Exemplo n.º 1
0
 public function run()
 {
     $this->setCurrentLeft('avatar');
     $isAvatarBan = false;
     if (Pw::getstatus($this->loginUser->info['status'], PwUser::STATUS_BAN_AVATAR)) {
         Wind::import('SRV:user.srv.PwBanBp');
         $banBp = new PwBanBp($this->loginUser->uid);
         if (false === $banBp->checkIfBanAvatar()) {
             $banBp->recoveryBanAvatarError();
         } elseif ($banBp->endDateTimeBanAvatar()) {
             $this->loginUser->info['status'] = $banBp->callEndDateTimeBanAvatar();
         } else {
             $isAvatarBan = true;
             $info = $banBp->getBanAvatarInfo();
             if ($info['created_userid'] == 0) {
                 $info['operator'] = 'system';
             } else {
                 $operatorInfo = Wekit::load('user.PwUser')->getUserByUid($info['created_userid']);
                 $info['operator'] = $operatorInfo['username'];
             }
             $this->setOutput($info, 'banInfo');
         }
     }
     $windidApi = $this->_getWindid();
     $this->setOutput($windidApi->showFlash($this->loginUser->uid), 'avatarFlash');
     $this->setOutput($windidApi->showFlash($this->loginUser->uid, 0), 'avatarArr');
     $this->setOutput($isAvatarBan, 'isAvatarBan');
     $this->setOutput($this->getInput('type'), 'type');
     $this->setLayout('');
     $this->setTemplate('profile_avatar');
     // seo设置
     Wind::import('SRV:seo.bo.PwSeoBo');
     $lang = Wind::getComponent('i18n');
     PwSeoBo::setCustomSeo($lang->getMessage('SEO:profile.avatar.run.title'), '', '');
 }
Exemplo n.º 2
0
 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;
 }