Commit 3f8c72ef authored by Till Brehm's avatar Till Brehm

Merge branch 'patch-1' into 'master'

Various minor code cleanups

See merge request ispconfig/ispconfig3!820
parents 50ea5b3d bf7714a5
......@@ -14,7 +14,7 @@ smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_restriction_classes = greylisting
greylisting = check_policy_service inet:127.0.0.1:10023
greylisting = check_policy_service inet:127.0.0.1:10023
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination{rbl_list}, check_recipient_access mysql:{config_dir}/mysql-virtual_recipient.cf{greylisting}
smtpd_use_tls = yes
smtpd_tls_security_level = may
......
......@@ -219,8 +219,8 @@ class remoting_mail extends remoting {
if (!isset($params['gid'])) $params['gid'] = -1;
if (!isset($params['maildir_format'])) $params['maildir_format'] = 'maildir';
$affected_rows = $this->insertQuery('../mail/form/mail_user.tform.php', $client_id, $params);
return $affected_rows;
$mailuser_id = $this->insertQuery('../mail/form/mail_user.tform.php', $client_id, $params);
return $mailuser_id;
}
//* Update mail user
......
......@@ -42,9 +42,9 @@ try {
'disablesmtp' => 'n'
);
$affected_rows = $client->mail_user_add($session_id, $client_id, $params);
$mailuser_id = $client->mail_user_add($session_id, $client_id, $params);
echo "New user: ".$affected_rows."<br>";
echo "New user: ".$mailuser_id."<br>";
if($client->logout($session_id)) {
echo 'Logged out.<br />';
......
<?php
$username = 'admin';
$password = 'admin';
$soap_location = 'http://localhost:8080/remote/index.php';
$soap_uri = 'http://localhost:8080/remote/';
$client = new SoapClient(null, array('location' => $soap_location,
'uri' => $soap_uri));
try {
if($session_id = $client->login($username, $password)) {
echo "Logged:".$session_id."<br />\n";
}
$database_type = 'mysql'; //Only mysql type avaliable more types coming soon.
$database_name = 'yourdbname';
$database_username = 'yourusername';
$database_password = 'yourpassword';
$database_charset = ''; // blank = db default, latin1 or utf8
$database_remoteips = ''; //remote ip´s separated by commas
$params = array(
'server_id' => 1,
'type' => $database_type,
'database_name' => $database_name,
'database_user' => $database_username,
'database_password' => $database_password,
'database_charset' => $database_charset,
'remote_access' => 'n', // n disabled - y enabled
'active' => 'y', // n disabled - y enabled
'remote_ips' => $database_remoteips
);
$client_id = 1;
$database_id = $client->sites_database_add($session_id, $client_id, $params);
if($client->logout($session_id)) {
echo "Logout.<br />\n";
}
} catch (SoapFault $e) {
die('Error: '.$e->getMessage());
}
?>
......@@ -3,12 +3,12 @@
- Remote API example files
--------------------------------------------------------
The examples folder contains a example script for every
Remote api function. The login details and URL for the
The examples folder contains an example script for every
remote api function. The login details and URL for the
remote connection are defined in the file soap_config.php
--------------------------------------------------------
- Remote API documentation
--------------------------------------------------------
The startpage of the API documentation is main.html
The startpage of the API documentation is API-docs/index.html
......@@ -37,7 +37,7 @@ if (is_file($conf['temppath'] . $conf['fs_div'] . '.ispconfig_cron_lock')) {
$pid = trim(file_get_contents($conf['temppath'] . $conf['fs_div'] . '.ispconfig_cron_lock'));
if(preg_match('/^[0-9]+$/', $pid)) {
if(file_exists('/proc/' . $pid)) {
if($conf['log_priority'] <= LOGLEVEL_WARN) print @date('d.m.Y-H:i').' - WARNING - There is already an instance of server.php running with pid ' . $pid . '.' . "\n";
if($conf['log_priority'] <= LOGLEVEL_WARN) print @date('d.m.Y-H:i').' - WARNING - There is already an instance of cron.php running with pid ' . $pid . '.' . "\n";
exit;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment