mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-24 10:59:07 +01:00
Compare commits
No commits in common. "2104187b1464369f8660cad14edf46b16151b02a" and "2d08374a535a65b384c9eb8d2d0785454edf3c0a" have entirely different histories.
2104187b14
...
2d08374a53
4 changed files with 20 additions and 54 deletions
|
@ -86,7 +86,7 @@ function LSaddon_ppolicy_support() {
|
|||
if ($retval) {
|
||||
LSurl :: add_handler(
|
||||
'#^api/1.0/exportPpolicyInfo/(?P<LSobject>[^/]+)/?$#',
|
||||
'handle_api_LSobject_exportPpolicyInfo',
|
||||
'handle/export_api_LSobject_exportPpolicyInfo',
|
||||
true, false, true);
|
||||
}
|
||||
|
||||
|
@ -137,22 +137,20 @@ function get_ppolicy_password_max_age($ppolicy_dn=null) {
|
|||
* @param string $text The text of the badge
|
||||
* @param string $bg_color The background color of the badge (optional, default: green)
|
||||
* @param string $color The text color of the badge (optional, default: white)
|
||||
* @param string $title The text title of the badge (optional, default: empty string)
|
||||
*
|
||||
* @return string The HTML code of the badge
|
||||
*
|
||||
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||
*/
|
||||
function _ppolicy_badge($text, $bg_color='green', $color='white', $title='') {
|
||||
function _ppolicy_badge($text, $bg_color='green', $color='white') {
|
||||
// Disable HTML formating on PHP cli
|
||||
if (php_sapi_name() == 'cli') return $text;
|
||||
return sprintf(
|
||||
'<span style="
|
||||
background-color: %s; color: %s;
|
||||
padding: 0.2em; font-size: 0.8em; border-radius: 0.4em;"
|
||||
class="LStips" title="%s"
|
||||
>%s</span>',
|
||||
$bg_color, $color, $title, $text
|
||||
$bg_color, $color, $text
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -172,10 +170,7 @@ function ppolicy_extraDisplayColumn_password_expiration($entry) {
|
|||
$change_time = ldapDate2Timestamp($change_time);
|
||||
$max_age = get_ppolicy_password_max_age($entry->pwdPolicySubentry);
|
||||
if ($max_age === false)
|
||||
return _ppolicy_badge(
|
||||
__('Unknown'), 'gray', 'white',
|
||||
sprintf(_('Last password changed: %s, no duration of validity configured.'), date('Y-m-d H:i', $change_time))
|
||||
);
|
||||
return _ppolicy_badge(__('Unknown'), 'gray');
|
||||
if (!$max_age)
|
||||
return _('Never');
|
||||
$expiration_date = $change_time + $max_age;
|
||||
|
@ -183,9 +178,7 @@ function ppolicy_extraDisplayColumn_password_expiration($entry) {
|
|||
if ($expiration_date <= $now)
|
||||
return _ppolicy_badge(
|
||||
sprintf(_('Expired (since %s)'), date('Y-m-d H:i', $expiration_date)),
|
||||
'black', 'white',
|
||||
sprintf(_('Last password changed: %s, duration of validity: %s days'), date('Y-m-d H:i', $change_time), floor($max_age/86400))
|
||||
);
|
||||
'black');
|
||||
$delta = $expiration_date - $now;
|
||||
if ($delta <= LS_PPOLICY_CRITICAL_EXPIRATION_THRESHOLD)
|
||||
$badge_color = 'red';
|
||||
|
@ -195,9 +188,7 @@ function ppolicy_extraDisplayColumn_password_expiration($entry) {
|
|||
$badge_color = 'green';
|
||||
return _ppolicy_badge(
|
||||
sprintf(_('Expire on %s'), date('Y-m-d H:i', $expiration_date)),
|
||||
$badge_color, 'white',
|
||||
sprintf(_('Last password changed: %s, duration of validity: %s days'), date('Y-m-d H:i', $change_time), floor($max_age/86400))
|
||||
);
|
||||
$badge_color);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Binary file not shown.
|
@ -8,7 +8,7 @@ msgstr ""
|
|||
"Project-Id-Version: LdapSaisie\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: \n"
|
||||
"PO-Revision-Date: 2023-12-05 12:48+0100\n"
|
||||
"PO-Revision-Date: 2023-10-13 18:57+0200\n"
|
||||
"Last-Translator: Benjamin Renard <brenard@easter-eggs.com>\n"
|
||||
"Language-Team: LdapSaisie <ldapsaisie-users@lists.labs.libre-entreprise."
|
||||
"org>\n"
|
||||
|
@ -56,40 +56,26 @@ msgstr ""
|
|||
"Politique de mots de passe : Une erreur est survenue en écrivant une ligne "
|
||||
"CSV."
|
||||
|
||||
#: includes/addons/LSaddons.ppolicy.php:171
|
||||
#: includes/addons/LSaddons.ppolicy.php:180
|
||||
#: includes/addons/LSaddons.ppolicy.php:169
|
||||
#: includes/addons/LSaddons.ppolicy.php:175
|
||||
msgid "Never"
|
||||
msgstr "Jamais"
|
||||
|
||||
#: includes/addons/LSaddons.ppolicy.php:176
|
||||
#: includes/addons/LSaddons.ppolicy.php:173
|
||||
msgid "Unknown"
|
||||
msgstr "Inconnu"
|
||||
|
||||
#: includes/addons/LSaddons.ppolicy.php:177
|
||||
#, php-format
|
||||
msgid "Last password changed: %s, no duration of validity configured."
|
||||
msgstr ""
|
||||
"Dernière modification du mot de passe : %s, pas de durée de validité "
|
||||
"configurée."
|
||||
|
||||
#: includes/addons/LSaddons.ppolicy.php:185
|
||||
#: includes/addons/LSaddons.ppolicy.php:180
|
||||
#, php-format
|
||||
msgid "Expired (since %s)"
|
||||
msgstr "Expiré (depuis %s)"
|
||||
|
||||
#: includes/addons/LSaddons.ppolicy.php:187
|
||||
#: includes/addons/LSaddons.ppolicy.php:199
|
||||
#, php-format
|
||||
msgid "Last password changed: %s, duration of validity: %s days"
|
||||
msgstr ""
|
||||
"Dernière modification du mot de passe : %s, durée de validité : %s jours."
|
||||
|
||||
#: includes/addons/LSaddons.ppolicy.php:197
|
||||
#: includes/addons/LSaddons.ppolicy.php:190
|
||||
#, php-format
|
||||
msgid "Expire on %s"
|
||||
msgstr "Expirera le %s"
|
||||
|
||||
#: includes/addons/LSaddons.ppolicy.php:269
|
||||
#: includes/addons/LSaddons.ppolicy.php:260
|
||||
msgid "Not set"
|
||||
msgstr "Non défini"
|
||||
|
||||
|
@ -571,7 +557,7 @@ msgstr ""
|
|||
#: includes/addons/LSaddons.ftp.php:48
|
||||
msgid "FTP: Unable to delete file %{file} on the remote server."
|
||||
msgstr ""
|
||||
"FTP : Impossible de supprimer le fichier %{file} sur le serveur distant."
|
||||
"FTP : Impossible de supprimer le fichier %{dir} sur le serveur distant."
|
||||
|
||||
#: includes/addons/LSaddons.ftp.php:51
|
||||
msgid ""
|
||||
|
|
|
@ -22,37 +22,26 @@ msgstr ""
|
|||
msgid "Password policy: An error occured writing a CSV row."
|
||||
msgstr ""
|
||||
|
||||
#: includes/addons/LSaddons.ppolicy.php:171
|
||||
#: includes/addons/LSaddons.ppolicy.php:180
|
||||
#: includes/addons/LSaddons.ppolicy.php:169
|
||||
#: includes/addons/LSaddons.ppolicy.php:175
|
||||
msgid "Never"
|
||||
msgstr ""
|
||||
|
||||
#: includes/addons/LSaddons.ppolicy.php:176
|
||||
#: includes/addons/LSaddons.ppolicy.php:173
|
||||
msgid "Unknown"
|
||||
msgstr ""
|
||||
|
||||
#: includes/addons/LSaddons.ppolicy.php:177
|
||||
#, php-format
|
||||
msgid "Last password changed: %s, no duration of validity configured."
|
||||
msgstr ""
|
||||
|
||||
#: includes/addons/LSaddons.ppolicy.php:185
|
||||
#: includes/addons/LSaddons.ppolicy.php:180
|
||||
#, php-format
|
||||
msgid "Expired (since %s)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/addons/LSaddons.ppolicy.php:187
|
||||
#: includes/addons/LSaddons.ppolicy.php:199
|
||||
#, php-format
|
||||
msgid "Last password changed: %s, duration of validity: %s days"
|
||||
msgstr ""
|
||||
|
||||
#: includes/addons/LSaddons.ppolicy.php:197
|
||||
#: includes/addons/LSaddons.ppolicy.php:190
|
||||
#, php-format
|
||||
msgid "Expire on %s"
|
||||
msgstr ""
|
||||
|
||||
#: includes/addons/LSaddons.ppolicy.php:269
|
||||
#: includes/addons/LSaddons.ppolicy.php:260
|
||||
msgid "Not set"
|
||||
msgstr ""
|
||||
|
||||
|
|
Loading…
Reference in a new issue