예제 #1
0
                 $msg .= $entry['login'] . ' existed, updating id ' . $old_client['client_id'] . '<br />';
             }
         } else {
             $msg .= $entry['login'] . ' existed, updating id ' . $old_client['client_id'] . '<br />';
         }
     }
     $params = array('company_name' => $entry['cname'], 'contact_name' => $entry['pname'], 'customer_no' => 'Plesk' . $entry['id'], 'username' => $entry['login'], 'password' => $entry['password'], 'language' => substr($entry['locale'], 0, 2), 'street' => $entry['address'], 'zip' => $entry['pcode'], 'city' => $entry['city'], 'state' => $entry['state'], 'country' => $entry['country'], 'telephone' => $entry['phone'], 'fax' => $entry['fax'], 'email' => $entry['email'], 'notes' => 'imported from Plesk id ' . $entry['id'], 'limit_maildomain' => get_limit($limits, $entry['id'], 'max_site', -1), 'limit_mailbox' => get_limit($limits, $entry['id'], 'max_box', -1), 'limit_mailalias' => get_limit($limits, $entry['id'], 'max_mn', -1), 'limit_mailaliasdomain' => get_limit($limits, $entry['id'], 'max_dom_aliases', -1), 'limit_mailmailinglist' => get_limit($limits, $entry['id'], 'max_maillists', -1), 'limit_mailforward' => get_limit($limits, $entry['id'], 'max_mn', -1), 'limit_mailcatchall' => 1, 'limit_mailrouting' => 0, 'limit_mailfilter' => 0, 'limit_fetchmail' => 0, 'limit_mailquota' => get_limit($limits, $entry['id'], 'mbox_quota', -1), 'limit_spamfilter_wblist' => 0, 'limit_spamfilter_user' => 0, 'limit_spamfilter_policy' => 0, 'limit_web_domain' => get_limit($limits, $entry['id'], 'max_site', -1), 'limit_web_quota' => intval(get_limit($limits, $entry['id'], 'disk_space', -1)), 'web_php_options' => implode(',', $phpopts), 'limit_web_aliasdomain' => get_limit($limits, $entry['id'], 'max_dom_aliases', -1), 'limit_web_subdomain' => get_limit($limits, $entry['id'], 'max_subdom', -1), 'limit_ftp_user' => (string) ($app->functions->intval(get_limit($limits, $entry['id'], 'max_subftp_users', -2)) + 1), 'limit_shell_user' => 0, 'ssh_chroot' => 'no,jailkit', 'limit_webdav_user' => get_limit($limits, $entry['id'], 'max_wu', 0), 'limit_dns_zone' => -1, 'limit_dns_slave_zone' => -1, 'limit_dns_record' => -1, 'limit_client' => $entry['type'] == 'client' ? 0 : -1, 'limit_database' => get_limit($limits, $entry['id'], 'max_db', -1), 'limit_cron' => 0, 'limit_cron_type' => 'url', 'limit_cron_frequency' => '5', 'limit_traffic_quota' => intval(get_limit($limits, $entry['id'], 'max_traffic', -1)), 'limit_openvz_vm' => 0, 'limit_openvz_vm_template_id' => '');
     $reseller_id = 0;
     if ($entry['parent_id'] != 0) {
         if (array_key_exists($entry['parent_id'], $plesk_ispc_ids)) {
             $reseller_id = $plesk_ispc_ids[$entry['parent_id']];
         }
     }
     if ($old_client) {
         $new_id = $old_client['client_id'];
         $ok = $importer->client_update($session_id, $old_client['client_id'], $reseller_id, array_merge($old_client, $params));
         if ($ok === false) {
         }
     } else {
         $new_id = $importer->client_add($session_id, $reseller_id, $params);
     }
     if ($new_id === false) {
         //something went wrong here...
         $msg .= "Client " . $entry['id'] . " (" . $entry['pname'] . ") could not be inserted/updated.<br />";
         $msg .= "&nbsp; Error: " . $importer->getFault() . "<br />";
     } else {
         $msg .= "Client " . $entry['id'] . " (" . $entry['pname'] . ") inserted/updated.<br />";
     }
     $plesk_ispc_ids[$entry['id']] = $new_id;
 }
 unset($users);