@@ -8,9 +8,7 @@ class UnitySQL
8
8
{
9
9
private const TABLE_REQS = "requests " ;
10
10
private const TABLE_NOTICES = "notices " ;
11
- private const TABLE_SSOLOG = "sso_log " ;
12
11
private const TABLE_PAGES = "pages " ;
13
- private const TABLE_EVENTS = "events " ;
14
12
private const TABLE_AUDIT_LOG = "audit_log " ;
15
13
private const TABLE_ACCOUNT_DELETION_REQUESTS = "account_deletion_requests " ;
16
14
private const TABLE_SITEVARS = "sitevars " ;
@@ -21,7 +19,8 @@ class UnitySQL
21
19
private const TABLE_GROUP_JOIN_REQUESTS = "groupJoinRequests " ;
22
20
23
21
24
- private const REQUEST_ADMIN = "admin " ;
22
+ // FIXME this string should be changed to something more intuitive, requires production sql change
23
+ private const REQUEST_BECOME_PI = "admin " ;
25
24
26
25
private $ conn ;
27
26
@@ -39,7 +38,7 @@ public function getConn()
39
38
//
40
39
// requests table methods
41
40
//
42
- public function addRequest ($ requestor , $ dest = self ::REQUEST_ADMIN )
41
+ public function addRequest ($ requestor , $ dest = self ::REQUEST_BECOME_PI )
43
42
{
44
43
if ($ this ->requestExists ($ requestor , $ dest )) {
45
44
return ;
@@ -54,7 +53,7 @@ public function addRequest($requestor, $dest = self::REQUEST_ADMIN)
54
53
$ stmt ->execute ();
55
54
}
56
55
57
- public function removeRequest ($ requestor , $ dest = self ::REQUEST_ADMIN )
56
+ public function removeRequest ($ requestor , $ dest = self ::REQUEST_BECOME_PI )
58
57
{
59
58
if (!$ this ->requestExists ($ requestor , $ dest )) {
60
59
return ;
@@ -69,7 +68,7 @@ public function removeRequest($requestor, $dest = self::REQUEST_ADMIN)
69
68
$ stmt ->execute ();
70
69
}
71
70
72
- public function removeRequests ($ dest = self ::REQUEST_ADMIN )
71
+ public function removeRequests ($ dest = self ::REQUEST_BECOME_PI )
73
72
{
74
73
$ stmt = $ this ->conn ->prepare (
75
74
"DELETE FROM " . self ::TABLE_REQS . " WHERE request_for=:request_for "
@@ -79,7 +78,7 @@ public function removeRequests($dest = self::REQUEST_ADMIN)
79
78
$ stmt ->execute ();
80
79
}
81
80
82
- public function requestExists ($ requestor , $ dest = self ::REQUEST_ADMIN )
81
+ public function requestExists ($ requestor , $ dest = self ::REQUEST_BECOME_PI )
83
82
{
84
83
$ stmt = $ this ->conn ->prepare (
85
84
"SELECT * FROM " . self ::TABLE_REQS . " WHERE uid=:uid and request_for=:request_for "
@@ -92,7 +91,7 @@ public function requestExists($requestor, $dest = self::REQUEST_ADMIN)
92
91
return count ($ stmt ->fetchAll ()) > 0 ;
93
92
}
94
93
95
- public function getRequests ($ dest = self ::REQUEST_ADMIN )
94
+ public function getRequests ($ dest = self ::REQUEST_BECOME_PI )
96
95
{
97
96
$ stmt = $ this ->conn ->prepare (
98
97
"SELECT * FROM " . self ::TABLE_REQS . " WHERE request_for=:request_for "
@@ -234,18 +233,6 @@ public function editPage($id, $content, $operator)
234
233
);
235
234
}
236
235
237
- public function addEvent ($ operator , $ action , $ entity )
238
- {
239
- $ stmt = $ this ->conn ->prepare (
240
- "INSERT INTO " . self ::TABLE_EVENTS . " (operator, action, entity) VALUE (:operator, :action, :entity) "
241
- );
242
- $ stmt ->bindParam (":operator " , $ operator );
243
- $ stmt ->bindParam (":action " , $ action );
244
- $ stmt ->bindParam (":entity " , $ entity );
245
-
246
- $ stmt ->execute ();
247
- }
248
-
249
236
// audit log table methods
250
237
public function addLog ($ operator , $ operator_ip , $ action_type , $ recipient )
251
238
{
0 commit comments