@@ -83,11 +83,11 @@ function directadmin_get_best_type($module, $packageId, $order = false, $extra =
8383 } elseif (in_array (strtolower ($ parts [2 ]), ['amd64 ' , 'x86-64 ' ])) {
8484 $ parts [2 ] = 64 ;
8585 }
86- if (in_array (strtolower ($ db ->Record ['template_os ' ]), ['debian ' ])) {
87- $ parts [0 ] = 'Debian ' ;
88- } elseif (in_array (strtolower ($ db ->Record ['template_os ' ]), ['ubuntu ' ])) {
89- $ parts [0 ] = 'Debian ' ;
90- $ parts [1 ] = '8 ' ;
86+ if (in_array (strtolower ($ db ->Record ['template_os ' ]), ['debian ' ])) {
87+ $ parts [0 ] = 'Debian ' ;
88+ } elseif (in_array (strtolower ($ db ->Record ['template_os ' ]), ['ubuntu ' ])) {
89+ $ parts [0 ] = 'Debian ' ;
90+ $ parts [1 ] = '8 ' ;
9191 } elseif (in_array (strtolower ($ db ->Record ['template_os ' ]), ['freebsd ' , 'openbsd ' ])) {
9292 $ parts [0 ] = 'FreeBSD ' ;
9393 } elseif (in_array (strtolower ($ db ->Record ['template_os ' ]), ['centos ' , 'fedora ' , 'rhel ' , 'redhat ' ])) {
@@ -130,7 +130,7 @@ function directadmin_get_best_type($module, $packageId, $order = false, $extra =
130130 */
131131function directadmin_req ($ page , $ post = '' , $ options = false )
132132{
133- require_once __DIR__ .'/../../../workerman/statistics/Applications/Statistics/Clients/StatisticClient.php ' ;
133+ require_once __DIR__ .'/../../../workerman/statistics/Applications/Statistics/Clients/StatisticClient.php ' ;
134134
135135 if ($ options === false ) {
136136 $ options = [];
@@ -162,13 +162,14 @@ function directadmin_req($page, $post = '', $options = false)
162162 $ page = "https://www.directadmin.com/ {$ page }" ;
163163 }
164164 }
165- $ call = basename (parse_url ($ page )['path ' ],'.php ' );
166- \StatisticClient::tick ('DirectAdmin ' , $ call );
167- $ response = getcurlpage ($ page , $ post , $ options );
168- if ($ response === false )
169- \StatisticClient::report ('DirectAdmin ' , $ call , false , 1 , 'Curl Error ' , STATISTICS_SERVER );
170- else
171- \StatisticClient::report ('DirectAdmin ' , $ call , true , 0 , '' , STATISTICS_SERVER );
165+ $ call = basename (parse_url ($ page )['path ' ], '.php ' );
166+ \StatisticClient::tick ('DirectAdmin ' , $ call );
167+ $ response = getcurlpage ($ page , $ post , $ options );
168+ if ($ response === false ) {
169+ \StatisticClient::report ('DirectAdmin ' , $ call , false , 1 , 'Curl Error ' , STATISTICS_SERVER );
170+ } else {
171+ \StatisticClient::report ('DirectAdmin ' , $ call , true , 0 , '' , STATISTICS_SERVER );
172+ }
172173 return trim ($ response );
173174}
174175
@@ -282,18 +283,18 @@ function activate_directadmin($ipAddress, $ostype, $pass, $email, $name, $domain
282283 }
283284 $ url = 'https://www.directadmin.com/cgi-bin/createlicense ' ;
284285 $ response = directadmin_req ($ url , $ post , $ options );
285- request_log ('licenses ' , $ GLOBALS ['tf ' ]->session ->account_id , __FUNCTION__ , 'directadmin ' , 'createlicense ' , $ post , $ response );
286+ request_log ('licenses ' , $ GLOBALS ['tf ' ]->session ->account_id , __FUNCTION__ , 'directadmin ' , 'createlicense ' , $ post , $ response );
286287 myadmin_log ('licenses ' , 'info ' , $ response , __LINE__ , __FILE__ );
287288 if (preg_match ('/lid=(\d+)&/ ' , $ response , $ matches )) {
288289 $ lid = $ matches [1 ];
289290 $ response = directadmin_makepayment ($ lid );
290291 request_log ('licenses ' , $ GLOBALS ['tf ' ]->session ->account_id , __FUNCTION__ , 'directadmin ' , 'makepayment ' , $ lid , $ response );
291- myadmin_log ('licenses ' , 'info ' , $ response , __LINE__ , __FILE__ );
292+ myadmin_log ('licenses ' , 'info ' , $ response , __LINE__ , __FILE__ );
292293 }
293294 $ GLOBALS ['tf ' ]->history ->add ($ settings ['TABLE ' ], 'add_directadmin ' , 'ip ' , $ ipAddress , $ custid );
294- return $ lid ;
295+ return $ lid ;
295296 }
296- return $ license ['lid ' ];
297+ return $ license ['lid ' ];
297298}
298299
299300/**
0 commit comments