%PDF- %PDF-
| Direktori : /home/tjamichg/intranet.tjamich.gob.mx/intranet/sistemas/administracion/ |
| Current File : /home/tjamichg/intranet.tjamich.gob.mx/intranet/sistemas/administracion/agregar_password.php |
<?php
session_start();
include "../../config/config.php";
$_SESSION['expire'] = time() + (120 * 60);
// Datos cliente
$conf = new Configuracion();
$conf->conectarBD();
$consulta = "SELECT rfc, password
FROM tjam_empleados WHERE rfc IS NOT NULL AND habilitado = 1 AND password IS NOT NULL AND id = 373";
$rst1 = $conf->consulta($consulta);
for ($i = 0; $i <= count($rst1); $i++) {
$rfc = $rst1[$i]["rfc"];
$pass = $rst1[$i]["password"];
$opciones = [ 'cost' => 12, ];
$hash = password_hash($pass, PASSWORD_BCRYPT, $opciones);
$update = "UPDATE tjam_empleados SET password_hash = '$hash' WHERE rfc = '$rfc' ";
$conf->actualizacion($update);
}
/*$rfc = $rst1[$i]["rfc"];
$pass = $rst1[$i]["password"];
$opciones = [ 'cost' => 12, ];
$hash = password_hash($pass, PASSWORD_BCRYPT, $opciones);
$update = "UPDATE tjam_empleados SET password_hash = '$hash' WHERE id = 373";
$conf->actualizacion($update);*/
$conf->desconectarDB();
header("Location: page_password.php");
?>