]> source.dussan.org Git - nextcloud-server.git/commitdiff
More whitespace fixes
authorBart Visscher <bartv@thisnet.nl>
Fri, 14 Dec 2012 22:16:32 +0000 (23:16 +0100)
committerBart Visscher <bartv@thisnet.nl>
Fri, 14 Dec 2012 23:43:46 +0000 (00:43 +0100)
apps/user_ldap/lib/access.php
lib/app.php
lib/migrate.php
lib/public/contacts.php
settings/js/users.js

index e1eea2f46c06f12ea95d5e6877ecd5c9a45cdf11..a4123cde57a2d6759edd6ef3575b0f00472e0865 100644 (file)
@@ -347,20 +347,20 @@ abstract class Access {
        }
 
        private function findMappedGroup($dn) {
-                static $query = null;
+               static $query = null;
                if(is_null($query)) {
                        $query = \OCP\DB::prepare('
-                               SELECT `owncloud_name`
-                               FROM `'.$this->getMapTable(false).'`
-                               WHERE `ldap_dn` = ?'
-                       );
+                                       SELECT `owncloud_name`
+                                       FROM `'.$this->getMapTable(false).'`
+                                       WHERE `ldap_dn` = ?'
+                       );
                }
-                $res = $query->execute(array($dn))->fetchOne();
+               $res = $query->execute(array($dn))->fetchOne();
                if($res) {
-                        return  $res;
-                }
+                       return  $res;
+               }
                return false;
-        }
+       }
 
 
        private function ldap2ownCloudNames($ldapObjects, $isUsers) {
index 5d4fbbd9c2322420004b0282cb18a95b65f9c8d0..be6d5ab3dd34f0907831944de59bef22fa23cd15 100755 (executable)
@@ -597,16 +597,16 @@ class OC_App{
                                $app1[$i]['internal'] = $app1[$i]['active'] = 0;
 
                                // rating img
-                               if($app['score']>=0     and $app['score']<5)    $img=OC_Helper::imagePath( "core", "rating/s1.png" );
-                               elseif($app['score']>=5 and $app['score']<15)   $img=OC_Helper::imagePath( "core", "rating/s2.png" );
-                               elseif($app['score']>=15 and $app['score']<25)  $img=OC_Helper::imagePath( "core", "rating/s3.png" );
-                               elseif($app['score']>=25 and $app['score']<35)  $img=OC_Helper::imagePath( "core", "rating/s4.png" );
-                               elseif($app['score']>=35 and $app['score']<45)  $img=OC_Helper::imagePath( "core", "rating/s5.png" );
-                               elseif($app['score']>=45 and $app['score']<55)  $img=OC_Helper::imagePath( "core", "rating/s6.png" );
-                               elseif($app['score']>=55 and $app['score']<65)  $img=OC_Helper::imagePath( "core", "rating/s7.png" );
-                               elseif($app['score']>=65 and $app['score']<75)  $img=OC_Helper::imagePath( "core", "rating/s8.png" );
-                               elseif($app['score']>=75 and $app['score']<85)  $img=OC_Helper::imagePath( "core", "rating/s9.png" );
-                               elseif($app['score']>=85 and $app['score']<95)  $img=OC_Helper::imagePath( "core", "rating/s10.png" );
+                               if($app['score']>=0     and $app['score']<5)    $img=OC_Helper::imagePath( "core", "rating/s1.png" );
+                               elseif($app['score']>=5 and $app['score']<15)   $img=OC_Helper::imagePath( "core", "rating/s2.png" );
+                               elseif($app['score']>=15 and $app['score']<25)  $img=OC_Helper::imagePath( "core", "rating/s3.png" );
+                               elseif($app['score']>=25 and $app['score']<35)  $img=OC_Helper::imagePath( "core", "rating/s4.png" );
+                               elseif($app['score']>=35 and $app['score']<45)  $img=OC_Helper::imagePath( "core", "rating/s5.png" );
+                               elseif($app['score']>=45 and $app['score']<55)  $img=OC_Helper::imagePath( "core", "rating/s6.png" );
+                               elseif($app['score']>=55 and $app['score']<65)  $img=OC_Helper::imagePath( "core", "rating/s7.png" );
+                               elseif($app['score']>=65 and $app['score']<75)  $img=OC_Helper::imagePath( "core", "rating/s8.png" );
+                               elseif($app['score']>=75 and $app['score']<85)  $img=OC_Helper::imagePath( "core", "rating/s9.png" );
+                               elseif($app['score']>=85 and $app['score']<95)  $img=OC_Helper::imagePath( "core", "rating/s10.png" );
                                elseif($app['score']>=95 and $app['score']<100) $img=OC_Helper::imagePath( "core", "rating/s11.png" );
 
                                $app1[$i]['score'] = '<img src="'.$img.'"> Score: '.$app['score'].'%';
index f41441bedbb2c6bae4e77d1fe473979520cbdb79..5ff8e338a442b887517858f709ca77a402ccabf9 100644 (file)
@@ -80,65 +80,65 @@ class OC_Migrate{
         */
        public static function export( $uid=null, $type='user', $path=null ) {
                $datadir = OC_Config::getValue( 'datadirectory' );
-               // Validate export type
-               $types = array( 'user', 'instance', 'system', 'userfiles' );
-               if( !in_array( $type, $types ) ) {
-                       OC_Log::write( 'migration', 'Invalid export type', OC_Log::ERROR );
-                       return json_encode( array( 'success' => false )  );
-               }
-               self::$exporttype = $type;
-               // Userid?
-               if( self::$exporttype == 'user' ) {
-                       // Check user exists
-                       self::$uid = is_null($uid) ? OC_User::getUser() : $uid;
-                       if(!OC_User::userExists(self::$uid)) {
-                               return json_encode( array( 'success' => false) );
-                       }
-               }
-               // Calculate zipname
-               if( self::$exporttype == 'user' ) {
-                       $zipname = 'oc_export_' . self::$uid . '_' . date("y-m-d_H-i-s") . '.zip';
-               } else {
-                       $zipname = 'oc_export_' . self::$exporttype . '_' . date("y-m-d_H-i-s") . '.zip';
-               }
-               // Calculate path
-               if( self::$exporttype == 'user' ) {
-                       self::$zippath = $datadir . '/' . self::$uid . '/' . $zipname;
-               } else {
-                       if( !is_null( $path ) ) {
-                               // Validate custom path
-                               if( !file_exists( $path ) || !is_writeable( $path ) ) {
-                                       OC_Log::write( 'migration', 'Path supplied is invalid.', OC_Log::ERROR );
-                                       return json_encode( array( 'success' => false ) );
-                               }
-                               self::$zippath = $path . $zipname;
-                       } else {
-                               // Default path
-                               self::$zippath = get_temp_dir() . '/' . $zipname;
-                       }
-               }
-               // Create the zip object
-               if( !self::createZip() ) {
-                       return json_encode( array( 'success' => false ) );
-               }
-               // Do the export
-               self::findProviders();
-               $exportdata = array();
-               switch( self::$exporttype ) {
-                       case 'user':
-                               // Connect to the db
-                               self::$dbpath = $datadir . '/' . self::$uid . '/migration.db';
-                               if( !self::connectDB() ) {
-                                       return json_encode( array( 'success' => false ) );
-                               }
-                               self::$content = new OC_Migration_Content( self::$zip, self::$MDB2 );
-                               // Export the app info
-                           $exportdata = self::exportAppData();
+               // Validate export type
+               $types = array( 'user', 'instance', 'system', 'userfiles' );
+               if( !in_array( $type, $types ) ) {
+                       OC_Log::write( 'migration', 'Invalid export type', OC_Log::ERROR );
+                       return json_encode( array( 'success' => false )  );
+               }
+               self::$exporttype = $type;
+               // Userid?
+               if( self::$exporttype == 'user' ) {
+                       // Check user exists
+                       self::$uid = is_null($uid) ? OC_User::getUser() : $uid;
+                       if(!OC_User::userExists(self::$uid)) {
+                               return json_encode( array( 'success' => false) );
+                       }
+               }
+               // Calculate zipname
+               if( self::$exporttype == 'user' ) {
+                       $zipname = 'oc_export_' . self::$uid . '_' . date("y-m-d_H-i-s") . '.zip';
+               } else {
+                       $zipname = 'oc_export_' . self::$exporttype . '_' . date("y-m-d_H-i-s") . '.zip';
+               }
+               // Calculate path
+               if( self::$exporttype == 'user' ) {
+                       self::$zippath = $datadir . '/' . self::$uid . '/' . $zipname;
+               } else {
+                       if( !is_null( $path ) ) {
+                               // Validate custom path
+                               if( !file_exists( $path ) || !is_writeable( $path ) ) {
+                                       OC_Log::write( 'migration', 'Path supplied is invalid.', OC_Log::ERROR );
+                                       return json_encode( array( 'success' => false ) );
+                               }
+                               self::$zippath = $path . $zipname;
+                       } else {
+                               // Default path
+                               self::$zippath = get_temp_dir() . '/' . $zipname;
+                       }
+               }
+               // Create the zip object
+               if( !self::createZip() ) {
+                       return json_encode( array( 'success' => false ) );
+               }
+               // Do the export
+               self::findProviders();
+               $exportdata = array();
+               switch( self::$exporttype ) {
+                       case 'user':
+                               // Connect to the db
+                               self::$dbpath = $datadir . '/' . self::$uid . '/migration.db';
+                               if( !self::connectDB() ) {
+                                       return json_encode( array( 'success' => false ) );
+                               }
+                               self::$content = new OC_Migration_Content( self::$zip, self::$MDB2 );
+                               // Export the app info
+                               $exportdata = self::exportAppData();
                                // Add the data dir to the zip
                                self::$content->addDir(OC_User::getHome(self::$uid), true, '/' );
-                       break;
-                       case 'instance':
-                               self::$content = new OC_Migration_Content( self::$zip );
+                               break;
+                       case 'instance':
+                               self::$content = new OC_Migration_Content( self::$zip );
                                // Creates a zip that is compatable with the import function
                                $dbfile = tempnam( get_temp_dir(), "owncloud_export_data_" );
                                OC_DB::getDbStructure( $dbfile, 'MDB2_SCHEMA_DUMP_ALL');
@@ -155,32 +155,32 @@ class OC_Migrate{
                                foreach(OC_User::getUsers() as $user) {
                                        self::$content->addDir(OC_User::getHome($user), true, "/userdata/" );
                                }
-                       break;
+                               break;
                        case 'userfiles':
                                self::$content = new OC_Migration_Content( self::$zip );
                                // Creates a zip with all of the users files
                                foreach(OC_User::getUsers() as $user) {
                                        self::$content->addDir(OC_User::getHome($user), true, "/" );
                                }
-                       break;
+                               break;
                        case 'system':
                                self::$content = new OC_Migration_Content( self::$zip );
                                // Creates a zip with the owncloud system files
                                self::$content->addDir( OC::$SERVERROOT . '/', false, '/');
                                foreach (array(".git", "3rdparty", "apps", "core", "files", "l10n", "lib", "ocs", "search", "settings", "tests") as $dir) {
-                               self::$content->addDir( OC::$SERVERROOT . '/' . $dir, true, "/");
+                                       self::$content->addDir( OC::$SERVERROOT . '/' . $dir, true, "/");
                                }
-                       break;
-               }
-               if( !$info = self::getExportInfo( $exportdata ) ) {
-                       return json_encode( array( 'success' => false ) );
-               }
-               // Add the export info json to the export zip
-               self::$content->addFromString( $info, 'export_info.json' );
-               if( !self::$content->finish() ) {
-                       return json_encode( array( 'success' => false ) );
-               }
-               return json_encode( array( 'success' => true, 'data' => self::$zippath ) );
+                               break;
+               }
+               if( !$info = self::getExportInfo( $exportdata ) ) {
+                       return json_encode( array( 'success' => false ) );
+               }
+               // Add the export info json to the export zip
+               self::$content->addFromString( $info, 'export_info.json' );
+               if( !self::$content->finish() ) {
+                       return json_encode( array( 'success' => false ) );
+               }
+               return json_encode( array( 'success' => true, 'data' => self::$zippath ) );
         }
 
        /**
@@ -254,7 +254,7 @@ class OC_Migrate{
                                        OC_Log::write( 'migration', 'Failed to delete the extracted zip', OC_Log::ERROR );
                                }
                                return json_encode( array( 'success' => true, 'data' => $appsimported ) );
-                       break;
+                               break;
                        case 'instance':
                                        /*
                                         * EXPERIMENTAL
@@ -281,7 +281,7 @@ class OC_Migrate{
                                        // Done
                                        return json_encode( array( 'success' => true ) );
                                        */
-                       break;
+                               break;
                }
 
        }
@@ -319,10 +319,10 @@ class OC_Migrate{
        static private function extractZip( $path ) {
                self::$zip = new ZipArchive;
                // Validate path
-               if( !file_exists( $path ) ) {
-                       OC_Log::write( 'migration', 'Zip not found', OC_Log::ERROR );
-                       return false;
-               }
+               if( !file_exists( $path ) ) {
+                       OC_Log::write( 'migration', 'Zip not found', OC_Log::ERROR );
+                       return false;
+               }
                if ( self::$zip->open( $path ) != true ) {
                        OC_Log::write( 'migration', "Failed to open zip file", OC_Log::ERROR );
                        return false;
@@ -555,9 +555,9 @@ class OC_Migrate{
                if ( self::$zip->open( self::$zippath, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE ) !== true ) {
                        OC_Log::write('migration', 'Failed to create the zip with error: '.self::$zip->getStatusString(), OC_Log::ERROR);
                        return false;
-           } else {
-               return true;
-           }
+               } else {
+                       return true;
+               }
        }
 
        /**
index 4cf57ed8ff28ce79b9e919f09b67d95803de1adc..88d812e735a857b79e47cb85b712ab9801836711 100644 (file)
@@ -54,29 +54,30 @@ namespace OCP {
                 * Example:
                 *  Following function shows how to search for contacts for the name and the email address.
                 *
-                *              public static function getMatchingRecipient($term) {
-                *          // The API is not active -> nothing to do
+                *              public static function getMatchingRecipient($term) {
+                *                      // The API is not active -> nothing to do
                 *                      if (!\OCP\Contacts::isEnabled()) {
-                *                      return array();
+                *                              return array();
                 *                      }
                 *
                 *                      $result = \OCP\Contacts::search($term, array('FN', 'EMAIL'));
                 *                      $receivers = array();
                 *                      foreach ($result as $r) {
-                *                          $id = $r['id'];
-                *                          $fn = $r['FN'];
-                *                          $email = $r['EMAIL'];
-                *                          if (!is_array($email)) {
-                *                      $email = array($email);
-                *                          }
+                *                              $id = $r['id'];
+                *                              $fn = $r['FN'];
+                *                              $email = $r['EMAIL'];
+                *                              if (!is_array($email)) {
+                *                                      $email = array($email);
+                *                              }
                 *
-                *                          // loop through all email addresses of this contact
-                *                          foreach ($email as $e) {
-                *                          $displayName = $fn . " <$e>";
-                *                              $receivers[] = array('id'    => $id,
-                *                              'label' => $displayName,
-                *                              'value' => $displayName);
-                *                          }
+                *                              // loop through all email addresses of this contact
+                *                              foreach ($email as $e) {
+                *                              $displayName = $fn . " <$e>";
+                *                              $receivers[] = array(
+                *                                      'id'    => $id,
+                *                                      'label' => $displayName,
+                *                                      'value' => $displayName);
+                *                              }
                 *                      }
                 *
                 *                      return $receivers;
index f2ce69cf3118cdb0af9efa68e1d976003739c50b..f148a43a48000932d15d09e6b84a5298895dedd3 100644 (file)
@@ -64,7 +64,7 @@ var UserList={
                                        }
                                }
                        });
-               }
+               }
        },
 
        add:function(username, groups, subadmin, quota, sort) {