Ejemplo n.º 1
0
 public function createHtml($left, $tab)
 {
     $config = Wekit::C('app_majia');
     $list = array();
     $method = !in_array($this->bp->user->gid, $config['band.allow.groups']) ? 'displayMajiaForbidden' : 'displayList';
     if (!$config['isopen']) {
         $method = 'displayMajiaClose';
     } else {
         Wind::import('EXT:majia.service.srv.App_Majia_MajiaBandingBp');
         $bp = new App_Majia_MajiaBandingBp($this->bp->user);
         $list = $bp->doGetBanded();
     }
     PwHook::template($method, 'EXT:majia.template.my_run', true, $this->bp->user, $list, intval($config['band.max.num']));
 }
Ejemplo n.º 2
0
 /**
  * 马甲切换
  */
 public function changeAction()
 {
     $uid = $this->getInput('uid', 'get');
     $bp = new App_Majia_MajiaBandingBp($this->loginUser);
     $result = $bp->doChangeAccount($uid);
     if ($result instanceof PwError) {
         $error = $result->getError();
         if ($error == '密码失效,请重新绑定') {
             $this->addMessage(array('reband' => WindUrlHelper::createUrl('app/majia/my/reBand?uid=' . $uid)), 'data');
             $this->showError('密码失效,需要重新绑定');
         } else {
             $this->showError($error);
         }
     }
     Wekit::load('SRV:user.srv.PwLoginService')->setLoginCookie(new PwUserBo($uid), $this->getRequest()->getClientIp());
     WindidApi::api('user')->synLogin($uid);
     $this->showMessage('切换成功');
 }