Exemple #1
0
 /**
  * @return Wax_Messages
  */
 public static function getInstance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Exemple #2
0
 public function __onSubmit($mail)
 {
     if (!empty($mail)) {
         $mail = strtolower($mail);
         $userData = Wax_Db::select()->from(TABLE_PERSONAS, array('id_personas', 'usuario', 'correo'))->where('correo', $mail)->query()->fetchRow();
         if (sizeof($userData) == 0) {
             Wax_Messages::getInstance()->add(__('CorreoInexistente', Standard8_Uri::createUri('Personas_Invitacion', 'Standard8')));
             return array(false, 'Personas_Recuperar_' . $mail);
         }
     } else {
         Wax_Messages::getInstance()->add(__('CamposIncompletos'));
         return false;
     }
     return true;
 }
Exemple #3
0
 public function __construct(Standard8 $Standard8)
 {
     parent::__construct('div');
     $SID = Standard8_Session::getSID();
     if (!empty($SID)) {
         throw new Wax_Exception('User already sign in.');
     }
     $form = Wax_Document::$body->createForm('/');
     $messages = Wax_Messages::getInstance();
     foreach ($messages as $message) {
         $form->appendMessage('a', $message);
     }
     $messages->clear();
     $this->appendChild($Standard8->createTitleNav(__('SolicitarInvitacion')))->appendChild($form);
     $Standard8->appendLocation(__('Ingresar'), 'Personas_Ingresar', 'Standard8')->appendLocation(__('RecuperarClave'), 'Personas_Recuperar', 'Standard8', true)->appendLocation(__('SolicitarInvitacion'), 'Personas_Invitacion', 'Standard8', true)->appendLocation(__('SolicitarInvitacion'), $this);
     //->appendSidebarNav( __('Ingresar'), 'Personas_Ingresar', 'Standard8');
 }
Exemple #4
0
 public function __onSubmit($username, $password)
 {
     if (!(empty($username) || empty($password))) {
         $userData = Wax_Db::select()->from(TABLE_PERSONAS, array('id_personas', 'usuario', 'clave'))->where('usuario', $username)->query()->fetchRow();
         if (sizeof($userData) == 0) {
             Wax_Messages::getInstance()->add(__('UsuarioInexistente', Standard8_Uri::createUri('Personas_Invitacion', 'Standard8')));
             return array(false, 'Personas_Ingresar_' . $username);
         }
         if (md5($password) != $userData['clave']) {
             Wax_Messages::getInstance()->add(__('ClaveNoValida', Standard8_Uri::createUri('Personas_Recuperar', 'Standard8')));
             return array(false, 'Personas_Ingresar_' . $username);
         }
         $idSessiones = Standard8_Session::begin($userData['id_personas']);
     } else {
         Wax_Messages::getInstance()->add(__('CamposIncompletos'));
         return false;
     }
     return true;
 }
Exemple #5
0
 /**
  * @return Wax_Document_Body_Form
  */
 public function appendMessages($messages = null)
 {
     if (is_null($messages)) {
         $messages = Wax_Messages::getInstance();
     }
     foreach ($messages as $message) {
         $this->appendMessage(null, $message, true);
     }
     $messages->clear();
 }