示例#1
0
 public function onBeforeRender()
 {
     $userId = OW::getUser()->getId();
     if ($userId === null) {
         $this->setVisible(false);
         return;
     }
     if (!OW::getConfig()->getValue('fbconnect', 'allow_synchronize')) {
         $fbFieldDto = BOL_RemoteAuthService::getInstance()->findByUserId($userId);
         if ($fbFieldDto === null) {
             $this->setVisible(false);
             return;
         }
     }
 }
示例#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);
     }
 }
示例#3
0
 public function __construct($remoteId, $type)
 {
     $this->remoteId = $remoteId;
     $this->type = trim($type);
     $this->remoteAuthService = BOL_RemoteAuthService::getInstance();
 }