miksco

index_qnap_ts-212.php

Jan 31st, 2026
12,854
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.11 KB | None | 0 0
  1. <?php
  2. function isMyCloudNAS()
  3. {
  4.     if (isset($_SERVER['HTTP_HOST']) && strlen($_SERVER['HTTP_HOST']) > 0)
  5.         $_http_host = $_SERVER['HTTP_HOST'];
  6.     else
  7.         return false;
  8.     $mycloudnas_domains = Array(
  9.         'mycloudnas.com',
  10.         'myqnapnas.com',
  11.         'qcloudnas.com',
  12.         'myqnapcloud.com'
  13.     );
  14.     foreach ($mycloudnas_domains as $d)
  15.     {
  16.         if (strncasecmp(stristr($_http_host,$d),$d,strlen($d))==0)
  17.         {
  18.             return true;
  19.         }
  20.     }
  21.     return false;
  22. }
  23.     if(isMyCloudNAS() == true){
  24.         $extPort = exec('/sbin/getcfg System ExtPort -d 0');
  25.         if(intval($extPort)>0)
  26.             $webAccessPort = $extPort;
  27.         else
  28.             $webAccessPort = exec('/sbin/getcfg System "Web Access Port" -d 8080');
  29.     }
  30.     else
  31.         $webAccessPort = exec('/sbin/getcfg System "Web Access Port" -d 8080');
  32.     $webAccessUrl = 'http://'.$_SERVER['SERVER_NAME'].':'.$webAccessPort.'/';
  33. ?>
  34. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  35. <html xmlns="http://www.w3.org/1999/xhtml">
  36.     <head>
  37. <meta http-equiv="expires" content="0">
  38. <script type='text/javascript'>
  39.     location.href = '<?=$webAccessUrl?>';
  40. </script>
  41.     </head>
  42. </html>
Advertisement
Comments
  • User was banned
  • User was banned
Add Comment
Please, Sign In to add comment