aqui hice una pequeña modificacion del session_start(), que estaba puesto 2 veces perdon x el fallo
Código PHP:
Ver original<?php
require_once('Connections/localhost.php');
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
}
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ?
intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ?
doubleval($theValue) : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$query_usuarios = "SELECT * FROM usuarios";
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['user'])) { $loginUsername=$_POST['user'];
$password=$_POST['pass'];
$MM_fldUserAuthorization = "atri";
$MM_redirectLoginAdmin = "AQUI LA PAGINA DE REDIRECCION DE ADMINISTRADORES";
$MM_redirectLoginTecnico = "AQUI LA PAGINA DE REDIRECCION DE TECNICOS";
$MM_redirectLoginCliente ="AQUI LA PAGINA DE REDIRECCION DE CLIENTES";
$MM_redirectLoginFailed = "error.php";
$MM_redirecttoReferrer = false;
$LoginRS__query=sprintf("SELECT usuario, pass, atri FROM usuarios WHERE usuario=%s AND pass=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
if ($loginFoundUser) {
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['MM_UserGroup']) == 'administrador') {
header("Location: ". $MM_redirectLoginAdmin );
}elseif(isset($_SESSION['MM_UserGroup']) == 'tecnico'){
header("Location: ". $MM_redirectLoginTecnico );
}elseif(isset($_SESSION['MM_UserGroup']) == 'cliente'){
header("Location: ". $MM_redirectLoginCliente );
}else{
header("Location: ". $MM_redirectLoginFailed ); }
}else {
header("Location: ". $MM_redirectLoginFailed ); }
}
?>