Skip to content

Commit

Permalink
Update display of project-level timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewPoppe committed Jun 27, 2024
1 parent bf930c2 commit 0c945bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"links": {
"project": [
{
"name": "<strong><font style='color:black;'>REDCap</font><em><font style='color:#900000;'>PRO</font></em>",
"name": "<span style='margin-top:2px;'><strong><font style='color:black;'>REDCap</font><em><font style='color:#900000;'>PRO</font></em></span>",
"key": "redcappro",
"icon": "images/fingerprint_2.png",
"url": "src/home.php",
Expand Down
11 changes: 7 additions & 4 deletions src/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
// Validate Timeout Time
if ( $showTimeoutTimeSetting ) {
$new_settings["timeout-time"] = (int) $post_settings["timeout-time"];
if ( $new_settings["timeout-time"] === 0 ) {
$new_settings["timeout-time"] = $projectSettings->getSystemTimeoutMinutes();
}
if ( $new_settings["timeout-time"] < 1 ) {
$timeout_time_err = "Timeout time must be a positive integer";
$any_err = true;
Expand Down Expand Up @@ -240,14 +243,14 @@ class="form-check-input <?php echo (!empty($prevent_email_login_err)) ? 'is-inva
<label>Enter the number of minutes of inactivity before participant is logged out</label>
<input type="text" name="timeout-time"
class="form-control <?php echo (!empty($timeout_time_err)) ? 'is-invalid' : ''; ?>"
value="<?php echo \REDCap::escapeHtml($settings["timeout-time"]); ?>">
value="<?php echo \REDCap::escapeHtml($projectSettings->getProjectTimeoutMinutes($project_id)); ?>">
<span class="invalid-feedback">
<?php echo $timeout_time_err; ?>
</span>
</div>
<p>
The maximum timeout time allowed on this system is <?= \REDCap::escapeHtml($projectSettings->getMaximumTimeoutMinutes()) ?> minutes.
</p>
<p><span>Leave this value blank to set to the system default of <strong><?= \REDCap::escapeHtml($projectSettings->getSystemTimeoutMinutes())?> minutes.</strong></span>
<br>
<span>The maximum timeout time allowed on this system is <strong><?= \REDCap::escapeHtml($projectSettings->getMaximumTimeoutMinutes()) ?> minutes.</strong></span></p>
</div>
</div>
<br>
Expand Down

0 comments on commit 0c945bb

Please sign in to comment.