Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2012
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.15 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.3.0
  8. * @ Author : DeZender
  9. * @ Release on : 17.05.2011
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function CheckLicense() {
  15. require( dirname( realpath( __FILE__ ) ) . '/' . 'config.php' );
  16. $licensekey = '' . $modulelicensekey;
  17.  
  18. if (!mysql_num_rows( mysql_query( 'SHOW TABLES LIKE \'mod_ovhsrv\'' ) )) {
  19. $query = 'CREATE TABLE `mod_ovhsrv` (`id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,`licensekey` TEXT NOT NULL)';
  20. $result = mysql_query( $query );
  21. }
  22.  
  23. $res = mysql_query( '' . 'SELECT relid,value FROM tblcustomfieldsvalues WHERE relid IN (SELECT id FROM tblhosting WHERE domainstatus = \'Active\') AND value REGEXP \'^(ns|ks)[0-9].*\.(ovh.net|kimsufi.com)$\'' );
  24. $num = mysql_num_rows( $res );
  25.  
  26. if (( preg_match( '' . '/^OvhSrv\-Micro\-(Leased|Owned)\-[a-zA-Z0-9]{20}$/', '' . $modulelicensekey ) && 2 < $num )) {
  27. echo '' . '<div class="errorbox">License exceeded.<br />Please contact our support to resolve this issue<br /><br />Error code [0' . $num . '2]<br /></div>';
  28. return false;
  29. }
  30.  
  31. if (( preg_match( '' . '/^OvhSrv\-Mini\-(Leased|Owned)\-[a-zA-Z0-9]{20}$/', '' . $modulelicensekey ) && 5 < $num )) {
  32. echo '' . '<div class="errorbox">License exceeded.<br />Please contact our support to resolve this issue<br /><br />Error code [0' . $num . '5]<br /></div>';
  33. return false;
  34. }
  35.  
  36. if (!preg_match( '' . '/^OvhSrv\-([a-zA-Z]{4,5}\-)?(Leased|Owned)\-[a-zA-Z0-9]{20}$/', '' . $modulelicensekey )) {
  37. echo '<div class="errorbox">Your license key is invalid.<br />Please contact WebSoftSolus support at support@websoftsolus.com to resolve this issue<br /></div>';
  38. return false;
  39. }
  40.  
  41. $query = select_query( 'mod_ovhsrv', 'licensekey' );
  42. $data = mysql_fetch_array( $query );
  43. $localkey = $data['licensekey'];
  44. $results = check_license( $licensekey, $localkey );
  45.  
  46. if ($results['status'] == 'Active') {
  47. if ($results['localkey']) {
  48. $localkeydata = $results['localkey'];
  49. $query = select_query( 'mod_ovhsrv', 'licensekey' );
  50. $result = mysql_fetch_assoc( $query );
  51.  
  52. if (empty( $result )) {
  53. insert_query( 'mod_ovhsrv', array( 'licensekey' => '' . $localkeydata ) );
  54. } else {
  55. update_query( 'mod_ovhsrv', array( 'licensekey' => '' . $localkeydata ) );
  56. }
  57. }
  58.  
  59. return true;
  60. }
  61.  
  62. if ($results['status'] == 'Invalid') {
  63. echo '<div class="errorbox">Your license key is invalid.<br />Please contact WebSoftSolus support at support@websoftsolus.com to resolve this issue<br /></div>';
  64. } else {
  65. if ($results['status'] == 'Expired') {
  66. echo '<div class="errorbox">Your license key is Expired.<br />Please contact WebSoftSolus support at support@websoftsolus.com to resolve this issue<br /></div>';
  67. } else {
  68. if ($results['status'] == 'Suspended') {
  69. echo '<div class="errorbox">Your license key is Suspended.<br />Please contact WebSoftSolus support at support@websoftsolus.com to resolve this issue<br /></div>';
  70. }
  71. }
  72. }
  73.  
  74. return false;
  75. }
  76.  
  77. function check_license($licensekey, $localkey = '') {
  78. $whmcsurl = 'http://www.websoftsolus.com/clients/';
  79. $licensing_secret_key = 'bd553aeb64S53ada45d8626db4e6d6ed';
  80. $check_token = time( ) . md5( mt_rand( 1000000000, 9999999999 ) . $licensekey );
  81. $checkdate = date( 'Ymd' );
  82. $usersip = (isset( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR']);
  83. $localkeydays = 23;
  84. $allowcheckfaildays = 18;
  85. $localkeyvalid = false;
  86.  
  87. if ($localkey) {
  88. $localkey = str_replace( '
  89. ', '', $localkey );
  90.  
  91. $localdata = substr( $localkey, 0, strlen( $localkey ) - 32 );
  92. $md5hash = substr( $localkey, strlen( $localkey ) - 32 );
  93.  
  94. if ($md5hash == md5( $localdata . $licensing_secret_key )) {
  95. $localdata = strrev( $localdata );
  96. $md5hash = substr( $localdata, 0, 32 );
  97. $localdata = substr( $localdata, 32 );
  98. $localdata = base64_decode( $localdata );
  99. $localkeyresults = unserialize( $localdata );
  100. $originalcheckdate = $localkeyresults['checkdate'];
  101.  
  102. if ($md5hash == md5( $originalcheckdate . $licensing_secret_key )) {
  103. $localexpiry = date( 'Ymd', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) - $localkeydays, date( 'Y' ) ) );
  104.  
  105. if ($localexpiry < $originalcheckdate) {
  106. $localkeyvalid = true;
  107. $results = $localkeyresults;
  108. $validdomains = explode( ',', $results['validdomain'] );
  109.  
  110. if (!in_array( $_SERVER['SERVER_NAME'], $validdomains )) {
  111. $localkeyvalid = false;
  112. $localkeyresults['status'] = 'Invalid';
  113. $results = array( );
  114. }
  115.  
  116. $validips = explode( ',', $results['validip'] );
  117.  
  118. if (!in_array( $usersip, $validips )) {
  119. $localkeyvalid = false;
  120. $localkeyresults['status'] = 'Invalid';
  121. $results = array( );
  122. }
  123.  
  124. if ($results['validdirectory'] != dirname( __FILE__ )) {
  125. $localkeyvalid = false;
  126. $localkeyresults['status'] = 'Invalid';
  127. $results = array( );
  128. }
  129. }
  130. }
  131. }
  132. }
  133.  
  134. if (!$localkeyvalid) {
  135. $postfields['licensekey'] = $licensekey;
  136. $postfields['domain'] = $_SERVER['SERVER_NAME'];
  137. $postfields['ip'] = $usersip;
  138. $postfields['dir'] = dirname( __FILE__ );
  139.  
  140. if ($check_token) {
  141. $postfields['check_token'] = $check_token;
  142. }
  143.  
  144. if (function_exists( 'curl_exec' )) {
  145. $ch = curl_init( );
  146. curl_setopt( $ch, CURLOPT_URL, $whmcsurl . 'modules/servers/licensing/verify.php' );
  147. curl_setopt( $ch, CURLOPT_POST, 1 );
  148. curl_setopt( $ch, CURLOPT_POSTFIELDS, $postfields );
  149. curl_setopt( $ch, CURLOPT_TIMEOUT, 30 );
  150. curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
  151. $data = curl_exec( $ch );
  152. curl_close( $ch );
  153. } else {
  154. $fp = fsockopen( $whmcsurl, 80, $errno, $errstr, 5 );
  155.  
  156. if ($fp) {
  157. $querystring = '';
  158.  
  159. foreach ($postfields as $k => $v) {
  160. $querystring .= '' . $k . '=' . urlencode( $v ) . '&';
  161. }
  162.  
  163. $header = 'POST ' . $whmcsurl . 'modules/servers/licensing/verify.php HTTP/1.0
  164. ';
  165. $header .= 'Host: ' . $whmcsurl . '
  166. ';
  167. $header .= 'Content-type: application/x-www-form-urlencoded
  168. ';
  169. $header .= 'Content-length: ' . @strlen( $querystring ) . '
  170. ';
  171. $header .= 'Connection: close
  172.  
  173. ';
  174. $header .= $querystring;
  175. $data = '';
  176. @stream_set_timeout( $fp, 20 );
  177. @fputs( $fp, $header );
  178. $status = @socket_get_status( $fp );
  179.  
  180. while (( !@feof( $fp ) && $status )) {
  181. $data .= @fgets( $fp, 1024 );
  182. $status = @socket_get_status( $fp );
  183. }
  184.  
  185. @fclose( $fp );
  186. }
  187. }
  188.  
  189.  
  190. if (!$data) {
  191. $localexpiry = date( 'Ymd', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) - ( $localkeydays + $allowcheckfaildays ), date( 'Y' ) ) );
  192.  
  193. if ($localexpiry < $originalcheckdate) {
  194. $results = $localkeyresults;
  195. } else {
  196. $results['status'] = 'Invalid';
  197. $results['description'] = 'Remote Check Failed';
  198. return $results;
  199. }
  200. }
  201.  
  202. preg_match_all( '/<(.*?)>([^<]+)<\/\1>/i', $data, $matches );
  203. $results = array( );
  204.  
  205. foreach ($matches[1] as $k => $v) {
  206. $results[$v] = $matches[2][$k];
  207. }
  208.  
  209.  
  210. if ($results['md5hash']) {
  211. if ($results['md5hash'] != md5( $licensing_secret_key . $check_token )) {
  212. $results['status'] = 'Invalid';
  213. $results['description'] = 'MD5 Checksum Verification Failed';
  214. return $results;
  215. }
  216. }
  217.  
  218. if ($results['status'] == 'Active') {
  219. $results['checkdate'] = $checkdate;
  220. $data_encoded = serialize( $results );
  221. $data_encoded = base64_encode( $data_encoded );
  222. $data_encoded = md5( $checkdate . $licensing_secret_key ) . $data_encoded;
  223. $data_encoded = strrev( $data_encoded );
  224. $data_encoded = $data_encoded . md5( $data_encoded . $licensing_secret_key );
  225. $data_encoded = wordwrap( $data_encoded, 80, '
  226. ', true );
  227.  
  228. $results['localkey'] = $data_encoded;
  229. }
  230.  
  231. $results['remotecheck'] = true;
  232. }
  233.  
  234. unset( $postfields );
  235. unset( $data );
  236. unset( $matches );
  237. unset( $whmcsurl );
  238. unset( $licensing_secret_key );
  239. unset( $checkdate );
  240. unset( $usersip );
  241. unset( $localkeydays );
  242. unset( $allowcheckfaildays );
  243. unset( $md5hash );
  244. return $results;
  245. }
  246.  
  247. function ovh_ConfigOptions() {
  248. if (!CheckLicense( )) {
  249. return null;
  250. }
  251.  
  252. $configarray = array( 'Clientarea Services Buttons' => array( 'Type' => 'text', 'Size' => '50', 'Description' => '<br />
  253. Separate with commas EX : reboot,mrtg,rtm<br /><br />
  254. reboot = Reboot<br />
  255. netboot = Netboot<br />
  256. install = Reinstall<br />
  257. reverseipv4 = Reverse IPv4<br />
  258. reverseipv6 = Reverse IPv6<br />
  259. failover = IP Failover<br />
  260. ircfilter = IRC Filter<br />
  261. vmac = Virtual Mac for VPS<br />
  262. blockedip = Blocked IP addresses<br />
  263. mrtg = Graphs MRTG<br />
  264. rtm = Real Time Monitoring<br />
  265. history = Interventions History<br />
  266. <br />' ), 'Colsnum' => array( 'Type' => 'dropdown', 'Options' => '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15', 'Description' => '# of buttons per line' ), 'Clientarea Summary' => array( 'Type' => 'yesno', 'Description' => 'Show Client Area server summary' ), 'White Label' => array( 'Type' => 'yesno', 'Description' => 'Conceal any information that may be related to OVH' ), 'Hide Rescue NetBoots' => array( 'Type' => 'yesno', 'Description' => 'Hide vKVM, Rescue-pro and WinRescue' ), 'Debug Mode' => array( 'Type' => 'yesno', 'Description' => 'Show all errors for debug' ) );
  267. return $configarray;
  268. }
  269.  
  270. function ovh_ClientArea($params) {
  271. if (!CheckLicense( )) {
  272. return null;
  273. }
  274.  
  275. $sql = select_query( 'tblhosting', 'regdate,nextduedate,domainstatus,dedicatedip', array( 'id' => $params['serviceid'] ) );
  276. $data = mysql_fetch_array( $sql );
  277. require( dirname( realpath( __FILE__ ) ) . '/' . 'config.php' );
  278. global $_LANG;
  279.  
  280. $ClientareaButtons = $params['configoption1'];
  281. $ButtonsColsnum = $params['configoption2'];
  282. $ClientareaSummary = $params['configoption3'];
  283. $WhiteLabel = $params['configoption4'];
  284. $HideRescueNetBoots = $params['configoption5'];
  285. $Debug = $params['configoption6'];
  286. $regdate = explode( '-', $data['regdate'] );
  287. $regdate = '' . $regdate['2'] . '/' . $regdate['1'] . '/' . $regdate['0'];
  288.  
  289. if ($data['nextduedate'] == '0000-00-00') {
  290. $nextduedate = '-';
  291. } else {
  292. $nextduedate = explode( '-', $data['nextduedate'] );
  293. $nextduedate = '' . $nextduedate['2'] . '/' . $nextduedate['1'] . '/' . $nextduedate['0'];
  294. }
  295.  
  296. $domain = $params['domain'];
  297. $customfields = $params['customfields'];
  298. $nic = $customfields['ovh_nic'];
  299. $nicpassword = $customfields['ovh_password'];
  300. $serveur = $customfields['ovh_hostname'];
  301. $ip = gethostbyname( $serveur );
  302. $id = $params['serviceid'];
  303. $clientsdetails = $params['clientsdetails'];
  304. $rebootbtn = ' <form action="clientarea.php?action=productdetails" method="post">
  305. <div style="margin:10px;">
  306. <div style="text-align:center;width:80px;">
  307. <input name="id" value="' . $id . '" type="hidden" />
  308. <input name="do" value="reboot" type="hidden" />
  309. <input name="a" value="reboot" type="hidden" />
  310. <input name="modop" value="custom" type="hidden" />
  311. <input name="reboot" type="image" src="images/icons/energy.gif" alt="' . $_LANG['srvReboot'] . '" title="' . $_LANG['srvReboot'] . '" value="reboot">
  312. <br />
  313. </div>' . $_LANG['srvReboot'] . '
  314. </div>
  315. </form>';
  316. $netbootbtn = ' <form action="clientarea.php?action=productdetails" method="post">
  317. <div style="margin:10px;" align="center">
  318. <div style="text-align:center;width:80px;">
  319. <input name="id" value="' . $id . '" type="hidden" />
  320. <input name="do" value="netboot" type="hidden" />
  321. <input name="a" value="netboot" type="hidden" />
  322. <input name="modop" value="custom" type="hidden" />
  323. <input name="Netboot" type="image" src="images/icons/neat.gif" alt="' . $_LANG['srvNetboot'] . '" title="' . $_LANG['srvNetboot'] . '" value="Netboot">
  324. <br />
  325. </div>' . $_LANG['srvNetboot'] . '
  326. </div>
  327. </form>';
  328. $installbtn = ' <form action="clientarea.php?action=productdetails" method="post">
  329. <div style="margin:10px;">
  330. <div style="text-align:center;width:80px;">
  331. <input name="id" value="' . $id . '" type="hidden" />
  332. <input name="do" value="install" type="hidden" />
  333. <input name="a" value="install" type="hidden" />
  334. <input name="modop" value="custom" type="hidden" />
  335. <input name="install" type="image" src="images/icons/package-utilities.gif" alt="' . $_LANG['srvReinstall'] . '" title="' . $_LANG['srvReinstall'] . '" value="install">
  336. <br />
  337. </div>' . $_LANG['srvReinstall'] . '
  338. </div>
  339. </form>';
  340. $reverseipv4btn = ' <form action="clientarea.php?action=productdetails" method="post">
  341. <div style="margin:10px;">
  342. <div style="text-align:center;width:80px;">
  343. <input name="id" value="' . $id . '" type="hidden" />
  344. <input name="do" value="reverseipv4" type="hidden" />
  345. <input name="a" value="reverseipv4" type="hidden" />
  346. <input name="modop" value="custom" type="hidden" />
  347. <input name="reverseipv4" type="image" src="images/icons/reverse_ipv4.gif" alt="' . $_LANG['srvIpv4Reverse'] . '" title="' . $_LANG['srvIpv4Reverse'] . '" value="reverseipv4">
  348. <br />
  349. </div>' . $_LANG['srvIpv4Reverse'] . '
  350. </div>
  351. </form>';
  352. $reverseipv6btn = ' <form action="clientarea.php?action=productdetails" method="post">
  353. <div style="margin:10px;">
  354. <div style="text-align:center;width:80px;">
  355. <input name="id" value="' . $id . '" type="hidden" />
  356. <input name="do" value="reverseipv6" type="hidden" />
  357. <input name="a" value="reverseipv6" type="hidden" />
  358. <input name="modop" value="custom" type="hidden" />
  359. <input name="reverseipv6" type="image" src="images/icons/reverse_ipv6.gif" alt="' . $_LANG['srvIpv6Reverse'] . '" title="' . $_LANG['srvIpv6Reverse'] . '" value="reverseipv6">
  360. <br />
  361. </div>' . $_LANG['srvIpv6Reverse'] . '
  362. </div>
  363. </form>';
  364. $failoverbtn = ' <form action="clientarea.php?action=productdetails" method="post">
  365. <div style="margin:10px;">
  366. <div style="text-align:center;width:80px;">
  367. <input name="id" value="' . $id . '" type="hidden" />
  368. <input name="do" value="failover" type="hidden" />
  369. <input name="a" value="failover" type="hidden" />
  370. <input name="modop" value="custom" type="hidden" />
  371. <input name="failover" type="image" src="images/icons/extraip.gif" alt="' . $_LANG['srvIpFailOver'] . '" title="' . $_LANG['srvIpFailOver'] . '" value="failover">
  372. <br />
  373. </div>' . $_LANG['srvIpFailOver'] . '
  374. </div>
  375. </form>';
  376. $ircfilterbtn = ' <form action="clientarea.php?action=productdetails" method="post">
  377. <div style="margin:10px;">
  378. <div style="text-align:center;width:80px;">
  379. <input name="id" value="' . $id . '" type="hidden" />
  380. <input name="do" value="ircfilter" type="hidden" />
  381. <input name="a" value="ircfilter" type="hidden" />
  382. <input name="modop" value="custom" type="hidden" />
  383. <input name="ircfilter" type="image" src="images/icons/chat.gif" alt="' . $_LANG['srvIrcFilter'] . '" title="' . $_LANG['srvIrcFilter'] . '" value="ircfilter">
  384. <br />
  385. </div>' . $_LANG['srvIrcFilter'] . '
  386. </div>
  387. </form>';
  388. $vmacbtn = ' <form action="clientarea.php?action=productdetails" method="post">
  389. <div style="margin:10px;">
  390. <div style="text-align:center;width:80px;">
  391. <input name="id" value="' . $id . '" type="hidden" />
  392. <input name="do" value="vmac" type="hidden" />
  393. <input name="a" value="vmac" type="hidden" />
  394. <input name="modop" value="custom" type="hidden" />
  395. <input name="vmac" type="image" src="images/icons/virtuamac.gif" alt="' . $_LANG['srvVirtualMacForVPS'] . '" title="' . $_LANG['srvVirtualMacForVPS'] . '" value="vmac">
  396. <br />
  397. </div>' . $_LANG['srvVirtualMacForVPS'] . '
  398. </div>
  399. </form>';
  400. $blockedipbtn = ' <form action="clientarea.php?action=productdetails" method="post">
  401. <div style="margin:10px;">
  402. <div style="text-align:center;width:80px;">
  403. <input name="id" value="' . $id . '" type="hidden" />
  404. <input name="do" value="blockedip" type="hidden" />
  405. <input name="a" value="blockedip" type="hidden" />
  406. <input name="modop" value="custom" type="hidden" />
  407. <input name="BlockedIp" type="image" src="images/icons/mx.gif" alt="' . $_LANG['srvBlockedIpAddresses'] . '" title="' . $_LANG['srvBlockedIpAddresses'] . '" value="BlockedIp">
  408. <br />
  409. </div>' . $_LANG['srvBlockedIpAddresses'] . '
  410. </div>
  411. </form>';
  412. $mrtgbtn = ' <form action="clientarea.php?action=productdetails" method="post">
  413. <div style="margin:10px;">
  414. <div style="text-align:center;width:80px;">
  415. <input name="id" value="' . $id . '" type="hidden" />
  416. <input name="do" value="mrtg" type="hidden" />
  417. <input name="a" value="mrtg" type="hidden" />
  418. <input name="modop" value="custom" type="hidden" />
  419. <input name="mrtg" type="image" src="images/icons/kchart.gif" alt="' . $_LANG['srvMrtgGraphs'] . '" title="' . $_LANG['srvMrtgGraphs'] . '" value="mrtg">
  420. <br />
  421. </div>' . $_LANG['srvMrtgGraphs'] . '
  422. </div>
  423. </form>';
  424. $rtmbtn = ' <form action="clientarea.php?action=productdetails" method="post">
  425. <div style="margin:10px;">
  426. <div style="text-align:center;width:80px;">
  427. <input name="id" value="' . $id . '" type="hidden" />
  428. <input name="do" value="rtm" type="hidden" />
  429. <input name="a" value="rtm" type="hidden" />
  430. <input name="modop" value="custom" type="hidden" />
  431. <input name="rtm" type="image" src="images/icons/rtm.gif" alt="' . $_LANG['srvRtm'] . '" title="' . $_LANG['srvRtm'] . '" value="rtm">
  432. <br />
  433. </div>' . $_LANG['srvRtm'] . '
  434. </div>
  435. </form>';
  436. $historybtn = ' <form action="clientarea.php?action=productdetails" method="post">
  437. <div style="margin:10px;">
  438. <div style="text-align:center;width:80px;">
  439. <input name="id" value="' . $id . '" type="hidden" />
  440. <input name="do" value="history" type="hidden" />
  441. <input name="a" value="history" type="hidden" />
  442. <input name="modop" value="custom" type="hidden" />
  443. <input name="history" type="image" src="images/icons/summary.gif" alt="' . $_LANG['srvHistory'] . '" title="' . $_LANG['srvHistory'] . '" value="history">
  444. <br />
  445. </div>' . $_LANG['srvHistory'] . '
  446. </div>
  447. </form>';
  448. $btnallow = explode( ',', $ClientareaButtons );
  449.  
  450. if (empty( $_POST['do'] )) {
  451. $code = '';
  452.  
  453. if ($ClientareaSummary == 'on') {
  454. $soap = new SoapClient( 'https://www.ovh.com/soapi/soapi-re-1.24.wsdl' );
  455. $session = $soap->login( '' . $nic, '' . $nicpassword, 'en', false );
  456. $resultinfo = $soap->dedicatedInfo( $session, $serveur );
  457. $resultrev = $soap->dedicatedReverseList( $session, $serveur );
  458. $resultnetboot = $soap->dedicatedNetbootInfo( $session, $serveur );
  459.  
  460. if ($resultnetboot->kernel == 'hd') {
  461. $netboot = $_LANG['srvHd'];
  462. $netboot1 = $_LANG['srvDesabled'];
  463. } else {
  464. $netboot = $resultnetboot->kernel;
  465. $netboot1 = $_LANG['srvEnabled'];
  466. }
  467.  
  468. $Quota = $resultinfo->traffic->monthlyQuota;
  469.  
  470. if (empty( $Quota )) {
  471. $Quota = $_LANG['srvUnlimited'];
  472. }
  473.  
  474. if ($resultinfo->network->connexion == 100000) {
  475. $conex = '100 Mbps';
  476. } else {
  477. if ($resultinfo->network->connexion == 1000000) {
  478. $conex = '1 Gbps';
  479. } else {
  480. if ($resultinfo->network->connexion == 10000000) {
  481. $conex = '10 Gbps';
  482. } else {
  483. $conex = $resultinfo->network->connexion . ' Kbps';
  484. }
  485. }
  486. }
  487.  
  488.  
  489. if ($resultinfo->network->bandwidthOvhToOvh == 100000) {
  490. $htoh = '100 Mbps';
  491. } else {
  492. if ($resultinfo->network->bandwidthOvhToOvh == 200000) {
  493. $htoh = '200 Mbps';
  494. } else {
  495. if ($resultinfo->network->bandwidthOvhToOvh == 1000000) {
  496. $htoh = '1 Gbps';
  497. } else {
  498. $htoh = $resultinfo->network->bandwidthOvhToOvh . ' Kbps';
  499. }
  500. }
  501. }
  502.  
  503.  
  504. if ($resultinfo->network->bandwidthOvhToInternet == 100000) {
  505. $htoi = '100 Mbps';
  506. } else {
  507. if ($resultinfo->network->bandwidthOvhToInternet == 200000) {
  508. $htoi = '200 Mbps';
  509. } else {
  510. if ($resultinfo->network->bandwidthOvhToInternet == 10000000) {
  511. $htoi = '1 Gbps';
  512. } else {
  513. $htoi = $resultinfo->network->bandwidthOvhToInternet . ' Kbps';
  514. }
  515. }
  516. }
  517.  
  518.  
  519. if ($resultinfo->network->bandwidthInternetToOvh == 100000) {
  520. $itoh = '100 Mbps';
  521. } else {
  522. if ($resultinfo->network->bandwidthInternetToOvh == 1000000) {
  523. $itoh = '1 Gbps';
  524. } else {
  525. $itoh = $resultinfo->network->bandwidthInternetToOvh . ' Kbps';
  526. }
  527. }
  528.  
  529. $i = 59;
  530.  
  531. while ($resultinfo->network->interfaces[$i]) {
  532. if ($i == 0) {
  533. $Switch = $resultinfo->network->interfaces[$i]->switch;
  534. $Mac = $resultinfo->network->interfaces[$i]->mac;
  535. $IP = $resultinfo->network->interfaces[$i]->ip;
  536. $Reverse = $resultinfo->network->interfaces[$i]->reverse;
  537.  
  538. if (( $WhiteLabel == 'on' && preg_match( '' . '/^[a-zA-Z0-9\-\_\.]+(ovh|kimsufi)\.[a-zA-Z]{2,4}$/', '' . $Reverse ) )) {
  539. $Reverse = $_LANG['srvIpFailOverRedefineReverse'];
  540. }
  541.  
  542. $IPV6 = $resultinfo->network->interfaces[$i]->ipv6;
  543. }
  544.  
  545. ++$i;
  546. $nb = $i - 1;
  547. }
  548. .........................
  549. ................
  550. ....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement