diff options
author | Brice Maron <brice@bmaron.net> | 2011-10-17 21:42:38 +0200 |
---|---|---|
committer | Brice Maron <brice@bmaron.net> | 2011-10-17 21:42:38 +0200 |
commit | ebd36d56caec3f665f750ac934a533df57074112 (patch) | |
tree | 9debdfb428b6882c24e083f31d81c8f1e7e559f8 /lib | |
parent | 7358d9ebb47027340ce97192eb6c86592117d3f3 (diff) | |
download | nextcloud-server-ebd36d56caec3f665f750ac934a533df57074112.tar.gz nextcloud-server-ebd36d56caec3f665f750ac934a533df57074112.zip |
Remove unnecessary exec for getting timezone and fix spacings
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/util.php b/lib/util.php index 0f8cc08fce6..6f3b7e3428a 100644 --- a/lib/util.php +++ b/lib/util.php @@ -153,7 +153,7 @@ class OC_Util { */ public static function formatDate( $timestamp,$dateOnly=false){ if(isset($_SESSION['timezone'])){//adjust to clients timezone if we know it - $systemTimeZone = intval(exec('date +%z')); + $systemTimeZone = intval(date('O')); $systemTimeZone=(round($systemTimeZone/100,0)*60)+($systemTimeZone%100); $clientTimeZone=$_SESSION['timezone']*60; $offset=$clientTimeZone-$systemTimeZone; @@ -270,17 +270,17 @@ class OC_Util { /** * Try to get the username the httpd server runs on, used in hints */ - public static function checkWebserverUser(){ + public static function checkWebserverUser(){ if(is_callable('posix_getuid')){ $serverUser=posix_getpwuid(posix_getuid()); $serverUser='\''.$serverUser['name'].'\''; }elseif(exec('whoami')){ - $serverUser=exec('whoami'); - }else{ + $serverUser=exec('whoami'); + }else{ $serverUser='\'www-data\' for ubuntu/debian'; //TODO: try to detect the distro and give a guess based on that } - return $serverUser; - } + return $serverUser; + } /** |