Skip to content

Commit

Permalink
Display start date and end date
Browse files Browse the repository at this point in the history
  • Loading branch information
coudot committed Nov 19, 2024
1 parent 552a585 commit 732fcdd
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
12 changes: 12 additions & 0 deletions htdocs/display.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
$isAccountEnabled = "";
$lockDate = "";
$isAccountValid = "";
$startDate = "";
$endDate = "";

if (isset($_GET["dn"]) and $_GET["dn"]) {
$dn = $_GET["dn"];
Expand Down Expand Up @@ -164,6 +166,14 @@

if ($show_validitystatus) {
$isAccountValid = $directory->isAccountValid($ldap, $dn);
if ($use_updatestarttime and isset($entry[0][ $attributes_map['starttime']['attribute'] ])) {
$starttime = $entry[0][ $attributes_map['starttime']['attribute'] ][0];
$startDate = $directory->getPhpDate( $starttime );
}
if ($use_updateendtime and isset($entry[0][ $attributes_map['endtime']['attribute'] ])) {
$endtime = $entry[0][ $attributes_map['endtime']['attribute'] ][0];
$endDate = $directory->getPhpDate( $endtime );
}
}

}}}
Expand Down Expand Up @@ -200,5 +210,7 @@
$smarty->assign('msg_resetpasswordresult','');
}
$smarty->assign("isAccountValid", $isAccountValid);
$smarty->assign("startDate", $startDate);
$smarty->assign("endDate", $endDate);

?>
5 changes: 4 additions & 1 deletion lang/en.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
$messages['dnrequired'] = "Entry identifier required";
$messages['editentry'] = "Edit entry";
$messages['enableaccount'] = "Enable account";
$messages['enddate'] = "End date";
$messages['entriesfound'] = "entries found";
$messages['entryfound'] = "entry found";
$messages['eventfound'] = "event found";
Expand Down Expand Up @@ -87,7 +88,7 @@
$messages['label_pwdreset'] = "Reset password at next connection";
$messages['label_result'] = "Result";
$messages['label_secretary'] = "Secretary";
$messages['label_starttime'] = "Start of validity";
$messages['label_startdate'] = "Start of validity";
$messages['label_state'] = "State";
$messages['label_street'] = "Street";
$messages['label_title'] = "Title";
Expand All @@ -112,6 +113,7 @@
$messages['search'] = "Search";
$messages['searchrequired'] = "Please enter your search";
$messages['sizelimit'] = "Size limit has been reached, some entries could not be displayed";
$messages['starttime'] = "Start date";
$messages['submit'] = "Submit";
$messages['title'] = "Service Desk";
$messages['title_search'] = "Search results:";
Expand Down Expand Up @@ -166,5 +168,6 @@
$messages['policypwned'] = "Your new password may not be published on any previous public password leak from any site";
$messages['policyspecialatends'] = "Your new password may not have its only special character at the beginning or end";
$messages['policyentropy'] = "Password strength";
$messages['updatevaliditydates'] = "Update validity dates";

?>
3 changes: 3 additions & 0 deletions lang/fr.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
$messages['dnrequired'] = "L'identifiant de l'entrée est requis";
$messages['editentry'] = "Modifier l'entrée";
$messages['enableaccount'] = "Activer le compte";
$messages['enddate'] = "Date de fin";
$messages['entriesfound'] = "entrées trouvées";
$messages['entryfound'] = "entrée trouvée";
$messages['eventfound'] = "événement trouvé";
Expand Down Expand Up @@ -112,6 +113,7 @@
$messages['search'] = "Rechercher";
$messages['searchrequired'] = "Veuillez saisir votre recherche";
$messages['sizelimit'] = "La limite de recherche a été atteinte, certaines entrées n'ont pas pu être affichées";
$messages['startdate'] = "Date de début";
$messages['submit'] = "Envoyer";
$messages['title'] = "Guichet de service";
$messages['title_search'] = "Résultats de la recherche :";
Expand Down Expand Up @@ -166,5 +168,6 @@
$messages['policypwned'] = "Votre nouveau mot de passe ne doit pas être connu d'une base publique de mots de passe compromis";
$messages['policyspecialatends'] = "Votre nouveau mot de passe ne doit pas avoir son seul caractère spécial en première ou dernière position.";
$messages['policyentropy'] = "Force du mot de passe";
$messages['updatevaliditydates'] = "Modifier les dates de validité";

?>
22 changes: 22 additions & 0 deletions templates/display.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,28 @@
{if $isAccountValid}{$msg_accountvalid}{else}{$msg_accountnotvalid}{/if}
</p>
</div>
{if $use_updatestarttime or $use_updateendtime}
<div class="card-body">
<form id="updatevaliditydates" method="post" action="index.php?page=updatevaliditydates" class="row g-3">
<input type="hidden" name="dn" value="{$dn}" />
{if $use_updatestarttime}
<div class="col-md-6">
<label for="startDate" class="form-label">{$msg_startdate}</label>
<input type="date" class="form-control" id="startDate" name="start_date" value="{$startDate|date_format:"%Y-%m-%d"}"/>
</div>
{/if}
{if $use_updateendtime}
<div class="col-md-6">
<label for="endDate" class="form-label">{$msg_enddate}</label>
<input type="date" class="form-control" id="endDate" name="end_date" value="{$endDate|date_format:"%Y-%m-%d"}"/>
</div>
{/if}
<button type="submit" class="btn btn-success">
<i class="fa fa-fw fa-calendar-check"></i> {$msg_updatevaliditydates}
</button>
</form>
</div>
{/if}
</div>
{/if}

Expand Down

0 comments on commit 732fcdd

Please sign in to comment.