1 |
<?PHP |
2 |
|
3 |
###################################################################### |
4 |
# PHP-NUKE: Web Portal System |
5 |
# =========================== |
6 |
# |
7 |
# Copyright (c) 2000 by Francisco Burzi (fburzi@ncc.org.ve) |
8 |
# http://www.ncc.org.ve/php-nuke.php |
9 |
# |
10 |
# This modules is for administrators authentication |
11 |
# |
12 |
# This program is free software. You can redistribute it and/or modify |
13 |
# it under the terms of the GNU General Public License as published by |
14 |
# the Free Software Foundation; either version 2 of the License. |
15 |
###################################################################### |
16 |
|
17 |
if(!isset($mainfile)) { include("mainfile.php"); } |
18 |
|
19 |
if ((isset($aid)) && (isset($pwd)) && ($op == "login")) { |
20 |
if($aid!="" AND $pwd!="") { |
21 |
dbconnect(); |
22 |
$result=mysql_query("select pwd from authors where aid='$aid'"); |
23 |
list($pass)=mysql_fetch_row($result); |
24 |
if($pass == $pwd) { |
25 |
$admin = base64_encode("$aid:$pwd"); |
26 |
setcookie("admin","$admin",time()+2592000); // 1 mo is 2592000 |
27 |
} |
28 |
} |
29 |
} |
30 |
|
31 |
$admintest = 0; |
32 |
|
33 |
if(isset($admin)) { |
34 |
if(!IsSet($mainfile)) { include("mainfile.php"); } |
35 |
$admin = base64_decode($admin); |
36 |
$admin = explode(":", $admin); |
37 |
$aid = "$admin[0]"; |
38 |
$pwd = "$admin[1]"; |
39 |
if ($aid=="" || $pwd=="") { |
40 |
$admintest=0; |
41 |
exit; |
42 |
} |
43 |
dbconnect(); |
44 |
$result=mysql_query("select pwd from authors where aid='$aid'"); |
45 |
if(!$result) { |
46 |
echo "Selection from database failed!"; |
47 |
exit; |
48 |
} else { |
49 |
list($pass)=mysql_fetch_row($result); |
50 |
|
51 |
if($pass == $pwd && $pass != "") { |
52 |
$admintest = 1; |
53 |
} |
54 |
} |
55 |
} |
56 |
|
57 |
?> |