当前位置: 首页>>代码示例>>PHP>>正文


PHP phpbb_clean_username函数代码示例

本文整理汇总了PHP中phpbb_clean_username函数的典型用法代码示例。如果您正苦于以下问题:PHP phpbb_clean_username函数的具体用法?PHP phpbb_clean_username怎么用?PHP phpbb_clean_username使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了phpbb_clean_username函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: validate_username

function validate_username($username)
{
    global $db, $lang, $userdata;
    // Remove doubled up spaces
    $username = preg_replace('#\\s+#', ' ', trim($username));
    $username = phpbb_clean_username($username);
    $sql = "SELECT username \r\n\t\tFROM " . USERS_TABLE . "\r\n\t\tWHERE LOWER(username) = '" . strtolower($username) . "'";
    if ($result = $db->sql_query($sql)) {
        while ($row = $db->sql_fetchrow($result)) {
            if ($userdata['session_logged_in'] && $row['username'] != $userdata['username'] || !$userdata['session_logged_in']) {
                $db->sql_freeresult($result);
                return array('error' => true, 'error_msg' => $lang['Username_taken']);
            }
        }
    }
    $db->sql_freeresult($result);
    $sql = "SELECT group_name\r\n\t\tFROM " . GROUPS_TABLE . " \r\n\t\tWHERE LOWER(group_name) = '" . strtolower($username) . "'";
    if ($result = $db->sql_query($sql)) {
        if ($row = $db->sql_fetchrow($result)) {
            $db->sql_freeresult($result);
            return array('error' => true, 'error_msg' => $lang['Username_taken']);
        }
    }
    $db->sql_freeresult($result);
    $sql = "SELECT disallow_username\r\n\t\tFROM " . DISALLOW_TABLE;
    if ($result = $db->sql_query($sql)) {
        if ($row = $db->sql_fetchrow($result)) {
            do {
                if (preg_match("#\\b(" . str_replace("\\*", ".*?", preg_quote($row['disallow_username'], '#')) . ")\\b#i", $username)) {
                    $db->sql_freeresult($result);
                    return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
                }
            } while ($row = $db->sql_fetchrow($result));
        }
    }
    $db->sql_freeresult($result);
    $sql = "SELECT word \r\n\t\tFROM  " . WORDS_TABLE;
    if ($result = $db->sql_query($sql)) {
        if ($row = $db->sql_fetchrow($result)) {
            do {
                if (preg_match("#\\b(" . str_replace("\\*", ".*?", preg_quote($row['word'], '#')) . ")\\b#i", $username)) {
                    $db->sql_freeresult($result);
                    return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
                }
            } while ($row = $db->sql_fetchrow($result));
        }
    }
    $db->sql_freeresult($result);
    // Don't allow " and ALT-255 in username.
    if (strstr($username, '"') || strstr($username, '"') || strstr($username, chr(160)) || strstr($username, chr(173))) {
        return array('error' => true, 'error_msg' => $lang['Username_invalid']);
    }
    return array('error' => false, 'error_msg' => '');
}
开发者ID:Nekrofage,项目名称:FJR,代码行数:54,代码来源:functions_validate.php

示例2: get_userdata

function get_userdata($user, $force_str = false)
{
    global $db;
    if (intval($user) == 0 || $force_str) {
        $user = phpbb_clean_username($user);
    } else {
        $user = intval($user);
    }
    $sql = "SELECT *\n\t\tFROM " . USERS_TABLE . " \n\t\tWHERE ";
    $sql .= (is_integer($user) ? "user_id = {$user}" : "username = '" . $user . "'") . " AND user_id <> " . ANONYMOUS;
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Tried obtaining data for a non-existent user', '', __LINE__, __FILE__, $sql);
    }
    return ($row = $db->sql_fetchrow($result)) ? $row : false;
}
开发者ID:Juuro,项目名称:Dreamapp-Website,代码行数:15,代码来源:functions.php

示例3: get_userdata_notifications

function get_userdata_notifications($target_user, $force_str = false)
{
    global $db;
    $target_user = !is_numeric($target_user) || $force_str ? phpbb_clean_username($target_user) : intval($target_user);
    $sql = "SELECT *\n\t\t\tFROM " . USERS_TABLE . "\n\t\t\tWHERE ";
    $sql .= (is_integer($target_user) ? "user_id = " . $target_user : "username = '" . $db->sql_escape($target_user) . "'") . " AND user_id <> " . ANONYMOUS;
    $result = $db->sql_query($sql);
    $return_value = ($row = $db->sql_fetchrow($result)) ? $row : false;
    $db->sql_freeresult($result);
    return $return_value;
}
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:11,代码来源:functions_post.php

示例4: message_die

         message_die(GENERAL_ERROR, "Could not obtain message details", "", __LINE__, __FILE__, $sql);
     }
     if (!($row = $db->sql_fetchrow($result))) {
         message_die(GENERAL_MESSAGE, $lang['No_such_post']);
     }
     $db->sql_freeresult($result);
     unset($row);
 }
 if ($submit) {
     // session id check
     if ($sid == '' || $sid != $userdata['session_id']) {
         $error = true;
         $error_msg .= (!empty($error_msg) ? '<br />' : '') . $lang['Session_invalid'];
     }
     if (!empty($HTTP_POST_VARS['username'])) {
         $to_username = phpbb_clean_username($HTTP_POST_VARS['username']);
         $sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active \r\n\t\t\t\tFROM " . USERS_TABLE . "\r\n\t\t\t\tWHERE username = '" . str_replace("\\'", "''", $to_username) . "'\r\n\t\t\t\t\tAND user_id <> " . ANONYMOUS;
         if (!($result = $db->sql_query($sql))) {
             $error = TRUE;
             $error_msg = $lang['No_such_user'];
         }
         if (!($to_userdata = $db->sql_fetchrow($result))) {
             $error = TRUE;
             $error_msg = $lang['No_such_user'];
         }
     } else {
         $error = TRUE;
         $error_msg .= (!empty($error_msg) ? '<br />' : '') . $lang['No_to_user'];
     }
     $privmsg_subject = trim(htmlspecialchars($HTTP_POST_VARS['subject']));
     if (empty($privmsg_subject)) {
开发者ID:Nekrofage,项目名称:FJR,代码行数:31,代码来源:privmsg.php

示例5: implode

     }
     if (count($mark_list)) {
         $delete_sql_id = implode(', ', $mark_list);
         $delete_text_sql = "DELETE FROM " . PRIVMSGS_TEXT_TABLE . "\n\t\t\t\t\tWHERE privmsgs_text_id IN ({$delete_sql_id})";
         $delete_sql = "DELETE FROM " . PRIVMSGS_TABLE . "\n\t\t\t\t\tWHERE privmsgs_id IN ({$delete_sql_id})";
         if (!$db->sql_query($delete_sql)) {
             message_die(GENERAL_ERROR, 'Could not delete private message info', '', __LINE__, __FILE__, $delete_sql);
         }
         if (!$db->sql_query($delete_text_sql)) {
             message_die(GENERAL_ERROR, 'Could not delete private message text', '', __LINE__, __FILE__, $delete_text_sql);
         }
     }
     $message = $lang['User_deleted'] . '<br /><br />' . sprintf($lang['Click_return_useradmin'], '<a href="' . append_sid("admin_users.{$phpEx}") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.{$phpEx}?pane=right") . '">', '</a>');
     message_die(GENERAL_MESSAGE, $message);
 }
 $username = !empty($HTTP_POST_VARS['username']) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';
 $email = !empty($HTTP_POST_VARS['email']) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['email']))) : '';
 $password = !empty($HTTP_POST_VARS['password']) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password']))) : '';
 $password_confirm = !empty($HTTP_POST_VARS['password_confirm']) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password_confirm']))) : '';
 $icq = !empty($HTTP_POST_VARS['icq']) ? trim(strip_tags($HTTP_POST_VARS['icq'])) : '';
 $aim = !empty($HTTP_POST_VARS['aim']) ? trim(strip_tags($HTTP_POST_VARS['aim'])) : '';
 $msn = !empty($HTTP_POST_VARS['msn']) ? trim(strip_tags($HTTP_POST_VARS['msn'])) : '';
 $yim = !empty($HTTP_POST_VARS['yim']) ? trim(strip_tags($HTTP_POST_VARS['yim'])) : '';
 $website = !empty($HTTP_POST_VARS['website']) ? trim(strip_tags($HTTP_POST_VARS['website'])) : '';
 $location = !empty($HTTP_POST_VARS['location']) ? trim(strip_tags($HTTP_POST_VARS['location'])) : '';
 $occupation = !empty($HTTP_POST_VARS['occupation']) ? trim(strip_tags($HTTP_POST_VARS['occupation'])) : '';
 $interests = !empty($HTTP_POST_VARS['interests']) ? trim(strip_tags($HTTP_POST_VARS['interests'])) : '';
 $signature = !empty($HTTP_POST_VARS['signature']) ? trim(str_replace('<br />', "\n", $HTTP_POST_VARS['signature'])) : '';
 validate_optional_fields($icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature);
 $viewemail = isset($HTTP_POST_VARS['viewemail']) ? $HTTP_POST_VARS['viewemail'] ? TRUE : 0 : 0;
 $allowviewonline = isset($HTTP_POST_VARS['hideonline']) ? $HTTP_POST_VARS['hideonline'] ? 0 : TRUE : TRUE;
开发者ID:bitweaver,项目名称:phpbb,代码行数:31,代码来源:admin_users.php

示例6: redirect

 //
 if (!empty($HTTP_POST_VARS['add']) || !empty($HTTP_POST_VARS['remove']) || isset($HTTP_POST_VARS['approve']) || isset($HTTP_POST_VARS['deny'])) {
     if (!$userdata['session_logged_in']) {
         redirect(append_sid("login.{$phpEx}?redirect=groupcp.{$phpEx}&" . POST_GROUPS_URL . "={$group_id}", true));
     } else {
         if ($sid !== $userdata['session_id']) {
             message_die(GENERAL_ERROR, $lang['Session_invalid']);
         }
     }
     if (!$is_moderator) {
         $template->assign_vars(array('META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.{$phpEx}") . '">'));
         $message = $lang['Not_group_moderator'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.{$phpEx}") . '">', '</a>');
         message_die(GENERAL_MESSAGE, $message);
     }
     if (isset($HTTP_POST_VARS['add'])) {
         $username = isset($HTTP_POST_VARS['username']) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';
         $sql = "SELECT user_id, user_email, user_lang, user_level  \n\t\t\t\t\tFROM " . USERS_TABLE . " \n\t\t\t\t\tWHERE username = '" . str_replace("\\'", "''", $username) . "'";
         if (!($result = $db->sql_query($sql))) {
             message_die(GENERAL_ERROR, "Could not get user information", $lang['Error'], __LINE__, __FILE__, $sql);
         }
         if (!($row = $db->sql_fetchrow($result))) {
             $template->assign_vars(array('META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("groupcp.{$phpEx}?" . POST_GROUPS_URL . "={$group_id}") . '">'));
             $message = $lang['Could_not_add_user'] . "<br /><br />" . sprintf($lang['Click_return_group'], "<a href=\"" . append_sid("groupcp.{$phpEx}?" . POST_GROUPS_URL . "={$group_id}") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_index'], "<a href=\"" . append_sid("index.{$phpEx}") . "\">", "</a>");
             message_die(GENERAL_MESSAGE, $message);
         }
         if ($row['user_id'] == ANONYMOUS) {
             $template->assign_vars(array('META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("groupcp.{$phpEx}?" . POST_GROUPS_URL . "={$group_id}") . '">'));
             $message = $lang['Could_not_anon_user'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.{$phpEx}?" . POST_GROUPS_URL . "={$group_id}") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.{$phpEx}") . '">', '</a>');
             message_die(GENERAL_MESSAGE, $message);
         }
         $sql = "SELECT ug.user_id, u.user_level \n\t\t\t\t\tFROM " . USER_GROUP_TABLE . " ug, " . USERS_TABLE . " u \n\t\t\t\t\tWHERE u.user_id = " . $row['user_id'] . " \n\t\t\t\t\t\tAND ug.user_id = u.user_id \n\t\t\t\t\t\tAND ug.group_id = {$group_id}";
开发者ID:ZerGabriel,项目名称:adr-rpg,代码行数:31,代码来源:groupcp.php

示例7: isset

//
// Define initial vars
//
if (isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode'])) {
    $mode = isset($HTTP_POST_VARS['mode']) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
} else {
    $mode = '';
}
if (isset($HTTP_POST_VARS['search_keywords']) || isset($HTTP_GET_VARS['search_keywords'])) {
    $search_keywords = isset($HTTP_POST_VARS['search_keywords']) ? $HTTP_POST_VARS['search_keywords'] : $HTTP_GET_VARS['search_keywords'];
} else {
    $search_keywords = '';
}
if (isset($HTTP_POST_VARS['search_author']) || isset($HTTP_GET_VARS['search_author'])) {
    $search_author = isset($HTTP_POST_VARS['search_author']) ? $HTTP_POST_VARS['search_author'] : $HTTP_GET_VARS['search_author'];
    $search_author = phpbb_clean_username($search_author);
} else {
    $search_author = '';
}
$search_id = isset($HTTP_GET_VARS['search_id']) ? $HTTP_GET_VARS['search_id'] : '';
$show_results = isset($HTTP_POST_VARS['show_results']) ? $HTTP_POST_VARS['show_results'] : 'posts';
$show_results = $show_results == 'topics' ? 'topics' : 'posts';
if (isset($HTTP_POST_VARS['search_terms'])) {
    $search_terms = $HTTP_POST_VARS['search_terms'] == 'all' ? 1 : 0;
} else {
    $search_terms = 0;
}
if (isset($HTTP_POST_VARS['search_fields'])) {
    $search_fields = $HTTP_POST_VARS['search_fields'] == 'all' ? 1 : 0;
} else {
    $search_fields = 0;
开发者ID:Juuro,项目名称:Dreamapp-Website,代码行数:31,代码来源:search.php

示例8: die

 ***************************************************************************/
/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *
 ***************************************************************************/
if (!defined('IN_PHPBB')) {
    die('Hacking attempt');
    exit;
}
if (isset($_POST['submit'])) {
    $username = !empty($_POST['username']) ? phpbb_clean_username($_POST['username']) : '';
    $email = !empty($_POST['email']) ? trim(strip_tags(htmlspecialchars($_POST['email']))) : '';
    $sql = "SELECT user_id, username, user_email, user_active, user_lang \n\t\tFROM " . USERS_TABLE . " \n\t\tWHERE user_email = '" . str_replace("\\'", "''", $email) . "' \n\t\t\tAND username = '" . str_replace("\\'", "''", $username) . "'";
    if ($result = $db->sql_query($sql)) {
        if ($row = $db->sql_fetchrow($result)) {
            if (!$row['user_active']) {
                message_die(GENERAL_MESSAGE, $lang['No_send_account_inactive']);
            }
            $username = $row['username'];
            $user_id = $row['user_id'];
            $user_actkey = gen_rand_string(true);
            $key_len = 54 - strlen($server_url);
            $key_len = $key_len > 6 ? $key_len : 6;
            $user_actkey = substr($user_actkey, 0, $key_len);
            $user_password = gen_rand_string(false);
            $sql = "UPDATE " . USERS_TABLE . " \n\t\t\t\tSET user_newpasswd = '" . md5($user_password) . "', user_actkey = '{$user_actkey}'  \n\t\t\t\tWHERE user_id = " . $row['user_id'];
开发者ID:nmpetkov,项目名称:ZphpBB2,代码行数:31,代码来源:usercp_sendpasswd.php

示例9: intval

         } else {
             $_varary = $_POST['pending_members'];
         }
         $_data = '';
         for ($i = 0; $i < sizeof($_varary); $i++) {
             $_data .= ($_data != '' ? ', ' : '') . intval($_varary[$i]);
         }
         $content .= '[Group Edit: ' . $_tmp1 . ' ==> ' . $_data . ']';
         if ($db_log_actions == true) {
             $db_log = array('action' => 'GROUP_EDIT', 'desc' => $_tmp1, 'target' => $_data);
         }
         $update_log = true;
     } elseif (isset($_POST['add']) && isset($_POST['username'])) {
         $content .= '[Group Add: ' . $_tmp1 . ' ==> ' . $_POST['username'] . ']';
         if ($db_log_actions == true) {
             $sql = get_users_sql(phpbb_clean_username($_POST['username']), false, false, true, true);
             $result = $db->sql_query($sql);
             $user_row = $db->sql_fetchrow($result);
             $db->sql_freeresult($result);
             $db_log = array('action' => 'GROUP_ADD', 'desc' => $_tmp1, 'target' => $user_row['user_id']);
         }
         $update_log = true;
     } elseif (isset($_POST['groupstatus']) && isset($_POST['group_type'])) {
         $content .= '[Group Type: ' . $_tmp1 . ' ==> ' . intval($_POST['group_type']) . ']';
         if ($db_log_actions == true) {
             $db_log = array('action' => 'GROUP_TYPE', 'desc' => $_tmp1 . ';' . intval($_POST['group_type']), 'target' => '');
         }
         $update_log = true;
     }
 }
 break;
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:31,代码来源:log_http_cmd.php

示例10: sizeof

 }
 $db->sql_freeresult($result);
 // remove friends from the username array
 $n = sizeof($data['add']);
 $data['add'] = array_diff($data['add'], $friends);
 // remove foes from the username array
 $n = sizeof($data['add']);
 $data['add'] = array_diff($data['add'], $foes);
 // remove the user himself from the username array
 $n = sizeof($data['add']);
 $data['add'] = array_diff($data['add'], array($user->data['username']));
 unset($friends, $foes, $n);
 if (sizeof($data['add'])) {
     $users_to_add = '';
     foreach ($data['add'] as $user_tmp) {
         $username_tmp = phpbb_clean_username($user_tmp);
         //$users_to_add .= (($users_to_add == '') ? '' : ', ') . "'" . $db->sql_escape($username_tmp) . "'";
         $users_to_add .= ($users_to_add == '' ? '' : ', ') . "'" . $db->sql_escape(utf8_clean_string($username_tmp)) . "'";
     }
     //$users_to_add = implode('\',\'', $data['add']);
     $sql = "SELECT user_id, user_level\n\t\t\t\t\tFROM " . USERS_TABLE . "\n\t\t\t\t\tWHERE username_clean IN (" . $users_to_add . ")\n\t\t\t\t\t\tAND user_active = 1";
     //die($sql);
     $result = $db->sql_query($sql);
     $user_id_ary = array();
     $user_id_level = array();
     while ($row = $db->sql_fetchrow($result)) {
         if ($row['user_id'] != ANONYMOUS) {
             $user_id_ary[$row['user_id']] = $row['user_id'];
             $user_id_level[$row['user_id']] = $row['user_level'];
         }
     }
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:31,代码来源:usercp_zebra.php

示例11: append_sid

	}

	$params[] = 'users_per_page=' . $users_per_page;
	$sort_params[] = 'users_per_page=' . $users_per_page;
	$params[] = 'mode=' . $mode;
	$sort_params[] = 'mode=' . $mode;
}

$pagination_url = append_sid(CMS_PAGE_MEMBERLIST, false, false, implode('&amp;', $params));
$sort_url = append_sid(CMS_PAGE_MEMBERLIST, false, false, implode('&amp;', $sort_params));

unset($search_params, $sort_params);

if (!empty($alphanum))
{
	$alphanum = ($alphanum == '#') ? '#' : (phpbb_clean_username(ip_clean_username(strtolower(urldecode($alphanum)))));
	$sql_where = ($alphanum == '#') ? "AND LOWER(username) NOT RLIKE '^[a-z]'" : "AND LOWER(username) LIKE '" . $db->sql_escape($alphanum) . "%'";
}

if (($action == 'searchuser') && ($user->data['user_level'] == ADMIN))
{
	$template->assign_vars(array(
		'USERNAME' => $username,
		'EMAIL' => $email,
		'AIM' => $aim,
		'ICQ' => $icq,
		'JABBER' => $jabber,
		'MSNM' => $msn,
		'SKYPE' => $skype,
		'YAHOO' => $yahoo,
		'JOINED' => implode('-', $joined),
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:31,代码来源:memberlist.php

示例12: rss_get_user

function rss_get_user()
{
    global $db, $HTTP_SERVER_VARS, $HTTP_GET_VARS;
    if ((!isset($HTTP_SERVER_VARS['PHP_AUTH_USER']) || !isset($HTTP_SERVER_VARS['PHP_AUTH_PW'])) && isset($HTTP_SERVER_VARS['REMOTE_USER']) && preg_match('/Basic\\s+(.*)$/i', $HTTP_SERVER_VARS['REMOTE_USER'], $matches)) {
        list($name, $password) = explode(':', base64_decode($matches[1]), 2);
        $HTTP_SERVER_VARS['PHP_AUTH_USER'] = strip_tags($name);
        $HTTP_SERVER_VARS['PHP_AUTH_PW'] = strip_tags($password);
    }
    if (isset($HTTP_SERVER_VARS['PHP_AUTH_USER']) && isset($HTTP_SERVER_VARS['PHP_AUTH_PW'])) {
        $username = phpbb_clean_username($HTTP_SERVER_VARS['PHP_AUTH_USER']);
        $password = md5($HTTP_SERVER_VARS['PHP_AUTH_PW']);
        if (isset($HTTP_GET_VARS['uid'])) {
            $uid = intval($HTTP_GET_VARS['uid']);
            $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_id = {$uid}";
        } else {
            $sql = "SELECT user_id, username, user_password, user_active, user_level\n\t\t\tFROM " . USERS_TABLE . "\n\t\t\tWHERE username = '" . str_replace("\\'", "''", $username) . "'";
        }
        if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, 'Error in obtaining userdata', '', __LINE__, __FILE__, $sql);
        }
        if ($row = $db->sql_fetchrow($result)) {
            if ($password == $row['user_password'] && $row['user_active']) {
                // Yes!!!  It's good user
                return $row['user_id'];
            } else {
                GetHTTPPasswd();
            }
        }
    } else {
        GetHTTPPasswd();
    }
    return ANONYMOUS;
}
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:33,代码来源:rss_functions.php

示例13: get_users_sql

function get_users_sql($username, $sql_like = false, $all_data = false, $data_escape = true, $clean_username = false)
{
    global $config, $cache, $db;
    $username = !empty($clean_username) ? phpbb_clean_username($username) : $username;
    $sql = "SELECT " . (!empty($all_data) ? "*" : "user_id, username, username_clean, user_active, user_color, user_level") . " FROM " . USERS_TABLE . "\n\t\tWHERE username_clean " . (!empty($sql_like) ? " LIKE " : " = ") . "'" . (!empty($data_escape) ? $db->sql_escape(utf8_clean_string($username)) : $username) . "'" . (!empty($sql_like) ? "" : " LIMIT 1");
    return $sql;
}
开发者ID:GabrielAnca,项目名称:icy_phoenix,代码行数:7,代码来源:functions.php

示例14: implode

     }
     if (count($mark_list)) {
         $delete_sql_id = implode(', ', $mark_list);
         $delete_text_sql = "DELETE FROM " . PRIVMSGS_TEXT_TABLE . "\n\t\t\t\t\tWHERE privmsgs_text_id IN ({$delete_sql_id})";
         $delete_sql = "DELETE FROM " . PRIVMSGS_TABLE . "\n\t\t\t\t\tWHERE privmsgs_id IN ({$delete_sql_id})";
         if (!$db->sql_query($delete_sql)) {
             message_die(GENERAL_ERROR, 'Could not delete private message info', '', __LINE__, __FILE__, $delete_sql);
         }
         if (!$db->sql_query($delete_text_sql)) {
             message_die(GENERAL_ERROR, 'Could not delete private message text', '', __LINE__, __FILE__, $delete_text_sql);
         }
     }
     $message = $lang['User_deleted'] . '<br /><br />' . sprintf($lang['Click_return_useradmin'], '<a href="' . append_sid("admin_users.{$phpEx}") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.{$phpEx}?pane=right") . '">', '</a>');
     message_die(GENERAL_MESSAGE, $message);
 }
 $username = !empty($HTTP_POST_VARS['username']) ? ereg_replace("&amp;", "&", phpbb_clean_username($HTTP_POST_VARS['username'])) : '';
 $email = !empty($HTTP_POST_VARS['email']) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['email']))) : '';
 $password = !empty($HTTP_POST_VARS['password']) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password']))) : '';
 $password_confirm = !empty($HTTP_POST_VARS['password_confirm']) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password_confirm']))) : '';
 $icq = !empty($HTTP_POST_VARS['icq']) ? trim(strip_tags($HTTP_POST_VARS['icq'])) : '';
 $aim = !empty($HTTP_POST_VARS['aim']) ? trim(strip_tags($HTTP_POST_VARS['aim'])) : '';
 $msn = !empty($HTTP_POST_VARS['msn']) ? trim(strip_tags($HTTP_POST_VARS['msn'])) : '';
 $yim = !empty($HTTP_POST_VARS['yim']) ? trim(strip_tags($HTTP_POST_VARS['yim'])) : '';
 $skype = !empty($HTTP_POST_VARS['skype']) ? trim(strip_tags($HTTP_POST_VARS['skype'])) : '';
 $website = !empty($HTTP_POST_VARS['website']) ? trim(strip_tags($HTTP_POST_VARS['website'])) : '';
 $location = !empty($HTTP_POST_VARS['location']) ? trim(strip_tags($HTTP_POST_VARS['location'])) : '';
 $occupation = !empty($HTTP_POST_VARS['occupation']) ? trim(strip_tags($HTTP_POST_VARS['occupation'])) : '';
 $interests = !empty($HTTP_POST_VARS['interests']) ? trim(strip_tags($HTTP_POST_VARS['interests'])) : '';
 $gender = isset($HTTP_POST_VARS['gender']) ? intval($HTTP_POST_VARS['gender']) : 0;
 if (isset($HTTP_POST_VARS['birthday'])) {
     $birthday = intval($HTTP_POST_VARS['birthday']);
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:31,代码来源:admin_users.php

示例15: message_die

				AND privmsgs_from_userid = ' . $userdata['user_id'];
                        if (!($result = $db->sql_query($sql))) {
                            message_die(GENERAL_ERROR, "Could not obtain message details", "", __LINE__, __FILE__, $sql);
                        }
                        if (!($row = $db->sql_fetchrow($result))) {
                            message_die(GENERAL_MESSAGE, $lang['No_such_post']);
                        }
                        $db->sql_freeresult($result);
                        unset($row);
                    }
                    if ($submit) {
                        if (!empty($HTTP_POST_VARS['username'])) {
                            $to_username_array = explode(";", $HTTP_POST_VARS['username']);
                            usort($to_username_array, create_function('$a,$b', 'return strcasecmp($a,$b);'));
                            foreach ($to_username_array as $name) {
                                $to_usernames .= "'" . phpbb_clean_username($name) . "',";
                            }
                            $to_usernames[strlen($to_usernames) - 1] = " ";
                            $sql = "SELECT user_id, username, user_notify_pm, user_email, user_lang, user_active \n\t\t\t\tFROM " . USERS_TABLE . "\n\t\t\t\tWHERE username IN (" . str_replace("\\'", "''", $to_usernames) . ")\n\t\t\t\t\tAND user_id <> " . ANONYMOUS . " \n\t\t\t\tORDER BY username ASC";
                            if (!($result2 = $db->sql_query($sql))) {
                                message_die(GENERAL_ERROR, 'Could not obtain users PM information', '', __LINE__, __FILE__, $sql);
                            }
                            if (!($to_users = $db->sql_fetchrowset($result2))) {
                                $error = TRUE;
                                $error_msg = $lang['No_such_user'];
                            }
                            $n = 0;
                            while ($to_username_array[$n] && !$error) {
                                if (strcasecmp($to_users[$n]['username'], str_replace("\\'", "'", $to_username_array[$n]))) {
                                    $error = TRUE;
                                    $error_msg .= $lang['No_such_user'] . " '" . str_replace("\\'", "'", $to_username_array[$n]);
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:31,代码来源:privmsg.php


注:本文中的phpbb_clean_username函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。