@@ -53,8 +53,8 @@ |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | // After we have inserted the data, we want to head back to the main users page |
56 | - header('Location: subTypes.php'); // Move to the home page of the admin section |
|
57 | - exit; |
|
56 | + header('Location: subTypes.php'); // Move to the home page of the admin section |
|
57 | + exit; |
|
58 | 58 | } |
59 | 59 | include 'includes/header.php'; |
60 | 60 | ?> |
@@ -30,24 +30,24 @@ |
||
30 | 30 | switch ($_POST['action']) { |
31 | 31 | case 'approve': |
32 | 32 | $userId = approvePendingUser($id); |
33 | - mailNewUser($userId); |
|
34 | - header('Location: addUser.php?action=edit&user='.$userId); |
|
35 | - break; |
|
33 | + mailNewUser($userId); |
|
34 | + header('Location: addUser.php?action=edit&user='.$userId); |
|
35 | + break; |
|
36 | 36 | case 'merge': |
37 | 37 | $existingUserId = $_POST['existingUser']; |
38 | - $existingUserId = filter_var($existingUserId, FILTER_SANITIZE_NUMBER_INT); |
|
39 | - mergePendingUserWithUserId($id, $existingUserId); |
|
40 | - mailNewUser($existingUserId); |
|
41 | - header('Location: addUser.php?action=edit&user='.$existingUserId); |
|
42 | - break; |
|
38 | + $existingUserId = filter_var($existingUserId, FILTER_SANITIZE_NUMBER_INT); |
|
39 | + mergePendingUserWithUserId($id, $existingUserId); |
|
40 | + mailNewUser($existingUserId); |
|
41 | + header('Location: addUser.php?action=edit&user='.$existingUserId); |
|
42 | + break; |
|
43 | 43 | case 'decline': |
44 | 44 | declinePendingUser($id); |
45 | - break; |
|
45 | + break; |
|
46 | 46 | |
47 | 47 | default: |
48 | 48 | // code... |
49 | 49 | break; |
50 | - } |
|
50 | + } |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | if (empty($id)) { |
@@ -51,7 +51,7 @@ |
||
51 | 51 | case 'everyone': |
52 | 52 | echo '<p>Function not complete, please wait while we finish writing it.</p><p>Apologies for any inconvinence.</p>'; |
53 | 53 | break; |
54 | - default: |
|
54 | + default: |
|
55 | 55 | echo '<p>Error: Insufficient parameters.</p>'; |
56 | 56 | echo '<p>Please inform the system administrator</p>'; |
57 | 57 | break; |
@@ -5,18 +5,18 @@ |
||
5 | 5 | include 'includes/config.php'; |
6 | 6 | include 'includes/functions.php'; |
7 | 7 | |
8 | - // you have to open the session first |
|
9 | - session_start(); |
|
8 | + // you have to open the session first |
|
9 | + session_start(); |
|
10 | 10 | |
11 | 11 | //if ($debug) notifyInfo(__FILE__,"logout",$_SESSION['userid']); //only_for_testing// |
12 | 12 | if ($debug) { |
13 | 13 | insertStatistics('user', __FILE__, 'logout'); |
14 | 14 | } |
15 | 15 | |
16 | - //remove all the variables in the session |
|
17 | - session_unset(); |
|
16 | + //remove all the variables in the session |
|
17 | + session_unset(); |
|
18 | 18 | |
19 | - // destroy the session |
|
20 | - session_destroy(); |
|
19 | + // destroy the session |
|
20 | + session_destroy(); |
|
21 | 21 | |
22 | - header('Location: login.php'); |
|
22 | + header('Location: login.php'); |
@@ -19,11 +19,11 @@ |
||
19 | 19 | { |
20 | 20 | return EventQuery::create() |
21 | 21 | ->useEventPersonQuery() |
22 | - ->useUserRoleQuery() |
|
22 | + ->useUserRoleQuery() |
|
23 | 23 | ->useRoleQuery() |
24 | - ->filterByGroup($this) |
|
24 | + ->filterByGroup($this) |
|
25 | + ->endUse() |
|
25 | 26 | ->endUse() |
26 | - ->endUse() |
|
27 | 27 | ->endUse() |
28 | 28 | ->orderByDate('desc') |
29 | 29 | ->findOne(); |
@@ -41,19 +41,19 @@ |
||
41 | 41 | switch ($platform) { |
42 | 42 | case 'facebook': |
43 | 43 | $_SESSION['fb-callback-url'] = 'fb-link.php'; |
44 | - header('Location: fb-login.php'); |
|
45 | - exit; |
|
46 | - } |
|
47 | - break; |
|
44 | + header('Location: fb-login.php'); |
|
45 | + exit; |
|
46 | + } |
|
47 | + break; |
|
48 | 48 | case 'unlink': |
49 | 49 | removeSocialAuthFromUserWithId($id, $platform); |
50 | - createNotificationForUser($id, ucfirst($platform).' account unlinked', 'You have successfully unlinked your Facebook account. Login via Facebook is now disabled for your account. Feel free to relink your account at any time.', 'account', 'linkSocialAuth.php'); |
|
51 | - break; |
|
50 | + createNotificationForUser($id, ucfirst($platform).' account unlinked', 'You have successfully unlinked your Facebook account. Login via Facebook is now disabled for your account. Feel free to relink your account at any time.', 'account', 'linkSocialAuth.php'); |
|
51 | + break; |
|
52 | 52 | |
53 | 53 | default: |
54 | 54 | // code... |
55 | 55 | break; |
56 | - } |
|
56 | + } |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // list of possible social account links (names used as platform names in database) |
@@ -142,10 +142,10 @@ |
||
142 | 142 | </form> |
143 | 143 | </div><!-- /.box --> |
144 | 144 | <?php |
145 | - if (isAdmin()) { |
|
146 | - ?> |
|
145 | + if (isAdmin()) { |
|
146 | + ?> |
|
147 | 147 | <div id="right"> |
148 | 148 | <div class="item"><a href="settings.php">Back to settings</a></div> |
149 | 149 | <?php |
150 | - } ?> |
|
150 | + } ?> |
|
151 | 151 | <?php include 'includes/footer.php'; ?> |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | // After we have inserted the data, we want to head back to the main users page |
57 | - header('Location: locations.php'); // Move to the home page of the admin section |
|
58 | - exit; |
|
57 | + header('Location: locations.php'); // Move to the home page of the admin section |
|
58 | + exit; |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | </form> |
122 | 122 | </div><!-- /.box --> |
123 | 123 | <?php |
124 | - if (isAdmin()) { |
|
125 | - ?> |
|
124 | + if (isAdmin()) { |
|
125 | + ?> |
|
126 | 126 | <div id="right"> |
127 | 127 | <div class="item"><a href="settings.php">Back to settings</a></div> |
128 | 128 | <?php |
129 | - } ?> |
|
129 | + } ?> |
|
130 | 130 | <?php include 'includes/footer.php'; ?> |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $swapId = filter_var($swapId, FILTER_SANITIZE_NUMBER_INT); |
50 | 50 | |
51 | 51 | switch ($action) { |
52 | - case 'swap': |
|
52 | + case 'swap': |
|
53 | 53 | if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
54 | 54 | $eventPersonId = $_POST['eventPerson']; |
55 | 55 | $newUserRoleId = $_POST['newUserRole']; |
@@ -63,48 +63,48 @@ discard block |
||
63 | 63 | $err = 'Swap details incorrect, please try again.'; |
64 | 64 | } |
65 | 65 | break; |
66 | - case 'accept': |
|
66 | + case 'accept': |
|
67 | 67 | if (canAcceptSwap($swapId) || $verify == verificationCodeForSwap($swapId)) { |
68 | 68 | switch (acceptSwap($swapId)) { |
69 | 69 | case '1': |
70 | 70 | $message = 'Swap Successful'; |
71 | - break; |
|
71 | + break; |
|
72 | 72 | case '2': |
73 | 73 | $message = 'Swap already accepted.'; |
74 | - break; |
|
74 | + break; |
|
75 | 75 | case '3': |
76 | 76 | $message = 'Swap already declined.'; |
77 | - break; |
|
77 | + break; |
|
78 | 78 | case '4': |
79 | 79 | $message = 'Swap already reverted.'; |
80 | - break; |
|
80 | + break; |
|
81 | 81 | default: |
82 | 82 | $err = 'Technical issue - please inform system administrator'; |
83 | - break; |
|
84 | - } |
|
83 | + break; |
|
84 | + } |
|
85 | 85 | } else { |
86 | 86 | $err = 'Swap Already Actioned or Verification Code Invalid'; |
87 | 87 | } |
88 | 88 | break; |
89 | - case 'decline': |
|
89 | + case 'decline': |
|
90 | 90 | if (canDeclineSwap($swapId) || $verify == verificationCodeForSwap($swapId)) { |
91 | 91 | switch (declineSwap($swapId)) { |
92 | 92 | case '1': |
93 | 93 | $message = 'Swap declined'; |
94 | - break; |
|
94 | + break; |
|
95 | 95 | case '2': |
96 | 96 | $message = 'Swap already declined.'; |
97 | - break; |
|
97 | + break; |
|
98 | 98 | default: |
99 | 99 | $err = 'Technical issue - please inform system administrator'; |
100 | - break; |
|
100 | + break; |
|
101 | 101 | } |
102 | 102 | } else { |
103 | 103 | $err = 'Swap Already Actioned or Verification Code Invalid'; |
104 | 104 | } |
105 | 105 | break; |
106 | 106 | |
107 | - default: |
|
107 | + default: |
|
108 | 108 | // code... |
109 | 109 | break; |
110 | 110 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | <section class="content"> |
166 | 166 | |
167 | 167 | <?php |
168 | - if (isset($message)) { ?> |
|
168 | + if (isset($message)) { ?> |
|
169 | 169 | |
170 | 170 | <p><?php echo $message ?></p> |
171 | 171 | |
@@ -226,19 +226,19 @@ discard block |
||
226 | 226 | <label for="newUserRole">Swap To:</label> |
227 | 227 | <select name="newUserRole" class="form-control"> |
228 | 228 | <?php |
229 | - if (roleCanSwapToOtherRoleInGroup($role->roleId)) { |
|
230 | - $whereAnd = 'r.groupId = '.groupIdWithRole($role->roleId).' AND r.allowRoleSwaps IS NOT FALSE'; |
|
231 | - } else { |
|
232 | - $whereAnd = 'r.id = '.$role->roleId; |
|
233 | - } |
|
234 | - $sql = 'SELECT ur.id, u.firstName, u.lastName, r.name FROM users u INNER JOIN userRoles ur ON ur.userId = u.id INNER JOIN roles r ON r.id = ur.roleId WHERE u.id <> '.$role->userId.' AND '.$whereAnd.' ORDER BY lastName, firstName, r.name'; |
|
235 | - $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); |
|
236 | - |
|
237 | - while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
|
238 | - ?> |
|
229 | + if (roleCanSwapToOtherRoleInGroup($role->roleId)) { |
|
230 | + $whereAnd = 'r.groupId = '.groupIdWithRole($role->roleId).' AND r.allowRoleSwaps IS NOT FALSE'; |
|
231 | + } else { |
|
232 | + $whereAnd = 'r.id = '.$role->roleId; |
|
233 | + } |
|
234 | + $sql = 'SELECT ur.id, u.firstName, u.lastName, r.name FROM users u INNER JOIN userRoles ur ON ur.userId = u.id INNER JOIN roles r ON r.id = ur.roleId WHERE u.id <> '.$role->userId.' AND '.$whereAnd.' ORDER BY lastName, firstName, r.name'; |
|
235 | + $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); |
|
236 | + |
|
237 | + while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
|
238 | + ?> |
|
239 | 239 | <option value='<?php echo $row['id']; ?>'><?php echo $row['firstName'].' '.$row['lastName'].' ('.$row['name'].')'; ?></option> |
240 | 240 | <?php |
241 | - } ?> |
|
241 | + } ?> |
|
242 | 242 | </select> |
243 | 243 | </div> |
244 | 244 | </div> |