@@ -131,11 +131,11 @@ public static function getActivate(GenericEvent $event)
131131 $ result = $ sock ->fetch_parsed_body ();
132132 request_log (self ::$ module , $ serviceClass ->getCustid (), __FUNCTION__ , 'directadmin ' , $ apiCmd , $ apiOptions , $ rawResult , $ serviceClass ->getId ());
133133 myadmin_log ('myadmin ' , 'info ' , 'DirectAdmin ' .$ apiCmd .' ' .json_encode ($ apiOptions ).' : ' .json_encode ($ result ), __LINE__ , __FILE__ , self ::$ module , $ serviceClass ->getId ());
134- if ($ result ['error ' ] != "0 " ) {
134+ if (( $ result ['error ' ] ?? ' 0 ' ) != "0 " ) {
135135 if ((isset ($ result ['text ' ]) && trim ($ result ['text ' ]) != '' ) || (isset ($ result ['details ' ]) && trim ($ result ['details ' ]) != '' )) {
136136 $ event ['success ' ] = false ;
137- chatNotify ('Failed [Website ' .$ serviceClass ->getId ().'](https://my.interserver.net/admin/view_website?id= ' .$ serviceClass ->getId ().') Activation Text: ' .$ result ['text ' ].' Details: ' .$ result ['details ' ], 'int-dev ' );
138- myadmin_log ('directadmin ' , 'error ' , 'Error Creating User ' .$ username .' Site ' .$ hostname .' Text: ' .$ result ['text ' ].' Details: ' .$ result ['details ' ], __LINE__ , __FILE__ , self ::$ module , $ serviceClass ->getId ());
137+ chatNotify ('Failed [Website ' .$ serviceClass ->getId ().'](https://my.interserver.net/admin/view_website?id= ' .$ serviceClass ->getId ().') Activation Text: ' .( $ result ['text ' ] ?? '' ) .' Details: ' .( $ result ['details ' ] ?? '' ) , 'int-dev ' );
138+ myadmin_log ('directadmin ' , 'error ' , 'Error Creating User ' .$ username .' Site ' .$ hostname .' Text: ' .( $ result ['text ' ] ?? '' ) .' Details: ' .( $ result ['details ' ] ?? '' ) , __LINE__ , __FILE__ , self ::$ module , $ serviceClass ->getId ());
139139 $ event ->stopPropagation ();
140140 return ;
141141 }
@@ -199,10 +199,14 @@ public static function getActivate(GenericEvent $event)
199199 }
200200 $ db = get_module_db (self ::$ module );
201201 $ username = $ db ->real_escape ($ username );
202+ $ siteIp = '' ;
202203 if (!isset ($ result ['error ' ]) || $ result ['error ' ] == '0 ' || $ result ['error ' ] == 0 ) {
203204 $ sock ->query ('/CMD_API_SHOW_USER_CONFIG ' , ['user ' => $ username ]);
204205 $ userConfigDetails = $ sock ->fetch_parsed_body ();
205- $ siteIp = $ userConfigDetails ['ip ' ];
206+ $ siteIp = $ userConfigDetails ['ip ' ] ?? '' ;
207+ if ($ siteIp === '' ) {
208+ myadmin_log ('directadmin ' , 'error ' , 'SHOW_USER_CONFIG returned no ip for ' .$ username , __LINE__ , __FILE__ , self ::$ module , $ serviceClass ->getId ());
209+ }
206210 }
207211 $ db ->query ("update {$ settings ['TABLE ' ]} set {$ settings ['PREFIX ' ]}_ip=' {$ siteIp }', {$ settings ['PREFIX ' ]}_username=' {$ username }' where {$ settings ['PREFIX ' ]}_id=' {$ serviceClass ->getId ()}' " , __LINE__ , __FILE__ );
208212 website_welcome_email ($ serviceClass ->getId ());
0 commit comments