devfzn
83d7fd1bad
conexion.php: Función para encriptar contraseña. auth.class.php: Funcion genera y retorna token y guarda en db. respuestas.class.php: Funcion error_500.
48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
|
|
class respuestas{
|
|
public $response = [
|
|
"status" => "ok",
|
|
"result" => array()
|
|
];
|
|
|
|
public function error_405(){
|
|
$this->response['status'] = "error";
|
|
$this->response['result'] = array(
|
|
"error_id" => "405",
|
|
"error_msg" => "Metodo no permitido"
|
|
);
|
|
return $this->response;
|
|
}
|
|
|
|
public function error_200($mensaje = "Datos incorrectos"){
|
|
$this->response['status'] = "error";
|
|
$this->response['result'] = array(
|
|
"error_id" => "200",
|
|
"error_msg" => $mensaje
|
|
);
|
|
return $this->response;
|
|
}
|
|
|
|
public function error_400(){
|
|
$this->response['status'] = "error";
|
|
$this->response['result'] = array(
|
|
"error_id" => "400",
|
|
"error_msg" => "Datos recibidos incompletos o formato erroneo"
|
|
);
|
|
return $this->response;
|
|
}
|
|
|
|
public function error_500($mensaje = "Error interno del servido"){
|
|
$this->response['status'] = "error";
|
|
$this->response['result'] = array(
|
|
"error_id" => "500",
|
|
"error_msg" => $mensaje
|
|
);
|
|
return $this->response;
|
|
}
|
|
|
|
}
|
|
|
|
?>
|