@@ -116,6 +116,18 @@ public static function getActivate(GenericEvent $event)
116
116
$ result = $ sock ->fetch_parsed_body ();
117
117
request_log (self ::$ module , $ serviceClass ->getCustid (), __FUNCTION__ , 'directadmin ' , $ apiCmd , $ apiOptions , $ result , $ serviceClass ->getId ());
118
118
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
+ }
119
131
/* if ($serviceTypes[$serviceClass->getType()]['services_field2'] != '') {
120
132
$fields = explode(',', $serviceTypes[$serviceClass->getType()]['services_field2']);
121
133
foreach ($fields as $field) {
0 commit comments