From b5bc0a836d904172ab4edff303bc22f1eb4b1d29 Mon Sep 17 00:00:00 2001 From: Lana Alber Date: Tue, 21 Sep 2004 21:56:10 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4220 --- aclocal.m4 | 2 +- checkin_notes | 7 ------- html/inc/db.inc | 10 ++++++++++ html/inc/util.inc | 18 ++++++++++++++++++ 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 5325821f9a..5822270c8b 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1106,7 +1106,7 @@ AC_DEFUN([SAH_HEADER_STDCXX],[ # # Revision Log: # $Log$ -# Revision 1.146 2004/09/13 22:58:46 boincadm +# Revision 1.147 2004/09/21 21:56:04 lana # *** empty log message *** # # Revision 1.1 2003/12/11 18:38:24 korpela diff --git a/checkin_notes b/checkin_notes index e24c98c0b3..0c822bad61 100755 --- a/checkin_notes +++ b/checkin_notes @@ -17529,10 +17529,3 @@ David 21 Sept 2004 handle_request.C sched_send.C -Lana 21 Sept 2004 - - fixed opening of the ops page - - html/ - inc/ - db.inc - util.inc diff --git a/html/inc/db.inc b/html/inc/db.inc index 435b1fc772..df36e3fec3 100644 --- a/html/inc/db.inc +++ b/html/inc/db.inc @@ -25,6 +25,16 @@ function db_init_aux() { return 0; } +function lookup_user_auth($auth) { + $result = mysql_query("select * from user where authenticator='$auth'"); + if ($result) { + $user = mysql_fetch_object($result); + mysql_free_result($result); + return $user; + } + return null; +} + function lookup_user_id($id) { $result = mysql_query("select * from user where id=$id"); if ($result) { diff --git a/html/inc/util.inc b/html/inc/util.inc index da1be58a96..253736cd77 100644 --- a/html/inc/util.inc +++ b/html/inc/util.inc @@ -4,6 +4,24 @@ require_once("../project/project.inc"); require_once("../inc/countries.inc"); require_once("../inc/db.inc"); +function db_init() { + if (project_is_stopped()) { + echo "Project is shut down for maintenance - please try again later\n"; + exit(); + } + $retval = db_init_aux(); + if ($retval == 1) { + echo "Unable to connect to database - please try again later\n"; + echo "Error: ", mysql_errno(), mysql_error(); + exit(); + } + if ($retval == 2) { + echo "Unable to select database - please try again later"; + echo mysql_error(); + exit(); + } +} + // Sends the authenticator to the given email address // function send_auth_email($email_addr, $auth) {