summaryrefslogtreecommitdiff
path: root/public/app/routes/user.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-06-09 02:35:46 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-06-09 02:35:46 +0300
commit0b0076b2ece062f248b7c048d6bb28abbe9174a5 (patch)
tree3cea63a08d76cc63d0de4fa0743a3c2eabe58fca /public/app/routes/user.php
parent85013cfa9aac7b2a17e0158a77e75dcfbb1ce298 (diff)
downloadgyraf1gov-0b0076b2ece062f248b7c048d6bb28abbe9174a5.tar.gz
gyraf1gov-0b0076b2ece062f248b7c048d6bb28abbe9174a5.tar.bz2
gyraf1gov-0b0076b2ece062f248b7c048d6bb28abbe9174a5.zip
invitations interface ready; needs testing onto the public web
Diffstat (limited to 'public/app/routes/user.php')
-rw-r--r--public/app/routes/user.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/public/app/routes/user.php b/public/app/routes/user.php
index 67032e6..622dc57 100644
--- a/public/app/routes/user.php
+++ b/public/app/routes/user.php
@@ -193,10 +193,17 @@ if (Auth::in_admin_group()) {
Route::add('/admin/invite', function() {
$teachers = Registry::use('database')->runQuery(
"SELECT id, concat(last_name, ' ', first_name) as TeacherName
- FROM user ORDER BY TeacherName", []
+ FROM user ORDER BY TeacherName
+ WHERE otp_expiration < :now OR otp_expiration IS NULL",
+ [ ':now' => time() ]
);
Render::view('templates/invite', ['teachers' => $teachers]);
});
+
+ // POST AJAX: set petition protocol
+ Route::add('/admin/send/invitation', function() {
+ Office::send_invitation();
+ }, 'post');
}