Пример #1
0
 public function switchAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $id = trim($this->getRequest()->getParam('id'));
     if (isset($this->authidentity) && $this->authidentity->userid != $id) {
         $userModel = new Application_Model_Users($this->registry->DB);
         $userModel->switchUser($id);
         echo json_encode(array('status' => 'success'));
     } else {
         echo json_encode(array('status' => 'error'));
     }
 }