Revert "fix wrong usage of \Froxlor\User::getAll()"
This reverts commit 48ff2e6b6d.
This commit is contained in:
@@ -124,10 +124,11 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
Database::needSqlData();
|
Database::needSqlData();
|
||||||
$sql_root = Database::getSqlData();
|
$sql_root = Database::getSqlData();
|
||||||
Database::needRoot(false);
|
Database::needRoot(false);
|
||||||
|
\Froxlor\User::getAll() = $customer;
|
||||||
|
|
||||||
$replace_arr = array(
|
$replace_arr = array(
|
||||||
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($customer),
|
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation(\Froxlor\User::getAll()),
|
||||||
'CUST_NAME' => \Froxlor\User::getCorrectUserSalutation($customer), // < keep this for compatibility
|
'CUST_NAME' => \Froxlor\User::getCorrectUserSalutation(\Froxlor\User::getAll()), // < keep this for compatibility
|
||||||
'DB_NAME' => $username,
|
'DB_NAME' => $username,
|
||||||
'DB_PASS' => $password,
|
'DB_PASS' => $password,
|
||||||
'DB_DESC' => $databasedescription,
|
'DB_DESC' => $databasedescription,
|
||||||
@@ -136,9 +137,9 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
);
|
);
|
||||||
|
|
||||||
// get template for mail subject
|
// get template for mail subject
|
||||||
$mail_subject = $this->getMailTemplate($customer, 'mails', 'new_database_by_customer_subject', $replace_arr, $this->lng['mails']['new_database_by_customer']['subject']);
|
$mail_subject = $this->getMailTemplate(\Froxlor\User::getAll(), 'mails', 'new_database_by_customer_subject', $replace_arr, $this->lng['mails']['new_database_by_customer']['subject']);
|
||||||
// get template for mail body
|
// get template for mail body
|
||||||
$mail_body = $this->getMailTemplate($customer, 'mails', 'new_database_by_customer_mailbody', $replace_arr, $this->lng['mails']['new_database_by_customer']['mailbody']);
|
$mail_body = $this->getMailTemplate(\Froxlor\User::getAll(), 'mails', 'new_database_by_customer_mailbody', $replace_arr, $this->lng['mails']['new_database_by_customer']['mailbody']);
|
||||||
|
|
||||||
$_mailerror = false;
|
$_mailerror = false;
|
||||||
$mailerr_msg = "";
|
$mailerr_msg = "";
|
||||||
@@ -146,7 +147,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
$this->mailer()->Subject = $mail_subject;
|
$this->mailer()->Subject = $mail_subject;
|
||||||
$this->mailer()->AltBody = $mail_body;
|
$this->mailer()->AltBody = $mail_body;
|
||||||
$this->mailer()->msgHTML(str_replace("\n", "<br />", $mail_body));
|
$this->mailer()->msgHTML(str_replace("\n", "<br />", $mail_body));
|
||||||
$this->mailer()->addAddress($customer['email'], \Froxlor\User::getCorrectUserSalutation($customer));
|
$this->mailer()->addAddress(\Froxlor\User::getAll()['email'], \Froxlor\User::getCorrectUserSalutation(\Froxlor\User::getAll()));
|
||||||
$this->mailer()->send();
|
$this->mailer()->send();
|
||||||
} catch (\PHPMailer\PHPMailer\Exception $e) {
|
} catch (\PHPMailer\PHPMailer\Exception $e) {
|
||||||
$mailerr_msg = $e->errorMessage();
|
$mailerr_msg = $e->errorMessage();
|
||||||
@@ -158,7 +159,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
|||||||
|
|
||||||
if ($_mailerror) {
|
if ($_mailerror) {
|
||||||
$this->logger()->logAction($this->isAdmin() ? ADM_ACTION : USR_ACTION, LOG_ERR, "[API] Error sending mail: " . $mailerr_msg);
|
$this->logger()->logAction($this->isAdmin() ? ADM_ACTION : USR_ACTION, LOG_ERR, "[API] Error sending mail: " . $mailerr_msg);
|
||||||
\Froxlor\UI\Response::standard_error('errorsendingmail', $customer['email'], true);
|
\Froxlor\UI\Response::standard_error('errorsendingmail', \Froxlor\User::getAll()['email'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->mailer()->clearAddresses();
|
$this->mailer()->clearAddresses();
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class IntegrityCheck
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
if (! empty(\Froxlor\User::getAll())) {
|
if (! isset(\Froxlor\User::getAll()) || ! is_array(\Froxlor\User::getAll())) {
|
||||||
\Froxlor\User::getAll() = array(
|
\Froxlor\User::getAll() = array(
|
||||||
'loginname' => 'integrity-check'
|
'loginname' => 'integrity-check'
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user