diff options
Diffstat (limited to 'apps')
32 files changed, 78 insertions, 78 deletions
diff --git a/apps/files/ajax/autocomplete.php b/apps/files/ajax/autocomplete.php index fae38368a85..b32ba7c3d5b 100644 --- a/apps/files/ajax/autocomplete.php +++ b/apps/files/ajax/autocomplete.php @@ -44,7 +44,7 @@ if(OC_Filesystem::file_exists($base) and OC_Filesystem::is_dir($base)) { if(substr(strtolower($file), 0, $queryLen)==$query) { $item=$base.$file; if((!$dirOnly or OC_Filesystem::is_dir($item))) { - $files[]=(object)array('id'=>$item,'label'=>$item,'name'=>$item); + $files[]=(object)array('id'=>$item, 'label'=>$item, 'name'=>$item); } } } diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index 7a69154677f..4ed0bbc5b0f 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -51,7 +51,7 @@ if(strpos($dir, '..') === false) { if(is_uploaded_file($files['tmp_name'][$i]) and OC_Filesystem::fromTmpFile($files['tmp_name'][$i], $target)) { $meta = OC_FileCache::get($target); $id = OC_FileCache::getId($target); - $result[]=array( "status" => "success", 'mime'=>$meta['mimetype'],'size'=>$meta['size'], 'id'=>$id, 'name'=>basename($target)); + $result[]=array( "status" => "success", 'mime'=>$meta['mimetype'], 'size'=>$meta['size'], 'id'=>$id, 'name'=>basename($target)); } } OCP\JSON::encodedPrint($result); diff --git a/apps/files/appinfo/filesync.php b/apps/files/appinfo/filesync.php index dfafe3f9561..0e368cb0f42 100644 --- a/apps/files/appinfo/filesync.php +++ b/apps/files/appinfo/filesync.php @@ -21,7 +21,7 @@ */ // load needed apps -$RUNTIME_APPTYPES=array('filesystem','authentication','logging'); +$RUNTIME_APPTYPES=array('filesystem', 'authentication', 'logging'); OC_App::loadApps($RUNTIME_APPTYPES); if(!OC_User::isLoggedIn()) { if(!isset($_SERVER['PHP_AUTH_USER'])) { @@ -36,7 +36,7 @@ if(!OC_User::isLoggedIn()) { } } -list($type,$file) = explode('/', substr($path_info, 1+strlen($service)+1), 2); +list($type, $file) = explode('/', substr($path_info, 1+strlen($service)+1), 2); if ($type != 'oc_chunked') { OC_Response::setStatus(OC_Response::STATUS_NOT_FOUND); diff --git a/apps/files/appinfo/remote.php b/apps/files/appinfo/remote.php index f12430f24dd..400a978fb17 100644 --- a/apps/files/appinfo/remote.php +++ b/apps/files/appinfo/remote.php @@ -23,7 +23,7 @@ * */ // load needed apps -$RUNTIME_APPTYPES=array('filesystem','authentication','logging'); +$RUNTIME_APPTYPES=array('filesystem', 'authentication', 'logging'); OC_App::loadApps($RUNTIME_APPTYPES); diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php index 3c63ad3c7ce..738864d7cff 100644 --- a/apps/files/appinfo/update.php +++ b/apps/files/appinfo/update.php @@ -39,7 +39,7 @@ foreach($filesToRemove as $file) { $success = OCP\Files::rmdirr($filepath); if($success === false) { //probably not sufficient privileges, give up and give a message. - OCP\Util::writeLog('files','Could not clean /files/ directory. Please remove everything except webdav.php from ' . OC::$SERVERROOT . '/files/', OCP\Util::ERROR); + OCP\Util::writeLog('files', 'Could not clean /files/ directory. Please remove everything except webdav.php from ' . OC::$SERVERROOT . '/files/', OCP\Util::ERROR); break; } } diff --git a/apps/files/index.php b/apps/files/index.php index 51fe6b0379c..c46ec59d03c 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -67,7 +67,7 @@ $breadcrumb = array(); $pathtohere = ''; foreach( explode( '/', $dir ) as $i ) { if( $i != '' ) { - $pathtohere .= '/'.str_replace('+','%20', urlencode($i)); + $pathtohere .= '/'.str_replace('+', '%20', urlencode($i)); $breadcrumb[] = array( 'dir' => $pathtohere, 'name' => $i ); } } diff --git a/apps/files/templates/admin.php b/apps/files/templates/admin.php index 5869ed21072..a60a1cebaf9 100644 --- a/apps/files/templates/admin.php +++ b/apps/files/templates/admin.php @@ -1,4 +1,4 @@ -<?php OCP\Util::addscript('files','admin'); ?> +<?php OCP\Util::addscript('files', 'admin'); ?> <form name="filesForm" action='#' method='post'> <fieldset class="personalblock"> diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 7cdff024ddf..e2640c1113c 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -8,7 +8,7 @@ <ul class="popup popupTop"> <li style="background-image:url('<?php echo OCP\mimetype_icon('text/plain') ?>')" data-type='file'><p><?php echo $l->t('Text file');?></p></li> <li style="background-image:url('<?php echo OCP\mimetype_icon('dir') ?>')" data-type='folder'><p><?php echo $l->t('Folder');?></p></li> - <li style="background-image:url('<?php echo OCP\image_path('core','actions/public.png') ?>')" data-type='web'><p><?php echo $l->t('From link');?></p></li> + <li style="background-image:url('<?php echo OCP\image_path('core', 'actions/public.png') ?>')" data-type='web'><p><?php echo $l->t('From link');?></p></li> </ul> </div> <div class="file_upload_wrapper svg"> diff --git a/apps/files/templates/part.breadcrumb.php b/apps/files/templates/part.breadcrumb.php index 71b695f65f8..ead9ab1ed7d 100644 --- a/apps/files/templates/part.breadcrumb.php +++ b/apps/files/templates/part.breadcrumb.php @@ -1,6 +1,6 @@ <?php for($i=0; $i<count($_["breadcrumb"]); $i++): $crumb = $_["breadcrumb"][$i]; ?> - <div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo urlencode($crumb["dir"]);?>' style='background-image:url("<?php echo OCP\image_path('core','breadcrumb.png');?>")'> + <div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo urlencode($crumb["dir"]);?>' style='background-image:url("<?php echo OCP\image_path('core', 'breadcrumb.png');?>")'> <a href="<?php echo $_['baseURL'].urlencode($crumb["dir"]); ?>"><?php echo OCP\Util::sanitizeHTML($crumb["name"]); ?></a> </div> <?php endfor;?> diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php index aaf9c5f57ee..4b5ac325672 100644 --- a/apps/files/templates/part.list.php +++ b/apps/files/templates/part.list.php @@ -14,10 +14,10 @@ $relative_modified_date = OCP\relative_modified_date($file['mtime']); $relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14 if($relative_date_color>200) $relative_date_color = 200; - $name = str_replace('+','%20', urlencode($file['name'])); - $name = str_replace('%2F','/', $name); - $directory = str_replace('+','%20', urlencode($file['directory'])); - $directory = str_replace('%2F','/', $directory); ?> + $name = str_replace('+', '%20', urlencode($file['name'])); + $name = str_replace('%2F', '/', $name); + $directory = str_replace('+', '%20', urlencode($file['directory'])); + $directory = str_replace('%2F', '/', $directory); ?> <tr data-id="<?php echo $file['id']; ?>" data-file="<?php echo $name;?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mimetype']?>" data-size='<?php echo $file['size'];?>' data-permissions='<?php echo $file['permissions']; ?>'> <td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo OCP\mimetype_icon('dir'); else echo OCP\mimetype_icon($file['mimetype']); ?>)"> <?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" /><?php } ?> diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php index bb130a366be..3f76e910a52 100644 --- a/apps/files_encryption/appinfo/app.php +++ b/apps/files_encryption/appinfo/app.php @@ -6,9 +6,9 @@ OC::$CLASSPATH['OC_FileProxy_Encryption'] = 'apps/files_encryption/lib/proxy.php OC_FileProxy::register(new OC_FileProxy_Encryption()); -OCP\Util::connectHook('OC_User','post_login','OC_Crypt','loginListener'); +OCP\Util::connectHook('OC_User', 'post_login', 'OC_Crypt', 'loginListener'); -stream_wrapper_register('crypt','OC_CryptStream'); +stream_wrapper_register('crypt', 'OC_CryptStream'); if(!isset($_SESSION['enckey']) and OCP\User::isLoggedIn()) {//force the user to re-loggin if the encryption key isn't unlocked (happens when a user is logged in before the encryption app is enabled) OCP\User::logout(); diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php index d8e7e4d1dd9..5ff3f578384 100644 --- a/apps/files_encryption/lib/crypt.php +++ b/apps/files_encryption/lib/crypt.php @@ -80,7 +80,7 @@ class OC_Crypt { } } - public static function createkey($username,$passcode) { + public static function createkey($username, $passcode) { // generate a random key $key=mt_rand(10000, 99999).mt_rand(10000, 99999).mt_rand(10000, 99999).mt_rand(10000, 99999); diff --git a/apps/files_encryption/lib/cryptstream.php b/apps/files_encryption/lib/cryptstream.php index 3170cff366c..8b05560050d 100644 --- a/apps/files_encryption/lib/cryptstream.php +++ b/apps/files_encryption/lib/cryptstream.php @@ -23,7 +23,7 @@ /** * transparently encrypted filestream * - * you can use it as wrapper around an existing stream by setting OC_CryptStream::$sourceStreams['foo']=array('path'=>$path,'stream'=>$stream) + * you can use it as wrapper around an existing stream by setting OC_CryptStream::$sourceStreams['foo']=array('path'=>$path, 'stream'=>$stream) * and then fopen('crypt://streams/foo'); */ @@ -123,11 +123,11 @@ class OC_CryptStream{ $data=substr($data, 8192); } } - $this->size=max($this->size,$currentPos+$length); + $this->size=max($this->size, $currentPos+$length); return $length; } - public function stream_set_option($option,$arg1,$arg2) { + public function stream_set_option($option, $arg1, $arg2) { switch($option) { case STREAM_OPTION_BLOCKING: stream_set_blocking($this->source, $arg1); diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index fed6acaf91b..cacf7d7920a 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -36,7 +36,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ */ private static function shouldEncrypt($path) { if(is_null(self::$enableEncryption)) { - self::$enableEncryption=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true'); + self::$enableEncryption=(OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true')=='true'); } if(!self::$enableEncryption) { return false; @@ -59,7 +59,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ * @return bool */ private static function isEncrypted($path) { - $metadata=OC_FileCache_Cached::get($path,''); + $metadata=OC_FileCache_Cached::get($path, ''); return isset($metadata['encrypted']) and (bool)$metadata['encrypted']; } @@ -68,14 +68,14 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ if (!is_resource($data)) {//stream put contents should have been converter to fopen $size=strlen($data); $data=OC_Crypt::blockEncrypt($data); - OC_FileCache::put($path, array('encrypted'=>true,'size'=>$size),''); + OC_FileCache::put($path, array('encrypted'=>true,'size'=>$size), ''); } } } - public function postFile_get_contents($path,$data) { + public function postFile_get_contents($path, $data) { if(self::isEncrypted($path)) { - $cached=OC_FileCache_Cached::get($path,''); + $cached=OC_FileCache_Cached::get($path, ''); $data=OC_Crypt::blockDecrypt($data, '', $cached['size']); } return $data; @@ -92,7 +92,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ }elseif(self::shouldEncrypt($path) and $meta['mode']!='r' and $meta['mode']!='rb') { if(OC_Filesystem::file_exists($path) and OC_Filesystem::filesize($path)>0) { //first encrypt the target file so we don't end up with a half encrypted file - OCP\Util::writeLog('files_encryption','Decrypting '.$path.' before writing',OCP\Util::DEBUG); + OCP\Util::writeLog('files_encryption','Decrypting '.$path.' before writing', OCP\Util::DEBUG); $tmp=fopen('php://temp'); OCP\Files::streamCopy($result, $tmp); fclose($result); @@ -106,14 +106,14 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ public function postGetMimeType($path, $mime) { if(self::isEncrypted($path)) { - $mime=OCP\Files::getMimeType('crypt://'.$path,'w'); + $mime=OCP\Files::getMimeType('crypt://'.$path, 'w'); } return $mime; } public function postStat($path, $data) { if(self::isEncrypted($path)) { - $cached=OC_FileCache_Cached::get($path,''); + $cached=OC_FileCache_Cached::get($path, ''); $data['size']=$cached['size']; } return $data; @@ -121,7 +121,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ public function postFileSize($path, $size) { if(self::isEncrypted($path)) { - $cached=OC_FileCache_Cached::get($path,''); + $cached=OC_FileCache_Cached::get($path, ''); return $cached['size']; }else{ return $size; diff --git a/apps/files_encryption/settings.php b/apps/files_encryption/settings.php index ab9324dee44..ae28b088cd6 100644 --- a/apps/files_encryption/settings.php +++ b/apps/files_encryption/settings.php @@ -8,11 +8,11 @@ $tmpl = new OCP\Template( 'files_encryption', 'settings'); $blackList=explode(',', OCP\Config::getAppValue('files_encryption', 'type_blacklist', 'jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg')); -$enabled=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true'); +$enabled=(OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true')=='true'); $tmpl->assign('blacklist', $blackList); $tmpl->assign('encryption_enabled', $enabled); -OCP\Util::addscript('files_encryption','settings'); -OCP\Util::addscript('core','multiselect'); +OCP\Util::addscript('files_encryption', 'settings'); +OCP\Util::addscript('core', 'multiselect'); return $tmpl->fetchPage(); diff --git a/apps/files_encryption/tests/encryption.php b/apps/files_encryption/tests/encryption.php index b714b00b8f2..0e119f55bea 100644 --- a/apps/files_encryption/tests/encryption.php +++ b/apps/files_encryption/tests/encryption.php @@ -17,7 +17,7 @@ class Test_Encryption extends UnitTestCase { $this->assertNotEqual($encrypted, $source); $this->assertEqual($decrypted, $source); - $chunk=substr($source,0, 8192); + $chunk=substr($source, 0, 8192); $encrypted=OC_Crypt::encrypt($chunk, $key); $this->assertEqual(strlen($chunk), strlen($encrypted)); $decrypted=OC_Crypt::decrypt($encrypted, $key); @@ -30,14 +30,14 @@ class Test_Encryption extends UnitTestCase { $this->assertEqual($decrypted, $source); $tmpFileEncrypted=OCP\Files::tmpFile(); - OC_Crypt::encryptfile($file,$tmpFileEncrypted, $key); + OC_Crypt::encryptfile($file, $tmpFileEncrypted, $key); $encrypted=file_get_contents($tmpFileEncrypted); $decrypted=OC_Crypt::blockDecrypt($encrypted, $key); $this->assertNotEqual($encrypted, $source); $this->assertEqual($decrypted, $source); $tmpFileDecrypted=OCP\Files::tmpFile(); - OC_Crypt::decryptfile($tmpFileEncrypted,$tmpFileDecrypted, $key); + OC_Crypt::decryptfile($tmpFileEncrypted, $tmpFileDecrypted, $key); $decrypted=file_get_contents($tmpFileDecrypted); $this->assertEqual($decrypted, $source); diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php index 25427ff4b97..1c800bbc5f6 100644 --- a/apps/files_encryption/tests/proxy.php +++ b/apps/files_encryption/tests/proxy.php @@ -13,8 +13,8 @@ class Test_CryptProxy extends UnitTestCase { public function setUp() { $user=OC_User::getUser(); - $this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption','true'); - OCP\Config::setAppValue('files_encryption','enable_encryption','true'); + $this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption', 'true'); + OCP\Config::setAppValue('files_encryption', 'enable_encryption', 'true'); $this->oldKey=isset($_SESSION['enckey'])?$_SESSION['enckey']:null; @@ -30,7 +30,7 @@ class Test_CryptProxy extends UnitTestCase { //set up temporary storage OC_Filesystem::clearMounts(); - OC_Filesystem::mount('OC_Filestorage_Temporary', array(),'/'); + OC_Filesystem::mount('OC_Filestorage_Temporary', array(), '/'); OC_Filesystem::init('/'.$user.'/files'); diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php index 2caebf912ed..67b5e98ae67 100644 --- a/apps/files_encryption/tests/stream.php +++ b/apps/files_encryption/tests/stream.php @@ -10,23 +10,23 @@ class Test_CryptStream extends UnitTestCase { private $tmpFiles=array(); function testStream() { - $stream=$this->getStream('test1','w', strlen('foobar')); - fwrite($stream,'foobar'); + $stream=$this->getStream('test1', 'w', strlen('foobar')); + fwrite($stream, 'foobar'); fclose($stream); - $stream=$this->getStream('test1','r', strlen('foobar')); + $stream=$this->getStream('test1', 'r', strlen('foobar')); $data=fread($stream, 6); fclose($stream); $this->assertEqual('foobar', $data); $file=OC::$SERVERROOT.'/3rdparty/MDB2.php'; - $source=fopen($file,'r'); + $source=fopen($file, 'r'); $target=$this->getStream('test2', 'w', 0); OCP\Files::streamCopy($source, $target); fclose($target); fclose($source); - $stream=$this->getStream('test2','r', filesize($file)); + $stream=$this->getStream('test2', 'r', filesize($file)); $data=stream_get_contents($stream); $original=file_get_contents($file); $this->assertEqual(strlen($original), strlen($data)); @@ -51,7 +51,7 @@ class Test_CryptStream extends UnitTestCase { $file=$this->tmpFiles[$id]; } $stream=fopen($file, $mode); - OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id,'stream'=>$stream,'size'=>$size); + OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id, 'stream'=>$stream, 'size'=>$size); return fopen('crypt://streams/'.$id, $mode); } @@ -59,11 +59,11 @@ class Test_CryptStream extends UnitTestCase { $file=__DIR__.'/binary'; $source=file_get_contents($file); - $stream=$this->getStream('test','w', strlen($source)); + $stream=$this->getStream('test', 'w', strlen($source)); fwrite($stream, $source); fclose($stream); - $stream=$this->getStream('test','r', strlen($source)); + $stream=$this->getStream('test', 'r', strlen($source)); $data=stream_get_contents($stream); fclose($stream); $this->assertEqual(strlen($data), strlen($source)); @@ -72,11 +72,11 @@ class Test_CryptStream extends UnitTestCase { $file=__DIR__.'/zeros'; $source=file_get_contents($file); - $stream=$this->getStream('test2','w', strlen($source)); + $stream=$this->getStream('test2', 'w', strlen($source)); fwrite($stream, $source); fclose($stream); - $stream=$this->getStream('test2','r', strlen($source)); + $stream=$this->getStream('test2', 'r', strlen($source)); $data=stream_get_contents($stream); fclose($stream); $this->assertEqual(strlen($data), strlen($source)); diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php index 8a67b31b20b..2fc2a3a1a37 100644 --- a/apps/files_external/lib/ftp.php +++ b/apps/files_external/lib/ftp.php @@ -53,7 +53,7 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{ case 'ab': //these are supported by the wrapper $context = stream_context_create(array('ftp' => array('overwrite' => true))); - return fopen($this->constructUrl($path),$mode, false, $context); + return fopen($this->constructUrl($path), $mode, false, $context); case 'r+': case 'w+': case 'wb+': @@ -63,13 +63,13 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{ case 'c': case 'c+': //emulate these - if(strrpos($path,'.')!==false) { - $ext=substr($path, strrpos($path,'.')); + if(strrpos($path, '.')!==false) { + $ext=substr($path, strrpos($path, '.')); }else{ $ext=''; } $tmpFile=OCP\Files::tmpFile($ext); - OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack'); + OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this, 'writeBack'); if($this->file_exists($path)) { $this->getFile($path, $tmpFile); } diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php index 32d57ed3cef..e5de81280ac 100644 --- a/apps/files_external/lib/google.php +++ b/apps/files_external/lib/google.php @@ -394,8 +394,8 @@ class OC_Filestorage_Google extends OC_Filestorage_Common { case 'x+': case 'c': case 'c+': - if (strrpos($path,'.') !== false) { - $ext = substr($path, strrpos($path,'.')); + if (strrpos($path, '.') !== false) { + $ext = substr($path, strrpos($path, '.')); } else { $ext = ''; } diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php index 7961ecbe1b7..b66a0f0ee1b 100644 --- a/apps/files_external/lib/streamwrapper.php +++ b/apps/files_external/lib/streamwrapper.php @@ -60,8 +60,8 @@ abstract class OC_FileStorage_StreamWrapper extends OC_Filestorage_Common{ public function touch($path, $mtime=null) { if(is_null($mtime)) { - $fh=$this->fopen($path,'a'); - fwrite($fh,''); + $fh=$this->fopen($path, 'a'); + fwrite($fh, ''); fclose($fh); }else{ return false;//not supported diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index c04de45d404..2f0076706e4 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -39,7 +39,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ * @return string */ private function getContainerName($path) { - $path=trim(trim($this->root,'/')."/".$path,'/.'); + $path=trim(trim($this->root, '/')."/".$path, '/.'); return str_replace('/', '\\', $path); } @@ -205,7 +205,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ unlink($tmpFile); return false; }else{ - $fh=fopen($tmpFile,'a'); + $fh=fopen($tmpFile, 'a'); fwrite($fh, $name."\n"); } }catch(Exception $e) { @@ -432,7 +432,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ case 'c': case 'c+': $tmpFile=$this->getTmpFile($path); - OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack'); + OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this, 'writeBack'); self::$tempFiles[$tmpFile]=$path; return fopen('close://'.$tmpFile, $mode); } diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php index 3d2ea7fa2a2..2503fb80b1b 100644 --- a/apps/files_external/lib/webdav.php +++ b/apps/files_external/lib/webdav.php @@ -252,7 +252,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{ public function stat($path) { $path=$this->cleanPath($path); try{ - $response=$this->client->propfind($path, array('{DAV:}getlastmodified','{DAV:}getcontentlength')); + $response=$this->client->propfind($path, array('{DAV:}getlastmodified', '{DAV:}getcontentlength')); return array( 'mtime'=>strtotime($response['{DAV:}getlastmodified']), 'size'=>(int)isset($response['{DAV:}getcontentlength']) ? $response['{DAV:}getcontentlength'] : 0, @@ -266,7 +266,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{ public function getMimeType($path) { $path=$this->cleanPath($path); try{ - $response=$this->client->propfind($path, array('{DAV:}getcontenttype','{DAV:}resourcetype')); + $response=$this->client->propfind($path, array('{DAV:}getcontenttype', '{DAV:}resourcetype')); $responseType=$response["{DAV:}resourcetype"]->resourceType; $type=(count($responseType)>0 and $responseType[0]=="{DAV:}collection")?'dir':'file'; if($type=='dir') { diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php index 746f89a8139..599d302e6e4 100644 --- a/apps/files_versions/appinfo/app.php +++ b/apps/files_versions/appinfo/app.php @@ -5,7 +5,7 @@ OC::$CLASSPATH['OCA_Versions\Storage'] = 'apps/files_versions/lib/versions.php'; OC::$CLASSPATH['OCA_Versions\Hooks'] = 'apps/files_versions/lib/hooks.php'; OCP\App::registerAdmin('files_versions', 'settings'); -OCP\App::registerPersonal('files_versions','settings-personal'); +OCP\App::registerPersonal('files_versions', 'settings-personal'); OCP\Util::addscript('files_versions', 'versions'); diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php index 0ebb34f45e4..deff735cedc 100644 --- a/apps/files_versions/history.php +++ b/apps/files_versions/history.php @@ -22,7 +22,7 @@ */ OCP\User::checkLoggedIn( ); -OCP\Util::addStyle('files_versions','versions'); +OCP\Util::addStyle('files_versions', 'versions'); $tmpl = new OCP\Template( 'files_versions', 'history', 'user' ); if ( isset( $_GET['path'] ) ) { diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 8ee147d0854..8f807187467 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -109,7 +109,7 @@ class Storage { // create all parent folders
$info=pathinfo($filename);
if(!file_exists($versionsFolderName.'/'.$info['dirname'])) {
- mkdir($versionsFolderName.'/'.$info['dirname'],0750, true);
+ mkdir($versionsFolderName.'/'.$info['dirname'], 0750, true);
}
// store a new version of a file
diff --git a/apps/files_versions/settings-personal.php b/apps/files_versions/settings-personal.php index 4fb866bd999..6555bc99c3e 100644 --- a/apps/files_versions/settings-personal.php +++ b/apps/files_versions/settings-personal.php @@ -2,6 +2,6 @@ $tmpl = new OCP\Template( 'files_versions', 'settings-personal'); -OCP\Util::addscript('files_versions','settings-personal'); +OCP\Util::addscript('files_versions', 'settings-personal'); return $tmpl->fetchPage(); diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index 6c6cc5679ba..63437310088 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -124,7 +124,7 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface { $this->connection->ldapGroupFilter, $this->connection->ldapGroupMemberAssocAttr.'='.$uid )); - $groups = $this->fetchListOfGroups($filter, array($this->connection->ldapGroupDisplayName,'dn')); + $groups = $this->fetchListOfGroups($filter, array($this->connection->ldapGroupDisplayName, 'dn')); $groups = array_unique($this->ownCloudGroupNames($groups), SORT_LOCALE_STRING); $this->connection->writeToCache($cacheKey, $groups); diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php index 74ff55355b2..ef92bbad40a 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/connection.php @@ -180,13 +180,13 @@ class Connection { * Caches the general LDAP configuration. */ private function readConfiguration($force = false) { - \OCP\Util::writeLog('user_ldap','Checking conf state: isConfigured? '.print_r($this->configured, true).' isForce? '.print_r($force, true).' configID? '.print_r($this->configID, true), \OCP\Util::DEBUG); + \OCP\Util::writeLog('user_ldap', 'Checking conf state: isConfigured? '.print_r($this->configured, true).' isForce? '.print_r($force, true).' configID? '.print_r($this->configID, true), \OCP\Util::DEBUG); if((!$this->configured || $force) && !is_null($this->configID)) { - \OCP\Util::writeLog('user_ldap','Reading the configuration', \OCP\Util::DEBUG); + \OCP\Util::writeLog('user_ldap', 'Reading the configuration', \OCP\Util::DEBUG); $this->config['ldapHost'] = \OCP\Config::getAppValue($this->configID, 'ldap_host', ''); $this->config['ldapPort'] = \OCP\Config::getAppValue($this->configID, 'ldap_port', 389); - $this->config['ldapAgentName'] = \OCP\Config::getAppValue($this->configID, 'ldap_dn',''); - $this->config['ldapAgentPassword'] = base64_decode(\OCP\Config::getAppValue($this->configID, 'ldap_agent_password','')); + $this->config['ldapAgentName'] = \OCP\Config::getAppValue($this->configID, 'ldap_dn', ''); + $this->config['ldapAgentPassword'] = base64_decode(\OCP\Config::getAppValue($this->configID, 'ldap_agent_password', '')); $this->config['ldapBase'] = \OCP\Config::getAppValue($this->configID, 'ldap_base', ''); $this->config['ldapBaseUsers'] = \OCP\Config::getAppValue($this->configID, 'ldap_base_users', $this->config['ldapBase']); $this->config['ldapBaseGroups'] = \OCP\Config::getAppValue($this->configID, 'ldap_base_groups', $this->config['ldapBase']); @@ -194,8 +194,8 @@ class Connection { $this->config['ldapNoCase'] = \OCP\Config::getAppValue($this->configID, 'ldap_nocase', 0); $this->config['turnOffCertCheck'] = \OCP\Config::getAppValue($this->configID, 'ldap_turn_off_cert_check', 0); $this->config['ldapUserDisplayName'] = mb_strtolower(\OCP\Config::getAppValue($this->configID, 'ldap_display_name', 'uid'), 'UTF-8'); - $this->config['ldapUserFilter'] = \OCP\Config::getAppValue($this->configID, 'ldap_userlist_filter','objectClass=person'); - $this->config['ldapGroupFilter'] = \OCP\Config::getAppValue($this->configID, 'ldap_group_filter','(objectClass=posixGroup)'); + $this->config['ldapUserFilter'] = \OCP\Config::getAppValue($this->configID, 'ldap_userlist_filter', 'objectClass=person'); + $this->config['ldapGroupFilter'] = \OCP\Config::getAppValue($this->configID, 'ldap_group_filter', '(objectClass=posixGroup)'); $this->config['ldapLoginFilter'] = \OCP\Config::getAppValue($this->configID, 'ldap_login_filter', '(uid=%uid)'); $this->config['ldapGroupDisplayName'] = mb_strtolower(\OCP\Config::getAppValue($this->configID, 'ldap_group_display_name', 'uid'), 'UTF-8'); $this->config['ldapQuotaAttribute'] = \OCP\Config::getAppValue($this->configID, 'ldap_quota_attr', ''); @@ -263,7 +263,7 @@ class Connection { if(empty($this->config['ldapGroupFilter']) && empty($this->config['ldapGroupMemberAssocAttr'])) { \OCP\Util::writeLog('user_ldap', 'No group filter is specified, LDAP group feature will not be used.', \OCP\Util::INFO); } - if(!in_array($this->config['ldapUuidAttribute'], array('auto','entryuuid', 'nsuniqueid', 'objectguid')) && (!is_null($this->configID))) { + if(!in_array($this->config['ldapUuidAttribute'], array('auto', 'entryuuid', 'nsuniqueid', 'objectguid')) && (!is_null($this->configID))) { \OCP\Config::setAppValue($this->configID, 'ldap_uuid_attribute', 'auto'); \OCP\Util::writeLog('user_ldap', 'Illegal value for the UUID Attribute, reset to autodetect.', \OCP\Util::INFO); } diff --git a/apps/user_ldap/settings.php b/apps/user_ldap/settings.php index f765151456a..95bf6f1ed7d 100644 --- a/apps/user_ldap/settings.php +++ b/apps/user_ldap/settings.php @@ -31,7 +31,7 @@ if ($_POST) { if('ldap_agent_password' == $param) { OCP\Config::setAppValue('user_ldap', $param, base64_encode($_POST[$param])); } elseif('ldap_cache_ttl' == $param) { - if(OCP\Config::getAppValue('user_ldap', $param,'') != $_POST[$param]) { + if(OCP\Config::getAppValue('user_ldap', $param, '') != $_POST[$param]) { $ldap = new \OCA\user_ldap\lib\Connection('user_ldap'); $ldap->clearCache(); OCP\Config::setAppValue('user_ldap', $param, $_POST[$param]); @@ -59,7 +59,7 @@ if ($_POST) { // fill template $tmpl = new OCP\Template( 'user_ldap', 'settings'); foreach($params as $param) { - $value = OCP\Config::getAppValue('user_ldap', $param,''); + $value = OCP\Config::getAppValue('user_ldap', $param, ''); $tmpl->assign($param, $value); } diff --git a/apps/user_ldap/tests/group_ldap.php b/apps/user_ldap/tests/group_ldap.php index 2acb8c35a19..f99902d32f5 100644 --- a/apps/user_ldap/tests/group_ldap.php +++ b/apps/user_ldap/tests/group_ldap.php @@ -32,8 +32,8 @@ class Test_Group_Ldap extends UnitTestCase { $this->assertIsA(OC_Group::getGroups(), gettype(array())); $this->assertIsA($group_ldap->getGroups(), gettype(array())); - $this->assertFalse(OC_Group::inGroup('john','dosers'), gettype(false)); - $this->assertFalse($group_ldap->inGroup('john','dosers'), gettype(false)); + $this->assertFalse(OC_Group::inGroup('john', 'dosers'), gettype(false)); + $this->assertFalse($group_ldap->inGroup('john', 'dosers'), gettype(false)); //TODO: check also for expected true result. This backend won't be able to do any modifications, maybe use a dummy for this. $this->assertIsA(OC_Group::getUserGroups('john doe'), gettype(array())); diff --git a/apps/user_webdavauth/appinfo/app.php b/apps/user_webdavauth/appinfo/app.php index 3ab323becce..c4c131b7ef0 100755 --- a/apps/user_webdavauth/appinfo/app.php +++ b/apps/user_webdavauth/appinfo/app.php @@ -23,7 +23,7 @@ require_once 'apps/user_webdavauth/user_webdavauth.php'; -OC_APP::registerAdmin('user_webdavauth','settings'); +OC_APP::registerAdmin('user_webdavauth', 'settings'); OC_User::registerBackend("WEBDAVAUTH"); OC_User::useBackend( "WEBDAVAUTH" ); |