diff options
author | Felix Moeller <mail@felixmoeller.de> | 2012-10-28 18:12:31 +0100 |
---|---|---|
committer | Felix Moeller <mail@felixmoeller.de> | 2012-10-28 18:12:31 +0100 |
commit | b7a02f0c93c2ad8d4bce3b05e8607712810d54b7 (patch) | |
tree | fa5a4850647e2f7e1120286b63f5611755b4f5ca /lib/util.php | |
parent | 2248fe9f3e23cbe342a5609119b5424448eb19b8 (diff) | |
download | nextcloud-server-b7a02f0c93c2ad8d4bce3b05e8607712810d54b7.tar.gz nextcloud-server-b7a02f0c93c2ad8d4bce3b05e8607712810d54b7.zip |
NoSpaceAfterComma
first in new branch
Diffstat (limited to 'lib/util.php')
-rwxr-xr-x | lib/util.php | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/lib/util.php b/lib/util.php index 69f29f12228..789c75f4154 100755 --- a/lib/util.php +++ b/lib/util.php @@ -39,7 +39,7 @@ class OC_Util { $CONFIG_DATADIRECTORY = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ); //first set up the local "root" storage if(!self::$rootMounted) { - OC_Filesystem::mount('OC_Filestorage_Local', array('datadir'=>$CONFIG_DATADIRECTORY),'/'); + OC_Filesystem::mount('OC_Filestorage_Local', array('datadir'=>$CONFIG_DATADIRECTORY), '/'); self::$rootMounted=true; } @@ -81,10 +81,10 @@ class OC_Util { } $mtime=filemtime($user_root.'/mount.php'); - $previousMTime=OC_Preferences::getValue($user,'files','mountconfigmtime',0); + $previousMTime=OC_Preferences::getValue($user, 'files', 'mountconfigmtime', 0); if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated OC_FileCache::triggerUpdate($user); - OC_Preferences::setValue($user,'files','mountconfigmtime',$mtime); + OC_Preferences::setValue($user, 'files', 'mountconfigmtime', $mtime); } } } @@ -169,7 +169,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(date('O')); - $systemTimeZone=(round($systemTimeZone/100,0)*60)+($systemTimeZone%100); + $systemTimeZone=(round($systemTimeZone/100, 0)*60)+($systemTimeZone%100); $clientTimeZone=$_SESSION['timezone']*60; $offset=$clientTimeZone-$systemTimeZone; $timestamp=$timestamp+$offset*60; @@ -196,11 +196,11 @@ class OC_Util { if($pagestop>$pagecount) $pagestop=$pagecount; $tmpl = new OC_Template( '', 'part.pagenavi', '' ); - $tmpl->assign('page',$page); - $tmpl->assign('pagecount',$pagecount); - $tmpl->assign('pagestart',$pagestart); - $tmpl->assign('pagestop',$pagestop); - $tmpl->assign('url',$url); + $tmpl->assign('page', $page); + $tmpl->assign('pagecount', $pagecount); + $tmpl->assign('pagestart', $pagestart); + $tmpl->assign('pagestop', $pagestop); + $tmpl->assign('url', $url); return $tmpl; } } @@ -241,24 +241,24 @@ class OC_Util { //check for correct file permissions if(!stristr(PHP_OS, 'WIN')) { $permissionsModHint="Please change the permissions to 0770 so that the directory cannot be listed by other users."; - $prems=substr(decoct(@fileperms($CONFIG_DATADIRECTORY)),-3); - if(substr($prems,-1)!='0') { - OC_Helper::chmodr($CONFIG_DATADIRECTORY,0770); + $prems=substr(decoct(@fileperms($CONFIG_DATADIRECTORY)), -3); + if(substr($prems, -1)!='0') { + OC_Helper::chmodr($CONFIG_DATADIRECTORY, 0770); clearstatcache(); - $prems=substr(decoct(@fileperms($CONFIG_DATADIRECTORY)),-3); - if(substr($prems,2,1)!='0') { - $errors[]=array('error'=>'Data directory ('.$CONFIG_DATADIRECTORY.') is readable for other users<br/>','hint'=>$permissionsModHint); + $prems=substr(decoct(@fileperms($CONFIG_DATADIRECTORY)), -3); + if(substr($prems, 2, 1)!='0') { + $errors[]=array('error'=>'Data directory ('.$CONFIG_DATADIRECTORY.') is readable for other users<br/>', 'hint'=>$permissionsModHint); } } if( OC_Config::getValue( "enablebackup", false )) { $CONFIG_BACKUPDIRECTORY = OC_Config::getValue( "backupdirectory", OC::$SERVERROOT."/backup" ); - $prems=substr(decoct(@fileperms($CONFIG_BACKUPDIRECTORY)),-3); - if(substr($prems,-1)!='0') { - OC_Helper::chmodr($CONFIG_BACKUPDIRECTORY,0770); + $prems=substr(decoct(@fileperms($CONFIG_BACKUPDIRECTORY)), -3); + if(substr($prems, -1)!='0') { + OC_Helper::chmodr($CONFIG_BACKUPDIRECTORY, 0770); clearstatcache(); - $prems=substr(decoct(@fileperms($CONFIG_BACKUPDIRECTORY)),-3); - if(substr($prems,2,1)!='0') { - $errors[]=array('error'=>'Data directory ('.$CONFIG_BACKUPDIRECTORY.') is readable for other users<br/>','hint'=>$permissionsModHint); + $prems=substr(decoct(@fileperms($CONFIG_BACKUPDIRECTORY)), -3); + if(substr($prems, 2, 1)!='0') { + $errors[]=array('error'=>'Data directory ('.$CONFIG_BACKUPDIRECTORY.') is readable for other users<br/>', 'hint'=>$permissionsModHint); } } } @@ -391,7 +391,7 @@ class OC_Util { // Check if we are a user self::checkLoggedIn(); self::verifyUser(); - if(OC_Group::inGroup(OC_User::getUser(),'admin')) { + if(OC_Group::inGroup(OC_User::getUser(), 'admin')) { return true; } if(!OC_SubAdmin::isSubAdmin(OC_User::getUser())) { @@ -467,7 +467,7 @@ class OC_Util { $id=OC_Config::getValue('instanceid', null); if(is_null($id)) { $id=uniqid(); - OC_Config::setValue('instanceid',$id); + OC_Config::setValue('instanceid', $id); } return $id; } @@ -504,10 +504,10 @@ class OC_Util { // cleanup old tokens garbage collector // only run every 20th time so we don't waste cpu cycles - if(rand(0,20)==0) { + if(rand(0, 20)==0) { foreach($_SESSION as $key=>$value) { // search all tokens in the session - if(substr($key,0,12)=='requesttoken') { + if(substr($key, 0, 12)=='requesttoken') { // check if static lifespan has expired if($value+self::$callLifespan<time()) { // remove outdated tokens @@ -571,7 +571,7 @@ class OC_Util { * @return array with sanitized strings or a single sanitized string, depends on the input parameter. */ public static function sanitizeHTML( &$value ) { - if (is_array($value) || is_object($value)) array_walk_recursive($value,'OC_Util::sanitizeHTML'); + if (is_array($value) || is_object($value)) array_walk_recursive($value, 'OC_Util::sanitizeHTML'); else $value = htmlentities($value, ENT_QUOTES, 'UTF-8'); //Specify encoding for PHP<5.4 return $value; } |