Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions htdocs/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
$dn = "";
$entry = "";
$action = "displayform";
$result = "";
$branch_list = "";

if (isset($_POST["action"]) and $_POST["action"]) {
Expand Down Expand Up @@ -91,9 +90,9 @@ function ($matches) use ($item, $create_attributes, $attributes_map) {
if (!empty($missing_attributes)) {
error_log("LDAP - create rejected for missing mandatory attributes: " . implode(", ", $missing_attributes));
$result = "mandatoryattributerequired";
$action = "displayform";
} else {
# Create entry
$action = "displayform";
} else {
# Create entry
if (!ldap_add($ldap, $dn, $create_attributes)) {
error_log("LDAP - create failed for $dn");
$result = "createfailed";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
isset($hook_config['deleteAccount']['before']['displayError']) and
$hook_config['deleteAccount']['before']['displayError'] and
$prehook_return > 0 ) {
$location .= '&prehookdeleteresult='.$prehook_message;
$location .= '&prehookdeleteresult='.$prehook_message;
}
if ( isset($posthook_return) and
isset($hook_config['deleteAccount']['after']['displayError']) and
Expand Down
3 changes: 3 additions & 0 deletions htdocs/display.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
$dn = $entry_dn;
} else {
$result = "dnrequired";
$page = "error";
}

if (isset($_GET["checkpasswordresult"]) and $_GET["checkpasswordresult"]) {
Expand Down Expand Up @@ -184,6 +185,7 @@
# DN match
if ( !$ldapInstance->matchDn($dn, $dnAttribute, $ldap_user_filter, $ldap_user_base, $ldap_scope) ) {
$result = "noentriesfound";
$page = "error";
error_log("LDAP - $dn not found using the configured search settings, reject request");
} else {

Expand All @@ -208,6 +210,7 @@

if ( $errno ) {
$result = "ldaperror";
$page = "error";
error_log("LDAP - Search error $errno (".ldap_error($ldap).")");
} else {

Expand Down
2 changes: 2 additions & 0 deletions htdocs/groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
$dn = $entry_dn;
} else {
$result = "dnrequired";
$page = "error";
}

if ($result === "") {
Expand All @@ -35,6 +36,7 @@
# DN match
if ( !$ldapInstance->matchDn($dn, $dnAttribute, $ldap_user_filter, $ldap_user_base, $ldap_scope) ) {
$result = "noentriesfound";
$page = "error";
error_log("LDAP - $dn not found using the configured search settings, reject request");
}
}
Expand Down
2 changes: 2 additions & 0 deletions htdocs/rename.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
$dn = $entry_dn;
} else {
$result = "dnrequired";
$page = "error";
}

if ($result === "") {
Expand All @@ -38,6 +39,7 @@
# DN match
if ( !$ldapInstance->matchDn($dn, $dnAttribute, $ldap_user_filter, $ldap_user_base, $ldap_scope) ) {
$result = "noentriesfound";
$page = "error";
error_log("LDAP - $dn not found using the configured search settings, reject request");
} else {

Expand Down
2 changes: 2 additions & 0 deletions htdocs/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
$dn = $entry_dn;
} else {
$result = "dnrequired";
$page = "error";
}

if ($result === "") {
Expand All @@ -38,6 +39,7 @@
# DN match
if ( !$ldapInstance->matchDn($dn, $dnAttribute, $ldap_user_filter, $ldap_user_base, $ldap_scope) ) {
$result = "noentriesfound";
$page = "error";
error_log("LDAP - $dn not found using the configured search settings, reject request");
} else {

Expand Down
1 change: 1 addition & 0 deletions lang/en.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
$messages['groups'] = "groups";
$messages['groupupdateerror'] = "Group not updated";
$messages['groupupdatesuccess'] = "Group updated";
$messages["home"] = "Home";
$messages['hookerror'] = "An error occured in the hook";
$messages['idleaccounts'] = "Idle accounts";
$messages['idleaccountstitle'] = "Accounts idle for more than $idledays days";
Expand Down
1 change: 1 addition & 0 deletions lang/fr.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
$messages['groups'] = "groupes";
$messages['groupupdateerror'] = "Groupe non modifié";
$messages['groupupdatesuccess'] = "Groupe modifié";
$messages["home"] = "Accueil";
$messages['hookerror'] = "Une erreur s'est produite dans le hook";
$messages['idleaccounts'] = "Comptes inactifs";
$messages['idleaccountstitle'] = "Comptes inactifs depuis plus de $idledays jours";
Expand Down
1 change: 1 addition & 0 deletions lang/ja.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
$messages['groups'] = "groups";
$messages['groupupdateerror'] = "Group not updated";
$messages['groupupdatesuccess'] = "Group updated";
$messages["home"] = "Home";
$messages['hookerror'] = "このフックでエラーが発生";
$messages['idleaccounts'] = "アイドル状態のアカウント";
$messages['idleaccountstitle'] = "$idledays 日以上、アイドル状態のアカウント";
Expand Down
1 change: 1 addition & 0 deletions lang/no.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
$messages['groups'] = "groups";
$messages['groupupdateerror'] = "Group not updated";
$messages['groupupdatesuccess'] = "Group updated";
$messages["home"] = "Home";
$messages['hookerror'] = "En feil oppstod i hooken";
$messages['idleaccounts'] = "Inaktive kontoer";
$messages['idleaccountstitle'] = "Kontoer inaktive i mer enn $idledays dager";
Expand Down
6 changes: 6 additions & 0 deletions templates/error.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="d-grid gap-2 col-md-2 mx-auto my-3">
<a type="button" class="btn btn-primary" href="index.php?page=welcome">
<i class="fa fa-fw fa-home"></i>
{$msg_home}
</a>
</div>
3 changes: 3 additions & 0 deletions templates/error_message.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="alert shadow alert-danger">
<i class="fa fa-fw fa-exclamation-circle"></i> {$error}
</div>
8 changes: 3 additions & 5 deletions templates/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
{/if}

{if $error}
<div class="alert alert-danger">
<i class="fa fa-fw fa-exclamation-circle"></i> {$error}
</div>
{else}
{include file="$page.tpl"}
{include file="error_message.tpl"}
{/if}

{include file="$page.tpl"}

</div>
</div>

Expand Down
Loading