Skip to content

Instantly share code, notes, and snippets.

Created January 4, 2013 16:10
Show Gist options
  • Save anonymous/4453750 to your computer and use it in GitHub Desktop.
Save anonymous/4453750 to your computer and use it in GitHub Desktop.
public function login_form() {
global $ws, $obj;
$validate_login = $obj -> _get_form_login($_REQUEST);
if ($validate_login->succes) {
$a = $ws -> user_authenticate(array(
'config' => $this->config,
'email' => $validate_login->login->email,
'password' => $validate_login->login->password
)
);
_pre($a);
if (isset($a->data->token)) {
$_SESSION['token'] = $a->data->token;
$meraki = npi('oracle');
// Aqui es donde debo hacer el insert usando la funcion de Oracle:
// ins_token_meraki($p_usuario, $p_token , $p_tiempo);
//header('Location: ?task=success');
//$message = 'Bienvenid@!.';
//exit ;
}
if (isset($a->data->emailtoken)) {
$encode_email = encode($validate_login->login->email);
$url = 'http://' . $_SERVER['SERVER_NAME'] . '/miclaro-wifi/?task=recover&a=' . $encode_email . '&t=' . $a->data->emailtoken;
$emailer = new emailer();
$emailer -> from($this->email);
$emailer -> use_template('user_blocked');
$emailer -> email_address($validate_login->login->email);
$emailer -> assign_vars(array('U_RESET' => $url));
$emailer -> send();
$emailer -> reset();
}
$validate_login->error = 'La información ingresada es incorrecta.';
}
if ($validate_login->error) {
if ($validate_login->error == 1) {
$validate_login->error = 'La información ingresada es incorrecta.';
}
$screen = (object) array('message' => $ws -> _v('MSN_REQUESTED_PARAM_FORM'), 'show_message' => $validate_login->error);
//header('Location: .');
require_once ('login.php');
//header('Location: ?task=home');
}
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment