cvs: php-hosts-web /include shared.inc

From: Date: Tue, 23 Apr 2002 04:24:46 +0000
Subject: cvs: php-hosts-web /include shared.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-9802@lists.php.net to get a copy of this message
jimw Tue Apr 23 00:24:46 2002 EDT Modified files: /php-hosts-web/include shared.inc Log: authentication functions Index: php-hosts-web/include/shared.inc diff -u php-hosts-web/include/shared.inc:1.8 php-hosts-web/include/shared.inc:1.9 --- php-hosts-web/include/shared.inc:1.8 Sun Apr 21 23:04:13 2002 +++ php-hosts-web/include/shared.inc Tue Apr 23 00:24:46 2002 @@ -2,6 +2,7 @@ srand(date("s")); require 'country_codes.inc'; +require 'cvs-auth.inc'; /* let caches know that we vary page content based on Cookie headers. */ header("Vary: Cookie"); @@ -13,7 +14,6 @@ or die ("unable to select database: ".mysql_error()); $HOSTS_TABLE = "hosts"; -$USERS_TABLE = "users"; $HOST_SERVICES_TABLE = "host_services"; $SERVICES_TABLE = "services"; $OPTIONS_TABLE = "options"; @@ -103,6 +103,25 @@ echo $errors[0]; } echo '</div>'; +} + +function verify_host_login() { + if ($_COOKIE['HOSTID']) { + list($hostid,$pass) = explode(":", $_COOKIE['HOSTID'], 2); + $hostid = (int)$hostid; + $pass = base64_decode($pass); + return mysql_get_one("SELECT HostId FROM hosts WHERE HostId=$hostid AND ENCRYPT('$pass',password) = password"); + } + return false; +} + +function verify_staff_login() { + if ($_COOKIE['MAGIC_COOKIE']) { + list($user,$pw) + = explode(":", base64_decode($_COOKIE['MAGIC_COOKIE'])); + return verify_password($user,stripslashes($pw)); + } + return false; } ?>

« previous php.mirrors (#9802) next »