コード例 #1
0
ファイル: import_plesk.php プロジェクト: shoaibali/ispconfig3
     add_command('chattr -i ' . escapeshellarg($path));
     add_command('if [[ -f ' . $path . '/web/index.html ]] ; then rm ' . $path . '/web/index.html ; fi');
     add_command('rsync -av --modify-window 10 --progress -e ssh root@${MYSERVER}:' . $hosting['www_root'] . '/ ' . $path . '/web/');
     add_command('chown -R ' . $cmd_data['system_user'] . ':' . $cmd_data['system_group'] . ' ' . escapeshellarg($path));
     add_command('grep ' . escapeshellarg($hosting['www_root']) . ' ' . $path . '/web -r -l | xargs replace ' . escapeshellarg($hosting['www_root']) . ' ' . escapeshellarg($path . '/web') . ' --');
     add_command('chown -R root:root ' . escapeshellarg($path . '/log') . ' ' . escapeshellarg($path . '/ssl') . ' ' . escapeshellarg($path . '/web/stats'));
     add_command('chattr +i ' . escapeshellarg($path));
 }
 // add domain to mail domains too
 $params = array('server_id' => $server_id, 'domain' => $entry['name'], 'active' => yes_no($entry['status'] == 0 ? 1 : 0));
 $old_domain = $app->db->queryOneRecord("SELECT * FROM mail_domain WHERE domain = '" . $entry['name'] . "'");
 if ($old_domain) {
     $new_id = $old_domain['domain_id'];
     $params = array_merge($old_domain, $params);
     $msg .= "Found maildomain with id " . $new_id . ", updating it.<br />";
     $ok = $importer->mail_domain_update($session_id, $plesk_ispc_ids[$entry['cl_id']], $new_id, $params);
     if ($ok === false) {
         $msg .= "&nbsp; Error: " . $importer->getFault() . "<br />";
     }
 } else {
     $msg .= "Inserting new maildomain " . $entry['name'] . ".<br />";
     $new_id = $importer->mail_domain_add($session_id, $plesk_ispc_ids[$entry['cl_id']], $params);
 }
 $maildomain_ids[$entry['id']] = $new_id;
 if ($new_id === false) {
     //something went wrong here...
     $msg .= "Maildomain (" . $entry['name'] . ") could not be inserted.<br />";
     $msg .= "&nbsp; Error: " . $importer->getFault() . "<br />";
 } else {
     $msg .= "Maildomain " . $new_id . " (" . $entry['name'] . ") inserted.<br />";
 }