Skip to content

Commit

Permalink
Address #60 - Issues with Expiration Dates
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewPoppe committed Jan 9, 2024
1 parent 7bee769 commit 54bec2e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions ajax/edit_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
// We ignore expired users, unless the request unexpires them
$userExpired = $sagUser->isUserExpired($module->getProjectId());
$requestedExpiration = urldecode($data['expiration']);
$requestedExpiration = \DateTimeRC::format_ts_to_ymd($requestedExpiration);
$requestedUnexpired = empty($requestedExpiration) || (strtotime($requestedExpiration) >= strtotime('today'));
if ( $userExpired && !$requestedUnexpired ) {
$ignore = true;
Expand Down
1 change: 1 addition & 0 deletions ajax/import_export_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
// We ignore expired users, unless the request unexpires them
$userExpired = $sagUser->isUserExpired($project_id);
$requestedExpiration = $thisUser['expiration'];
$requestedExpiration = \DateTimeRC::format_ts_to_ymd($requestedExpiration);

// This import is requesting the user be expired
if ( !empty($requestedExpiration) && strtotime($requestedExpiration) < strtotime('today') ) {
Expand Down
1 change: 1 addition & 0 deletions ajax/set_user_expiration.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

$username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$expiration = filter_input(INPUT_POST, 'expiration', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$expiration = \DateTimeRC::format_ts_to_ymd($expiration);

if ( !empty($expiration) && strtotime($expiration) < strtotime('today') ) {
$errors = false;
Expand Down
1 change: 1 addition & 0 deletions classes/APIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ private function checkUsers()
// We ignore expired users, unless the request unexpires them
$userExpired = $sagUser->isUserExpired($this->projectId);
$requestedExpiration = urldecode($thisUser['expiration']);
$requestedExpiration = \DateTimeRC::format_ts_to_ymd($requestedExpiration);

// This import is requesting the user be expired
if ( !empty($requestedExpiration) && strtotime($requestedExpiration) < strtotime('today') ) {
Expand Down

0 comments on commit 54bec2e

Please sign in to comment.