summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Kinkade <nath@nkinka.de>2011-03-16 14:47:23 +0000
committerNathan Kinkade <nath@nkinka.de>2011-03-16 14:47:23 +0000
commit6b963b4a679d9af06a0e4018ba739fb327227fda (patch)
treea525df3d460773f4bfa32436cd852e8dd20f4722
parent22bd552686aecbc04e5814a24cc1a2e69bed29a5 (diff)
Allow users to change their login, but when searching for duplicates, don't include current id.
-rw-r--r--edit_account.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/edit_account.php b/edit_account.php
index e456162..73ec9bd 100644
--- a/edit_account.php
+++ b/edit_account.php
@@ -16,8 +16,6 @@ include("config.php");
# not then this function will send them back to the index page
loginRequired();
-# if the user got here by pressing the "Register" button, then
-# let's process is his request.
if ( isset($_POST['action']) && ($_POST['action'] == "editUser") ) {
# validate the form .. this is already done through javascript, but we
@@ -70,8 +68,10 @@ if ( isset($_POST['action']) && ($_POST['action'] == "editUser") ) {
$sql = sprintf ("
SELECT * FROM users
WHERE username = '%s'
+ AND id != '%s'
",
- trim($_POST['username'])
+ trim($_POST['username']),
+ $_SESSION['user']['id']
);
$db->Select($sql);
if ( $db->_rowCount > 0 ) {