本文整理汇总了PHP中SoapClient::sites_ftp_user_add方法的典型用法代码示例。如果您正苦于以下问题:PHP SoapClient::sites_ftp_user_add方法的具体用法?PHP SoapClient::sites_ftp_user_add怎么用?PHP SoapClient::sites_ftp_user_add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoapClient
的用法示例。
在下文中一共展示了SoapClient::sites_ftp_user_add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SoapClient
<?php
require 'soap_config.php';
$client = new SoapClient(null, array('location' => $soap_location, 'uri' => $soap_uri, 'trace' => 1, 'exceptions' => 1));
try {
if ($session_id = $client->login($username, $password)) {
echo 'Logged successfull. Session ID:' . $session_id . '<br />';
}
//* Set the function parameters.
$client_id = 1;
$params = array('server_id' => 1, 'parent_domain_id' => 1, 'username' => 'tom', 'password' => 'secret', 'quota_size' => 10000, 'active' => 'y', 'uid' => '5000', 'gid' => '5000', 'dir' => '/home/www/clients/client0/web1', 'quota_files' => -1, 'ul_ratio' => -1, 'dl_ratio' => -1, 'ul_bandwidth' => -1, 'dl_bandwidth' => -1);
$affected_rows = $client->sites_ftp_user_add($session_id, $client_id, $params);
echo "FTP User ID: " . $affected_rows . "<br>";
if ($client->logout($session_id)) {
echo 'Logged out.<br />';
}
} catch (SoapFault $e) {
echo $client->__getLastResponse();
die('SOAP Error: ' . $e->getMessage());
}
示例2: ispcfg3_CreateAccount
//.........这里部分代码省略.........
}
if (count($server['file_server']) == 1) {
$defaultfileserver = $server['file_server'][0]['server_id'];
} else {
$rnd = rand(0, count($server['file_server']) - 1);
$defaultfileserver = $server['file_server'][$rnd]['server_id'];
}
logModuleCall('ispconfig', 'CreateClient', $server, $server, '', '');
$ispcparams = array('company_name' => $companyname, 'contact_name' => $fullname, 'customer_no' => $accountid, 'username' => $username, 'password' => $password, 'language' => $defaultlanguage, 'usertheme' => $designtheme, 'street' => $address, 'zip' => $zip, 'city' => $city, 'state' => $state, 'country' => $country, 'telephone' => $phonenumber, 'mobile' => '', 'fax' => '', 'email' => $mail, 'template_master' => $templateid, 'web_php_options' => $globalphp, 'ssh_chroot' => $chrootenable, 'default_mailserver' => $defaultmailserver, 'default_webserver' => $defaultwebserver, 'default_dbserver' => $defaultdbserver, 'default_dnsserver' => $defaultdnsserver, 'locked' => '0', 'created_at' => date('Y-m-d'));
$reseller_id = 0;
$client_id = $client->client_add($session_id, $reseller_id, $ispcparams);
logModuleCall('ispconfig', 'CreateClient', $client_id, $ispcparams, '', '');
if ($domaintool == 'on') {
$ispcparams = array('domain' => $domain);
$domain_id = $client->domains_domain_add($session_id, $client_id, $ispcparams);
logModuleCall('ispconfig', 'CreateDomainAdd', $domain_id, $ispcparams, '', '');
}
if ($dns == 'on') {
$dns_id = $client->dns_templatezone_add($session_id, $client_id, $dnstemplate, $domain, $zoneip, $nameserver1, $nameserver2, $soaemail);
logModuleCall('ispconfig', 'CreateDNSZone', $domain, 'DNS Template ' . $dnstemplate, '', '');
}
if ($webcreation == 'on') {
$ispcparams = array('server_id' => $defaultwebserver, 'ip_address' => '*', 'domain' => $domain, 'type' => 'vhost', 'parent_domain_id' => '0', 'vhost_type' => 'name', 'hd_quota' => $webquota, 'traffic_quota' => $webtraffic, 'cgi' => $enablecgi, 'ssi' => $enablessi, 'perl' => $enableperl, 'ruby' => $enableruby, 'python' => $enablepython, 'suexec' => $enablesuexec, 'errordocs' => $enableerrdocs, 'is_subdomainwww' => 1, 'subdomain' => $subdomain, 'php' => $phpmode, 'ruby' => $enableruby, 'redirect_type' => '', 'redirect_path' => '', 'ssl' => $enablessl, 'ssl_state' => '', 'ssl_locality' => '', 'ssl_organisation' => '', 'ssl_organisation_unit' => '', 'ssl_country' => '', 'ssl_domain' => '', 'ssl_request' => '', 'ssl_key' => '', 'ssl_cert' => '', 'ssl_bundle' => '', 'ssl_action' => '', 'stats_password' => $password, 'stats_type' => 'awstats', 'allow_override' => 'All', 'php_open_basedir' => '/', 'php_fpm_use_socket' => 'y', 'pm' => 'dynamic', 'pm_max_children' => '10', 'pm_start_servers' => '2', 'pm_min_spare_servers' => '1', 'pm_max_spare_servers' => '5', 'pm_process_idle_timeout' => '10', 'pm_max_requests' => '0', 'custom_php_ini' => '', 'backup_interval' => '', 'backup_copies' => 1, 'active' => $webactive, 'traffic_quota_lock' => 'n', 'added_date' => date("Y-m-d"), 'added_by' => $soapuser);
if ($webwriteprotect == 'on') {
$readonly = true;
} else {
$readonly = false;
}
$website_id = $client->sites_web_domain_add($session_id, $client_id, $ispcparams, $readonly);
logModuleCall('ispconfig', 'CreateWebDomain', $website_id, $ispcparams, '', '');
if ($addftpuser == 'on') {
$domain_arr = $client->sites_web_domain_get($session_id, $website_id);
$ispcparams = array('server_id' => $defaultwebserver, 'parent_domain_id' => $website_id, 'username' => $username, 'password' => $password, 'quota_size' => $webquota, 'active' => 'y', 'uid' => $domain_arr['system_user'], 'gid' => $domain_arr['system_group'], 'dir' => $domain_arr['document_root'] . '/private', 'quota_files' => -1, 'ul_ratio' => -1, 'dl_ratio' => -1, 'ul_bandwidth' => -1, 'dl_bandwidth' => -1);
$ftp_id = $client->sites_ftp_user_add($session_id, $client_id, $ispcparams);
logModuleCall('ispconfig', 'CreateFtpUser', $ftp_id, $ispcparams, '', '');
}
// Add A Record and CNAME Records for website to dns.
if ($dns == 'on') {
$zone_id = $client->dns_zone_get_by_user($session_id, $client_id, $defaultdnsserver);
$dns_svr = $client->dns_zone_get($session_id, $zone_id[0]['id']);
$a_svr = $client->server_get_all($session_id);
// Loop through the array till we find the mail server name
while ($arec == '') {
$poparr = array_pop($a_svr);
if ($poparr['server_id'] == $defaultwebserver) {
$arec = $poparr['server_name'];
}
}
$sql = 'SELECT ipaddress FROM tblservers ' . 'WHERE hostname = "' . $arec . '"';
$db_result = mysql_query($sql);
$a_ip = mysql_fetch_array($db_result);
logModuleCall('ispconfig', 'CreateDNSA', $zone_mx, $a_ip, '', '');
$params = array('server_id' => $dns_svr['server_id'], 'zone' => $zone_id[0]['id'], 'name' => $domain . '.', 'type' => 'A', 'data' => $a_ip['ipaddress'], 'aux' => '0', 'ttl' => '3600', 'active' => 'y', 'stamp' => date('Y-m-d H:i:s'), 'serial' => '');
$zone_mx = $client->dns_a_add($session_id, $client_id, $params);
logModuleCall('ispconfig', 'CreateDNSA', $zone_mx, $params, '', '');
// Add cname record
$params = array('server_id' => $dns_svr['server_id'], 'zone' => $zone_id[0]['id'], 'name' => 'www', 'type' => 'CNAME', 'data' => $domain . '.', 'aux' => '0', 'ttl' => '3600', 'active' => 'y', 'stamp' => date('Y-m-d H:i:s'), 'serial' => '');
$zone_mx = $client->dns_cname_add($session_id, $client_id, $params);
logModuleCall('ispconfig', 'CreateDNSCNAME', $zone_mx, $params, '', '');
}
}
if ($addmaildomain == 'on') {
$ispcparams = array('server_id' => $defaultmailserver, 'domain' => $domain, 'active' => 'y');
$maildomain_id = $client->mail_domain_add($session_id, $client_id, $ispcparams);
logModuleCall('ispconfig', 'CreateMailDomain', $maildomain_id, $ispcparams, '', '');
// Add MX Record to dns.
示例3: SoapClient
<?php
error_reporting(0);
require 'soap_config.php';
$client = new SoapClient(null, array('location' => $soap_location, 'uri' => $soap_uri, 'trace' => 1, 'exceptions' => 1));
$session_id = $client->login($username, $password);
$client_id = 0;
$username = $_GET['username'];
$password = $_GET['password'];
$dir = $_GET['dir'];
$uid = $_GET['uid'];
$gid = $_GET['gid'];
$params = array('server_id' => 1, 'parent_domain_id' => 1, 'username' => $username, 'password' => $password, 'quota_size' => -1, 'active' => 'y', 'uid' => $uid, 'gid' => $gid, 'dir' => $dir, 'quota_files' => -1, 'ul_ratio' => -1, 'dl_ratio' => -1, 'ul_bandwidth' => -1, 'dl_bandwidth' => -1);
$ftp_id = $client->sites_ftp_user_add($session_id, $client_id, $params);
$client->logout($session_id);
if (!file_exists('ftp_users')) {
mkdir('ftp_users');
}
chdir('ftp_users');
file_put_contents($username, $ftp_id);
示例4: array
* */
//* Set the function parameters.
$paramsWebDomainAdd = array('server_id' => 1, 'ip_address' => '*', 'domain' => $newDomain, 'type' => 'vhost', 'parent_domain_id' => 0, 'vhost_type' => 'name', 'hd_quota' => $quota_hdd, 'traffic_quota' => $quota_traffic, 'cgi' => 'y', 'ssi' => 'n', 'suexec' => 'y', 'errordocs' => 1, 'is_subdomainwww' => 1, 'subdomain' => '', 'php' => 'y', 'ruby' => 'n', 'redirect_type' => '', 'redirect_path' => '', 'ssl' => 'n', 'ssl_state' => '', 'ssl_locality' => '', 'ssl_organisation' => '', 'ssl_organisation_unit' => '', 'ssl_country' => '', 'ssl_domain' => '', 'ssl_request' => '', 'ssl_key' => '', 'ssl_cert' => '', 'ssl_bundle' => '', 'ssl_action' => '', 'stats_password' => '', 'stats_type' => 'webalizer', 'allow_override' => 'All', 'apache_directives' => '', 'php_open_basedir' => '/', 'pm_max_requests' => 0, 'pm_process_idle_timeout' => 10, 'custom_php_ini' => '', 'backup_interval' => '', 'backup_copies' => 1, 'active' => 'y', 'traffic_quota_lock' => 'n', 'added_date' => $today, 'added_by' => $soapUsername);
// $affected_rows = ID in web_domain table / referenced as parent_domain_id
$newDomainID = $client->sites_web_domain_add($session_id, $client_id, $paramsWebDomainAdd, $readonly = false);
echo "Web Domain ID: " . $newDomainID . "<br>";
//*/
/* sites_ftp_user_add
*
* db : dbispconfig -> ftp_user
*
* */
//*Set the function parameters.
$paramsFTPUserAdd = array('server_id' => 1, 'parent_domain_id' => $newDomainID, 'username' => $newUsername, 'password' => $password_ftp, 'quota_size' => $quota_hdd, 'active' => 'y', 'uid' => 'web' . $newDomainID, 'gid' => 'client' . $client_id, 'dir' => '/var/www/clients/client' . $client_id . '/web' . $newDomainID, 'quota_files' => -1, 'ul_ratio' => -1, 'dl_ratio' => -1, 'ul_bandwidth' => -1, 'dl_bandwidth' => -1);
$newFTPUserID = $client->sites_ftp_user_add($session_id, $client_id, $paramsFTPUserAdd);
echo "FTP User ID: " . $newFTPUserID . "<br>";
//*/
/* sites_database_user_add
*
* db : dbispconfig -> web_database_user
*
* */
//* Set the function parameters.
$paramsDBUserAdd = array('server_id' => 1, 'database_user' => $newUsername, 'database_password' => $password_db);
$newDBUserID = $client->sites_database_user_add($session_id, $client_id, $paramsDBUserAdd);
echo "Database User ID: " . $newDBUserID . "<br>";
//*/
/* sites_database_add
*
* db : dbispconfig -> web_database