\n"; echo " window.top.location.href = '" . $to_root . "index.php?accesscode=" . $accesscode . "';\n"; echo "\n"; }; ?> zkontrolovat pristup $logErrReport = ""; $log_username = $_POST['log_username']; $log_password = $_POST['log_password']; MySQL_Connect($DB_Server, $DB_User, $DB_Pass); MySQL_Select_DB($DB_Database) or die("Nelze vybrat databázi!
Error: L-001"); MySQL_Query("SET NAMES '" . $DB_CharSet . "';"); $sqlLog = "SELECT Count(*) As numberRecords FROM " . $DB_Prefix . "users_ext WHERE os_username='" . $log_username . "';"; //echo "$sqlLog
\n"; $rsLog = MySQL_Query($sqlLog); $rowLog = MySQL_Fetch_Array($rsLog); $numLog = $rowLog["numberRecords"]; if($numLog==1) { $sqlLog = "SELECT * FROM " . $DB_Prefix . "users_ext WHERE os_username='" . $log_username . "';"; $rsLog = MySQL_Query($sqlLog); $rowLog = MySQL_Fetch_Array($rsLog); if($log_username==$rowLog["os_username"] && za_kodovat($log_password, $crypt_key_password)==$rowLog["os_password"] && $rowLog["os_pristup"]==1) { // Vse je OK - uzivatel muze byt prihlasen $logErrReport = "Prihlasen"; $_SESSION[$app_auth_var] = true; $_SESSION['userid'] = $rowLog["id"]; $_SESSION['accesscode'] = $accesscode; $_SESSION['accessid'] = odSifruj($accesscode, $crypt_key_access_code); if($users_titpz==1) { $os_upjm = $rowLog["os_titp"] . " " . $rowLog["os_prijmeni"] . " " . $rowLog["os_jmeno"]; } else { $os_upjm = $rowLog["os_prijmeni"] . " " . $rowLog["os_jmeno"]; }; if(strlen(trim($rowLog["os_titz"]))>0) { $os_upjm = $os_upjm . ", " . $rowLog["os_titz"]; }; $_SESSION['os_upjm'] = $os_upjm; $_SESSION['os_username'] = $rowLog["os_username"]; $_SESSION['os_pristup'] = $rowLog["os_pristup"]; $_SESSION['os_mail'] = $rowLog["os_mail"]; index_window($accesscode); } else { if($rowLog["os_pristup"]==1) { // => Chybné heslo => Login Window // echo "
\n"; $logErrReport = $lang_LogErrReport_1; $logErrNumber = 1; loginWindow($accesscode); exit; } else { // => Nepovolený přístup => Login Window // echo "
\n"; $logErrReport = $lang_LogErrReport_2; $logErrNumber = 2; loginWindow($accesscode); exit; }; }; } else { if($numLog<1) { // Nenalezen uzivatel tohoto jména => Login Window // echo "
\n"; $logErrReport = $lang_LogErrReport_3; $logErrNumber = 3; loginWindow($accesscode); exit; } else { // Více uživatelů se stejným jménem => Login Window // echo "
\n"; $logErrReport = $lang_LogErrReport_4; $logErrNumber = 4; loginWindow($accesscode); exit; }; }; } else { // --- Nebyla predana data metodou POST => prihlasovaci formular cisty //echo $logErrReport . "
\n"; //echo "SESSION\n"; loginWindow($accesscode); }; }; ?>