Skip to content

Commit ddb3749

Browse files
fix DID email notification to admin
1 parent fd38604 commit ddb3749

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

protected/commands/DidCheckCommand.php

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ public function run($args)
107107
if ($didUse->idUser->email_did == 1) {
108108
$mail->send();
109109
}
110-
$sendAdmin = $this->config['global']['admin_received_email'] == 1 ? $mail->send($this->config['global']['admin_email']) : null;
110+
if ($this->config['global']['admin_received_email'] == 1) {
111+
$mail->send($this->config['global']['admin_email']);
112+
}
111113
} else {
112114
$description = Yii::t('zii', 'Monthly payment DID') . ' ' . $didUse->idDid->did;
113115

@@ -131,7 +133,9 @@ public function run($args)
131133
if ($didUse->idUser->email_did == 1) {
132134
$mail->send();
133135
}
134-
$sendAdmin = $this->config['global']['admin_received_email'] == 1 ? $mail->send($this->config['global']['admin_email']) : null;
136+
if ($this->config['global']['admin_received_email'] == 1) {
137+
$mail->send($this->config['global']['admin_email']);
138+
}
135139
}
136140
} else {
137141
//just notify the client about the due date
@@ -168,7 +172,9 @@ public function run($args)
168172
$mail->send();
169173
}
170174

171-
$sendAdmin = $this->config['global']['admin_received_email'] == 1 ? $mail->send($this->config['global']['admin_email']) : null;
175+
if ($this->config['global']['admin_received_email'] == 1) {
176+
$mail->send($this->config['global']['admin_email']);
177+
}
172178
}
173179
} else {
174180
if ($user_credit >= $didUse->idDid->fixrate) {
@@ -190,7 +196,9 @@ public function run($args)
190196
if ($didUse->idUser->email_did == 1) {
191197
$mail->send();
192198
}
193-
$sendAdmin = $this->config['global']['admin_received_email'] == 1 ? $mail->send($this->config['global']['admin_email']) : null;
199+
if ($this->config['global']['admin_received_email'] == 1) {
200+
$mail->send($this->config['global']['admin_email']);
201+
}
194202
} else {
195203
$description = Yii::t('zii', 'Monthly payment DID') . ' ' . $didUse->idDid->did;
196204

@@ -214,7 +222,9 @@ public function run($args)
214222
if ($didUse->idUser->email_did == 1) {
215223
$mail->send();
216224
}
217-
$sendAdmin = $this->config['global']['admin_received_email'] == 1 ? $mail->send($this->config['global']['admin_email']) : null;
225+
if ($this->config['global']['admin_received_email'] == 1) {
226+
$mail->send($this->config['global']['admin_email']);
227+
}
218228
}
219229
} else {
220230
$log = $this->debug >= 1 ? MagnusLog::writeLog(LOGFILE, ' line:' . __LINE__ . " RELEASE THE DID " . $didUse->idDid->did . " ON THE USER " . $didUse->idUser->username . " ") : null;
@@ -253,8 +263,9 @@ public function run($args)
253263
if ($didUse->idUser->email_did == 1) {
254264
$mail->send();
255265
}
256-
$mail->send($this->config['global']['admin_email']);
257-
$sendAdmin = $this->config['global']['admin_received_email'] == 1 ? $mail->send($this->config['global']['admin_email']) : null;
266+
if ($this->config['global']['admin_received_email'] == 1) {
267+
$mail->send($this->config['global']['admin_email']);
268+
}
258269
}
259270
}
260271
} else {

protected/commands/update.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ echo 'Options -Indexes
8888
Order Deny,Allow
8989
Deny from all
9090
' > /var/www/html/mbilling/assets/.htaccess
91+
echo 'Options -Indexes
92+
Order Deny,Allow
93+
Deny from all
94+
' > /var/www/html/mbilling/lib/.htaccess
9195
chmod +x /var/www/html/mbilling/resources/asterisk/mbilling.php
9296
sed -i "s/AllowOverride None/AllowOverride All/" ${HTTP_CONFIG}
9397
systemctl reload ${SERVICE}

0 commit comments

Comments
 (0)