Esempio n. 1
0
 /**
  * Constructor.
  */
 private function __construct()
 {
     $this->userDao = BOL_UserDao::getInstance();
     $this->loginCookieDao = BOL_LoginCookieDao::getInstance();
     $this->userFeaturedDao = BOL_UserFeaturedDao::getInstance();
     $this->userOnlineDao = BOL_UserOnlineDao::getInstance();
     $this->userSuspendDao = BOL_UserSuspendDao::getInstance();
     $this->userApproveDao = BOL_UserApproveDao::getInstance();
     $this->restrictedUsernamesDao = BOL_RestrictedUsernamesDao::getInstance();
     $this->inviteCodeDao = BOL_InviteCodeDao::getInstance();
     $this->approveDao = BOL_UserApproveDao::getInstance();
     $this->resetPasswordDao = BOL_UserResetPasswordDao::getInstance();
     $this->userBlockDao = BOL_UserBlockDao::getInstance();
     $this->tokenDao = BOL_AuthTokenDao::getInstance();
 }
Esempio n. 2
0
 public function onDeleteUserContent(OW_Event $event)
 {
     $params = $event->getParams();
     $userId = (int) $params['userId'];
     if ($userId > 0) {
         $moderatorId = BOL_AuthorizationService::getInstance()->getModeratorIdByUserId($userId);
         if ($moderatorId !== null) {
             BOL_AuthorizationService::getInstance()->deleteModerator($moderatorId);
         }
         BOL_AuthorizationService::getInstance()->deleteUserRolesByUserId($userId);
         if (isset($params['deleteContent']) && (bool) $params['deleteContent']) {
             BOL_CommentService::getInstance()->deleteUserComments($userId);
             BOL_RateService::getInstance()->deleteUserRates($userId);
             BOL_VoteService::getInstance()->deleteUserVotes($userId);
         }
         //delete widgets
         BOL_ComponentEntityService::getInstance()->onEntityDelete(BOL_ComponentEntityService::PLACE_DASHBOARD, $userId);
         BOL_ComponentEntityService::getInstance()->onEntityDelete(BOL_ComponentEntityService::PLACE_PROFILE, $userId);
         // delete email verify
         BOL_EmailVerifyService::getInstance()->deleteByUserId($userId);
         // delete remote auth info
         BOL_RemoteAuthService::getInstance()->deleteByUserId($userId);
         // delete user auth token
         BOL_AuthTokenDao::getInstance()->deleteByUserId($userId);
     }
 }