make password sending more flexible
This commit is contained in:
parent
26b6505be7
commit
22c0ebe6d4
|
@ -912,7 +912,12 @@ function sendPasswordMail($pwd, $user, $recipient = null) {
|
||||||
$attr = str_replace('@', '', $results[0]);
|
$attr = str_replace('@', '', $results[0]);
|
||||||
$value = '';
|
$value = '';
|
||||||
if (isset($user[strtolower($attr)][0])) {
|
if (isset($user[strtolower($attr)][0])) {
|
||||||
$value = $user[strtolower($attr)][0];
|
if (is_array($user[strtolower($attr)])) {
|
||||||
|
$value = $user[strtolower($attr)][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$value = $user[strtolower($attr)];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$body = str_replace('@@' . $attr . '@@', $value, $body);
|
$body = str_replace('@@' . $attr . '@@', $value, $body);
|
||||||
$found = preg_match('/\@\@[^\@]+\@\@/', $body, $results);
|
$found = preg_match('/\@\@[^\@]+\@\@/', $body, $results);
|
||||||
|
|
Loading…
Reference in New Issue