tbrehm
2009-03-10 ce6dcf483febeb655958e0afae0eb320bed05bea
Fixed bugs in opensuse config and docs
Fixed a bug that prevented the modification of website settings of a site that the user created.
9 files modified
52 ■■■■ changed files
docs/INSTALL_OPENSUSE_11_1.txt 5 ●●●●● patch | view | raw | blame | history
install/dist/lib/opensuse.lib.php 5 ●●●●● patch | view | raw | blame | history
install/lib/installer_base.lib.php 2 ●●● patch | view | raw | blame | history
interface/lib/classes/tform.inc.php 23 ●●●● patch | view | raw | blame | history
interface/lib/classes/tform_actions.inc.php 2 ●●● patch | view | raw | blame | history
server/conf/vhost.conf.master 8 ●●●●● patch | view | raw | blame | history
server/plugins-available/shelluser_base_plugin.inc.php 4 ●●●● patch | view | raw | blame | history
server/plugins-available/shelluser_jailkit_plugin.inc.php 2 ●●● patch | view | raw | blame | history
server/server.php 1 ●●●● patch | view | raw | blame | history
docs/INSTALL_OPENSUSE_11_1.txt
@@ -73,6 +73,11 @@
mysqladmin -h ispconfig.local -u root password yourrootsqlpassword
// Install phpmyadmin
yast2 -i pwgen
rpm -i http://download.opensuse.org/repositories/server:/php:/applications/openSUSE_11.1/noarch/phpMyAdmin-3.1.2-1.1.noarch.rpm
2) Install Amavisd-new, Spamassassin and Clamav (1 line!):
yast2 -i amavisd-new clamav clamav-db zoo unzip unrar bzip2 unarj perl-DBD-mysql
install/dist/lib/opensuse.lib.php
@@ -429,6 +429,11 @@
        //* Create the logging directory for the vhost logfiles
        exec('mkdir -p /var/log/ispconfig/httpd');
        
        if(is_file('/etc/suphp/suphp.conf')) {
            replaceLine('/etc/suphp.conf','php=php:/srv/www/cgi-bin/php5','x-httpd-suphp=php:/srv/www/cgi-bin/php5',0);
            replaceLine('/etc/suphp.conf','docroot=','docroot=/var/clients',0);
        }
        // Sites enabled and avaulable dirs
        exec('mkdir -p '.$conf['apache']['vhost_conf_enabled_dir']);
        exec('mkdir -p '.$conf['apache']['vhost_conf_dir']);
install/lib/installer_base.lib.php
@@ -705,7 +705,7 @@
        
        if(is_file('/etc/suphp/suphp.conf')) {
            replaceLine('/etc/suphp/suphp.conf','php=php:/usr/bin','x-httpd-suphp=php:/usr/bin/php-cgi',0);
            replaceLine('/etc/suphp/suphp.conf','docroot=','docroot=/var/clients',0);
            //replaceLine('/etc/suphp/suphp.conf','docroot=','docroot=/var/clients',0);
        }
        
        if(is_file('/etc/apache2/sites-enabled/000-default')) {
interface/lib/classes/tform.inc.php
@@ -738,10 +738,10 @@
                $sql_insert_val = '';
                $sql_update = '';
                if(!is_array($this->formDef)) $app->error("Keine Formulardefinition vorhanden.");
                if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab ist leer oder existiert nicht (TAB: $tab).");
                if(!is_array($this->formDef)) $app->error("Form definition not found.");
                if(!is_array($this->formDef['tabs'][$tab])) $app->error("The tab is empty or does not exist (TAB: $tab).");
                // gehe durch alle Felder des Tabs
                // go trough all fields of the tab
                if(is_array($record)) {
                foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
                                // Wenn es kein leeres Passwortfeld ist
@@ -1109,8 +1109,21 @@
                return $_SESSION["s"]["form"]["tab"];
        }
        
        function isReadonlyTab($tab) {
            if(isset($this->formDef['tabs'][$tab]['readonly']) && $this->formDef['tabs'][$tab]['readonly'] == true) {
        function isReadonlyTab($tab, $primary_id) {
            global $app, $conf;
            // Add backticks for incomplete table names.
            if(stristr($this->formDef['db_table'],'.')) {
                $escape = '';
            } else {
                $escape = '`';
            }
            $sql = "SELECT sys_userid FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id;
            $record = $app->db->queryOneRecord($sql);
            // return true if the readonly flag of the form is set and the current loggedin user is not the owner of the record.
            if(isset($this->formDef['tabs'][$tab]['readonly']) && $this->formDef['tabs'][$tab]['readonly'] == true && $record['sys_userid'] != $_SESSION["s"]["user"]["userid"]) {
                return true;
            } else {
                return false;
interface/lib/classes/tform_actions.inc.php
@@ -163,7 +163,7 @@
        
        function onUpdateSave($sql) {
            global $app;
            if(!empty($sql) && !$app->tform->isReadonlyTab($app->tform->getCurrentTab())) {
            if(!empty($sql) && !$app->tform->isReadonlyTab($app->tform->getCurrentTab(),$this->id)) {
                $app->db->query($sql);
                if($app->db->errorMessage != '') die($app->db->errorMessage);
            }
server/conf/vhost.conf.master
@@ -107,6 +107,10 @@
    ScriptAlias /php5-cgi <tmpl_var name='cgi_starter_path'><tmpl_var name='cgi_starter_script'>
    Action php5-cgi /php5-cgi
    AddHandler php5-cgi .php .php3 .php4 .php5
    <Directory {tmpl_var name='cgi_starter_path'}>
        Order allow,deny
        Allow from all
    </Directory>
</tmpl_if>
<tmpl_if name='php' op='==' value='fast-cgi'>
    # php as fast-cgi enabled
@@ -251,6 +255,10 @@
    ScriptAlias /php5-cgi <tmpl_var name='cgi_starter_path'><tmpl_var name='cgi_starter_script'>
    Action php5-cgi /php5-cgi
    AddHandler php5-cgi .php .php3 .php4 .php5
    <Directory {tmpl_var name='cgi_starter_path'}>
        Order allow,deny
        Allow from all
    </Directory>
</tmpl_if>
<tmpl_if name='php' op='==' value='fast-cgi'>
    # php as fast-cgi enabled
server/plugins-available/shelluser_base_plugin.inc.php
@@ -90,9 +90,9 @@
                
                //* Disable shell user temporarily if we use jailkit
                if($data['new']['chroot'] == 'jailkit') {
                    $command = 'usermod --lock '.escapeshellcmd($data['new']['username']);
                    $command = 'usermod -L '.escapeshellcmd($data['new']['username']);
                    exec($command);
                    $app->log("Disabling shelluser temporarily: ".$data['new']['username'],LOGLEVEL_DEBUG);
                    $app->log("Disabling shelluser temporarily: ".$command,LOGLEVEL_DEBUG);
                }
            
            } else {
server/plugins-available/shelluser_jailkit_plugin.inc.php
@@ -87,7 +87,7 @@
            
                $this->_setup_jailkit_chroot();
                
                $command .= 'usermod --unlock '.escapeshellcmd($data['new']['username']);
                $command .= 'usermod -U '.escapeshellcmd($data['new']['username']);
                exec($command);
                
                $this->_add_jailkit_user();
server/server.php
@@ -32,6 +32,7 @@
require("lib/app.inc.php");
set_time_limit(0);
ini_set('error_reporting','E_ALL & ~E_NOTICE');
// make sure server_id is always an int
$conf["server_id"] = intval($conf["server_id"]);