-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathincludes.php
100 lines (68 loc) · 1.9 KB
/
includes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
require_once(dirname(__FILE__) . '/../../includes/inc_global.php');
function lti_getConnection()
{
global $DB;
$connection = $DB->getConnection();
if (method_exists($connection, 'getWrappedConnection')) {
$connection = $connection->getWrappedConnection()->getWrappedResourceHandle();
}
return $connection;
}
if (!function_exists('check_user')) {
function check_user($_user, $user_type = NULL)
{
return \WebPA\includes\functions\Common::check_user($_user, $user_type);
}
}
if (!function_exists('fetch_GET')) {
function fetch_GET($key, $default_value = '')
{
return \WebPA\includes\functions\Common::fetch_GET($key, $default_value);
}
}
function lti_fetch_GET($key, $default_value = '')
{
$value = fetch_GET($key, $default_value);
if (!empty($value)) {
$value = mysqli_real_escape_string(lti_getConnection(), $value);
}
return $value;
}
if (!function_exists('fetch_POST')) {
function fetch_POST($key, $default_value = '')
{
return \WebPA\includes\functions\Common::fetch_POST($key, $default_value);
}
}
function lti_fetch_POST($key, $default_value = '')
{
$value = fetch_POST($key, $default_value);
if (!empty($value)) {
$value = mysqli_real_escape_string(lti_getConnection(), $value);
}
return $value;
}
if (!function_exists('logEvent')) {
function logEvent($description, $module_id = NULL, $object_id = NULL)
{
global $DB;
return \WebPA\includes\functions\Common::logEvent($DB, $description, $module_id, $object_id);
}
}
if (!class_exists('User')) {
class User extends \WebPA\includes\classes\User
{
}
}
if (!class_exists('Module')) {
class Module extends \WebPA\includes\classes\Module
{
}
}
if (!class_exists('GroupHandler')) {
class GroupHandler extends \WebPA\includes\classes\GroupHandler
{
}
}
?>