1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

Posting preview done, ability for anonymous users to post with a username

git-svn-id: file:///svn/phpbb/trunk@463 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
James Atkinson
2001-06-11 00:58:08 +00:00
parent b71e098cdc
commit cb44575d8a
10 changed files with 210 additions and 99 deletions

View File

@@ -37,61 +37,7 @@ init_userprefs($userdata);
//
// Page specific functions
//
function validate_username($username)
{
global $db;
switch(SQL_LAYER)
{
// Along with subqueries MySQL also lacks
// a UNION clause which would be very nice here :(
// So we have to use two queries
case 'mysql':
$sql_users = "SELECT username
FROM ".USERS_TABLE."
WHERE LOWER(username) = '".strtolower($username)."'";
$sql_disallow = "SELECT disallow_username
FROM ".DISALLOW_TABLE."
WHERE disallow_username = '$username'";
if($result = $db->sql_query($sql_users))
{
if($db->sql_numrows($result) > 0)
{
return(FALSE);
}
}
if($result = $db->sql_query($sql_disallow))
{
if($db->sql_numrows($result) > 0)
{
return(FALSE);
}
}
break;
default:
$sql = "SELECT disallow_username
FROM ".DISALLOW_TABLE."
WHERE disallow_username = '$username'
UNION
SELECT username
FROM ".USERS_TABLE."
WHERE LOWER(username) = '".strtolower($username)."'";
if($result = $db->sql_query($sql))
{
if($db->sql_numrows($result) > 0)
{
return(FALSE);
}
}
break;
}
return(TRUE);
}
function language_select($default, $dirname="language/")
{
global $phpEx;