Ejemplo n.º 1
0
 /**
  * main function of this class. 
  * trying to find user by email
  *
  * @return bool
  */
 public function authenticate()
 {
     $persona = new Persona();
     $model = $this->_model_name;
     $email_field = $this->_email_field;
     if ($persona->isStatusSuccess()) {
         $criteria = new CDbCriteria();
         $criteria->compare($email_field, $persona->getEmail());
         $user_model = $model::model()->find($criteria);
         if ($user_model == null) {
             return false;
         }
         $this->id = $user_model->id;
         $this->_isAuthenticated = true;
         //TODO name should me a real name or login or some readable user identifier
         $this->_name = $user_model->{$email_field};
         return true;
     } else {
         return false;
     }
 }
Ejemplo n.º 2
0
 private function getParametros(Persona $persona)
 {
     $parametros = array(':documento' => $persona->getDocumento(), ':nombres' => $persona->getNombre(), ':apellidos' => $persona->getApellidos(), ':telefono1' => $persona->getTelefono1(), ':telefono2' => $persona->getTelefono2(), ':email' => $persona->getEmail(), ':direccion' => $persona->getDireccion(), ':fechaRegistro' => date('Y-m-d G:i:s'));
     return $parametros;
 }
Ejemplo n.º 3
0
 private function getParametros(Persona $persona)
 {
     $parametros = array(':idPersona' => $persona->getIdPersona(), ':Nombre' => $persona->getNombre(), ':Apellidos' => $persona->getApellidos(), ':Telefono' => $persona->getTelefono(), ':Email' => $persona->getEmail(), ':fecha' => date('Y-m-d G:i:s'), ':usuario' => $persona->getUsuario(), ':contrasena' => $persona->getContrasena());
     return $parametros;
 }
Ejemplo n.º 4
0
 public function getEmail()
 {
     return parent::getEmail();
     // TODO: Change the autogenerated stub
 }