diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/MDB2/Driver/Reverse/sqlite3.php | 2 | ||||
-rw-r--r-- | lib/MDB2/Driver/sqlite3.php | 3 | ||||
-rw-r--r-- | lib/archive/tar.php | 3 | ||||
-rw-r--r-- | lib/backgroundjob.php | 2 | ||||
-rw-r--r-- | lib/base.php | 10 | ||||
-rw-r--r-- | lib/connector/sabre/quotaplugin.php | 16 | ||||
-rw-r--r-- | lib/fileproxy/quota.php | 4 | ||||
-rw-r--r-- | lib/filestorage/local.php | 8 | ||||
-rw-r--r-- | lib/filesystem.php | 86 | ||||
-rw-r--r-- | lib/installer.php | 8 | ||||
-rw-r--r-- | lib/log.php | 2 | ||||
-rw-r--r-- | lib/migrate.php | 2 | ||||
-rw-r--r-- | lib/migration/content.php | 2 | ||||
-rw-r--r-- | lib/ocsclient.php | 6 | ||||
-rw-r--r-- | lib/public/backgroundjob.php | 2 | ||||
-rw-r--r-- | lib/public/share.php | 2 | ||||
-rw-r--r-- | lib/public/util.php | 2 | ||||
-rw-r--r-- | lib/template.php | 2 | ||||
-rw-r--r-- | lib/user.php | 2 | ||||
-rwxr-xr-x | lib/util.php | 2 |
20 files changed, 81 insertions, 85 deletions
diff --git a/lib/MDB2/Driver/Reverse/sqlite3.php b/lib/MDB2/Driver/Reverse/sqlite3.php index 36626478ce8..97037809549 100644 --- a/lib/MDB2/Driver/Reverse/sqlite3.php +++ b/lib/MDB2/Driver/Reverse/sqlite3.php @@ -476,7 +476,7 @@ class MDB2_Driver_Reverse_sqlite3 extends MDB2_Driver_Reverse_Common $definition['unique'] = true; $count = count($column_names); for ($i=0; $i<$count; ++$i) { - $column_name = strtok($column_names[$i]," "); + $column_name = strtok($column_names[$i], " "); $collation = strtok(" "); $definition['fields'][$column_name] = array( 'position' => $i+1 diff --git a/lib/MDB2/Driver/sqlite3.php b/lib/MDB2/Driver/sqlite3.php index bccb8cbbf01..fa4c91c1269 100644 --- a/lib/MDB2/Driver/sqlite3.php +++ b/lib/MDB2/Driver/sqlite3.php @@ -397,8 +397,7 @@ class MDB2_Driver_sqlite3 extends MDB2_Driver_Common } if ($this->fix_assoc_fields_names || - $this->options['portability'] & MDB2_PORTABILITY_FIX_ASSOC_FIELD_NAMES) - { + $this->options['portability'] & MDB2_PORTABILITY_FIX_ASSOC_FIELD_NAMES) { $this->connection->exec("PRAGMA short_column_names = 1"); $this->fix_assoc_fields_names = true; } diff --git a/lib/archive/tar.php b/lib/archive/tar.php index 6c264686991..0fa633c6038 100644 --- a/lib/archive/tar.php +++ b/lib/archive/tar.php @@ -130,8 +130,7 @@ class OC_Archive_TAR extends OC_Archive{ if( $file == $header['filename'] or $file.'/' == $header['filename'] or '/'.$file.'/' == $header['filename'] - or '/'.$file == $header['filename']) - { + or '/'.$file == $header['filename']) { return $header; } } diff --git a/lib/backgroundjob.php b/lib/backgroundjob.php index f486519bf09..28b5ce3af20 100644 --- a/lib/backgroundjob.php +++ b/lib/backgroundjob.php @@ -40,7 +40,7 @@ class OC_BackgroundJob{ * @param $type execution type * @return boolean * - * This method sets the execution type of the background jobs. Possible types + * This method sets the execution type of the background jobs. Possible types * are "none", "ajax", "webcron", "cron" */ public static function setExecutionType( $type ) { diff --git a/lib/base.php b/lib/base.php index f494716bd87..d4eeac82daa 100644 --- a/lib/base.php +++ b/lib/base.php @@ -524,8 +524,7 @@ class OC{ } $file_ext = substr($param['file'], -3); if ($file_ext != 'php' - || !self::loadAppScriptFile($param)) - { + || !self::loadAppScriptFile($param)) { header('HTTP/1.0 404 Not Found'); } } @@ -595,8 +594,7 @@ class OC{ if(!isset($_COOKIE["oc_remember_login"]) || !isset($_COOKIE["oc_token"]) || !isset($_COOKIE["oc_username"]) - || !$_COOKIE["oc_remember_login"]) - { + || !$_COOKIE["oc_remember_login"]) { return false; } OC_App::loadApps(array('authentication')); @@ -621,9 +619,9 @@ class OC{ OC_Util::redirectToDefaultPage(); // doesn't return } - // if you reach this point you have changed your password + // if you reach this point you have changed your password // or you are an attacker - // we can not delete tokens here because users may reach + // we can not delete tokens here because users may reach // this point multiple times after a password change OC_Log::write('core', 'Authentication cookie rejected for user '.$_COOKIE['oc_username'], OC_Log::WARN); } diff --git a/lib/connector/sabre/quotaplugin.php b/lib/connector/sabre/quotaplugin.php index 5b8ef941710..a56a65ad863 100644 --- a/lib/connector/sabre/quotaplugin.php +++ b/lib/connector/sabre/quotaplugin.php @@ -2,7 +2,7 @@ /** * This plugin check user quota and deny creating files when they exceeds the quota. - * + * * @copyright Copyright (C) 2012 entreCables S.L. All rights reserved. * @author Sergio Cambra * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License @@ -10,9 +10,9 @@ class OC_Connector_Sabre_QuotaPlugin extends Sabre_DAV_ServerPlugin { /** - * Reference to main server object - * - * @var Sabre_DAV_Server + * Reference to main server object + * + * @var Sabre_DAV_Server */ private $server; @@ -23,8 +23,8 @@ class OC_Connector_Sabre_QuotaPlugin extends Sabre_DAV_ServerPlugin { * addPlugin is called. * * This method should set up the requires event subscriptions. - * - * @param Sabre_DAV_Server $server + * + * @param Sabre_DAV_Server $server * @return void */ public function initialize(Sabre_DAV_Server $server) { @@ -37,10 +37,10 @@ class OC_Connector_Sabre_QuotaPlugin extends Sabre_DAV_ServerPlugin { /** * This method is called before any HTTP method and forces users to be authenticated - * + * * @param string $method * @throws Sabre_DAV_Exception - * @return bool + * @return bool */ public function checkQuota($uri, $data = null) { $expected = $this->server->httpRequest->getHeader('X-Expected-Entity-Length'); diff --git a/lib/fileproxy/quota.php b/lib/fileproxy/quota.php index 81376fb6fca..46bc8dc16d8 100644 --- a/lib/fileproxy/quota.php +++ b/lib/fileproxy/quota.php @@ -38,9 +38,9 @@ class OC_FileProxy_Quota extends OC_FileProxy{ if(in_array($user, $this->userQuota)) { return $this->userQuota[$user]; } - $userQuota=OC_Preferences::getValue($user,'files','quota', 'default'); + $userQuota=OC_Preferences::getValue($user, 'files', 'quota', 'default'); if($userQuota=='default') { - $userQuota=OC_AppConfig::getValue('files','default_quota', 'none'); + $userQuota=OC_AppConfig::getValue('files', 'default_quota', 'none'); } if($userQuota=='none') { $this->userQuota[$user]=0; diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php index 2dde0093d4b..6fe45acf8c5 100644 --- a/lib/filestorage/local.php +++ b/lib/filestorage/local.php @@ -6,7 +6,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{ protected $datadir; public function __construct($arguments) { $this->datadir=$arguments['datadir']; - if(substr($this->datadir,-1)!=='/') { + if(substr($this->datadir, -1)!=='/') { $this->datadir.='/'; } } @@ -20,7 +20,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{ return opendir($this->datadir.$path); } public function is_dir($path) { - if(substr($path,-1)=='/') { + if(substr($path, -1)=='/') { $path=substr($path, 0, -1); } return is_dir($this->datadir.$path); @@ -86,11 +86,11 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{ } public function rename($path1, $path2) { if (!$this->isUpdatable($path1)) { - OC_Log::write('core','unable to rename, file is not writable : '.$path1, OC_Log::ERROR); + OC_Log::write('core', 'unable to rename, file is not writable : '.$path1, OC_Log::ERROR); return false; } if(! $this->file_exists($path1)) { - OC_Log::write('core','unable to rename, file does not exists : '.$path1, OC_Log::ERROR); + OC_Log::write('core', 'unable to rename, file does not exists : '.$path1, OC_Log::ERROR); return false; } diff --git a/lib/filesystem.php b/lib/filesystem.php index aeafb149395..4635f8b4f30 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -209,48 +209,48 @@ class OC_Filesystem{ } static private function loadSystemMountPoints($user) { - if(is_file(OC::$SERVERROOT.'/config/mount.php')) {
- $mountConfig=include OC::$SERVERROOT.'/config/mount.php';
- if(isset($mountConfig['global'])) {
- foreach($mountConfig['global'] as $mountPoint=>$options) {
- self::mount($options['class'], $options['options'], $mountPoint);
- }
- }
-
- if(isset($mountConfig['group'])) {
- foreach($mountConfig['group'] as $group=>$mounts) {
- if(OC_Group::inGroup($user, $group)) {
- foreach($mounts as $mountPoint=>$options) {
- $mountPoint=self::setUserVars($mountPoint, $user);
- foreach($options as &$option) {
- $option=self::setUserVars($option, $user);
- }
- self::mount($options['class'], $options['options'], $mountPoint);
- }
- }
- }
- }
-
- if(isset($mountConfig['user'])) {
- foreach($mountConfig['user'] as $user=>$mounts) {
- if($user==='all' or strtolower($user)===strtolower($user)) {
- foreach($mounts as $mountPoint=>$options) {
- $mountPoint=self::setUserVars($mountPoint, $user);
- foreach($options as &$option) {
- $option=self::setUserVars($option, $user);
- }
- self::mount($options['class'], $options['options'], $mountPoint);
- }
- }
- }
- }
-
- $mtime=filemtime(OC::$SERVERROOT.'/config/mount.php');
- $previousMTime=OC_Appconfig::getValue('files','mountconfigmtime', 0);
- if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated
- OC_FileCache::triggerUpdate();
- OC_Appconfig::setValue('files', 'mountconfigmtime', $mtime);
- }
+ if(is_file(OC::$SERVERROOT.'/config/mount.php')) { + $mountConfig=include OC::$SERVERROOT.'/config/mount.php'; + if(isset($mountConfig['global'])) { + foreach($mountConfig['global'] as $mountPoint=>$options) { + self::mount($options['class'], $options['options'], $mountPoint); + } + } + + if(isset($mountConfig['group'])) { + foreach($mountConfig['group'] as $group=>$mounts) { + if(OC_Group::inGroup($user, $group)) { + foreach($mounts as $mountPoint=>$options) { + $mountPoint=self::setUserVars($mountPoint, $user); + foreach($options as &$option) { + $option=self::setUserVars($option, $user); + } + self::mount($options['class'], $options['options'], $mountPoint); + } + } + } + } + + if(isset($mountConfig['user'])) { + foreach($mountConfig['user'] as $user=>$mounts) { + if($user==='all' or strtolower($user)===strtolower($user)) { + foreach($mounts as $mountPoint=>$options) { + $mountPoint=self::setUserVars($mountPoint, $user); + foreach($options as &$option) { + $option=self::setUserVars($option, $user); + } + self::mount($options['class'], $options['options'], $mountPoint); + } + } + } + } + + $mtime=filemtime(OC::$SERVERROOT.'/config/mount.php'); + $previousMTime=OC_Appconfig::getValue('files', 'mountconfigmtime', 0); + if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated + OC_FileCache::triggerUpdate(); + OC_Appconfig::setValue('files', 'mountconfigmtime', $mtime); + } } } @@ -312,7 +312,7 @@ class OC_Filesystem{ return false; } }else{ - OC_Log::write('core','storage backend '.$class.' not found', OC_Log::ERROR); + OC_Log::write('core', 'storage backend '.$class.' not found', OC_Log::ERROR); return false; } } diff --git a/lib/installer.php b/lib/installer.php index 266c07d5c2b..7dc8b0cef8d 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -57,7 +57,7 @@ class OC_Installer{ */ public static function installApp( $data = array()) { if(!isset($data['source'])) { - OC_Log::write('core','No source specified when installing app', OC_Log::ERROR); + OC_Log::write('core', 'No source specified when installing app', OC_Log::ERROR); return false; } @@ -65,13 +65,13 @@ class OC_Installer{ if($data['source']=='http') { $path=OC_Helper::tmpFile(); if(!isset($data['href'])) { - OC_Log::write('core','No href specified when installing app from http', OC_Log::ERROR); + OC_Log::write('core', 'No href specified when installing app from http', OC_Log::ERROR); return false; } copy($data['href'], $path); }else{ if(!isset($data['path'])) { - OC_Log::write('core','No path specified when installing app from local file', OC_Log::ERROR); + OC_Log::write('core', 'No path specified when installing app from local file', OC_Log::ERROR); return false; } $path=$data['path']; @@ -86,7 +86,7 @@ class OC_Installer{ rename($path, $path.'.tgz'); $path.='.tgz'; }else{ - OC_Log::write('core','Archives of type '.$mime.' are not supported', OC_Log::ERROR); + OC_Log::write('core', 'Archives of type '.$mime.' are not supported', OC_Log::ERROR); return false; } diff --git a/lib/log.php b/lib/log.php index b5e8e1b06a1..e9cededa5c0 100644 --- a/lib/log.php +++ b/lib/log.php @@ -47,7 +47,7 @@ class OC_Log { //ob_end_clean(); self::write('PHP', $error['message'] . ' at ' . $error['file'] . '#' . $error['line'], self::FATAL); } else { - return true; + return true; } } diff --git a/lib/migrate.php b/lib/migrate.php index 616417a2271..96f5a0001f7 100644 --- a/lib/migrate.php +++ b/lib/migrate.php @@ -611,7 +611,7 @@ class OC_Migrate{ if( file_exists( $db ) ) { // Connect to the db if(!self::connectDB( $db )) { - OC_Log::write('migration','Failed to connect to migration.db', OC_Log::ERROR); + OC_Log::write('migration', 'Failed to connect to migration.db', OC_Log::ERROR); return false; } } else { diff --git a/lib/migration/content.php b/lib/migration/content.php index 54982b3c847..00df62f0c7f 100644 --- a/lib/migration/content.php +++ b/lib/migration/content.php @@ -205,7 +205,7 @@ class OC_Migration_Content{ } closedir($dirhandle); } else { - OC_Log::write('admin_export',"Was not able to open directory: " . $dir, OC_Log::ERROR); + OC_Log::write('admin_export', "Was not able to open directory: " . $dir, OC_Log::ERROR); return false; } return true; diff --git a/lib/ocsclient.php b/lib/ocsclient.php index ceeb78570fd..b6b5ad8f0a9 100644 --- a/lib/ocsclient.php +++ b/lib/ocsclient.php @@ -162,7 +162,7 @@ class OC_OCSClient{ $xml=OC_OCSClient::getOCSresponse($url); if($xml==false) { - OC_Log::write('core','Unable to parse OCS content', OC_Log::FATAL); + OC_Log::write('core', 'Unable to parse OCS content', OC_Log::FATAL); return null; } $data=simplexml_load_string($xml); @@ -200,7 +200,7 @@ class OC_OCSClient{ $xml=OC_OCSClient::getOCSresponse($url); if($xml==false) { - OC_Log::write('core','Unable to parse OCS content', OC_Log::FATAL); + OC_Log::write('core', 'Unable to parse OCS content', OC_Log::FATAL); return null; } $data=simplexml_load_string($xml); @@ -238,7 +238,7 @@ class OC_OCSClient{ $xml=OC_OCSClient::getOCSresponse($url); if($xml==false) { - OC_Log::write('core','Unable to parse knowledgebase content', OC_Log::FATAL); + OC_Log::write('core', 'Unable to parse knowledgebase content', OC_Log::FATAL); return null; } $data=simplexml_load_string($xml); diff --git a/lib/public/backgroundjob.php b/lib/public/backgroundjob.php index 24a17836f7f..601046fe691 100644 --- a/lib/public/backgroundjob.php +++ b/lib/public/backgroundjob.php @@ -62,7 +62,7 @@ class BackgroundJob { * @param $type execution type * @return boolean * - * This method sets the execution type of the background jobs. Possible types + * This method sets the execution type of the background jobs. Possible types * are "none", "ajax", "webcron", "cron" */ public static function setExecutionType( $type ) { diff --git a/lib/public/share.php b/lib/public/share.php index da1c0616390..071304ec249 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -28,7 +28,7 @@ namespace OCP; /** * This class provides the ability for apps to share their content between users. * Apps must create a backend class that implements OCP\Share_Backend and register it with this class. -* +* * It provides the following hooks: * - post_shared */ diff --git a/lib/public/util.php b/lib/public/util.php index 6ce79715b6f..7b5b1abbded 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -61,7 +61,7 @@ class Util { */ public static function sendMail( $toaddress, $toname, $subject, $mailtext, $fromaddress, $fromname, $html=0, $altbody='', $ccaddress='', $ccname='', $bcc='') { // call the internal mail class - \OC_MAIL::send( $toaddress, $toname, $subject, $mailtext, $fromaddress, $fromname, $html=0, $altbody='', $ccaddress='', $ccname='', $bcc=''); + \OC_MAIL::send($toaddress, $toname, $subject, $mailtext, $fromaddress, $fromname, $html = 0, $altbody = '', $ccaddress = '', $ccname = '', $bcc = ''); } /** diff --git a/lib/template.php b/lib/template.php index efcc6e82c4c..3d3589abd1e 100644 --- a/lib/template.php +++ b/lib/template.php @@ -199,7 +199,7 @@ class OC_Template{ $mode='tablet'; }elseif(stripos($_SERVER['HTTP_USER_AGENT'], 'iphone')>0) { $mode='mobile'; - }elseif((stripos($_SERVER['HTTP_USER_AGENT'],'N9')>0) and (stripos($_SERVER['HTTP_USER_AGENT'], 'nokia')>0)) { + }elseif((stripos($_SERVER['HTTP_USER_AGENT'], 'N9')>0) and (stripos($_SERVER['HTTP_USER_AGENT'], 'nokia')>0)) { $mode='mobile'; }else{ $mode='default'; diff --git a/lib/user.php b/lib/user.php index be0e525d868..801ab7f608d 100644 --- a/lib/user.php +++ b/lib/user.php @@ -133,7 +133,7 @@ class OC_User { self::useBackend($backend); $_setupedBackends[]=$i; }else{ - OC_Log::write('core','User backend '.$class.' not found.', OC_Log::ERROR); + OC_Log::write('core', 'User backend '.$class.' not found.', OC_Log::ERROR); } } } diff --git a/lib/util.php b/lib/util.php index d16424ce4e1..40b44bf9d6e 100755 --- a/lib/util.php +++ b/lib/util.php @@ -559,7 +559,7 @@ class OC_Util { // creating a test file $testfile = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ).'/'.$filename; - if(file_exists($testfile)){// already running this test, possible recursive call + if(file_exists($testfile)) {// already running this test, possible recursive call return false; } |