Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function server_domains() {
- require_once(get_home_path() . "phpseclib/Net/SFTP.php");
- $ip = $_POST['ip'];
- $current_server = get_user_server_by_ip($ip);
- $ssh = gotr_ssh_connect($current_server);
- $sftp = new Net_SFTP($ip);
- for ($i = 0; $i < count($current_server); $i ++) {
- $current_server[$i] = trim($current_server[$i]);
- }
- if (!$sftp->login($current_server[1], $current_server[2])) {
- exit('Login Failed');
- }
- $virtualhost = $sftp->get('virtualhost.txt');
- $virtualhost = preg_split("#\n\s*\n#Uis", $virtualhost);
- $j = 0; $virtualhost_not_cold = array();
- for ($i = 0; $i < count($virtualhost); $i++) {
- if (stripos($virtualhost[$i], "cold=") === false) {
- $virtualhost_not_cold[$j] = $virtualhost[$i];
- $j++;
- }
- }
- echo "<pre>";
- var_dump(stripos($virtualhost[1], "cold="));
- echo '----------------------<br>';
- var_dump($virtualhost[1]);
- echo "</pre>";
- echo $j;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement