mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Use e107 methods in Ajax callback.
This commit is contained in:
11
user.php
11
user.php
@@ -47,10 +47,11 @@ if(e_AJAX_REQUEST)
|
||||
{
|
||||
if(vartrue($_POST['q']))
|
||||
{
|
||||
$q = filter_var($_POST['q'], FILTER_SANITIZE_STRING);
|
||||
$l = vartrue($_POST['l']) ? intval($_POST['l']) : 10;
|
||||
|
||||
$db = e107::getDb();
|
||||
$tp = e107::getParser();
|
||||
|
||||
$q = $tp->filter($_POST['q']);
|
||||
$l = vartrue($_POST['l']) ? intval($_POST['l']) : 10;
|
||||
|
||||
if($db->select("user", "user_id,user_name", "user_name LIKE '". $q."%' ORDER BY user_name LIMIT " . $l))
|
||||
{
|
||||
@@ -65,8 +66,8 @@ if(e_AJAX_REQUEST)
|
||||
|
||||
if(count($data))
|
||||
{
|
||||
header('Content-type: application/json');
|
||||
echo json_encode($data);
|
||||
$ajax = e107::getAjax();
|
||||
$ajax->response($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user