Commit d650cb5f authored by Nico Schallehn's avatar Nico Schallehn

test

parent a484b98d
......@@ -16,21 +16,22 @@ if (isset ( $_POST ["anmelden"] )) {
}
}
if(isset($_SESSION['api-key']) OR (isset($_COOKIE['api-key']) AND isset($_COOKIE['api-secret']))){
if(isset($_SESSION['api-key'])){
$_SESSION['api-key'] = $_COOKIE['api-key'];
$ErrorBox = '<div class="alert alert-danger">' . PHP_EOL .
'<strong>Fehler !</strong> ich leite dich weiter!! ' . PHP_EOL .
'</div>' . PHP_EOL;
$dologin = false;
if(isset($_SESSION['api-key'])){ // Login aus Session verhanden?
$dologin = true;
}
if((md5($_SERVER['HTTP_USER_AGENT'].$_SERVER['REMOTE_ADDR']) == $_COOKIE['api-secret']) AND isset($_SESSION['api-key'])){
// Login in Cookie vorhanden?
else if((md5($_SERVER['HTTP_USER_AGENT'].$_SERVER['REMOTE_ADDR']) == $_COOKIE['api-secret']) AND isset($_COOKIE['api-key'])){
$dologin = true;
$_SESSION['api-key'] = $_COOKIE['api-key'];
$ErrorBox .= '<div class="alert alert-danger">' . PHP_EOL .
'<strong>Fehler !</strong> ich leite dich weiter!! ' . PHP_EOL .
'</div>' . PHP_EOL;
}
if($dologin){
$API = new MediaDBAPI ();
if ($API->APIinit($_SESSION['api-key'])) {
header('location: webapp/');
}
}
}
?><!DOCTYPE html>
<html lang="de">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment