Add files via upload
This commit is contained in:
@ -315,6 +315,9 @@
|
||||
font-size: 90%;
|
||||
color: #00020f;
|
||||
}
|
||||
.code label{
|
||||
color: #d3ebff;
|
||||
}
|
||||
.code.details{
|
||||
height: 750px;
|
||||
}
|
||||
|
@ -314,6 +314,9 @@ main img {
|
||||
font-size: 90%;
|
||||
color: #d3ebff;
|
||||
}
|
||||
.code label{
|
||||
color: #d3ebff;
|
||||
}
|
||||
.code.details{
|
||||
height: 750px;
|
||||
}
|
||||
|
@ -18,15 +18,6 @@
|
||||
|
||||
//Methods:
|
||||
|
||||
// Delete user
|
||||
public function deleteUser($user_id) {
|
||||
$sql = sprintf( "DELETE FROM users WHERE id = '%s'", $user_id);
|
||||
|
||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||
|
||||
return $resul;
|
||||
}
|
||||
|
||||
//Encrypt password with SHA254.
|
||||
private function encryptPass($password){
|
||||
//$password = hash('sha256', $password);
|
||||
@ -75,6 +66,7 @@
|
||||
$resul = mysqli_query($this->mysqli, $sql);
|
||||
|
||||
$resul->data_seek(0);
|
||||
$user = null;
|
||||
while ($fila = $resul->fetch_assoc()) {
|
||||
if($username === $fila['username'] && $this->verifyPass($password, $fila['passwd'])){
|
||||
$user = $this->loadUser($fila['id'], $fila['username'], $fila['email'], $fila['passwd'], $fila['rol']);
|
||||
@ -132,6 +124,16 @@
|
||||
|
||||
}
|
||||
|
||||
//Delete user account by id.
|
||||
public function deleteUserAccount($id){
|
||||
$id = $this->mysqli->real_escape_string($id);
|
||||
|
||||
$sql = sprintf( "DELETE FROM users WHERE id = '%d'", $id );
|
||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||
|
||||
return $resul;
|
||||
}
|
||||
|
||||
//Create a new User Data Transfer Object.
|
||||
public function loadUser($id, $username, $email, $password, $rol){
|
||||
return new User($id, $username, $email, $password, $rol);
|
||||
|
@ -2,10 +2,10 @@
|
||||
/**
|
||||
* Connection parameters to the DB.
|
||||
*/
|
||||
define('BD_HOST', 'vm01.db.swarm.test');
|
||||
define('BD_HOST', 'localhost');
|
||||
define('BD_NAME', 'complucine');
|
||||
define('BD_USER', 'root');
|
||||
define('BD_PASS', 'T4cFwfxT_vI2W!nYp!tv');
|
||||
define('BD_USER', 'sw');
|
||||
define('BD_PASS', '_admin_');
|
||||
|
||||
/*
|
||||
* Configuration parameters used to generate URLs and file paths in the application
|
||||
@ -46,4 +46,9 @@
|
||||
* @see http://php.net/manual/en/language.types.callable.php
|
||||
*/
|
||||
register_shutdown_function(array($app, 'shutdown'));
|
||||
|
||||
//Depuración (BORRAR):
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
?>
|
||||
|
Reference in New Issue
Block a user