]> source.dussan.org Git - nextcloud-server.git/commitdiff
Reverted to self::$classType syntax and fixed the use of self in non-object
authorAldo "xoen" Giambelluca <xoen@xoen.org>
Mon, 19 Jul 2010 16:52:49 +0000 (18:52 +0200)
committerAldo "xoen" Giambelluca <xoen@xoen.org>
Mon, 19 Jul 2010 16:52:49 +0000 (18:52 +0200)
inc/User/database.php
inc/User/ldap.php
inc/User/mod_auth.php
inc/lib_user.php

index e083c30a7dc652c90284a34583a42865bc78de4b..d0bcf56fa96074eb63e0640c07eee8034dbfcee3 100755 (executable)
@@ -28,7 +28,7 @@
  *
  */
 class OC_USER_Database extends OC_USER {
-       
+
        /**
         * Check if the login button is pressed and logg the user in
         *
@@ -54,8 +54,7 @@ class OC_USER_Database extends OC_USER {
 
                return('');
        }
-       
-       
+
        /**
         * Try to create a new user
         *
@@ -76,7 +75,7 @@ class OC_USER_Database extends OC_USER {
                        return ($result) ? true : false;
                }
        }
-       
+
        /**
         * Try to login a user
         *
@@ -100,7 +99,7 @@ class OC_USER_Database extends OC_USER {
                        return false;
                }
        }
-       
+
        /**
         * Check if the logout button is pressed and logout the user
         *
@@ -113,7 +112,7 @@ class OC_USER_Database extends OC_USER {
                        $_SESSION['username_clean'] = '';
                }
        }
-       
+
        /**
         * Check if a user is logged in
         *
@@ -125,7 +124,7 @@ class OC_USER_Database extends OC_USER {
                        return false;
                }
        }
-       
+
        /**
         * Try to create a new group
         *
@@ -143,7 +142,7 @@ class OC_USER_Database extends OC_USER {
                        return false;
                }
        }
-       
+
        /**
         * Get the ID of a user
         *
@@ -169,7 +168,7 @@ class OC_USER_Database extends OC_USER {
                        return 0;
                }
        }
-       
+
        /**
         * Get the ID of a group
         *
@@ -195,7 +194,7 @@ class OC_USER_Database extends OC_USER {
                        return 0;
                }
        }
-       
+
        /**
         * Get the name of a group
         *
@@ -216,7 +215,7 @@ class OC_USER_Database extends OC_USER {
                        return 0;
                }
        }
-       
+
        /**
         * Check if a user belongs to a group
         *
@@ -238,7 +237,7 @@ class OC_USER_Database extends OC_USER {
                        return false;
                }
        }
-       
+
        /**
         * Add a user to a group
         *
@@ -264,11 +263,11 @@ class OC_USER_Database extends OC_USER {
                        return true;
                }
        }
-       
+
        public static function generatePassword() {
                return uniqId();
        }
-       
+
        /**
         * Get all groups the user belongs to
         *
@@ -289,7 +288,7 @@ class OC_USER_Database extends OC_USER {
 
                return $groups;
        }
-       
+
        /**
         * Set the password of a user
         *
@@ -304,7 +303,7 @@ class OC_USER_Database extends OC_USER {
 
                return $result ? true : false;
        }
-       
+
        /**
        * Check the password of a user
        *
index da0e2d0457306c92a3620a0d75f4b20690da3e03..37ca441fc07e2313faf3fb193ffc36cf19dfeb95 100755 (executable)
 
 require_once 'mod_auth.php';
 
+
+
 /**
- * Class for usermanagement in a SQL Database
- * eg mysql, sqlite
+ * Class for usermanagement in a SQL Database (e.g. MySql, SQLite)
  */
 class OC_USER_LDAP extends OC_USER_MOD_AUTH {
 }
-
-?>
\ No newline at end of file
index 11cb4bafd4a848b614ef4c666cc3b7f2bbbd09d9..059bb7b5aaa091a0c24d79c11e4b0161b99c55ae 100755 (executable)
@@ -67,7 +67,7 @@ class OC_USER_MOD_AUTH extends OC_USER {
         *
         */
        public static function logoutLisener() {
-               if( isset($_GET['logoutbutton']) AND isset($_SESSION['username']) ) {
+               if ( isset($_GET['logoutbutton']) AND isset($_SESSION['username']) ) {
                        header('WWW-Authenticate: Basic realm="ownCloud"');
                        header('HTTP/1.0 401 Unauthorized');
                        die('401 Unauthorized');
index d3c2b9f910902545141f951f44651c529625c99c..09ab1a3ddb57c6f0ce124a1ff98288b374886a6f 100755 (executable)
@@ -29,11 +29,11 @@ if ( !$CONFIG_INSTALLED ) {
        $_SESSION['username_clean'] = '';
 }
 
-//cache the userid's an groupid's
+// Cache the userid's an groupid's
 if ( !isset($_SESSION['user_id_cache']) ) {
        $_SESSION['user_id_cache'] = array();
 }
-if( !isset($_SESSION['group_id_cache']) ) {
+if ( !isset($_SESSION['group_id_cache']) ) {
        $_SESSION['group_id_cache'] = array();
 }
 
@@ -44,125 +44,125 @@ if( !isset($_SESSION['group_id_cache']) ) {
  *
  */
 class OC_USER {
-       
+
        public static $classType;
-       
+
        /**
         * Check if the login button is pressed and logg the user in
         *
         */
        public static function loginLisener() {
-               return self::classType->loginLisener();
+               return self::$classType->loginLisener();
        }
-       
-       
+
        /**
         * Try to create a new user
         *
         */
        public static function createUser($username, $password) {
-               return self::classType->createUser($username, $password);
+               return self::$classType->createUser($username, $password);
        }
-       
+
        /**
         * Try to login a user
         *
         */
        public static function login($username, $password) {
-               return self::classType->login($username, $password);
+               return self::$classType->login($username, $password);
        }
-       
+
        /**
         * Check if the logout button is pressed and logout the user
         *
         */
        public static function logoutLisener() {
-               return self::classType->logoutLisener();
+               return self::$classType->logoutLisener();
        }
-       
+
        /**
         * Check if a user is logged in
         *
         */
        public static function isLoggedIn() {
-               return self::classType->isLoggedIn();
+               return self::$classType->isLoggedIn();
        }
-       
+
        /**
         * Try to create a new group
         *
         */
        public static function createGroup($groupName) {
-               return self::classType->createGroup($groupName);
+               return self::$classType->createGroup($groupName);
        }
-       
+
        /**
         * Get the ID of a user
         *
         */
        public static function getUserId($username, $noCache=false) {
-               return self::classType->getUserId($username, $noCache);
+               return self::$classType->getUserId($username, $noCache);
        }
-       
+
        /**
         * Get the ID of a group
         *
         */
        public static function getGroupId($groupName, $noCache=false) {
-               return self::classType->getGroupId($groupName, $noCache);
+               return self::$classType->getGroupId($groupName, $noCache);
        }
-       
+
        /**
         * Get the name of a group
         *
         */
        public static function getGroupName($groupId, $noCache=false) {
-               return self::classType->getGroupName($groupId, $noCache);
+               return self::$classType->getGroupName($groupId, $noCache);
        }
-       
+
        /**
         * Check if a user belongs to a group
         *
         */
        public static function inGroup($username, $groupName) {
-               return self::classType->inGroup($username, $groupName);
+               return self::$classType->inGroup($username, $groupName);
        }
-       
+
        /**
         * Add a user to a group
         *
         */
        public static function addToGroup($username, $groupName) {
-               return self::classType->addToGroup($username, $groupName);
+               return self::$classType->addToGroup($username, $groupName);
        }
-       
+
        public static function generatePassword() {
                return uniqId();
        }
-       
+
        /**
         * Get all groups the user belongs to
         *
         */
        public static function getUserGroups($username) {
-               return self::classType->getUserGroups($username);
+               return self::$classType->getUserGroups($username);
        }
-       
+
        /**
         * Set the password of a user
         *
         */
        public static function setPassword($username, $password) {
-               return self::classType->setPassword($username, $password);
+               return self::$classType->setPassword($username, $password);
        }
-       
+
        /**
         * Check the password of a user
         *
         */
        public static function checkPassword($username, $password) {
-               return self::classType->checkPassword($username, $password);
+               return self::$classType->checkPassword($username, $password);
        }
+
 }
 
 
@@ -174,24 +174,24 @@ function set_OC_USER() {
        global $CONFIG_BACKEND;
 
        if ( isset($CONFIG_BACKEND) ) {
-               switch( $CONFIG_BACKEND ) {
+               switch ( $CONFIG_BACKEND ) {
                        case 'mysql':
                        case 'sqlite':
                                require_once 'User/database.php';
-                               self::classType = new OC_USER_Database();
+                               OC_USER::$classType = new OC_USER_Database();
                                break;
                        case 'ldap':
                                require_once 'User/ldap.php';
-                               self::classType = new OC_USER_LDAP();
+                               OC_USER::$classType = new OC_USER_LDAP();
                                break;
                        default:
                                require_once 'User/database.php';
-                               self::classType = new OC_USER_Database();
+                               OC_USER::$classType = new OC_USER_Database();
                                break;
                }
        } else {
                require_once 'User/database.php';
-               self::classType = new OC_USER_Database();
+               OC_USER::$classType = new OC_USER_Database();
        }
 }