Exemplo n.º 1
0
 public function switchAction()
 {
     if (!$this->fc->user->checkAcl('task_see_all')) {
         $this->fc->redirect(APP_WWW_URI, '[error]access_denied');
     }
     if ($id = $this->fc->getReqVar('id')) {
         // switch has been requested
         $obj = new MemberModel();
         $obj->connectDb();
         $obj->setUid($id);
         if ($obj->load()) {
             $this->fc->setSessionVariable('switch_id', $id);
             $this->fc->setSessionVariable('switch_name', $obj->get('nickname'));
         }
         $this->fc->redirect(APP_WWW_URI, '[ui]switched');
     }
     $this->switch_id = $this->fc->getSessionVariable('switch_id');
     $this->data = new MemberModel();
     $this->data->connectDb();
     $this->data->orderBy('nickname ASC');
     $this->data->loadList();
     $this->setView('admin/switch');
     $this->view();
 }