add USERNAME replacer to all email templates; fixes #1032
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -222,6 +222,7 @@ class EmailAccounts extends ApiCommand implements ResourceEntity
|
|||||||
'NAME' => $customer['name'],
|
'NAME' => $customer['name'],
|
||||||
'FIRSTNAME' => $customer['firstname'],
|
'FIRSTNAME' => $customer['firstname'],
|
||||||
'COMPANY' => $customer['company'],
|
'COMPANY' => $customer['company'],
|
||||||
|
'USERNAME' => $customer['loginname'],
|
||||||
'CUSTOMER_NO' => $customer['customernumber']
|
'CUSTOMER_NO' => $customer['customernumber']
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -268,6 +268,7 @@ class Ftps extends ApiCommand implements ResourceEntity
|
|||||||
'NAME' => $customer['name'],
|
'NAME' => $customer['name'],
|
||||||
'FIRSTNAME' => $customer['firstname'],
|
'FIRSTNAME' => $customer['firstname'],
|
||||||
'COMPANY' => $customer['company'],
|
'COMPANY' => $customer['company'],
|
||||||
|
'USERNAME' => $customer['loginname'],
|
||||||
'CUSTOMER_NO' => $customer['customernumber'],
|
'CUSTOMER_NO' => $customer['customernumber'],
|
||||||
'USR_NAME' => $username,
|
'USR_NAME' => $username,
|
||||||
'USR_PASS' => htmlentities(htmlentities($password)),
|
'USR_PASS' => htmlentities(htmlentities($password)),
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ class Mysqls extends ApiCommand implements ResourceEntity
|
|||||||
'NAME' => $userinfo['name'],
|
'NAME' => $userinfo['name'],
|
||||||
'FIRSTNAME' => $userinfo['firstname'],
|
'FIRSTNAME' => $userinfo['firstname'],
|
||||||
'COMPANY' => $userinfo['company'],
|
'COMPANY' => $userinfo['company'],
|
||||||
|
'USERNAME' => $userinfo['loginname'],
|
||||||
'CUSTOMER_NO' => $userinfo['customernumber'],
|
'CUSTOMER_NO' => $userinfo['customernumber'],
|
||||||
'DB_NAME' => $username,
|
'DB_NAME' => $username,
|
||||||
'DB_PASS' => htmlentities(htmlentities($password)),
|
'DB_PASS' => htmlentities(htmlentities($password)),
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class ReportsCron extends FroxlorCron
|
|||||||
if ((int)Settings::Get('system.report_trafficmax') > 0) {
|
if ((int)Settings::Get('system.report_trafficmax') > 0) {
|
||||||
// Warn the customers at xx% traffic-usage
|
// Warn the customers at xx% traffic-usage
|
||||||
$result_stmt = Database::prepare("
|
$result_stmt = Database::prepare("
|
||||||
SELECT `c`.`customerid`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,
|
SELECT `c`.`customerid`, `c`.`loginname`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,
|
||||||
`c`.`company`, `c`.`traffic`, `c`.`email`, `c`.`def_language`,
|
`c`.`company`, `c`.`traffic`, `c`.`email`, `c`.`def_language`,
|
||||||
`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`,
|
`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`,
|
||||||
(SELECT SUM(`t`.`http` + `t`.`ftp_up` + `t`.`ftp_down` + `t`.`mail`)
|
(SELECT SUM(`t`.`http` + `t`.`ftp_up` + `t`.`ftp_down` + `t`.`mail`)
|
||||||
@@ -90,6 +90,7 @@ class ReportsCron extends FroxlorCron
|
|||||||
'NAME' => $rep_userinfo['name'],
|
'NAME' => $rep_userinfo['name'],
|
||||||
'FIRSTNAME' => $rep_userinfo['firstname'],
|
'FIRSTNAME' => $rep_userinfo['firstname'],
|
||||||
'COMPANY' => $rep_userinfo['company'],
|
'COMPANY' => $rep_userinfo['company'],
|
||||||
|
'USERNAME' => $rep_userinfo['loginname'],
|
||||||
'CUSTOMER_NO' => $rep_userinfo['customernumber'],
|
'CUSTOMER_NO' => $rep_userinfo['customernumber'],
|
||||||
'TRAFFIC' => round(($row['traffic'] / 1024), 2),
|
'TRAFFIC' => round(($row['traffic'] / 1024), 2),
|
||||||
/* traffic is stored in KB, template uses MB */
|
/* traffic is stored in KB, template uses MB */
|
||||||
@@ -332,7 +333,7 @@ class ReportsCron extends FroxlorCron
|
|||||||
* report about diskusage for customers
|
* report about diskusage for customers
|
||||||
*/
|
*/
|
||||||
$result_stmt = Database::query("
|
$result_stmt = Database::query("
|
||||||
SELECT `c`.`customerid`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,
|
SELECT `c`.`customerid`, `c`.`loginname`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,
|
||||||
`c`.`company`, `c`.`diskspace`, `c`.`diskspace_used`, `c`.`email`, `c`.`def_language`,
|
`c`.`company`, `c`.`diskspace`, `c`.`diskspace_used`, `c`.`email`, `c`.`def_language`,
|
||||||
`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`
|
`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`
|
||||||
FROM `" . TABLE_PANEL_CUSTOMERS . "` AS `c`
|
FROM `" . TABLE_PANEL_CUSTOMERS . "` AS `c`
|
||||||
@@ -356,6 +357,7 @@ class ReportsCron extends FroxlorCron
|
|||||||
'NAME' => $rep_userinfo['name'],
|
'NAME' => $rep_userinfo['name'],
|
||||||
'FIRSTNAME' => $rep_userinfo['firstname'],
|
'FIRSTNAME' => $rep_userinfo['firstname'],
|
||||||
'COMPANY' => $rep_userinfo['company'],
|
'COMPANY' => $rep_userinfo['company'],
|
||||||
|
'USERNAME' => $rep_userinfo['loginname'],
|
||||||
'CUSTOMER_NO' => $rep_userinfo['customernumber'],
|
'CUSTOMER_NO' => $rep_userinfo['customernumber'],
|
||||||
'DISKAVAILABLE' => round(($row['diskspace'] / 1024), 2),
|
'DISKAVAILABLE' => round(($row['diskspace'] / 1024), 2),
|
||||||
/* traffic is stored in KB, template uses MB */
|
/* traffic is stored in KB, template uses MB */
|
||||||
|
|||||||
@@ -46,8 +46,7 @@ return [
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
'var' => 'USERNAME',
|
'var' => 'USERNAME',
|
||||||
'description' => lng('admin.templates.USERNAME'),
|
'description' => lng('admin.templates.USERNAME')
|
||||||
'visible' => $template == 'createcustomer' || $template == 'password_reset'
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'var' => 'PASSWORD',
|
'var' => 'PASSWORD',
|
||||||
|
|||||||
Reference in New Issue
Block a user