Zeile 222 | Zeile 222 |
---|
if($mybb->input['action'] == "get_users") { $mybb->input['query'] = ltrim($mybb->get_input('query'));
|
if($mybb->input['action'] == "get_users") { $mybb->input['query'] = ltrim($mybb->get_input('query'));
|
| $search_type = $mybb->get_input('search_type', MyBB::INPUT_INT); // 0: contains, 1: starts with, 2: ends with
|
// If the string is less than 2 characters, quit. if(my_strlen($mybb->input['query']) < 2)
| // If the string is less than 2 characters, quit. if(my_strlen($mybb->input['query']) < 2)
|
Zeile 251 | Zeile 252 |
---|
$plugins->run_hooks("xmlhttp_get_users_start");
|
$plugins->run_hooks("xmlhttp_get_users_start");
|
$query = $db->simple_select("users", "uid, username", "username LIKE '".$db->escape_string_like($mybb->input['query'])."%'", $query_options); if($limit == 1)
| $likestring = $db->escape_string_like($mybb->input['query']); if($search_type == 1) { $likestring .= '%'; } elseif($search_type == 2) { $likestring = '%'.$likestring; } else { $likestring = '%'.$likestring.'%'; }
$query = $db->simple_select("users", "uid, username", "username LIKE '{$likestring}'", $query_options); if($limit == 1)
|
{ $user = $db->fetch_array($query);
|
{ $user = $db->fetch_array($query);
|
$data = array('id' => $user['username'], 'text' => $user['username']);
| $data = array('uid' => $user['uid'], 'id' => $user['username'], 'text' => $user['username']);
|
} else { $data = array(); while($user = $db->fetch_array($query))
|
} else { $data = array(); while($user = $db->fetch_array($query))
|
{ $data[] = array('id' => $user['username'], 'text' => $user['username']); } }
| { $data[] = array('uid' => $user['uid'], 'id' => $user['username'], 'text' => $user['username']); } }
|
$plugins->run_hooks("xmlhttp_get_users_end");
echo json_encode($data);
| $plugins->run_hooks("xmlhttp_get_users_end");
echo json_encode($data);
|
Zeile 288 | Zeile 303 |
---|
if(!$thread) { xmlhttp_error($lang->thread_doesnt_exist);
|
if(!$thread) { xmlhttp_error($lang->thread_doesnt_exist);
|
}
| }
|
// Fetch some of the information from the first post of this thread. $query_options = array(
| // Fetch some of the information from the first post of this thread. $query_options = array(
|
Zeile 346 | Zeile 361 |
---|
if(my_strtolower($charset) != "utf-8") { if(function_exists("iconv"))
|
if(my_strtolower($charset) != "utf-8") { if(function_exists("iconv"))
|
{
| {
|
$subject = iconv($charset, "UTF-8//IGNORE", $subject); } else if(function_exists("mb_convert_encoding"))
| $subject = iconv($charset, "UTF-8//IGNORE", $subject); } else if(function_exists("mb_convert_encoding"))
|
Zeile 805 | Zeile 820 |
---|
$sid = $db->escape_string($mybb->get_input('question_id')); $query = $db->query(" SELECT q.qid, s.sid
|
$sid = $db->escape_string($mybb->get_input('question_id')); $query = $db->query(" SELECT q.qid, s.sid
|
FROM ".TABLE_PREFIX."questionsessions s LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid) WHERE q.active='1' AND s.sid='{$sid}' ");
| FROM ".TABLE_PREFIX."questionsessions s LEFT JOIN ".TABLE_PREFIX."questions q ON (q.qid=s.qid) WHERE q.active='1' AND s.sid='{$sid}' ");
|
if($db->num_rows($query) == 0) {
| if($db->num_rows($query) == 0) {
|
Zeile 971 | Zeile 986 |
---|
exit; } }
|
exit; } }
|
else if($mybb->input['action'] == "username_exists")
| else if($mybb->input['action'] == "email_availability")
|
{ if(!verify_post_check($mybb->get_input('my_post_key'), true)) { xmlhttp_error($lang->invalid_post_code); }
|
{ if(!verify_post_check($mybb->get_input('my_post_key'), true)) { xmlhttp_error($lang->invalid_post_code); }
|
require_once MYBB_ROOT."inc/functions_user.php"; $username = $mybb->get_input('value');
| require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler("insert");
$email = $mybb->get_input('email');
|
header("Content-type: application/json; charset={$charset}");
|
header("Content-type: application/json; charset={$charset}");
|
if(!trim($username)) { echo json_encode(array("success" => 1)); exit; }
// Check if the username actually exists $user = get_user_by_username($username);
| $user = array( 'email' => $email );
$userhandler->set_data($user);
$errors = array();
if(!$userhandler->verify_email()) { $errors = $userhandler->get_friendly_errors(); }
$plugins->run_hooks("xmlhttp_email_availability");
|
|
|
$plugins->run_hooks("xmlhttp_username_exists");
if($user['uid']) { $lang->valid_username = $lang->sprintf($lang->valid_username, htmlspecialchars_uni($username)); echo json_encode(array("success" => $lang->valid_username));
| if(!empty($errors)) { echo json_encode($errors[0]);
|
exit; } else {
|
exit; } else {
|
$lang->invalid_username = $lang->sprintf($lang->invalid_username, htmlspecialchars_uni($username)); echo json_encode($lang->invalid_username);
| echo json_encode("true");
|
exit; } }
| exit; } }
|