public function welcome(PwUserBo $userBo, $ip)
 {
     Wind::import('SRV:user.srv.PwBanBp');
     $banBp = new PwBanBp($userBo->uid);
     if ($banBp->checkIfBan()) {
         if (Pw::getstatus($userBo->info['status'], PwUser::STATUS_BAN_AVATAR) && false === $banBp->checkIfBanAvatar()) {
             $banBp->recoveryBanAvatarError();
         } else {
             $banBp->endDateTimeBanAvatar();
         }
         if (Pw::getstatus($userBo->info['status'], PwUser::STATUS_BAN_SIGN) && false === $banBp->checkIfBanSign()) {
             $banBp->recoveryBanSignError();
         } else {
             $banBp->endDateTimeBanSign();
         }
         if ($userBo->gid == 6 && false == $banBp->checkIfBanSpeak()) {
             $banBp->recoveryBanSpeaKError();
         } else {
             $banBp->endDateTimeBanSpeak();
         }
         $userBo->info = array_merge($userBo->info, Wekit::load('user.PwUser')->getUserByUid($userBo->uid));
         $userBo->gid = $userBo->info['groupid'] == 0 ? $userBo->info['memberid'] : $userBo->info['groupid'];
         if ($userBo->info['groups']) {
             $userBo->groups = explode(',', $userBo->info['groups']);
         }
         $userBo->groups[] = $this->gid;
     }
     return $userBo;
 }
Beispiel #2
0
 /**
  * 检测用户是否被禁言
  *
  * @return bool
  */
 public function isBan()
 {
     if ($this->user->gid == 6) {
         Wind::import('SRV:user.srv.PwBanBp');
         $banBp = new PwBanBp($this->user->uid);
         $memberid = 0;
         if (false === $banBp->checkIfBanSpeak()) {
             $memberid = $banBp->recoveryBanSpeaKError();
         } elseif ($banBp->endDateTimeBanSpeak()) {
             $memberid = $banBp->callEndDateTimeBanSpeak();
         }
         if ($memberid) {
             $this->user->info['groups'] = '';
             $this->user->info['groupid'] = 0;
             $this->user->info['memberid'] = $memberid;
             $this->user->groups = array($memberid);
             $this->user->resetGid($memberid);
             return false;
         }
         return true;
     }
     return false;
 }