main/inc/lib/sessionmanager.lib.php 1 location
|
@@ 290-298 (lines=9) @@
|
| 287 |
|
* |
| 288 |
|
* @return bool |
| 289 |
|
*/ |
| 290 |
|
public static function session_name_exists($name) |
| 291 |
|
{ |
| 292 |
|
$name = Database::escape_string($name); |
| 293 |
|
$sql = "SELECT COUNT(*) as count FROM " . Database::get_main_table(TABLE_MAIN_SESSION) . " |
| 294 |
|
WHERE name = '$name'"; |
| 295 |
|
$result = Database::fetch_array(Database::query($sql)); |
| 296 |
|
|
| 297 |
|
return $result['count'] > 0; |
| 298 |
|
} |
| 299 |
|
|
| 300 |
|
/** |
| 301 |
|
* @param string $where_condition |
main/inc/lib/urlmanager.lib.php 1 location
|
@@ 620-630 (lines=11) @@
|
| 617 |
|
* @param int $urlId |
| 618 |
|
* @return int |
| 619 |
|
*/ |
| 620 |
|
public static function addUserGroupToUrl($userGroupId, $urlId) |
| 621 |
|
{ |
| 622 |
|
$urlRelUserGroupTable = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USERGROUP); |
| 623 |
|
$sql = "INSERT INTO $urlRelUserGroupTable |
| 624 |
|
SET |
| 625 |
|
usergroup_id = '".intval($userGroupId)."', |
| 626 |
|
access_url_id = ".intval($urlId); |
| 627 |
|
Database::query($sql); |
| 628 |
|
|
| 629 |
|
return Database::insert_id(); |
| 630 |
|
} |
| 631 |
|
|
| 632 |
|
/** |
| 633 |
|
* @param int $categoryId |
main/inc/lib/course.lib.php 1 location
|
@@ 5789-5797 (lines=9) @@
|
| 5786 |
|
* @param int Category ID |
| 5787 |
|
* @return string Course code |
| 5788 |
|
*/ |
| 5789 |
|
public static function get_course_by_category($category_id) |
| 5790 |
|
{ |
| 5791 |
|
$category_id = intval($category_id); |
| 5792 |
|
$info = Database::fetch_array( |
| 5793 |
|
Database::query('SELECT course_code FROM ' . Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY) . ' |
| 5794 |
|
WHERE id=' . $category_id), 'ASSOC' |
| 5795 |
|
); |
| 5796 |
|
return $info ? $info['course_code'] : false; |
| 5797 |
|
} |
| 5798 |
|
|
| 5799 |
|
/** |
| 5800 |
|
* This function gets all the courses that are not in a session |