diff options
author | Dries Buytaert <dries@buytaert.net> | 2000-06-11 13:24:10 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2000-06-11 13:24:10 +0000 |
commit | f66120de0576cd3b19ba329ed4976d7d9e6d7d6f (patch) | |
tree | b0ff12da4abfa1fb4d462a0d5b8743bd6da4f657 | |
parent | 44a566c8ca813e1f1d4f1d32500c73f812ab96fe (diff) | |
download | brdo-f66120de0576cd3b19ba329ed4976d7d9e6d7d6f.tar.gz brdo-f66120de0576cd3b19ba329ed4976d7d9e6d7d6f.tar.bz2 |
Updates:
* Various small changes to account.php including a SQL table movement:
'testusers' -> 'users'. As a result, user.class.php and article.php
needed patching as well. Hopefully I didn't break anyting. ;o)
-rw-r--r-- | account.php | 13 | ||||
-rw-r--r-- | article.php | 2 | ||||
-rw-r--r-- | user.class.php | 6 |
3 files changed, 10 insertions, 11 deletions
diff --git a/account.php b/account.php index c94b2d463..084388779 100644 --- a/account.php +++ b/account.php @@ -1,7 +1,6 @@ <? include "config.inc"; include "functions.inc"; -include "database.inc"; function dbsave($dbase, $data, $id=0) { foreach ($data as $key=>$value) { @@ -61,7 +60,7 @@ function newUser($user = "", $error="") { $theme->footer(); } function validateUser($user) { - include "ban.class.php"; + include "ban.inc"; ### Verify username and e-mail address: $user[userid] = trim($user[userid]); @@ -75,8 +74,8 @@ function validateUser($user) { ### Verify whether username and e-mail address are unique: dbconnect(); - if (mysql_num_rows(mysql_query("SELECT userid FROM testusers WHERE LOWER(userid)=LOWER('$user[userid]')")) > 0) $rval = "the specified username is already taken."; - if (mysql_num_rows(mysql_query("SELECT email FROM testusers WHERE LOWER(email)=LOWER('$user[email]')")) > 0) $rval = "the specified e-mail address is already registered."; + if (mysql_num_rows(mysql_query("SELECT userid FROM users WHERE LOWER(userid)=LOWER('$user[userid]')")) > 0) $rval = "the specified username is already taken."; + if (mysql_num_rows(mysql_query("SELECT email FROM users WHERE LOWER(email)=LOWER('$user[email]')")) > 0) $rval = "the specified e-mail address is already registered."; return($rval); } function makePassword($min_length=6) { @@ -107,7 +106,7 @@ switch ($op) { else { include('theme.inc'); $new[passwd] = makePassword(); - dbsave("testusers", $new); + dbsave("users", $new); $theme->header(); if ($system == 1) { print("Your password is: <B>$new[passwd]</B><BR>"); @@ -211,7 +210,7 @@ switch ($op) { $data[ublock] = $edit[ublock]; $data[ublockon] = $edit[ublockon]; if ($edit[pass1] == $edit[pass2] && !empty($edit[pass1])) { $data[passwd] = $edit[pass1]; } - dbsave("testusers", $data, $user->id); + dbsave("users", $data, $user->id); $user->update(); } showUser(); @@ -224,7 +223,7 @@ switch ($op) { $data[uorder] = $edit[uorder]; $data[thold] = $edit[thold]; $data[signature] = $edit[signature]; - dbsave("testusers", $data, $user->id); + dbsave("users", $data, $user->id); $user->update(); } showUser(); diff --git a/article.php b/article.php index 320d627f0..0c14e9b7e 100644 --- a/article.php +++ b/article.php @@ -8,7 +8,7 @@ dbconnect(); if ($save) { - mysql_query("UPDATE testusers SET umode='$mode', uorder='$order', thold='$thold' where id='$user->id'"); + mysql_query("UPDATE users SET umode='$mode', uorder='$order', thold='$thold' where id='$user->id'"); $user->update(); } diff --git a/user.class.php b/user.class.php index cd97cfa94..3600e989b 100644 --- a/user.class.php +++ b/user.class.php @@ -6,14 +6,14 @@ $access = array("Administrator" => 0x00000001, class User { function User($userid, $passwd="") { dbconnect(); - $result = mysql_query("SELECT * FROM testusers WHERE LOWER(userid)=LOWER('$userid') && passwd=PASSWORD('$passwd') && STATUS=0") or die(sprintf("Critical error at line %d in %s: %s", __LINE__, __FILE__, mysql_error())); + $result = mysql_query("SELECT * FROM users WHERE LOWER(userid)=LOWER('$userid') && passwd=PASSWORD('$passwd') && STATUS=0") or die(sprintf("Critical error at line %d in %s: %s", __LINE__, __FILE__, mysql_error())); if (mysql_num_rows($result) == 1) { foreach (mysql_fetch_array($result) as $key=>$value) { $this->$key = $value; } } } function update() { dbconnect(); - $result = mysql_query("SELECT * FROM testusers WHERE id=$this->id") or die(sprintf("Critical error at line %d in %s: %s", __LINE__, __FILE__, mysql_error())); + $result = mysql_query("SELECT * FROM users WHERE id=$this->id") or die(sprintf("Critical error at line %d in %s: %s", __LINE__, __FILE__, mysql_error())); if (mysql_num_rows($result) == 1) { foreach (mysql_fetch_array($result) as $key=>$value) { $this->$key = $value; } } @@ -23,7 +23,7 @@ class User { $this->last_access = time(); $this->last_host = (!empty($GLOBALS[REMOTE_HOST]) ? $GLOBALS[REMOTE_HOST] : $GLOBALS[REMOTE_ADDR] ); dbconnect(); - mysql_query("UPDATE testusers SET last_access='$this->last_access',last_host='$this->last_host' WHERE id=$this->id") or die(sprintf("Critical error at line %d in %s: %s", __LINE__, __FILE__, mysql_error())); + mysql_query("UPDATE users SET last_access='$this->last_access',last_host='$this->last_host' WHERE id=$this->id") or die(sprintf("Critical error at line %d in %s: %s", __LINE__, __FILE__, mysql_error())); if ($this->access & $access || $access == 0) return 1; } return 0; |