<?php
require("mysql.php");
require_once 'filter.php';

$titel = 'Login - Fotos';
if($_SESSION[foto] != '') {
header("location:photo.php?n=$_SESSION[foto]");
}else{
if(!$_POST[submit]) {
$inhalt .= '
<div class="photo">
<div class="noh1"></div>
<div class="box photoslogin small">
<div class="hd">
<div class="tl"></div>
<div class="tr"></div>

<div class="tm"></div>
<div class="m"><div class="mi"><div class="h h1"><div class="hbegin"></div><h1>Login</h1></div>
</div></div>
</div>
<div class="bd fade bd-fade">
<div class="m">
<div class="mi">
<form action="photos-login.php" name="submit" accept-charset="utf-8" method="POST">
<table class="none">
<tbody>
<tr id="formline-photologin-nickname" class="formline formline-photologin-nickname formres-no formres-noresult-photologin-nickname ">
<td class="formlabel">
<span class="label"><label for="photologin-nickname">Nickname</label>:</span>
</td><td class="formelement">

<div class="formelementbody">
<input type="text" class="text type-String"
name="nickname" id="photologin-nickname"
value="" /><div class="formerror hidden" id="err-photologin-nickname">

</div>
</div>
</td>
</tr>
<tr id="formline-photologin-password" class="formline formline-photologin-password formres-no formres-noresult-photologin-password ">
<td class="formlabel">
<span class="label"><label for="photologin-password">Passwort</label>:</span>
</td><td class="formelement">
<div class="formelementbody">
<input type="password" class="text password type-String"
name="password" id="photologin-password"
/><div class="formerror hidden" id="err-photologin-password">

</div>

</div>
</td>
</tr>
</tbody>
</table>
<div class="bbutton submit" id="submit-button-1719087160"><div class="bttl corner"></div><div class="bttr corner"></div><div class="bttm"></div><div class="btm"><img src="/sf/m/buttons/bt-nm.png" id="submit-button-1543648886-img" class="jsFixHeight" style="" height="22" width="" /><input type="submit" name="submit" value="Login" class="image-submit" /><div class="btmi"><span class="text">Login</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></div>
</form>
</div>
</div>';
}else{
$ruw = mysql_fetch_array(mysql_query("select * from accounts where name='".$_POST[nickname]."'"));
if(!$_POST[nickname]) {
$inhalt .= '
<div class="photo">
<div class="noh1"></div>
<div class="box photoslogin small">
<div class="hd">
<div class="tl"></div>
<div class="tr"></div>

<div class="tm"></div>
<div class="m"><div class="mi"><div class="h h1"><div class="hbegin"></div><h1>Login</h1></div>
</div></div>
</div>
<div class="bd fade bd-fade">
<div class="m">
<div class="mi">
<form action="photos-login.php" name="submit" accept-charset="utf-8" method="POST">
<table class="none">
<tbody>
<tr id="formline-photologin-nickname" class="formline formline-photologin-nickname formres-no formres-noresult-photologin-nickname ">
<td class="formlabel">
<span class="label"><label for="photologin-nickname">Nickname</label>:</span>
</td><td class="formelement">

<div class="formelementbody">
<input type="text" class="text type-String"
name="nickname" id="photologin-nickname"
value="" /><div class="formerror" id="err-photologin-nickname">

Das Feld muss angegeben werden.

</div>
</div>
</td>
</tr>
<tr id="formline-photologin-password" class="formline formline-photologin-password formres-no formres-noresult-photologin-password ">
<td class="formlabel">
<span class="label"><label for="photologin-password">Passwort</label>:</span>
</td><td class="formelement">
<div class="formelementbody">
<input type="password" class="text password type-String"
name="password" id="photologin-password"
/><div class="formerror hidden" id="err-photologin-password">

</div>

</div>
</td>
</tr>
</tbody>
</table>
<div class="bbutton submit" id="submit-button-1719087160"><div class="bttl corner"></div><div class="bttr corner"></div><div class="bttm"></div><div class="btm"><img src="/sf/m/buttons/bt-nm.png" id="submit-button-1543648886-img" class="jsFixHeight" style="" height="22" width="" /><input type="submit" name="submit" value="Login" class="image-submit" /><div class="btmi"><span class="text">Login</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></div>
</form></div>
</div>';
}elseif(!$_POST[password]) {
$inhalt .= '
<div class="photo">
<div class="noh1"></div>
<div class="box photoslogin small">
<div class="hd">
<div class="tl"></div>
<div class="tr"></div>

<div class="tm"></div>
<div class="m"><div class="mi"><div class="h h1"><div class="hbegin"></div><h1>Login</h1></div>
</div></div>
</div>
<div class="bd fade bd-fade">
<div class="m">
<div class="mi">
<form action="photos-login.php" name="submit" accept-charset="utf-8" method="POST">
<table class="none">
<tbody>
<tr id="formline-photologin-nickname" class="formline formline-photologin-nickname formres-no formres-noresult-photologin-nickname ">
<td class="formlabel">
<span class="label"><label for="photologin-nickname">Nickname</label>:</span>
</td><td class="formelement">

<div class="formelementbody">
<input type="text" class="text type-String"
name="nickname" id="photologin-nickname"
value="'.$_POST[nickname].'" /><div class="formerror hidden" id="err-photologin-nickname">


</div>
</div>
</td>
</tr>
<tr id="formline-photologin-password" class="formline formline-photologin-password formres-no formres-noresult-photologin-password ">
<td class="formlabel">
<span class="label"><label for="photologin-password">Passwort</label>:</span>
</td><td class="formelement">
<div class="formelementbody">
<input type="password" class="text password type-String"
name="password" id="photologin-password"
/><div class="formerror" id="err-photologin-password">

Das Feld muss angegeben werden.
</div>

</div>
</td>
</tr>
</tbody>
</table>
<div class="bbutton submit" id="submit-button-1719087160"><div class="bttl corner"></div><div class="bttr corner"></div><div class="bttm"></div><div class="btm"><img src="/sf/m/buttons/bt-nm.png" id="submit-button-1543648886-img" class="jsFixHeight" style="" height="22" width="" /><input type="submit" name="submit" value="Login" class="image-submit" /><div class="btmi"><span class="text">Login</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></div>
</form></div>
</div>';

}elseif(!$ruw[name]) {
$inhalt .= '
<div class="photo">
<div class="noh1"></div>
<div class="box photoslogin small">
<div class="hd">
<div class="tl"></div>
<div class="tr"></div>

<div class="tm"></div>
<div class="m"><div class="mi"><div class="h h1"><div class="hbegin"></div><h1>Login</h1></div>
</div></div>
</div>
<div class="bd fade bd-fade">
<div class="m">
<div class="mi">
<form action="photos-login.php" name="submit" accept-charset="utf-8" method="POST">
<table class="none">
<tbody>
<tr id="formline-photologin-nickname" class="formline formline-photologin-nickname formres-no formres-noresult-photologin-nickname ">
<td class="formlabel">
<span class="label"><label for="photologin-nickname">Nickname</label>:</span>
</td><td class="formelement">

<div class="formelementbody">
<input type="text" class="text type-String"
name="nickname" id="photologin-nickname"
value="'.$_POST[nickname].'" /><div class="formerror" id="err-photologin-nickname">
Der Nick existiert nicht.

</div>
</div>
</td>
</tr>
<tr id="formline-photologin-password" class="formline formline-photologin-password formres-no formres-noresult-photologin-password ">
<td class="formlabel">
<span class="label"><label for="photologin-password">Passwort</label>:</span>
</td><td class="formelement">
<div class="formelementbody">
<input type="password" class="text password type-String"
name="password" id="photologin-password" value="'.$_POST[passwort].'"
/><div class="formerror hidden" id="err-photologin-password">
</div>

</div>
</td>
</tr>
</tbody>
</table>
<div class="bbutton submit" id="submit-button-1719087160"><div class="bttl corner"></div><div class="bttr corner"></div><div class="bttm"></div><div class="btm"><img src="/sf/m/buttons/bt-nm.png" id="submit-button-1543648886-img" class="jsFixHeight" style="" height="22" width="" /><input type="submit" name="submit" value="Login" class="image-submit" /><div class="btmi"><span class="text">Login</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></div>
</form></div>
</div>';
}elseif(sha1($_POST[password]) != $ruw[password]) {
$inhalt .= '
<div class="photo">
<div class="noh1"></div>
<div class="box photoslogin small">
<div class="hd">
<div class="tl"></div>
<div class="tr"></div>

<div class="tm"></div>
<div class="m"><div class="mi"><div class="h h1"><div class="hbegin"></div><h1>Login</h1></div>
</div></div>
</div>
<div class="bd fade bd-fade">
<div class="m">
<div class="mi">
<form action="photos-login.php" name="submit" accept-charset="utf-8" method="POST">
<table class="none">
<tbody>
<tr id="formline-photologin-nickname" class="formline formline-photologin-nickname formres-no formres-noresult-photologin-nickname ">
<td class="formlabel">
<span class="label"><label for="photologin-nickname">Nickname</label>:</span>
</td><td class="formelement">

<div class="formelementbody">
<input type="text" class="text type-String"
name="nickname" id="photologin-nickname"
value="'.$_POST[nickname].'" /><div class="formerror hidden" id="err-photologin-nickname">

</div>
</div>
</td>
</tr>
<tr id="formline-photologin-password" class="formline formline-photologin-password formres-no formres-noresult-photologin-password ">
<td class="formlabel">
<span class="label"><label for="photologin-password">Passwort</label>:</span>
</td><td class="formelement">
<div class="formelementbody">
<input type="password" class="text password type-String"
name="password" id="photologin-password" value="'.$_POST[passwort].'"
/><div class="formerror" id="err-photologin-password">
Das Passwort ist falsch.
</div>

</div>
</td>
</tr>
</tbody>
</table>
<div class="bbutton submit" id="submit-button-1719087160"><div class="bttl corner"></div><div class="bttr corner"></div><div class="bttm"></div><div class="btm"><img src="/sf/m/buttons/bt-nm.png" id="submit-button-1543648886-img" class="jsFixHeight" style="" height="22" width="" /><input type="submit" name="submit" value="Login" class="image-submit" /><div class="btmi"><span class="text">Login</span></div></div><div class="btbl corner"></div><div class="btbr corner"></div><div class="btbm"></div></div>
</form></div>
</div>';
}else{
header("location:photos-profile.php?id=$ruw[name]");
$_SESSION[foto] = $ruw[name];
}
}}
$inhalt .= '
          
          <div class="bl"></div>
          <div class="br"></div>
          <div class="bm"></div>

         
        </div></div></div>
       </div>';

$styles = '<link href="/sf/f/registration/registration.css" rel="stylesheet" type="text/css">
<link href="/sf/m/buttons/buttons.css" rel="stylesheet" type="text/css"><link href="/sf/f/index/index.css" rel="stylesheet" type="text/css"><link href="/sf/m/boxes/boxes.css" rel="stylesheet" type="text/css"><link href="/sf/m/forms/forms.css" rel="stylesheet" type="text/css"><link href="/sf/f/photos/photos.css" rel="stylesheet" type="text/css"><link href="/sf/m/tables/tables.css" rel="stylesheet" type="text/css"><link href="/sf/m/uploader/uploader.css" rel="stylesheet" type="text/css"><link href="/sf/f/photos/photos-rate.css" rel="stylesheet" type="text/css">
';
echo str_replace(array('<?url?>','<?inhalt?>', '<?titel?>', '<?fotonavi?>', '<?registrieren?>', '<?styles?>', '<?fotos?>'),array($_SERVER[SERVER_NAME], $inhalt, $titel, $fotonavi, $registrieren, $styles, $fotos),implode("",file("sf/b/style.tpl")));
?>    