public function loginasAction() { if ($admin_id = $this->getRequest()->getParam("admin_id")) { $admin = new Admin_Model_Admin(); $admin->find($admin_id); if ($admin->getId()) { $key = sha1($admin->getFirstname() . $admin->getId()); if ($key == $this->getRequest()->getParam('key', 'aa')) { $front_session = $this->getSession('front'); $front_session->resetInstance()->setAdmin($admin); $this->_redirect(''); return $this; } } } }
public function findAction() { $admin = new Admin_Model_Admin(); $admin->find($this->getRequest()->getParam("admin_id")); $data = array(); if ($admin->getId()) { $data["admin"] = $admin->getData(); $data["section_title"] = $this->_("Edit the user %s", $admin->getFirstname() . " " . $admin->getLastname()); } else { $data["section_title"] = $this->_("Create a new user"); } $data["applications_section_title"] = $this->_("Manage access"); $countries = Zend_Registry::get('Zend_Locale')->getTranslationList('Territory', null, 2); asort($countries, SORT_LOCALE_STRING); $data["country_codes"] = $countries; $roles = $admin->getAvailableRole(); $data["roles"] = $roles; $role = new Acl_Model_Role(); $default_role_id = $role->findDefaultRoleId(); $data["default_role_id"] = $default_role_id; $this->_sendHtml($data); }