Пример #1
0
 public function resetPasswordAction()
 {
     $request = $this->getRequest();
     $form = new Form_ResetPassword();
     if ($request->isPost()) {
         $client = Kaltura_ClientHelper::getClient();
         $userEmail = $request->getPost('email');
         $client->user->resetPassword($userEmail);
         // ask to reset password
         //TODO: check for exceptions!
         $tranlsate = $this->getFrontController()->getParam('bootstrap')->getResource('translate');
         // TODO: add translate action helper
         $form->setDescription(sprintf($tranlsate->_('password instructions emailed to %s'), $request->getPost('email')));
         $form->hideForm();
     }
     $this->view->form = $form;
 }
 public function resetPasswordAction()
 {
     $request = $this->getRequest();
     $form = new Form_ResetPassword();
     if ($request->isPost()) {
         $form->isValid($request->getPost());
         $client = Infra_ClientHelper::getClient();
         $userEmail = $request->getPost('email');
         try {
             $client->user->resetPassword($userEmail);
             // ask to reset password
             $tranlsate = $this->getFrontController()->getParam('bootstrap')->getResource('translate');
             // TODO: add translate action helper
             $form->setDescription(sprintf($tranlsate->_('password instructions emailed to %s'), $request->getPost('email')));
             $form->hideForm();
         } catch (Exception $e) {
             $form->setDescription('Login error: ' . $e->getMessage());
         }
     }
     $this->view->form = $form;
 }