summaryrefslogtreecommitdiffstats
path: root/lib/user.php
diff options
context:
space:
mode:
authorJakob Sack <kde@jakobsack.de>2011-07-29 21:36:03 +0200
committerJakob Sack <kde@jakobsack.de>2011-07-29 21:36:03 +0200
commitbafd684eb694ed0bd86b46ff7cd36382c1cebc34 (patch)
treec3bb1e013d563263002d052eb41032076a36a5f9 /lib/user.php
parent220132ca237f5077f5145bf327e8528a652ad559 (diff)
downloadnextcloud-server-bafd684eb694ed0bd86b46ff7cd36382c1cebc34.tar.gz
nextcloud-server-bafd684eb694ed0bd86b46ff7cd36382c1cebc34.zip
Renaming classes :-)
Diffstat (limited to 'lib/user.php')
-rw-r--r--lib/user.php32
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/user.php b/lib/user.php
index f6fbc33f640..9b8f5fb13e7 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -34,7 +34,7 @@
* post_login(uid)
* logout()
*/
-class OC_USER {
+class OC_User {
// The backend used for user management
private static $_usedBackends = array();
@@ -91,7 +91,7 @@ class OC_USER {
case 'database':
case 'mysql':
case 'sqlite':
- self::$_usedBackends[$backend] = new OC_USER_DATABASE();
+ self::$_usedBackends[$backend] = new OC_User_Database();
break;
default:
$className = 'OC_USER_' . strToUpper($backend);
@@ -108,7 +108,7 @@ class OC_USER {
* @param $password The password of the new user
* @returns true/false
*
- * Creates a new user. Basic checking of username is done in OC_USER
+ * Creates a new user. Basic checking of username is done in OC_User
* itself, not in its subclasses.
*
* Allowed characters in the username are: "a-z", "A-Z", "0-9" and "_.@-"
@@ -130,7 +130,7 @@ class OC_USER {
$run = true;
- OC_HOOK::emit( "OC_USER", "pre_createUser", array( "run" => &$run, "uid" => $uid, "password" => $password ));
+ OC_Hook::emit( "OC_User", "pre_createUser", array( "run" => &$run, "uid" => $uid, "password" => $password ));
if( $run ){
//create the user in the first backend that supports creating users
@@ -139,7 +139,7 @@ class OC_USER {
continue;
$backend->createUser($uid,$password);
- OC_HOOK::emit( "OC_USER", "post_createUser", array( "uid" => $uid, "password" => $password ));
+ OC_Hook::emit( "OC_User", "post_createUser", array( "uid" => $uid, "password" => $password ));
return true;
}
@@ -156,7 +156,7 @@ class OC_USER {
*/
public static function deleteUser( $uid ){
$run = true;
- OC_HOOK::emit( "OC_USER", "pre_deleteUser", array( "run" => &$run, "uid" => $uid ));
+ OC_Hook::emit( "OC_User", "pre_deleteUser", array( "run" => &$run, "uid" => $uid ));
if( $run ){
//delete the user from all backends
@@ -166,12 +166,12 @@ class OC_USER {
}
}
// We have to delete the user from all groups
- foreach( OC_GROUP::getUserGroups( $uid ) as $i ){
- OC_GROUP::removeFromGroup( $uid, $i );
+ foreach( OC_Group::getUserGroups( $uid ) as $i ){
+ OC_Group::removeFromGroup( $uid, $i );
}
// Emit and exit
- OC_HOOK::emit( "OC_USER", "post_deleteUser", array( "uid" => $uid ));
+ OC_Hook::emit( "OC_User", "post_deleteUser", array( "uid" => $uid ));
return true;
}
else{
@@ -189,12 +189,12 @@ class OC_USER {
*/
public static function login( $uid, $password ){
$run = true;
- OC_HOOK::emit( "OC_USER", "pre_login", array( "run" => &$run, "uid" => $uid ));
+ OC_Hook::emit( "OC_User", "pre_login", array( "run" => &$run, "uid" => $uid ));
if( $run && self::checkPassword( $uid, $password )){
$_SESSION['user_id'] = $uid;
- OC_LOG::add( "core", $_SESSION['user_id'], "login" );
- OC_HOOK::emit( "OC_USER", "post_login", array( "uid" => $uid ));
+ OC_Log::add( "core", $_SESSION['user_id'], "login" );
+ OC_Hook::emit( "OC_User", "post_login", array( "uid" => $uid ));
return true;
}
else{
@@ -209,8 +209,8 @@ class OC_USER {
* Logout, destroys session
*/
public static function logout(){
- OC_HOOK::emit( "OC_USER", "logout", array());
- OC_LOG::add( "core", $_SESSION['user_id'], "logout" );
+ OC_Hook::emit( "OC_User", "logout", array());
+ OC_Log::add( "core", $_SESSION['user_id'], "logout" );
$_SESSION['user_id'] = false;
return true;
}
@@ -263,7 +263,7 @@ class OC_USER {
*/
public static function setPassword( $uid, $password ){
$run = true;
- OC_HOOK::emit( "OC_USER", "pre_setPassword", array( "run" => &$run, "uid" => $uid, "password" => $password ));
+ OC_Hook::emit( "OC_User", "pre_setPassword", array( "run" => &$run, "uid" => $uid, "password" => $password ));
if( $run ){
foreach(self::$_usedBackends as $backend){
@@ -273,7 +273,7 @@ class OC_USER {
}
}
}
- OC_HOOK::emit( "OC_USER", "post_setPassword", array( "uid" => $uid, "password" => $password ));
+ OC_Hook::emit( "OC_User", "post_setPassword", array( "uid" => $uid, "password" => $password ));
return true;
}
else{