diff options
author | Thomas Mueller <thomas.mueller@tmit.eu> | 2012-09-07 15:22:01 +0200 |
---|---|---|
committer | Thomas Mueller <thomas.mueller@tmit.eu> | 2012-09-07 15:22:01 +0200 |
commit | 3829460ab8cbb6de65c53583a20fd04cbe7927dd (patch) | |
tree | 4dc24845a5eb31b17510a621e14c15b51f16bf7b /lib/user | |
parent | 785aa751bb5f9a4bcdd677b96207550482e17d3c (diff) | |
download | nextcloud-server-3829460ab8cbb6de65c53583a20fd04cbe7927dd.tar.gz nextcloud-server-3829460ab8cbb6de65c53583a20fd04cbe7927dd.zip |
adding space between) and {
Diffstat (limited to 'lib/user')
-rw-r--r-- | lib/user/backend.php | 12 | ||||
-rw-r--r-- | lib/user/database.php | 30 | ||||
-rw-r--r-- | lib/user/dummy.php | 18 | ||||
-rw-r--r-- | lib/user/http.php | 18 |
4 files changed, 39 insertions, 39 deletions
diff --git a/lib/user/backend.php b/lib/user/backend.php index 0ef7ccd0468..2a95db93690 100644 --- a/lib/user/backend.php +++ b/lib/user/backend.php @@ -59,9 +59,9 @@ abstract class OC_User_Backend implements OC_User_Interface { * Returns the supported actions as int to be * compared with OC_USER_BACKEND_CREATE_USER etc. */ - public function getSupportedActions(){ + public function getSupportedActions() { $actions = 0; - foreach($this->possibleActions AS $action => $methodName){ + foreach($this->possibleActions AS $action => $methodName) { if(method_exists($this, $methodName)) { $actions |= $action; } @@ -78,7 +78,7 @@ abstract class OC_User_Backend implements OC_User_Interface { * Returns the supported actions as int to be * compared with OC_USER_BACKEND_CREATE_USER etc. */ - public function implementsActions($actions){ + public function implementsActions($actions) { return (bool)($this->getSupportedActions() & $actions); } @@ -89,7 +89,7 @@ abstract class OC_User_Backend implements OC_User_Interface { * * Deletes a user */ - public function deleteUser( $uid ){ + public function deleteUser( $uid ) { return false; } @@ -108,7 +108,7 @@ abstract class OC_User_Backend implements OC_User_Interface { * @param string $uid the username * @return boolean */ - public function userExists($uid){ + public function userExists($uid) { return false; } @@ -117,7 +117,7 @@ abstract class OC_User_Backend implements OC_User_Interface { * @param string $uid the username * @return boolean */ - public function getHome($uid){ + public function getHome($uid) { return false; } } diff --git a/lib/user/database.php b/lib/user/database.php index 52f3b35fa5c..76b44a2f6ca 100644 --- a/lib/user/database.php +++ b/lib/user/database.php @@ -44,8 +44,8 @@ class OC_User_Database extends OC_User_Backend { */ static private $hasher=null; - private function getHasher(){ - if(!self::$hasher){ + 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 $forcePortable=(CRYPT_BLOWFISH!=1); self::$hasher=new PasswordHash(8,$forcePortable); @@ -63,8 +63,8 @@ class OC_User_Database extends OC_User_Backend { * Creates a new user. Basic checking of username is done in OC_User * itself, not in its subclasses. */ - public function createUser( $uid, $password ){ - if( $this->userExists($uid) ){ + public function createUser( $uid, $password ) { + if( $this->userExists($uid) ) { return false; }else{ $hasher=$this->getHasher(); @@ -83,7 +83,7 @@ class OC_User_Database extends OC_User_Backend { * * Deletes a user */ - public function deleteUser( $uid ){ + public function deleteUser( $uid ) { // Delete user-group-relation $query = OC_DB::prepare( 'DELETE FROM `*PREFIX*users` WHERE uid = ?' ); $query->execute( array( $uid )); @@ -98,8 +98,8 @@ class OC_User_Database extends OC_User_Backend { * * Change the password of a user */ - public function setPassword( $uid, $password ){ - if( $this->userExists($uid) ){ + public function setPassword( $uid, $password ) { + if( $this->userExists($uid) ) { $hasher=$this->getHasher(); $hash = $hasher->HashPassword($password.OC_Config::getValue('passwordsalt', '')); $query = OC_DB::prepare( 'UPDATE `*PREFIX*users` SET `password` = ? WHERE `uid` = ?' ); @@ -120,22 +120,22 @@ class OC_User_Database extends OC_User_Backend { * Check if the password is correct without logging in the user * returns the user id or false */ - public function checkPassword( $uid, $password ){ + public function checkPassword( $uid, $password ) { $query = OC_DB::prepare( 'SELECT `uid`, `password` FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)' ); $result = $query->execute( array( $uid)); $row=$result->fetchRow(); - if($row){ + if($row) { $storedHash=$row['password']; - if ($storedHash[0]=='$'){//the new phpass based hashing + if ($storedHash[0]=='$') {//the new phpass based hashing $hasher=$this->getHasher(); - if($hasher->CheckPassword($password.OC_Config::getValue('passwordsalt', ''), $storedHash)){ + if($hasher->CheckPassword($password.OC_Config::getValue('passwordsalt', ''), $storedHash)) { return $row['uid']; }else{ return false; } }else{//old sha1 based hashing - if(sha1($password)==$storedHash){ + if(sha1($password)==$storedHash) { //upgrade to new hashing $this->setPassword($row['uid'],$password); return $row['uid']; @@ -169,7 +169,7 @@ class OC_User_Database extends OC_User_Backend { * @param string $uid the username * @return boolean */ - public function userExists($uid){ + public function userExists($uid) { $query = OC_DB::prepare( 'SELECT * FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)' ); $result = $query->execute( array( $uid )); @@ -181,8 +181,8 @@ class OC_User_Database extends OC_User_Backend { * @param string $uid the username * @return boolean */ - public function getHome($uid){ - if($this->userExists($uid)){ + public function getHome($uid) { + if($this->userExists($uid)) { return OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ) . '/' . $uid; }else{ return false; diff --git a/lib/user/dummy.php b/lib/user/dummy.php index 15a67b7e1ed..4dbbc02b888 100644 --- a/lib/user/dummy.php +++ b/lib/user/dummy.php @@ -35,8 +35,8 @@ class OC_User_Dummy extends OC_User_Backend { * Creates a new user. Basic checking of username is done in OC_User * itself, not in its subclasses. */ - public function createUser($uid, $password){ - if(isset($this->users[$uid])){ + public function createUser($uid, $password) { + if(isset($this->users[$uid])) { return false; }else{ $this->users[$uid]=$password; @@ -51,8 +51,8 @@ class OC_User_Dummy extends OC_User_Backend { * * Deletes a user */ - public function deleteUser( $uid ){ - if(isset($this->users[$uid])){ + public function deleteUser( $uid ) { + if(isset($this->users[$uid])) { unset($this->users[$uid]); return true; }else{ @@ -68,8 +68,8 @@ class OC_User_Dummy extends OC_User_Backend { * * Change the password of a user */ - public function setPassword($uid, $password){ - if(isset($this->users[$uid])){ + public function setPassword($uid, $password) { + if(isset($this->users[$uid])) { $this->users[$uid]=$password; return true; }else{ @@ -86,8 +86,8 @@ class OC_User_Dummy extends OC_User_Backend { * Check if the password is correct without logging in the user * returns the user id or false */ - public function checkPassword($uid, $password){ - if(isset($this->users[$uid])){ + public function checkPassword($uid, $password) { + if(isset($this->users[$uid])) { return ($this->users[$uid]==$password); }else{ return false; @@ -109,7 +109,7 @@ class OC_User_Dummy extends OC_User_Backend { * @param string $uid the username * @return boolean */ - public function userExists($uid){ + public function userExists($uid) { return isset($this->users[$uid]); } } diff --git a/lib/user/http.php b/lib/user/http.php index 5149678e4ed..2668341408d 100644 --- a/lib/user/http.php +++ b/lib/user/http.php @@ -30,14 +30,14 @@ class OC_User_HTTP extends OC_User_Backend { * @param string path * @return array */ - private function parseUrl($url){ + private function parseUrl($url) { $parts=parse_url($url); $url=$parts['scheme'].'://'.$parts['host']; - if(isset($parts['port'])){ + if(isset($parts['port'])) { $url.=':'.$parts['port']; } $url.=$parts['path']; - if(isset($parts['query'])){ + if(isset($parts['query'])) { $url.='?'.$parts['query']; } return array($parts['user'],$url); @@ -49,7 +49,7 @@ class OC_User_HTTP extends OC_User_Backend { * @param string url * @return boolean */ - private function matchUrl($url){ + private function matchUrl($url) { return ! is_null(parse_url($url,PHP_URL_USER)); } @@ -62,8 +62,8 @@ class OC_User_HTTP extends OC_User_Backend { * Check if the password is correct without logging in the user * returns the user id or false */ - public function checkPassword($uid, $password){ - if(!$this->matchUrl($uid)){ + public function checkPassword($uid, $password) { + if(!$this->matchUrl($uid)) { return false; } list($user,$url)=$this->parseUrl($uid); @@ -87,7 +87,7 @@ class OC_User_HTTP extends OC_User_Backend { * @param string $uid the username * @return boolean */ - public function userExists($uid){ + public function userExists($uid) { return $this->matchUrl($uid); } @@ -96,8 +96,8 @@ class OC_User_HTTP extends OC_User_Backend { * @param string $uid the username * @return boolean */ - public function getHome($uid){ - if($this->userExists($uid)){ + public function getHome($uid) { + if($this->userExists($uid)) { return OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ) . '/' . $uid; }else{ return false; |