|
<?
|
|
session_start();
|
|
|
|
if ($_POST['prihlaseno']) {
|
|
|
|
$nacteni_uzivatele=file("users/users.dat");
|
|
$pocet_uzivatelu=sizeof($nacteni_uzivatele);
|
|
//echo $pocet_uzivatelu;
|
|
|
|
|
|
for ($i=0;$i<$pocet_uzivatelu;$i++) {
|
|
$uzivatel[$i]=explode(";",$nacteni_uzivatele[$i]);
|
|
if ($uzivatel[$i][0]==$_POST['jmeno'] && $uzivatel[$i][1]==md5($_POST['heslo'])) {
|
|
$_SESSION['online_user']=$_POST['jmeno'];
|
|
$_SESSION['online_user_prava']=$uzivatel[$i][5];
|
|
break;
|
|
}
|
|
}
|
|
//echo $_SESSION['user'];
|
|
if ($_SESSION['online_user']==$_POST['jmeno']) header ("Location: index.php?lng=".$_GET['lng']."&zobraz=vyber&".SID."");
|
|
else header ("Location: index.php?lng=".$_GET['lng']."&prihlaseno=error");
|
|
|
|
//print_r($pole);
|
|
/*
|
|
$uzivatel[$i]["nick"]=$pole[$i][0];
|
|
$uzivatel[$i]["heslo"]=$pole[$i][1];
|
|
$uzivatel[$i]["jmeno"]=$pole[$i][2];
|
|
$uzivatel[$i]["email"]=$pole[$i][3];
|
|
$uzivatel[$i]["poznamka"]=$pole[$i][4];
|
|
$uzivatel[$i]["prava"]=$pole[$i][5];
|
|
*/
|
|
}
|
|
?>
|