コード例 #1
0
 static function removeUser($userID)
 {
     $user = eZUser::fetch($userID);
     if (!$user) {
         eZDebug::writeError("unable to find user with ID {$userID}", __METHOD__);
         return false;
     }
     eZUser::removeSessionData($userID);
     eZSubtreeNotificationRule::removeByUserID($userID);
     eZCollaborationNotificationRule::removeByUserID($userID);
     eZUserSetting::removeByUserID($userID);
     eZUserAccountKey::removeByUserID($userID);
     eZForgotPassword::removeByUserID($userID);
     eZWishList::removeByUserID($userID);
     eZGeneralDigestUserSettings::removeByUserId($userID);
     eZPersistentObject::removeObject(eZUser::definition(), array('contentobject_id' => $userID));
     return true;
 }
コード例 #2
0
ファイル: ezuser.php プロジェクト: netbliss/ezpublish
 static function removeUser($userID)
 {
     $user = eZUser::fetch($userID);
     if (!$user) {
         eZDebug::writeError("unable to find user with ID {$userID}", __METHOD__);
         return false;
     }
     eZUser::removeSessionData($userID);
     eZSubtreeNotificationRule::removeByUserID($userID);
     eZCollaborationNotificationRule::removeByUserID($userID);
     eZUserSetting::removeByUserID($userID);
     eZUserAccountKey::removeByUserID($userID);
     eZForgotPassword::removeByUserID($userID);
     eZWishList::removeByUserID($userID);
     // only remove general digest setting if there are no other users with the same e-mail
     $email = $user->attribute('email');
     $usersWithEmailCount = eZPersistentObject::count(eZUser::definition(), array('email' => $email));
     if ($usersWithEmailCount == 1) {
         eZGeneralDigestUserSettings::removeByAddress($email);
     }
     eZPersistentObject::removeObject(eZUser::definition(), array('contentobject_id' => $userID));
     return true;
 }