mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Various updates, password email hash, altered function names
git-svn-id: file:///svn/phpbb/trunk@4799 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
fd8d235e41
commit
173ac0529b
1 changed files with 7 additions and 12 deletions
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
// Obtain user_ids from usernames or vice versa. Returns false on
|
// Obtain user_ids from usernames or vice versa. Returns false on
|
||||||
// success else the error string
|
// success else the error string
|
||||||
function get_username_id_data(&$user_id_ary, &$username_ary)
|
function user_get_id_name(&$user_id_ary, &$username_ary)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
|
@ -278,9 +278,9 @@ function validate_email($email)
|
||||||
|
|
||||||
if (!$config['allow_emailreuse'])
|
if (!$config['allow_emailreuse'])
|
||||||
{
|
{
|
||||||
$sql = 'SELECT user_email
|
$sql = 'SELECT user_email_hash
|
||||||
FROM ' . USERS_TABLE . "
|
FROM ' . USERS_TABLE . "
|
||||||
WHERE user_email = '" . $db->sql_escape($email) . "'";
|
WHERE user_email_hash = " . crc32(strtolower($email)) . strlen($email);
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
if ($row = $db->sql_fetchrow($result))
|
||||||
|
@ -608,9 +608,7 @@ function group_delete($group_id, $group_name = false)
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
$batch = 100;
|
|
||||||
$start = 0;
|
$start = 0;
|
||||||
$end = $start + $batch;
|
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -621,8 +619,7 @@ function group_delete($group_id, $group_name = false)
|
||||||
FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . " u
|
FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . " u
|
||||||
WHERE ug.group_id = $group_id
|
WHERE ug.group_id = $group_id
|
||||||
AND u.user_id = ug.user_id
|
AND u.user_id = ug.user_id
|
||||||
BETWEEN $start
|
LIMIT $start, 200";
|
||||||
AND $end";
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
if ($row = $db->sql_fetchrow($result))
|
||||||
|
@ -637,8 +634,6 @@ function group_delete($group_id, $group_name = false)
|
||||||
while ($row = $db->sql_fetchrow($result));
|
while ($row = $db->sql_fetchrow($result));
|
||||||
|
|
||||||
group_user_del($group_id, $user_id_ary, $username_ary, $group_name);
|
group_user_del($group_id, $user_id_ary, $username_ary, $group_name);
|
||||||
|
|
||||||
$end = $start + $batch;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -669,7 +664,7 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
|
||||||
global $db, $auth;
|
global $db, $auth;
|
||||||
|
|
||||||
// We need both username and user_id info
|
// We need both username and user_id info
|
||||||
get_username_id_data($user_id_ary, $username_ary);
|
user_get_id_name($user_id_ary, $username_ary);
|
||||||
|
|
||||||
// Remove users who are already members of this group
|
// Remove users who are already members of this group
|
||||||
$sql = 'SELECT user_id, group_leader
|
$sql = 'SELECT user_id, group_leader
|
||||||
|
@ -861,7 +856,7 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
|
||||||
$attribute_ary = array('group_colour' => 'string', 'group_rank' => 'int', 'group_avatar' => 'string', 'group_avatar_type' => 'int', 'group_avatar_width' => 'int', 'group_avatar_height' => 'int');
|
$attribute_ary = array('group_colour' => 'string', 'group_rank' => 'int', 'group_avatar' => 'string', 'group_avatar_type' => 'int', 'group_avatar_width' => 'int', 'group_avatar_height' => 'int');
|
||||||
|
|
||||||
// We need both username and user_id info
|
// We need both username and user_id info
|
||||||
get_username_id_data($user_id_ary, $username_ary);
|
user_get_id_name($user_id_ary, $username_ary);
|
||||||
|
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . GROUPS_TABLE . '
|
FROM ' . GROUPS_TABLE . '
|
||||||
|
@ -985,7 +980,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
||||||
global $db, $auth;
|
global $db, $auth;
|
||||||
|
|
||||||
// We need both username and user_id info
|
// We need both username and user_id info
|
||||||
get_username_id_data($user_id_ary, $username_ary);
|
user_get_id_name($user_id_ary, $username_ary);
|
||||||
|
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue