diff --git a/install/dist/lib/fedora.lib.php b/install/dist/lib/fedora.lib.php index f5c04ad9fd5ea43da9da373b234edfbd792d3f78..2d3cc3079c9de87c37e33bd6ad7cb5f630840e80 100644 --- a/install/dist/lib/fedora.lib.php +++ b/install/dist/lib/fedora.lib.php @@ -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 diff --git a/install/dist/lib/gentoo.lib.php b/install/dist/lib/gentoo.lib.php index 40f552c66228f8ecfb951efb55c272381e3ceaef..3ee39390449e0d0a4ee7b25752720a3f3d21608b 100644 --- a/install/dist/lib/gentoo.lib.php +++ b/install/dist/lib/gentoo.lib.php @@ -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')) { diff --git a/install/dist/lib/opensuse.lib.php b/install/dist/lib/opensuse.lib.php index 1c47271b422e1f8659d66fb31b155abc4f98fb3a..7d97977849c516e72f15af2a4692c65c6321851d 100644 --- a/install/dist/lib/opensuse.lib.php +++ b/install/dist/lib/opensuse.lib.php @@ -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 diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php index 501cf3b35765e41864d7a143a1e2a904bc342962..4d5fe875ec6390c444440cf32681d113330f334a 100644 --- a/install/lib/install.lib.php +++ b/install/lib/install.lib.php @@ -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 */ diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 61a1fbaabe54118444559e31d5e102010f7582ee..065df3067fb033e8fd28f4f087fbf4321a04039e 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -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 diff --git a/install/lib/update.lib.php b/install/lib/update.lib.php index 61f400be7d6ac2c581c177c839cec45dcf79ea8a..678faf90c9e94fc71592e52194851ad9bb39acf9 100644 --- a/install/lib/update.lib.php +++ b/install/lib/update.lib.php @@ -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.')); diff --git a/interface/web/admin/form/system_config.tform.php b/interface/web/admin/form/system_config.tform.php index eaa0f6f27389838e183c90efc08d77c49acd0312..889e6d53ac7afb23c21a43c1d2f79f99edeba6e8 100644 --- a/interface/web/admin/form/system_config.tform.php +++ b/interface/web/admin/form/system_config.tform.php @@ -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 diff --git a/interface/web/admin/lib/lang/de_system_config.lng b/interface/web/admin/lib/lang/de_system_config.lng index 5349ade34d3000c7b79449ba865aadf6728bdd31..29d0cf7e0c51cf29504b8ae0990b32f35658f1a1 100644 --- a/interface/web/admin/lib/lang/de_system_config.lng +++ b/interface/web/admin/lib/lang/de_system_config.lng @@ -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'; ?> diff --git a/interface/web/admin/lib/lang/en_system_config.lng b/interface/web/admin/lib/lang/en_system_config.lng index 1c045cf272b30879cea345cd6b994cd17da05d19..e1e11fc2533dae376881a40ee0c92e0525c8839b 100644 --- a/interface/web/admin/lib/lang/en_system_config.lng +++ b/interface/web/admin/lib/lang/en_system_config.lng @@ -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'; ?> diff --git a/interface/web/admin/templates/system_config_mail_edit.htm b/interface/web/admin/templates/system_config_mail_edit.htm index e9c0c0e5b08b54cd5d7d1b77b4c25792f5674b9c..8697e72ef3a58b7111dfeb2b67bbd26ae5ccdc5b 100644 --- a/interface/web/admin/templates/system_config_mail_edit.htm +++ b/interface/web/admin/templates/system_config_mail_edit.htm @@ -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> diff --git a/interface/web/client/domain_edit.php b/interface/web/client/domain_edit.php index 07929f901eeb71a3a8da033f2f4a9f34f33bd1c0..7b24e46f068c2623d405fd1ed85174f64348c72c 100644 --- a/interface/web/client/domain_edit.php +++ b/interface/web/client/domain_edit.php @@ -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) { /* diff --git a/interface/web/client/templates/domain_edit.htm b/interface/web/client/templates/domain_edit.htm index 03f3aaf2ff81e637c7e07dc404b197e0620886d5..aaafa6e9e4395c09f4afabb821c531209334bb43 100644 --- a/interface/web/client/templates/domain_edit.htm +++ b/interface/web/client/templates/domain_edit.htm @@ -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'}"> diff --git a/interface/web/sites/shell_user_edit.php b/interface/web/sites/shell_user_edit.php index 9a8f2669bb0622b8d00f8da9f6b60900761bfa71..5a54b339e6948175efdf43899299936993af1543 100644 --- a/interface/web/sites/shell_user_edit.php +++ b/interface/web/sites/shell_user_edit.php @@ -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); } diff --git a/server/scripts/ispconfig_update.php b/server/scripts/ispconfig_update.php index 6843e7bde28b1aee47b241fea8fbc691b67dee46..1001f4f5a229945886a23a858a02a522cdd5e506 100644 --- a/server/scripts/ispconfig_update.php +++ b/server/scripts/ispconfig_update.php @@ -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; } diff --git a/server/scripts/update_from_dev.sh b/server/scripts/update_from_dev.sh new file mode 100644 index 0000000000000000000000000000000000000000..de93fd96728c5133fb7651f4b38a88107cf1d394 --- /dev/null +++ b/server/scripts/update_from_dev.sh @@ -0,0 +1,11 @@ +#!/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 diff --git a/server/scripts/update_from_svn.sh b/server/scripts/update_from_svn.sh index d8ed23657cd5f7dedfa9ece5ad42a5f2a9ff5fb8..8c8ee2ae18deee4dd818476d7b9e8ee63fc59305 100644 --- a/server/scripts/update_from_svn.sh +++ b/server/scripts/update_from_svn.sh @@ -1,10 +1,6 @@ #!/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