]> source.dussan.org Git - nextcloud-server.git/commitdiff
Whitespace fixes in lib
authorBart Visscher <bartv@thisnet.nl>
Wed, 29 Aug 2012 06:38:33 +0000 (08:38 +0200)
committerBart Visscher <bartv@thisnet.nl>
Wed, 29 Aug 2012 18:28:45 +0000 (20:28 +0200)
57 files changed:
lib/appconfig.php
lib/archive.php
lib/archive/tar.php
lib/archive/zip.php
lib/backgroundjob/worker.php
lib/base.php
lib/cache.php
lib/connector/sabre/auth.php
lib/connector/sabre/directory.php
lib/connector/sabre/file.php
lib/connector/sabre/locks.php
lib/connector/sabre/node.php
lib/db.php
lib/eventsource.php
lib/filecache.php
lib/filecache/cached.php
lib/filecache/update.php
lib/fileproxy.php
lib/fileproxy/quota.php
lib/files.php
lib/filestorage/common.php
lib/filestorage/commontest.php
lib/filestorage/local.php
lib/filesystem.php
lib/filesystemview.php
lib/geo.php
lib/group.php
lib/hook.php
lib/image.php
lib/json.php
lib/l10n.php
lib/mail.php
lib/migrate.php
lib/migration/content.php
lib/migration/provider.php
lib/ocs.php
lib/ocsclient.php
lib/preferences.php
lib/public/app.php
lib/public/backgroundjob.php
lib/public/config.php
lib/public/db.php
lib/public/files.php
lib/public/json.php
lib/public/response.php
lib/public/template.php
lib/public/user.php
lib/search.php
lib/search/provider.php
lib/setup.php
lib/subadmin.php
lib/template.php
lib/user.php
lib/user/database.php
lib/user/http.php
lib/util.php
lib/vcategories.php

index 372cded9a5f0fb2e277298614389e36631f29804..0e608b540bd9981d50a87ac47983a935b42dafd3 100644 (file)
@@ -100,7 +100,7 @@ class OC_Appconfig{
                        return $default;
                }
        }
-       
+
        /**
         * @brief check if a key is set in the appconfig
         * @param string $app
@@ -111,7 +111,7 @@ class OC_Appconfig{
                $exists = self::getKeys( $app );
                return in_array( $key, $exists );
        }
-       
+
        /**
         * @brief sets a value in the appconfig
         * @param $app app
@@ -163,7 +163,7 @@ class OC_Appconfig{
 
                return true;
        }
-       
+
        /**
         * get multiply values, either the app or key can be used as wildcard by setting it to false
         * @param app
index fabd7cc7a51756282528a657f1323bc4387f975c..5ac4edbfd1e93b15b01517bf6171900f9950edfe 100644 (file)
@@ -28,7 +28,7 @@ abstract class OC_Archive{
                                return new OC_Archive_TAR($path);
                }
        }
-       
+
        abstract function __construct($source);
        /**
         * add an empty folder to the archive
index f6efd6d0ecc6f7fd69fbe61c1f492611489e2003..095362d0cd661005d33d864038cab688969dde5e 100644 (file)
@@ -14,7 +14,7 @@ class OC_Archive_TAR extends OC_Archive{
        const BZIP=2;
 
        private $fileList;
-       
+
        /**
         * @var Archive_Tar tar
         */
@@ -127,7 +127,7 @@ class OC_Archive_TAR extends OC_Archive{
                }
                return null;
        }
-       
+
        /**
         * get the uncompressed size of a file in the archive
         * @param string path
@@ -254,7 +254,7 @@ class OC_Archive_TAR extends OC_Archive{
                        return false;
                }
        }
-       
+
        /**
         * remove a file or folder from the archive
         * @param string path
index c1a5c35738bfd6ef0fdabd78cdb259133761aaad..396b1f6c054e62568f5b98aa6f3019a261470ec9 100644 (file)
@@ -12,7 +12,7 @@ class OC_Archive_ZIP extends OC_Archive{
         */
        private $zip=null;
        private $path;
-       
+
        function __construct($source){
                $this->path=$source;
                $this->zip=new ZipArchive();
index b4f0429b31958a1321fe78154b202b04eb9ec40f..8684e0df117c581da3b9654f61ea38b9e75ce0b4 100644 (file)
@@ -22,7 +22,7 @@
 
 /**
  * This class does the dirty work.
- * 
+ *
  * TODO: locking in doAllSteps
  */
 class OC_BackgroundJob_Worker{
@@ -56,7 +56,7 @@ class OC_BackgroundJob_Worker{
                        OC_BackgroundJob_QueuedTask::delete( $task['id'] );
                        call_user_func( array( $task['klass'], $task['method'] ), $task['parameters'] );
                }
-               
+
                return true;
        }
 
@@ -70,7 +70,7 @@ class OC_BackgroundJob_Worker{
         */
        public static function doNextStep(){
                $laststep = OC_Appconfig::getValue( 'core', 'backgroundjobs_step', 'regular_tasks' );
-               
+
                if( $laststep == 'regular_tasks' ){
                        // get last app
                        $lasttask = OC_Appconfig::getValue( 'core', 'backgroundjobs_task', '' );
@@ -79,7 +79,7 @@ class OC_BackgroundJob_Worker{
                        $regular_tasks = OC_BackgroundJob_RegularTask::all();
                        ksort( $regular_tasks );
                        $done = false;
-                       
+
                        // search for next background job
                        foreach( $regular_tasks as $key => $value ){
                                if( strcmp( $key, $lasttask ) > 0 ){
@@ -112,7 +112,7 @@ class OC_BackgroundJob_Worker{
                                OC_Appconfig::setValue( 'core', 'backgroundjobs_task', '' );
                        }
                }
-               
+
                return true;
        }
 }
index d3f3c5ba1c6b0a6e2e3191f458e97b0019924804..0c3ab8527a905ee737c4f8e65eb2288171fd375e 100644 (file)
@@ -239,7 +239,7 @@ class OC{
                                OC_Util::addScript( 'backgroundjobs' );
                        }
                }
-               
+
                OC_Util::addStyle( "styles" );
                OC_Util::addStyle( "multiselect" );
                OC_Util::addStyle( "jquery-ui-1.8.16.custom" );
@@ -473,7 +473,7 @@ class OC{
                // Someone wants to log in :
                } elseif (OC::tryFormLogin()) {
                        $error = true;
-               
+
                // The user is already authenticated using Apaches AuthType Basic... very usable in combination with LDAP
                } elseif (OC::tryBasicAuthLogin()) {
                        $error = true;
index 55f189a5da8e1f5400c3a47cabc5ebf0900f31d3..fed990b5b3451dd8975e0cbd1f371f9349156ad1 100644 (file)
@@ -38,7 +38,7 @@ class OC_Cache {
                        if (!self::$global_cache_fast && function_exists('apc_store')) {
                                self::$global_cache_fast = new OC_Cache_APC(true);
                        }
-                       
+
                        self::$global_cache = new OC_Cache_FileGlobal();
                        if (self::$global_cache_fast) {
                                self::$global_cache = new OC_Cache_Broker(self::$global_cache_fast, self::$global_cache);
@@ -67,7 +67,7 @@ class OC_Cache {
                        if (!self::$user_cache_fast && function_exists('apc_store')) {
                                self::$user_cache_fast = new OC_Cache_APC();
                        }
-                       
+
                        self::$user_cache = new OC_Cache_File();
                        if (self::$user_cache_fast) {
                                self::$user_cache = new OC_Cache_Broker(self::$user_cache_fast, self::$user_cache);
index 99f696e3a0711963b689a3d34aa3a132528c0248..8197571e9497a34b8c0938f870d174d19ed2db2d 100644 (file)
@@ -45,4 +45,4 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic {
                        }
                }
        }
-} 
+}
index cd3ed60292c250862dc1558a019d8b66c0daa1e7..a75024461525241bf045bdae3194a5ee3630fb37 100644 (file)
@@ -203,4 +203,3 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
                return $props;
        }
 }
-
index 9d571fceb0d1077bc2f0f5979e81bc53df633dad..5bd38240d4471ff9524e6e4d36485f793b5df814 100644 (file)
@@ -126,4 +126,3 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
 
        }
 }
-
index 0ddc8b18d2f9fa16a28864582435332deaa2e014..a01653d960adc2a74f6b09977ea16f2f5e6bf6b8 100644 (file)
@@ -42,7 +42,7 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
                // pure sql. MySQL's non-standard string concatination prevents us
                // from doing this though.
                // NOTE: SQLite requires time() to be inserted directly. That's ugly
-               // but otherwise reading locks from SQLite Databases will return 
+               // but otherwise reading locks from SQLite Databases will return
                // nothing
                $query = 'SELECT * FROM `*PREFIX*locks` WHERE `userid` = ? AND (`created` + `timeout`) > '.time().' AND (( `uri` = ?)';
                $params = array(OC_User::getUser(),$uri);
@@ -75,7 +75,7 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
 
                $stmt = OC_DB::prepare( $query );
                $result = $stmt->execute( $params );
-               
+
                $lockList = array();
                while( $row = $result->fetchRow()){
 
@@ -114,7 +114,7 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
                foreach($locks as $lock) {
                        if ($lock->token == $lockInfo->token) $exists = true;
                }
-       
+
                if ($exists) {
                        $query = OC_DB::prepare( 'UPDATE `*PREFIX*locks` SET `owner` = ?, `timeout` = ?, `scope` = ?, `depth` = ?, `uri` = ?, `created` = ? WHERE `userid` = ? AND `token` = ?' );
                        $result = $query->execute( array($lockInfo->owner,$lockInfo->timeout,$lockInfo->scope,$lockInfo->depth,$uri,$lockInfo->created,OC_User::getUser(),$lockInfo->token));
index b9bf474a0412f905aadf8bb33131e87f44820f0d..afcabe7bef63dd5505e4ad578e791c71c7f2f179 100644 (file)
@@ -80,9 +80,9 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
                $oldPath = $this->path;
 
                OC_Filesystem::rename($this->path,$newPath);
-       
+
                $this->path = $newPath;
-               
+
                $query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertypath` = ? WHERE `userid` = ? AND `propertypath` = ?' );
                $query->execute( array( $newPath,OC_User::getUser(), $oldPath ));
 
@@ -123,8 +123,8 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
 
        }
 
-       /** 
-        *  sets the last modification time of the file (mtime) to the value given 
+       /**
+        *  sets the last modification time of the file (mtime) to the value given
         *  in the second parameter or to now if the second param is empty.
         *  Even if the modification time is set to a custom value the access time is set to now.
         */
@@ -195,7 +195,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
                if(count($properties) == 0){
                        return $this->property_cache;
                }
-               
+
                $props = array();
                foreach($properties as $property) {
                        if (isset($this->property_cache[$property])) $props[$property] = $this->property_cache[$property];
index 4214451c85fa27998f15be684753104b6c79f870..ecaf9e37ee565ad8786a4e4587121448ab87f0ca 100644 (file)
@@ -27,7 +27,7 @@
 class OC_DB {
        const BACKEND_PDO=0;
        const BACKEND_MDB2=1;
-       
+
        static private $connection; //the prefered connection to use, either PDO or MDB2
        static private $backend=null;
        static private $MDB2=false;
@@ -55,7 +55,7 @@ class OC_DB {
                }
                return self::BACKEND_MDB2;
        }
-       
+
        /**
         * @brief connects to the database
         * @returns true if connection can be established or nothing (die())
@@ -104,7 +104,7 @@ class OC_DB {
                }
                $opts = array();
                $datadir=OC_Config::getValue( "datadirectory", OC::$SERVERROOT.'/data' );
-               
+
                // do nothing if the connection already has been established
                if(!self::$PDO){
                        // Add the dsn according to the database type
@@ -158,7 +158,7 @@ class OC_DB {
                }
                return true;
        }
-       
+
        /**
         * connect to the database using mdb2
         */
@@ -234,10 +234,10 @@ class OC_DB {
                                        }
                                        break;
                        }
-                       
+
                        // Try to establish connection
                        self::$MDB2 = MDB2::factory( $dsn, $options );
-                       
+
                        // Die if we could not connect
                        if( PEAR::isError( self::$MDB2 )){
                                echo( '<b>can not connect to database, using '.$type.'. ('.self::$MDB2->getUserInfo().')</center>');
@@ -245,11 +245,11 @@ class OC_DB {
                                OC_Log::write('core',self::$MDB2->getMessage(),OC_Log::FATAL);
                                die( $error );
                        }
-                       
+
                        // We always, really always want associative arrays
                        self::$MDB2->setFetchMode(MDB2_FETCHMODE_ASSOC);
                }
-               
+
                // we are done. great!
                return true;
        }
@@ -262,7 +262,7 @@ class OC_DB {
         * SQL query via MDB2 prepare(), needs to be execute()'d!
         */
        static public function prepare( $query , $limit=null, $offset=null ){
-               
+
                if (!is_null($limit) && $limit != -1) {
                        if (self::$backend == self::BACKEND_MDB2) {
                                //MDB2 uses or emulates limits & offset internally
@@ -394,7 +394,7 @@ class OC_DB {
 
                // read file
                $content = file_get_contents( $file );
-               
+
                // Make changes and save them to an in-memory file
                $file2 = 'static://db_scheme';
                $content = str_replace( '*dbname*', $CONFIG_DBNAME, $content );
@@ -414,7 +414,7 @@ class OC_DB {
 
                // Try to create tables
                $definition = self::$schema->parseDatabaseDefinitionFile( $file2 );
-               
+
                //clean up memory
                unlink( $file2 );
 
@@ -427,7 +427,7 @@ class OC_DB {
                        $oldname = $definition['name'];
                        $definition['name']=OC_Config::getValue( "dbuser", $oldname );
                }
-               
+
                $ret=self::$schema->createDatabase( $definition );
 
                // Die in case something went wrong
@@ -438,7 +438,7 @@ class OC_DB {
 
                return true;
        }
-       
+
        /**
         * @brief update the database scheme
         * @param $file file to read structure from
@@ -451,7 +451,7 @@ class OC_DB {
 
                // read file
                $content = file_get_contents( $file );
-               
+
                $previousSchema = self::$schema->getDefinitionFromDatabase();
                if (PEAR::isError($previousSchema)) {
                        $error = $previousSchema->getMessage();
@@ -475,10 +475,10 @@ class OC_DB {
                 */
                file_put_contents( $file2, $content );
                $op = self::$schema->updateDatabase($file2, $previousSchema, array(), false);
-               
+
                //clean up memory
                unlink( $file2 );
-               
+
                if (PEAR::isError($op)) {
                        $error = $op->getMessage();
                        $detail = $op->getDebugInfo();
@@ -528,7 +528,7 @@ class OC_DB {
                        self::$prefix=OC_Config::getValue( "dbtableprefix", "oc_" );
                }
                $prefix = self::$prefix;
-               
+
                // differences in escaping of table names ('`' for mysql) and getting the current timestamp
                if( $type == 'sqlite' || $type == 'sqlite3' ){
                        $query = str_replace( '`', '"', $query );
@@ -547,7 +547,7 @@ class OC_DB {
 
                return $query;
        }
-       
+
        /**
         * @brief drop a table
         * @param string $tableNamme the table to drop
@@ -557,7 +557,7 @@ class OC_DB {
                self::$MDB2->loadModule('Manager');
                self::$MDB2->dropTable($tableName);
        }
-       
+
        /**
         * remove all tables defined in a database structure xml file
         * @param string $file the xml file describing the tables
@@ -578,7 +578,7 @@ class OC_DB {
 
                // get the tables
                $definition = self::$schema->parseDatabaseDefinitionFile( $file2 );
-               
+
                // Delete our temporary file
                unlink( $file2 );
                $tables=array_keys($definition['tables']);
@@ -586,7 +586,7 @@ class OC_DB {
                        self::dropTable($table);
                }
        }
-       
+
        /**
         * @brief replaces the owncloud tables with a new set
         * @param $file string path to the MDB2 xml db export file
@@ -596,20 +596,20 @@ class OC_DB {
                self::beginTransaction();
                // Delete the old tables
                self::removeDBStructure( OC::$SERVERROOT . '/db_structure.xml' );
-               
+
                foreach($apps as $app){
                        $path = OC_App::getAppPath($app).'/appinfo/database.xml';
                        if(file_exists($path)){
-                               self::removeDBStructure( $path );       
+                               self::removeDBStructure( $path );
                        }
                }
-               
+
                // Create new tables
                self::createDBFromStructure( $file );
                self::commit();
-               
+
         }
-       
+
        /**
         * Start a transaction
         */
@@ -660,7 +660,7 @@ class PDOStatementWrapper{
        public function __construct($statement){
                $this->statement=$statement;
        }
-       
+
        /**
         * make execute return the result instead of a bool
         */
@@ -677,7 +677,7 @@ class PDOStatementWrapper{
                        return false;
                }
        }
-       
+
        /**
         * provide numRows
         */
@@ -690,21 +690,21 @@ class PDOStatementWrapper{
                        return $this->statement->rowCount();
                }
        }
-       
+
        /**
         * provide an alias for fetch
         */
        public function fetchRow(){
                return $this->statement->fetch();
        }
-       
+
        /**
         * pass all other function directly to the PDOStatement
         */
        public function __call($name,$arguments){
                return call_user_func_array(array($this->statement,$name),$arguments);
        }
-       
+
        /**
         * Provide a simple fetchOne.
         * fetch single column from the next row
@@ -714,4 +714,3 @@ class PDOStatementWrapper{
                return $this->statement->fetchColumn($colnum);
        }
 }
-
index 95af2e471bca36cd7b80694b55d030f6616c2efd..45a20806b6edacec2932594073b46f24aec98cde 100644 (file)
@@ -30,7 +30,7 @@
 class OC_EventSource{
        private $fallback;
        private $fallBackId=0;
-       
+
        public function __construct(){
                @ob_end_clean();
                header('Cache-Control: no-cache');
index e85d6747f905b133db40c00d20a44a7d46e2678c..364b908bcfa7dd14eb3992f277105fdf7cbceda7 100644 (file)
@@ -76,14 +76,14 @@ class OC_FileCache{
                        self::update($id,$data);
                        return;
                }
-               
+
                // add parent directory to the file cache if it does not exist yet.
                if ($parent == -1 && $fullpath != $root) {
                        $parentDir = substr(dirname($path), 0, strrpos(dirname($path), DIRECTORY_SEPARATOR));
                        self::scanFile($parentDir);
                        $parent = self::getParentId($fullpath);
                }
-               
+
                if(!isset($data['size']) or !isset($data['mtime'])){//save incomplete data for the next time we write it
                        OC_FileCache_Cached::$savedData[$fullpath]=$data;
                        return;
@@ -136,7 +136,7 @@ class OC_FileCache{
                        $queryParts[]='`mimepart`=?';
                }
                $arguments[]=$id;
-               
+
                $sql = 'UPDATE `*PREFIX*fscache` SET '.implode(' , ',$queryParts).' WHERE `id`=?';
                $query=OC_DB::prepare($sql);
                $result=$query->execute($arguments);
@@ -192,14 +192,14 @@ class OC_FileCache{
                }
                $query=OC_DB::prepare('DELETE FROM `*PREFIX*fscache` WHERE `path_hash`=?');
                $query->execute(array(md5($root.$path)));
-               
+
                //delete everything inside the folder
                $query=OC_DB::prepare('DELETE FROM `*PREFIX*fscache` WHERE `path` LIKE ?');
                $query->execute(array($root.$path.'/%'));
 
                OC_Cache::remove('fileid/'.$root.$path);
        }
-       
+
        /**
         * return array of filenames matching the querty
         * @param string $query
@@ -277,14 +277,14 @@ class OC_FileCache{
                if(($cache=OC_Cache::getUserCache(true)) && $cache->hasKey('fileid/'.$fullPath)){
                        return $cache->get('fileid/'.$fullPath);
                }
-               
+
                $query=OC_DB::prepare('SELECT `id` FROM `*PREFIX*fscache` WHERE `path_hash`=?');
                $result=$query->execute(array(md5($fullPath)));
                if(OC_DB::isError($result)){
                        OC_Log::write('files','error while getting file id of '.$path,OC_Log::ERROR);
                        return -1;
                }
-               
+
                $result=$result->fetchRow();
                if(is_array($result)){
                        $id=$result['id'];
@@ -294,10 +294,10 @@ class OC_FileCache{
                if($cache=OC_Cache::getUserCache(true)){
                        $cache->set('fileid/'.$fullPath,$id);
                }
-               
+
                return $id;
        }
-       
+
        /**
         * get the file path from the id, relative to the home folder of the user
         * @param int id
@@ -331,7 +331,7 @@ class OC_FileCache{
                        return self::getId(dirname($path),'');
                }
        }
-       
+
        /**
         * adjust the size of the parent folders
         * @param string $path
@@ -390,7 +390,7 @@ class OC_FileCache{
                                }
                        }
                }
-               
+
                OC_FileCache_Update::cleanFolder($path,$root);
                self::increaseSize($path,$totalSize,$root);
        }
index 95cc0ac300ebae8f01f930a561e2569042e2cb3d..505f1a5e2a03f57e6fd018805f88f5a45ffc2b2a 100644 (file)
@@ -12,7 +12,7 @@
  */
 class OC_FileCache_Cached{
        public static $savedData=array();
-       
+
        public static function get($path,$root=false){
                if($root===false){
                        $root=OC_Filesystem::getRoot();
index 0b5ff8e2446b277d280ccfdc03b88f41ccc0babe..7b5f18fe5c156276c2078ee0747e203bca7275ea 100644 (file)
@@ -42,7 +42,7 @@ class OC_FileCache_Update{
                        return true;
                }
        }
-       
+
        /**
         * delete non existing files from the cache
         */
@@ -148,7 +148,7 @@ class OC_FileCache_Update{
                }
 
                $mimetype=$view->getMimeType($path);
-               
+
                $size=0;
                $cached=OC_FileCache_Cached::get($path,$root);
                $cachedSize=isset($cached['size'])?$cached['size']:0;
index ec04faa9bc5061af43b7abd8cd6951861c074677..a1c79874bf75ce7e3103765149b11430369c181c 100644 (file)
@@ -43,7 +43,7 @@
 class OC_FileProxy{
        private static $proxies=array();
        public static $enabled=true;
-       
+
        /**
         * fallback function when a proxy operation is not implemented
         * @param string $function the name of the proxy operation
@@ -58,7 +58,7 @@ class OC_FileProxy{
                        return $arguments[1];
                }
        }
-       
+
        /**
         * register a proxy to be used
         * @param OC_FileProxy $proxy
@@ -66,7 +66,7 @@ class OC_FileProxy{
        public static function register($proxy){
                self::$proxies[]=$proxy;
        }
-       
+
        public static function getProxies($operation){
                $proxies=array();
                foreach(self::$proxies as $proxy){
index 7316224cc6160566f6d629390f0a9021f1d56eb5..4c6261fc51460008e495f1d4b5c1a69a11888706 100644 (file)
@@ -27,7 +27,7 @@
 
 class OC_FileProxy_Quota extends OC_FileProxy{
        private $userQuota=-1;
-       
+
        /**
         * get the quota for the current user
         * @return int
@@ -46,9 +46,9 @@ class OC_FileProxy_Quota extends OC_FileProxy{
                        $this->userQuota=OC_Helper::computerFileSize($userQuota);
                }
                return $this->userQuota;
-               
+
        }
-       
+
        /**
         * get the free space in the users home folder
         * @return int
@@ -69,7 +69,7 @@ class OC_FileProxy_Quota extends OC_FileProxy{
                }
                return $totalSpace-$usedSpace;
        }
-       
+
        public function postFree_space($path,$space){
                $free=$this->getFreeSpace();
                if($free==0){
index 1a1fffa0a50fb97c181e8105812e58dd3808befb..0c71f6e5e42f5083f53c7de9cef0ae338a84a2e5 100644 (file)
@@ -406,9 +406,9 @@ class OC_Files {
                //check for write permissions
                if(is_writable(OC::$SERVERROOT.'/.htaccess')) {
                        file_put_contents(OC::$SERVERROOT.'/.htaccess', $htaccess);
-                       return OC_Helper::computerFileSize($size);      
+                       return OC_Helper::computerFileSize($size);
                } else { OC_Log::write('files','Can\'t write upload limit to '.OC::$SERVERROOT.'/.htaccess. Please check the file permissions',OC_Log::WARN); }
-               
+
                return false;
        }
 
index c829be62f74351d0ad3f42a2054e0150b56a5a97..e2828e561709772ca8389a55f06c3fef02daf32a 100644 (file)
 */
 
 /**
- * Storage backend class for providing common filesystem operation methods 
+ * Storage backend class for providing common filesystem operation methods
  * which are not storage-backend specific.
  *
  * OC_Filestorage_Common is never used directly; it is extended by all other
- * storage backends, where its methods may be overridden, and additional 
+ * storage backends, where its methods may be overridden, and additional
  * (backend-specific) methods are defined.
  *
  * Some OC_Filestorage_Common methods call functions which are first defined
@@ -115,71 +115,71 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
         * @param $empty Flag indicating whether directory will be emptied
         * @returns true/false
         *
-        * @note By default the directory specified by $directory will be 
+        * @note By default the directory specified by $directory will be
         * deleted together with its contents. To avoid this set $empty to true
         */
        public function deleteAll( $directory, $empty = false ) {
-       
+
                // strip leading slash
                if( substr( $directory, 0, 1 ) == "/" ) {
-               
+
                        $directory = substr( $directory, 1 );
-                       
+
                }
-               
+
                // strip trailing slash
                if( substr( $directory, -1) == "/" ) {
-               
+
                        $directory = substr( $directory, 0, -1 );
-                       
+
                }
-               
+
                if ( !$this->file_exists( \OCP\USER::getUser() . '/' . $directory ) || !$this->is_dir( \OCP\USER::getUser() . '/' . $directory ) ) {
-               
+
                        return false;
-                       
+
                } elseif( !$this->is_readable( \OCP\USER::getUser() . '/' . $directory ) ) {
-               
+
                        return false;
-                       
+
                } else {
-                       
+
                        $directoryHandle = $this->opendir( \OCP\USER::getUser() . '/' . $directory );
-                       
+
                        while ( $contents = readdir( $directoryHandle ) ) {
-                       
+
                                if ( $contents != '.' && $contents != '..') {
-                                       
+
                                        $path = $directory . "/" . $contents;
-                               
+
                                        if ( $this->is_dir( $path ) ) {
-                                               
+
                                                deleteAll( $path );
-                                       
+
                                        } else {
-                                               
+
                                                $this->unlink( \OCP\USER::getUser() .'/' . $path ); // TODO: make unlink use same system path as is_dir
-                                       
+
                                        }
                                }
-                       
+
                        }
-               
+
                        //$this->closedir( $directoryHandle ); // TODO: implement closedir in OC_FSV
 
                        if ( $empty == false ) {
-                       
+
                                if ( !$this->rmdir( $directory ) ) {
-                               
+
                                        return false;
-                                       
+
                                }
-                               
+
                        }
-               
+
                        return true;
                }
-               
+
        }
        public function getMimeType($path){
                if(!$this->file_exists($path)){
index b5126a407b343b020ada149cd572de10a3dcf517..4d06e4fa321d81737e97c419bd7e7fb919dfb8fb 100644 (file)
@@ -31,11 +31,11 @@ class OC_Filestorage_CommonTest extends OC_Filestorage_Common{
         * @var OC_FileStorage_Local
         */
        private $storage;
-       
+
        public function __construct($params){
                $this->storage=new OC_Filestorage_Local($params);
        }
-       
+
        public function mkdir($path){
                return $this->storage->mkdir($path);
        }
index 22d17469df3380764c0f34b9205f509fe5262257..b19205f45b1e8a01e7344a35ce2d5d8f05f4b678 100644 (file)
@@ -61,7 +61,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
                return filemtime($this->datadir.$path);
        }
        public function touch($path, $mtime=null){
-               // sets the modification time of the file to the given value. 
+               // sets the modification time of the file to the given value.
                // If mtime is nil the current time is set.
                // note that the access time of the file always changes to the current time.
                if(!is_null($mtime)){
@@ -72,7 +72,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
                if( $result ) {
                        clearstatcache( true, $this->datadir.$path );
                }
-               
+
                return $result;
        }
        public function file_get_contents($path){
index fbb0290045629c61e324fa788e18c3cf332aa931..327329f9d91228e05deaf3ccca62a8a567c71226 100644 (file)
@@ -3,22 +3,22 @@
 /**
 * ownCloud
 *
-* @author Frank Karlitschek 
-* @copyright 2012 Frank Karlitschek frank@owncloud.org 
-* 
+* @author Frank Karlitschek
+* @copyright 2012 Frank Karlitschek frank@owncloud.org
+*
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
-* License as published by the Free Software Foundation; either 
+* License as published by the Free Software Foundation; either
 * version 3 of the License, or any later version.
-* 
+*
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
-*  
-* You should have received a copy of the GNU Affero General Public 
+*
+* You should have received a copy of the GNU Affero General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
-* 
+*
 */
 
 
@@ -193,7 +193,7 @@ class OC_Filesystem{
                        return OC_Filesystem::$storages[$mountpoint];
                }
        }
-       
+
        static public function init($root){
                if(self::$defaultInstance){
                        return false;
@@ -237,7 +237,7 @@ class OC_Filesystem{
                                }
                        }
                }
-               
+
                self::$loaded=true;
        }
 
@@ -257,14 +257,14 @@ class OC_Filesystem{
        static public function getView(){
                return self::$defaultInstance;
        }
-       
+
        /**
         * tear down the filesystem, removing all storage providers
         */
        static public function tearDown(){
                self::$storages=array();
        }
-       
+
        /**
        * create a new storage of a specific type
        * @param  string  type
@@ -284,7 +284,7 @@ class OC_Filesystem{
                        return false;
                }
        }
-       
+
        /**
        * change the root to a fake root
        * @param  string  fakeRoot
@@ -326,7 +326,7 @@ class OC_Filesystem{
                }
                self::$mounts[$mountpoint]=array('class'=>$class,'arguments'=>$arguments);
        }
-       
+
        /**
        * return the path to a local version of the file
        * we need this because we can't know if a file is stored local or not from outside the filestorage and for some purposes a local file is needed
@@ -343,7 +343,7 @@ class OC_Filesystem{
        static public function getLocalFolder($path){
                return self::$defaultInstance->getLocalFolder($path);
        }
-       
+
        /**
        * return path to file which reflects one visible in browser
        * @param string path
@@ -357,7 +357,7 @@ class OC_Filesystem{
                }
                return $newpath;
        }
-       
+
        /**
         * check if the requested path is valid
         * @param string path
@@ -372,7 +372,7 @@ class OC_Filesystem{
                }
                return true;
        }
-       
+
        /**
         * checks if a file is blacklsited for storage in the filesystem
         * Listens to write and rename hooks
@@ -392,7 +392,7 @@ class OC_Filesystem{
                        }
                }
        }
-       
+
        /**
         * following functions are equivilent to their php buildin equivilents for arguments/return values.
         */
@@ -496,11 +496,11 @@ class OC_Filesystem{
        static public function hash($type,$path, $raw = false){
                return self::$defaultInstance->hash($type,$path, $raw);
        }
-       
+
        static public function free_space($path='/'){
                return self::$defaultInstance->free_space($path);
        }
-       
+
        static public function search($query){
                return OC_FileCache::search($query);
        }
index a888e5340ea49f6f7e6456532eb4c501a247688c..461a02625602add1080887b85f92f56777dce5ea 100644 (file)
@@ -56,7 +56,7 @@ class OC_FilesystemView {
                }
                return $this->fakeRoot.$path;
        }
-       
+
        /**
        * change the root to a fake toor
        * @param  string  fakeRoot
@@ -325,7 +325,7 @@ class OC_FilesystemView {
                if(OC_FileProxy::runPreProxies('rename', $absolutePath1, $absolutePath2) and OC_Filesystem::isValidPath($path2)) {
                        $path1 = $this->getRelativePath($absolutePath1);
                        $path2 = $this->getRelativePath($absolutePath2);
-                       
+
                        if($path1 == null or $path2 == null) {
                                return false;
                        }
@@ -352,7 +352,7 @@ class OC_FilesystemView {
                                        $storage1 = $this->getStorage($path1);
                                        $storage1->unlink($this->getInternalPath($path1.$postFix1));
                                        $result = $count>0;
-                               } 
+                               }
                                OC_Hook::emit(
                                        OC_Filesystem::CLASSNAME,
                                        OC_Filesystem::signal_post_rename,
@@ -373,7 +373,7 @@ class OC_FilesystemView {
                if(OC_FileProxy::runPreProxies('copy', $absolutePath1, $absolutePath2) and OC_Filesystem::isValidPath($path2)) {
                        $path1 = $this->getRelativePath($absolutePath1);
                        $path2 = $this->getRelativePath($absolutePath2);
-                       
+
                        if($path1 == null or $path2 == null) {
                                return false;
                        }
index a967ab28a96edc3a54b9caa3914d15e31091190e..964605b1c1cbf4a30a7df6e70d2b595e066b2f46 100644 (file)
@@ -12,7 +12,7 @@ class OC_Geo{
         * @param (string) $longitude - Longitude
         * @return (string) $timezone - closest timezone
         */
-       public static function timezone($latitude, $longitude){ 
+       public static function timezone($latitude, $longitude){
                $alltimezones = DateTimeZone::listIdentifiers();
                $variances = array();
                //calculate for all timezones the system know
index 72cf5dc89afe9727b64c3f52a2b208d2578c7614..dd70a94eb0d976018f5c4f3d5b896b057425a572 100644 (file)
@@ -271,7 +271,7 @@ class OC_Group {
                }
                return $users;
        }
-       
+
        /**
         * @brief get a list of all users in several groups
         * @param array $gids
index b53755310e064f71370f870e87ec872fa90bff06..ee390d6cd5a752fd6c53390fdf10825cae3a31d1 100644 (file)
@@ -83,4 +83,3 @@ class OC_Hook{
                }
        }
 }
index 90c64320a7c8fe59715963af77a1ffd5607b1d6f..e87cf9e16d9224b6253612ea06a8bc7f7f503f09 100644 (file)
@@ -383,7 +383,7 @@ class OC_Image {
        /**
        * @brief Loads an image from an open file handle.
        * It is the responsibility of the caller to position the pointer at the correct place and to close the handle again.
-       * @param $handle 
+       * @param $handle
        * @returns An image resource or false on error
        */
        public function loadFromFileHandle($handle) {
@@ -468,7 +468,7 @@ class OC_Image {
                                break;
                        */
                        default:
-                       
+
                                // this is mostly file created from encrypted file
                                $this->resource = imagecreatefromstring(\OC_Filesystem::file_get_contents(\OC_Filesystem::getLocalPath($imagepath)));
                                $itype = IMAGETYPE_PNG;
@@ -534,7 +534,7 @@ class OC_Image {
                $width_orig=imageSX($this->resource);
                $height_orig=imageSY($this->resource);
                $ratio_orig = $width_orig/$height_orig;
-               
+
                if ($ratio_orig > 1) {
                        $new_height = round($maxsize/$ratio_orig);
                        $new_width = $maxsize;
@@ -564,7 +564,7 @@ class OC_Image {
        public function preciseResize($width, $height) {
                if (!$this->valid()) {
                        OC_Log::write('core',__METHOD__.'(): No image loaded', OC_Log::ERROR);
-                       return false;                   
+                       return false;
                }
                $width_orig=imageSX($this->resource);
                $height_orig=imageSY($this->resource);
index 3d9d5c96fa3d954199bd811c4b50e16f872c0ab1..32ae734e4a5a355ba36cb0ddd73c1428a0d39682 100644 (file)
@@ -52,7 +52,7 @@ class OC_JSON{
                        exit();
                }
        }
-        
+
        /**
        * Check if the user is a admin, send json error msg if not
        */
@@ -64,7 +64,7 @@ class OC_JSON{
                        exit();
                }
        }
-        
+
        /**
        * Check if the user is a subadmin, send json error msg if not
        */
index e7f5ffea0e4938c66d3507215f3b5a8443aa012a..cfa0e26486bac5859bb6df6fccfa65b142292b96 100644 (file)
@@ -28,17 +28,17 @@ class OC_L10N{
         * cached instances
         */
        protected static $instances=array();
-       
+
        /**
         * cache
         */
        protected static $cache = array();
-       
+
        /**
         * The best language
         */
        protected static $language = '';
-       
+
        /**
         * App of this object
         */
@@ -53,7 +53,7 @@ class OC_L10N{
         * Translations
         */
        private $translations = array();
-       
+
        /**
         * Localization
         */
@@ -61,7 +61,7 @@ class OC_L10N{
                'date' => 'd.m.Y',
                'datetime' => 'd.m.Y H:i:s',
                'time' => 'H:i:s');
-               
+
        /**
         * get an L10N instance
         * @return OC_L10N
@@ -76,7 +76,7 @@ class OC_L10N{
                        return new OC_L10N($app,$lang);
                }
        }
-       
+
        /**
         * @brief The constructor
         * @param $app the app requesting l10n
@@ -90,7 +90,7 @@ class OC_L10N{
                $this->app = $app;
                $this->lang = $lang;
        }
-               
+
        protected function init(){
                if ($this->app === true) {
                        return;
@@ -119,7 +119,7 @@ class OC_L10N{
                                if(isset($TRANSLATIONS) && is_array($TRANSLATIONS)){
                                        $this->translations = $TRANSLATIONS;
                                }
-                       } 
+                       }
 
                        if(file_exists(OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php')){
                                // Include the file, save the data from $CONFIG
@@ -188,7 +188,7 @@ class OC_L10N{
         * @returns String or false
         *
         * Returns the localized data.
-        * 
+        *
         * Implemented types:
         *  - date
         *    - Creates a date
@@ -241,7 +241,7 @@ class OC_L10N{
         * @returns language
         *
         * If $app is an array, ownCloud assumes that these are the available
-        * languages. Otherwise ownCloud tries to find the files in the l10n 
+        * languages. Otherwise ownCloud tries to find the files in the l10n
         * folder.
         *
         * If nothing works it returns 'en'
index 0ac9a97c1bfaa5cdd5321d9a2d3af2f570ff8540..acdadeffd33eaadaa1cb53e83bcf95242ceb0655 100644 (file)
@@ -17,7 +17,7 @@ require_once('class.phpmailer.php');
 class OC_Mail {
 
        /**
-        * send an email 
+        * send an email
         *
         * @param string $toaddress
         * @param string $toname
@@ -31,9 +31,9 @@ class OC_Mail {
 
                $SMTPMODE = OC_Config::getValue( 'mail_smtpmode', 'sendmail' );
                $SMTPHOST = OC_Config::getValue( 'mail_smtphost', '127.0.0.1' );
-               $SMTPAUTH = OC_Config::getValue( 'mail_smtpauth', false ); 
-               $SMTPUSERNAME = OC_Config::getValue( 'mail_smtpname', '' ); 
-               $SMTPPASSWORD = OC_Config::getValue( 'mail_smtppassword', '' );  
+               $SMTPAUTH = OC_Config::getValue( 'mail_smtpauth', false );
+               $SMTPUSERNAME = OC_Config::getValue( 'mail_smtpname', '' );
+               $SMTPPASSWORD = OC_Config::getValue( 'mail_smtppassword', '' );
 
 
                $mailo = new PHPMailer(true);
index e998cf1f4a8873cfd465897185a920e3475904eb..7d7169c4e466f3b89836208a6f4b7a5d86863129 100644 (file)
@@ -196,7 +196,7 @@ class OC_Migrate{
        * @param optional $uid userid of new user
        */
        public static function import( $path, $type='user', $uid=null ){
-               
+
                $datadir = OC_Config::getValue( 'datadirectory' );
                // Extract the zip
                if( !$extractpath = self::extractZip( $path ) ){
@@ -222,13 +222,13 @@ class OC_Migrate{
                if( self::$exporttype == 'user' ){
                        self::$uid = !is_null($uid) ? $uid : $currentuser;
                }
-               
+
                // We need to be an admin if we are not importing our own data
                if(($type == 'user' && self::$uid != $currentuser) || $type != 'user' ){
                        if( !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
                                // Naughty.
                                OC_Log::write( 'migration', 'Import not permitted.', OC_Log::ERROR );
-                               return json_encode( array( 'success' => false ) );      
+                               return json_encode( array( 'success' => false ) );
                        }
                }
 
@@ -411,7 +411,7 @@ class OC_Migrate{
                                                $success = false;
                                        }
                                }
-       
+
                                // Run the export function?
                                if( $success ){
                                        // Set the provider properties
@@ -421,7 +421,7 @@ class OC_Migrate{
                                        $return['apps'][$provider->getID()]['success'] = false;
                                        $return['apps'][$provider->getID()]['message'] = 'failed to create the app tables';
                                }
-       
+
                                // Now add some app info the the return array
                                $appinfo = OC_App::getAppInfo( $provider->getID() );
                                $return['apps'][$provider->getID()]['version'] = OC_App::getAppVersion($provider->getID());
index 5c89e6bacd66d4b08794350e365303927ba0529c..e04ac224f79123e891c986e8d6780aec69c4ed6f 100644 (file)
  * provides methods to add and access data from the migration
  */
 class OC_Migration_Content{
-       
+
        private $zip=false;
        // Holds the MDB2 object
        private $db=null;
        // Holds an array of tmpfiles to delete after zip creation
        private $tmpfiles=false;
-       
+
        /**
        * @brief sets up the
        * @param $zip ZipArchive object
@@ -42,25 +42,25 @@ class OC_Migration_Content{
 
                $this->zip = $zip;
                $this->db = $db;
-               
+
                if( !is_null( $db ) ){
                        // Get db path
                        $db = $this->db->getDatabase();
                        $this->tmpfiles[] = $db;
                }
-               
+
        }
-       
+
        // @brief prepares the db
        // @param $query the sql query to prepare
        public function prepare( $query ){
-               
+
                // Optimize the query
                $query = $this->processQuery( $query );
-               
+
                // Optimize the query
                $query = $this->db->prepare( $query );
-               
+
                // Die if we have an error (error means: bad query, not 0 results!)
                if( PEAR::isError( $query ) ) {
                        $entry = 'DB Error: "'.$result->getMessage().'"<br />';
@@ -68,11 +68,11 @@ class OC_Migration_Content{
                        OC_Log::write( 'migration', $entry, OC_Log::FATAL );
                        return false;
                } else {
-                       return $query;  
+                       return $query;
                }
-               
+
        }
-       
+
        /**
        * @brief processes the db query
        * @param $query the query to process
@@ -86,7 +86,7 @@ class OC_Migration_Content{
                $query = str_replace( '*PREFIX*', '', $query );
                return $query;
        }
-       
+
        /**
        * @brief copys rows to migration.db from the main database
        * @param $options array of options.
@@ -94,19 +94,19 @@ class OC_Migration_Content{
        */
        public function copyRows( $options ){
                if( !array_key_exists( 'table', $options ) ){
-                       return false;   
+                       return false;
                }
-               
+
                $return = array();
-                                       
+
                // Need to include 'where' in the query?
                if( array_key_exists( 'matchval', $options ) && array_key_exists( 'matchcol', $options ) ){
-                       
+
                        // If only one matchval, create an array
                        if(!is_array($options['matchval'])){
-                               $options['matchval'] = array( $options['matchval'] );   
+                               $options['matchval'] = array( $options['matchval'] );
                        }
-                       
+
                        foreach( $options['matchval'] as $matchval ){
                                // Run the query for this match value (where x = y value)
                                $sql = 'SELECT * FROM `*PREFIX*' . $options['table'] . '` WHERE `' . $options['matchcol'] . '` LIKE ?';
@@ -122,13 +122,13 @@ class OC_Migration_Content{
                        $query = OC_DB::prepare( $sql );
                        $results = $query->execute();
                        $return = $this->insertData( $results, $options );
-       
+
                }
-               
+
                return $return;
-               
+
        }
-       
+
        /**
        * @brief saves a sql data set into migration.db
        * @param $data a sql data set returned from self::prepare()->query()
@@ -144,7 +144,7 @@ class OC_Migration_Content{
                                $fields[] = $field;
                                $values[] = $value;
                        }
-                       
+
                        // Generate some sql
                        $sql = "INSERT INTO `" . $options['table'] . '` ( `';
                        $fieldssql = implode( '`, `', $fields );
@@ -154,7 +154,7 @@ class OC_Migration_Content{
                        // Make the query
                        $query = $this->prepare( $sql );
                        if( !$query ){
-                               OC_Log::write( 'migration', 'Invalid sql produced: '.$sql, OC_Log::FATAL );     
+                               OC_Log::write( 'migration', 'Invalid sql produced: '.$sql, OC_Log::FATAL );
                                return false;
                                exit();
                        } else {
@@ -162,10 +162,10 @@ class OC_Migration_Content{
                                // Do we need to return some values?
                                if( array_key_exists( 'idcol', $options ) ){
                                        // Yes we do
-                                       $return[] = $row[$options['idcol']];    
+                                       $return[] = $row[$options['idcol']];
                                } else {
                                        // Take a guess and return the first field :)
-                                       $return[] = reset($row);        
+                                       $return[] = reset($row);
                                }
                        }
                        $fields = '';
@@ -173,11 +173,11 @@ class OC_Migration_Content{
                }
                return $return;
        }
-       
+
        /**
        * @brief adds a directory to the zip object
        * @param $dir string path of the directory to add
-       * @param $recursive bool 
+       * @param $recursive bool
        * @param $internaldir string path of folder to add dir to in zip
        * @return bool
        */
@@ -186,13 +186,13 @@ class OC_Migration_Content{
            $this->zip->addEmptyDir($internaldir . $dirname);
            $internaldir.=$dirname.='/';
                if( !file_exists( $dir ) ){
-                       return false;   
+                       return false;
                }
            if ($dirhandle = opendir($dir)) {
                        while (false !== ( $file = readdir($dirhandle))) {
-       
+
                                if (( $file != '.' ) && ( $file != '..' )) {
-               
+
                                        if (is_dir($dir . '/' . $file) && $recursive) {
                                                $this->addDir($dir . '/' . $file, $recursive, $internaldir);
                                        } elseif (is_file($dir . '/' . $file)) {
@@ -207,7 +207,7 @@ class OC_Migration_Content{
            }
            return true;
        }
-       
+
        /**
        * @brief adds a file to the zip from a given string
        * @param $data string of data to add
@@ -220,13 +220,13 @@ class OC_Migration_Content{
                $this->tmpfiles[] = $file;
                if( !file_put_contents( $file, $data ) ){
                        OC_Log::write( 'migation', 'Failed to save data to a temporary file', OC_Log::ERROR );
-                       return false;   
+                       return false;
                }
                // Add file to the zip
                $this->zip->addFile( $file, $path );
                return true;
        }
-       
+
        /**
        * @brief closes the zip, removes temp files
        * @return bool
@@ -234,19 +234,19 @@ class OC_Migration_Content{
        public function finish(){
                if( !$this->zip->close() ){
                        OC_Log::write( 'migration', 'Failed to write the zip file with error: '.$this->zip->getStatusString(), OC_Log::ERROR );
-                       return false;   
+                       return false;
                }
                $this->cleanup();
-               return true;    
-       }       
-       
+               return true;
+       }
+
                /**
        * @brief cleans up after the zip
        */
        private function cleanup(){
                // Delete tmp files
                foreach($this->tmpfiles as $i){
-                       unlink( $i );   
-               }       
+                       unlink( $i );
+               }
        }
 }
index 91336f3019d178063d1399e22290e594f60c3252..259b1fe7ae69235850f6c6059df8dd4d51e3f44c 100644 (file)
@@ -3,37 +3,37 @@
  * provides search functionalty
  */
 abstract class OC_Migration_Provider{
-       
+
        protected $id=false;
-       protected $content=false; 
+       protected $content=false;
        protected $uid=false;
        protected $olduid=false;
        protected $appinfo=false;
-       
+
        public function __construct( $appid ){
                // Set the id
                $this->id = $appid;
                OC_Migrate::registerProvider( $this );
        }
-       
+
        /**
         * @brief exports data for apps
         * @return array appdata to be exported
         */
        abstract function export( );
-       
+
        /**
         * @brief imports data for the app
         * @return void
         */
        abstract function import( );
-       
+
        /**
        * @brief sets the OC_Migration_Content object to $this->content
        * @param $content a OC_Migration_Content object
        */
        public function setData( $uid, $content, $info=null ){
-               $this->content = $content;      
+               $this->content = $content;
                $this->uid = $uid;
                $id = $this->id;
                if( !is_null( $info ) ){
@@ -41,12 +41,12 @@ abstract class OC_Migration_Provider{
                        $this->appinfo = $info->apps->$id;
                }
        }
-               
+
        /**
        * @brief returns the appid of the provider
        * @return string
        */
        public function getID(){
-               return $this->id;       
+               return $this->id;
        }
 }
index 3157aae99e64739f57158832423648364fb4bfc5..ad01e5c42fa838df4264b31649fa1918c66c5eee 100644 (file)
@@ -153,27 +153,27 @@ class OC_OCS {
                        OC_OCS::privatedatadelete($format, $app, $key);
 
                // CLOUD
-               // systemWebApps 
+               // systemWebApps
                }elseif(($method=='get') and ($ex[$paracount-5] == 'v1.php') and ($ex[$paracount-4]=='cloud') and ($ex[$paracount-3] == 'system') and ($ex[$paracount-2] == 'webapps')){
                        OC_OCS::systemwebapps($format);
 
-               // quotaget 
+               // quotaget
                }elseif(($method=='get') and ($ex[$paracount-6] == 'v1.php') and ($ex[$paracount-5]=='cloud') and ($ex[$paracount-4] == 'user') and ($ex[$paracount-2] == 'quota')){
                        $user=$ex[$paracount-3];
                        OC_OCS::quotaget($format,$user);
 
-               // quotaset 
+               // quotaset
                }elseif(($method=='post') and ($ex[$paracount-6] == 'v1.php') and ($ex[$paracount-5]=='cloud') and ($ex[$paracount-4] == 'user') and ($ex[$paracount-2] == 'quota')){
                        $user=$ex[$paracount-3];
                        $quota = self::readData('post', 'quota', 'int');
                        OC_OCS::quotaset($format,$user,$quota);
 
-               // keygetpublic 
+               // keygetpublic
                }elseif(($method=='get') and ($ex[$paracount-6] == 'v1.php') and ($ex[$paracount-5]=='cloud') and ($ex[$paracount-4] == 'user') and ($ex[$paracount-2] == 'publickey')){
                        $user=$ex[$paracount-3];
                        OC_OCS::publicKeyGet($format,$user);
 
-               // keygetprivate 
+               // keygetprivate
                }elseif(($method=='get') and ($ex[$paracount-6] == 'v1.php') and ($ex[$paracount-5]=='cloud') and ($ex[$paracount-4] == 'user') and ($ex[$paracount-2] == 'privatekey')){
                        $user=$ex[$paracount-3];
                        OC_OCS::privateKeyGet($format,$user);
@@ -501,7 +501,7 @@ class OC_OCS {
                        echo(OC_OCS::generatexml($format,'ok',100,''));
                }
        }
-       
+
        /**
        * get private data
        * @param string $user
index ae35470cff6f24d1870a4b17994c24f1f49b1ea8..9d51004669727cee657426ef110dce3cb07559db 100644 (file)
@@ -29,7 +29,7 @@
 class OC_OCSClient{
 
        /**
-        * @brief Get the url of the OCS AppStore server. 
+        * @brief Get the url of the OCS AppStore server.
         * @returns string of the AppStore server
         *
         * This function returns the url of the OCS AppStore server. It´s possible to set it in the config file or it will fallback to the default
@@ -40,7 +40,7 @@ class OC_OCSClient{
        }
 
         /**
-         * @brief Get the url of the OCS KB server. 
+         * @brief Get the url of the OCS KB server.
          * @returns string of the KB server
          * This function returns the url of the OCS knowledge base server. It´s possible to set it in the config file or it will fallback to the default
          */
@@ -61,13 +61,13 @@ class OC_OCSClient{
                        return NULL;
                }
                $url=OC_OCSClient::getAppStoreURL().'/content/categories';
-       
+
                $xml=@file_get_contents($url);
                if($xml==FALSE){
                        return NULL;
                }
                $data=simplexml_load_string($xml);
-       
+
                $tmp=$data->data;
                $cats=array();
 
@@ -119,9 +119,9 @@ class OC_OCSClient{
                        $app['preview']=(string)$tmp[$i]->smallpreviewpic1;
                        $app['changed']=strtotime($tmp[$i]->changed);
                        $app['description']=(string)$tmp[$i]->description;
-       
+
                        $apps[]=$app;
-               } 
+               }
                return $apps;
        }
 
@@ -184,7 +184,7 @@ class OC_OCSClient{
 
                $tmp=$data->data->content;
                $app=array();
-               if(isset($tmp->downloadlink)) { 
+               if(isset($tmp->downloadlink)) {
                        $app['downloadlink']=$tmp->downloadlink;
                }else{
                        $app['downloadlink']='';
@@ -199,7 +199,7 @@ class OC_OCSClient{
         *
         * This function returns a list of all the knowledgebase entries from the OCS server
         */
-       public static function getKnownledgebaseEntries($page,$pagesize,$search=''){    
+       public static function getKnownledgebaseEntries($page,$pagesize,$search=''){
                if(OC_Config::getValue('knowledgebaseenabled', true)==false){
                        $kbe=array();
                        $kbe['totalitems']=0;
index b6c4c3a163fb83b0eb762c5913177552125650ee..de5747fcccce51b46ec7fcf90fda77b125009a68 100644 (file)
@@ -116,7 +116,7 @@ class OC_Preferences{
                // Try to fetch the value, return default if not exists.
                $query = OC_DB::prepare( 'SELECT `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?' );
                $result = $query->execute( array( $user, $app, $key ));
-               
+
                $row = $result->fetchRow();
                if($row){
                        return $row["configvalue"];
index e74f155074029cec03d6056acde520dbeaa9a7f4..be38bbff98a68226d99424d234dc6269be413bb2 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
 
-// use OCP namespace for all classes that are considered public. 
+// use OCP namespace for all classes that are considered public.
 // This means that they should be used by apps instead of the internal ownCloud classes
 namespace OCP;
 
@@ -130,7 +130,7 @@ class App {
 
 
         /**
-         * @brief Check if the app is enabled, redirects to home if not 
+         * @brief Check if the app is enabled, redirects to home if not
          * @param $app app
          * @returns true/false
         */
@@ -140,7 +140,7 @@ class App {
 
 
         /**
-         * @brief Get the last version of the app, either from appinfo/version or from appinfo/info.xml 
+         * @brief Get the last version of the app, either from appinfo/version or from appinfo/info.xml
          * @param $app app
          * @returns true/false
          */
index 834bebb5c3c7debc082ba5130d47f1d101320f77..2962346dbc9271b85c1ddb020383fe7d95a4aa5f 100644 (file)
@@ -24,7 +24,7 @@
  * Public interface of ownCloud forbackground jobs.
  */
 
-// use OCP namespace for all classes that are considered public. 
+// use OCP namespace for all classes that are considered public.
 // This means that they should be used by apps instead of the internal ownCloud classes
 namespace OCP;
 
@@ -42,7 +42,7 @@ namespace OCP;
  * An example of the queued task would be the creation of the thumbnail. As
  * soon as the user uploads a picture the gallery app registers the queued
  * task "create thumbnail" and saves the path in the parameter instead of doing
- * the work right away. This makes the app more responsive. As soon as the task 
+ * the work right away. This makes the app more responsive. As soon as the task
  * is done it will be deleted from the list.
  */
 class BackgroundJob {
index ab01902ffe60e13d673ebfa8476711ad88a7e460..f3120b9aaa209023c98a170b5dc2097a9151466d 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 /**
- * @brief use OCP namespace for all classes that are considered public. 
+ * @brief use OCP namespace for all classes that are considered public.
  *
  * Classes that use this namespace are for use by apps, and not for use by internal
  * OC classes
index 23c670cf442a425cc3a81e78d8ec52796599da04..e1da62e2d274b64372416d0b3f7e7cd22edfc084 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
 
-// use OCP namespace for all classes that are considered public. 
+// use OCP namespace for all classes that are considered public.
 // This means that they should be used by apps instead of the internal ownCloud classes
 namespace OCP;
 
index 32b3f03674484193044e45081d6ef0c10f8b946b..be5952d362a2e0240c9f68656978d85b8bb84c35 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
 
-// use OCP namespace for all classes that are considered public. 
+// use OCP namespace for all classes that are considered public.
 // This means that they should be used by apps instead of the internal ownCloud classes
 namespace OCP;
 
index 99df79173eb85dbff1d75660fd2bd7c510465d7c..2a74535f41711fce58741832f96e639f8f42a1c0 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
 
-// use OCP namespace for all classes that are considered public. 
+// use OCP namespace for all classes that are considered public.
 // This means that they should be used by apps instead of the internal ownCloud classes
 namespace OCP;
 
@@ -47,17 +47,17 @@ class JSON {
 
        /**
        * Check if the user is logged in, send json error msg if not.
-       * 
+       *
        * This method checks if a user is logged in. If not, a json error
        * response will be return and the method will exit from execution
        * of the script.
        * The returned json will be in the format:
-       * 
+       *
        *     {"status":"error","data":{"message":"Authentication error."}}
-       * 
+       *
        * Add this call to the start of all ajax method files that requires
        * an authenticated user.
-       * 
+       *
        * @return string json formatted error string if not authenticated.
        */
        public static function checkLoggedIn(){
@@ -66,22 +66,22 @@ class JSON {
 
        /**
        * Check an ajax get/post call if the request token is valid.
-       * 
+       *
        * This method checks for a valid variable 'requesttoken' in $_GET,
        * $_POST and $_SERVER. If a valid token is not found, a json error
        * response will be return and the method will exit from execution
        * of the script.
        * The returned json will be in the format:
-       * 
+       *
        *     {"status":"error","data":{"message":"Token expired. Please reload page."}}
-       * 
-       * Add this call to the start of all ajax method files that creates, 
+       *
+       * Add this call to the start of all ajax method files that creates,
        * updates or deletes anything.
        * In cases where you e.g. use an ajax call to load a dialog containing
        * a submittable form, you will need to add the requesttoken first as a
        * parameter to the ajax call, then assign it to the template and finally
        * add a hidden input field also named 'requesttoken' containing the value.
-       * 
+       *
        * @return string json formatted error string if not valid.
        */
        public static function callCheck(){
@@ -90,10 +90,10 @@ class JSON {
 
        /**
        * Send json success msg
-       * 
+       *
        * Return a json success message with optional extra data.
        * @see OCP\JSON::error()                for the format to use.
-       * 
+       *
        * @param array $data The data to use
        * @return string json formatted string.
        */
@@ -103,19 +103,19 @@ class JSON {
 
        /**
        * Send json error msg
-       * 
-       * Return a json error message with optional extra data for 
+       *
+       * Return a json error message with optional extra data for
        * error message or app specific data.
-       * 
+       *
        * Example use:
-       * 
+       *
        *     $id = [some value]
        *     OCP\JSON::error(array('data':array('message':'An error happened', 'id': $id)));
-       * 
+       *
        * Will return the json formatted string:
-       * 
+       *
        *     {"status":"error","data":{"message":"An error happened", "id":[some value]}}
-       * 
+       *
        * @param array $data The data to use
        * @return string json formatted error string.
        */
@@ -134,17 +134,17 @@ class JSON {
 
        /**
        * Check if the App is enabled and send JSON error message instead
-       * 
+       *
        * This method checks if a specific app is enabled. If not, a json error
        * response will be return and the method will exit from execution
        * of the script.
        * The returned json will be in the format:
-       * 
+       *
        *     {"status":"error","data":{"message":"Application is not enabled."}}
-       * 
+       *
        * Add this call to the start of all ajax method files that requires
        * a specific app to be enabled.
-       * 
+       *
        * @param string $app The app to check
        * @return string json formatted string if not enabled.
        */
@@ -154,17 +154,17 @@ class JSON {
 
        /**
        * Check if the user is a admin, send json error msg if not
-       * 
+       *
        * This method checks if the current user has admin rights. If not, a json error
        * response will be return and the method will exit from execution
        * of the script.
        * The returned json will be in the format:
-       * 
+       *
        *     {"status":"error","data":{"message":"Authentication error."}}
-       * 
+       *
        * Add this call to the start of all ajax method files that requires
        * administrative rights.
-       * 
+       *
        * @return string json formatted string if not admin user.
        */
        public static function checkAdminUser(){
index 8dff3bcd3541eae97dada5703315eddc24511ad9..febb3f1436117529edb725bc172c73688f6a0c2c 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
 
-// use OCP namespace for all classes that are considered public. 
+// use OCP namespace for all classes that are considered public.
 // This means that they should be used by apps instead of the internal ownCloud classes
 namespace OCP;
 
index a0ed618cb2c5f16f4a87e872170c36f7ae556d69..11c740d13acc94781306e0e12ed7d3afdbed7f24 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
 
-// use OCP namespace for all classes that are considered public. 
+// use OCP namespace for all classes that are considered public.
 // This means that they should be used by apps instead of the internal ownCloud classes
 namespace OCP;
 
@@ -88,13 +88,13 @@ function simple_file_size($bytes) {
 
 /**
  * @brief Generate html code for an options block.
- * @param $options the options 
- * @param $selected which one is selected? 
- * @param $params the parameters 
+ * @param $options the options
+ * @param $selected which one is selected?
+ * @param $params the parameters
  * @returns html options
  */
 function html_select_options($options, $selected, $params=array()) {
-       return(\html_select_options($options, $selected, $params)); 
+       return(\html_select_options($options, $selected, $params));
 }
 
 
index 2fa599488a7a013ca6c86d3784cfb8e9b5d80dc1..6228268d75b829b4a0b7af23980784070594dbc3 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
 
-// use OCP namespace for all classes that are considered public. 
+// use OCP namespace for all classes that are considered public.
 // This means that they should be used by apps instead of the internal ownCloud classes
 namespace OCP;
 
index f8a4b8e96eb16470ebb30aebf5881baf8989e02c..9dfd0cf69efe6afd1143cc4352c37901d324d634 100644 (file)
@@ -27,7 +27,7 @@
 class OC_Search{
        static private $providers=array();
        static private $registeredProviders=array();
-       
+
        /**
         * remove all registered search providers
         */
@@ -35,7 +35,7 @@ class OC_Search{
                self::$providers=array();
                self::$registeredProviders=array();
        }
-       
+
        /**
         * register a new search provider to be used
         * @param string $provider class name of a OC_Search_Provider
@@ -43,7 +43,7 @@ class OC_Search{
        public static function registerProvider($class,$options=array()){
                self::$registeredProviders[]=array('class'=>$class,'options'=>$options);
        }
-       
+
        /**
         * search all provider for $query
         * @param string query
@@ -57,7 +57,7 @@ class OC_Search{
                }
                return $results;
        }
-       
+
        /**
         * create instances of all the registered search providers
         */
index b3ee79b477091ea14a8720f23a59f10f082c83ae..b83c5aa61b6446c781d228d8c30a7447ca797fa5 100644 (file)
@@ -4,11 +4,11 @@
  */
 abstract class OC_Search_Provider {
        private $options;
-       
+
        public function __construct($options){
                $this->options=$options;
        }
-       
+
        /**
         * search for $query
         * @param string $query
index f7e8c6950ce0c1fe2d1fb8d59355305bed5a0fa5..e60a461debf2868f9a54f967cb3df5423ef1af28 100644 (file)
@@ -18,7 +18,7 @@ if(isset($_POST['install']) AND $_POST['install']=='true') {
        // We have to launch the installation process :
        $e = OC_Setup::install($_POST);
        $errors = array('errors' => $e);
-       
+
        if(count($e) > 0) {
                //OC_Template::printGuestPage("", "error", array("errors" => $errors));
                $options = array_merge($_POST, $opts, $errors);
@@ -37,7 +37,7 @@ class OC_Setup {
        public static function install($options) {
                $error = array();
                $dbtype = $options['dbtype'];
-               
+
                if(empty($options['adminlogin'])) {
                        $error[] = 'Set an admin username.';
                }
@@ -72,7 +72,7 @@ class OC_Setup {
                        $username = htmlspecialchars_decode($options['adminlogin']);
                        $password = htmlspecialchars_decode($options['adminpass']);
                        $datadir = htmlspecialchars_decode($options['directory']);
-                       
+
                        //use sqlite3 when available, otherise sqlite2 will be used.
                        if($dbtype=='sqlite' and class_exists('SQLite3')){
                                $dbtype='sqlite3';
@@ -107,7 +107,7 @@ class OC_Setup {
                                }
                                else {
                                        $oldUser=OC_Config::getValue('dbuser', false);
-                                       
+
                                        $query="SELECT user FROM mysql.user WHERE user='$dbuser'"; //this should be enough to check for admin rights in mysql
                                        if(mysql_query($query, $connection)) {
                                                //use the admin login data for the new database user
@@ -184,9 +184,9 @@ class OC_Setup {
                                                $dbusername='oc_'.$username;
                                                //create a new password so we don't need to store the admin config in the config file
                                                $dbpassword=md5(time());
-                                               
+
                                                self::pg_createDBUser($dbusername, $dbpassword, $connection);
-                                               
+
                                                OC_CONFIG::setValue('dbuser', $dbusername);
                                                OC_CONFIG::setValue('dbpassword', $dbpassword);
 
@@ -257,7 +257,7 @@ class OC_Setup {
                                         );
                                         return $error;
                                 } else {
-                                        //check for roles creation rights in oracle             
+                                        //check for roles creation rights in oracle
 
                                         $query="SELECT count(*) FROM user_role_privs, role_sys_privs WHERE user_role_privs.granted_role = role_sys_privs.role AND privilege = 'CREATE ROLE'";
                                         $stmt = oci_parse($connection, $query);
@@ -342,7 +342,7 @@ class OC_Setup {
                                                 }
                                         }
                                 }
-                        }                   
+                        }
                        else {
                                //delete the old sqlite database first, might cause infinte loops otherwise
                                if(file_exists("$datadir/owncloud.db")){
@@ -428,7 +428,7 @@ class OC_Setup {
                        }
                }
                $query = "REVOKE ALL PRIVILEGES ON DATABASE \"$e_name\" FROM PUBLIC";
-               $result = pg_query($connection, $query);                
+               $result = pg_query($connection, $query);
        }
 
        private static function pg_createDBUser($name,$password,$connection) {
@@ -463,7 +463,7 @@ class OC_Setup {
                }
        }
         /**
-         * 
+         *
          * @param String $name
          * @param String $password
          * @param String $tablespace
index 718fe922ffe424c4b03f98489d25c1dcf45f6a2c..4752492df3091f2ce74a685aad9fdc5a3f4eab6e 100644 (file)
@@ -3,7 +3,7 @@
  * ownCloud
  *
  * @author Georg Ehrke
- * @copyright 2012 Georg Ehrke 
+ * @copyright 2012 Georg Ehrke
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -85,7 +85,7 @@ class OC_SubAdmin{
                }
                return $uids;
        }
-       
+
        /**
         * @brief get all SubAdmins
         * @return array
@@ -99,7 +99,7 @@ class OC_SubAdmin{
                }
                return $subadmins;
        }
-       
+
        /**
         * @brief checks if a user is a SubAdmin of a group
         * @param $uid uid of the subadmin
@@ -115,7 +115,7 @@ class OC_SubAdmin{
                }
                return false;
        }
-       
+
        /**
         * @brief checks if a user is a SubAdmin
         * @param $uid uid of the subadmin
@@ -130,7 +130,7 @@ class OC_SubAdmin{
                }
                return false;
        }
-       
+
        /**
         * @brief checks if a user is a accessible by a subadmin
         * @param $subadmin uid of the subadmin
@@ -152,7 +152,7 @@ class OC_SubAdmin{
                }
                return false;
        }
-       
+
        /*
         * @brief alias for self::isSubAdminofGroup()
         */
@@ -162,7 +162,7 @@ class OC_SubAdmin{
 
        /**
         * @brief delete all SubAdmins by uid
-        * @param $parameters 
+        * @param $parameters
         * @return boolean
         */
        public static function post_deleteUser($parameters){
index a10ddcd5c33156be30c4598192f675177a1ca317..609c8da97638992094de43bda1b2e1401fb8c958 100644 (file)
@@ -161,7 +161,7 @@ class OC_Template{
                 header('X-Frame-Options: Sameorigin');
                 header('X-XSS-Protection: 1; mode=block');
                 header('X-Content-Type-Options: nosniff');
+
                $this->findTemplate($name);
        }
 
@@ -208,13 +208,13 @@ class OC_Template{
                        $_SESSION['formfactor']=$_GET['formfactor'];
                }
                $formfactor=$_SESSION['formfactor'];
-               if($formfactor=='default') { 
+               if($formfactor=='default') {
                        $fext='';
-               }elseif($formfactor=='mobile') { 
+               }elseif($formfactor=='mobile') {
                        $fext='.mobile';
-               }elseif($formfactor=='tablet') { 
+               }elseif($formfactor=='tablet') {
                        $fext='.tablet';
-               }elseif($formfactor=='standalone') { 
+               }elseif($formfactor=='standalone') {
                        $fext='.standalone';
                }else{
                        $fext='';
index c14ef2d6ca643bf6c4bf365faa225410e15d343a..c432f6074a608358000c96be608ff081311f08d2 100644 (file)
@@ -385,7 +385,7 @@ class OC_User {
                }
                return false;
        }
-       
+
        /**
         * disables a user
         * @param string $userid the user to disable
@@ -395,7 +395,7 @@ class OC_User {
                $query = OC_DB::prepare($query);
                $query->execute(array($userid, 'core', 'enabled', 'false'));
        }
-       
+
        /**
         * enable a user
         * @param string $userid
@@ -405,7 +405,7 @@ class OC_User {
                $query = OC_DB::prepare($query);
                $query->execute(array($userid, 'core', 'enabled', 'false'));
        }
-       
+
        /**
         * checks if a user is enabled
         * @param string $userid
index dc11614cc57acf1ad998b781c88f1bf2f2581c36..52f3b35fa5c99ae46bc3f5999ac5fb424a170e2b 100644 (file)
@@ -43,7 +43,7 @@ class OC_User_Database extends OC_User_Backend {
         * @var PasswordHash
         */
        static private $hasher=null;
-       
+
        private function getHasher(){
                if(!self::$hasher){
                        //we don't want to use DES based crypt(), since it doesn't return a has with a recognisable prefix
@@ -53,7 +53,7 @@ class OC_User_Database extends OC_User_Backend {
                return self::$hasher;
 
        }
-       
+
        /**
         * @brief Create a new user
         * @param $uid The username of the user to create
@@ -172,7 +172,7 @@ class OC_User_Database extends OC_User_Backend {
        public function userExists($uid){
                $query = OC_DB::prepare( 'SELECT * FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)' );
                $result = $query->execute( array( $uid ));
-               
+
                return $result->numRows() > 0;
        }
 
index 547c0201b699877a1a725c47afa423afeb0ad458..5149678e4ed30073d73f284c813568c3c8c5e023 100644 (file)
@@ -41,9 +41,9 @@ class OC_User_HTTP extends OC_User_Backend {
                        $url.='?'.$parts['query'];
                }
                return array($parts['user'],$url);
-               
+
        }
-       
+
        /**
         * check if an url is a valid login
         * @param string url
@@ -52,7 +52,7 @@ class OC_User_HTTP extends OC_User_Backend {
        private function matchUrl($url){
                return ! is_null(parse_url($url,PHP_URL_USER));
        }
-       
+
        /**
         * @brief Check if the password is correct
         * @param $uid The username
@@ -67,7 +67,7 @@ class OC_User_HTTP extends OC_User_Backend {
                        return false;
                }
                list($user,$url)=$this->parseUrl($uid);
-               
+
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, $url);
                curl_setopt($ch, CURLOPT_USERPWD, $user.':'.$password);
@@ -76,7 +76,7 @@ class OC_User_HTTP extends OC_User_Backend {
                curl_exec($ch);
 
                $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
-               
+
                curl_close($ch);
 
                return $status==200;
index 720f2cdeefd66ed48c77a37e5ab54e38f1b5aa65..f543f742ac17834baf61aa628a4dbaa03b8a86f2 100755 (executable)
@@ -40,7 +40,7 @@ class OC_Util {
                                mkdir( $userdirectory, 0755, true );
                        }
                        OC_Filesystem::mount('OC_Filestorage_Local',array('datadir'=>$user_root), $user);
-                       
+
                        //jail the user into his "home" directory
                        OC_Filesystem::init($user_dir);
                        $quotaProxy=new OC_FileProxy_Quota();
@@ -62,9 +62,9 @@ class OC_Util {
        public static function setupFS4all(){
                foreach(OC_User::getUsers() as $user){
                        OC_Filesystem::mount('OC_Filestorage_Local',array('datadir'=>OC_User::getHome($singleuser)), $user);
-               }       
+               }
        }
-       
+
        public static function tearDownFS(){
                OC_Filesystem::tearDown();
                self::$fsSetup=false;
@@ -211,7 +211,7 @@ class OC_Util {
                // Check if there is a writable install folder.
                if(OC_Config::getValue('appstoreenabled', true)) {
                        if( OC_App::getInstallPath() === null  || !is_writable(OC_App::getInstallPath())) {
-                               $errors[]=array('error'=>"Can't write into apps directory",'hint'=>"You can usually fix this by giving the webserver user write access to the apps directory 
+                               $errors[]=array('error'=>"Can't write into apps directory",'hint'=>"You can usually fix this by giving the webserver user write access to the apps directory
                                in owncloud or disabling the appstore in the config file.");
                        }
                }
@@ -410,15 +410,15 @@ 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($value+$maxtime<time()){
                                                // remove outdated tokens
-                                               unset($_SESSION[$key]);                                         
+                                               unset($_SESSION[$key]);
                                        }
-                               }       
+                               }
                        }
                }
                // return the token
@@ -465,13 +465,13 @@ class OC_Util {
                        exit;
                }
        }
-       
+
        /**
         * @brief Public function to sanitize HTML
         *
         * This function is used to sanitize HTML and should be applied on any
         * string or array of strings before displaying it on a web page.
-        * 
+        *
         * @param string or array of strings
         * @return array with sanitized strings or a single sanitized string, depends on the input parameter.
         */
index 20d9e3b5d6193888f11283ec42fc73f19d537afd..60cc034f780900714feb07ac4c23dd0a6ff29eaa 100644 (file)
@@ -219,7 +219,7 @@ class OC_VCategories {
                if(!is_array($haystack)) {
                        return false;
                }
-               return array_search(strtolower($needle),array_map('strtolower',$haystack)); 
+               return array_search(strtolower($needle),array_map('strtolower',$haystack));
        }
 
 }