public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request) { if ($identity = Zend_Auth::getInstance()->getIdentity()) { $user = new User(); $id = $identity->id; $userRow = $user->findOne($id)->toArray(); if ($userRow['tmp_password'] === true && ($request->getControllerName() != 'auth' || $request->getActionName() != 'changepassword')) { $conv = new Base_Controller_Action_Helper_IdConvert(); $id = $conv->strToHex($id); $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector'); $redirector->setGotoSimple('changepassword', 'auth', null, array('id' => $id)); } } }
public function getAllIP($id) { $id = Base_Controller_Action_Helper_IdConvert::hexToStr($id); if ($id > 0) { $model = new WsSaveIP(); $row = $model->findOne($id); return $row->ip; } else { throw new Exception('Brak adresu IP'); } }