From 4ce771dcf30e973eedb262b05ce3f442c13771aa Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 24 Jun 2016 01:08:22 +0100 Subject: [PATCH] Bed --- etc/dbs/rent.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/etc/dbs/rent.php b/etc/dbs/rent.php index 9d2c81e3..6c890e71 100644 --- a/etc/dbs/rent.php +++ b/etc/dbs/rent.php @@ -4,7 +4,7 @@ #die(print_r(pathinfo('~/.gitconfig'),true)); #die(file_exists(realpath('~/.gitconfig')) ? 'yes' : 'no'); $CONF['_rent'] = array( - 'Title' => 'Rent', + 'title' => 'Rent', 'notice' => 'Micro foncier 4BE', 'default_table' => 'rent', @@ -63,14 +63,21 @@ $CONF['rent'] = array ( 'order' => 5, 'pdo' => 'sqlite:/opt/rent/rent.db', '_import' => '_rent', + 'title' => 'DEV '.$CONF['_rent']['title'] ); +0 && bye([ + fileowner(!empty($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : __FILE__), +]); return 1; function untilde($path) { if (!function_exists('posix_getuid')) return $path; return preg_replace_callback('/^(~)(\w+)?/',function($m){ - if (!empty($m[2])) return str_replace($m[2],posix_getpwnam('nico')['dir'],$m[0]); + + $uid = fileowner(!empty($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : __FILE__); + if (!empty($m[2])) return str_replace($m[2],posix_getpwnam($uid)['dir'],$m[0]); + return str_replace($m[1],posix_getpwuid(posix_getuid())['dir'],$m[0]); },$path); } -- 2.47.3