Skip to content

Commit 62f780f

Browse files
committed
added notification on setup error for da storage
1 parent fc9dd13 commit 62f780f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Plugin.php

+12
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,18 @@ public static function getActivate(GenericEvent $event)
116116
$result = $sock->fetch_parsed_body();
117117
request_log(self::$module, $serviceClass->getCustid(), __FUNCTION__, 'directadmin', $apiCmd, $apiOptions, $result, $serviceClass->getId());
118118
myadmin_log('myadmin', 'info', 'DirectAdmin '.$apiCmd.' '.json_encode($apiOptions).' : '.json_encode($result), __LINE__, __FILE__, self::$module, $serviceClass->getId());
119+
if ($result['error'] != "0") {
120+
if ((isset($result['text']) && trim($result['text']) != '') || (isset($result['details']) && trim($result['details']) != '')) {
121+
$event['success'] = false;
122+
getcurlpage('https://chat.is.cc/hooks/BAckHdSAoMsPieCof/CHQ3bKKo5Kh2HeHFJWDpxqBFyj2i7WZwmsLpLM7PmHK5D2fR', json_encode([
123+
'username' => 'Interesting Guy',
124+
'text' => 'Failed [Storage '.$serviceClass->getId().'](https://my.interserver.net/admin/view_backup?id='.$serviceClass->getId().') Activation Text:'.$result['text'].' Details:'.$result['details'],
125+
]), [CURLOPT_HTTPHEADER => ['Content-type: application/json']]);
126+
myadmin_log('directadmin', 'error', 'Error Creating User '.$username.' Site '.$hostname.' Text:'.$result['text'].' Details:'.$result['details'], __LINE__, __FILE__, self::$module, $serviceClass->getId());
127+
$event->stopPropagation();
128+
return;
129+
}
130+
}
119131
/* if ($serviceTypes[$serviceClass->getType()]['services_field2'] != '') {
120132
$fields = explode(',', $serviceTypes[$serviceClass->getType()]['services_field2']);
121133
foreach ($fields as $field) {

0 commit comments

Comments
 (0)