Skip to content

Commit

Permalink
do not hardcode profile link in AD pass expire message
Browse files Browse the repository at this point in the history
Changing passwords might not be available.
  • Loading branch information
splitbrain committed Feb 17, 2012
1 parent b2117c6 commit 69995a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion inc/auth/ad.class.php
Expand Up @@ -149,6 +149,7 @@ function checkPass($user, $pass){
function getUserData($user){
global $conf;
global $lang;
global $ID;
if(!$this->_init()) return false;

if($user == '') return array();
Expand Down Expand Up @@ -206,7 +207,12 @@ function getUserData($user){

// if this is the current user, warn him
if( ($_SERVER['REMOTE_USER'] == $user) && ($timeleft <= $this->cnf['expirywarn'])){
msg(sprintf($lang['authpwdexpire'],$timeleft));
$msg = sprintf($lang['authpwdexpire'],$timeleft);
if($this->canDo('modPass')){
$url = wl($ID,array('do'=>'profile'));
$msg .= ' <a href="'.$url.'">'.$lang['btn_profile'].'</a>';
}
msg($msg);
}
}

Expand Down
2 changes: 1 addition & 1 deletion inc/lang/de/lang.php
Expand Up @@ -268,7 +268,7 @@
$lang['subscr_style_list'] = 'Liste der geänderten Seiten (Alle %.2f Tage)';
$lang['authmodfailed'] = 'Benutzerüberprüfung nicht möglich. Bitte wenden Sie sich an den Systembetreuer.';
$lang['authtempfail'] = 'Benutzerüberprüfung momentan nicht möglich. Falls das Problem andauert, wenden Sie sich an den Systembetreuer.';
$lang['authpwdexpire'] = 'Ihr Passwort läuft in %d Tag(en) ab. Sie sollten es <a href="?do=profile">ändern</a>.';
$lang['authpwdexpire'] = 'Ihr Passwort läuft in %d Tag(en) ab, Sie sollten es bald ändern.';
$lang['i_chooselang'] = 'Wählen Sie Ihre Sprache';
$lang['i_installer'] = 'DokuWiki Installation';
$lang['i_wikiname'] = 'Wiki-Name';
Expand Down
2 changes: 1 addition & 1 deletion inc/lang/en/lang.php
Expand Up @@ -275,7 +275,7 @@
/* auth.class language support */
$lang['authmodfailed'] = 'Bad user authentication configuration. Please inform your Wiki Admin.';
$lang['authtempfail'] = 'User authentication is temporarily unavailable. If this situation persists, please inform your Wiki Admin.';
$lang['authpwdexpire'] = 'Your password will expire in %d days. You should <a href="?do=profile">change it</a>.';
$lang['authpwdexpire'] = 'Your password will expire in %d days, you should change it soon.';

/* installer strings */
$lang['i_chooselang'] = 'Choose your language';
Expand Down

0 comments on commit 69995a1

Please sign in to comment.