Załącznik 'patch-lib__Auth.class.php'
Download 1 --- ./lib/Auth.class.php.orig 2007-06-14 21:00:15.000000000 +0200
2 +++ ./lib/Auth.class.php 2016-08-24 11:43:42.124505000 +0200
3 @@ -43,42 +43,42 @@ class Auth {
4 * and start the session
5 * @param none
6 */
7 - //function Auth() {
8 + //public static function Auth() {
9 // $this->db = new AuthDB();
10 //}
11
12 /**
13 * Check if user is a super administrator
14 - * This function checks to see if the currently
15 + * This public static function checks to see if the currently
16 * logged in user is the administrator, granting
17 * them special permissions
18 * @param none
19 * @return boolean whether the user is a s_admin
20 */
21 - function isAdmin() {
22 + public static function isAdmin() {
23 return isset($_SESSION['sessionAdmin']);
24 }
25
26 /**
27 * Check if user is a mail administrator
28 - * This function checks to see if the currently
29 + * This public static function checks to see if the currently
30 * logged in user is the administrator, granting
31 * them special permissions
32 * @param none
33 * @return boolean whether the user is a m_admin
34 */
35 - function isMailAdmin() {
36 + public static function isMailAdmin() {
37 return (isset($_SESSION['sessionMailAdmin']) || isset($_SESSION['sessionAdmin']));
38 }
39
40 /**
41 * Check user login
42 - * This function checks to see if the user has
43 + * This public static function checks to see if the user has
44 * a valid session set (if they are logged in)
45 * @param none
46 * @return boolean whether the user is logged in
47 */
48 - function is_logged_in() {
49 + public static function is_logged_in() {
50 return isset($_SESSION['sessionID']);
51 }
52
53 @@ -87,7 +87,7 @@ class Auth {
54 * @param none
55 * @return the userid, or null if the user is not logged in
56 */
57 - function getCurrentID() {
58 + public static function getCurrentID() {
59 return $_SESSION['sessionID'];//isset($_SESSION['sessionID']) ? $_SESSION['sessionID'] : null;
60 }
61
62 @@ -281,7 +281,7 @@ class Auth {
63 }
64 }
65
66 - function isAllowedToLogin( $username ) {
67 + public static function isAllowedToLogin( $username ) {
68
69 global $conf;
70
71 @@ -333,7 +333,7 @@ class Auth {
72 * @param none
73 * @return whether the user is attempting to log in
74 */
75 - function isAttempting() {
76 + public static function isAttempting() {
77 return $this->is_attempt;
78 }
79
80 @@ -341,7 +341,7 @@ class Auth {
81 * Kills app
82 * @param none
83 */
84 - function kill() {
85 + public static function kill() {
86 die;
87 }
88
89 @@ -349,7 +349,7 @@ class Auth {
90 * Destroy any lingering sessions
91 * @param none
92 */
93 - function clean() {
94 + public static function clean() {
95 // Destroy all session variables
96 unset($_SESSION['sessionID']);
97 unset($_SESSION['sessionName']);
98 @@ -359,11 +359,11 @@ class Auth {
99 }
100
101 /**
102 - * Wrapper function to call template 'printLoginForm' function
103 + * Wrapper public static function to call template 'printLoginForm' function
104 * @param string $msg error messages to display for user
105 * @param string $resume page to resume after a login
106 */
107 - function printLoginForm($msg = '', $resume = '') {
108 + public static function printLoginForm($msg = '', $resume = '') {
109 printLoginForm($msg, $resume);
110 }
111
112 @@ -371,7 +371,7 @@ class Auth {
113 * Prints a message telling the user to log in
114 * @param boolean $kill whether to end the program or not
115 */
116 - function print_login_msg($kill = true) {
117 + public static function print_login_msg($kill = true) {
118 CmnFns::redirect(CmnFns::getScriptURL() . '/index.php?auth=no&resume=' . urlencode($_SERVER['PHP_SELF']) . '?' . urlencode($_SERVER['QUERY_STRING']));
119 }
120
121 @@ -379,7 +379,7 @@ class Auth {
122 * Prints out the latest success box
123 * @param none
124 */
125 - function print_success_box() {
126 + public static function print_success_box() {
127 CmnFns::do_message_box($this->success);
128 }
129 }
Załączone pliki
Aby odnieść się do załącznika na stronie, użyj attachment:filename, jak pokazano poniżej na liście plików. NIGDY nie używaj URLa [get], ponieważ odnośnik może się zmienić i spowodować utratę informacji, którą chcesz przekazać.Nie możesz załączać plików do niniejszej strony.
