本文整理汇总了PHP中UserUtils::userid_exists方法的典型用法代码示例。如果您正苦于以下问题:PHP UserUtils::userid_exists方法的具体用法?PHP UserUtils::userid_exists怎么用?PHP UserUtils::userid_exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserUtils
的用法示例。
在下文中一共展示了UserUtils::userid_exists方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_var
// Rogō is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Rogō. If not, see <http://www.gnu.org/licenses/>.
/**
*
* @author Simon Wilkinson
* @version 1.0
* @copyright Copyright (c) 2014 The University of Nottingham
* @package
*/
require '../../include/invigilator_auth.inc';
require_once '../../include/errors.inc';
require_once '../../classes/paperutils.class.php';
require_once '../../classes/userutils.class.php';
require_once '../../classes/toiletbreakutils.class.php';
$userID = check_var('userID', 'POST', true, false, true);
$paperID = check_var('paperID', 'POST', true, false, true);
// Does the paper exist?
if (!Paper_utils::paper_exists($paperID, $mysqli)) {
exit;
}
// Does the student exist?
if (!UserUtils::userid_exists($userID, $mysqli)) {
exit;
}
ToiletBreaks::add_toilet_break($userID, $paperID, $mysqli);
$mysqli->close();
示例2: check_var
* Delete a user account.
*
* @author Simon Wilkinson
* @version 1.0
* @copyright Copyright (c) 2014 The University of Nottingham
* @package
*/
require '../include/sysadmin_auth.inc';
require_once '../include/errors.inc';
require_once '../classes/userutils.class.php';
$userID = check_var('id', 'POST', true, false, true);
// Check that all the past user IDs actually exist.
$id_list = explode(',', $userID);
foreach ($id_list as $id) {
if ($id != '') {
if (!UserUtils::userid_exists($id, $mysqli)) {
$msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email'));
$notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true);
}
}
}
foreach ($id_list as $single_id) {
if ($single_id != '') {
UserUtils::delete_userID($single_id, $mysqli);
}
}
$mysqli->close();
?>
<!DOCTYPE html>
<html>
<head>
示例3: explode
$cols = explode(',', $separate_line);
if ($line_no == 0) {
// Read the header row
$heading = $cols;
$col_no = count($cols);
echo "<tr><th></th><th>Username</th><th colspan=\"3\">Student Name</th>";
for ($i = 1; $i < $col_no; $i++) {
echo "<th>" . trim($heading[$i]) . "</th>";
}
echo "</tr>\n";
} else {
// 'username' can be either the real username or sid
$username = trim($cols[0]);
// Check see if user was found
if (!isset($student_id_array[$username])) {
if (UserUtils::userid_exists($username, $mysqli) or UserUtils::username_exists($username, $mysqli)) {
echo "<tr><td><img src=\"../artwork/red_cross_16.png\" wodth=\"16\" height=\"16\" alt=\"Failed\" /></td><td class=\"failed\">{$username}</td><td colspan=\"" . (3 + $col_no) . "\" class=\"failed\" style=\"text-align:center\"><user not registered on " . module_utils::get_moduleid_from_id($_GET['module'], $mysqli) . "></td>";
} else {
echo "<tr><td><img src=\"../artwork/red_cross_16.png\" wodth=\"16\" height=\"16\" alt=\"Failed\" /></td><td class=\"failed\">{$username}</td><td colspan=\"" . (3 + $col_no) . "\" class=\"failed\" style=\"text-align:center\"><unknown user></td>";
}
} else {
$student_id = $student_id_array[$username];
echo "<tr><td><img src=\"../artwork/green_plus_16.png\" wodth=\"16\" height=\"16\" alt=\"Add\" /></td><td>{$username}</td><td>" . $student_data[$student_id]['title'] . "</td><td>" . $student_data[$student_id]['surname'] . "</td><td>" . $student_data[$student_id]['first_names'] . "</td>";
for ($i = 1; $i < $col_no; $i++) {
$type = trim($heading[$i]);
$value = trim($cols[$i]);
echo "<td>{$value}</td>";
if ($type != '') {
$stmt->execute();
}
}