Advertisement
Guest User

index

a guest
Apr 15th, 2015
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.76 KB | None | 0 0
  1. <?php
  2. error_reporting(NULL);
  3. ob_start();
  4. session_start();
  5. $TAB = 'WordPress Installer';
  6.  
  7.   include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  8.  
  9.  
  10.   if(isset($_POST['ok']) && empty($_SESSION['error_msg'])):
  11.        
  12.     if(empty($_POST['cdn_install_dir'])) :
  13.       $_SESSION['error_msg'] .= "You must enter an Install Directory. <br>";
  14.     endif;
  15.    
  16.     if(substr($_POST['cdn_install_dir'],0, 1) != "/") :
  17.       $_SESSION['error_msg'] .= "Install Directory must start with /. <br>";
  18.     endif;
  19.    
  20.     if(empty($_POST['cdn_domain'])) :
  21.       $_SESSION['error_msg'] .= "Please select a Domain. <br>";
  22.     endif;
  23.    
  24.     if (empty($_POST['cdn_admin_email']) || (!filter_var($_POST['cdn_admin_email'], FILTER_VALIDATE_EMAIL))):
  25.         $_SESSION['error_msg'] .= "Please enter a valid Email Address. <br>";
  26.     endif;
  27.    
  28.     if(empty($_POST['cdn_admin_user'])) :
  29.       $_SESSION['error_msg'] .= "Please enter an Admin Username. <br>";
  30.     endif;
  31.    
  32.     if(empty($_POST['cdn_protocol'])) :
  33.       $_SESSION['error_msg'] .= "Please select a Protocol. <br>";
  34.     endif;
  35.  
  36.     if(empty($_POST['cdn_site_name'])) :
  37.       $_SESSION['error_msg'] .= "Please enter a Site Name. <br>";
  38.     endif;
  39.  
  40.     if(empty($_POST['cdn_admin_pass'])) :
  41.       $_SESSION['error_msg'] .= "Please enter an Admin Password.";
  42.     endif;
  43.  
  44.     if(empty($_SESSION['error_msg'])):
  45.    
  46.     $cdn_protocol  = escapeshellarg($_POST['cdn_protocol']);
  47.     $cdn_domain  = escapeshellarg($_POST['cdn_domain']);
  48.     $cdn_install_dir = escapeshellarg($_POST['cdn_install_dir']);
  49.     $cdn_site_name = escapeshellarg($_POST['cdn_site_name']);
  50.     $cdn_admin_user = escapeshellarg($_POST['cdn_admin_user']);
  51.     $cdn_admin_email = escapeshellarg($_POST['cdn_admin_email']);
  52.     $cdn_admin_pass = escapeshellarg($_POST['cdn_admin_pass']);
  53.  
  54.         exec (VESTA_CMD."v-wp-installer $user $cdn_install_dir $cdn_domain $cdn_protocol $cdn_site_name $cdn_admin_user $cdn_admin_email $cdn_admin_pass", $output, $return_var);
  55.         check_return_code($return_var,$output);
  56.        
  57.          if ( $return_var == 0 ) {
  58.              foreach($output as $out => $out_value) {
  59.               $_SESSION['ok_msg'] .= $out_value;
  60.             }
  61.          }
  62.          
  63.         unset($output);
  64.        
  65.      endif;
  66.      
  67.   endif;
  68.  
  69.   exec (VESTA_CMD."v-list-web-domains $user json", $output, $return_var);
  70.   $domain = json_decode(implode('', $output), true);
  71.   $domain = array_reverse($domain,true);
  72.   unset($output);
  73.  
  74.  
  75. include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
  76.  
  77. top_panel($user,$TAB);
  78.  
  79. include($_SERVER['DOCUMENT_ROOT'].'/wp-installer/templates/dashboard.html');
  80.  
  81. unset($_SESSION['error_msg']);
  82. unset($_SESSION['ok_msg']);
  83.  
  84. include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement