-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block account #169
Merged
Merged
Block account #169
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8418b52
fix account locking name and bug (#125)
d125a93
fix missing comment in auditlog() (#125)
c44b3b8
use block account feature from ltb-common main branch(#125)
68d639f
add a dedicated menu to list disabled accounts (#125)
8905bfa
add a comment while enabling / disabling accounts (#125)
952a92b
add doc for enabling/disabling comments (#125)
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,16 +5,23 @@ | |
|
||
$result = ""; | ||
$dn = ""; | ||
$password = ""; | ||
$comment = ""; | ||
$returnto = "display"; | ||
|
||
if (isset($_POST["dn"]) and $_POST["dn"]) { | ||
$dn = $_POST["dn"]; | ||
} else if (isset($_GET["dn"]) and $_GET["dn"]) { | ||
$dn = $_GET["dn"]; | ||
} else { | ||
$result = "dnrequired"; | ||
} | ||
|
||
if (!$use_enableaccount) { | ||
$result = "actionforbidden"; | ||
if (isset($_GET["returnto"]) and $_GET["returnto"]) { | ||
$returnto = $_GET["returnto"]; | ||
} | ||
|
||
if (isset($_POST["comment"]) and $_POST["comment"]) { | ||
$comment = $_POST["comment"]; | ||
} | ||
|
||
if ($result === "") { | ||
|
@@ -38,7 +45,7 @@ | |
} | ||
|
||
if ($audit_log_file) { | ||
auditlog($audit_log_file, $dn, $audit_admin, "enableaccount", $result); | ||
auditlog($audit_log_file, $dn, $audit_admin, "enableaccount", $result, $comment); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same than previous comment, this need an adaptation of HTML template, |
||
} | ||
|
||
header('Location: index.php?page=display&dn='.$dn.'&enableaccountresult='.$result); | ||
header('Location: index.php?page='.$returnto.'&dn='.$dn.'&enableaccountresult='.$result); |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/* | ||
* Search disabled entries in LDAP directory | ||
*/ | ||
|
||
require_once("../conf/config.inc.php"); | ||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
[$ldap,$result,$nb_entries,$entries,$size_limit_reached] = $ldapInstance->search($ldap_user_filter, array(), $attributes_map, $search_result_title, $search_result_sortby, $search_result_items, $ldap_scope); | ||
|
||
if ( !empty($entries) ) | ||
{ | ||
|
||
# Check if entry is still locked | ||
foreach($entries as $entry_key => $entry) { | ||
|
||
$isEnabled = $directory->isAccountEnabled($ldap, $entry['dn']); | ||
|
||
if ( $isEnabled === true ) { | ||
unset($entries[$entry_key]); | ||
$nb_entries--; | ||
} | ||
|
||
} | ||
|
||
$smarty->assign("page_title", "disabledaccounts"); | ||
if ($nb_entries === 0) { | ||
$result = "noentriesfound"; | ||
} else { | ||
$smarty->assign("nb_entries", $nb_entries); | ||
$smarty->assign("entries", $entries); | ||
$smarty->assign("size_limit_reached", $size_limit_reached); | ||
|
||
$columns = $search_result_items; | ||
if (! in_array($search_result_title, $columns)) array_unshift($columns, $search_result_title); | ||
$smarty->assign("listing_columns", $columns); | ||
$smarty->assign("listing_linkto", isset($search_result_linkto) ? $search_result_linkto : array($search_result_title)); | ||
$smarty->assign("listing_sortby", array_search($search_result_sortby, $columns)); | ||
$smarty->assign("show_undef", $search_result_show_undefined); | ||
$smarty->assign("truncate_value_after", $search_result_truncate_value_after); | ||
if ($use_enableaccount) { $smarty->assign("display_enable_button", true); } | ||
} | ||
} | ||
|
||
?> |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="alert alert-warning"> | ||
{$nb_entries} {if $nb_entries==1}{$msg_entryfound}{else}{$msg_entriesfound}{/if} | ||
</div> | ||
|
||
{if {$size_limit_reached}} | ||
<div class="alert alert-warning"><i class="fa fa-fw fa-exclamation-triangle"></i> {$msg_sizelimit}</div> | ||
{/if} | ||
|
||
<table id="search-listing" class="table table-striped table-hover table-condensed dataTable"> | ||
{include 'listing_table.tpl' display="search"} | ||
</table> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment modal is only defined for now in lock/unlock panel in the HTML template.
We may add comment for all action, but this should maybe done in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'll do another PR for the comment feature...
Anyway, the last argument of the function auditlog is needed, else Service-Desk crashes.