-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added modal functionality to insert comment to audit logs when un/loc…
…king account. (#140) * #127: Added modal functionality to insert comment to audit logs when un/locking account. * #127: Adding un/lock comment documentation. * #127: Removed code duplication. Using comment modal reference. * #127: Created comment.tpl to make reusable component. * #127: Minor formating. * #127: Added feature to enable and disable comment. Added documentation for the feature. * #127: Deleting accidental pushed image. * #127: Fixing requested suggestions. * Add translation * #127: Added functionality to require comment. Changed audit to only write comment if value is set. Added documentation for required comment feature. * #127: Simplying conditions. * Improve code for comment in audit * Use textarea for comment * Clean unused lang messages * Add vanilla tooltip to modal buttons --------- Co-authored-by: Clément OUDOT <[email protected]>
- Loading branch information
Showing
11 changed files
with
127 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
<?php | ||
function auditlog($file, $dn, $admin, $action, $result) { | ||
$log = array ( | ||
function auditlog($file, $dn, $admin, $action, $result, $comment) { | ||
|
||
$log = array( | ||
"date" => date_format(date_create(), "D, d M Y H:i:s"), | ||
"ip" => $_SERVER['REMOTE_ADDR'], | ||
"user_dn" => $dn, | ||
"done_by" => $admin, | ||
"action" => $action, | ||
"result" => $result | ||
); | ||
|
||
if ($comment) { | ||
$log['comment'] = $comment; | ||
} | ||
|
||
file_put_contents($file, json_encode($log, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . PHP_EOL, FILE_APPEND | LOCK_EX); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<form id={$method} method="post" action="index.php?page={$page}"> | ||
<input type="hidden" name="dn" value="{$dn}" /> | ||
<div class="modal fade" id="commentModal" tabindex="-1" aria-labelledby="CommentModal" aria-hidden="true"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h1 class="modal-title fs-5" id="CommentModal">{$title}</h1> | ||
</div> | ||
<div class="modal-body"> | ||
<textarea class="form-control" name="comment" id="comment-{$method}" rows="3" placeholder="{$msg_insert_comment}"{if $use_lockcomment_required || $use_unlockcomment_required}required{/if}></textarea> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> | ||
<i class="fa fa-fw fa-window-close-o"></i> {$msg_close} | ||
</button> | ||
<button type="submit" class="btn btn-success"> | ||
<i class="fa fa-fw fa-check-square-o"></i> {$msg_submit} | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters