@@ -8,9 +8,7 @@ class UnitySQL
88{
99 private const TABLE_REQS = "requests " ;
1010 private const TABLE_NOTICES = "notices " ;
11- private const TABLE_SSOLOG = "sso_log " ;
1211 private const TABLE_PAGES = "pages " ;
13- private const TABLE_EVENTS = "events " ;
1412 private const TABLE_AUDIT_LOG = "audit_log " ;
1513 private const TABLE_ACCOUNT_DELETION_REQUESTS = "account_deletion_requests " ;
1614 private const TABLE_SITEVARS = "sitevars " ;
@@ -21,7 +19,8 @@ class UnitySQL
2119 private const TABLE_GROUP_JOIN_REQUESTS = "groupJoinRequests " ;
2220
2321
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 " ;
2524
2625 private $ conn ;
2726
@@ -39,7 +38,7 @@ public function getConn()
3938 //
4039 // requests table methods
4140 //
42- public function addRequest ($ requestor , $ dest = self ::REQUEST_ADMIN )
41+ public function addRequest ($ requestor , $ dest = self ::REQUEST_BECOME_PI )
4342 {
4443 if ($ this ->requestExists ($ requestor , $ dest )) {
4544 return ;
@@ -54,7 +53,7 @@ public function addRequest($requestor, $dest = self::REQUEST_ADMIN)
5453 $ stmt ->execute ();
5554 }
5655
57- public function removeRequest ($ requestor , $ dest = self ::REQUEST_ADMIN )
56+ public function removeRequest ($ requestor , $ dest = self ::REQUEST_BECOME_PI )
5857 {
5958 if (!$ this ->requestExists ($ requestor , $ dest )) {
6059 return ;
@@ -69,7 +68,7 @@ public function removeRequest($requestor, $dest = self::REQUEST_ADMIN)
6968 $ stmt ->execute ();
7069 }
7170
72- public function removeRequests ($ dest = self ::REQUEST_ADMIN )
71+ public function removeRequests ($ dest = self ::REQUEST_BECOME_PI )
7372 {
7473 $ stmt = $ this ->conn ->prepare (
7574 "DELETE FROM " . self ::TABLE_REQS . " WHERE request_for=:request_for "
@@ -79,7 +78,7 @@ public function removeRequests($dest = self::REQUEST_ADMIN)
7978 $ stmt ->execute ();
8079 }
8180
82- public function requestExists ($ requestor , $ dest = self ::REQUEST_ADMIN )
81+ public function requestExists ($ requestor , $ dest = self ::REQUEST_BECOME_PI )
8382 {
8483 $ stmt = $ this ->conn ->prepare (
8584 "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)
9291 return count ($ stmt ->fetchAll ()) > 0 ;
9392 }
9493
95- public function getRequests ($ dest = self ::REQUEST_ADMIN )
94+ public function getRequests ($ dest = self ::REQUEST_BECOME_PI )
9695 {
9796 $ stmt = $ this ->conn ->prepare (
9897 "SELECT * FROM " . self ::TABLE_REQS . " WHERE request_for=:request_for "
@@ -234,18 +233,6 @@ public function editPage($id, $content, $operator)
234233 );
235234 }
236235
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-
249236 // audit log table methods
250237 public function addLog ($ operator , $ operator_ip , $ action_type , $ recipient )
251238 {
0 commit comments