| | |
| | | |
| | | /* Updating PasswordLastChange Attribute if desired */ |
| | | if ($lchattr = $rcmail->config->get('password_ldap_lchattr')) { |
| | | $entree[$lchattr] = (int)(time() / 86400) |
| | | $entree[$lchattr] = (int)(time() / 86400); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * Substitute %login, %name and %domain in $str |
| | | * Substitute %login, %name, %domain, %dc in $str |
| | | * See plugin config for details |
| | | */ |
| | | function ldap_simple_substitute_vars($str) |
| | |
| | | $str = str_replace('%l', $_SESSION['username'], $str); |
| | | |
| | | $parts = explode('@', $_SESSION['username']); |
| | | |
| | | if (count($parts) == 2) { |
| | | $dc = 'dc='.strtr($parts[1], array('.' => ',dc=')); // hierarchal domain string |
| | | |
| | | $str = str_replace('%name', $parts[0], $str); |
| | | $str = str_replace('%n', $parts[0], $str); |
| | | |
| | | $str = str_replace('%dc', $dc, $str); |
| | | $str = str_replace('%domain', $parts[1], $str); |
| | | $str = str_replace('%d', $parts[1], $str); |
| | | } |