Skip to content

Commit 010fa80

Browse files
committed
Upgrade to Framework 15
1 parent 2524e2b commit 010fa80

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

WarnUsersOfPendingSuspension.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ function extend_suspension_time($username='')
4747
$message = "Unable to extend account suspension time: you need to log in with your credentials.";
4848
}
4949
else {
50-
$sql = "update redcap_user_information set user_lastlogin = NOW() where username ='$username';";
51-
52-
db_query($sql);
50+
# Update the user's last login time to now
51+
$result = $this->query("update redcap_user_information set user_lastlogin = NOW() where username = ?;", [$username]);
5352
}
5453

5554
if ($message) {
@@ -95,9 +94,9 @@ function warn_users_account_suspension_cron()
9594
from redcap_user_information
9695
where user_suspended_time is null
9796
) as my_user_info
98-
where '$suspend_users_inactive_days' - DATEDIFF(NOW(), user_last_date) = '$day';";
97+
where ? - DATEDIFF(NOW(), user_last_date) = ?;";
9998

100-
$q = $this->query($sql);
99+
$q = $this->query($sql, [$suspend_users_inactive_days, $day]);
101100

102101
while ($row = db_fetch_assoc($q))
103102
{

config.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
{
22
"name": "Warn Users of Pending Suspension",
33
"namespace": "UF_CTSI\\WarnUsersOfPendingSuspension",
4-
"description": "A REDCap external module that will warn users of pending suspensions and provide an easy opportunity to extend the life of REDCap accounts.",
5-
6-
"permissions": [
7-
"redcap_every_page_top"
8-
],
4+
"description": "A REDCap external module that warns users of pending account suspensions and provides a simple way for REDCap users to extend their account lifetimes.",
5+
"framework-version": 15,
96
"enable-every-page-hooks-on-system-pages": true,
107
"authors": [
118
{

0 commit comments

Comments
 (0)