Esempio n. 1
0
 public function lostPasswordAction()
 {
     try {
         if ($this->_request->isPost()) {
             $email = $this->_getParam('email', null);
             $mail = new Core_Service_Mail(new Mail_Model_Invitation());
             $params = array();
             $params['emailFrom'] = '*****@*****.**';
             $params['nameFrom'] = 'Full Cine';
             $params['receptor_name'] = 'Usuario';
             $params['receptor_email'] = $email;
             $params['token'] = md5(uniqid());
             $tblAdmin = new Default_Model_Admin();
             $admin = $tblAdmin->getRowEmail($email);
             $id = isset($admin['id']) ? $admin['id'] : 0;
             $objAdmin = new Application_Entity_RunSql('Admin');
             $objAdmin->edit = array($objAdmin->getPK() => $id, 'rememberpassword' => $params['token']);
             $mail->send($params);
         }
     } catch (Exception $exc) {
         echo $exc->getMessage();
     }
 }
Esempio n. 2
0
 public function deleteAction()
 {
     $this->_helper->layout()->disableLayout();
     $this->_helper->viewRenderer->setNoRender(true);
     $id = $this->_getParam('id', 0);
     try {
         if (empty($id)) {
             throw new Exception('wrong params');
         }
         $obj = new Application_Entity_RunSql(self::_TABLECLASS);
         $obj->edit = array($obj->getPK() => $id, 'flagactive' => 0);
         $rpta = array('state' => 1, 'msg' => 'Item eliminado');
     } catch (Exception $exc) {
         $rpta = array('state' => 0, 'msj' => $exc->getMessage());
     }
     parent::response(200, $rpta);
 }
Esempio n. 3
0
 public function deleteAction()
 {
     echo 'mamam';
     exit;
     $this->_helper->layout()->disableLayout();
     $this->_helper->viewRenderer->setNoRender(true);
     $id = $this->getParam('id');
     $rpta = array();
     if (!empty($id)) {
         try {
             $obj = new Application_Entity_RunSql('User');
             $obj->edit = array('state' => 'I', $obj->getPK() => $id);
             $rpta['msj'] = 'ok';
         } catch (Exception $e) {
             $rpta['msj'] = $e->getMessage();
         }
     } else {
         $rpta['msj'] = 'faltan datos';
     }
     $this->getResponse()->setHttpResponseCode(200)->setHeader('Content-type', 'application/json; charset=UTF-8', true)->appendBody(json_encode($rpta));
 }