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; }
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; }
public static function start() { if (self::$_sessionStarted) { return; } self::$_sessionStarted = true; self::$_sessionDestroyed = false; $requestSID = Wax_Request::getInstance()->SID; if (!empty($requestSID)) { self::$_idSesiones = $requestSID; } elseif (isset($_COOKIE['Standard8_Session_SID'])) { self::$_idSesiones = $_COOKIE['Standard8_Session_SID']; } if (strlen(self::$_idSesiones) > 0) { self::$_data = Wax_Db::select()->from(array('s' => TABLE_SESIONES), array('fecha'))->where('id_sesiones', self::$_idSesiones)->joinInner(array('p' => TABLE_PERSONAS), 'p.id_personas = s.id_personas', array('usuario', 'clave'))->query()->fetchRow(); if (empty(self::$_data)) { self::destroy(); } } }
public function __construct() { $this->_config = Wax_Db::select()->from(TABLE_CONFIGURACION)->query()->fetchPairs(); }