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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
--- lib/Auth.class.php.orig 2007-06-14 19:00:15 UTC
+++ lib/Auth.class.php
@@ -43,42 +43,42 @@ class Auth {
* and start the session
* @param none
*/
- //function Auth() {
+ //public static function Auth() {
// $this->db = new AuthDB();
//}
/**
* Check if user is a super administrator
- * This function checks to see if the currently
+ * This public static function checks to see if the currently
* logged in user is the administrator, granting
* them special permissions
* @param none
* @return boolean whether the user is a s_admin
*/
- function isAdmin() {
+ public static function isAdmin() {
return isset($_SESSION['sessionAdmin']);
}
/**
* Check if user is a mail administrator
- * This function checks to see if the currently
+ * This public static function checks to see if the currently
* logged in user is the administrator, granting
* them special permissions
* @param none
* @return boolean whether the user is a m_admin
*/
- function isMailAdmin() {
+ public static function isMailAdmin() {
return (isset($_SESSION['sessionMailAdmin']) || isset($_SESSION['sessionAdmin']));
}
/**
* Check user login
- * This function checks to see if the user has
+ * This public static function checks to see if the user has
* a valid session set (if they are logged in)
* @param none
* @return boolean whether the user is logged in
*/
- function is_logged_in() {
+ public static function is_logged_in() {
return isset($_SESSION['sessionID']);
}
@@ -87,7 +87,7 @@ class Auth {
* @param none
* @return the userid, or null if the user is not logged in
*/
- function getCurrentID() {
+ public static function getCurrentID() {
return $_SESSION['sessionID'];//isset($_SESSION['sessionID']) ? $_SESSION['sessionID'] : null;
}
@@ -281,7 +281,7 @@ class Auth {
}
}
- function isAllowedToLogin( $username ) {
+ public static function isAllowedToLogin( $username ) {
global $conf;
@@ -333,7 +333,7 @@ class Auth {
* @param none
* @return whether the user is attempting to log in
*/
- function isAttempting() {
+ public static function isAttempting() {
return $this->is_attempt;
}
@@ -341,7 +341,7 @@ class Auth {
* Kills app
* @param none
*/
- function kill() {
+ public static function kill() {
die;
}
@@ -349,7 +349,7 @@ class Auth {
* Destroy any lingering sessions
* @param none
*/
- function clean() {
+ public static function clean() {
// Destroy all session variables
unset($_SESSION['sessionID']);
unset($_SESSION['sessionName']);
@@ -359,11 +359,11 @@ class Auth {
}
/**
- * Wrapper function to call template 'printLoginForm' function
+ * Wrapper public static function to call template 'printLoginForm' function
* @param string $msg error messages to display for user
* @param string $resume page to resume after a login
*/
- function printLoginForm($msg = '', $resume = '') {
+ public static function printLoginForm($msg = '', $resume = '') {
printLoginForm($msg, $resume);
}
@@ -371,7 +371,7 @@ class Auth {
* Prints a message telling the user to log in
* @param boolean $kill whether to end the program or not
*/
- function print_login_msg($kill = true) {
+ public static function print_login_msg($kill = true) {
CmnFns::redirect(CmnFns::getScriptURL() . '/index.php?auth=no&resume=' . urlencode($_SERVER['PHP_SELF']) . '?' . urlencode($_SERVER['QUERY_STRING']));
}
@@ -379,7 +379,7 @@ class Auth {
* Prints out the latest success box
* @param none
*/
- function print_success_box() {
+ public static function print_success_box() {
CmnFns::do_message_box($this->success);
}
}
|