aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_user.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-06-22 15:14:03 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-06-22 15:14:03 +0000
commit725b21f2d206efb4b34eb95ec3329bc81f66b805 (patch)
tree7de41ee058c21e1884bc5d2292f5e7014a587890 /phpBB/includes/functions_user.php
parentdaa0435614af7bed95e71f3b11aa2c372df3958d (diff)
downloadforums-725b21f2d206efb4b34eb95ec3329bc81f66b805.tar
forums-725b21f2d206efb4b34eb95ec3329bc81f66b805.tar.gz
forums-725b21f2d206efb4b34eb95ec3329bc81f66b805.tar.bz2
forums-725b21f2d206efb4b34eb95ec3329bc81f66b805.tar.xz
forums-725b21f2d206efb4b34eb95ec3329bc81f66b805.zip
time to squash some bugs
git-svn-id: file:///svn/phpbb/trunk@6114 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r--phpBB/includes/functions_user.php25
1 files changed, 16 insertions, 9 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 0eab7d8a6f..1b4dc37cd2 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -37,6 +37,8 @@ function user_get_id_name(&$user_id_ary, &$username_ary)
$sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', $$which_ary) : preg_replace('#^\s*(.*)\s*$#e', "\"'\" . \$db->sql_escape('\\1') . \"'\"", $$which_ary);
unset($$which_ary);
+ $user_id_ary = $username_ary = array();
+
// Grab the user id/username records
$sql_where = ($which_ary == 'user_id_ary') ? 'user_id' : 'username';
$sql = 'SELECT user_id, username
@@ -50,7 +52,6 @@ function user_get_id_name(&$user_id_ary, &$username_ary)
return 'NO_USERS';
}
- $user_id_ary = $username_ary = array();
do
{
$username_ary[$row['user_id']] = $row['username'];
@@ -234,6 +235,9 @@ function user_add($user_row, $cp_data = false)
$db->sql_transaction('commit');
+ // Now make it the users default group...
+ group_set_user_default($user_row['group_id'], array($user_id));
+
return $user_id;
}
@@ -1092,7 +1096,7 @@ function validate_email($email)
return 'EMAIL_INVALID';
}
- if ($user->check_ban('', '', $email, true) == true)
+ if ($user->check_ban(false, false, $email, true) == true)
{
return 'EMAIL_BANNED';
}
@@ -1513,6 +1517,9 @@ function group_delete($group_id, $group_name = false)
WHERE group_id = $group_id";
$db->sql_query($sql);
+ // Re-cache moderators
+ cache_moderators();
+
add_log('admin', 'LOG_GROUP_DELETE', $group_name);
return 'GROUP_DELETED';
@@ -1526,9 +1533,9 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
global $db, $auth;
// We need both username and user_id info
- user_get_id_name($user_id_ary, $username_ary);
+ $result = user_get_id_name($user_id_ary, $username_ary);
- if (!sizeof($user_id_ary))
+ if (!sizeof($user_id_ary) || $result !== false)
{
return 'NO_USER';
}
@@ -1629,9 +1636,9 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
$group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'REGISTERED_COPPA', 'REGISTERED', 'BOTS', 'GUESTS');
// We need both username and user_id info
- user_get_id_name($user_id_ary, $username_ary);
+ $result = user_get_id_name($user_id_ary, $username_ary);
- if (!sizeof($user_id_ary))
+ if (!sizeof($user_id_ary) || $result !== false)
{
return 'NO_USER';
}
@@ -1762,9 +1769,9 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
global $db, $auth, $phpbb_root_path, $phpEx, $config;
// We need both username and user_id info
- user_get_id_name($user_id_ary, $username_ary);
+ $result = user_get_id_name($user_id_ary, $username_ary);
- if (!sizeof($user_id_ary))
+ if (!sizeof($user_id_ary) || $result !== false)
{
return false;
}
@@ -1869,7 +1876,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal
{
global $db;
- if (!$user_id_ary)
+ if (empty($user_id_ary))
{
return;
}