本文整理汇总了PHP中UserUtils::is_user_on_module方法的典型用法代码示例。如果您正苦于以下问题:PHP UserUtils::is_user_on_module方法的具体用法?PHP UserUtils::is_user_on_module怎么用?PHP UserUtils::is_user_on_module使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserUtils
的用法示例。
在下文中一共展示了UserUtils::is_user_on_module方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_student_to_module
/**
* Enrole the student on a module.
*
* @param $idMod moduleID of module
* @param $attempt
* @param $session session of module
* @param int $auto_update if system add
*
* @return bool return true if successful.
*/
public function add_student_to_module($idMod, $attempt, $session, $auto_update = 0)
{
// need to check its a self reg module
if (module_utils::get_full_details_by_ID($idMod, $this->db) === false) {
return false;
}
if (UserUtils::is_user_on_module($this, $idMod, $session, $this->db)) {
//don't add a user to a module multiple times
return true;
}
$return = UserUtils::add_student_to_module($this->get_user_ID(), $idMod, $attempt, $session, $auto_update);
$this->load_student_modules();
return $return;
}
示例2: foreach
echo "<tr>\n";
foreach ($table_order as $col_title) {
echo "<th style=\"background-color:#1E3C7B\" class=\"coltitle\">{$col_title}</th>\n";
}
?>
</tr>
</thead>
<tbody>
<?php
$stmt = false;
if ($userObject->has_role(array('Admin', 'SysAdmin')) or $userObject->get_user_ID() == $userID) {
$log_viewable = true;
} else {
$idMod = array_keys($userObject->get_staff_modules());
$log_viewable = UserUtils::is_user_on_module($userID, $idMod, '', $mysqli);
}
$paper_types = array('Formative Self-Assessment', 'Progress Test', 'Summative Exam', 'Survey', 'OSCE Station', 'Offline Paper', 'Peer Review');
if ($log_viewable) {
if (stripos($user_details['roles'], 'External Examiner') !== false) {
// Get the papers the External is down to review.
$external_array = array();
$sql = "SELECT DISTINCT\n\t\t\t\t\t\t\t\tcrypt_name, paper_title, property_id, paper_type, started, DATE_FORMAT(started,'{$configObject->get('cfg_long_date_time')}') AS display_started\n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t(properties, properties_reviewers)\n\t\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t\t\treview_metadata\n\t\t\t\t\t\t\tON\n\t\t\t\t\t\t\t\tproperties.property_id = review_metadata.paperID AND review_metadata.reviewerID = ?\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\tproperties.property_id = properties_reviewers.paperID AND\n\t\t\t\t\t\t\t\tproperties_reviewers.reviewerID = ? AND\n\t\t\t\t\t\t\t\tdeleted IS NULL\n\t\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\tpaper_title";
$stmt = $mysqli->prepare($sql);
$stmt->bind_param('ii', $userID, $userID);
$stmt->execute();
$stmt->bind_result($crypt_name, $paper_title, $property_id, $paper_type, $started, $display_started);
while ($stmt->fetch()) {
$paper[$results_no]['crypt_name'] = $crypt_name;
$paper[$results_no]['q_paper'] = $paper_title;
$paper[$results_no]['id'] = $property_id;