Commit 738c3d47 authored by Marius Cramer's avatar Marius Cramer

Merge remote-tracking branch 'origin/stable-3.0.5'

Conflicts:
	install/sql/ispconfig3.sql
	install/tpl/config.inc.php.master
	interface/lib/config.inc.php
	interface/web/admin/lib/lang/de_system_config.lng
parents ba5d8315 b34f99da
......@@ -1167,14 +1167,14 @@ class installer_dist extends installer_base {
//exec('chmod +r /var/log/clamav/freshclam.log');
//* Install the update script
if(is_file('/usr/local/bin/ispconfig_update_from_svn.sh')) unlink('/usr/local/bin/ispconfig_update_from_svn.sh');
exec('chown root /usr/local/ispconfig/server/scripts/update_from_svn.sh');
exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_svn.sh');
if(is_file('/usr/local/bin/ispconfig_update_from_dev.sh')) unlink('/usr/local/bin/ispconfig_update_from_dev.sh');
exec('chown root /usr/local/ispconfig/server/scripts/update_from_dev.sh');
exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_dev.sh');
exec('chown root /usr/local/ispconfig/server/scripts/update_from_tgz.sh');
exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_tgz.sh');
exec('chown root /usr/local/ispconfig/server/scripts/ispconfig_update.sh');
exec('chmod 700 /usr/local/ispconfig/server/scripts/ispconfig_update.sh');
if(!is_link('/usr/local/bin/ispconfig_update_from_svn.sh')) exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update_from_svn.sh');
if(!is_link('/usr/local/bin/ispconfig_update_from_dev.sh')) exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update_from_dev.sh');
if(!is_link('/usr/local/bin/ispconfig_update.sh')) exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update.sh');
// set the fast cgi starter script to executable
......
......@@ -1014,19 +1014,19 @@ class installer extends installer_base
}
//* Install the update script
if (is_file('/usr/local/bin/ispconfig_update_from_svn.sh')) {
unlink('/usr/local/bin/ispconfig_update_from_svn.sh');
if (is_file('/usr/local/bin/ispconfig_update_from_dev.sh')) {
unlink('/usr/local/bin/ispconfig_update_from_dev.sh');
}
chown($install_dir.'/server/scripts/update_from_svn.sh', 'root');
chmod($install_dir.'/server/scripts/update_from_svn.sh', 0700);
chown($install_dir.'/server/scripts/update_from_dev.sh', 'root');
chmod($install_dir.'/server/scripts/update_from_dev.sh', 0700);
chown($install_dir.'/server/scripts/update_from_tgz.sh', 'root');
chmod($install_dir.'/server/scripts/update_from_tgz.sh', 0700);
chown($install_dir.'/server/scripts/ispconfig_update.sh', 'root');
chmod($install_dir.'/server/scripts/ispconfig_update.sh', 0700);
if (!is_link('/usr/local/bin/ispconfig_update_from_svn.sh')) {
symlink($install_dir.'/server/scripts/ispconfig_update.sh', '/usr/local/bin/ispconfig_update_from_svn.sh');
if (!is_link('/usr/local/bin/ispconfig_update_from_dev.sh')) {
symlink($install_dir.'/server/scripts/ispconfig_update.sh', '/usr/local/bin/ispconfig_update_from_dev.sh');
}
if (!is_link('/usr/local/bin/ispconfig_update.sh')) {
......
......@@ -1218,14 +1218,14 @@ class installer_dist extends installer_base {
//exec('chmod +r /var/log/clamav/freshclam.log');
//* Install the update script
if(is_file('/usr/local/bin/ispconfig_update_from_svn.sh')) unlink('/usr/local/bin/ispconfig_update_from_svn.sh');
exec('chown root /usr/local/ispconfig/server/scripts/update_from_svn.sh');
exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_svn.sh');
if(is_file('/usr/local/bin/ispconfig_update_from_dev.sh')) unlink('/usr/local/bin/ispconfig_update_from_dev.sh');
exec('chown root /usr/local/ispconfig/server/scripts/update_from_dev.sh');
exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_dev.sh');
exec('chown root /usr/local/ispconfig/server/scripts/update_from_tgz.sh');
exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_tgz.sh');
exec('chown root /usr/local/ispconfig/server/scripts/ispconfig_update.sh');
exec('chmod 700 /usr/local/ispconfig/server/scripts/ispconfig_update.sh');
if(!is_link('/usr/local/bin/ispconfig_update_from_svn.sh')) exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update_from_svn.sh');
if(!is_link('/usr/local/bin/ispconfig_update_from_dev.sh')) exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update_from_dev.sh');
if(!is_link('/usr/local/bin/ispconfig_update.sh')) exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update.sh');
//set the fast cgi starter script to executable
......
......@@ -692,43 +692,6 @@ function is_installed($appname) {
}
}
/*
* Compare ISPConfig version number.
* return values:
* -1 $current version is newer then $new version (downgrade)
* 0 $current version = $new version
* 1 $current version is older then new version (update)
*/
function compare_ispconfig_version($current, $new) {
if( $current == $new) {
return 0;
}
$p = explode('.', $current);
$tmp = '';
$tmp .= str_pad(intval($p[0]), 3, '0', STR_PAD_LEFT);
$tmp .= (isset($p[1]))?str_pad(intval($p[1]), 3, '0', STR_PAD_LEFT):'000';
$tmp .= (isset($p[2]))?str_pad(intval($p[2]), 3, '0', STR_PAD_LEFT):'000';
$tmp .= (isset($p[3]))?str_pad(intval($p[3]), 3, '0', STR_PAD_LEFT):'000';
$current = $tmp;
$p = explode('.', $new);
$tmp = '';
$tmp .= str_pad(intval($p[0]), 3, '0', STR_PAD_LEFT);
$tmp .= (isset($p[1]))?str_pad(intval($p[1]), 3, '0', STR_PAD_LEFT):'000';
$tmp .= (isset($p[2]))?str_pad(intval($p[2]), 3, '0', STR_PAD_LEFT):'000';
$tmp .= (isset($p[3]))?str_pad(intval($p[3]), 3, '0', STR_PAD_LEFT):'000';
$new = $tmp;
if($new > $current) {
return 1;
} else {
return -1;
}
}
/*
* Get the port number of the ISPConfig controlpanel vhost
*/
......
......@@ -2035,14 +2035,14 @@ class installer_base {
}
//* Install the update script
if(is_file('/usr/local/bin/ispconfig_update_from_svn.sh')) unlink('/usr/local/bin/ispconfig_update_from_svn.sh');
chown($install_dir.'/server/scripts/update_from_svn.sh', 'root');
chmod($install_dir.'/server/scripts/update_from_svn.sh', 0700);
if(is_file('/usr/local/bin/ispconfig_update_from_dev.sh')) unlink('/usr/local/bin/ispconfig_update_from_dev.sh');
chown($install_dir.'/server/scripts/update_from_dev.sh', 'root');
chmod($install_dir.'/server/scripts/update_from_dev.sh', 0700);
chown($install_dir.'/server/scripts/update_from_tgz.sh', 'root');
chmod($install_dir.'/server/scripts/update_from_tgz.sh', 0700);
chown($install_dir.'/server/scripts/ispconfig_update.sh', 'root');
chmod($install_dir.'/server/scripts/ispconfig_update.sh', 0700);
if(!is_link('/usr/local/bin/ispconfig_update_from_svn.sh')) symlink($install_dir.'/server/scripts/ispconfig_update.sh', '/usr/local/bin/ispconfig_update_from_svn.sh');
if(!is_link('/usr/local/bin/ispconfig_update_from_dev.sh')) symlink($install_dir.'/server/scripts/ispconfig_update.sh', '/usr/local/bin/ispconfig_update_from_dev.sh');
if(!is_link('/usr/local/bin/ispconfig_update.sh')) symlink($install_dir.'/server/scripts/ispconfig_update.sh', '/usr/local/bin/ispconfig_update.sh');
//* Make the logs readable for the ispconfig user
......
......@@ -153,8 +153,8 @@ function updateDbAndIni() {
$conf['nginx']['installed'] = false;
}
//* Do incremental DB updates only on installed ISPConfig versions > 3.0.3
if(compare_ispconfig_version('3.0.3', ISPC_APP_VERSION) >= 0) {
//* Do incremental DB updates only on installed ISPConfig versions >= 3.0.3
if(version_compare('3.0.3', ISPC_APP_VERSION, '<=')) {
swriteln($inst->lng('Starting incremental database update.'));
......
......@@ -317,9 +317,9 @@ $form["tabs"]['mail'] = array (
),
'smtp_crypt' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(0 => 'n', 1 => 'y')
'formtype' => 'SELECT',
'default' => '',
'value' => array('' => 'No', 'ssl' => 'SSL', 'tls' => 'STARTTLS')
),
//#################################
// ENDE Datatable fields
......
......@@ -68,4 +68,5 @@ $wb['customer_no_start_txt'] = 'Kundennummer Startwert';
$wb['customer_no_counter_txt'] = 'Kundennummer Zähler';
$wb['session_timeout_txt'] = 'Session-Timeout (Minuten)';
$wb['session_allow_endless_txt'] = '"Eingeloggt bleiben" aktivieren';
$wb['No'] = 'Nein';
?>
......@@ -70,4 +70,5 @@ $wb['customer_no_start_txt'] = 'Customer No. start value';
$wb['customer_no_counter_txt'] = 'Customer No. counter';
$wb['session_timeout_txt'] = 'Session timeout (minutes)';
$wb['session_allow_endless_txt'] = 'Enable "stay logged in"';
$wb['No'] = 'No';
?>
......@@ -80,10 +80,10 @@
<input name="smtp_pass" id="smtp_pass" value="" size="30" maxlength="255" type="password" class="textInput" />
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='smtp_crypt_txt'}</p>
<div class="multiField">
<label for="smtp_crypt">{tmpl_var name='smtp_crypt_txt'}</label>
<select name="smtp_crypt" id="smtp_crypt" class="selectInput formLengthHalf">
{tmpl_var name='smtp_crypt'}
</div>
</select>
</div>
</fieldset>
......
......@@ -52,14 +52,6 @@ $app->load('tform_actions');
$lng_file = 'lib/lang/'.$_SESSION['s']['language'].'.lng';
include $lng_file;
if(!$app->tform->checkClientLimit('limit_domainmodule')) {
$app->uses('ini_parser,getconf');
$settings = $app->getconf->get_global_config('domains');
if ($settings['use_domain_module'] == 'y') {
$app->error($settings['new_domain_html']);
}
}
class page_action extends tform_actions {
......@@ -75,6 +67,16 @@ class page_action extends tform_actions {
function onShowEnd() {
global $app, $conf, $wb;
if($_SESSION["s"]["user"]["typ"] != 'admin' && $this->id == 0) {
if(!$app->tform->checkClientLimit('limit_domainmodule')) {
$app->uses('ini_parser,getconf');
$settings = $app->getconf->get_global_config('domains');
if ($settings['use_domain_module'] == 'y') {
$app->error($settings['new_domain_html']);
}
}
}
if($_SESSION["s"]["user"]["typ"] == 'admin') {
// Getting Clients of the user
......@@ -92,6 +94,28 @@ class page_action extends tform_actions {
}
$app->tpl->setVar("client_group_id", $client_select);
} else {
// Get the limits of the client
$client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
$client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
// Fill the client select field
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name";
//die($sql);
$records = $app->db->queryAllRecords($sql);
$tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$app->functions->intval($client['client_id']));
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['contactname'].'</option>';
//$tmp_data_record = $app->tform->getDataRecord($this->id);
if(is_array($records)) {
$selected_client_group_id = 0; // needed to get list of PHP versions
foreach( $records as $rec) {
if(is_array($this->dataRecord) && ($rec["groupid"] == $this->dataRecord['client_group_id'] || $rec["groupid"] == $this->dataRecord['sys_groupid']) && !$selected_client_group_id) $selected_client_group_id = $rec["groupid"];
$selected = @(is_array($this->dataRecord) && ($rec["groupid"] == $this->dataRecord['client_group_id'] || $rec["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':'';
if($selected == 'SELECTED') $selected_client_group_id = $rec["groupid"];
$client_select .= "<option value='$rec[groupid]' $selected>$rec[contactname]</option>\r\n";
}
}
$app->tpl->setVar("client_group_id", $client_select);
}
if($this->id > 0) {
......@@ -127,6 +151,24 @@ class page_action extends tform_actions {
*/
$this->dataRecord = $app->tform->getDataRecord($this->id);
}
} elseif ($_SESSION["s"]["user"]["typ"] != 'admin' && $app->auth->has_clients($_SESSION['s']['user']['userid'])) {
if ($this->id == 0) {
/*
* We create a new record
*/
// Check if the user is empty
if(isset($this->dataRecord['client_group_id']) && $this->dataRecord['client_group_id'] == 0) {
$app->tform->errorMessage .= $wb['error_client_group_id_empty'];
}
//* make sure that the domain is lowercase
if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]);
}
else {
/*
* We edit a existing one, but there is nothing to edit
*/
$this->dataRecord = $app->tform->getDataRecord($this->id);
}
} else {
if($this->id > 0) {
/*
......
......@@ -12,7 +12,6 @@
<input name="domain" id="domain" value="{tmpl_var name='domain'}" size="30" maxlength="255" type="text" class="textInput" />
</tmpl_if>
</div>
<tmpl_if name="is_admin">
<div class="ctrlHolder">
<label for="client_group_id">{tmpl_var name='client_txt'}</label>
<tmpl_if name="edit_disabled">
......@@ -25,7 +24,6 @@
</select>
</tmpl_if>
</div>
</tmpl_if>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
......
......@@ -158,6 +158,7 @@ class page_action extends tform_actions {
global $app, $conf;
$web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($this->dataRecord["parent_domain_id"]));
$server_id = $app->functions->intval($web["server_id"]);
$dir = $app->db->quote($web["document_root"]);
$uid = $app->db->quote($web["system_user"]);
......@@ -166,8 +167,9 @@ class page_action extends tform_actions {
// The FTP user shall be owned by the same group then the website
$sys_groupid = $app->functions->intval($web['sys_groupid']);
$sql = "UPDATE shell_user SET server_id = $server_id, dir = '$dir', puser = '$puser', pgroup = '$pgroup', sys_groupid = '$sys_groupid' WHERE shell_user_id = ".$this->id;
$sql = "UPDATE shell_user SET server_id = $server_id, dir = '$dir', puser = '$uid', pgroup = '$gid', sys_groupid = '$sys_groupid' WHERE shell_user_id = ".$this->id;
$app->db->query($sql);
die($sql);
}
......
......@@ -93,14 +93,14 @@ $method = simple_query('Select update method', array('stable', 'svn'), 'stable')
if($method == 'stable') {
$new_version = @file_get_contents('http://www.ispconfig.org/downloads/ispconfig3_version.txt') or die('Unable to retrieve version file.');
$new_version = trim($new_version);
if($new_version != ISPC_APP_VERSION) {
if(version_compare($new_version, ISPC_APP_VERSION, '>') {
passthru('/usr/local/ispconfig/server/scripts/update_from_tgz.sh');
exit;
} else {
echo "There are no updates available for ISPConfig ".ISPC_APP_VERSION."\n";
}
} else {
passthru('/usr/local/ispconfig/server/scripts/update_from_svn.sh');
passthru('/usr/local/ispconfig/server/scripts/update_from_dev.sh');
exit;
}
......
#!/bin/bash
cd /tmp
wget -O ispconfig3-dev.tar.gz "http://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=master"
tar xzf ispconfig3-dev.tar.gz
cd ispconfig3.git/install
php -q update.php
cd /tmp
rm -rf /tmp/ispconfig3.git /tmp/ispconfig3-dev.tar.gz
exit 0
\ No newline at end of file
#!/bin/bash
cd /tmp
svn export svn://svn.ispconfig.org/ispconfig3/trunk/
cd trunk/install
php -q update.php
cd /tmp
rm -rf /tmp/trunk
CUR=`dirname $0`
bash ${CUR}/update_from_dev.sh
exit 0
\ No newline at end of file
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