Example #1
0
 /**
  * Returns an instance of class (singleton pattern implementation).
  *
  * @return BOL_AuthTokenDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Example #2
0
 /**
  * @param integer $userId
  */
 public function deleteTokenForUser($userId)
 {
     $this->tokenDao->deleteByUserId($userId);
 }
Example #3
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);
     }
 }