First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
$ValidAccess = 2010;
|
||||
require_once("include/globals.php");
|
||||
|
||||
|
||||
$moduleName = "ajax.UserIdValidate.php";
|
||||
// startLog($moduleName);
|
||||
|
||||
$return_data = array();
|
||||
$return_data['ajax_return_code'] = 0;
|
||||
|
||||
|
||||
// CSRF token validation
|
||||
include "include/ajax.csrfToken.php";
|
||||
|
||||
|
||||
// Get search text
|
||||
$uid = db_escape_string(trim(strtolower($_GET['uid'])));
|
||||
writeLog("uid: $uid");
|
||||
|
||||
if (strpos($uid, ' ') > 0) {
|
||||
$return_data['ajax_error_message'] = getLanguageText('ERRORMSG-INVALID-USER-ID');
|
||||
$return_data['ajax_return_code'] = -1;
|
||||
}
|
||||
else {
|
||||
switch ($uid) {
|
||||
case 'superuser':
|
||||
case 'admin':
|
||||
$return_data['ajax_return_code'] = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
// Search for matching user records
|
||||
$query = "SELECT * FROM users " .
|
||||
"WHERE school_num = $base_school_num " .
|
||||
"AND userid = '$uid'";
|
||||
writeLog("query: $query\n");
|
||||
$results = db_query($query);
|
||||
|
||||
// Set return data values
|
||||
$return_data['ajax_return_code'] = db_num_rows($results);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
writeLog("ajax_return_code: ".$return_data['ajax_return_code']);
|
||||
|
||||
writeLog("completed");
|
||||
echo(json_encode($return_data));
|
||||
return false;
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user