Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
<?php
2
include "config.php";
3
 
4
if(isset($w)&&$w=='logout'){
5
setcookie('admin_pass','');$admin_pass='';}
6
 
7
$pss_file=$data_dir.'/psss.php';
8
$die_string="</head><body class=\"y\" onload=\"window.location='admin.php?r=$random'\">OK</body></html>";
9
 
10
if(!is_writeable($pss_file)){
11
if(!isset($setup_pass)||$setup_pass==''){
12
include "incl/header.inc";
13
print '</head><body class="y" onload="document.forms[0].setup_pass.focus()"><form action="admin.php" method="post">';
14
print '<table align="center" class="t"><tr><td class="k" align="center">';
15
print '<input type="'.$password_field.'" name="setup_pass" class="g" value="" /> <input type="submit" class="g" value="'.$lang[6].'" /><br /><br />'.$lang[56];
16
print '</td></tr></table></form></body></html>';die();
17
}
18
else{
19
setcookie('admin_pass',$setup_pass);
20
$setup_pass='<?php die();?>'.md5($setup_pass);
21
save_file($pss_file,$setup_pass,'CHMOD /data to 777!');
22
include "incl/header.inc";
23
die($die_string);}}
24
 
25
else{
26
$stored_pass=open_file($pss_file,0);
27
$stored_pass=str_replace('<?php die();?>','',$stored_pass);
28
 
29
if(!isset($admin_pass)||$stored_pass!=md5($admin_pass)){
30
 
31
if(isset($enter_pass)&&$stored_pass==md5($enter_pass)){
32
setcookie('admin_pass',$enter_pass);
33
include "incl/header.inc";
34
die($die_string);}
35
 
36
else{
37
include "incl/header.inc";
38
print '</head><body class="y" onload="document.forms[0].enter_pass.focus()"><form action="admin.php" method="post">';
39
print '<table align="center" class="t"><tr><td class="k" align="center">';
40
print '<input type="'.$password_field.'" name="enter_pass" class="g" value="" /> <input type="submit" class="g" value="'.$lang[6].'" /><br /><br />';
41
print '</td></tr></table></form></body></html>';die();
42
}}}?>