public function init() { parent::init(); if (!preg_match("/admin_api_account_autologin/", $this->getFullActionName("_"))) { $username = $this->getRequest()->getServer("PHP_AUTH_USER"); $password = $this->getRequest()->getServer("PHP_AUTH_PW"); $user = new Api_Model_User(); $user->find($username, "username"); if (!$user->getId() or !$user->authenticate($password)) { $this->_forward("notauthorized"); } } return $this; }