Advertisement
rbarom

Untitled

Oct 20th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.01 KB | None | 0 0
  1. function server_domains() {
  2.  
  3.     require_once(get_home_path() . "phpseclib/Net/SFTP.php");
  4.  
  5.     $ip = $_POST['ip'];
  6.     $current_server = get_user_server_by_ip($ip);
  7.     $ssh = gotr_ssh_connect($current_server);
  8.     $sftp = new Net_SFTP($ip);
  9.  
  10.     for ($i = 0; $i < count($current_server); $i ++) {
  11.         $current_server[$i] = trim($current_server[$i]);
  12.     }
  13.  
  14.     if (!$sftp->login($current_server[1], $current_server[2])) {
  15.         exit('Login Failed');
  16.     }
  17.  
  18.     $virtualhost = $sftp->get('virtualhost.txt');
  19.     $virtualhost = preg_split("#\n\s*\n#Uis", $virtualhost);
  20.  
  21.     $j = 0; $virtualhost_not_cold = array();
  22.     for ($i = 0; $i < count($virtualhost); $i++) {
  23.  
  24.         if (stripos($virtualhost[$i], "cold=") === false) {
  25.  
  26.             $virtualhost_not_cold[$j] = $virtualhost[$i];
  27.             $j++;
  28.         }
  29.     }
  30.  
  31.     echo "<pre>";
  32.     var_dump(stripos($virtualhost[1], "cold="));
  33.     echo '----------------------<br>';
  34.     var_dump($virtualhost[1]);
  35.     echo "</pre>";
  36.     echo $j;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement