From 719e1539b07f1d72cef7e42d96acb7455dead45f Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Sat, 23 Jun 2018 16:54:54 +0200 Subject: [PATCH] [fix] renaming update_certs, fixing deprecated usage of --- bureau/class/m_err.php | 6 +++++- src/mail_add.php | 10 +++++----- src/{update_cert.sh => update_certs.sh} | 0 3 files changed, 10 insertions(+), 6 deletions(-) rename src/{update_cert.sh => update_certs.sh} (100%) diff --git a/bureau/class/m_err.php b/bureau/class/m_err.php index 3e054893..9c6e3bc0 100644 --- a/bureau/class/m_err.php +++ b/bureau/class/m_err.php @@ -149,7 +149,11 @@ class m_err { function deprecated(){ global $msg; $trace = debug_backtrace(); - $caller = $trace[2]; + if (isset($trace[2])) { + $caller = $trace[2]; + } else { + $caller = "UNKNOWN CALLER"; + } $msg->raise("info", "err", "Deprecation warning: The old messaging class is still used by ".json_encode($caller)); } diff --git a/src/mail_add.php b/src/mail_add.php index 490dee46..eb887389 100644 --- a/src/mail_add.php +++ b/src/mail_add.php @@ -109,7 +109,7 @@ print "cuid: $cuid\n"; * from scratch */ if (!($mail_id = $mail->create($domain_id, $user))) { - error_log('failed to create: ' . $err->errstr()); + error_log('failed to create: ' . $msg->msg_str()); exit(4); } @@ -120,8 +120,8 @@ if (!($mail_id = $mail->create($domain_id, $user))) { * no idea why this is a different function. */ if (!$mail->set_passwd($mail_id,$password)) { - error_log("failed to set password on mail $mail_id: " . $err->errstr()); - exit(5); + error_log("failed to set password on mail $mail_id: " . $msg->msg_str()); + exit(5); } /* function set_details($mail_id, $islocal, $quotamb, @@ -132,8 +132,8 @@ if (!$mail->set_passwd($mail_id,$password)) { * if we have no aliases, it's a mailbox. deal with it. */ if (!$mail->set_details($mail_id, !count($recipients), $quota, join("\n", $recipients))) { - error_log('failed to set details: ' . $err->errstr()); - exit(6); + error_log('failed to set details: ' . $msg->msg_str()); + exit(6); } // maybe we need to call the hooks? i don't know! diff --git a/src/update_cert.sh b/src/update_certs.sh similarity index 100% rename from src/update_cert.sh rename to src/update_certs.sh