From 22c0ebe6d49379e791d7dbe2fe74fff8fa3ce5ab Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 28 Apr 2013 10:20:54 +0000 Subject: [PATCH] make password sending more flexible --- lam/lib/account.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lam/lib/account.inc b/lam/lib/account.inc index 97b3d878..1b2202dc 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -912,7 +912,12 @@ function sendPasswordMail($pwd, $user, $recipient = null) { $attr = str_replace('@', '', $results[0]); $value = ''; 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); $found = preg_match('/\@\@[^\@]+\@\@/', $body, $results);