Example #1
0
   }
    * 
    */
/* END PRIMARY DOMAIN */
/* START ADDITIONAL DOMAINS */
foreach ($backup->getAdditionalDomains(TRUE) as $extradomain) {
    echo "/opt/psa/bin/site -c {$extradomain} -hosting true -hst_type phys -webspace-name {$domain} -www-root domains/{$extradomain} -seo-redirect none\n";
    echo "/usr/bin/find " . $backup->getPath() . "/domains/" . $extradomain . "/ -type f -print | xargs -I {} sed -i \"s@/home/" . $username . "/domains/" . $extradomain . "/public_html@/var/www/vhosts/" . $domain . "/domains/" . $extradomain . "@g\" {}\n";
    echo "/usr/bin/find " . $backup->getPath() . "/domains/" . $extradomain . "/ -type f -print | grep configuration.php | xargs -I {} sed -i \"s@ftp_enable = '1'@ftp_enable = '0'@g\" {}\n";
    echo "mkdir " . $backup->getPath() . "/domains/" . $extradomain . "/public_html/webmail/\n";
    echo "echo \"Redirect 301 /webmail http://webmail." . $extradomain . "/\" > " . $backup->getPath() . "/domains/" . $extradomain . "/public_html/webmail/.htaccess\n";
    echo "cd " . $backup->getPath() . "/domains/" . $extradomain . "/public_html && /usr/bin/lftp -c 'set ftp:ssl-allow false && open ftp://{$username}:\"{$password}\"@localhost && cd domains/{$extradomain} && mirror --no-symlinks -p -R .'\n";
    foreach ($backup->getSubdomains($extradomain) as $sub) {
        echo "/opt/psa/bin/subdomain -c {$sub} -domain {$extradomain} -www-root /domains/{$extradomain}/{$sub} -php true\n";
    }
    foreach ($dns->getDNSChanges($backup->getPath() . "/backup/" . $extradomain . "/" . $extradomain . ".db", $ip) as $dnschange) {
        echo $dnschange . "\n";
    }
}
/* END ADDITIONAL DOMAINS */
foreach ($backup->getAdditionalDomains(FALSE) as $extradomain) {
    foreach ($backup->getProtectedDirectories($extradomain) as $dir) {
        echo "/opt/psa/bin/protdir -c " . $dir["path"] . " -domain " . $extradomain . " -title \"" . $dir["name"] . "\" -type wwwroot\n";
        foreach ($dir["list"] as $account) {
            echo "/opt/psa/bin/protdir -u " . $dir["path"] . " -domain " . $extradomain . " -add_user \"" . $account["user"] . "\" -passwd_type encrypted -passwd '" . $account["pass"] . "'\n";
        }
        // Function changed. We previously removed the .htaccess here.
        // We now only remove the Auth lines because Plesk does this in Apache config, where DA does this in .htaccess.
        if ($backup->getDomain(FALSE) == $extradomain) {
            echo "sed -i \"/^Auth/d\" /var/www/vhosts/" . $extradomain . "/httpdocs/" . $dir["path"] . "/.htaccess\n";
            #          echo "rm -v /var/www/vhosts/" . $extradomain . "/httpdocs/" . $dir["path"] . "/.htaccess\n";