diff --git a/docs/INSTALL_FEDORA_9.txt b/docs/INSTALL_FEDORA_9.txt index 13bce90bd8f37de470668380c693e55ba22315cb..7f1531fabd609f3a8a8b7f025cd683fad99dfe8d 100644 --- a/docs/INSTALL_FEDORA_9.txt +++ b/docs/INSTALL_FEDORA_9.txt @@ -1,215 +1,215 @@ - -Installation ------------ - -It is recommended to use a clean (fresh) Fedora install. Then follow the steps below to setup your server with ISPConfig 3: - -Installation of some basic requirements: - -rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY* -yum update -yum groupinstall 'Development Tools' -yum groupinstall 'Development Libraries' - -You should disable selinux now, as some programs will not start when selinux is enabled: - -vi /etc/selinux/config - -and set: - -SELINUX=disabled - -then reboot the server. - - -1) Install Postfix, Courier, Saslauthd, MySQL, phpMyAdmin with the following command line (on one line!): - -yum install ntp httpd mysql-server php php-mysql php-mbstring rpm-build gcc mysql-devel openssl-devel cyrus-sasl-devel pkgconfig zlib-devel phpMyAdmin pcre-devel openldap-devel postgresql-devel expect libtool-ltdl-devel openldap-servers libtool gdbm-devel pam-devel gamin-devel getmail - -useradd -m -s /bin/bash compileuser -passwd compileuser - -visudo - -## Allow root to run any commands anywhere -root ALL=(ALL) ALL -compileuser ALL=(ALL) ALL - - -su compileuser - -mkdir $HOME/rpm -mkdir $HOME/rpm/SOURCES -mkdir $HOME/rpm/SPECS -mkdir $HOME/rpm/BUILD -mkdir $HOME/rpm/SRPMS -mkdir $HOME/rpm/RPMS -mkdir $HOME/rpm/RPMS/i386 - -echo "%_topdir $HOME/rpm" >> $HOME/.rpmmacros - - -wget http://prdownloads.sourceforge.net/courier/courier-authlib-0.61.0.tar.bz2 -wget http://prdownloads.sourceforge.net/courier/courier-imap-4.4.1.tar.bz2 -wget http://prdownloads.sourceforge.net/courier/maildrop-2.0.4.tar.bz2 - -sudo rpmbuild -ta courier-authlib-0.61.0.tar.bz2 - -sudo rpm -ivh /home/compileuser/rpm/RPMS/i386/courier-authlib-0.61.0-1.fc9.i386.rpm -sudo rpm -ivh /home/compileuser/rpm/RPMS/i386/courier-authlib-mysql-0.61.0-1.fc9.i386.rpm -sudo rpm -ivh /home/compileuser/rpm/RPMS/i386/courier-authlib-devel-0.61.0-1.fc9.i386.rpm - -rpmbuild -ta courier-imap-4.4.1.tar.bz2 - -sudo rpm -ivh /home/compileuser/rpm/RPMS/i386/courier-imap-4.4.1-1.9.i386.rpm - -sudo rpmbuild -ta maildrop-2.0.4.tar.bz2 - -sudo rpm -ivh /home/compileuser/rpm/RPMS/i386/maildrop-2.0.4-1.9.i386.rpm - -exit - -yum install postfix - -chkconfig --levels 235 mysqld on -/etc/init.d/mysqld start - -chkconfig --levels 235 httpd on -/etc/init.d/httpd start - -chkconfig --levels 235 courier-authlib on -/etc/init.d/courier-authlib start - -chkconfig --levels 235 sendmail off -chkconfig --levels 235 postfix on -chkconfig --levels 235 saslauthd on -/etc/init.d/sendmail stop -/etc/init.d/postfix start -/etc/init.d/saslauthd start - -chkconfig --levels 235 courier-imap on -/etc/init.d/courier-authlib restart -/etc/init.d/courier-imap restart - - -Set the mysql database password: - -mysqladmin -u root password yourrootsqlpassword -mysqladmin -h ispconfig.local -u root password yourrootsqlpassword - - -2) Install Amavisd-new, Spamassassin and Clamav (1 line!): - -yum install amavisd-new spamassassin clamav clamav-data clamav-server clamav-update unzip bzip2 unrar - -chkconfig --levels 235 amavisd on -chkconfig --levels 235 clamd.amavisd on -/usr/bin/freshclam -/etc/init.d/amavisd start -/etc/init.d/clamd.amavisd start - -3) Install apache, PHP5 and phpmyadmin (1 line!): - -yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-magickwand php-magpierss php-mapserver php-mbstring php-mcrypt php-mhash php-mssql php-shout php-snmp php-soap php-tidy curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel phpmyadmin - - -4) Install pure-ftpd and quota - -yum install pure-ftpd quota - -chkconfig --levels 235 pure-ftpd on - -5) Install mydns - -rpm -i http://mydns.bboy.net/download/mydns-mysql-1.1.0-1.i386.rpm - -chkconfig --levels 235 mydns on - -6) Install vlogger and webalizer - -yum install webalizer perl-DateTime-Format-HTTP perl-DateTime-Format-Builder - -cd /tmp -wget http://n0rp.chemlab.org/vlogger/vlogger-1.3.tar.gz -tar xvfz vlogger-1.3.tar.gz -mv vlogger-1.3/vlogger /usr/sbin/ -rm -rf vlogger* - -7) Configure the firewall - -Now you should switch off the firewall by running: - -system-config-firewall-tui - -ISPConfig comes with a iptables bsed firewall script that can be meneged from within the ispconfig interface. - - -8) Install ISPConfig 3 - -There are two possile scenarios, but not both: -8.1) Install the latest released version -8.2) Install directly from SVN - -8.1) Installation of beta 3 from tar.gz - - cd /tmp - wget http://www.ispconfig.org/downloads/ISPConfig-3.0.0.9-rc2.tar.gz - tar xvfz ISPConfig-3.0.0.9-rc2.tar.gz - cd ispconfig3_install/install/ - -8.2) Installation from SVN - - yum install subversion - cd /tmp - svn export svn://svn.ispconfig.org/ispconfig3/trunk/ - cd trunk/install - - -8.1+8.2) Now proceed with the ISPConfig installation. - -Now start the installation process by executing: - -php -q install.php - -The installer will configure all services like postfix, sasl, courier, etc. for you. A manual setup as required for ISPConfig 2 (perfect setup guides) is not necessary. To login to the ISPConfig controlpanel, open the following URL in your browser (replace the IP to match your settings!): - -http://192.168.0.100:8080/ - -the default login is: - -user: admin -password: admin - -In case you get a permission denied error from apache, please restart the apache webserver process. - -Optional: - -Install a webbased Email Client - -yum install squirrelmail - - ----------------------------------------------------------------------------------------------------------- - -Hints: - -debian 4.0 under openvz: - -VPSID=101 -for CAP in CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE -do - vzctl set $VPSID --capability ${CAP}:on --save -done - ----------------------------------------------------------------------------------------------------------- - -Installing Jailkit: - -cd /tmp -wget http://olivier.sessink.nl/jailkit/jailkit-2.5.tar.gz -tar xvfz jailkit-2.5.tar.gz -cd jailkit-2.5 -./configure -make -make install -rm -rf jailkit-2.5* + +Installation +----------- + +It is recommended to use a clean (fresh) Fedora install. Then follow the steps below to setup your server with ISPConfig 3: + +Installation of some basic requirements: + +rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY* +yum update +yum groupinstall 'Development Tools' +yum groupinstall 'Development Libraries' + +You should disable selinux now, as some programs will not start when selinux is enabled: + +vi /etc/selinux/config + +and set: + +SELINUX=disabled + +then reboot the server. + + +1) Install Postfix, Courier, Saslauthd, MySQL, phpMyAdmin with the following command line (on one line!): + +yum install ntp httpd mysql-server php php-mysql php-mbstring rpm-build gcc mysql-devel openssl-devel cyrus-sasl-devel pkgconfig zlib-devel phpMyAdmin pcre-devel openldap-devel postgresql-devel expect libtool-ltdl-devel openldap-servers libtool gdbm-devel pam-devel gamin-devel getmail + +useradd -m -s /bin/bash compileuser +passwd compileuser + +visudo + +## Allow root to run any commands anywhere +root ALL=(ALL) ALL +compileuser ALL=(ALL) ALL + + +su compileuser + +mkdir $HOME/rpm +mkdir $HOME/rpm/SOURCES +mkdir $HOME/rpm/SPECS +mkdir $HOME/rpm/BUILD +mkdir $HOME/rpm/SRPMS +mkdir $HOME/rpm/RPMS +mkdir $HOME/rpm/RPMS/i386 + +echo "%_topdir $HOME/rpm" >> $HOME/.rpmmacros + + +wget http://prdownloads.sourceforge.net/courier/courier-authlib-0.61.0.tar.bz2 +wget http://prdownloads.sourceforge.net/courier/courier-imap-4.4.1.tar.bz2 +wget http://prdownloads.sourceforge.net/courier/maildrop-2.0.4.tar.bz2 + +sudo rpmbuild -ta courier-authlib-0.61.0.tar.bz2 + +sudo rpm -ivh /home/compileuser/rpm/RPMS/i386/courier-authlib-0.61.0-1.fc9.i386.rpm +sudo rpm -ivh /home/compileuser/rpm/RPMS/i386/courier-authlib-mysql-0.61.0-1.fc9.i386.rpm +sudo rpm -ivh /home/compileuser/rpm/RPMS/i386/courier-authlib-devel-0.61.0-1.fc9.i386.rpm + +rpmbuild -ta courier-imap-4.4.1.tar.bz2 + +sudo rpm -ivh /home/compileuser/rpm/RPMS/i386/courier-imap-4.4.1-1.9.i386.rpm + +sudo rpmbuild -ta maildrop-2.0.4.tar.bz2 + +sudo rpm -ivh /home/compileuser/rpm/RPMS/i386/maildrop-2.0.4-1.9.i386.rpm + +exit + +yum install postfix + +chkconfig --levels 235 mysqld on +/etc/init.d/mysqld start + +chkconfig --levels 235 httpd on +/etc/init.d/httpd start + +chkconfig --levels 235 courier-authlib on +/etc/init.d/courier-authlib start + +chkconfig --levels 235 sendmail off +chkconfig --levels 235 postfix on +chkconfig --levels 235 saslauthd on +/etc/init.d/sendmail stop +/etc/init.d/postfix start +/etc/init.d/saslauthd start + +chkconfig --levels 235 courier-imap on +/etc/init.d/courier-authlib restart +/etc/init.d/courier-imap restart + + +Set the mysql database password: + +mysqladmin -u root password yourrootsqlpassword +mysqladmin -h ispconfig.local -u root password yourrootsqlpassword + + +2) Install Amavisd-new, Spamassassin and Clamav (1 line!): + +yum install amavisd-new spamassassin clamav clamav-data clamav-server clamav-update unzip bzip2 unrar + +chkconfig --levels 235 amavisd on +chkconfig --levels 235 clamd.amavisd on +/usr/bin/freshclam +/etc/init.d/amavisd start +/etc/init.d/clamd.amavisd start + +3) Install apache, PHP5 and phpmyadmin (1 line!): + +yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-magickwand php-magpierss php-mapserver php-mbstring php-mcrypt php-mhash php-mssql php-shout php-snmp php-soap php-tidy curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel phpmyadmin + + +4) Install pure-ftpd and quota + +yum install pure-ftpd quota + +chkconfig --levels 235 pure-ftpd on + +5) Install mydns + +rpm -i http://mydns.bboy.net/download/mydns-mysql-1.1.0-1.i386.rpm + +chkconfig --levels 235 mydns on + +6) Install vlogger and webalizer + +yum install webalizer perl-DateTime-Format-HTTP perl-DateTime-Format-Builder + +cd /tmp +wget http://n0rp.chemlab.org/vlogger/vlogger-1.3.tar.gz +tar xvfz vlogger-1.3.tar.gz +mv vlogger-1.3/vlogger /usr/sbin/ +rm -rf vlogger* + +7) Configure the firewall + +Now you should switch off the firewall by running: + +system-config-firewall-tui + +ISPConfig comes with a iptables bsed firewall script that can be meneged from within the ispconfig interface. + + +8) Install ISPConfig 3 + +There are two possile scenarios, but not both: +8.1) Install the latest released version +8.2) Install directly from SVN + +8.1) Installation of beta 3 from tar.gz + + cd /tmp + wget http://www.ispconfig.org/downloads/ISPConfig-3.0.0.9-rc2.tar.gz + tar xvfz ISPConfig-3.0.0.9-rc2.tar.gz + cd ispconfig3_install/install/ + +8.2) Installation from SVN + + yum install subversion + cd /tmp + svn export svn://svn.ispconfig.org/ispconfig3/trunk/ + cd trunk/install + + +8.1+8.2) Now proceed with the ISPConfig installation. + +Now start the installation process by executing: + +php -q install.php + +The installer will configure all services like postfix, sasl, courier, etc. for you. A manual setup as required for ISPConfig 2 (perfect setup guides) is not necessary. To login to the ISPConfig controlpanel, open the following URL in your browser (replace the IP to match your settings!): + +http://192.168.0.100:8080/ + +the default login is: + +user: admin +password: admin + +In case you get a permission denied error from apache, please restart the apache webserver process. + +Optional: + +Install a webbased Email Client + +yum install squirrelmail + + +---------------------------------------------------------------------------------------------------------- + +Hints: + +debian 4.0 under openvz: + +VPSID=101 +for CAP in CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE +do + vzctl set $VPSID --capability ${CAP}:on --save +done + +---------------------------------------------------------------------------------------------------------- + +Installing Jailkit: + +cd /tmp +wget http://olivier.sessink.nl/jailkit/jailkit-2.5.tar.gz +tar xvfz jailkit-2.5.tar.gz +cd jailkit-2.5 +./configure +make +make install +rm -rf jailkit-2.5* diff --git a/docs/INSTALL_OPENSUSE_11.txt b/docs/INSTALL_OPENSUSE_11.txt index a9176cba0089b9b09aba9679b0d606e687f70f1b..de8c0a079a403cc07ac1aa61c8a2471f2fe5f6b5 100644 --- a/docs/INSTALL_OPENSUSE_11.txt +++ b/docs/INSTALL_OPENSUSE_11.txt @@ -1,201 +1,201 @@ - -Installation ------------ - -It is recommended to use a clean (fresh) OpenSUSE installatiom where you selected to install just the minimal packages. A Gnome or KDE desktop is not needed and will just slow down the server. Then follow the steps below to setup your server with ISPConfig 3: - -Install some basic packes and the compilers that we need later - -yast2 -i findutils readline libgcc glibc-devel findutils-locate gcc flex lynx compat-readline4 db-devel wget gcc-c++ make vim telnet cron iptables iputils man man-pages - -1) Install Postfix, Courier, Saslauthd, MySQL, phpMyAdmin with the following command line (on one line!): - -yast2 -i postfix postfix-mysql mysql mysql-client phpMyAdmin courier-imap courier-authlib courier-authlib-mysql python cron cyrus-sasl cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapi cyrus-sasl-otp cyrus-sasl-plain cyrus-sasl-saslauthd libmysqlclient-devel - -chkconfig --add mysql -/etc/init.d/mysql start - -chkconfig --add postfix -/etc/init.d/postfix start - -chkconfig --add saslauthd -/etc/init.d/saslauthd start - -chkconfig --add saslauthd -/etc/init.d/saslauthd start - -chkconfig --add fam -chkconfig --add courier-authdaemon -chkconfig --add courier-pop -chkconfig --add courier-imap -/etc/init.d/courier-pop start -/etc/init.d/courier-imap start -chkconfig --add courier-pop-ssl -chkconfig --add courier-imap-ssl -/etc/init.d/courier-pop-ssl start -/etc/init.d/courier-imap-ssl start - -cd /tmp -wget http://download.opensuse.org/repositories/server:/mail/openSUSE_11.0/i586/getmail-4.7.6-1.4.i586.rpm -rpm -i getmail-4.7.6-1.4.i586.rpm - -// Warnings like "warning: getmail-4.7.6-1.4.i586.rpm: Header V3 DSA signature: NOKEY, key ID 367fe7fc" can be ignored. - -// Install maildrop -rpm --force -i http://download.opensuse.org/repositories/home%3A/cboltz/openSUSE_10.3/i586/maildrop-2.0.3-16.1.i586.rpm - -// Install pam_mysql - -yast2 -i pam-devel -cd /tmp -wget http://heanet.dl.sourceforge.net/sourceforge/pam-mysql/pam_mysql-0.7RC1.tar.gz -tar xvfz pam_mysql-0.7RC1.tar.gz -cd pam_mysql-0.7RC1 -./configure -make -make install -rm -rf pam_mysql-0.7RC1 -rm pam_mysql-0.7RC1.tar.gz - -// Set the mysql database password: - -mysqladmin -u root password yourrootsqlpassword -mysqladmin -h ispconfig.local -u root password yourrootsqlpassword - - -2) Install Amavisd-new, Spamassassin and Clamav (1 line!): - -yast2 -i amavisd-new clamav clamav-db zoo unzip unrar bzip2 unarj perl-DBD-mysql - -chkconfig --add amavis -chkconfig --add clamd -/etc/init.d/amavis start -/etc/init.d/clamd start - -3) Install PHP5 modules (1 line!): - -yast2 -i php5-bcmath php5-bz2 php5-calendar php5-ctype php5-curl php5-dbase php5-dom php5-ftp php5-gd php5-gettext php5-gmp php5-iconv php5-imap php5-ldap php5-mbstring php5-mcrypt php5-mysql php5-ncurses php5-odbc php5-openssl php5-pcntl php5-pgsql php5-posix php5-shmop php5-snmp php5-soap php5-sockets php5-sqlite php5-sysvsem php5-tokenizer php5-wddx php5-xmlrpc php5-xsl php5-zlib php5-exif php5-fastcgi php5-pear php5-sysvmsg php5-sysvshm ImageMagick curl - -Then run the following to enable the Apache modules: - -a2enmod suexec -a2enmod rewrite -a2enmod ssl -a2enmod actions - -chkconfig --add apache2 -/etc/init.d/apache2 start - -4) Install pure-ftpd and quota - -yast2 -i pure-ftpd quota - -// The current pure-ftpd package from SuSE is unstable and segfaults when a file is uploaded, -// we will replace it with a manually compiled package now: - -cd /tmp -wget http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.21.tar.gz -tar xvfz pure-ftpd-1.0.21.tar.gz -cd pure-ftpd-1.0.21/ -./configure --sysconfdir=/etc/pure-ftpd --with-everything --with-mysql -make -make install -mv /usr/sbin/pure-ftpd /usr/sbin/pure-ftpd.suse -ln -s /usr/local/sbin/pure-ftpd /usr/sbin/pure-ftpd -rm -rf pure-ftpd-1.0.21 -rm -f pure-ftpd-1.0.21.tar.gz - -chkconfig --add pure-ftpd -/etc/init.d/pure-ftpd start - - -5) Install mydns - -cd /tmp -wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/server:/dns/SUSE_Factory/i586/mydns-mysql-1.1.0-3.72.i586.rpm -wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/server:/dns/SUSE_Factory/i586/mydns-1.1.0-3.72.i586.rpm -rpm -i mydns*.rpm -rm -rf /tmp/mydns* - -chkconfig --add mydns - -6) Install vlogger and webalizer - -cd /tmp -wget http://n0rp.chemlab.org/vlogger/vlogger-1.3.tar.gz -tar xvfz vlogger-1.3.tar.gz -mv vlogger-1.3/vlogger /usr/sbin/ -rm -rf vlogger* - - -yast2 -i webalizer perl-DateManip - - -7) Install ISPConfig 3 - -There are two possile scenarios, but not both: -7.1) Install the latest released version -7.2) Install directly from SVN - -7.1) Installation of beta 3 from tar.gz - - cd /tmp - wget http://www.ispconfig.org/downloads/ISPConfig-3.0.0.9-rc2.tar.gz - tar xvfz ISPConfig-3.0.0.9-rc2.tar.gz - cd ispconfig3_install/install/ - -7.2) Installation from SVN - - yast2 -i subversion - cd /tmp - svn export svn://svn.ispconfig.org/ispconfig3/trunk/ - cd trunk/install - - -7.1+7.2) Now proceed with the ISPConfig installation. - -Now start the installation process by executing: - -php -q install.php - -The installer will configure all services like postfix, sasl, courier, etc. for you. A manual setup as required for ISPConfig 2 (perfect setup guides) is not necessary. To login to the ISPConfig controlpanel, open the following URL in your browser (replace the IP to match your settings!): - -http://192.168.0.100:8080/ - -the default login is: - -user: admin -password: admin - -In case you get a permission denied error from apache, please restart the apache webserver process. - -Optional: - -Install a webbased Email Client - -yast2 -i squirrelmail - ----------------------------------------------------------------------------------------------------------- - -Hints: - -debian 4.0 under openvz: - -VPSID=101 -for CAP in CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE -do - vzctl set $VPSID --capability ${CAP}:on --save -done - ----------------------------------------------------------------------------------------------------------- - -Installing Jailkit: - -cd /tmp -wget http://olivier.sessink.nl/jailkit/jailkit-2.5.tar.gz -tar xvfz jailkit-2.5.tar.gz -cd jailkit-2.5 -./configure -make -make install -rm -rf jailkit-2.5* + +Installation +----------- + +It is recommended to use a clean (fresh) OpenSUSE installatiom where you selected to install just the minimal packages. A Gnome or KDE desktop is not needed and will just slow down the server. Then follow the steps below to setup your server with ISPConfig 3: + +Install some basic packes and the compilers that we need later + +yast2 -i findutils readline libgcc glibc-devel findutils-locate gcc flex lynx compat-readline4 db-devel wget gcc-c++ make vim telnet cron iptables iputils man man-pages + +1) Install Postfix, Courier, Saslauthd, MySQL, phpMyAdmin with the following command line (on one line!): + +yast2 -i postfix postfix-mysql mysql mysql-client phpMyAdmin courier-imap courier-authlib courier-authlib-mysql python cron cyrus-sasl cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapi cyrus-sasl-otp cyrus-sasl-plain cyrus-sasl-saslauthd libmysqlclient-devel + +chkconfig --add mysql +/etc/init.d/mysql start + +chkconfig --add postfix +/etc/init.d/postfix start + +chkconfig --add saslauthd +/etc/init.d/saslauthd start + +chkconfig --add saslauthd +/etc/init.d/saslauthd start + +chkconfig --add fam +chkconfig --add courier-authdaemon +chkconfig --add courier-pop +chkconfig --add courier-imap +/etc/init.d/courier-pop start +/etc/init.d/courier-imap start +chkconfig --add courier-pop-ssl +chkconfig --add courier-imap-ssl +/etc/init.d/courier-pop-ssl start +/etc/init.d/courier-imap-ssl start + +cd /tmp +wget http://download.opensuse.org/repositories/server:/mail/openSUSE_11.0/i586/getmail-4.7.6-1.4.i586.rpm +rpm -i getmail-4.7.6-1.4.i586.rpm + +// Warnings like "warning: getmail-4.7.6-1.4.i586.rpm: Header V3 DSA signature: NOKEY, key ID 367fe7fc" can be ignored. + +// Install maildrop +rpm --force -i http://download.opensuse.org/repositories/home%3A/cboltz/openSUSE_10.3/i586/maildrop-2.0.3-16.1.i586.rpm + +// Install pam_mysql + +yast2 -i pam-devel +cd /tmp +wget http://heanet.dl.sourceforge.net/sourceforge/pam-mysql/pam_mysql-0.7RC1.tar.gz +tar xvfz pam_mysql-0.7RC1.tar.gz +cd pam_mysql-0.7RC1 +./configure +make +make install +rm -rf pam_mysql-0.7RC1 +rm pam_mysql-0.7RC1.tar.gz + +// Set the mysql database password: + +mysqladmin -u root password yourrootsqlpassword +mysqladmin -h ispconfig.local -u root password yourrootsqlpassword + + +2) Install Amavisd-new, Spamassassin and Clamav (1 line!): + +yast2 -i amavisd-new clamav clamav-db zoo unzip unrar bzip2 unarj perl-DBD-mysql + +chkconfig --add amavis +chkconfig --add clamd +/etc/init.d/amavis start +/etc/init.d/clamd start + +3) Install PHP5 modules (1 line!): + +yast2 -i php5-bcmath php5-bz2 php5-calendar php5-ctype php5-curl php5-dbase php5-dom php5-ftp php5-gd php5-gettext php5-gmp php5-iconv php5-imap php5-ldap php5-mbstring php5-mcrypt php5-mysql php5-ncurses php5-odbc php5-openssl php5-pcntl php5-pgsql php5-posix php5-shmop php5-snmp php5-soap php5-sockets php5-sqlite php5-sysvsem php5-tokenizer php5-wddx php5-xmlrpc php5-xsl php5-zlib php5-exif php5-fastcgi php5-pear php5-sysvmsg php5-sysvshm ImageMagick curl + +Then run the following to enable the Apache modules: + +a2enmod suexec +a2enmod rewrite +a2enmod ssl +a2enmod actions + +chkconfig --add apache2 +/etc/init.d/apache2 start + +4) Install pure-ftpd and quota + +yast2 -i pure-ftpd quota + +// The current pure-ftpd package from SuSE is unstable and segfaults when a file is uploaded, +// we will replace it with a manually compiled package now: + +cd /tmp +wget http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.21.tar.gz +tar xvfz pure-ftpd-1.0.21.tar.gz +cd pure-ftpd-1.0.21/ +./configure --sysconfdir=/etc/pure-ftpd --with-everything --with-mysql +make +make install +mv /usr/sbin/pure-ftpd /usr/sbin/pure-ftpd.suse +ln -s /usr/local/sbin/pure-ftpd /usr/sbin/pure-ftpd +rm -rf pure-ftpd-1.0.21 +rm -f pure-ftpd-1.0.21.tar.gz + +chkconfig --add pure-ftpd +/etc/init.d/pure-ftpd start + + +5) Install mydns + +cd /tmp +wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/server:/dns/SUSE_Factory/i586/mydns-mysql-1.1.0-3.72.i586.rpm +wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/server:/dns/SUSE_Factory/i586/mydns-1.1.0-3.72.i586.rpm +rpm -i mydns*.rpm +rm -rf /tmp/mydns* + +chkconfig --add mydns + +6) Install vlogger and webalizer + +cd /tmp +wget http://n0rp.chemlab.org/vlogger/vlogger-1.3.tar.gz +tar xvfz vlogger-1.3.tar.gz +mv vlogger-1.3/vlogger /usr/sbin/ +rm -rf vlogger* + + +yast2 -i webalizer perl-DateManip + + +7) Install ISPConfig 3 + +There are two possile scenarios, but not both: +7.1) Install the latest released version +7.2) Install directly from SVN + +7.1) Installation of beta 3 from tar.gz + + cd /tmp + wget http://www.ispconfig.org/downloads/ISPConfig-3.0.0.9-rc2.tar.gz + tar xvfz ISPConfig-3.0.0.9-rc2.tar.gz + cd ispconfig3_install/install/ + +7.2) Installation from SVN + + yast2 -i subversion + cd /tmp + svn export svn://svn.ispconfig.org/ispconfig3/trunk/ + cd trunk/install + + +7.1+7.2) Now proceed with the ISPConfig installation. + +Now start the installation process by executing: + +php -q install.php + +The installer will configure all services like postfix, sasl, courier, etc. for you. A manual setup as required for ISPConfig 2 (perfect setup guides) is not necessary. To login to the ISPConfig controlpanel, open the following URL in your browser (replace the IP to match your settings!): + +http://192.168.0.100:8080/ + +the default login is: + +user: admin +password: admin + +In case you get a permission denied error from apache, please restart the apache webserver process. + +Optional: + +Install a webbased Email Client + +yast2 -i squirrelmail + +---------------------------------------------------------------------------------------------------------- + +Hints: + +debian 4.0 under openvz: + +VPSID=101 +for CAP in CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE +do + vzctl set $VPSID --capability ${CAP}:on --save +done + +---------------------------------------------------------------------------------------------------------- + +Installing Jailkit: + +cd /tmp +wget http://olivier.sessink.nl/jailkit/jailkit-2.5.tar.gz +tar xvfz jailkit-2.5.tar.gz +cd jailkit-2.5 +./configure +make +make install +rm -rf jailkit-2.5* diff --git a/docs/INSTALL_OPENSUSE_11_1.txt b/docs/INSTALL_OPENSUSE_11_1.txt index 6688c24eb4bb54c487453ed485ecc2fc53efb232..f6ea738ed6a034418c41549cd6c1657544fcafcf 100644 --- a/docs/INSTALL_OPENSUSE_11_1.txt +++ b/docs/INSTALL_OPENSUSE_11_1.txt @@ -1,210 +1,210 @@ - -Installation ------------ - -It is recommended to use a clean (fresh) OpenSUSE installatiom where you selected to install just the minimal packages. A Gnome or KDE desktop is not needed and will just slow down the server. Then follow the steps below to setup your server with ISPConfig 3: - -The following guide is for the 32Bit version of openSUSE, for 64Bit installations the package names may differ especially the names of downloaded rpm files. - -Install some basic packes and the compilers that we need later - -yast2 -i findutils readline libgcc glibc-devel findutils-locate gcc flex lynx compat-readline4 db-devel wget gcc-c++ make vim telnet cron iptables iputils man man-pages nano pico - -1) Install Postfix, Courier, Saslauthd, MySQL with the following command line (on one line!): - -yast2 -i postfix postfix-mysql mysql mysql-client courier-imap courier-authlib courier-authlib-mysql python cron cyrus-sasl cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapi cyrus-sasl-otp cyrus-sasl-plain cyrus-sasl-saslauthd libmysqlclient-devel - -chkconfig --add mysql -/etc/init.d/mysql start - -chkconfig --add postfix -/etc/init.d/postfix start - -chkconfig --add saslauthd -/etc/init.d/saslauthd start - -chkconfig --add saslauthd -/etc/init.d/saslauthd start - -chkconfig --add fam -chkconfig --add courier-authdaemon -chkconfig --add courier-pop -chkconfig --add courier-imap -/etc/init.d/courier-pop start -/etc/init.d/courier-imap start -chkconfig --add courier-pop-ssl -chkconfig --add courier-imap-ssl -/etc/init.d/courier-pop-ssl start -/etc/init.d/courier-imap-ssl start - - -cd /tmp -wget http://download.opensuse.org/repositories/server:/mail/openSUSE_11.0/i586/getmail-4.7.6-1.4.i586.rpm -rpm -i getmail-4.7.6-1.4.i586.rpm - -// Install maildrop -wget http://download.opensuse.org/repositories/home:/atzewilms/openSUSE_11.1_Update/i586/maildrop-2.0.4-10.5.i586.rpm -rpm --force -i maildrop-2.0.4-10.5.i586.rpm - -// Install pam_mysql -yast2 -i pam-devel -cd /tmp -wget http://heanet.dl.sourceforge.net/sourceforge/pam-mysql/pam_mysql-0.7RC1.tar.gz -tar xvfz pam_mysql-0.7RC1.tar.gz -cd pam_mysql-0.7RC1 -./configure -make -make install -rm -rf /tmp/pam_mysql-0.7RC1 -rm /tmp/pam_mysql-0.7RC1.tar.gz - - -// Set the mysql database password: - -mysql_secure_installation - - -2) Install Amavisd-new, Spamassassin and Clamav (1 line!): - -yast2 -i amavisd-new clamav clamav-db zoo unzip unrar bzip2 unarj perl-DBD-mysql - -chkconfig --add amavis -chkconfig --add clamd -/etc/init.d/amavis start -/etc/init.d/clamd start - -2.1) Install apache2 - -yast2 -i apache2 apache2-mod_fcgid - -rpm -i http://download.opensuse.org/repositories/server:/php/server_database_apache_openSUSE_11.0/i586/suphp-0.6.2-10.41.i586.rpm - -3) Install PHP5 modules (1 line!): - -yast2 -i php5-bcmath php5-bz2 php5-calendar php5-ctype php5-curl php5-dbase php5-dom php5-ftp php5-gd php5-gettext php5-gmp php5-iconv php5-imap php5-ldap php5-mbstring php5-mcrypt php5-mysql php5-ncurses php5-odbc php5-openssl php5-pcntl php5-pgsql php5-posix php5-shmop php5-snmp php5-soap php5-sockets php5-sqlite php5-sysvsem php5-tokenizer php5-wddx php5-xmlrpc php5-xsl php5-zlib php5-exif php5-fastcgi php5-pear php5-sysvmsg php5-sysvshm ImageMagick curl apache2-mod_php5 - -Then run the following to enable the Apache modules: - -a2enmod suexec -a2enmod rewrite -a2enmod ssl -a2enmod actions -a2enmod suphp -a2enmod fcgid - -// Fix a suexec permission problem - -chown root:www /usr/sbin/suexec2 -chmod 4755 /usr/sbin/suexec2 - -// and start apache - -chkconfig --add apache2 -/etc/init.d/apache2 start - -cd /tmp - -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 -ln -s /srv/www/htdocs/phpMyAdmin /usr/local/ispconfig/interface/web/phpmyadmin - -// Warnings like "warning: phpMyAdmin-3.1.2-1.1.src.rpm: Header V3 DSA signature: NOKEY, key ID 367fe7fc" can be ignored. - -4) Install pure-ftpd and quota - -yast2 -i pure-ftpd quota - -chkconfig --add pure-ftpd -/etc/init.d/pure-ftpd start - - -5) Install mydns - -cd /tmp -wget http://download.opensuse.org/repositories/home:/bajizs_cnt/openSUSE_11.1/i586/mydns-ng-1.2.8-1.1.i586.rpm -wget http://download.opensuse.org/repositories/home:/bajizs_cnt/openSUSE_11.1/i586/mydns-ng-mysql-1.2.8-1.1.i586.rpm -rpm -i mydns*.rpm - -chkconfig --add mydns - -6) Install vlogger and webalizer - -cd /tmp -wget http://n0rp.chemlab.org/vlogger/vlogger-1.3.tar.gz -tar xvfz vlogger-1.3.tar.gz -mv vlogger-1.3/vlogger /usr/sbin/ -rm -rf vlogger* -yast2 -i webalizer perl-DateManip - -6.1 Install fail2ban - -rpm -i http://download.opensuse.org/repositories/home:/leonardocf/openSUSE_11.0/i586/fail2ban-0.8.2-5.2.i586.rpm - - - - -6.2) Cleanup - -rm -f /tmp/*.rpm - -6.2 Install jailkit - -cd /tmp -wget http://olivier.sessink.nl/jailkit/jailkit-2.5.tar.gz -tar xvfz jailkit-2.5.tar.gz -cd jailkit-2.5 -./configure -make -make install -cd .. -rm -rf jailkit-2.5* - - -7) Install ISPConfig 3 - -There are two possile scenarios, but not both: -7.1) Install the latest released version -7.2) Install directly from SVN - -7.1) Installation of beta 3 from tar.gz - - cd /tmp - wget http://www.ispconfig.org/downloads/ISPConfig-3.0.0.9-rc2.tar.gz - tar xvfz ISPConfig-3.0.0.9-rc2.tar.gz - cd ispconfig3_install/install/ - -7.2) Installation from SVN - - yast2 -i subversion - cd /tmp - svn export svn://svn.ispconfig.org/ispconfig3/trunk/ - cd trunk/install - - -7.1+7.2) Now proceed with the ISPConfig installation. - -Now start the installation process by executing: - -php -q install.php - -// Cleanup -rm -rf /tmp/trunk - -The installer will configure all services like postfix, sasl, courier, etc. for you. A manual setup as required for ISPConfig 2 (perfect setup guides) is not necessary. To login to the ISPConfig controlpanel, open the following URL in your browser (replace the IP to match your settings!): - -http://192.168.0.100:8080/ - -the default login is: - -user: admin -password: admin - -In case you get a permission denied error from apache, please restart the apache webserver process. - -Optional: - -Install a webbased Email Client - -yast2 -i squirrelmail - - + +Installation +----------- + +It is recommended to use a clean (fresh) OpenSUSE installatiom where you selected to install just the minimal packages. A Gnome or KDE desktop is not needed and will just slow down the server. Then follow the steps below to setup your server with ISPConfig 3: + +The following guide is for the 32Bit version of openSUSE, for 64Bit installations the package names may differ especially the names of downloaded rpm files. + +Install some basic packes and the compilers that we need later + +yast2 -i findutils readline libgcc glibc-devel findutils-locate gcc flex lynx compat-readline4 db-devel wget gcc-c++ make vim telnet cron iptables iputils man man-pages nano pico + +1) Install Postfix, Courier, Saslauthd, MySQL with the following command line (on one line!): + +yast2 -i postfix postfix-mysql mysql mysql-client courier-imap courier-authlib courier-authlib-mysql python cron cyrus-sasl cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapi cyrus-sasl-otp cyrus-sasl-plain cyrus-sasl-saslauthd libmysqlclient-devel + +chkconfig --add mysql +/etc/init.d/mysql start + +chkconfig --add postfix +/etc/init.d/postfix start + +chkconfig --add saslauthd +/etc/init.d/saslauthd start + +chkconfig --add saslauthd +/etc/init.d/saslauthd start + +chkconfig --add fam +chkconfig --add courier-authdaemon +chkconfig --add courier-pop +chkconfig --add courier-imap +/etc/init.d/courier-pop start +/etc/init.d/courier-imap start +chkconfig --add courier-pop-ssl +chkconfig --add courier-imap-ssl +/etc/init.d/courier-pop-ssl start +/etc/init.d/courier-imap-ssl start + + +cd /tmp +wget http://download.opensuse.org/repositories/server:/mail/openSUSE_11.0/i586/getmail-4.7.6-1.4.i586.rpm +rpm -i getmail-4.7.6-1.4.i586.rpm + +// Install maildrop +wget http://download.opensuse.org/repositories/home:/atzewilms/openSUSE_11.1_Update/i586/maildrop-2.0.4-10.5.i586.rpm +rpm --force -i maildrop-2.0.4-10.5.i586.rpm + +// Install pam_mysql +yast2 -i pam-devel +cd /tmp +wget http://heanet.dl.sourceforge.net/sourceforge/pam-mysql/pam_mysql-0.7RC1.tar.gz +tar xvfz pam_mysql-0.7RC1.tar.gz +cd pam_mysql-0.7RC1 +./configure +make +make install +rm -rf /tmp/pam_mysql-0.7RC1 +rm /tmp/pam_mysql-0.7RC1.tar.gz + + +// Set the mysql database password: + +mysql_secure_installation + + +2) Install Amavisd-new, Spamassassin and Clamav (1 line!): + +yast2 -i amavisd-new clamav clamav-db zoo unzip unrar bzip2 unarj perl-DBD-mysql + +chkconfig --add amavis +chkconfig --add clamd +/etc/init.d/amavis start +/etc/init.d/clamd start + +2.1) Install apache2 + +yast2 -i apache2 apache2-mod_fcgid + +rpm -i http://download.opensuse.org/repositories/server:/php/server_database_apache_openSUSE_11.0/i586/suphp-0.6.2-10.41.i586.rpm + +3) Install PHP5 modules (1 line!): + +yast2 -i php5-bcmath php5-bz2 php5-calendar php5-ctype php5-curl php5-dbase php5-dom php5-ftp php5-gd php5-gettext php5-gmp php5-iconv php5-imap php5-ldap php5-mbstring php5-mcrypt php5-mysql php5-ncurses php5-odbc php5-openssl php5-pcntl php5-pgsql php5-posix php5-shmop php5-snmp php5-soap php5-sockets php5-sqlite php5-sysvsem php5-tokenizer php5-wddx php5-xmlrpc php5-xsl php5-zlib php5-exif php5-fastcgi php5-pear php5-sysvmsg php5-sysvshm ImageMagick curl apache2-mod_php5 + +Then run the following to enable the Apache modules: + +a2enmod suexec +a2enmod rewrite +a2enmod ssl +a2enmod actions +a2enmod suphp +a2enmod fcgid + +// Fix a suexec permission problem + +chown root:www /usr/sbin/suexec2 +chmod 4755 /usr/sbin/suexec2 + +// and start apache + +chkconfig --add apache2 +/etc/init.d/apache2 start + +cd /tmp + +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 +ln -s /srv/www/htdocs/phpMyAdmin /usr/local/ispconfig/interface/web/phpmyadmin + +// Warnings like "warning: phpMyAdmin-3.1.2-1.1.src.rpm: Header V3 DSA signature: NOKEY, key ID 367fe7fc" can be ignored. + +4) Install pure-ftpd and quota + +yast2 -i pure-ftpd quota + +chkconfig --add pure-ftpd +/etc/init.d/pure-ftpd start + + +5) Install mydns + +cd /tmp +wget http://download.opensuse.org/repositories/home:/bajizs_cnt/openSUSE_11.1/i586/mydns-ng-1.2.8-1.1.i586.rpm +wget http://download.opensuse.org/repositories/home:/bajizs_cnt/openSUSE_11.1/i586/mydns-ng-mysql-1.2.8-1.1.i586.rpm +rpm -i mydns*.rpm + +chkconfig --add mydns + +6) Install vlogger and webalizer + +cd /tmp +wget http://n0rp.chemlab.org/vlogger/vlogger-1.3.tar.gz +tar xvfz vlogger-1.3.tar.gz +mv vlogger-1.3/vlogger /usr/sbin/ +rm -rf vlogger* +yast2 -i webalizer perl-DateManip + +6.1 Install fail2ban + +rpm -i http://download.opensuse.org/repositories/home:/leonardocf/openSUSE_11.0/i586/fail2ban-0.8.2-5.2.i586.rpm + + + + +6.2) Cleanup + +rm -f /tmp/*.rpm + +6.2 Install jailkit + +cd /tmp +wget http://olivier.sessink.nl/jailkit/jailkit-2.5.tar.gz +tar xvfz jailkit-2.5.tar.gz +cd jailkit-2.5 +./configure +make +make install +cd .. +rm -rf jailkit-2.5* + + +7) Install ISPConfig 3 + +There are two possile scenarios, but not both: +7.1) Install the latest released version +7.2) Install directly from SVN + +7.1) Installation of beta 3 from tar.gz + + cd /tmp + wget http://www.ispconfig.org/downloads/ISPConfig-3.0.0.9-rc2.tar.gz + tar xvfz ISPConfig-3.0.0.9-rc2.tar.gz + cd ispconfig3_install/install/ + +7.2) Installation from SVN + + yast2 -i subversion + cd /tmp + svn export svn://svn.ispconfig.org/ispconfig3/trunk/ + cd trunk/install + + +7.1+7.2) Now proceed with the ISPConfig installation. + +Now start the installation process by executing: + +php -q install.php + +// Cleanup +rm -rf /tmp/trunk + +The installer will configure all services like postfix, sasl, courier, etc. for you. A manual setup as required for ISPConfig 2 (perfect setup guides) is not necessary. To login to the ISPConfig controlpanel, open the following URL in your browser (replace the IP to match your settings!): + +http://192.168.0.100:8080/ + +the default login is: + +user: admin +password: admin + +In case you get a permission denied error from apache, please restart the apache webserver process. + +Optional: + +Install a webbased Email Client + +yast2 -i squirrelmail + + diff --git a/helper_scripts/setup_in_openvz/diff_openssl.cnf b/helper_scripts/setup_in_openvz/diff_openssl.cnf index b1973a4ad90729888535679faf70512e8ad45e31..4a3c7e6aa19504cb5f646cefe8c29ee57952826e 100644 --- a/helper_scripts/setup_in_openvz/diff_openssl.cnf +++ b/helper_scripts/setup_in_openvz/diff_openssl.cnf @@ -1,25 +1,25 @@ -# diff openssl.cnf /usr/lib/ssl/openssl.cnf -68c68 -< default_days = 3653 # how long to certify for ---- -> default_days = 365 # how long to certify for -125c125 -< countryName_default = YOURCOUNTRY ---- -> countryName_default = AU -130c130 -< stateOrProvinceName_default = YOURPROVINCE ---- -> stateOrProvinceName_default = Some-State -135c135 -< 0.organizationName_default = YOURDOMAIN ---- -> 0.organizationName_default = Internet Widgits Pty Ltd -142c142 -< organizationalUnitName_default = ISP ---- -> #organizationalUnitName_default = -145d144 -< commonName_default = YOURHOSTNAME -149d147 -< emailAddress_default = postmaster@YOURDOMAIN +# diff openssl.cnf /usr/lib/ssl/openssl.cnf +68c68 +< default_days = 3653 # how long to certify for +--- +> default_days = 365 # how long to certify for +125c125 +< countryName_default = YOURCOUNTRY +--- +> countryName_default = AU +130c130 +< stateOrProvinceName_default = YOURPROVINCE +--- +> stateOrProvinceName_default = Some-State +135c135 +< 0.organizationName_default = YOURDOMAIN +--- +> 0.organizationName_default = Internet Widgits Pty Ltd +142c142 +< organizationalUnitName_default = ISP +--- +> #organizationalUnitName_default = +145d144 +< commonName_default = YOURHOSTNAME +149d147 +< emailAddress_default = postmaster@YOURDOMAIN diff --git a/helper_scripts/setup_in_openvz/install_server.sh b/helper_scripts/setup_in_openvz/install_server.sh index 454aec6077b63fac7cb3373ebb1e2a2fba4038af..1cc05841703b3fe7cb268b4086ea90d8991a9261 100644 --- a/helper_scripts/setup_in_openvz/install_server.sh +++ b/helper_scripts/setup_in_openvz/install_server.sh @@ -1,61 +1,61 @@ -#!/bin/bash -# Script to configuring an ispconfig3 server in a Debian VPS -# by calocen [at] gmail [dot] com - -# getting some enviromment values -myhostname=`hostname -f` -mydomain=`hostname -d` -myip=`hostname -i` -[ ! -x /usr/bin/geoiplookup ] && apt-get --assume-yes install geoip-bin -mycountry=`geoiplookup $myip | cut -f4 -d" " | cut -f1 -d","` -myprovince=`geoiplookup $myip | cut -f5 -d" "` - -# reconfiguring webalizer, postfix -# could be cool to modify here webalizer values -dpkg-reconfigure -u webalizer -postconf -e "myhostname = $myhostname" -postconf -e "mydestination = $myhostname, localhost" -echo $myhostname > /etc/mailname -dpkg-reconfigure -u postfix - -# request new password -oldpwd=`grep password /root/.my.cnf | tr "\t" " " | tr -s " " | cut -f3 -d" "` -read -p "mysql password: [$oldpwd] " mysqlpwd -[ -z $mysqlpwd ] && mysqlpwd=$oldpwd -echo $mysqlpwd -#read -p "Are you sure? (y/n) " sure -## who said fear ## -set -x -mysqladmin -u root -p$oldpwd password $mysqlpwd -mysqladmin -u root -p$mysqlpwd -h localhost password $mysqlpwd -cat << EOF > /root/.my.cnf -[client] -password = $mysqlpwd -EOF -chmod 600 /root/.my.cnf - -# changing mydns password -mysql -e "SET PASSWORD FOR 'mydns'@'%' = PASSWORD( '$mysqlpwd' )" -mysql -e "SET PASSWORD FOR 'mydns'@'localhost' = PASSWORD( '$mysqlpwd' )" -cp -ax /etc/mydns.conf /etc/mydns.conf~ -sed s/$oldpwd/$mysqlpwd/g < /etc/mydns.conf~ > /etc/mydns.conf - -# enabling mydns -mydns --create-tables > /tmp/mydns.sql -mysql -e "CREATE DATABASE IF NOT EXISTS mydns ; USE mydns ; SOURCE /tmp/mydns.sql;" -rm /tmp/mydns.* -invoke-rc.d mydns restart - -# preparing server installation -mv /etc/ssl/openssl.cnf /etc/ssl/openssl.cnf~ -sed s/"YOURHOSTNAME"/"$myhostname"/g < /usr/local/bin/openssl.cnf | -sed s/"YOURDOMAIN"/"$mydomain"/g | \ -sed s/"YOURCOUNTRY"/"$mycountry"/g | \ -sed s/"YOURPROVINCE"/"$myprovince"/g > /etc/ssl/openssl.cnf - -tar xfz /root/downloads/ISPConfig-3.0.0.7-beta.tar.gz -C /usr/local/src -# here would be some stuff to update from SVN -cd /usr/local/src/ispconfig3_install/install/ -php -q install.php - - +#!/bin/bash +# Script to configuring an ispconfig3 server in a Debian VPS +# by calocen [at] gmail [dot] com + +# getting some enviromment values +myhostname=`hostname -f` +mydomain=`hostname -d` +myip=`hostname -i` +[ ! -x /usr/bin/geoiplookup ] && apt-get --assume-yes install geoip-bin +mycountry=`geoiplookup $myip | cut -f4 -d" " | cut -f1 -d","` +myprovince=`geoiplookup $myip | cut -f5 -d" "` + +# reconfiguring webalizer, postfix +# could be cool to modify here webalizer values +dpkg-reconfigure -u webalizer +postconf -e "myhostname = $myhostname" +postconf -e "mydestination = $myhostname, localhost" +echo $myhostname > /etc/mailname +dpkg-reconfigure -u postfix + +# request new password +oldpwd=`grep password /root/.my.cnf | tr "\t" " " | tr -s " " | cut -f3 -d" "` +read -p "mysql password: [$oldpwd] " mysqlpwd +[ -z $mysqlpwd ] && mysqlpwd=$oldpwd +echo $mysqlpwd +#read -p "Are you sure? (y/n) " sure +## who said fear ## +set -x +mysqladmin -u root -p$oldpwd password $mysqlpwd +mysqladmin -u root -p$mysqlpwd -h localhost password $mysqlpwd +cat << EOF > /root/.my.cnf +[client] +password = $mysqlpwd +EOF +chmod 600 /root/.my.cnf + +# changing mydns password +mysql -e "SET PASSWORD FOR 'mydns'@'%' = PASSWORD( '$mysqlpwd' )" +mysql -e "SET PASSWORD FOR 'mydns'@'localhost' = PASSWORD( '$mysqlpwd' )" +cp -ax /etc/mydns.conf /etc/mydns.conf~ +sed s/$oldpwd/$mysqlpwd/g < /etc/mydns.conf~ > /etc/mydns.conf + +# enabling mydns +mydns --create-tables > /tmp/mydns.sql +mysql -e "CREATE DATABASE IF NOT EXISTS mydns ; USE mydns ; SOURCE /tmp/mydns.sql;" +rm /tmp/mydns.* +invoke-rc.d mydns restart + +# preparing server installation +mv /etc/ssl/openssl.cnf /etc/ssl/openssl.cnf~ +sed s/"YOURHOSTNAME"/"$myhostname"/g < /usr/local/bin/openssl.cnf | +sed s/"YOURDOMAIN"/"$mydomain"/g | \ +sed s/"YOURCOUNTRY"/"$mycountry"/g | \ +sed s/"YOURPROVINCE"/"$myprovince"/g > /etc/ssl/openssl.cnf + +tar xfz /root/downloads/ISPConfig-3.0.0.7-beta.tar.gz -C /usr/local/src +# here would be some stuff to update from SVN +cd /usr/local/src/ispconfig3_install/install/ +php -q install.php + + diff --git a/helper_scripts/setup_in_openvz/recreate_ssh_and_hostname.sh b/helper_scripts/setup_in_openvz/recreate_ssh_and_hostname.sh index 5ba95c80a481d60192298ce2362df8c6f13166f5..72c2ab61a2779f8acaa69ae32225c89e31187862 100644 --- a/helper_scripts/setup_in_openvz/recreate_ssh_and_hostname.sh +++ b/helper_scripts/setup_in_openvz/recreate_ssh_and_hostname.sh @@ -1,18 +1,18 @@ -#!/bin/bash -set -x -echo "" > /etc/resolv.conf -echo "" > /etc/hostname -echo "" > /etc/mailname -rm -f /etc/ssh/ssh_host_* -cat << EOF > /etc/rc2.d/S15ssh_gen_host_keys -#!/bin/bash -ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N '' -ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N '' -dpkg-reconfigure -u webalizer -postconf -e "myhostname = $(hostname -f)" -postconf -e "mydestination = $(hostname -f), localhost" -echo $(hostname -f) > /etc/mailname -dpkg-reconfigure -u postfix -rm -f \$0 -EOF -chmod a+x /etc/rc2.d/S15ssh_gen_host_keys +#!/bin/bash +set -x +echo "" > /etc/resolv.conf +echo "" > /etc/hostname +echo "" > /etc/mailname +rm -f /etc/ssh/ssh_host_* +cat << EOF > /etc/rc2.d/S15ssh_gen_host_keys +#!/bin/bash +ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N '' +ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N '' +dpkg-reconfigure -u webalizer +postconf -e "myhostname = $(hostname -f)" +postconf -e "mydestination = $(hostname -f), localhost" +echo $(hostname -f) > /etc/mailname +dpkg-reconfigure -u postfix +rm -f \$0 +EOF +chmod a+x /etc/rc2.d/S15ssh_gen_host_keys diff --git a/install/autoupdate.php b/install/autoupdate.php index d4bbfcd11e51e6454cdb59a68b11edd7dabd110d..647fc34202f80fb1f7b1715a58365e28f4372629 100644 --- a/install/autoupdate.php +++ b/install/autoupdate.php @@ -1,314 +1,314 @@ ->This script is for internal use only! Please use update.php! \n\n"; - exit; -} - -//** Include the library with the basic installer functions -require_once('lib/install.lib.php'); - -//** Include the library with the basic updater functions -require_once('lib/update.lib.php'); - -//** Include the base class of the installer class -require_once('lib/installer_base.lib.php'); - -//** Ensure that current working directory is install directory -$cur_dir = getcwd(); -if(realpath(dirname(__FILE__)) != $cur_dir) die("Please run installation/update from _inside_ the install directory!\n"); - -//** Install logfile -define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log'); -define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../')); - -//** Get distribution identifier -$dist = get_distname(); - -include_once("/usr/local/ispconfig/server/lib/config.inc.php"); -$conf_old = $conf; -unset($conf); - -if($dist['id'] == '') die('Linux distribution or version not recognized.'); - -//** Include the distribution-specific installer class library and configuration -if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php'); -include_once('dist/lib/'.$dist['id'].'.lib.php'); -include_once('dist/conf/'.$dist['id'].'.conf.php'); - -//** Get hostname -exec('hostname -f', $tmp_out); -$conf['hostname'] = $tmp_out[0]; -unset($tmp_out); - -//** Set the mysql login information -$conf["mysql"]["host"] = $conf_old["db_host"]; -$conf["mysql"]["database"] = $conf_old["db_database"]; -$conf['mysql']['charset'] = 'utf8'; -$conf["mysql"]["ispconfig_user"] = $conf_old["db_user"]; -$conf["mysql"]["ispconfig_password"] = $conf_old["db_password"]; -$conf['language'] = $conf_old['language']; -if($conf['language'] == '{language}') $conf['language'] = 'en'; - -if(isset($conf_old["dbmaster_host"])) $conf["mysql"]["master_host"] = $conf_old["dbmaster_host"]; -if(isset($conf_old["dbmaster_database"])) $conf["mysql"]["master_database"] = $conf_old["dbmaster_database"]; -if(isset($conf_old["dbmaster_user"])) $conf["mysql"]["master_ispconfig_user"] = $conf_old["dbmaster_user"]; -if(isset($conf_old["dbmaster_password"])) $conf["mysql"]["master_ispconfig_password"] = $conf_old["dbmaster_password"]; - -//* Check if this is a master / slave setup -$conf['mysql']['master_slave_setup'] = 'n'; -if($conf["mysql"]["master_host"] != '' && $conf["mysql"]["host"] != $conf["mysql"]["master_host"]) { - $conf['mysql']['master_slave_setup'] = 'y'; -} - -// Resolve the IP address of the mysql hostname. -if(!$conf['mysql']['ip'] = gethostbyname($conf['mysql']['host'])) die('Unable to resolve hostname'.$conf['mysql']['host']); - -$conf['server_id'] = intval($conf_old["server_id"]); -$conf['ispconfig_log_priority'] = $conf_old["log_priority"]; - -$inst = new installer(); -$inst->is_update = true; - -//** Detect the installed applications -$inst->find_installed_apps(); - -//** Initialize the MySQL server connection -include_once('lib/mysql.lib.php'); - -//** Database update is a bit brute force and should be rebuild later ;) - -/* - * Try to read the DB-admin settings - */ -$clientdb_host = ''; -$clientdb_user = ''; -$clientdb_password = ''; -include_once("/usr/local/ispconfig/server/lib/mysql_clientdb.conf"); -$conf["mysql"]["admin_user"] = $clientdb_user; -$conf["mysql"]["admin_password"] = $clientdb_password; -$clientdb_host = ''; -$clientdb_user = ''; -$clientdb_password = ''; - -//** There is a error if user for mysql admin_password if empty -if( empty($conf["mysql"]["admin_password"]) ) { - die("internal error - MYSQL-Root passord not known"); -} - -/* - * Prepare the dump of the database -*/ -prepareDBDump(); - -//* initialize the database -$inst->db = new db(); - -/* - * The next line is a bit tricky! - * At the automated update we have no connection to the master-db (we don't need it, because - * there are only TWO points, where this is needed) - * 1) update the rights --> the autoupdater sets the rights of all clients when the server is - * autoupdated) - * 2) update the server-settings (is web installed, is mail installed) --> the autoupdates - * doesn't change any of this settings, so there ist no need to update this. - * This means, the autoupdater did not need any connection to the master-db (only to the local bd - * of the master-server). To avoid any problems, we set the master-db to the local one. - */ -$inst->dbmaster = $inst->db; - -/* - * If it is NOT a master-slave - Setup then we are at the Master-DB. So set all rights -*/ -if($conf['mysql']['master_slave_setup'] != 'y') { - $inst->grant_master_database_rights(); -} - -/* - * dump the new Database and reconfigure the server.ini - */ -updateDbAndIni(); - -/* - * Reconfigure all Services - */ -if($conf['services']['mail'] == true) { - //** Configure postfix - swriteln('Configuring Postfix'); - $inst->configure_postfix('dont-create-certs'); - - //** Configure mailman - swriteln('Configuring Mailman'); - $inst->configure_mailman('update'); - - //* Configure Jailkit - swriteln('Configuring Jailkit'); - $inst->configure_jailkit(); - - if($conf['dovecot']['installed'] == true) { - //* Configure dovecot - swriteln('Configuring Dovecot'); - $inst->configure_dovecot(); - } else { - //** Configure saslauthd - swriteln('Configuring SASL'); - $inst->configure_saslauthd(); - - //** Configure PAM - swriteln('Configuring PAM'); - $inst->configure_pam(); - - //* Configure courier - swriteln('Configuring Courier'); - $inst->configure_courier(); - } - - //** Configure Spamasassin - swriteln('Configuring Spamassassin'); - $inst->configure_spamassassin(); - - //** Configure Amavis - swriteln('Configuring Amavisd'); - $inst->configure_amavis(); - - //** Configure Getmail - swriteln('Configuring Getmail'); - $inst->configure_getmail(); -} - -if($conf['services']['web'] == true) { - //** Configure Pureftpd - swriteln('Configuring Pureftpd'); - $inst->configure_pureftpd(); -} - -if($conf['services']['dns'] == true) { - //* Configure DNS - if($conf['powerdns']['installed'] == true) { - swriteln('Configuring PowerDNS'); - $inst->configure_powerdns(); - } elseif($conf['bind']['installed'] == true) { - swriteln('Configuring BIND'); - $inst->configure_bind(); - } else { - swriteln('Configuring MyDNS'); - $inst->configure_mydns(); - } -} - -if($conf['services']['web'] == true) { - //** Configure Apache - swriteln('Configuring Apache'); - $inst->configure_apache(); - - //** Configure vlogger - swriteln('Configuring vlogger'); - $inst->configure_vlogger(); - - //** Configure apps vhost - swriteln('Configuring Apps vhost'); - $inst->configure_apps_vhost(); -} - - -//* Configure DBServer -swriteln('Configuring Database'); -$inst->configure_dbserver(); - - -//if(@is_dir('/etc/Bastille')) { -//* Configure Firewall -swriteln('Configuring Firewall'); -$inst->configure_firewall(); -//} - -//** Configure ISPConfig -swriteln('Updating ISPConfig'); - - -//** Customise the port ISPConfig runs on -$conf['apache']['vhost_port'] = get_ispconfig_port_number(); - -$inst->install_ispconfig(); - -//** Configure Crontab -swriteln('Updating Crontab'); -$inst->install_crontab(); - -//** Restart services: -swriteln('Restarting services ...'); -if($conf['mysql']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mysql']['init_script'])) system($conf['init_scripts'].'/'.$conf['mysql']['init_script'].' reload'); -if($conf['services']['mail']) { - if($conf['postfix']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart'); - if($conf['saslauthd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart'); - if($conf['amavis']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart'); - if($conf['clamav']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart'); - if($conf['courier']['courier-authdaemon'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart'); - if($conf['courier']['courier-imap'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart'); - if($conf['courier']['courier-imap-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart'); - if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); - if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); - if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); - if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart'); -} -if($conf['services']['web']) { - if($conf['apache']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); - if($conf['pureftpd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart'); -} -if($conf['services']['dns']) { - if($conf['mydns']['installed'] == true && $conf['mydns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null'); - if($conf['powerdns']['installed'] == true && $conf['powerdns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['powerdns']['init_script'])) system($conf['init_scripts'].'/'.$conf['powerdns']['init_script'].' restart &> /dev/null'); - if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['bind']['init_script'])) system($conf['init_scripts'].'/'.$conf['bind']['init_script'].' restart &> /dev/null'); -} - -echo "Update finished.\n"; - -?> +>This script is for internal use only! Please use update.php! \n\n"; + exit; +} + +//** Include the library with the basic installer functions +require_once('lib/install.lib.php'); + +//** Include the library with the basic updater functions +require_once('lib/update.lib.php'); + +//** Include the base class of the installer class +require_once('lib/installer_base.lib.php'); + +//** Ensure that current working directory is install directory +$cur_dir = getcwd(); +if(realpath(dirname(__FILE__)) != $cur_dir) die("Please run installation/update from _inside_ the install directory!\n"); + +//** Install logfile +define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log'); +define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../')); + +//** Get distribution identifier +$dist = get_distname(); + +include_once("/usr/local/ispconfig/server/lib/config.inc.php"); +$conf_old = $conf; +unset($conf); + +if($dist['id'] == '') die('Linux distribution or version not recognized.'); + +//** Include the distribution-specific installer class library and configuration +if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php'); +include_once('dist/lib/'.$dist['id'].'.lib.php'); +include_once('dist/conf/'.$dist['id'].'.conf.php'); + +//** Get hostname +exec('hostname -f', $tmp_out); +$conf['hostname'] = $tmp_out[0]; +unset($tmp_out); + +//** Set the mysql login information +$conf["mysql"]["host"] = $conf_old["db_host"]; +$conf["mysql"]["database"] = $conf_old["db_database"]; +$conf['mysql']['charset'] = 'utf8'; +$conf["mysql"]["ispconfig_user"] = $conf_old["db_user"]; +$conf["mysql"]["ispconfig_password"] = $conf_old["db_password"]; +$conf['language'] = $conf_old['language']; +if($conf['language'] == '{language}') $conf['language'] = 'en'; + +if(isset($conf_old["dbmaster_host"])) $conf["mysql"]["master_host"] = $conf_old["dbmaster_host"]; +if(isset($conf_old["dbmaster_database"])) $conf["mysql"]["master_database"] = $conf_old["dbmaster_database"]; +if(isset($conf_old["dbmaster_user"])) $conf["mysql"]["master_ispconfig_user"] = $conf_old["dbmaster_user"]; +if(isset($conf_old["dbmaster_password"])) $conf["mysql"]["master_ispconfig_password"] = $conf_old["dbmaster_password"]; + +//* Check if this is a master / slave setup +$conf['mysql']['master_slave_setup'] = 'n'; +if($conf["mysql"]["master_host"] != '' && $conf["mysql"]["host"] != $conf["mysql"]["master_host"]) { + $conf['mysql']['master_slave_setup'] = 'y'; +} + +// Resolve the IP address of the mysql hostname. +if(!$conf['mysql']['ip'] = gethostbyname($conf['mysql']['host'])) die('Unable to resolve hostname'.$conf['mysql']['host']); + +$conf['server_id'] = intval($conf_old["server_id"]); +$conf['ispconfig_log_priority'] = $conf_old["log_priority"]; + +$inst = new installer(); +$inst->is_update = true; + +//** Detect the installed applications +$inst->find_installed_apps(); + +//** Initialize the MySQL server connection +include_once('lib/mysql.lib.php'); + +//** Database update is a bit brute force and should be rebuild later ;) + +/* + * Try to read the DB-admin settings + */ +$clientdb_host = ''; +$clientdb_user = ''; +$clientdb_password = ''; +include_once("/usr/local/ispconfig/server/lib/mysql_clientdb.conf"); +$conf["mysql"]["admin_user"] = $clientdb_user; +$conf["mysql"]["admin_password"] = $clientdb_password; +$clientdb_host = ''; +$clientdb_user = ''; +$clientdb_password = ''; + +//** There is a error if user for mysql admin_password if empty +if( empty($conf["mysql"]["admin_password"]) ) { + die("internal error - MYSQL-Root passord not known"); +} + +/* + * Prepare the dump of the database +*/ +prepareDBDump(); + +//* initialize the database +$inst->db = new db(); + +/* + * The next line is a bit tricky! + * At the automated update we have no connection to the master-db (we don't need it, because + * there are only TWO points, where this is needed) + * 1) update the rights --> the autoupdater sets the rights of all clients when the server is + * autoupdated) + * 2) update the server-settings (is web installed, is mail installed) --> the autoupdates + * doesn't change any of this settings, so there ist no need to update this. + * This means, the autoupdater did not need any connection to the master-db (only to the local bd + * of the master-server). To avoid any problems, we set the master-db to the local one. + */ +$inst->dbmaster = $inst->db; + +/* + * If it is NOT a master-slave - Setup then we are at the Master-DB. So set all rights +*/ +if($conf['mysql']['master_slave_setup'] != 'y') { + $inst->grant_master_database_rights(); +} + +/* + * dump the new Database and reconfigure the server.ini + */ +updateDbAndIni(); + +/* + * Reconfigure all Services + */ +if($conf['services']['mail'] == true) { + //** Configure postfix + swriteln('Configuring Postfix'); + $inst->configure_postfix('dont-create-certs'); + + //** Configure mailman + swriteln('Configuring Mailman'); + $inst->configure_mailman('update'); + + //* Configure Jailkit + swriteln('Configuring Jailkit'); + $inst->configure_jailkit(); + + if($conf['dovecot']['installed'] == true) { + //* Configure dovecot + swriteln('Configuring Dovecot'); + $inst->configure_dovecot(); + } else { + //** Configure saslauthd + swriteln('Configuring SASL'); + $inst->configure_saslauthd(); + + //** Configure PAM + swriteln('Configuring PAM'); + $inst->configure_pam(); + + //* Configure courier + swriteln('Configuring Courier'); + $inst->configure_courier(); + } + + //** Configure Spamasassin + swriteln('Configuring Spamassassin'); + $inst->configure_spamassassin(); + + //** Configure Amavis + swriteln('Configuring Amavisd'); + $inst->configure_amavis(); + + //** Configure Getmail + swriteln('Configuring Getmail'); + $inst->configure_getmail(); +} + +if($conf['services']['web'] == true) { + //** Configure Pureftpd + swriteln('Configuring Pureftpd'); + $inst->configure_pureftpd(); +} + +if($conf['services']['dns'] == true) { + //* Configure DNS + if($conf['powerdns']['installed'] == true) { + swriteln('Configuring PowerDNS'); + $inst->configure_powerdns(); + } elseif($conf['bind']['installed'] == true) { + swriteln('Configuring BIND'); + $inst->configure_bind(); + } else { + swriteln('Configuring MyDNS'); + $inst->configure_mydns(); + } +} + +if($conf['services']['web'] == true) { + //** Configure Apache + swriteln('Configuring Apache'); + $inst->configure_apache(); + + //** Configure vlogger + swriteln('Configuring vlogger'); + $inst->configure_vlogger(); + + //** Configure apps vhost + swriteln('Configuring Apps vhost'); + $inst->configure_apps_vhost(); +} + + +//* Configure DBServer +swriteln('Configuring Database'); +$inst->configure_dbserver(); + + +//if(@is_dir('/etc/Bastille')) { +//* Configure Firewall +swriteln('Configuring Firewall'); +$inst->configure_firewall(); +//} + +//** Configure ISPConfig +swriteln('Updating ISPConfig'); + + +//** Customise the port ISPConfig runs on +$conf['apache']['vhost_port'] = get_ispconfig_port_number(); + +$inst->install_ispconfig(); + +//** Configure Crontab +swriteln('Updating Crontab'); +$inst->install_crontab(); + +//** Restart services: +swriteln('Restarting services ...'); +if($conf['mysql']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mysql']['init_script'])) system($conf['init_scripts'].'/'.$conf['mysql']['init_script'].' reload'); +if($conf['services']['mail']) { + if($conf['postfix']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart'); + if($conf['saslauthd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart'); + if($conf['amavis']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart'); + if($conf['clamav']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart'); + if($conf['courier']['courier-authdaemon'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart'); + if($conf['courier']['courier-imap'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart'); + if($conf['courier']['courier-imap-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart'); + if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); + if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); + if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); + if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart'); +} +if($conf['services']['web']) { + if($conf['apache']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); + if($conf['pureftpd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart'); +} +if($conf['services']['dns']) { + if($conf['mydns']['installed'] == true && $conf['mydns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null'); + if($conf['powerdns']['installed'] == true && $conf['powerdns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['powerdns']['init_script'])) system($conf['init_scripts'].'/'.$conf['powerdns']['init_script'].' restart &> /dev/null'); + if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['bind']['init_script'])) system($conf['init_scripts'].'/'.$conf['bind']['init_script'].' restart &> /dev/null'); +} + +echo "Update finished.\n"; + +?> diff --git a/install/dist/conf/debian40.conf.php b/install/dist/conf/debian40.conf.php index 35c4deae272686a988808a643ca0090713ad99d4..a3db4dd81c27bf40d8ba4d8227ef21980ae26c89 100644 --- a/install/dist/conf/debian40.conf.php +++ b/install/dist/conf/debian40.conf.php @@ -1,195 +1,195 @@ - + diff --git a/install/dist/conf/debian60.conf.php b/install/dist/conf/debian60.conf.php index 6962adb22c13c71c6e3addba3396ffbe0d2a4ae8..f4e8ba6ac34f55addc73280974016c40b625f9d4 100644 --- a/install/dist/conf/debian60.conf.php +++ b/install/dist/conf/debian60.conf.php @@ -1,195 +1,195 @@ - + diff --git a/install/install.php b/install/install.php index a17e0393eab6925fbb0763ca7cbe17c20328b6c3..d79450f72aa9dc4c6961bfd268155a4fa89cdc40 100644 --- a/install/install.php +++ b/install/install.php @@ -1,490 +1,490 @@ -> Initial configuration \n\n"; - -//** Include the library with the basic installer functions -require_once('lib/install.lib.php'); - -//** Include the base class of the installer class -require_once('lib/installer_base.lib.php'); - -//** Ensure that current working directory is install directory -$cur_dir = getcwd(); -if(realpath(dirname(__FILE__)) != $cur_dir) { - chdir( realpath(dirname(__FILE__)) ); -} - -//** Install logfile -define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log'); -define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../')); - -//** Check for existing installation -/*if(is_dir("/usr/local/ispconfig")) { - die('We will stop here. There is already a ISPConfig installation, use the update script to update this installation.'); -}*/ - -//** Get distribution identifier -$dist = get_distname(); - -if($dist['id'] == '') die('Linux distribution or version not recognized.'); - -//** Include the distribution-specific installer class library and configuration -if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php'); -include_once('dist/lib/'.$dist['id'].'.lib.php'); -include_once('dist/conf/'.$dist['id'].'.conf.php'); - -//**************************************************************************************************** -//** Installer Interface -//**************************************************************************************************** -$inst = new installer(); -swriteln($inst->lng(' Following will be a few questions for primary configuration so be careful.')); -swriteln($inst->lng(' Default values are in [brackets] and can be accepted with .')); -swriteln($inst->lng(' Tap in "quit" (without the quotes) to stop the installer.'."\n\n")); - -//** Check log file is writable (probably not root or sudo) -if(!is_writable(dirname(ISPC_LOG_FILE))){ - die("ERROR: Cannot write to the ".dirname(ISPC_LOG_FILE)." directory. Are you root or sudo ?\n\n"); -} - -if(is_dir('/root/ispconfig') || is_dir('/home/admispconfig')) { - die('This software cannot be installed on a server wich runs ISPConfig 2.x.'); -} - -if(is_dir('/usr/local/ispconfig')) { - die('ISPConfig 3 installation found. Please use update.php instead if install.php to update the installation.'); -} - -//** Detect the installed applications -$inst->find_installed_apps(); - -//** Select the language -$conf['language'] = $inst->simple_query('Select language', array('en','de'), 'en'); - -//** Select installation mode -$install_mode = $inst->simple_query('Installation mode', array('standard','expert'), 'standard'); - - -//** Get the hostname -$tmp_out = array(); -exec('hostname -f', $tmp_out); -$conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', $tmp_out[0]); -unset($tmp_out); - -// Check if the mysql functions are loaded in PHP -if(!function_exists('mysql_connect')) die('No PHP MySQL functions available. Please ensure that the PHP MySQL module is loaded.'); - -//** Get MySQL root credentials -$finished = false; -do { - $tmp_mysql_server_host = $inst->free_query('MySQL server hostname', $conf['mysql']['host']); - $tmp_mysql_server_admin_user = $inst->free_query('MySQL root username', $conf['mysql']['admin_user']); - $tmp_mysql_server_admin_password = $inst->free_query('MySQL root password', $conf['mysql']['admin_password']); - $tmp_mysql_server_database = $inst->free_query('MySQL database to create', $conf['mysql']['database']); - $tmp_mysql_server_charset = $inst->free_query('MySQL charset', $conf['mysql']['charset']); - - //* Initialize the MySQL server connection - if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { - $conf['mysql']['host'] = $tmp_mysql_server_host; - $conf['mysql']['admin_user'] = $tmp_mysql_server_admin_user; - $conf['mysql']['admin_password'] = $tmp_mysql_server_admin_password; - $conf['mysql']['database'] = $tmp_mysql_server_database; - $conf['mysql']['charset'] = $tmp_mysql_server_charset; - $finished = true; - } else { - swriteln($inst->lng('Unable to connect to the specified MySQL server').' '.mysql_error()); - } -} while ($finished == false); -unset($finished); - -// Resolve the IP address of the MySQL hostname. -$tmp = explode(':',$conf['mysql']['host']); -if(!$conf['mysql']['ip'] = gethostbyname($tmp[0])) die('Unable to resolve hostname'.$tmp[0]); -unset($tmp); - - -//** Initializing database connection -include_once('lib/mysql.lib.php'); -$inst->db = new db(); - -//** Begin with standard or expert installation -if($install_mode == 'standard') { - - //* Create the MySQL database - $inst->configure_database(); - - //* Insert the Server record into the database - $inst->add_database_server_record(); - - //* Configure Postfix - $inst->configure_postfix(); - - //* Configure Mailman - $inst->configure_mailman('install'); - - //* Configure jailkit - swriteln('Configuring Jailkit'); - $inst->configure_jailkit(); - - if($conf['dovecot']['installed'] == true) { - //* Configure Dovecot - swriteln('Configuring Dovecot'); - $inst->configure_dovecot(); - } else { - //* Configure saslauthd - swriteln('Configuring SASL'); - $inst->configure_saslauthd(); - - //* Configure PAM - swriteln('Configuring PAM'); - $inst->configure_pam(); - - //* Configure Courier - swriteln('Configuring Courier'); - $inst->configure_courier(); - } - - //* Configure Spamasassin - swriteln('Configuring Spamassassin'); - $inst->configure_spamassassin(); - - //* Configure Amavis - swriteln('Configuring Amavisd'); - $inst->configure_amavis(); - - //* Configure Getmail - swriteln('Configuring Getmail'); - $inst->configure_getmail(); - - - //* Configure Pureftpd - swriteln('Configuring Pureftpd'); - $inst->configure_pureftpd(); - - //* Configure DNS - if($conf['powerdns']['installed'] == true) { - swriteln('Configuring PowerDNS'); - $inst->configure_powerdns(); - } elseif($conf['bind']['installed'] == true) { - swriteln('Configuring BIND'); - $inst->configure_bind(); - } else { - swriteln('Configuring MyDNS'); - $inst->configure_mydns(); - } - - //* Configure Apache - swriteln('Configuring Apache'); - $inst->configure_apache(); - - //** Configure Vlogger - swriteln('Configuring Vlogger'); - $inst->configure_vlogger(); - - //** Configure apps vhost - swriteln('Configuring Apps vhost'); - $inst->configure_apps_vhost(); - - //* Configure Firewall - swriteln('Configuring Firewall'); - $inst->configure_firewall(); - - //* Configure ISPConfig - swriteln('Installing ISPConfig'); - - //** Customize the port ISPConfig runs on - $conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080'); - - $inst->install_ispconfig(); - - //* Configure DBServer - swriteln('Configuring DBServer'); - $inst->configure_dbserver(); - - //* Configure ISPConfig - swriteln('Installing ISPConfig crontab'); - $inst->install_crontab(); - - swriteln('Restarting services ...'); - if($conf['mysql']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mysql']['init_script'])) system($conf['init_scripts'].'/'.$conf['mysql']['init_script'].' restart'); - if($conf['postfix']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart'); - if($conf['saslauthd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart'); - if($conf['amavis']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart'); - if($conf['clamav']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart'); - if($conf['courier']['courier-authdaemon'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart'); - if($conf['courier']['courier-imap'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart'); - if($conf['courier']['courier-imap-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart'); - if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); - if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); - if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); - if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart'); - if($conf['apache']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); - if($conf['pureftpd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart'); - if($conf['mydns']['installed'] == true && $conf['mydns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null'); - if($conf['powerdns']['installed'] == true && $conf['powerdns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['powerdns']['init_script'])) system($conf['init_scripts'].'/'.$conf['powerdns']['init_script'].' restart &> /dev/null'); - if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['bind']['init_script'])) system($conf['init_scripts'].'/'.$conf['bind']['init_script'].' restart &> /dev/null'); - -}else{ - - //* In expert mode, we select the services in the following steps, only db is always available - $conf['services']['mail'] = false; - $conf['services']['web'] = false; - $conf['services']['dns'] = false; - $conf['services']['db'] = true; - - - //** Get Server ID - // $conf['server_id'] = $inst->free_query('Unique Numeric ID of the server','1'); - // Server ID is an autoInc value of the mysql database now - - if(strtolower($inst->simple_query('Shall this server join an existing ISPConfig multiserver setup',array('y','n'),'n')) == 'y') { - $conf['mysql']['master_slave_setup'] = 'y'; - - //** Get MySQL root credentials - $finished = false; - do { - $tmp_mysql_server_host = $inst->free_query('MySQL master server hostname', $conf['mysql']['master_host']); - $tmp_mysql_server_admin_user = $inst->free_query('MySQL master server root username', $conf['mysql']['master_admin_user']); - $tmp_mysql_server_admin_password = $inst->free_query('MySQL master server root password', $conf['mysql']['master_admin_password']); - $tmp_mysql_server_database = $inst->free_query('MySQL master server database name', $conf['mysql']['master_database']); - - //* Initialize the MySQL server connection - if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { - $conf['mysql']['master_host'] = $tmp_mysql_server_host; - $conf['mysql']['master_admin_user'] = $tmp_mysql_server_admin_user; - $conf['mysql']['master_admin_password'] = $tmp_mysql_server_admin_password; - $conf['mysql']['master_database'] = $tmp_mysql_server_database; - $finished = true; - } else { - swriteln($inst->lng('Unable to connect to mysql server').' '.mysql_error()); - } - } while ($finished == false); - unset($finished); - - // initialize the connection to the master database - $inst->dbmaster = new db(); - if($inst->dbmaster->linkId) $inst->dbmaster->closeConn(); - $inst->dbmaster->dbHost = $conf['mysql']["master_host"]; - $inst->dbmaster->dbName = $conf['mysql']["master_database"]; - $inst->dbmaster->dbUser = $conf['mysql']["master_admin_user"]; - $inst->dbmaster->dbPass = $conf['mysql']["master_admin_password"]; - - } else { - // the master DB is the same then the slave DB - $inst->dbmaster = $inst->db; - } - - //* Create the mysql database - $inst->configure_database(); - - //* Insert the Server record into the database - swriteln('Adding ISPConfig server record to database.'); - swriteln(''); - $inst->add_database_server_record(); - - - if(strtolower($inst->simple_query('Configure Mail', array('y','n') ,'y') ) == 'y') { - - $conf['services']['mail'] = true; - - //* Configure Postfix - swriteln('Configuring Postfix'); - $inst->configure_postfix(); - - //* Configure Mailman - swriteln('Configuring Mailman'); - $inst->configure_mailman(); - - if($conf['dovecot']['installed'] == true) { - //* Configure dovecot - swriteln('Configuring Dovecot'); - $inst->configure_dovecot(); - } else { - - //* Configure saslauthd - swriteln('Configuring SASL'); - $inst->configure_saslauthd(); - - //* Configure PAM - swriteln('Configuring PAM'); - $inst->configure_pam(); - - //* Configure courier - swriteln('Configuring Courier'); - $inst->configure_courier(); - } - - //* Configure Spamasassin - swriteln('Configuring Spamassassin'); - $inst->configure_spamassassin(); - - //* Configure Amavis - swriteln('Configuring Amavisd'); - $inst->configure_amavis(); - - //* Configure Getmail - swriteln('Configuring Getmail'); - $inst->configure_getmail(); - - if($conf['postfix']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart'); - if($conf['saslauthd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart'); - if($conf['amavis']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart'); - if($conf['clamav']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart'); - if($conf['courier']['courier-authdaemon'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart'); - if($conf['courier']['courier-imap'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart'); - if($conf['courier']['courier-imap-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart'); - if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); - if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); - if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); - if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart'); - } - - //** Configure Jailkit - if(strtolower($inst->simple_query('Configure Jailkit', array('y','n'),'y') ) == 'y') { - swriteln('Configuring Jailkit'); - $inst->configure_jailkit(); - } - - //** Configure Pureftpd - if(strtolower($inst->simple_query('Configure FTP Server', array('y','n'),'y') ) == 'y') { - swriteln('Configuring Pureftpd'); - $inst->configure_pureftpd(); - if($conf['pureftpd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart'); - } - - //** Configure DNS - if(strtolower($inst->simple_query('Configure DNS Server',array('y','n'),'y')) == 'y') { - $conf['services']['dns'] = true; - //* Configure DNS - if($conf['powerdns']['installed'] == true) { - swriteln('Configuring PowerDNS'); - $inst->configure_powerdns(); - if($conf['powerdns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['powerdns']['init_script'])) system($conf['init_scripts'].'/'.$conf['powerdns']['init_script'].' restart &> /dev/null'); - } elseif($conf['bind']['installed'] == true) { - swriteln('Configuring BIND'); - $inst->configure_bind(); - if($conf['bind']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['bind']['init_script'])) system($conf['init_scripts'].'/'.$conf['bind']['init_script'].' restart &> /dev/null'); - } else { - swriteln('Configuring MyDNS'); - $inst->configure_mydns(); - if($conf['mydns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null'); - } - - } - - //** Configure Apache - swriteln("\nHint: If this server shall run the ISPConfig interface, select 'y' in the 'Configure Apache Server' option.\n"); - if(strtolower($inst->simple_query('Configure Apache Server',array('y','n'),'y')) == 'y') { - $conf['services']['web'] = true; - swriteln('Configuring Apache'); - $inst->configure_apache(); - - //** Configure Vlogger - swriteln('Configuring Vlogger'); - $inst->configure_vlogger(); - - //** Configure apps vhost - swriteln('Configuring Apps vhost'); - $inst->configure_apps_vhost(); - } - - //** Configure Firewall - if(strtolower($inst->simple_query('Configure Firewall Server',array('y','n'),'y')) == 'y') { - swriteln('Configuring Firewall'); - $inst->configure_firewall(); - } - //** Configure ISPConfig :-) - if(strtolower($inst->simple_query('Install ISPConfig Web Interface',array('y','n'),'y')) == 'y') { - swriteln('Installing ISPConfig'); - - //** We want to check if the server is a module or cgi based php enabled server - //** TODO: Don't always ask for this somehow ? - /* - $fast_cgi = $inst->simple_query('CGI PHP Enabled Server?', array('yes','no'),'no'); - - if($fast_cgi == 'yes') { - $alias = $inst->free_query('Script Alias', '/php/'); - $path = $inst->free_query('Script Alias Path', '/path/to/cgi/bin'); - $conf['apache']['vhost_cgi_alias'] = sprintf('ScriptAlias %s %s', $alias, $path); - } else { - $conf['apache']['vhost_cgi_alias'] = ""; - } - */ - - //** Customise the port ISPConfig runs on - $conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080'); - - if(strtolower($inst->simple_query('Enable SSL for the ISPConfig web interface',array('y','n'),'y')) == 'y') { - $inst->make_ispconfig_ssl_cert(); - } - - $inst->install_ispconfig_interface = true; - - } else { - $inst->install_ispconfig_interface = false; - } - - $inst->install_ispconfig(); - - //* Configure DBServer - swriteln('Configuring DBServer'); - $inst->configure_dbserver(); - - //* Configure ISPConfig - swriteln('Installing ISPConfig crontab'); - $inst->install_crontab(); - if($conf['apache']['init_script'] != '' && @is_file($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); - - - -} //* << $install_mode / 'Standard' or Genius - - -echo "Installation completed.\n"; - - -?> +> Initial configuration \n\n"; + +//** Include the library with the basic installer functions +require_once('lib/install.lib.php'); + +//** Include the base class of the installer class +require_once('lib/installer_base.lib.php'); + +//** Ensure that current working directory is install directory +$cur_dir = getcwd(); +if(realpath(dirname(__FILE__)) != $cur_dir) { + chdir( realpath(dirname(__FILE__)) ); +} + +//** Install logfile +define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log'); +define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../')); + +//** Check for existing installation +/*if(is_dir("/usr/local/ispconfig")) { + die('We will stop here. There is already a ISPConfig installation, use the update script to update this installation.'); +}*/ + +//** Get distribution identifier +$dist = get_distname(); + +if($dist['id'] == '') die('Linux distribution or version not recognized.'); + +//** Include the distribution-specific installer class library and configuration +if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php'); +include_once('dist/lib/'.$dist['id'].'.lib.php'); +include_once('dist/conf/'.$dist['id'].'.conf.php'); + +//**************************************************************************************************** +//** Installer Interface +//**************************************************************************************************** +$inst = new installer(); +swriteln($inst->lng(' Following will be a few questions for primary configuration so be careful.')); +swriteln($inst->lng(' Default values are in [brackets] and can be accepted with .')); +swriteln($inst->lng(' Tap in "quit" (without the quotes) to stop the installer.'."\n\n")); + +//** Check log file is writable (probably not root or sudo) +if(!is_writable(dirname(ISPC_LOG_FILE))){ + die("ERROR: Cannot write to the ".dirname(ISPC_LOG_FILE)." directory. Are you root or sudo ?\n\n"); +} + +if(is_dir('/root/ispconfig') || is_dir('/home/admispconfig')) { + die('This software cannot be installed on a server wich runs ISPConfig 2.x.'); +} + +if(is_dir('/usr/local/ispconfig')) { + die('ISPConfig 3 installation found. Please use update.php instead if install.php to update the installation.'); +} + +//** Detect the installed applications +$inst->find_installed_apps(); + +//** Select the language +$conf['language'] = $inst->simple_query('Select language', array('en','de'), 'en'); + +//** Select installation mode +$install_mode = $inst->simple_query('Installation mode', array('standard','expert'), 'standard'); + + +//** Get the hostname +$tmp_out = array(); +exec('hostname -f', $tmp_out); +$conf['hostname'] = $inst->free_query('Full qualified hostname (FQDN) of the server, eg server1.domain.tld ', $tmp_out[0]); +unset($tmp_out); + +// Check if the mysql functions are loaded in PHP +if(!function_exists('mysql_connect')) die('No PHP MySQL functions available. Please ensure that the PHP MySQL module is loaded.'); + +//** Get MySQL root credentials +$finished = false; +do { + $tmp_mysql_server_host = $inst->free_query('MySQL server hostname', $conf['mysql']['host']); + $tmp_mysql_server_admin_user = $inst->free_query('MySQL root username', $conf['mysql']['admin_user']); + $tmp_mysql_server_admin_password = $inst->free_query('MySQL root password', $conf['mysql']['admin_password']); + $tmp_mysql_server_database = $inst->free_query('MySQL database to create', $conf['mysql']['database']); + $tmp_mysql_server_charset = $inst->free_query('MySQL charset', $conf['mysql']['charset']); + + //* Initialize the MySQL server connection + if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { + $conf['mysql']['host'] = $tmp_mysql_server_host; + $conf['mysql']['admin_user'] = $tmp_mysql_server_admin_user; + $conf['mysql']['admin_password'] = $tmp_mysql_server_admin_password; + $conf['mysql']['database'] = $tmp_mysql_server_database; + $conf['mysql']['charset'] = $tmp_mysql_server_charset; + $finished = true; + } else { + swriteln($inst->lng('Unable to connect to the specified MySQL server').' '.mysql_error()); + } +} while ($finished == false); +unset($finished); + +// Resolve the IP address of the MySQL hostname. +$tmp = explode(':',$conf['mysql']['host']); +if(!$conf['mysql']['ip'] = gethostbyname($tmp[0])) die('Unable to resolve hostname'.$tmp[0]); +unset($tmp); + + +//** Initializing database connection +include_once('lib/mysql.lib.php'); +$inst->db = new db(); + +//** Begin with standard or expert installation +if($install_mode == 'standard') { + + //* Create the MySQL database + $inst->configure_database(); + + //* Insert the Server record into the database + $inst->add_database_server_record(); + + //* Configure Postfix + $inst->configure_postfix(); + + //* Configure Mailman + $inst->configure_mailman('install'); + + //* Configure jailkit + swriteln('Configuring Jailkit'); + $inst->configure_jailkit(); + + if($conf['dovecot']['installed'] == true) { + //* Configure Dovecot + swriteln('Configuring Dovecot'); + $inst->configure_dovecot(); + } else { + //* Configure saslauthd + swriteln('Configuring SASL'); + $inst->configure_saslauthd(); + + //* Configure PAM + swriteln('Configuring PAM'); + $inst->configure_pam(); + + //* Configure Courier + swriteln('Configuring Courier'); + $inst->configure_courier(); + } + + //* Configure Spamasassin + swriteln('Configuring Spamassassin'); + $inst->configure_spamassassin(); + + //* Configure Amavis + swriteln('Configuring Amavisd'); + $inst->configure_amavis(); + + //* Configure Getmail + swriteln('Configuring Getmail'); + $inst->configure_getmail(); + + + //* Configure Pureftpd + swriteln('Configuring Pureftpd'); + $inst->configure_pureftpd(); + + //* Configure DNS + if($conf['powerdns']['installed'] == true) { + swriteln('Configuring PowerDNS'); + $inst->configure_powerdns(); + } elseif($conf['bind']['installed'] == true) { + swriteln('Configuring BIND'); + $inst->configure_bind(); + } else { + swriteln('Configuring MyDNS'); + $inst->configure_mydns(); + } + + //* Configure Apache + swriteln('Configuring Apache'); + $inst->configure_apache(); + + //** Configure Vlogger + swriteln('Configuring Vlogger'); + $inst->configure_vlogger(); + + //** Configure apps vhost + swriteln('Configuring Apps vhost'); + $inst->configure_apps_vhost(); + + //* Configure Firewall + swriteln('Configuring Firewall'); + $inst->configure_firewall(); + + //* Configure ISPConfig + swriteln('Installing ISPConfig'); + + //** Customize the port ISPConfig runs on + $conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080'); + + $inst->install_ispconfig(); + + //* Configure DBServer + swriteln('Configuring DBServer'); + $inst->configure_dbserver(); + + //* Configure ISPConfig + swriteln('Installing ISPConfig crontab'); + $inst->install_crontab(); + + swriteln('Restarting services ...'); + if($conf['mysql']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mysql']['init_script'])) system($conf['init_scripts'].'/'.$conf['mysql']['init_script'].' restart'); + if($conf['postfix']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart'); + if($conf['saslauthd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart'); + if($conf['amavis']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart'); + if($conf['clamav']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart'); + if($conf['courier']['courier-authdaemon'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart'); + if($conf['courier']['courier-imap'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart'); + if($conf['courier']['courier-imap-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart'); + if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); + if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); + if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); + if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart'); + if($conf['apache']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); + if($conf['pureftpd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart'); + if($conf['mydns']['installed'] == true && $conf['mydns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null'); + if($conf['powerdns']['installed'] == true && $conf['powerdns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['powerdns']['init_script'])) system($conf['init_scripts'].'/'.$conf['powerdns']['init_script'].' restart &> /dev/null'); + if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['bind']['init_script'])) system($conf['init_scripts'].'/'.$conf['bind']['init_script'].' restart &> /dev/null'); + +}else{ + + //* In expert mode, we select the services in the following steps, only db is always available + $conf['services']['mail'] = false; + $conf['services']['web'] = false; + $conf['services']['dns'] = false; + $conf['services']['db'] = true; + + + //** Get Server ID + // $conf['server_id'] = $inst->free_query('Unique Numeric ID of the server','1'); + // Server ID is an autoInc value of the mysql database now + + if(strtolower($inst->simple_query('Shall this server join an existing ISPConfig multiserver setup',array('y','n'),'n')) == 'y') { + $conf['mysql']['master_slave_setup'] = 'y'; + + //** Get MySQL root credentials + $finished = false; + do { + $tmp_mysql_server_host = $inst->free_query('MySQL master server hostname', $conf['mysql']['master_host']); + $tmp_mysql_server_admin_user = $inst->free_query('MySQL master server root username', $conf['mysql']['master_admin_user']); + $tmp_mysql_server_admin_password = $inst->free_query('MySQL master server root password', $conf['mysql']['master_admin_password']); + $tmp_mysql_server_database = $inst->free_query('MySQL master server database name', $conf['mysql']['master_database']); + + //* Initialize the MySQL server connection + if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { + $conf['mysql']['master_host'] = $tmp_mysql_server_host; + $conf['mysql']['master_admin_user'] = $tmp_mysql_server_admin_user; + $conf['mysql']['master_admin_password'] = $tmp_mysql_server_admin_password; + $conf['mysql']['master_database'] = $tmp_mysql_server_database; + $finished = true; + } else { + swriteln($inst->lng('Unable to connect to mysql server').' '.mysql_error()); + } + } while ($finished == false); + unset($finished); + + // initialize the connection to the master database + $inst->dbmaster = new db(); + if($inst->dbmaster->linkId) $inst->dbmaster->closeConn(); + $inst->dbmaster->dbHost = $conf['mysql']["master_host"]; + $inst->dbmaster->dbName = $conf['mysql']["master_database"]; + $inst->dbmaster->dbUser = $conf['mysql']["master_admin_user"]; + $inst->dbmaster->dbPass = $conf['mysql']["master_admin_password"]; + + } else { + // the master DB is the same then the slave DB + $inst->dbmaster = $inst->db; + } + + //* Create the mysql database + $inst->configure_database(); + + //* Insert the Server record into the database + swriteln('Adding ISPConfig server record to database.'); + swriteln(''); + $inst->add_database_server_record(); + + + if(strtolower($inst->simple_query('Configure Mail', array('y','n') ,'y') ) == 'y') { + + $conf['services']['mail'] = true; + + //* Configure Postfix + swriteln('Configuring Postfix'); + $inst->configure_postfix(); + + //* Configure Mailman + swriteln('Configuring Mailman'); + $inst->configure_mailman(); + + if($conf['dovecot']['installed'] == true) { + //* Configure dovecot + swriteln('Configuring Dovecot'); + $inst->configure_dovecot(); + } else { + + //* Configure saslauthd + swriteln('Configuring SASL'); + $inst->configure_saslauthd(); + + //* Configure PAM + swriteln('Configuring PAM'); + $inst->configure_pam(); + + //* Configure courier + swriteln('Configuring Courier'); + $inst->configure_courier(); + } + + //* Configure Spamasassin + swriteln('Configuring Spamassassin'); + $inst->configure_spamassassin(); + + //* Configure Amavis + swriteln('Configuring Amavisd'); + $inst->configure_amavis(); + + //* Configure Getmail + swriteln('Configuring Getmail'); + $inst->configure_getmail(); + + if($conf['postfix']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart'); + if($conf['saslauthd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart'); + if($conf['amavis']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart'); + if($conf['clamav']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart'); + if($conf['courier']['courier-authdaemon'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart'); + if($conf['courier']['courier-imap'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart'); + if($conf['courier']['courier-imap-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart'); + if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); + if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); + if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); + if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart'); + } + + //** Configure Jailkit + if(strtolower($inst->simple_query('Configure Jailkit', array('y','n'),'y') ) == 'y') { + swriteln('Configuring Jailkit'); + $inst->configure_jailkit(); + } + + //** Configure Pureftpd + if(strtolower($inst->simple_query('Configure FTP Server', array('y','n'),'y') ) == 'y') { + swriteln('Configuring Pureftpd'); + $inst->configure_pureftpd(); + if($conf['pureftpd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart'); + } + + //** Configure DNS + if(strtolower($inst->simple_query('Configure DNS Server',array('y','n'),'y')) == 'y') { + $conf['services']['dns'] = true; + //* Configure DNS + if($conf['powerdns']['installed'] == true) { + swriteln('Configuring PowerDNS'); + $inst->configure_powerdns(); + if($conf['powerdns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['powerdns']['init_script'])) system($conf['init_scripts'].'/'.$conf['powerdns']['init_script'].' restart &> /dev/null'); + } elseif($conf['bind']['installed'] == true) { + swriteln('Configuring BIND'); + $inst->configure_bind(); + if($conf['bind']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['bind']['init_script'])) system($conf['init_scripts'].'/'.$conf['bind']['init_script'].' restart &> /dev/null'); + } else { + swriteln('Configuring MyDNS'); + $inst->configure_mydns(); + if($conf['mydns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null'); + } + + } + + //** Configure Apache + swriteln("\nHint: If this server shall run the ISPConfig interface, select 'y' in the 'Configure Apache Server' option.\n"); + if(strtolower($inst->simple_query('Configure Apache Server',array('y','n'),'y')) == 'y') { + $conf['services']['web'] = true; + swriteln('Configuring Apache'); + $inst->configure_apache(); + + //** Configure Vlogger + swriteln('Configuring Vlogger'); + $inst->configure_vlogger(); + + //** Configure apps vhost + swriteln('Configuring Apps vhost'); + $inst->configure_apps_vhost(); + } + + //** Configure Firewall + if(strtolower($inst->simple_query('Configure Firewall Server',array('y','n'),'y')) == 'y') { + swriteln('Configuring Firewall'); + $inst->configure_firewall(); + } + //** Configure ISPConfig :-) + if(strtolower($inst->simple_query('Install ISPConfig Web Interface',array('y','n'),'y')) == 'y') { + swriteln('Installing ISPConfig'); + + //** We want to check if the server is a module or cgi based php enabled server + //** TODO: Don't always ask for this somehow ? + /* + $fast_cgi = $inst->simple_query('CGI PHP Enabled Server?', array('yes','no'),'no'); + + if($fast_cgi == 'yes') { + $alias = $inst->free_query('Script Alias', '/php/'); + $path = $inst->free_query('Script Alias Path', '/path/to/cgi/bin'); + $conf['apache']['vhost_cgi_alias'] = sprintf('ScriptAlias %s %s', $alias, $path); + } else { + $conf['apache']['vhost_cgi_alias'] = ""; + } + */ + + //** Customise the port ISPConfig runs on + $conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', '8080'); + + if(strtolower($inst->simple_query('Enable SSL for the ISPConfig web interface',array('y','n'),'y')) == 'y') { + $inst->make_ispconfig_ssl_cert(); + } + + $inst->install_ispconfig_interface = true; + + } else { + $inst->install_ispconfig_interface = false; + } + + $inst->install_ispconfig(); + + //* Configure DBServer + swriteln('Configuring DBServer'); + $inst->configure_dbserver(); + + //* Configure ISPConfig + swriteln('Installing ISPConfig crontab'); + $inst->install_crontab(); + if($conf['apache']['init_script'] != '' && @is_file($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); + + + +} //* << $install_mode / 'Standard' or Genius + + +echo "Installation completed.\n"; + + +?> diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index b941f45de7b97c04c39f448569cab1c91263eb36..2e74e2e7b99b9482e44128cd2e160aaa48fa2237 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -1,1788 +1,1788 @@ -conf = $conf; - } - - //: TODO Implement the translation function and language files for the installer. - public function lng($text) { - return $text; - } - - public function error($msg) { - die('ERROR: '.$msg."\n"); - } - - public function warning($msg) { - echo('WARNING: '.$msg."\n"); - } - - public function simple_query($query, $answers, $default) { - $finished = false; - do { - $answers_str = implode(',', $answers); - swrite($this->lng($query).' ('.$answers_str.') ['.$default.']: '); - $input = sread(); - - //* Stop the installation - if($input == 'quit') { - swriteln($this->lng("Installation terminated by user.\n")); - die(); - } - - //* Select the default - if($input == '') { - $answer = $default; - $finished = true; - } - - //* Set answer id valid - if(in_array($input, $answers)) { - $answer = $input; - $finished = true; - } - - } while ($finished == false); - swriteln(); - return $answer; - } - - public function free_query($query,$default) { - swrite($this->lng($query).' ['.$default.']: '); - $input = sread(); - - //* Stop the installation - if($input == 'quit') { - swriteln($this->lng("Installation terminated by user.\n")); - die(); - } - - $answer = ($input == '') ? $default : $input; - swriteln(); - return $answer; - } - - /* - // TODO: this function is not used atmo I think - pedro - function request_language(){ - - swriteln(lng('Enter your language')); - swriteln(lng('de, en')); - - } - */ - - //** Detect installed applications - public function find_installed_apps() { - global $conf; - - if(is_installed('mysql') || is_installed('mysqld')) $conf['mysql']['installed'] = true; - if(is_installed('postfix')) $conf['postfix']['installed'] = true; - if(is_installed('mailman')) $conf['mailman']['installed'] = true; - if(is_installed('apache') || is_installed('apache2') || is_installed('httpd')) $conf['apache']['installed'] = true; - if(is_installed('getmail')) $conf['getmail']['installed'] = true; +conf = $conf; + } + + //: TODO Implement the translation function and language files for the installer. + public function lng($text) { + return $text; + } + + public function error($msg) { + die('ERROR: '.$msg."\n"); + } + + public function warning($msg) { + echo('WARNING: '.$msg."\n"); + } + + public function simple_query($query, $answers, $default) { + $finished = false; + do { + $answers_str = implode(',', $answers); + swrite($this->lng($query).' ('.$answers_str.') ['.$default.']: '); + $input = sread(); + + //* Stop the installation + if($input == 'quit') { + swriteln($this->lng("Installation terminated by user.\n")); + die(); + } + + //* Select the default + if($input == '') { + $answer = $default; + $finished = true; + } + + //* Set answer id valid + if(in_array($input, $answers)) { + $answer = $input; + $finished = true; + } + + } while ($finished == false); + swriteln(); + return $answer; + } + + public function free_query($query,$default) { + swrite($this->lng($query).' ['.$default.']: '); + $input = sread(); + + //* Stop the installation + if($input == 'quit') { + swriteln($this->lng("Installation terminated by user.\n")); + die(); + } + + $answer = ($input == '') ? $default : $input; + swriteln(); + return $answer; + } + + /* + // TODO: this function is not used atmo I think - pedro + function request_language(){ + + swriteln(lng('Enter your language')); + swriteln(lng('de, en')); + + } + */ + + //** Detect installed applications + public function find_installed_apps() { + global $conf; + + if(is_installed('mysql') || is_installed('mysqld')) $conf['mysql']['installed'] = true; + if(is_installed('postfix')) $conf['postfix']['installed'] = true; + if(is_installed('mailman')) $conf['mailman']['installed'] = true; + if(is_installed('apache') || is_installed('apache2') || is_installed('httpd')) $conf['apache']['installed'] = true; + if(is_installed('getmail')) $conf['getmail']['installed'] = true; if(is_installed('courierlogger')) $conf['courier']['installed'] = true; - if(is_installed('dovecot')) $conf['dovecot']['installed'] = true; - if(is_installed('saslsauthd')) $conf['saslauthd']['installed'] = true; - if(is_installed('amavisd-new')) $conf['amavis']['installed'] = true; - if(is_installed('clamdscan')) $conf['clamav']['installed'] = true; - if(is_installed('pure-ftpd') || is_installed('pure-ftpd-wrapper')) $conf['pureftpd']['installed'] = true; - if(is_installed('mydns') || is_installed('mydns-ng')) $conf['mydns']['installed'] = true; - if(is_installed('jk_chrootsh')) $conf['jailkit']['installed'] = true; - if(is_installed('pdns_server') || is_installed('pdns_control')) $conf['powerdns']['installed'] = true; - if(is_installed('named') || is_installed('bind') || is_installed('bind9')) $conf['bind']['installed'] = true; - - } - - /** Create the database for ISPConfig */ - public function configure_database() { - global $conf; - - //** Create the database - if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$conf['mysql']['database'].' DEFAULT CHARACTER SET '.$conf['mysql']['charset'])) { - $this->error('Unable to create MySQL database: '.$conf['mysql']['database'].'.'); - } - - //* Set the database name in the DB library - $this->db->dbName = $conf['mysql']['database']; - - //* Load the database dump into the database, if database contains no tables - $db_tables = $this->db->getTables(); - if(count($db_tables) > 0) { - $this->error('Stopped: Database already contains some tables.'); - } else { - if($conf['mysql']['admin_password'] == '') { - caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' '".$conf['mysql']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null", - __FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql'); - } else { - caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' -p'".$conf['mysql']['admin_password']."' '".$conf['mysql']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null", - __FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql'); - } - $db_tables = $this->db->getTables(); - if(count($db_tables) == 0) { - $this->error('Unable to load SQL-Dump into database table.'); - } - - //* Load system.ini into the sys_ini table - $system_ini = $this->db->quote(rf('tpl/system.ini.master')); - $this->db->query("UPDATE sys_ini SET config = '$system_ini' WHERE sysini_id = 1"); - - } - } - - //** Create the server record in the database - public function add_database_server_record() { - - global $conf; - - if($conf['mysql']['host'] == 'localhost') { - $from_host = 'localhost'; - } else { - $from_host = $conf['hostname']; - } - - // Delete ISPConfig user in the local database, in case that it exists - $this->db->query("DELETE FROM mysql.user WHERE User = '".$conf['mysql']['ispconfig_user']."' AND Host = '".$from_host."';"); - $this->db->query("DELETE FROM mysql.db WHERE Db = '".$conf['mysql']['database']."' AND Host = '".$from_host."';"); - $this->db->query('FLUSH PRIVILEGES;'); - - //* Create the ISPConfig database user in the local database - $query = 'GRANT SELECT, INSERT, UPDATE, DELETE ON '.$conf['mysql']['database'].".* " - ."TO '".$conf['mysql']['ispconfig_user']."'@'".$from_host."' " - ."IDENTIFIED BY '".$conf['mysql']['ispconfig_password']."';"; - if(!$this->db->query($query)) { - $this->error('Unable to create database user: '.$conf['mysql']['ispconfig_user'].' Error: '.$this->db->errorMessage); - } - - //* Reload database privelages - $this->db->query('FLUSH PRIVILEGES;'); - - //* Set the database name in the DB library - $this->db->dbName = $conf['mysql']['database']; - - $tpl_ini_array = ini_to_array(rf('tpl/server.ini.master')); - - //* Update further distribution specific parameters for server config here - //* HINT: Every line added here has to be added in update.lib.php too!! - $tpl_ini_array['web']['vhost_conf_dir'] = $conf['apache']['vhost_conf_dir']; - $tpl_ini_array['web']['vhost_conf_enabled_dir'] = $conf['apache']['vhost_conf_enabled_dir']; - $tpl_ini_array['jailkit']['jailkit_chroot_app_programs'] = $conf['jailkit']['jailkit_chroot_app_programs']; - $tpl_ini_array['fastcgi']['fastcgi_phpini_path'] = $conf['fastcgi']['fastcgi_phpini_path']; - $tpl_ini_array['fastcgi']['fastcgi_starter_path'] = $conf['fastcgi']['fastcgi_starter_path']; - $tpl_ini_array['server']['hostname'] = $conf['hostname']; - $tpl_ini_array['server']['ip_address'] = @gethostbyname($conf['hostname']); - $tpl_ini_array['web']['website_basedir'] = $conf['web']['website_basedir']; - $tpl_ini_array['web']['website_path'] = $conf['web']['website_path']; - $tpl_ini_array['web']['website_symlinks'] = $conf['web']['website_symlinks']; - $tpl_ini_array['cron']['crontab_dir'] = $conf['cron']['crontab_dir']; - $tpl_ini_array['web']['security_level'] = 20; - $tpl_ini_array['web']['user'] = $conf['apache']['user']; - $tpl_ini_array['web']['group'] = $conf['apache']['group']; - $tpl_ini_array['web']['php_ini_path_apache'] = $conf['apache']['php_ini_path_apache']; - $tpl_ini_array['web']['php_ini_path_cgi'] = $conf['apache']['php_ini_path_cgi']; - $tpl_ini_array['mail']['pop3_imap_daemon'] = ($conf['dovecot']['installed'] == true)?'dovecot':'courier'; - $tpl_ini_array['mail']['mail_filter_syntax'] = ($conf['dovecot']['installed'] == true)?'sieve':'maildrop'; - $tpl_ini_array['dns']['bind_user'] = $conf['bind']['bind_user']; - $tpl_ini_array['dns']['bind_group'] = $conf['bind']['bind_group']; - $tpl_ini_array['dns']['bind_zonefiles_dir'] = $conf['bind']['bind_zonefiles_dir']; - $tpl_ini_array['dns']['named_conf_path'] = $conf['bind']['named_conf_path']; - $tpl_ini_array['dns']['named_conf_local_path'] = $conf['bind']['named_conf_local_path']; - - if (array_key_exists('awstats', $conf)) { - foreach ($conf['awstats'] as $aw_sett => $aw_value) { - $tpl_ini_array['web']['awstats_'.$aw_sett] = $aw_value; - } - } - - $server_ini_content = array_to_ini($tpl_ini_array); - $server_ini_content = mysql_real_escape_string($server_ini_content); - - $mail_server_enabled = ($conf['services']['mail'])?1:0; - $web_server_enabled = ($conf['services']['web'])?1:0; - $dns_server_enabled = ($conf['services']['dns'])?1:0; - $file_server_enabled = ($conf['services']['file'])?1:0; - $db_server_enabled = ($conf['services']['db'])?1:0; - $vserver_server_enabled = ($conf['services']['vserver'])?1:0; - - //** Get the database version number based on the patchfiles - $found = true; - $current_db_version = 1; - while($found == true) { - $next_db_version = intval($current_db_version + 1); - $patch_filename = realpath(dirname(__FILE__).'/../').'/sql/incremental/upd_'.str_pad($next_db_version, 4, '0', STR_PAD_LEFT).'.sql'; - if(is_file($patch_filename)) { - $current_db_version = $next_db_version; - } else { - $found = false; - } - } - $current_db_version = intval($current_db_version); - - - if($conf['mysql']['master_slave_setup'] == 'y') { - - //* Insert the server record in master DB - $sql = "INSERT INTO `server` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `vserver_server`, `config`, `updated`, `active`, `dbversion`) VALUES (1, 1, 'riud', 'riud', 'r', '".$conf['hostname']."', '$mail_server_enabled', '$web_server_enabled', '$dns_server_enabled', '$file_server_enabled', '$db_server_enabled', '$vserver_server_enabled', '$server_ini_content', 0, 1, $current_db_version);"; - $this->dbmaster->query($sql); - $conf['server_id'] = $this->dbmaster->insertID(); - $conf['server_id'] = $conf['server_id']; - - //* Insert the same record in the local DB - $sql = "INSERT INTO `server` (`server_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `vserver_server`, `config`, `updated`, `active`, `dbversion`) VALUES ('".$conf['server_id']."',1, 1, 'riud', 'riud', 'r', '".$conf['hostname']."', '$mail_server_enabled', '$web_server_enabled', '$dns_server_enabled', '$file_server_enabled', '$db_server_enabled', '$vserver_server_enabled', '$server_ini_content', 0, 1, $current_db_version);"; - $this->db->query($sql); - - //* username for the ispconfig user - $conf['mysql']['master_ispconfig_user'] = 'ispcsrv'.$conf['server_id']; - - $this->grant_master_database_rights(); - - } else { - //* Insert the server, if its not a mster / slave setup - $sql = "INSERT INTO `server` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `vserver_server`, `config`, `updated`, `active`, `dbversion`) VALUES (1, 1, 'riud', 'riud', 'r', '".$conf['hostname']."', '$mail_server_enabled', '$web_server_enabled', '$dns_server_enabled', '$file_server_enabled', '$db_server_enabled', '$vserver_server_enabled', '$server_ini_content', 0, 1, $current_db_version);"; - $this->db->query($sql); - $conf['server_id'] = $this->db->insertID(); - $conf['server_id'] = $conf['server_id']; - } - - - } - - public function grant_master_database_rights() { - global $conf; - - /* - * The following code is a little bit tricky: - * * If we HAVE a master-slave - Setup then the client has to grant the rights for himself - * at the master. - * * If we DO NOT have a master-slave - Setup then we have two possibilities - * 1) it is a single server - * 2) it is the MASTER of n clients - */ - $hosts = array(); - - if($conf['mysql']['master_slave_setup'] == 'y') { - /* - * it is a master-slave - Setup so the slave has to grant its rights in the master - * database - */ - - //* insert the ispconfig user in the remote server - $from_host = $conf['hostname']; - $from_ip = gethostbyname($conf['hostname']); - - $hosts[$from_host]['user'] = $conf['mysql']['master_ispconfig_user']; - $hosts[$from_host]['db'] = $conf['mysql']['master_database']; - $hosts[$from_host]['pwd'] = $conf['mysql']['master_ispconfig_password']; - - $hosts[$from_ip]['user'] = $conf['mysql']['master_ispconfig_user']; - $hosts[$from_ip]['db'] = $conf['mysql']['master_database']; - $hosts[$from_ip]['pwd'] = $conf['mysql']['master_ispconfig_password']; - } else{ - /* - * it is NOT a master-slave - Setup so we have to find out all clients and their - * host - */ - $query = "SELECT Host, User FROM mysql.user WHERE User like 'ispcsrv%' ORDER BY User, Host"; - $data = $this->dbmaster->queryAllRecords($query); - if($data === false) { - $this->error('Unable to get the user rights: '.$value['db'].' Error: '.$this->dbmaster->errorMessage); - } - foreach ($data as $item){ - $hosts[$item['Host']]['user'] = $item['User']; - $hosts[$item['Host']]['db'] = $conf['mysql']['master_database']; - $hosts[$item['Host']]['pwd'] = ''; // the user already exists, so we need no pwd! - } - } - - if(count($hosts) > 0) { - foreach($hosts as $host => $value) { - /* - * If a pwd exists, this means, we have to add the new user (and his pwd). - * if not, the user already exists and we do not need the pwd - */ - if ($value['pwd'] != ''){ - $query = "CREATE USER '".$value['user']."'@'".$host."' IDENTIFIED BY '" . $value['pwd'] . "'"; - $this->dbmaster->query($query); // ignore the error - } - - /* - * Try to delete all rights of the user in case that it exists. - * In Case that it will not exist, do nothing (ignore the error!) - */ - $query = "REVOKE ALL PRIVILEGES, GRANT OPTION FROM '".$value['user']."'@'".$host."' "; - $this->dbmaster->query($query); // ignore the error - - //* Create the ISPConfig database user in the remote database - $query = "GRANT SELECT ON ".$value['db'].".`server` TO '".$value['user']."'@'".$host."' "; - if(!$this->dbmaster->query($query)) { - $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); - } - - $query = "GRANT SELECT, INSERT ON ".$value['db'].".`sys_log` TO '".$value['user']."'@'".$host."' "; - if(!$this->dbmaster->query($query)) { - $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); - } - - $query = "GRANT SELECT, UPDATE(`status`) ON ".$value['db'].".`sys_datalog` TO '".$value['user']."'@'".$host."' "; - if(!$this->dbmaster->query($query)) { - $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); - } - - $query = "GRANT SELECT, UPDATE(`status`) ON ".$value['db'].".`software_update_inst` TO '".$value['user']."'@'".$host."' "; - if(!$this->dbmaster->query($query)) { - $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); - } - - $query = "GRANT SELECT, UPDATE(`updated`) ON ".$value['db'].".`server` TO '".$value['user']."'@'".$host."' "; - if(!$this->dbmaster->query($query)) { - $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); - } - - $query = "GRANT SELECT, UPDATE (`ssl_request`, `ssl_cert`, `ssl_action`) ON ".$value['db'].".`web_domain` TO '".$value['user']."'@'".$host."' "; - if(!$this->dbmaster->query($query)) { - $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); - } - - $query = "GRANT SELECT ON ".$value['db'].".`sys_group` TO '".$value['user']."'@'".$host."' "; - if(!$this->dbmaster->query($query)) { - $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); - } - - $query = "GRANT SELECT, UPDATE (`action_state`, `response`) ON ".$value['db'].".`sys_remoteaction` TO '".$value['user']."'@'".$host."' "; - if(!$this->dbmaster->query($query)) { - $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); - } - - $query = "GRANT SELECT, INSERT , DELETE ON ".$value['db'].".`monitor_data` TO '".$value['user']."'@'".$host."' "; - if(!$this->dbmaster->query($query)) { - $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); - } - - $query = "GRANT SELECT, INSERT, UPDATE ON ".$value['db'].".`mail_traffic` TO '".$value['user']."'@'".$host."' "; - if(!$this->dbmaster->query($query)) { - $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); - } - - $query = "GRANT SELECT, INSERT, UPDATE ON ".$value['db'].".`web_traffic` TO '".$value['user']."'@'".$host."' "; - if(!$this->dbmaster->query($query)) { - $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); - } - } - - /* - * It is all done. Relod the rights... - */ - $this->dbmaster->query('FLUSH PRIVILEGES;'); - } - - } - - //** writes postfix configuration files - public function process_postfix_config($configfile) { - global $conf; - - $config_dir = $conf['postfix']['config_dir'].'/'; - $full_file_name = $config_dir.$configfile; - //* Backup exiting file - if(is_file($full_file_name)) { - copy($full_file_name, $config_dir.$configfile.'~'); - } - $content = rf('tpl/'.$configfile.'.master'); - $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); - $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); - $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); - $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); - $content = str_replace('{server_id}', $conf['server_id'], $content); - wf($full_file_name, $content); - } - - public function configure_jailkit() { - global $conf; - - $cf = $conf['jailkit']; - $config_dir = $cf['config_dir']; - $jk_init = $cf['jk_init']; - $jk_chrootsh = $cf['jk_chrootsh']; - - if (is_dir($config_dir)) { - if(is_file($config_dir.'/'.$jk_init)) copy($config_dir.'/'.$jk_init, $config_dir.'/'.$jk_init.'~'); - if(is_file($config_dir.'/'.$jk_chrootsh.'.master')) copy($config_dir.'/'.$jk_chrootsh.'.master', $config_dir.'/'.$jk_chrootsh.'~'); - - copy('tpl/'.$jk_init.'.master', $config_dir.'/'.$jk_init); - copy('tpl/'.$jk_chrootsh.'.master', $config_dir.'/'.$jk_chrootsh); - } - - } - - public function configure_mailman($status = 'insert') { - global $conf; - - $config_dir = $conf['mailman']['config_dir'].'/'; - $full_file_name = $config_dir.'mm_cfg.py'; - //* Backup exiting file - if(is_file($full_file_name)) { - copy($full_file_name, $config_dir.'mm_cfg.py~'); - } - - // load files - $content = rf('tpl/mm_cfg.py.master'); - $old_file = rf($full_file_name); - - $old_options = array(); - $lines = explode("\n", $old_file); - foreach ($lines as $line) - { - if (strlen($line) && substr($line, 0, 1) != '#') - { - list($key, $value) = explode("=", $line); - if (!empty($value)) - { - $key = rtrim($key); - $old_options[$key] = trim($value); - } - } - } - - $virtual_domains = ''; - if($status == 'update') - { - // create virtual_domains list - $domainAll = $this->db->queryAllRecords("SELECT domain FROM mail_mailinglist GROUP BY domain"); - - foreach($domainAll as $domain) - { - if ($domainAll[0]['domain'] == $domain['domain']) - $virtual_domains .= "'".$domain['domain']."'"; - else - $virtual_domains .= ", '".$domain['domain']."'"; - } - } - else - $virtual_domains = "' '"; - - $content = str_replace('{hostname}', $conf['hostname'], $content); - $content = str_replace('{default_language}', $old_options['DEFAULT_SERVER_LANGUAGE'], $content); - $content = str_replace('{virtual_domains}', $virtual_domains, $content); - - wf($full_file_name, $content); - } - - public function configure_postfix($options = '') { - global $conf; - $cf = $conf['postfix']; - $config_dir = $cf['config_dir']; - - if(!is_dir($config_dir)) { - $this->error("The postfix configuration directory '$config_dir' does not exist."); - } - - //* mysql-virtual_domains.cf - $this->process_postfix_config('mysql-virtual_domains.cf'); - - //* mysql-virtual_forwardings.cf - $this->process_postfix_config('mysql-virtual_forwardings.cf'); - - //* mysql-virtual_mailboxes.cf - $this->process_postfix_config('mysql-virtual_mailboxes.cf'); - - //* mysql-virtual_email2email.cf - $this->process_postfix_config('mysql-virtual_email2email.cf'); - - //* mysql-virtual_transports.cf - $this->process_postfix_config('mysql-virtual_transports.cf'); - - //* mysql-virtual_recipient.cf - $this->process_postfix_config('mysql-virtual_recipient.cf'); - - //* mysql-virtual_sender.cf - $this->process_postfix_config('mysql-virtual_sender.cf'); - - //* mysql-virtual_client.cf - $this->process_postfix_config('mysql-virtual_client.cf'); - - //* mysql-virtual_relaydomains.cf - $this->process_postfix_config('mysql-virtual_relaydomains.cf'); - - //* mysql-virtual_relayrecipientmaps.cf - $this->process_postfix_config('mysql-virtual_relayrecipientmaps.cf'); - - //* Changing mode and group of the new created config files. - caselog('chmod o= '.$config_dir.'/mysql-virtual_*.cf* &> /dev/null', - __FILE__, __LINE__, 'chmod on mysql-virtual_*.cf*', 'chmod on mysql-virtual_*.cf* failed'); - caselog('chgrp '.$cf['group'].' '.$config_dir.'/mysql-virtual_*.cf* &> /dev/null', - __FILE__, __LINE__, 'chgrp on mysql-virtual_*.cf*', 'chgrp on mysql-virtual_*.cf* failed'); - - //* Creating virtual mail user and group - $command = 'groupadd -g '.$cf['vmail_groupid'].' '.$cf['vmail_groupname']; - if(!is_group($cf['vmail_groupname'])) caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - $command = 'useradd -g '.$cf['vmail_groupname'].' -u '.$cf['vmail_userid'].' '.$cf['vmail_username'].' -d '.$cf['vmail_mailbox_base'].' -m'; - if(!is_user($cf['vmail_username'])) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - $postconf_commands = array ( - 'myhostname = '.$conf['hostname'], - 'mydestination = '.$conf['hostname'].', localhost, localhost.localdomain', - 'mynetworks = 127.0.0.0/8 [::1]/128', - 'alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases', - 'alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases', - 'virtual_alias_domains =', - 'virtual_alias_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_forwardings.cf, proxy:mysql:'.$config_dir.'/mysql-virtual_email2email.cf, hash:/var/lib/mailman/data/virtual-mailman', - 'virtual_mailbox_domains = proxy:mysql:'.$config_dir.'/mysql-virtual_domains.cf', - 'virtual_mailbox_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_mailboxes.cf', - 'virtual_mailbox_base = '.$cf['vmail_mailbox_base'], - 'virtual_uid_maps = static:'.$cf['vmail_userid'], - 'virtual_gid_maps = static:'.$cf['vmail_groupid'], - 'smtpd_sasl_auth_enable = yes', - 'broken_sasl_auth_clients = yes', - 'smtpd_sasl_authenticated_header = yes', - 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:'.$config_dir.'/mysql-virtual_recipient.cf, reject_unauth_destination', - 'smtpd_use_tls = yes', - 'smtpd_tls_security_level = may', - 'smtpd_tls_cert_file = '.$config_dir.'/smtpd.cert', - 'smtpd_tls_key_file = '.$config_dir.'/smtpd.key', - 'transport_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_transports.cf', - 'relay_domains = mysql:'.$config_dir.'/mysql-virtual_relaydomains.cf', - 'relay_recipient_maps = mysql:'.$config_dir.'/mysql-virtual_relayrecipientmaps.cf', - 'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps', - 'smtpd_sender_restrictions = check_sender_access mysql:'.$config_dir.'/mysql-virtual_sender.cf', - 'smtpd_client_restrictions = check_client_access mysql:'.$config_dir.'/mysql-virtual_client.cf', - 'maildrop_destination_concurrency_limit = 1', - 'maildrop_destination_recipient_limit = 1', - 'virtual_transport = maildrop', - 'header_checks = regexp:'.$config_dir.'/header_checks', - 'mime_header_checks = regexp:'.$config_dir.'/mime_header_checks', - 'nested_header_checks = regexp:'.$config_dir.'/nested_header_checks', - 'body_checks = regexp:'.$config_dir.'/body_checks', - 'owner_request_special = no' - ); - - //* Create the header and body check files - touch($config_dir.'/header_checks'); - touch($config_dir.'/mime_header_checks'); - touch($config_dir.'/nested_header_checks'); - touch($config_dir.'/body_checks'); - - //* Create the mailman files - exec('mkdir -p /var/lib/mailman/data'); - touch('/var/lib/mailman/data/aliases'); - exec('postmap /var/lib/mailman/data/aliases'); - touch('/var/lib/mailman/data/virtual-mailman'); - exec('postmap /var/lib/mailman/data/virtual-mailman'); - - //* Make a backup copy of the main.cf file - copy($config_dir.'/main.cf', $config_dir.'/main.cf~'); - - //* Executing the postconf commands - foreach($postconf_commands as $cmd) { - $command = "postconf -e '$cmd'"; - caselog($command." &> /dev/null", __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); - } - - if(!stristr($options,'dont-create-certs')) { - //* Create the SSL certificate - $command = 'cd '.$config_dir.'; ' + if(is_installed('dovecot')) $conf['dovecot']['installed'] = true; + if(is_installed('saslsauthd')) $conf['saslauthd']['installed'] = true; + if(is_installed('amavisd-new')) $conf['amavis']['installed'] = true; + if(is_installed('clamdscan')) $conf['clamav']['installed'] = true; + if(is_installed('pure-ftpd') || is_installed('pure-ftpd-wrapper')) $conf['pureftpd']['installed'] = true; + if(is_installed('mydns') || is_installed('mydns-ng')) $conf['mydns']['installed'] = true; + if(is_installed('jk_chrootsh')) $conf['jailkit']['installed'] = true; + if(is_installed('pdns_server') || is_installed('pdns_control')) $conf['powerdns']['installed'] = true; + if(is_installed('named') || is_installed('bind') || is_installed('bind9')) $conf['bind']['installed'] = true; + + } + + /** Create the database for ISPConfig */ + public function configure_database() { + global $conf; + + //** Create the database + if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$conf['mysql']['database'].' DEFAULT CHARACTER SET '.$conf['mysql']['charset'])) { + $this->error('Unable to create MySQL database: '.$conf['mysql']['database'].'.'); + } + + //* Set the database name in the DB library + $this->db->dbName = $conf['mysql']['database']; + + //* Load the database dump into the database, if database contains no tables + $db_tables = $this->db->getTables(); + if(count($db_tables) > 0) { + $this->error('Stopped: Database already contains some tables.'); + } else { + if($conf['mysql']['admin_password'] == '') { + caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' '".$conf['mysql']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null", + __FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql'); + } else { + caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' -p'".$conf['mysql']['admin_password']."' '".$conf['mysql']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null", + __FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql'); + } + $db_tables = $this->db->getTables(); + if(count($db_tables) == 0) { + $this->error('Unable to load SQL-Dump into database table.'); + } + + //* Load system.ini into the sys_ini table + $system_ini = $this->db->quote(rf('tpl/system.ini.master')); + $this->db->query("UPDATE sys_ini SET config = '$system_ini' WHERE sysini_id = 1"); + + } + } + + //** Create the server record in the database + public function add_database_server_record() { + + global $conf; + + if($conf['mysql']['host'] == 'localhost') { + $from_host = 'localhost'; + } else { + $from_host = $conf['hostname']; + } + + // Delete ISPConfig user in the local database, in case that it exists + $this->db->query("DELETE FROM mysql.user WHERE User = '".$conf['mysql']['ispconfig_user']."' AND Host = '".$from_host."';"); + $this->db->query("DELETE FROM mysql.db WHERE Db = '".$conf['mysql']['database']."' AND Host = '".$from_host."';"); + $this->db->query('FLUSH PRIVILEGES;'); + + //* Create the ISPConfig database user in the local database + $query = 'GRANT SELECT, INSERT, UPDATE, DELETE ON '.$conf['mysql']['database'].".* " + ."TO '".$conf['mysql']['ispconfig_user']."'@'".$from_host."' " + ."IDENTIFIED BY '".$conf['mysql']['ispconfig_password']."';"; + if(!$this->db->query($query)) { + $this->error('Unable to create database user: '.$conf['mysql']['ispconfig_user'].' Error: '.$this->db->errorMessage); + } + + //* Reload database privelages + $this->db->query('FLUSH PRIVILEGES;'); + + //* Set the database name in the DB library + $this->db->dbName = $conf['mysql']['database']; + + $tpl_ini_array = ini_to_array(rf('tpl/server.ini.master')); + + //* Update further distribution specific parameters for server config here + //* HINT: Every line added here has to be added in update.lib.php too!! + $tpl_ini_array['web']['vhost_conf_dir'] = $conf['apache']['vhost_conf_dir']; + $tpl_ini_array['web']['vhost_conf_enabled_dir'] = $conf['apache']['vhost_conf_enabled_dir']; + $tpl_ini_array['jailkit']['jailkit_chroot_app_programs'] = $conf['jailkit']['jailkit_chroot_app_programs']; + $tpl_ini_array['fastcgi']['fastcgi_phpini_path'] = $conf['fastcgi']['fastcgi_phpini_path']; + $tpl_ini_array['fastcgi']['fastcgi_starter_path'] = $conf['fastcgi']['fastcgi_starter_path']; + $tpl_ini_array['server']['hostname'] = $conf['hostname']; + $tpl_ini_array['server']['ip_address'] = @gethostbyname($conf['hostname']); + $tpl_ini_array['web']['website_basedir'] = $conf['web']['website_basedir']; + $tpl_ini_array['web']['website_path'] = $conf['web']['website_path']; + $tpl_ini_array['web']['website_symlinks'] = $conf['web']['website_symlinks']; + $tpl_ini_array['cron']['crontab_dir'] = $conf['cron']['crontab_dir']; + $tpl_ini_array['web']['security_level'] = 20; + $tpl_ini_array['web']['user'] = $conf['apache']['user']; + $tpl_ini_array['web']['group'] = $conf['apache']['group']; + $tpl_ini_array['web']['php_ini_path_apache'] = $conf['apache']['php_ini_path_apache']; + $tpl_ini_array['web']['php_ini_path_cgi'] = $conf['apache']['php_ini_path_cgi']; + $tpl_ini_array['mail']['pop3_imap_daemon'] = ($conf['dovecot']['installed'] == true)?'dovecot':'courier'; + $tpl_ini_array['mail']['mail_filter_syntax'] = ($conf['dovecot']['installed'] == true)?'sieve':'maildrop'; + $tpl_ini_array['dns']['bind_user'] = $conf['bind']['bind_user']; + $tpl_ini_array['dns']['bind_group'] = $conf['bind']['bind_group']; + $tpl_ini_array['dns']['bind_zonefiles_dir'] = $conf['bind']['bind_zonefiles_dir']; + $tpl_ini_array['dns']['named_conf_path'] = $conf['bind']['named_conf_path']; + $tpl_ini_array['dns']['named_conf_local_path'] = $conf['bind']['named_conf_local_path']; + + if (array_key_exists('awstats', $conf)) { + foreach ($conf['awstats'] as $aw_sett => $aw_value) { + $tpl_ini_array['web']['awstats_'.$aw_sett] = $aw_value; + } + } + + $server_ini_content = array_to_ini($tpl_ini_array); + $server_ini_content = mysql_real_escape_string($server_ini_content); + + $mail_server_enabled = ($conf['services']['mail'])?1:0; + $web_server_enabled = ($conf['services']['web'])?1:0; + $dns_server_enabled = ($conf['services']['dns'])?1:0; + $file_server_enabled = ($conf['services']['file'])?1:0; + $db_server_enabled = ($conf['services']['db'])?1:0; + $vserver_server_enabled = ($conf['services']['vserver'])?1:0; + + //** Get the database version number based on the patchfiles + $found = true; + $current_db_version = 1; + while($found == true) { + $next_db_version = intval($current_db_version + 1); + $patch_filename = realpath(dirname(__FILE__).'/../').'/sql/incremental/upd_'.str_pad($next_db_version, 4, '0', STR_PAD_LEFT).'.sql'; + if(is_file($patch_filename)) { + $current_db_version = $next_db_version; + } else { + $found = false; + } + } + $current_db_version = intval($current_db_version); + + + if($conf['mysql']['master_slave_setup'] == 'y') { + + //* Insert the server record in master DB + $sql = "INSERT INTO `server` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `vserver_server`, `config`, `updated`, `active`, `dbversion`) VALUES (1, 1, 'riud', 'riud', 'r', '".$conf['hostname']."', '$mail_server_enabled', '$web_server_enabled', '$dns_server_enabled', '$file_server_enabled', '$db_server_enabled', '$vserver_server_enabled', '$server_ini_content', 0, 1, $current_db_version);"; + $this->dbmaster->query($sql); + $conf['server_id'] = $this->dbmaster->insertID(); + $conf['server_id'] = $conf['server_id']; + + //* Insert the same record in the local DB + $sql = "INSERT INTO `server` (`server_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `vserver_server`, `config`, `updated`, `active`, `dbversion`) VALUES ('".$conf['server_id']."',1, 1, 'riud', 'riud', 'r', '".$conf['hostname']."', '$mail_server_enabled', '$web_server_enabled', '$dns_server_enabled', '$file_server_enabled', '$db_server_enabled', '$vserver_server_enabled', '$server_ini_content', 0, 1, $current_db_version);"; + $this->db->query($sql); + + //* username for the ispconfig user + $conf['mysql']['master_ispconfig_user'] = 'ispcsrv'.$conf['server_id']; + + $this->grant_master_database_rights(); + + } else { + //* Insert the server, if its not a mster / slave setup + $sql = "INSERT INTO `server` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `vserver_server`, `config`, `updated`, `active`, `dbversion`) VALUES (1, 1, 'riud', 'riud', 'r', '".$conf['hostname']."', '$mail_server_enabled', '$web_server_enabled', '$dns_server_enabled', '$file_server_enabled', '$db_server_enabled', '$vserver_server_enabled', '$server_ini_content', 0, 1, $current_db_version);"; + $this->db->query($sql); + $conf['server_id'] = $this->db->insertID(); + $conf['server_id'] = $conf['server_id']; + } + + + } + + public function grant_master_database_rights() { + global $conf; + + /* + * The following code is a little bit tricky: + * * If we HAVE a master-slave - Setup then the client has to grant the rights for himself + * at the master. + * * If we DO NOT have a master-slave - Setup then we have two possibilities + * 1) it is a single server + * 2) it is the MASTER of n clients + */ + $hosts = array(); + + if($conf['mysql']['master_slave_setup'] == 'y') { + /* + * it is a master-slave - Setup so the slave has to grant its rights in the master + * database + */ + + //* insert the ispconfig user in the remote server + $from_host = $conf['hostname']; + $from_ip = gethostbyname($conf['hostname']); + + $hosts[$from_host]['user'] = $conf['mysql']['master_ispconfig_user']; + $hosts[$from_host]['db'] = $conf['mysql']['master_database']; + $hosts[$from_host]['pwd'] = $conf['mysql']['master_ispconfig_password']; + + $hosts[$from_ip]['user'] = $conf['mysql']['master_ispconfig_user']; + $hosts[$from_ip]['db'] = $conf['mysql']['master_database']; + $hosts[$from_ip]['pwd'] = $conf['mysql']['master_ispconfig_password']; + } else{ + /* + * it is NOT a master-slave - Setup so we have to find out all clients and their + * host + */ + $query = "SELECT Host, User FROM mysql.user WHERE User like 'ispcsrv%' ORDER BY User, Host"; + $data = $this->dbmaster->queryAllRecords($query); + if($data === false) { + $this->error('Unable to get the user rights: '.$value['db'].' Error: '.$this->dbmaster->errorMessage); + } + foreach ($data as $item){ + $hosts[$item['Host']]['user'] = $item['User']; + $hosts[$item['Host']]['db'] = $conf['mysql']['master_database']; + $hosts[$item['Host']]['pwd'] = ''; // the user already exists, so we need no pwd! + } + } + + if(count($hosts) > 0) { + foreach($hosts as $host => $value) { + /* + * If a pwd exists, this means, we have to add the new user (and his pwd). + * if not, the user already exists and we do not need the pwd + */ + if ($value['pwd'] != ''){ + $query = "CREATE USER '".$value['user']."'@'".$host."' IDENTIFIED BY '" . $value['pwd'] . "'"; + $this->dbmaster->query($query); // ignore the error + } + + /* + * Try to delete all rights of the user in case that it exists. + * In Case that it will not exist, do nothing (ignore the error!) + */ + $query = "REVOKE ALL PRIVILEGES, GRANT OPTION FROM '".$value['user']."'@'".$host."' "; + $this->dbmaster->query($query); // ignore the error + + //* Create the ISPConfig database user in the remote database + $query = "GRANT SELECT ON ".$value['db'].".`server` TO '".$value['user']."'@'".$host."' "; + if(!$this->dbmaster->query($query)) { + $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); + } + + $query = "GRANT SELECT, INSERT ON ".$value['db'].".`sys_log` TO '".$value['user']."'@'".$host."' "; + if(!$this->dbmaster->query($query)) { + $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); + } + + $query = "GRANT SELECT, UPDATE(`status`) ON ".$value['db'].".`sys_datalog` TO '".$value['user']."'@'".$host."' "; + if(!$this->dbmaster->query($query)) { + $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); + } + + $query = "GRANT SELECT, UPDATE(`status`) ON ".$value['db'].".`software_update_inst` TO '".$value['user']."'@'".$host."' "; + if(!$this->dbmaster->query($query)) { + $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); + } + + $query = "GRANT SELECT, UPDATE(`updated`) ON ".$value['db'].".`server` TO '".$value['user']."'@'".$host."' "; + if(!$this->dbmaster->query($query)) { + $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); + } + + $query = "GRANT SELECT, UPDATE (`ssl_request`, `ssl_cert`, `ssl_action`) ON ".$value['db'].".`web_domain` TO '".$value['user']."'@'".$host."' "; + if(!$this->dbmaster->query($query)) { + $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); + } + + $query = "GRANT SELECT ON ".$value['db'].".`sys_group` TO '".$value['user']."'@'".$host."' "; + if(!$this->dbmaster->query($query)) { + $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); + } + + $query = "GRANT SELECT, UPDATE (`action_state`, `response`) ON ".$value['db'].".`sys_remoteaction` TO '".$value['user']."'@'".$host."' "; + if(!$this->dbmaster->query($query)) { + $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); + } + + $query = "GRANT SELECT, INSERT , DELETE ON ".$value['db'].".`monitor_data` TO '".$value['user']."'@'".$host."' "; + if(!$this->dbmaster->query($query)) { + $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); + } + + $query = "GRANT SELECT, INSERT, UPDATE ON ".$value['db'].".`mail_traffic` TO '".$value['user']."'@'".$host."' "; + if(!$this->dbmaster->query($query)) { + $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); + } + + $query = "GRANT SELECT, INSERT, UPDATE ON ".$value['db'].".`web_traffic` TO '".$value['user']."'@'".$host."' "; + if(!$this->dbmaster->query($query)) { + $this->warning('Unable to set rights of user in master database: '.$value['db']."\n Query: ".$query."\n Error: ".$this->dbmaster->errorMessage); + } + } + + /* + * It is all done. Relod the rights... + */ + $this->dbmaster->query('FLUSH PRIVILEGES;'); + } + + } + + //** writes postfix configuration files + public function process_postfix_config($configfile) { + global $conf; + + $config_dir = $conf['postfix']['config_dir'].'/'; + $full_file_name = $config_dir.$configfile; + //* Backup exiting file + if(is_file($full_file_name)) { + copy($full_file_name, $config_dir.$configfile.'~'); + } + $content = rf('tpl/'.$configfile.'.master'); + $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); + $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); + $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); + $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); + $content = str_replace('{server_id}', $conf['server_id'], $content); + wf($full_file_name, $content); + } + + public function configure_jailkit() { + global $conf; + + $cf = $conf['jailkit']; + $config_dir = $cf['config_dir']; + $jk_init = $cf['jk_init']; + $jk_chrootsh = $cf['jk_chrootsh']; + + if (is_dir($config_dir)) { + if(is_file($config_dir.'/'.$jk_init)) copy($config_dir.'/'.$jk_init, $config_dir.'/'.$jk_init.'~'); + if(is_file($config_dir.'/'.$jk_chrootsh.'.master')) copy($config_dir.'/'.$jk_chrootsh.'.master', $config_dir.'/'.$jk_chrootsh.'~'); + + copy('tpl/'.$jk_init.'.master', $config_dir.'/'.$jk_init); + copy('tpl/'.$jk_chrootsh.'.master', $config_dir.'/'.$jk_chrootsh); + } + + } + + public function configure_mailman($status = 'insert') { + global $conf; + + $config_dir = $conf['mailman']['config_dir'].'/'; + $full_file_name = $config_dir.'mm_cfg.py'; + //* Backup exiting file + if(is_file($full_file_name)) { + copy($full_file_name, $config_dir.'mm_cfg.py~'); + } + + // load files + $content = rf('tpl/mm_cfg.py.master'); + $old_file = rf($full_file_name); + + $old_options = array(); + $lines = explode("\n", $old_file); + foreach ($lines as $line) + { + if (strlen($line) && substr($line, 0, 1) != '#') + { + list($key, $value) = explode("=", $line); + if (!empty($value)) + { + $key = rtrim($key); + $old_options[$key] = trim($value); + } + } + } + + $virtual_domains = ''; + if($status == 'update') + { + // create virtual_domains list + $domainAll = $this->db->queryAllRecords("SELECT domain FROM mail_mailinglist GROUP BY domain"); + + foreach($domainAll as $domain) + { + if ($domainAll[0]['domain'] == $domain['domain']) + $virtual_domains .= "'".$domain['domain']."'"; + else + $virtual_domains .= ", '".$domain['domain']."'"; + } + } + else + $virtual_domains = "' '"; + + $content = str_replace('{hostname}', $conf['hostname'], $content); + $content = str_replace('{default_language}', $old_options['DEFAULT_SERVER_LANGUAGE'], $content); + $content = str_replace('{virtual_domains}', $virtual_domains, $content); + + wf($full_file_name, $content); + } + + public function configure_postfix($options = '') { + global $conf; + $cf = $conf['postfix']; + $config_dir = $cf['config_dir']; + + if(!is_dir($config_dir)) { + $this->error("The postfix configuration directory '$config_dir' does not exist."); + } + + //* mysql-virtual_domains.cf + $this->process_postfix_config('mysql-virtual_domains.cf'); + + //* mysql-virtual_forwardings.cf + $this->process_postfix_config('mysql-virtual_forwardings.cf'); + + //* mysql-virtual_mailboxes.cf + $this->process_postfix_config('mysql-virtual_mailboxes.cf'); + + //* mysql-virtual_email2email.cf + $this->process_postfix_config('mysql-virtual_email2email.cf'); + + //* mysql-virtual_transports.cf + $this->process_postfix_config('mysql-virtual_transports.cf'); + + //* mysql-virtual_recipient.cf + $this->process_postfix_config('mysql-virtual_recipient.cf'); + + //* mysql-virtual_sender.cf + $this->process_postfix_config('mysql-virtual_sender.cf'); + + //* mysql-virtual_client.cf + $this->process_postfix_config('mysql-virtual_client.cf'); + + //* mysql-virtual_relaydomains.cf + $this->process_postfix_config('mysql-virtual_relaydomains.cf'); + + //* mysql-virtual_relayrecipientmaps.cf + $this->process_postfix_config('mysql-virtual_relayrecipientmaps.cf'); + + //* Changing mode and group of the new created config files. + caselog('chmod o= '.$config_dir.'/mysql-virtual_*.cf* &> /dev/null', + __FILE__, __LINE__, 'chmod on mysql-virtual_*.cf*', 'chmod on mysql-virtual_*.cf* failed'); + caselog('chgrp '.$cf['group'].' '.$config_dir.'/mysql-virtual_*.cf* &> /dev/null', + __FILE__, __LINE__, 'chgrp on mysql-virtual_*.cf*', 'chgrp on mysql-virtual_*.cf* failed'); + + //* Creating virtual mail user and group + $command = 'groupadd -g '.$cf['vmail_groupid'].' '.$cf['vmail_groupname']; + if(!is_group($cf['vmail_groupname'])) caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + $command = 'useradd -g '.$cf['vmail_groupname'].' -u '.$cf['vmail_userid'].' '.$cf['vmail_username'].' -d '.$cf['vmail_mailbox_base'].' -m'; + if(!is_user($cf['vmail_username'])) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + $postconf_commands = array ( + 'myhostname = '.$conf['hostname'], + 'mydestination = '.$conf['hostname'].', localhost, localhost.localdomain', + 'mynetworks = 127.0.0.0/8 [::1]/128', + 'alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases', + 'alias_database = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases', + 'virtual_alias_domains =', + 'virtual_alias_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_forwardings.cf, proxy:mysql:'.$config_dir.'/mysql-virtual_email2email.cf, hash:/var/lib/mailman/data/virtual-mailman', + 'virtual_mailbox_domains = proxy:mysql:'.$config_dir.'/mysql-virtual_domains.cf', + 'virtual_mailbox_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_mailboxes.cf', + 'virtual_mailbox_base = '.$cf['vmail_mailbox_base'], + 'virtual_uid_maps = static:'.$cf['vmail_userid'], + 'virtual_gid_maps = static:'.$cf['vmail_groupid'], + 'smtpd_sasl_auth_enable = yes', + 'broken_sasl_auth_clients = yes', + 'smtpd_sasl_authenticated_header = yes', + 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:'.$config_dir.'/mysql-virtual_recipient.cf, reject_unauth_destination', + 'smtpd_use_tls = yes', + 'smtpd_tls_security_level = may', + 'smtpd_tls_cert_file = '.$config_dir.'/smtpd.cert', + 'smtpd_tls_key_file = '.$config_dir.'/smtpd.key', + 'transport_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_transports.cf', + 'relay_domains = mysql:'.$config_dir.'/mysql-virtual_relaydomains.cf', + 'relay_recipient_maps = mysql:'.$config_dir.'/mysql-virtual_relayrecipientmaps.cf', + 'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps', + 'smtpd_sender_restrictions = check_sender_access mysql:'.$config_dir.'/mysql-virtual_sender.cf', + 'smtpd_client_restrictions = check_client_access mysql:'.$config_dir.'/mysql-virtual_client.cf', + 'maildrop_destination_concurrency_limit = 1', + 'maildrop_destination_recipient_limit = 1', + 'virtual_transport = maildrop', + 'header_checks = regexp:'.$config_dir.'/header_checks', + 'mime_header_checks = regexp:'.$config_dir.'/mime_header_checks', + 'nested_header_checks = regexp:'.$config_dir.'/nested_header_checks', + 'body_checks = regexp:'.$config_dir.'/body_checks', + 'owner_request_special = no' + ); + + //* Create the header and body check files + touch($config_dir.'/header_checks'); + touch($config_dir.'/mime_header_checks'); + touch($config_dir.'/nested_header_checks'); + touch($config_dir.'/body_checks'); + + //* Create the mailman files + exec('mkdir -p /var/lib/mailman/data'); + touch('/var/lib/mailman/data/aliases'); + exec('postmap /var/lib/mailman/data/aliases'); + touch('/var/lib/mailman/data/virtual-mailman'); + exec('postmap /var/lib/mailman/data/virtual-mailman'); + + //* Make a backup copy of the main.cf file + copy($config_dir.'/main.cf', $config_dir.'/main.cf~'); + + //* Executing the postconf commands + foreach($postconf_commands as $cmd) { + $command = "postconf -e '$cmd'"; + caselog($command." &> /dev/null", __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); + } + + if(!stristr($options,'dont-create-certs')) { + //* Create the SSL certificate + $command = 'cd '.$config_dir.'; ' .'openssl req -new -outform PEM -out smtpd.cert -newkey rsa:2048 -nodes -keyout smtpd.key -keyform PEM -days 3650 -x509'; - exec($command); - - $command = 'chmod o= '.$config_dir.'/smtpd.key'; - caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); - } - - //** We have to change the permissions of the courier authdaemon directory to make it accessible for maildrop. - $command = 'chmod 755 /var/run/courier/authdaemon/'; - if(is_file('/var/run/courier/authdaemon/')) caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); - - //* Changing maildrop lines in posfix master.cf - if(is_file($config_dir.'/master.cf')) { - copy($config_dir.'/master.cf', $config_dir.'/master.cf~'); - } - if(is_file($config_dir.'/master.cf~')) { - chmod($config_dir.'/master.cf~', 0400); - } - $configfile = $config_dir.'/master.cf'; - $content = rf($configfile); - $content = str_replace('flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}', - 'flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d '.$cf['vmail_username'].' ${extension} ${recipient} ${user} ${nexthop} ${sender}', - $content); - wf($configfile, $content); - - //* Writing the Maildrop mailfilter file - $configfile = 'mailfilter'; - if(is_file($cf['vmail_mailbox_base'].'/.'.$configfile)) { - copy($cf['vmail_mailbox_base'].'/.'.$configfile, $cf['vmail_mailbox_base'].'/.'.$configfile.'~'); - } - $content = rf('tpl/'.$configfile.'.master'); - $content = str_replace('{dist_postfix_vmail_mailbox_base}', $cf['vmail_mailbox_base'], $content); - wf($cf['vmail_mailbox_base'].'/.'.$configfile, $content); - - //* Create the directory for the custom mailfilters - if(!is_dir($cf['vmail_mailbox_base'].'/mailfilters')) { - $command = 'mkdir '.$cf['vmail_mailbox_base'].'/mailfilters'; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - } - - //* Chmod and chown the .mailfilter file - $command = 'chown -R '.$cf['vmail_username'].':'.$cf['vmail_groupname'].' '.$cf['vmail_mailbox_base'].'/.mailfilter'; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - $command = 'chmod -R 600 '.$cf['vmail_mailbox_base'].'/.mailfilter'; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - } - - public function configure_saslauthd() { - global $conf; - - - $configfile = 'sasl_smtpd.conf'; - if(is_file($conf['postfix']['config_dir'].'/sasl/smtpd.conf')) copy($conf['postfix']['config_dir'].'/sasl/smtpd.conf',$conf['postfix']['config_dir'].'/sasl/smtpd.conf~'); - if(is_file($conf['postfix']['config_dir'].'/sasl/smtpd.conf~')) chmod($conf['postfix']['config_dir'].'/sasl/smtpd.conf~', 0400); - $content = rf('tpl/'.$configfile.'.master'); - $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); - $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); - $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); - $content = str_replace('{mysql_server_ip}',$conf['mysql']['ip'],$content); - wf($conf['postfix']['config_dir'].'/sasl/smtpd.conf',$content); - - // TODO: Chmod and chown on the config file - - - // Recursively create the spool directory - if(!@is_dir('/var/spool/postfix/var/run/saslauthd')) mkdir('/var/spool/postfix/var/run/saslauthd', 0755, true); - - // Edit the file /etc/default/saslauthd - $configfile = $conf['saslauthd']['config']; - if(is_file($configfile)) copy($configfile,$configfile.'~'); - if(is_file($configfile.'~')) chmod($configfile.'~', 0400); - $content = rf($configfile); - $content = str_replace('START=no','START=yes',$content); - // Debian - $content = str_replace('OPTIONS="-c"','OPTIONS="-m /var/spool/postfix/var/run/saslauthd -r"',$content); - // Ubuntu - $content = str_replace('OPTIONS="-c -m /var/run/saslauthd"','OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"',$content); - wf($configfile,$content); - - // Edit the file /etc/init.d/saslauthd - $configfile = $conf['init_scripts'].'/'.$conf['saslauthd']['init_script']; - $content = rf($configfile); - $content = str_replace('PIDFILE=$RUN_DIR/saslauthd.pid','PIDFILE="/var/spool/postfix/var/run/${NAME}/saslauthd.pid"',$content); - wf($configfile,$content); - - // add the postfix user to the sasl group (at least necessary for Ubuntu 8.04 and most likely Debian Lenny as well. - exec('adduser postfix sasl'); - - - } - - public function configure_pam() { - global $conf; - $pam = $conf['pam']; - //* configure pam for SMTP authentication agains the ispconfig database - $configfile = 'pamd_smtp'; - if(is_file($pam.'/smtp')) copy($pam.'/smtp', $pam.'/smtp~'); - if(is_file($pam.'/smtp~')) chmod($pam.'/smtp~', 0400); - - $content = rf('tpl/'.$configfile.'.master'); - $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); - $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); - $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); - $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); - wf($pam.'/smtp', $content); - // On some OSes smtp is world readable which allows for reading database information. Removing world readable rights should have no effect. - if(is_file($pam.'/smtp')) exec("chmod o= $pam/smtp"); - chmod($pam.'/smtp', 0660); - chown($pam.'/smtp', 'daemon'); - chgrp($pam.'/smtp', 'daemon'); - - } - - public function configure_courier() { - global $conf; - $config_dir = $conf['courier']['config_dir']; - //* authmysqlrc - $configfile = 'authmysqlrc'; - if(is_file($config_dir.'/'.$configfile)) { - copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~'); - } - chmod($config_dir.'/'.$configfile.'~', 0400); - $content = rf('tpl/'.$configfile.'.master'); - $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); - $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); - $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); - $content = str_replace('{mysql_server_host}',$conf['mysql']['host'],$content); - wf($config_dir.'/'.$configfile, $content); - - chmod($config_dir.'/'.$configfile, 0660); - chown($config_dir.'/'.$configfile, 'daemon'); - chgrp($config_dir.'/'.$configfile, 'daemon'); - - //* authdaemonrc - $configfile = $config_dir.'/authdaemonrc'; - if(is_file($configfile)) { - copy($configfile, $configfile.'~'); - } - if(is_file($configfile.'~')) { - chmod($configfile.'~', 0400); - } - $content = rf($configfile); - $content = str_replace('authmodulelist="authpam"', 'authmodulelist="authmysql"', $content); - wf($configfile, $content); - } - - public function configure_dovecot() { - global $conf; - - $config_dir = $conf['dovecot']['config_dir']; - - //* Configure master.cf and add a line for deliver - if(is_file($conf['postfix']['config_dir'].'/master.cf')) { - copy($conf['postfix']['config_dir'].'/master.cf', $conf['postfix']['config_dir'].'/master.cf~2'); - } - if(is_file($conf['postfix']['config_dir'].'/master.cf~')) { - chmod($conf['postfix']['config_dir'].'/master.cf~2', 0400); - } - $content = rf($conf['postfix']['config_dir'].'/master.cf'); - // Only add the content if we had not addded it before - if(!stristr($content,'dovecot/deliver')) { - $deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'; - af($conf['postfix']['config_dir'].'/master.cf',$deliver_content); - } - unset($content); - unset($deliver_content); - - - //* Reconfigure postfix to use dovecot authentication - // Adding the amavisd commands to the postfix configuration - $postconf_commands = array ( - 'dovecot_destination_recipient_limit = 1', - 'virtual_transport = dovecot', - 'smtpd_sasl_type = dovecot', - 'smtpd_sasl_path = private/auth' - ); - - // Make a backup copy of the main.cf file - copy($conf['postfix']['config_dir'].'/main.cf',$conf['postfix']['config_dir'].'/main.cf~3'); - - // Executing the postconf commands - foreach($postconf_commands as $cmd) { - $command = "postconf -e '$cmd'"; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - } - - //* copy dovecot.conf - $configfile = 'dovecot.conf'; - if(is_file($config_dir.'/'.$configfile)) { - copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~'); - } - copy('tpl/debian_dovecot.conf.master',$config_dir.'/'.$configfile); - - //* dovecot-sql.conf - $configfile = 'dovecot-sql.conf'; - if(is_file($config_dir.'/'.$configfile)) { - copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~'); - } - chmod($config_dir.'/'.$configfile.'~', 0400); - $content = rf('tpl/debian_dovecot-sql.conf.master'); - $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); - $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); - $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); - $content = str_replace('{mysql_server_host}',$conf['mysql']['host'],$content); - wf($config_dir.'/'.$configfile, $content); - - chmod($config_dir.'/'.$configfile, 0600); - chown($config_dir.'/'.$configfile, 'root'); - chgrp($config_dir.'/'.$configfile, 'root'); - - } - - public function configure_amavis() { - global $conf; - - // amavisd user config file - $configfile = 'amavisd_user_config'; - if(is_file($conf['amavis']['config_dir'].'/conf.d/50-user')) copy($conf['amavis']['config_dir'].'/conf.d/50-user',$conf['amavis']['config_dir'].'/50-user~'); - if(is_file($conf['amavis']['config_dir'].'/conf.d/50-user~')) chmod($conf['amavis']['config_dir'].'/conf.d/50-user~', 0400); - $content = rf('tpl/'.$configfile.'.master'); - $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); - $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); - $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); - $content = str_replace('{mysql_server_port}',$conf['mysql']['port'],$content); - $content = str_replace('{mysql_server_ip}',$conf['mysql']['ip'],$content); - wf($conf['amavis']['config_dir'].'/conf.d/50-user',$content); - - // TODO: chmod and chown on the config file - - - // Adding the amavisd commands to the postfix configuration - $postconf_commands = array ( - 'content_filter = amavis:[127.0.0.1]:10024', - 'receive_override_options = no_address_mappings' - ); - - // Make a backup copy of the main.cf file - copy($conf['postfix']['config_dir'].'/main.cf',$conf['postfix']['config_dir'].'/main.cf~2'); - - // Executing the postconf commands - foreach($postconf_commands as $cmd) { - $command = "postconf -e '$cmd'"; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - } - - // Append the configuration for amavisd to the master.cf file - if(is_file($conf['postfix']['config_dir'].'/master.cf')) copy($conf['postfix']['config_dir'].'/master.cf',$conf['postfix']['config_dir'].'/master.cf~'); - $content = rf($conf['postfix']['config_dir'].'/master.cf'); - // Only add the content if we had not addded it before - if(!stristr($content,'127.0.0.1:10025')) { - unset($content); - $content = rf('tpl/master_cf_amavis.master'); - af($conf['postfix']['config_dir'].'/master.cf',$content); - } - unset($content); - - // Add the clamav user to the amavis group - exec('adduser clamav amavis'); - - - } - - public function configure_spamassassin() { - global $conf; - - //* Enable spamasasssin on debian and ubuntu - $configfile = '/etc/default/spamassassin'; - if(is_file($configfile)) { - copy($configfile, $configfile.'~'); - } - $content = rf($configfile); - $content = str_replace('ENABLED=0', 'ENABLED=1', $content); - wf($configfile, $content); - } - - public function configure_getmail() { - global $conf; - - $config_dir = $conf['getmail']['config_dir']; - - if(!@is_dir($config_dir)) mkdir(escapeshellcmd($config_dir), 0700, true); - - $command = 'useradd -d '.$config_dir.' getmail'; - if(!is_user('getmail')) caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - $command = "chown -R getmail $config_dir"; - caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - $command = "chmod -R 700 $config_dir"; - caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - } - - - public function configure_pureftpd() { - global $conf; - - $config_dir = $conf['pureftpd']['config_dir']; - - //* configure pure-ftpd for MySQL authentication against the ispconfig database - $configfile = 'db/mysql.conf'; - if(is_file($config_dir.'/'.$configfile)) { - copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~'); - } - if(is_file($config_dir.'/'.$configfile.'~')) { - chmod($config_dir.'/'.$configfile.'~', 0400); - } - $content = rf('tpl/pureftpd_mysql.conf.master'); - $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); - $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); - $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); - $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); - $content = str_replace('{server_id}', $conf['server_id'], $content); - wf($config_dir.'/'.$configfile, $content); - chmod($config_dir.'/'.$configfile, 0600); - chown($config_dir.'/'.$configfile, 'root'); - chgrp($config_dir.'/'.$configfile, 'root'); - // **enable chrooting - //exec('mkdir -p '.$config_dir.'/conf/ChrootEveryone'); - exec('echo "yes" > '.$config_dir.'/conf/ChrootEveryone'); - exec('echo "yes" > '.$config_dir.'/conf/BrokenClientsCompatibility'); - exec('echo "yes" > '.$config_dir.'/conf/DisplayDotFiles'); - - if(is_file('/etc/default/pure-ftpd-common')) { - replaceLine('/etc/default/pure-ftpd-common','STANDALONE_OR_INETD=inetd','STANDALONE_OR_INETD=standalone',1,0); - replaceLine('/etc/default/pure-ftpd-common','VIRTUALCHROOT=false','VIRTUALCHROOT=true',1,0); - } - - if(is_file('/etc/inetd.conf')) { - replaceLine('/etc/inetd.conf','/usr/sbin/pure-ftpd-wrapper','#ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/pure-ftpd-wrapper',0,0); - if(is_file($conf['init_scripts'].'/'.'openbsd-inetd')) exec($conf['init_scripts'].'/'.'openbsd-inetd restart'); - } - - if(!is_file('/etc/pure-ftpd/conf/DontResolve')) exec('echo "yes" > /etc/pure-ftpd/conf/DontResolve'); - } - - public function configure_mydns() { - global $conf; - - // configure pam for SMTP authentication agains the ispconfig database - $configfile = 'mydns.conf'; - if(is_file($conf['mydns']['config_dir'].'/'.$configfile)) copy($conf['mydns']['config_dir'].'/'.$configfile,$conf['mydns']['config_dir'].'/'.$configfile.'~'); - if(is_file($conf['mydns']['config_dir'].'/'.$configfile.'~')) chmod($conf['mydns']['config_dir'].'/'.$configfile.'~', 0400); - $content = rf('tpl/'.$configfile.'.master'); - $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); - $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); - $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); - $content = str_replace('{mysql_server_host}',$conf['mysql']['host'],$content); - $content = str_replace('{server_id}',$conf['server_id'],$content); - wf($conf['mydns']['config_dir'].'/'.$configfile,$content); - chmod($conf['mydns']['config_dir'].'/'.$configfile, 0600); - chown($conf['mydns']['config_dir'].'/'.$configfile, 'root'); - chgrp($conf['mydns']['config_dir'].'/'.$configfile, 'root'); - - } - - public function configure_powerdns() { - global $conf; - - //* Create the database - if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$conf['powerdns']['database'].' DEFAULT CHARACTER SET '.$conf['mysql']['charset'])) { - $this->error('Unable to create MySQL database: '.$conf['powerdns']['database'].'.'); - } - - //* Create the ISPConfig database user in the local database - $query = "GRANT ALL ON `".$conf['powerdns']['database']."` . * TO '".$conf['mysql']['ispconfig_user']."'@'localhost';"; - if(!$this->db->query($query)) { - $this->error('Unable to create user for powerdns database Error: '.$this->db->errorMessage); - } - - //* Reload database privelages - $this->db->query('FLUSH PRIVILEGES;'); - - //* load the powerdns databse dump - if($conf['mysql']['admin_password'] == '') { - caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' '".$conf['powerdns']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/powerdns.sql' &> /dev/null", - __FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in powerdns.sql'); - } else { - caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' -p'".$conf['mysql']['admin_password']."' '".$conf['powerdns']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/powerdns.sql' &> /dev/null", - __FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in powerdns.sql'); - } - - //* Create the powerdns config file - $configfile = 'pdns.local'; - if(is_file($conf['powerdns']['config_dir'].'/'.$configfile)) copy($conf['powerdns']['config_dir'].'/'.$configfile,$conf['powerdns']['config_dir'].'/'.$configfile.'~'); - if(is_file($conf['powerdns']['config_dir'].'/'.$configfile.'~')) chmod($conf['powerdns']['config_dir'].'/'.$configfile.'~', 0400); - $content = rf('tpl/'.$configfile.'.master'); - $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); - $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); - $content = str_replace('{powerdns_database}',$conf['powerdns']['database'],$content); - $content = str_replace('{mysql_server_host}',$conf['mysql']['host'],$content); - wf($conf['powerdns']['config_dir'].'/'.$configfile,$content); - chmod($conf['powerdns']['config_dir'].'/'.$configfile, 0600); - chown($conf['powerdns']['config_dir'].'/'.$configfile, 'root'); - chgrp($conf['powerdns']['config_dir'].'/'.$configfile, 'root'); - - - } - - public function configure_bind() { - global $conf; - - //* Check if the zonefile directory has a slash at the end - $content=$conf['bind']['bind_zonefiles_dir']; - if(substr($content,-1,1) != '/') { - $content .= '/'; - } - - //* Create the slave subdirectory - $content .= 'slave'; - if(!@is_dir($content)) mkdir($content, 0770, true); - - //* Chown the slave subdirectory to $conf['bind']['bind_user'] - chown($content, $conf['bind']['bind_user']); - chgrp($content, $conf['bind']['bind_group']); - - } - - - - public function configure_apache() { - global $conf; - - //* Create the logging directory for the vhost logfiles - if(!@is_dir($conf['ispconfig_log_dir'].'/httpd')) mkdir($conf['ispconfig_log_dir'].'/httpd', 0755, true); - - 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','umask=0077','umask=0022',0); - } - - if(is_file('/etc/apache2/sites-enabled/000-default')) { - replaceLine('/etc/apache2/sites-available/000-default','NameVirtualHost *','NameVirtualHost *:80',1,0); - replaceLine('/etc/apache2/sites-available/000-default','','',1,0); - } - - if(is_file('/etc/apache2/ports.conf')) { - // add a line "Listen 443" to ports conf if line does not exist - replaceLine('/etc/apache2/ports.conf','Listen 443','Listen 443',1); - } - - - //* Copy the ISPConfig configuration include - $vhost_conf_dir = $conf['apache']['vhost_conf_dir']; - $vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir']; - - // copy('tpl/apache_ispconfig.conf.master',$vhost_conf_dir.'/ispconfig.conf'); - - $content = rf('tpl/apache_ispconfig.conf.master'); - $records = $this->db->queryAllRecords('SELECT * FROM '.$conf['mysql']['master_database'].'.server_ip WHERE server_id = '.$conf['server_id']." AND virtualhost = 'y'"); - if(is_array($records) && count($records) > 0) { - foreach($records as $rec) { - $content .= 'NameVirtualHost '.$rec['ip_address'].":80\n"; - $content .= 'NameVirtualHost '.$rec['ip_address'].":443\n"; - } - } - $content .= "\n"; - wf($vhost_conf_dir.'/ispconfig.conf',$content); - - if(!@is_link($vhost_conf_enabled_dir.'/000-ispconfig.conf')) { - symlink($vhost_conf_dir.'/ispconfig.conf',$vhost_conf_enabled_dir.'/000-ispconfig.conf'); - } - - //* make sure that webalizer finds its config file when it is directly in /etc - if(@is_file('/etc/webalizer.conf') && !@is_dir('/etc/webalizer')) { - mkdir('/etc/webalizer'); - symlink('/etc/webalizer.conf','/etc/webalizer/webalizer.conf'); - } - - if(is_file('/etc/webalizer/webalizer.conf')) { - // Change webalizer mode to incremental - replaceLine('/etc/webalizer/webalizer.conf','#IncrementalName','IncrementalName webalizer.current',0,0); - replaceLine('/etc/webalizer/webalizer.conf','#Incremental','Incremental yes',0,0); - replaceLine('/etc/webalizer/webalizer.conf','#HistoryName','HistoryName webalizer.hist',0,0); - } - - // Check the awsatst script - if(!is_dir('/usr/share/awstats/tools')) exec('mkdir -p /usr/share/awstats/tools'); - if(!file_exists('/usr/share/awstats/tools/awstats_buildstaticpages.pl') && file_exists('/usr/share/doc/awstats/examples/awstats_buildstaticpages.pl')) symlink('/usr/share/doc/awstats/examples/awstats_buildstaticpages.pl','/usr/share/awstats/tools/awstats_buildstaticpages.pl'); + exec($command); + + $command = 'chmod o= '.$config_dir.'/smtpd.key'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); + } + + //** We have to change the permissions of the courier authdaemon directory to make it accessible for maildrop. + $command = 'chmod 755 /var/run/courier/authdaemon/'; + if(is_file('/var/run/courier/authdaemon/')) caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); + + //* Changing maildrop lines in posfix master.cf + if(is_file($config_dir.'/master.cf')) { + copy($config_dir.'/master.cf', $config_dir.'/master.cf~'); + } + if(is_file($config_dir.'/master.cf~')) { + chmod($config_dir.'/master.cf~', 0400); + } + $configfile = $config_dir.'/master.cf'; + $content = rf($configfile); + $content = str_replace('flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}', + 'flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d '.$cf['vmail_username'].' ${extension} ${recipient} ${user} ${nexthop} ${sender}', + $content); + wf($configfile, $content); + + //* Writing the Maildrop mailfilter file + $configfile = 'mailfilter'; + if(is_file($cf['vmail_mailbox_base'].'/.'.$configfile)) { + copy($cf['vmail_mailbox_base'].'/.'.$configfile, $cf['vmail_mailbox_base'].'/.'.$configfile.'~'); + } + $content = rf('tpl/'.$configfile.'.master'); + $content = str_replace('{dist_postfix_vmail_mailbox_base}', $cf['vmail_mailbox_base'], $content); + wf($cf['vmail_mailbox_base'].'/.'.$configfile, $content); + + //* Create the directory for the custom mailfilters + if(!is_dir($cf['vmail_mailbox_base'].'/mailfilters')) { + $command = 'mkdir '.$cf['vmail_mailbox_base'].'/mailfilters'; + caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + } + + //* Chmod and chown the .mailfilter file + $command = 'chown -R '.$cf['vmail_username'].':'.$cf['vmail_groupname'].' '.$cf['vmail_mailbox_base'].'/.mailfilter'; + caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + $command = 'chmod -R 600 '.$cf['vmail_mailbox_base'].'/.mailfilter'; + caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + } + + public function configure_saslauthd() { + global $conf; + + + $configfile = 'sasl_smtpd.conf'; + if(is_file($conf['postfix']['config_dir'].'/sasl/smtpd.conf')) copy($conf['postfix']['config_dir'].'/sasl/smtpd.conf',$conf['postfix']['config_dir'].'/sasl/smtpd.conf~'); + if(is_file($conf['postfix']['config_dir'].'/sasl/smtpd.conf~')) chmod($conf['postfix']['config_dir'].'/sasl/smtpd.conf~', 0400); + $content = rf('tpl/'.$configfile.'.master'); + $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); + $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); + $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); + $content = str_replace('{mysql_server_ip}',$conf['mysql']['ip'],$content); + wf($conf['postfix']['config_dir'].'/sasl/smtpd.conf',$content); + + // TODO: Chmod and chown on the config file + + + // Recursively create the spool directory + if(!@is_dir('/var/spool/postfix/var/run/saslauthd')) mkdir('/var/spool/postfix/var/run/saslauthd', 0755, true); + + // Edit the file /etc/default/saslauthd + $configfile = $conf['saslauthd']['config']; + if(is_file($configfile)) copy($configfile,$configfile.'~'); + if(is_file($configfile.'~')) chmod($configfile.'~', 0400); + $content = rf($configfile); + $content = str_replace('START=no','START=yes',$content); + // Debian + $content = str_replace('OPTIONS="-c"','OPTIONS="-m /var/spool/postfix/var/run/saslauthd -r"',$content); + // Ubuntu + $content = str_replace('OPTIONS="-c -m /var/run/saslauthd"','OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"',$content); + wf($configfile,$content); + + // Edit the file /etc/init.d/saslauthd + $configfile = $conf['init_scripts'].'/'.$conf['saslauthd']['init_script']; + $content = rf($configfile); + $content = str_replace('PIDFILE=$RUN_DIR/saslauthd.pid','PIDFILE="/var/spool/postfix/var/run/${NAME}/saslauthd.pid"',$content); + wf($configfile,$content); + + // add the postfix user to the sasl group (at least necessary for Ubuntu 8.04 and most likely Debian Lenny as well. + exec('adduser postfix sasl'); + + + } + + public function configure_pam() { + global $conf; + $pam = $conf['pam']; + //* configure pam for SMTP authentication agains the ispconfig database + $configfile = 'pamd_smtp'; + if(is_file($pam.'/smtp')) copy($pam.'/smtp', $pam.'/smtp~'); + if(is_file($pam.'/smtp~')) chmod($pam.'/smtp~', 0400); + + $content = rf('tpl/'.$configfile.'.master'); + $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); + $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); + $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); + $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); + wf($pam.'/smtp', $content); + // On some OSes smtp is world readable which allows for reading database information. Removing world readable rights should have no effect. + if(is_file($pam.'/smtp')) exec("chmod o= $pam/smtp"); + chmod($pam.'/smtp', 0660); + chown($pam.'/smtp', 'daemon'); + chgrp($pam.'/smtp', 'daemon'); + + } + + public function configure_courier() { + global $conf; + $config_dir = $conf['courier']['config_dir']; + //* authmysqlrc + $configfile = 'authmysqlrc'; + if(is_file($config_dir.'/'.$configfile)) { + copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~'); + } + chmod($config_dir.'/'.$configfile.'~', 0400); + $content = rf('tpl/'.$configfile.'.master'); + $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); + $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); + $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); + $content = str_replace('{mysql_server_host}',$conf['mysql']['host'],$content); + wf($config_dir.'/'.$configfile, $content); + + chmod($config_dir.'/'.$configfile, 0660); + chown($config_dir.'/'.$configfile, 'daemon'); + chgrp($config_dir.'/'.$configfile, 'daemon'); + + //* authdaemonrc + $configfile = $config_dir.'/authdaemonrc'; + if(is_file($configfile)) { + copy($configfile, $configfile.'~'); + } + if(is_file($configfile.'~')) { + chmod($configfile.'~', 0400); + } + $content = rf($configfile); + $content = str_replace('authmodulelist="authpam"', 'authmodulelist="authmysql"', $content); + wf($configfile, $content); + } + + public function configure_dovecot() { + global $conf; + + $config_dir = $conf['dovecot']['config_dir']; + + //* Configure master.cf and add a line for deliver + if(is_file($conf['postfix']['config_dir'].'/master.cf')) { + copy($conf['postfix']['config_dir'].'/master.cf', $conf['postfix']['config_dir'].'/master.cf~2'); + } + if(is_file($conf['postfix']['config_dir'].'/master.cf~')) { + chmod($conf['postfix']['config_dir'].'/master.cf~2', 0400); + } + $content = rf($conf['postfix']['config_dir'].'/master.cf'); + // Only add the content if we had not addded it before + if(!stristr($content,'dovecot/deliver')) { + $deliver_content = 'dovecot unix - n n - - pipe'."\n".' flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}'; + af($conf['postfix']['config_dir'].'/master.cf',$deliver_content); + } + unset($content); + unset($deliver_content); + + + //* Reconfigure postfix to use dovecot authentication + // Adding the amavisd commands to the postfix configuration + $postconf_commands = array ( + 'dovecot_destination_recipient_limit = 1', + 'virtual_transport = dovecot', + 'smtpd_sasl_type = dovecot', + 'smtpd_sasl_path = private/auth' + ); + + // Make a backup copy of the main.cf file + copy($conf['postfix']['config_dir'].'/main.cf',$conf['postfix']['config_dir'].'/main.cf~3'); + + // Executing the postconf commands + foreach($postconf_commands as $cmd) { + $command = "postconf -e '$cmd'"; + caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + } + + //* copy dovecot.conf + $configfile = 'dovecot.conf'; + if(is_file($config_dir.'/'.$configfile)) { + copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~'); + } + copy('tpl/debian_dovecot.conf.master',$config_dir.'/'.$configfile); + + //* dovecot-sql.conf + $configfile = 'dovecot-sql.conf'; + if(is_file($config_dir.'/'.$configfile)) { + copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~'); + } + chmod($config_dir.'/'.$configfile.'~', 0400); + $content = rf('tpl/debian_dovecot-sql.conf.master'); + $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); + $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); + $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); + $content = str_replace('{mysql_server_host}',$conf['mysql']['host'],$content); + wf($config_dir.'/'.$configfile, $content); + + chmod($config_dir.'/'.$configfile, 0600); + chown($config_dir.'/'.$configfile, 'root'); + chgrp($config_dir.'/'.$configfile, 'root'); + + } + + public function configure_amavis() { + global $conf; + + // amavisd user config file + $configfile = 'amavisd_user_config'; + if(is_file($conf['amavis']['config_dir'].'/conf.d/50-user')) copy($conf['amavis']['config_dir'].'/conf.d/50-user',$conf['amavis']['config_dir'].'/50-user~'); + if(is_file($conf['amavis']['config_dir'].'/conf.d/50-user~')) chmod($conf['amavis']['config_dir'].'/conf.d/50-user~', 0400); + $content = rf('tpl/'.$configfile.'.master'); + $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); + $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); + $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); + $content = str_replace('{mysql_server_port}',$conf['mysql']['port'],$content); + $content = str_replace('{mysql_server_ip}',$conf['mysql']['ip'],$content); + wf($conf['amavis']['config_dir'].'/conf.d/50-user',$content); + + // TODO: chmod and chown on the config file + + + // Adding the amavisd commands to the postfix configuration + $postconf_commands = array ( + 'content_filter = amavis:[127.0.0.1]:10024', + 'receive_override_options = no_address_mappings' + ); + + // Make a backup copy of the main.cf file + copy($conf['postfix']['config_dir'].'/main.cf',$conf['postfix']['config_dir'].'/main.cf~2'); + + // Executing the postconf commands + foreach($postconf_commands as $cmd) { + $command = "postconf -e '$cmd'"; + caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + } + + // Append the configuration for amavisd to the master.cf file + if(is_file($conf['postfix']['config_dir'].'/master.cf')) copy($conf['postfix']['config_dir'].'/master.cf',$conf['postfix']['config_dir'].'/master.cf~'); + $content = rf($conf['postfix']['config_dir'].'/master.cf'); + // Only add the content if we had not addded it before + if(!stristr($content,'127.0.0.1:10025')) { + unset($content); + $content = rf('tpl/master_cf_amavis.master'); + af($conf['postfix']['config_dir'].'/master.cf',$content); + } + unset($content); + + // Add the clamav user to the amavis group + exec('adduser clamav amavis'); + + + } + + public function configure_spamassassin() { + global $conf; + + //* Enable spamasasssin on debian and ubuntu + $configfile = '/etc/default/spamassassin'; + if(is_file($configfile)) { + copy($configfile, $configfile.'~'); + } + $content = rf($configfile); + $content = str_replace('ENABLED=0', 'ENABLED=1', $content); + wf($configfile, $content); + } + + public function configure_getmail() { + global $conf; + + $config_dir = $conf['getmail']['config_dir']; + + if(!@is_dir($config_dir)) mkdir(escapeshellcmd($config_dir), 0700, true); + + $command = 'useradd -d '.$config_dir.' getmail'; + if(!is_user('getmail')) caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + $command = "chown -R getmail $config_dir"; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + $command = "chmod -R 700 $config_dir"; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + } + + + public function configure_pureftpd() { + global $conf; + + $config_dir = $conf['pureftpd']['config_dir']; + + //* configure pure-ftpd for MySQL authentication against the ispconfig database + $configfile = 'db/mysql.conf'; + if(is_file($config_dir.'/'.$configfile)) { + copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~'); + } + if(is_file($config_dir.'/'.$configfile.'~')) { + chmod($config_dir.'/'.$configfile.'~', 0400); + } + $content = rf('tpl/pureftpd_mysql.conf.master'); + $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); + $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); + $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); + $content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content); + $content = str_replace('{server_id}', $conf['server_id'], $content); + wf($config_dir.'/'.$configfile, $content); + chmod($config_dir.'/'.$configfile, 0600); + chown($config_dir.'/'.$configfile, 'root'); + chgrp($config_dir.'/'.$configfile, 'root'); + // **enable chrooting + //exec('mkdir -p '.$config_dir.'/conf/ChrootEveryone'); + exec('echo "yes" > '.$config_dir.'/conf/ChrootEveryone'); + exec('echo "yes" > '.$config_dir.'/conf/BrokenClientsCompatibility'); + exec('echo "yes" > '.$config_dir.'/conf/DisplayDotFiles'); + + if(is_file('/etc/default/pure-ftpd-common')) { + replaceLine('/etc/default/pure-ftpd-common','STANDALONE_OR_INETD=inetd','STANDALONE_OR_INETD=standalone',1,0); + replaceLine('/etc/default/pure-ftpd-common','VIRTUALCHROOT=false','VIRTUALCHROOT=true',1,0); + } + + if(is_file('/etc/inetd.conf')) { + replaceLine('/etc/inetd.conf','/usr/sbin/pure-ftpd-wrapper','#ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/pure-ftpd-wrapper',0,0); + if(is_file($conf['init_scripts'].'/'.'openbsd-inetd')) exec($conf['init_scripts'].'/'.'openbsd-inetd restart'); + } + + if(!is_file('/etc/pure-ftpd/conf/DontResolve')) exec('echo "yes" > /etc/pure-ftpd/conf/DontResolve'); + } + + public function configure_mydns() { + global $conf; + + // configure pam for SMTP authentication agains the ispconfig database + $configfile = 'mydns.conf'; + if(is_file($conf['mydns']['config_dir'].'/'.$configfile)) copy($conf['mydns']['config_dir'].'/'.$configfile,$conf['mydns']['config_dir'].'/'.$configfile.'~'); + if(is_file($conf['mydns']['config_dir'].'/'.$configfile.'~')) chmod($conf['mydns']['config_dir'].'/'.$configfile.'~', 0400); + $content = rf('tpl/'.$configfile.'.master'); + $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); + $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); + $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); + $content = str_replace('{mysql_server_host}',$conf['mysql']['host'],$content); + $content = str_replace('{server_id}',$conf['server_id'],$content); + wf($conf['mydns']['config_dir'].'/'.$configfile,$content); + chmod($conf['mydns']['config_dir'].'/'.$configfile, 0600); + chown($conf['mydns']['config_dir'].'/'.$configfile, 'root'); + chgrp($conf['mydns']['config_dir'].'/'.$configfile, 'root'); + + } + + public function configure_powerdns() { + global $conf; + + //* Create the database + if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$conf['powerdns']['database'].' DEFAULT CHARACTER SET '.$conf['mysql']['charset'])) { + $this->error('Unable to create MySQL database: '.$conf['powerdns']['database'].'.'); + } + + //* Create the ISPConfig database user in the local database + $query = "GRANT ALL ON `".$conf['powerdns']['database']."` . * TO '".$conf['mysql']['ispconfig_user']."'@'localhost';"; + if(!$this->db->query($query)) { + $this->error('Unable to create user for powerdns database Error: '.$this->db->errorMessage); + } + + //* Reload database privelages + $this->db->query('FLUSH PRIVILEGES;'); + + //* load the powerdns databse dump + if($conf['mysql']['admin_password'] == '') { + caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' '".$conf['powerdns']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/powerdns.sql' &> /dev/null", + __FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in powerdns.sql'); + } else { + caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' -p'".$conf['mysql']['admin_password']."' '".$conf['powerdns']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/powerdns.sql' &> /dev/null", + __FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in powerdns.sql'); + } + + //* Create the powerdns config file + $configfile = 'pdns.local'; + if(is_file($conf['powerdns']['config_dir'].'/'.$configfile)) copy($conf['powerdns']['config_dir'].'/'.$configfile,$conf['powerdns']['config_dir'].'/'.$configfile.'~'); + if(is_file($conf['powerdns']['config_dir'].'/'.$configfile.'~')) chmod($conf['powerdns']['config_dir'].'/'.$configfile.'~', 0400); + $content = rf('tpl/'.$configfile.'.master'); + $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); + $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); + $content = str_replace('{powerdns_database}',$conf['powerdns']['database'],$content); + $content = str_replace('{mysql_server_host}',$conf['mysql']['host'],$content); + wf($conf['powerdns']['config_dir'].'/'.$configfile,$content); + chmod($conf['powerdns']['config_dir'].'/'.$configfile, 0600); + chown($conf['powerdns']['config_dir'].'/'.$configfile, 'root'); + chgrp($conf['powerdns']['config_dir'].'/'.$configfile, 'root'); + + + } + + public function configure_bind() { + global $conf; + + //* Check if the zonefile directory has a slash at the end + $content=$conf['bind']['bind_zonefiles_dir']; + if(substr($content,-1,1) != '/') { + $content .= '/'; + } + + //* Create the slave subdirectory + $content .= 'slave'; + if(!@is_dir($content)) mkdir($content, 0770, true); + + //* Chown the slave subdirectory to $conf['bind']['bind_user'] + chown($content, $conf['bind']['bind_user']); + chgrp($content, $conf['bind']['bind_group']); + + } + + + + public function configure_apache() { + global $conf; + + //* Create the logging directory for the vhost logfiles + if(!@is_dir($conf['ispconfig_log_dir'].'/httpd')) mkdir($conf['ispconfig_log_dir'].'/httpd', 0755, true); + + 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','umask=0077','umask=0022',0); + } + + if(is_file('/etc/apache2/sites-enabled/000-default')) { + replaceLine('/etc/apache2/sites-available/000-default','NameVirtualHost *','NameVirtualHost *:80',1,0); + replaceLine('/etc/apache2/sites-available/000-default','','',1,0); + } + + if(is_file('/etc/apache2/ports.conf')) { + // add a line "Listen 443" to ports conf if line does not exist + replaceLine('/etc/apache2/ports.conf','Listen 443','Listen 443',1); + } + + + //* Copy the ISPConfig configuration include + $vhost_conf_dir = $conf['apache']['vhost_conf_dir']; + $vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir']; + + // copy('tpl/apache_ispconfig.conf.master',$vhost_conf_dir.'/ispconfig.conf'); + + $content = rf('tpl/apache_ispconfig.conf.master'); + $records = $this->db->queryAllRecords('SELECT * FROM '.$conf['mysql']['master_database'].'.server_ip WHERE server_id = '.$conf['server_id']." AND virtualhost = 'y'"); + if(is_array($records) && count($records) > 0) { + foreach($records as $rec) { + $content .= 'NameVirtualHost '.$rec['ip_address'].":80\n"; + $content .= 'NameVirtualHost '.$rec['ip_address'].":443\n"; + } + } + $content .= "\n"; + wf($vhost_conf_dir.'/ispconfig.conf',$content); + + if(!@is_link($vhost_conf_enabled_dir.'/000-ispconfig.conf')) { + symlink($vhost_conf_dir.'/ispconfig.conf',$vhost_conf_enabled_dir.'/000-ispconfig.conf'); + } + + //* make sure that webalizer finds its config file when it is directly in /etc + if(@is_file('/etc/webalizer.conf') && !@is_dir('/etc/webalizer')) { + mkdir('/etc/webalizer'); + symlink('/etc/webalizer.conf','/etc/webalizer/webalizer.conf'); + } + + if(is_file('/etc/webalizer/webalizer.conf')) { + // Change webalizer mode to incremental + replaceLine('/etc/webalizer/webalizer.conf','#IncrementalName','IncrementalName webalizer.current',0,0); + replaceLine('/etc/webalizer/webalizer.conf','#Incremental','Incremental yes',0,0); + replaceLine('/etc/webalizer/webalizer.conf','#HistoryName','HistoryName webalizer.hist',0,0); + } + + // Check the awsatst script + if(!is_dir('/usr/share/awstats/tools')) exec('mkdir -p /usr/share/awstats/tools'); + if(!file_exists('/usr/share/awstats/tools/awstats_buildstaticpages.pl') && file_exists('/usr/share/doc/awstats/examples/awstats_buildstaticpages.pl')) symlink('/usr/share/doc/awstats/examples/awstats_buildstaticpages.pl','/usr/share/awstats/tools/awstats_buildstaticpages.pl'); if(file_exists('/etc/awstats/awstats.conf.local')) replaceLine('/etc/awstats/awstats.conf.local','LogFormat=4','LogFormat=1',0,1); - //* add a sshusers group - $command = 'groupadd sshusers'; - if(!is_group('sshusers')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - } - - public function configure_firewall() { - global $conf; - - $dist_init_scripts = $conf['init_scripts']; - - if(is_dir('/etc/Bastille.backup')) caselog('rm -rf /etc/Bastille.backup', __FILE__, __LINE__); - if(is_dir('/etc/Bastille')) caselog('mv -f /etc/Bastille /etc/Bastille.backup', __FILE__, __LINE__); - @mkdir('/etc/Bastille', 0700); - if(is_dir('/etc/Bastille.backup/firewall.d')) caselog('cp -pfr /etc/Bastille.backup/firewall.d /etc/Bastille/', __FILE__, __LINE__); - caselog('cp -f tpl/bastille-firewall.cfg.master /etc/Bastille/bastille-firewall.cfg', __FILE__, __LINE__); - caselog('chmod 644 /etc/Bastille/bastille-firewall.cfg', __FILE__, __LINE__); - $content = rf('/etc/Bastille/bastille-firewall.cfg'); - $content = str_replace('{DNS_SERVERS}', '', $content); - - $tcp_public_services = ''; - $udp_public_services = ''; - - $row = $this->db->queryOneRecord('SELECT * FROM '.$conf["mysql"]["database"].'.firewall WHERE server_id = '.intval($conf['server_id'])); - - if(trim($row['tcp_port']) != '' || trim($row['udp_port']) != '') { - $tcp_public_services = trim(str_replace(',',' ',$row['tcp_port'])); - $udp_public_services = trim(str_replace(',',' ',$row['udp_port'])); - } else { - $tcp_public_services = '21 22 25 53 80 110 143 443 3306 8080 10000'; - $udp_public_services = '53'; - } - - if(!stristr($tcp_public_services, $conf['apache']['vhost_port'])) { - $tcp_public_services .= ' '.intval($conf['apache']['vhost_port']); - if($row['tcp_port'] != '') $this->db->query("UPDATE firewall SET tcp_port = tcp_port + ',".intval($conf['apache']['vhost_port'])."' WHERE server_id = ".intval($conf['server_id'])); - } - - $content = str_replace('{TCP_PUBLIC_SERVICES}', $tcp_public_services, $content); - $content = str_replace('{UDP_PUBLIC_SERVICES}', $udp_public_services, $content); - - wf('/etc/Bastille/bastille-firewall.cfg', $content); - - if(is_file($dist_init_scripts.'/bastille-firewall')) caselog('mv -f '.$dist_init_scripts.'/bastille-firewall '.$dist_init_scripts.'/bastille-firewall.backup', __FILE__, __LINE__); - caselog('cp -f apps/bastille-firewall '.$dist_init_scripts, __FILE__, __LINE__); - caselog('chmod 700 '.$dist_init_scripts.'/bastille-firewall', __FILE__, __LINE__); - - if(is_file('/sbin/bastille-ipchains')) caselog('mv -f /sbin/bastille-ipchains /sbin/bastille-ipchains.backup', __FILE__, __LINE__); - caselog('cp -f apps/bastille-ipchains /sbin', __FILE__, __LINE__); - caselog('chmod 700 /sbin/bastille-ipchains', __FILE__, __LINE__); - - if(is_file('/sbin/bastille-netfilter')) caselog('mv -f /sbin/bastille-netfilter /sbin/bastille-netfilter.backup', __FILE__, __LINE__); - caselog('cp -f apps/bastille-netfilter /sbin', __FILE__, __LINE__); - caselog('chmod 700 /sbin/bastille-netfilter', __FILE__, __LINE__); - - if(!@is_dir('/var/lock/subsys')) caselog('mkdir /var/lock/subsys', __FILE__, __LINE__); - - exec('which ipchains &> /dev/null', $ipchains_location, $ret_val); - if(!is_file('/sbin/ipchains') && !is_link('/sbin/ipchains') && $ret_val == 0) phpcaselog(@symlink(shell_exec('which ipchains'), '/sbin/ipchains'), 'create symlink', __FILE__, __LINE__); - unset($ipchains_location); - exec('which iptables &> /dev/null', $iptables_location, $ret_val); - if(!is_file('/sbin/iptables') && !is_link('/sbin/iptables') && $ret_val == 0) phpcaselog(@symlink(trim(shell_exec('which iptables')), '/sbin/iptables'), 'create symlink', __FILE__, __LINE__); - unset($iptables_location); - - } - - public function configure_vlogger() { - global $conf; - - //** Configure vlogger to use traffic logging to mysql (master) db - $configfile = 'vlogger-dbi.conf'; - if(is_file($conf['vlogger']['config_dir'].'/'.$configfile)) copy($conf['vlogger']['config_dir'].'/'.$configfile,$conf['vlogger']['config_dir'].'/'.$configfile.'~'); - if(is_file($conf['vlogger']['config_dir'].'/'.$configfile.'~')) chmod($conf['vlogger']['config_dir'].'/'.$configfile.'~', 0400); - $content = rf('tpl/'.$configfile.'.master'); - if($conf['mysql']['master_slave_setup'] == 'y') { - $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['master_ispconfig_user'],$content); - $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['master_ispconfig_password'], $content); - $content = str_replace('{mysql_server_database}',$conf['mysql']['master_database'],$content); - $content = str_replace('{mysql_server_ip}',$conf['mysql']['master_host'],$content); - } else { - $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); - $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); - $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); - $content = str_replace('{mysql_server_ip}',$conf['mysql']['host'],$content); - } - wf($conf['vlogger']['config_dir'].'/'.$configfile,$content); - chmod($conf['vlogger']['config_dir'].'/'.$configfile, 0600); - chown($conf['vlogger']['config_dir'].'/'.$configfile, 'root'); - chgrp($conf['vlogger']['config_dir'].'/'.$configfile, 'root'); - - } - - public function configure_apps_vhost() { - global $conf; - - //* Create the ispconfig apps vhost user and group - - $apps_vhost_user = escapeshellcmd($conf['web']['apps_vhost_user']); - $apps_vhost_group = escapeshellcmd($conf['web']['apps_vhost_group']); - $install_dir = escapeshellcmd($conf['web']['website_basedir'].'/apps'); - - $command = 'groupadd '.$apps_vhost_user; - if(!is_group($apps_vhost_group)) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - $command = 'useradd -g '.$apps_vhost_group.' -d '.$install_dir.' '.$apps_vhost_group; - if(!is_user($apps_vhost_user)) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - - $command = 'adduser '.$conf['apache']['user'].' '.$apps_vhost_group; - caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - if(!@is_dir($install_dir)) mkdir($install_dir, 0755, true); - chown($install_dir, $apps_vhost_user); - chgrp($install_dir, $apps_vhost_group); - - //* Copy the apps vhost file - $vhost_conf_dir = $conf['apache']['vhost_conf_dir']; - $vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir']; - $apps_vhost_servername = ($conf['web']['apps_vhost_servername'] == '')?'':'ServerName '.$conf['web']['apps_vhost_servername']; - - // Dont just copy over the virtualhost template but add some custom settings - $content = rf('tpl/apache_apps.vhost.master'); - - $content = str_replace('{apps_vhost_ip}', $conf['web']['apps_vhost_ip'], $content); - $content = str_replace('{apps_vhost_port}', $conf['web']['apps_vhost_port'], $content); - $content = str_replace('{apps_vhost_dir}', $conf['web']['website_basedir'].'/apps', $content); - $content = str_replace('{website_basedir}', $conf['web']['website_basedir'], $content); - $content = str_replace('{apps_vhost_servername}', $apps_vhost_servername, $content); - - - // comment out the listen directive if port is 80 or 443 - if($conf['web']['apps_vhost_ip'] == 80 or $conf['web']['apps_vhost_ip'] == 443) { - $content = str_replace('{vhost_port_listen}', '#', $content); - } else { - $content = str_replace('{vhost_port_listen}', '', $content); - } - - wf($vhost_conf_dir.'/apps.vhost', $content); - - //copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost"); - //* and create the symlink - if($this->install_ispconfig_interface == true) { - if(@is_link($vhost_conf_enabled_dir.'/apps.vhost')) unlink($vhost_conf_enabled_dir.'/apps.vhost'); - if(!@is_link($vhost_conf_enabled_dir.'/000-apps.vhost')) { - symlink($vhost_conf_dir.'/apps.vhost',$vhost_conf_enabled_dir.'/000-apps.vhost'); - } - } - if(!is_file($conf['web']['website_basedir'].'/php-fcgi-scripts/apps/.php-fcgi-starter')) { - mkdir($conf['web']['website_basedir'].'/php-fcgi-scripts/apps', 0755, true); - copy('tpl/apache_apps_fcgi_starter.master',$conf['web']['website_basedir'].'/php-fcgi-scripts/apps/.php-fcgi-starter'); - exec('chmod +x '.$conf['web']['website_basedir'].'/php-fcgi-scripts/apps/.php-fcgi-starter'); - exec('chown -R ispapps:ispapps '.$conf['web']['website_basedir'].'/php-fcgi-scripts/apps'); - - } - - } - - public function make_ispconfig_ssl_cert() { - global $conf; - - $install_dir = $conf['ispconfig_install_dir']; - - $ssl_crt_file = $install_dir.'/interface/ssl/ispserver.crt'; - $ssl_csr_file = $install_dir.'/interface/ssl/ispserver.csr'; - $ssl_key_file = $install_dir.'/interface/ssl/ispserver.key'; - - if(!@is_dir($install_dir.'/interface/ssl')) mkdir($install_dir.'/interface/ssl', 0755, true); - - $ssl_pw = substr(md5(mt_rand()),0,6); - exec("openssl genrsa -des3 -passout pass:$ssl_pw -out $ssl_key_file 4096"); - exec("openssl req -new -passin pass:$ssl_pw -passout pass:$ssl_pw -key $ssl_key_file -out $ssl_csr_file"); - exec("openssl req -x509 -passin pass:$ssl_pw -passout pass:$ssl_pw -key $ssl_key_file -in $ssl_csr_file -out $ssl_crt_file -days 3650"); - exec("openssl rsa -passin pass:$ssl_pw -in $ssl_key_file -out $ssl_key_file.insecure"); - rename($ssl_key_file,$ssl_key_file.'.secure'); - rename($ssl_key_file.'.insecure',$ssl_key_file); - - } - - public function install_ispconfig() { - global $conf; - - $install_dir = $conf['ispconfig_install_dir']; - - //* Create the ISPConfig installation directory - if(!@is_dir($install_dir)) { - $command = "mkdir $install_dir"; - caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - } - - //* Create a ISPConfig user and group - $command = 'groupadd ispconfig'; - if(!is_group('ispconfig')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - $command = 'useradd -g ispconfig -d '.$install_dir.' ispconfig'; - if(!is_user('ispconfig')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - //* copy the ISPConfig interface part - $command = 'cp -rf ../interface '.$install_dir; - caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - //* copy the ISPConfig server part - $command = 'cp -rf ../server '.$install_dir; - caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - //* Create a symlink, so ISPConfig is accessible via web - // Replaced by a separate vhost definition for port 8080 - // $command = "ln -s $install_dir/interface/web/ /var/www/ispconfig"; - // caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - //* Create the config file for ISPConfig interface - $configfile = 'config.inc.php'; - if(is_file($install_dir.'/interface/lib/'.$configfile)) { - copy($install_dir.'/interface/lib/'.$configfile, $install_dir.'/interface/lib/'.$configfile.'~'); - } - $content = rf('tpl/'.$configfile.'.master'); - $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); - $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); - $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); - $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); - - $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); - $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); - $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); - $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); - - $content = str_replace('{server_id}', $conf['server_id'], $content); - $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); - $content = str_replace('{language}', $conf['language'], $content); - - wf($install_dir.'/interface/lib/'.$configfile, $content); - - //* Create the config file for ISPConfig server - $configfile = 'config.inc.php'; - if(is_file($install_dir.'/server/lib/'.$configfile)) { - copy($install_dir.'/server/lib/'.$configfile, $install_dir.'/interface/lib/'.$configfile.'~'); - } - $content = rf('tpl/'.$configfile.'.master'); - $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); - $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); - $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); - $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); - - $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); - $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); - $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); - $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); - - $content = str_replace('{server_id}', $conf['server_id'], $content); - $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); + //* add a sshusers group + $command = 'groupadd sshusers'; + if(!is_group('sshusers')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + } + + public function configure_firewall() { + global $conf; + + $dist_init_scripts = $conf['init_scripts']; + + if(is_dir('/etc/Bastille.backup')) caselog('rm -rf /etc/Bastille.backup', __FILE__, __LINE__); + if(is_dir('/etc/Bastille')) caselog('mv -f /etc/Bastille /etc/Bastille.backup', __FILE__, __LINE__); + @mkdir('/etc/Bastille', 0700); + if(is_dir('/etc/Bastille.backup/firewall.d')) caselog('cp -pfr /etc/Bastille.backup/firewall.d /etc/Bastille/', __FILE__, __LINE__); + caselog('cp -f tpl/bastille-firewall.cfg.master /etc/Bastille/bastille-firewall.cfg', __FILE__, __LINE__); + caselog('chmod 644 /etc/Bastille/bastille-firewall.cfg', __FILE__, __LINE__); + $content = rf('/etc/Bastille/bastille-firewall.cfg'); + $content = str_replace('{DNS_SERVERS}', '', $content); + + $tcp_public_services = ''; + $udp_public_services = ''; + + $row = $this->db->queryOneRecord('SELECT * FROM '.$conf["mysql"]["database"].'.firewall WHERE server_id = '.intval($conf['server_id'])); + + if(trim($row['tcp_port']) != '' || trim($row['udp_port']) != '') { + $tcp_public_services = trim(str_replace(',',' ',$row['tcp_port'])); + $udp_public_services = trim(str_replace(',',' ',$row['udp_port'])); + } else { + $tcp_public_services = '21 22 25 53 80 110 143 443 3306 8080 10000'; + $udp_public_services = '53'; + } + + if(!stristr($tcp_public_services, $conf['apache']['vhost_port'])) { + $tcp_public_services .= ' '.intval($conf['apache']['vhost_port']); + if($row['tcp_port'] != '') $this->db->query("UPDATE firewall SET tcp_port = tcp_port + ',".intval($conf['apache']['vhost_port'])."' WHERE server_id = ".intval($conf['server_id'])); + } + + $content = str_replace('{TCP_PUBLIC_SERVICES}', $tcp_public_services, $content); + $content = str_replace('{UDP_PUBLIC_SERVICES}', $udp_public_services, $content); + + wf('/etc/Bastille/bastille-firewall.cfg', $content); + + if(is_file($dist_init_scripts.'/bastille-firewall')) caselog('mv -f '.$dist_init_scripts.'/bastille-firewall '.$dist_init_scripts.'/bastille-firewall.backup', __FILE__, __LINE__); + caselog('cp -f apps/bastille-firewall '.$dist_init_scripts, __FILE__, __LINE__); + caselog('chmod 700 '.$dist_init_scripts.'/bastille-firewall', __FILE__, __LINE__); + + if(is_file('/sbin/bastille-ipchains')) caselog('mv -f /sbin/bastille-ipchains /sbin/bastille-ipchains.backup', __FILE__, __LINE__); + caselog('cp -f apps/bastille-ipchains /sbin', __FILE__, __LINE__); + caselog('chmod 700 /sbin/bastille-ipchains', __FILE__, __LINE__); + + if(is_file('/sbin/bastille-netfilter')) caselog('mv -f /sbin/bastille-netfilter /sbin/bastille-netfilter.backup', __FILE__, __LINE__); + caselog('cp -f apps/bastille-netfilter /sbin', __FILE__, __LINE__); + caselog('chmod 700 /sbin/bastille-netfilter', __FILE__, __LINE__); + + if(!@is_dir('/var/lock/subsys')) caselog('mkdir /var/lock/subsys', __FILE__, __LINE__); + + exec('which ipchains &> /dev/null', $ipchains_location, $ret_val); + if(!is_file('/sbin/ipchains') && !is_link('/sbin/ipchains') && $ret_val == 0) phpcaselog(@symlink(shell_exec('which ipchains'), '/sbin/ipchains'), 'create symlink', __FILE__, __LINE__); + unset($ipchains_location); + exec('which iptables &> /dev/null', $iptables_location, $ret_val); + if(!is_file('/sbin/iptables') && !is_link('/sbin/iptables') && $ret_val == 0) phpcaselog(@symlink(trim(shell_exec('which iptables')), '/sbin/iptables'), 'create symlink', __FILE__, __LINE__); + unset($iptables_location); + + } + + public function configure_vlogger() { + global $conf; + + //** Configure vlogger to use traffic logging to mysql (master) db + $configfile = 'vlogger-dbi.conf'; + if(is_file($conf['vlogger']['config_dir'].'/'.$configfile)) copy($conf['vlogger']['config_dir'].'/'.$configfile,$conf['vlogger']['config_dir'].'/'.$configfile.'~'); + if(is_file($conf['vlogger']['config_dir'].'/'.$configfile.'~')) chmod($conf['vlogger']['config_dir'].'/'.$configfile.'~', 0400); + $content = rf('tpl/'.$configfile.'.master'); + if($conf['mysql']['master_slave_setup'] == 'y') { + $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['master_ispconfig_user'],$content); + $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['master_ispconfig_password'], $content); + $content = str_replace('{mysql_server_database}',$conf['mysql']['master_database'],$content); + $content = str_replace('{mysql_server_ip}',$conf['mysql']['master_host'],$content); + } else { + $content = str_replace('{mysql_server_ispconfig_user}',$conf['mysql']['ispconfig_user'],$content); + $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); + $content = str_replace('{mysql_server_database}',$conf['mysql']['database'],$content); + $content = str_replace('{mysql_server_ip}',$conf['mysql']['host'],$content); + } + wf($conf['vlogger']['config_dir'].'/'.$configfile,$content); + chmod($conf['vlogger']['config_dir'].'/'.$configfile, 0600); + chown($conf['vlogger']['config_dir'].'/'.$configfile, 'root'); + chgrp($conf['vlogger']['config_dir'].'/'.$configfile, 'root'); + + } + + public function configure_apps_vhost() { + global $conf; + + //* Create the ispconfig apps vhost user and group + + $apps_vhost_user = escapeshellcmd($conf['web']['apps_vhost_user']); + $apps_vhost_group = escapeshellcmd($conf['web']['apps_vhost_group']); + $install_dir = escapeshellcmd($conf['web']['website_basedir'].'/apps'); + + $command = 'groupadd '.$apps_vhost_user; + if(!is_group($apps_vhost_group)) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + $command = 'useradd -g '.$apps_vhost_group.' -d '.$install_dir.' '.$apps_vhost_group; + if(!is_user($apps_vhost_user)) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + + $command = 'adduser '.$conf['apache']['user'].' '.$apps_vhost_group; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + if(!@is_dir($install_dir)) mkdir($install_dir, 0755, true); + chown($install_dir, $apps_vhost_user); + chgrp($install_dir, $apps_vhost_group); + + //* Copy the apps vhost file + $vhost_conf_dir = $conf['apache']['vhost_conf_dir']; + $vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir']; + $apps_vhost_servername = ($conf['web']['apps_vhost_servername'] == '')?'':'ServerName '.$conf['web']['apps_vhost_servername']; + + // Dont just copy over the virtualhost template but add some custom settings + $content = rf('tpl/apache_apps.vhost.master'); + + $content = str_replace('{apps_vhost_ip}', $conf['web']['apps_vhost_ip'], $content); + $content = str_replace('{apps_vhost_port}', $conf['web']['apps_vhost_port'], $content); + $content = str_replace('{apps_vhost_dir}', $conf['web']['website_basedir'].'/apps', $content); + $content = str_replace('{website_basedir}', $conf['web']['website_basedir'], $content); + $content = str_replace('{apps_vhost_servername}', $apps_vhost_servername, $content); + + + // comment out the listen directive if port is 80 or 443 + if($conf['web']['apps_vhost_ip'] == 80 or $conf['web']['apps_vhost_ip'] == 443) { + $content = str_replace('{vhost_port_listen}', '#', $content); + } else { + $content = str_replace('{vhost_port_listen}', '', $content); + } + + wf($vhost_conf_dir.'/apps.vhost', $content); + + //copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost"); + //* and create the symlink + if($this->install_ispconfig_interface == true) { + if(@is_link($vhost_conf_enabled_dir.'/apps.vhost')) unlink($vhost_conf_enabled_dir.'/apps.vhost'); + if(!@is_link($vhost_conf_enabled_dir.'/000-apps.vhost')) { + symlink($vhost_conf_dir.'/apps.vhost',$vhost_conf_enabled_dir.'/000-apps.vhost'); + } + } + if(!is_file($conf['web']['website_basedir'].'/php-fcgi-scripts/apps/.php-fcgi-starter')) { + mkdir($conf['web']['website_basedir'].'/php-fcgi-scripts/apps', 0755, true); + copy('tpl/apache_apps_fcgi_starter.master',$conf['web']['website_basedir'].'/php-fcgi-scripts/apps/.php-fcgi-starter'); + exec('chmod +x '.$conf['web']['website_basedir'].'/php-fcgi-scripts/apps/.php-fcgi-starter'); + exec('chown -R ispapps:ispapps '.$conf['web']['website_basedir'].'/php-fcgi-scripts/apps'); + + } + + } + + public function make_ispconfig_ssl_cert() { + global $conf; + + $install_dir = $conf['ispconfig_install_dir']; + + $ssl_crt_file = $install_dir.'/interface/ssl/ispserver.crt'; + $ssl_csr_file = $install_dir.'/interface/ssl/ispserver.csr'; + $ssl_key_file = $install_dir.'/interface/ssl/ispserver.key'; + + if(!@is_dir($install_dir.'/interface/ssl')) mkdir($install_dir.'/interface/ssl', 0755, true); + + $ssl_pw = substr(md5(mt_rand()),0,6); + exec("openssl genrsa -des3 -passout pass:$ssl_pw -out $ssl_key_file 4096"); + exec("openssl req -new -passin pass:$ssl_pw -passout pass:$ssl_pw -key $ssl_key_file -out $ssl_csr_file"); + exec("openssl req -x509 -passin pass:$ssl_pw -passout pass:$ssl_pw -key $ssl_key_file -in $ssl_csr_file -out $ssl_crt_file -days 3650"); + exec("openssl rsa -passin pass:$ssl_pw -in $ssl_key_file -out $ssl_key_file.insecure"); + rename($ssl_key_file,$ssl_key_file.'.secure'); + rename($ssl_key_file.'.insecure',$ssl_key_file); + + } + + public function install_ispconfig() { + global $conf; + + $install_dir = $conf['ispconfig_install_dir']; + + //* Create the ISPConfig installation directory + if(!@is_dir($install_dir)) { + $command = "mkdir $install_dir"; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + } + + //* Create a ISPConfig user and group + $command = 'groupadd ispconfig'; + if(!is_group('ispconfig')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + $command = 'useradd -g ispconfig -d '.$install_dir.' ispconfig'; + if(!is_user('ispconfig')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* copy the ISPConfig interface part + $command = 'cp -rf ../interface '.$install_dir; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* copy the ISPConfig server part + $command = 'cp -rf ../server '.$install_dir; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* Create a symlink, so ISPConfig is accessible via web + // Replaced by a separate vhost definition for port 8080 + // $command = "ln -s $install_dir/interface/web/ /var/www/ispconfig"; + // caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* Create the config file for ISPConfig interface + $configfile = 'config.inc.php'; + if(is_file($install_dir.'/interface/lib/'.$configfile)) { + copy($install_dir.'/interface/lib/'.$configfile, $install_dir.'/interface/lib/'.$configfile.'~'); + } + $content = rf('tpl/'.$configfile.'.master'); + $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); + $content = str_replace('{mysql_server_ispconfig_password}',$conf['mysql']['ispconfig_password'], $content); + $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); + $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); + + $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); + $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); + $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); + $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); + + $content = str_replace('{server_id}', $conf['server_id'], $content); + $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); + $content = str_replace('{language}', $conf['language'], $content); + + wf($install_dir.'/interface/lib/'.$configfile, $content); + + //* Create the config file for ISPConfig server + $configfile = 'config.inc.php'; + if(is_file($install_dir.'/server/lib/'.$configfile)) { + copy($install_dir.'/server/lib/'.$configfile, $install_dir.'/interface/lib/'.$configfile.'~'); + } + $content = rf('tpl/'.$configfile.'.master'); + $content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content); + $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); + $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); + $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); + + $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); + $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); + $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); + $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); + + $content = str_replace('{server_id}', $conf['server_id'], $content); + $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); $content = str_replace('{language}', $conf['language'], $content); - wf($install_dir.'/server/lib/'.$configfile, $content); - - //* Create the config file for remote-actions (but only, if it does not exist, because - // the value is a autoinc-value and so changed by the remoteaction_core_module - if (!file_exists($install_dir.'/server/lib/remote_action.inc.php')) { - $content = ''; - wf($install_dir.'/server/lib/remote_action.inc.php', $content); - } - - //* Enable the server modules and plugins. - // TODO: Implement a selector which modules and plugins shall be enabled. - $dir = $install_dir.'/server/mods-available/'; - if (is_dir($dir)) { - if ($dh = opendir($dir)) { - while (($file = readdir($dh)) !== false) { - if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') { - include_once($install_dir.'/server/mods-available/'.$file); - $module_name = substr($file,0,-8); - $tmp = new $module_name; - if($tmp->onInstall()) { - if(!@is_link($install_dir.'/server/mods-enabled/'.$file)) { - @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-enabled/'.$file); - // @symlink($install_dir.'/server/mods-available/'.$file, '../mods-enabled/'.$file); - } - if (strpos($file, '_core_module') !== false) { - if(!@is_link($install_dir.'/server/mods-core/'.$file)) { - @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-core/'.$file); - // @symlink($install_dir.'/server/mods-available/'.$file, '../mods-core/'.$file); - } - } - } - unset($tmp); - } - } - closedir($dh); - } - } - - $dir = $install_dir.'/server/plugins-available/'; - if (is_dir($dir)) { - if ($dh = opendir($dir)) { - while (($file = readdir($dh)) !== false) { - if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') { - include_once($install_dir.'/server/plugins-available/'.$file); - $plugin_name = substr($file,0,-8); - $tmp = new $plugin_name; - if(method_exists($tmp,'onInstall') && $tmp->onInstall()) { - if(!@is_link($install_dir.'/server/plugins-enabled/'.$file)) { - @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-enabled/'.$file); - //@symlink($install_dir.'/server/plugins-available/'.$file, '../plugins-enabled/'.$file); - } - if (strpos($file, '_core_plugin') !== false) { - if(!@is_link($install_dir.'/server/plugins-core/'.$file)) { - @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-core/'.$file); - //@symlink($install_dir.'/server/plugins-available/'.$file, '../plugins-core/'.$file); - } - } - } - unset($tmp); - } - } - closedir($dh); - } - } - - // Update the server config - $mail_server_enabled = ($conf['services']['mail'])?1:0; - $web_server_enabled = ($conf['services']['web'])?1:0; - $dns_server_enabled = ($conf['services']['dns'])?1:0; - $file_server_enabled = ($conf['services']['file'])?1:0; - $db_server_enabled = ($conf['services']['db'])?1:0; - $vserver_server_enabled = ($conf['services']['vserver'])?1:0; - - - - - - - $sql = "UPDATE `server` SET mail_server = '$mail_server_enabled', web_server = '$web_server_enabled', dns_server = '$dns_server_enabled', file_server = '$file_server_enabled', db_server = '$db_server_enabled', vserver_server = '$vserver_server_enabled' WHERE server_id = ".intval($conf['server_id']); - - if($conf['mysql']['master_slave_setup'] == 'y') { - $this->dbmaster->query($sql); - $this->db->query($sql); - } else { - $this->db->query($sql); - } - - - //* Chmod the files - $command = 'chmod -R 750 '.$install_dir; - caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - //* chown the files to the ispconfig user and group - $command = 'chown -R ispconfig:ispconfig '.$install_dir; - caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - //* Make the global language file directory group writable - exec("chmod -R 770 $install_dir/interface/lib/lang"); - - //* Make the temp directory for language file exports writable - if(is_dir($install_dir.'/interface/web/temp')) exec("chmod -R 770 $install_dir/interface/web/temp"); - - //* Make all interface language file directories group writable - $handle = @opendir($install_dir.'/interface/web'); - while ($file = @readdir ($handle)) { - if ($file != '.' && $file != '..') { - if(@is_dir($install_dir.'/interface/web'.'/'.$file.'/lib/lang')) { - $handle2 = opendir($install_dir.'/interface/web'.'/'.$file.'/lib/lang'); - chmod($install_dir.'/interface/web'.'/'.$file.'/lib/lang',0770); - while ($lang_file = @readdir ($handle2)) { - if ($lang_file != '.' && $lang_file != '..') { - chmod($install_dir.'/interface/web'.'/'.$file.'/lib/lang/'.$lang_file,0770); - } - } - } - } - } - - //* make sure that the server config file (not the interface one) is only readable by the root user - chmod($install_dir.'/server/lib/'.$configfile, 0600); - chown($install_dir.'/server/lib/'.$configfile, 'root'); - chgrp($install_dir.'/server/lib/'.$configfile, 'root'); - - chmod($install_dir.'/server/lib/remote_action.inc.php', 0600); - chown($install_dir.'/server/lib/remote_action.inc.php', 'root'); - chgrp($install_dir.'/server/lib/remote_action.inc.php', 'root'); - - if(@is_file($install_dir.'/server/lib/mysql_clientdb.conf')) { - chmod($install_dir.'/server/lib/mysql_clientdb.conf', 0600); - chown($install_dir.'/server/lib/mysql_clientdb.conf', 'root'); - chgrp($install_dir.'/server/lib/mysql_clientdb.conf', 'root'); - } - - // TODO: FIXME: add the www-data user to the ispconfig group. This is just for testing - // and must be fixed as this will allow the apache user to read the ispconfig files. - // Later this must run as own apache server or via suexec! - $command = 'adduser www-data ispconfig'; - caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - //* Make the shell scripts executable - $command = "chmod +x $install_dir/server/scripts/*.sh"; - caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - //* Copy the ISPConfig vhost for the controlpanel - $vhost_conf_dir = $conf['apache']['vhost_conf_dir']; - $vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir']; - - - // Dont just copy over the virtualhost template but add some custom settings - $content = rf('tpl/apache_ispconfig.vhost.master'); - $content = str_replace('{vhost_port}', $conf['apache']['vhost_port'], $content); - - // comment out the listen directive if port is 80 or 443 - if($conf['apache']['vhost_port'] == 80 or $conf['apache']['vhost_port'] == 443) { - $content = str_replace('{vhost_port_listen}', '#', $content); - } else { - $content = str_replace('{vhost_port_listen}', '', $content); - } - - if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) { - $content = str_replace('{ssl_comment}', '', $content); - } else { - $content = str_replace('{ssl_comment}', '#', $content); - } - - wf($vhost_conf_dir.'/ispconfig.vhost', $content); - - //copy('tpl/apache_ispconfig.vhost.master', $vhost_conf_dir.'/ispconfig.vhost'); - //* and create the symlink - if($this->install_ispconfig_interface == true && $this->is_update == false) { - if(@is_link($vhost_conf_enabled_dir.'/ispconfig.vhost')) unlink($vhost_conf_enabled_dir.'/ispconfig.vhost'); - if(!@is_link($vhost_conf_enabled_dir.'/000-ispconfig.vhost')) { - symlink($vhost_conf_dir.'/ispconfig.vhost',$vhost_conf_enabled_dir.'/000-ispconfig.vhost'); - } - } - if(!is_file('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) { - mkdir('/var/www/php-fcgi-scripts/ispconfig', 0755, true); - copy('tpl/apache_ispconfig_fcgi_starter.master','/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter'); - exec('chmod +x /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter'); - symlink($install_dir.'/interface/web','/var/www/ispconfig'); - exec('chown -R ispconfig:ispconfig /var/www/php-fcgi-scripts/ispconfig'); - - } - - //* 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); - 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.sh')) symlink($install_dir.'/server/scripts/ispconfig_update.sh','/usr/local/bin/ispconfig_update.sh'); - - //* Make the logs readable for the ispconfig user - if(@is_file('/var/log/mail.log')) exec('chmod +r /var/log/mail.log'); - if(@is_file('/var/log/mail.warn')) exec('chmod +r /var/log/mail.warn'); - if(@is_file('/var/log/mail.err')) exec('chmod +r /var/log/mail.err'); - if(@is_file('/var/log/messages')) exec('chmod +r /var/log/messages'); - if(@is_file('/var/log/clamav/clamav.log')) exec('chmod +r /var/log/clamav/clamav.log'); - if(@is_file('/var/log/clamav/freshclam.log')) exec('chmod +r /var/log/clamav/freshclam.log'); - - //* Create the ispconfig log file and directory - if(!is_file($conf['ispconfig_log_dir'].'/ispconfig.log')) { - if(!is_dir($conf['ispconfig_log_dir'])) mkdir($conf['ispconfig_log_dir'], 0755); - touch($conf['ispconfig_log_dir'].'/ispconfig.log'); - } - - rename($install_dir.'/server/scripts/run-getmail.sh','/usr/local/bin/run-getmail.sh'); - if(is_user('getmail')) chown('/usr/local/bin/run-getmail.sh', 'getmail'); - chmod('/usr/local/bin/run-getmail.sh', 0744); - - //* Add Log-Rotation - if (is_dir('/etc/logrotate.d')) { - @unlink('/etc/logrotate.d/logispc3'); // ignore, if the file is not there - /* We rotate these logs in cron_daily.php - $fh = fopen('/etc/logrotate.d/logispc3', 'w'); - fwrite($fh, - "$conf['ispconfig_log_dir']/ispconfig.log { \n" . - " weekly \n" . - " missingok \n" . - " rotate 4 \n" . - " compress \n" . - " delaycompress \n" . - "} \n" . - "$conf['ispconfig_log_dir']/cron.log { \n" . - " weekly \n" . - " missingok \n" . - " rotate 4 \n" . - " compress \n" . - " delaycompress \n" . - "}"); - fclose($fh); - */ - } - } - - public function configure_dbserver() { - global $conf; - - //* If this server shall act as database server for client DB's, we configure this here - $install_dir = $conf['ispconfig_install_dir']; - - // Create a file with the database login details which - // are used to create the client databases. - - if(!is_dir($install_dir.'/server/lib')) { - $command = "mkdir $install_dir/server/lib"; - caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - } - - $content = rf('tpl/mysql_clientdb.conf.master'); - $content = str_replace('{username}',$conf['mysql']['admin_user'],$content); - $content = str_replace('{password}',$conf['mysql']['admin_password'], $content); - wf($install_dir.'/server/lib/mysql_clientdb.conf',$content); - chmod($install_dir.'/server/lib/mysql_clientdb.conf', 0600); - chown($install_dir.'/server/lib/mysql_clientdb.conf', 'root'); - chgrp($install_dir.'/server/lib/mysql_clientdb.conf', 'root'); - - } - - public function install_crontab() { - global $conf; - - $install_dir = $conf['ispconfig_install_dir']; - - //* Root Crontab - exec('crontab -u root -l > crontab.txt'); - $existing_root_cron_jobs = file('crontab.txt'); - - // remove existing ispconfig cronjobs, in case the syntax has changed - foreach($existing_root_cron_jobs as $key => $val) { - if(stristr($val,$install_dir)) unset($existing_root_cron_jobs[$key]); - } - - $root_cron_jobs = array( - "* * * * * ".$install_dir."/server/server.sh > /dev/null 2>> ".$conf['ispconfig_log_dir']."/cron.log", - "30 00 * * * ".$install_dir."/server/cron_daily.sh > /dev/null 2>> ".$conf['ispconfig_log_dir']."/cron.log" - ); - foreach($root_cron_jobs as $cron_job) { - if(!in_array($cron_job."\n", $existing_root_cron_jobs)) { - $existing_root_cron_jobs[] = $cron_job."\n"; - } - } - file_put_contents('crontab.txt', $existing_root_cron_jobs); - exec('crontab -u root crontab.txt &> /dev/null'); - unlink('crontab.txt'); - - //* Getmail crontab - if(is_user('getmail')) { - $cf = $conf['getmail']; - exec('crontab -u getmail -l > crontab.txt'); - $existing_cron_jobs = file('crontab.txt'); - - $cron_jobs = array( - '*/5 * * * * /usr/local/bin/run-getmail.sh > /dev/null 2>> '.$conf['ispconfig_log_dir'].'/cron.log' - ); - - // remove existing ispconfig cronjobs, in case the syntax has changed - foreach($existing_cron_jobs as $key => $val) { - if(stristr($val,'getmail')) unset($existing_cron_jobs[$key]); - } - - foreach($cron_jobs as $cron_job) { - if(!in_array($cron_job."\n", $existing_cron_jobs)) { - $existing_cron_jobs[] = $cron_job."\n"; - } - } - file_put_contents('crontab.txt', $existing_cron_jobs); - exec('crontab -u getmail crontab.txt &> /dev/null'); - unlink('crontab.txt'); - } - - touch($conf['ispconfig_log_dir'].'/cron.log'); - chmod($conf['ispconfig_log_dir'].'/cron.log', 0666); - - } - - /** - * Helper function - get the path to a template file based on - * the local part of the filename. Checks first for the existence - * of a distribution specific file and if not found looks in the - * base template folder. Optionally the behaviour can be changed - * by setting the 2nd parameter which will fetch the contents - * of the template file and return it instead of the path. The 3rd - * parameter further extends this behaviour by filtering the contents - * by inserting the ispconfig database credentials using the {} placeholders. - * - * @param string $tLocal local part of filename - * @param bool $tRf - * @param bool $tDBCred - * @return string Relative path to the chosen template file - */ - protected function get_template_file($tLocal, $tRf=false, $tDBCred=false) { - global $conf, $dist; - - $final_path = ''; - $dist_template = 'dist/tpl/'.strtolower($dist['name'])."/$tLocal.master"; - if (file_exists($dist_template)) { - $final_path = $dist_template; - } else { - $final_path = "tpl/$tLocal.master"; - } - - if (!$tRf) { - return $final_path; - } else { - return (!$tDBCred) ? rf($final_path) : $this->insert_db_credentials(rf($final_path)); - } - } - - /** - * Helper function - writes the contents to a config file - * and performs a backup if the file exist. Additionally - * if the file exists the new file will be given the - * same rights and ownership as the original. Optionally the - * rights and/or ownership can be overriden by appending umask, - * user and group to the parameters. Providing only uid and gid - * values will result in only a chown. - * - * @param $tConf - * @param $tContents - * @return bool - */ - protected function write_config_file($tConf, $tContents) { - // Backup config file before writing new contents and stat file - if ( is_file($tConf) ) { - $stat = exec('stat -c \'%a %U %G\' '.escapeshellarg($tConf), $output, $res); - if ($res == 0) { // stat successfull - list($access, $user, $group) = split(" ", $stat); - } - - if ( copy($tConf, $tConf.'~') ) { - chmod($tConf.'~', 0400); - } - } - - wf($tConf, $tContents); // write file - - if (func_num_args() >= 4) // override rights and/or ownership - { - $args = func_get_args(); - $output = array_slice($args, 2); - - switch (sizeof($output)) { - case 3: - $umask = array_shift($output); - if (is_numeric($umask) && preg_match('/^0?[0-7]{3}$/', $umask)) { - $access = $umask; - } - case 2: - if (is_user($output[0]) && is_group($output[1])) { - list($user,$group) = $output; - } - break; - } - } - - if (!empty($user) && !empty($group)) { - chown($tConf, $user); - chgrp($tConf, $group); - } - - if (!empty($access)) { - exec("chmod $access $tConf"); - } - } - - /** - * Helper function - filter the contents of a config - * file by inserting the common ispconfig database - * credentials. - * - * @param $tContents - * @return string - */ - protected function insert_db_credentials($tContents) { - global $conf; - - $tContents = str_replace('{mysql_server_ispconfig_user}', $conf["mysql"]["ispconfig_user"], $tContents); - $tContents = str_replace('{mysql_server_ispconfig_password}', $conf["mysql"]["ispconfig_password"], $tContents); - $tContents = str_replace('{mysql_server_database}', $conf["mysql"]["database"], $tContents); - $tContents = str_replace('{mysql_server_ip}', $conf["mysql"]["ip"], $tContents); - $tContents = str_replace('{mysql_server_host}',$conf['mysql']['host'], $tContents); - $tContents = str_replace('{mysql_server_port}',$conf["mysql"]["port"], $tContents); - - return $tContents; - } -} - -?> + wf($install_dir.'/server/lib/'.$configfile, $content); + + //* Create the config file for remote-actions (but only, if it does not exist, because + // the value is a autoinc-value and so changed by the remoteaction_core_module + if (!file_exists($install_dir.'/server/lib/remote_action.inc.php')) { + $content = ''; + wf($install_dir.'/server/lib/remote_action.inc.php', $content); + } + + //* Enable the server modules and plugins. + // TODO: Implement a selector which modules and plugins shall be enabled. + $dir = $install_dir.'/server/mods-available/'; + if (is_dir($dir)) { + if ($dh = opendir($dir)) { + while (($file = readdir($dh)) !== false) { + if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') { + include_once($install_dir.'/server/mods-available/'.$file); + $module_name = substr($file,0,-8); + $tmp = new $module_name; + if($tmp->onInstall()) { + if(!@is_link($install_dir.'/server/mods-enabled/'.$file)) { + @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-enabled/'.$file); + // @symlink($install_dir.'/server/mods-available/'.$file, '../mods-enabled/'.$file); + } + if (strpos($file, '_core_module') !== false) { + if(!@is_link($install_dir.'/server/mods-core/'.$file)) { + @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-core/'.$file); + // @symlink($install_dir.'/server/mods-available/'.$file, '../mods-core/'.$file); + } + } + } + unset($tmp); + } + } + closedir($dh); + } + } + + $dir = $install_dir.'/server/plugins-available/'; + if (is_dir($dir)) { + if ($dh = opendir($dir)) { + while (($file = readdir($dh)) !== false) { + if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') { + include_once($install_dir.'/server/plugins-available/'.$file); + $plugin_name = substr($file,0,-8); + $tmp = new $plugin_name; + if(method_exists($tmp,'onInstall') && $tmp->onInstall()) { + if(!@is_link($install_dir.'/server/plugins-enabled/'.$file)) { + @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-enabled/'.$file); + //@symlink($install_dir.'/server/plugins-available/'.$file, '../plugins-enabled/'.$file); + } + if (strpos($file, '_core_plugin') !== false) { + if(!@is_link($install_dir.'/server/plugins-core/'.$file)) { + @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-core/'.$file); + //@symlink($install_dir.'/server/plugins-available/'.$file, '../plugins-core/'.$file); + } + } + } + unset($tmp); + } + } + closedir($dh); + } + } + + // Update the server config + $mail_server_enabled = ($conf['services']['mail'])?1:0; + $web_server_enabled = ($conf['services']['web'])?1:0; + $dns_server_enabled = ($conf['services']['dns'])?1:0; + $file_server_enabled = ($conf['services']['file'])?1:0; + $db_server_enabled = ($conf['services']['db'])?1:0; + $vserver_server_enabled = ($conf['services']['vserver'])?1:0; + + + + + + + $sql = "UPDATE `server` SET mail_server = '$mail_server_enabled', web_server = '$web_server_enabled', dns_server = '$dns_server_enabled', file_server = '$file_server_enabled', db_server = '$db_server_enabled', vserver_server = '$vserver_server_enabled' WHERE server_id = ".intval($conf['server_id']); + + if($conf['mysql']['master_slave_setup'] == 'y') { + $this->dbmaster->query($sql); + $this->db->query($sql); + } else { + $this->db->query($sql); + } + + + //* Chmod the files + $command = 'chmod -R 750 '.$install_dir; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* chown the files to the ispconfig user and group + $command = 'chown -R ispconfig:ispconfig '.$install_dir; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* Make the global language file directory group writable + exec("chmod -R 770 $install_dir/interface/lib/lang"); + + //* Make the temp directory for language file exports writable + if(is_dir($install_dir.'/interface/web/temp')) exec("chmod -R 770 $install_dir/interface/web/temp"); + + //* Make all interface language file directories group writable + $handle = @opendir($install_dir.'/interface/web'); + while ($file = @readdir ($handle)) { + if ($file != '.' && $file != '..') { + if(@is_dir($install_dir.'/interface/web'.'/'.$file.'/lib/lang')) { + $handle2 = opendir($install_dir.'/interface/web'.'/'.$file.'/lib/lang'); + chmod($install_dir.'/interface/web'.'/'.$file.'/lib/lang',0770); + while ($lang_file = @readdir ($handle2)) { + if ($lang_file != '.' && $lang_file != '..') { + chmod($install_dir.'/interface/web'.'/'.$file.'/lib/lang/'.$lang_file,0770); + } + } + } + } + } + + //* make sure that the server config file (not the interface one) is only readable by the root user + chmod($install_dir.'/server/lib/'.$configfile, 0600); + chown($install_dir.'/server/lib/'.$configfile, 'root'); + chgrp($install_dir.'/server/lib/'.$configfile, 'root'); + + chmod($install_dir.'/server/lib/remote_action.inc.php', 0600); + chown($install_dir.'/server/lib/remote_action.inc.php', 'root'); + chgrp($install_dir.'/server/lib/remote_action.inc.php', 'root'); + + if(@is_file($install_dir.'/server/lib/mysql_clientdb.conf')) { + chmod($install_dir.'/server/lib/mysql_clientdb.conf', 0600); + chown($install_dir.'/server/lib/mysql_clientdb.conf', 'root'); + chgrp($install_dir.'/server/lib/mysql_clientdb.conf', 'root'); + } + + // TODO: FIXME: add the www-data user to the ispconfig group. This is just for testing + // and must be fixed as this will allow the apache user to read the ispconfig files. + // Later this must run as own apache server or via suexec! + $command = 'adduser www-data ispconfig'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* Make the shell scripts executable + $command = "chmod +x $install_dir/server/scripts/*.sh"; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + + //* Copy the ISPConfig vhost for the controlpanel + $vhost_conf_dir = $conf['apache']['vhost_conf_dir']; + $vhost_conf_enabled_dir = $conf['apache']['vhost_conf_enabled_dir']; + + + // Dont just copy over the virtualhost template but add some custom settings + $content = rf('tpl/apache_ispconfig.vhost.master'); + $content = str_replace('{vhost_port}', $conf['apache']['vhost_port'], $content); + + // comment out the listen directive if port is 80 or 443 + if($conf['apache']['vhost_port'] == 80 or $conf['apache']['vhost_port'] == 443) { + $content = str_replace('{vhost_port_listen}', '#', $content); + } else { + $content = str_replace('{vhost_port_listen}', '', $content); + } + + if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) { + $content = str_replace('{ssl_comment}', '', $content); + } else { + $content = str_replace('{ssl_comment}', '#', $content); + } + + wf($vhost_conf_dir.'/ispconfig.vhost', $content); + + //copy('tpl/apache_ispconfig.vhost.master', $vhost_conf_dir.'/ispconfig.vhost'); + //* and create the symlink + if($this->install_ispconfig_interface == true && $this->is_update == false) { + if(@is_link($vhost_conf_enabled_dir.'/ispconfig.vhost')) unlink($vhost_conf_enabled_dir.'/ispconfig.vhost'); + if(!@is_link($vhost_conf_enabled_dir.'/000-ispconfig.vhost')) { + symlink($vhost_conf_dir.'/ispconfig.vhost',$vhost_conf_enabled_dir.'/000-ispconfig.vhost'); + } + } + if(!is_file('/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) { + mkdir('/var/www/php-fcgi-scripts/ispconfig', 0755, true); + copy('tpl/apache_ispconfig_fcgi_starter.master','/var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter'); + exec('chmod +x /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter'); + symlink($install_dir.'/interface/web','/var/www/ispconfig'); + exec('chown -R ispconfig:ispconfig /var/www/php-fcgi-scripts/ispconfig'); + + } + + //* 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); + 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.sh')) symlink($install_dir.'/server/scripts/ispconfig_update.sh','/usr/local/bin/ispconfig_update.sh'); + + //* Make the logs readable for the ispconfig user + if(@is_file('/var/log/mail.log')) exec('chmod +r /var/log/mail.log'); + if(@is_file('/var/log/mail.warn')) exec('chmod +r /var/log/mail.warn'); + if(@is_file('/var/log/mail.err')) exec('chmod +r /var/log/mail.err'); + if(@is_file('/var/log/messages')) exec('chmod +r /var/log/messages'); + if(@is_file('/var/log/clamav/clamav.log')) exec('chmod +r /var/log/clamav/clamav.log'); + if(@is_file('/var/log/clamav/freshclam.log')) exec('chmod +r /var/log/clamav/freshclam.log'); + + //* Create the ispconfig log file and directory + if(!is_file($conf['ispconfig_log_dir'].'/ispconfig.log')) { + if(!is_dir($conf['ispconfig_log_dir'])) mkdir($conf['ispconfig_log_dir'], 0755); + touch($conf['ispconfig_log_dir'].'/ispconfig.log'); + } + + rename($install_dir.'/server/scripts/run-getmail.sh','/usr/local/bin/run-getmail.sh'); + if(is_user('getmail')) chown('/usr/local/bin/run-getmail.sh', 'getmail'); + chmod('/usr/local/bin/run-getmail.sh', 0744); + + //* Add Log-Rotation + if (is_dir('/etc/logrotate.d')) { + @unlink('/etc/logrotate.d/logispc3'); // ignore, if the file is not there + /* We rotate these logs in cron_daily.php + $fh = fopen('/etc/logrotate.d/logispc3', 'w'); + fwrite($fh, + "$conf['ispconfig_log_dir']/ispconfig.log { \n" . + " weekly \n" . + " missingok \n" . + " rotate 4 \n" . + " compress \n" . + " delaycompress \n" . + "} \n" . + "$conf['ispconfig_log_dir']/cron.log { \n" . + " weekly \n" . + " missingok \n" . + " rotate 4 \n" . + " compress \n" . + " delaycompress \n" . + "}"); + fclose($fh); + */ + } + } + + public function configure_dbserver() { + global $conf; + + //* If this server shall act as database server for client DB's, we configure this here + $install_dir = $conf['ispconfig_install_dir']; + + // Create a file with the database login details which + // are used to create the client databases. + + if(!is_dir($install_dir.'/server/lib')) { + $command = "mkdir $install_dir/server/lib"; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); + } + + $content = rf('tpl/mysql_clientdb.conf.master'); + $content = str_replace('{username}',$conf['mysql']['admin_user'],$content); + $content = str_replace('{password}',$conf['mysql']['admin_password'], $content); + wf($install_dir.'/server/lib/mysql_clientdb.conf',$content); + chmod($install_dir.'/server/lib/mysql_clientdb.conf', 0600); + chown($install_dir.'/server/lib/mysql_clientdb.conf', 'root'); + chgrp($install_dir.'/server/lib/mysql_clientdb.conf', 'root'); + + } + + public function install_crontab() { + global $conf; + + $install_dir = $conf['ispconfig_install_dir']; + + //* Root Crontab + exec('crontab -u root -l > crontab.txt'); + $existing_root_cron_jobs = file('crontab.txt'); + + // remove existing ispconfig cronjobs, in case the syntax has changed + foreach($existing_root_cron_jobs as $key => $val) { + if(stristr($val,$install_dir)) unset($existing_root_cron_jobs[$key]); + } + + $root_cron_jobs = array( + "* * * * * ".$install_dir."/server/server.sh > /dev/null 2>> ".$conf['ispconfig_log_dir']."/cron.log", + "30 00 * * * ".$install_dir."/server/cron_daily.sh > /dev/null 2>> ".$conf['ispconfig_log_dir']."/cron.log" + ); + foreach($root_cron_jobs as $cron_job) { + if(!in_array($cron_job."\n", $existing_root_cron_jobs)) { + $existing_root_cron_jobs[] = $cron_job."\n"; + } + } + file_put_contents('crontab.txt', $existing_root_cron_jobs); + exec('crontab -u root crontab.txt &> /dev/null'); + unlink('crontab.txt'); + + //* Getmail crontab + if(is_user('getmail')) { + $cf = $conf['getmail']; + exec('crontab -u getmail -l > crontab.txt'); + $existing_cron_jobs = file('crontab.txt'); + + $cron_jobs = array( + '*/5 * * * * /usr/local/bin/run-getmail.sh > /dev/null 2>> '.$conf['ispconfig_log_dir'].'/cron.log' + ); + + // remove existing ispconfig cronjobs, in case the syntax has changed + foreach($existing_cron_jobs as $key => $val) { + if(stristr($val,'getmail')) unset($existing_cron_jobs[$key]); + } + + foreach($cron_jobs as $cron_job) { + if(!in_array($cron_job."\n", $existing_cron_jobs)) { + $existing_cron_jobs[] = $cron_job."\n"; + } + } + file_put_contents('crontab.txt', $existing_cron_jobs); + exec('crontab -u getmail crontab.txt &> /dev/null'); + unlink('crontab.txt'); + } + + touch($conf['ispconfig_log_dir'].'/cron.log'); + chmod($conf['ispconfig_log_dir'].'/cron.log', 0666); + + } + + /** + * Helper function - get the path to a template file based on + * the local part of the filename. Checks first for the existence + * of a distribution specific file and if not found looks in the + * base template folder. Optionally the behaviour can be changed + * by setting the 2nd parameter which will fetch the contents + * of the template file and return it instead of the path. The 3rd + * parameter further extends this behaviour by filtering the contents + * by inserting the ispconfig database credentials using the {} placeholders. + * + * @param string $tLocal local part of filename + * @param bool $tRf + * @param bool $tDBCred + * @return string Relative path to the chosen template file + */ + protected function get_template_file($tLocal, $tRf=false, $tDBCred=false) { + global $conf, $dist; + + $final_path = ''; + $dist_template = 'dist/tpl/'.strtolower($dist['name'])."/$tLocal.master"; + if (file_exists($dist_template)) { + $final_path = $dist_template; + } else { + $final_path = "tpl/$tLocal.master"; + } + + if (!$tRf) { + return $final_path; + } else { + return (!$tDBCred) ? rf($final_path) : $this->insert_db_credentials(rf($final_path)); + } + } + + /** + * Helper function - writes the contents to a config file + * and performs a backup if the file exist. Additionally + * if the file exists the new file will be given the + * same rights and ownership as the original. Optionally the + * rights and/or ownership can be overriden by appending umask, + * user and group to the parameters. Providing only uid and gid + * values will result in only a chown. + * + * @param $tConf + * @param $tContents + * @return bool + */ + protected function write_config_file($tConf, $tContents) { + // Backup config file before writing new contents and stat file + if ( is_file($tConf) ) { + $stat = exec('stat -c \'%a %U %G\' '.escapeshellarg($tConf), $output, $res); + if ($res == 0) { // stat successfull + list($access, $user, $group) = split(" ", $stat); + } + + if ( copy($tConf, $tConf.'~') ) { + chmod($tConf.'~', 0400); + } + } + + wf($tConf, $tContents); // write file + + if (func_num_args() >= 4) // override rights and/or ownership + { + $args = func_get_args(); + $output = array_slice($args, 2); + + switch (sizeof($output)) { + case 3: + $umask = array_shift($output); + if (is_numeric($umask) && preg_match('/^0?[0-7]{3}$/', $umask)) { + $access = $umask; + } + case 2: + if (is_user($output[0]) && is_group($output[1])) { + list($user,$group) = $output; + } + break; + } + } + + if (!empty($user) && !empty($group)) { + chown($tConf, $user); + chgrp($tConf, $group); + } + + if (!empty($access)) { + exec("chmod $access $tConf"); + } + } + + /** + * Helper function - filter the contents of a config + * file by inserting the common ispconfig database + * credentials. + * + * @param $tContents + * @return string + */ + protected function insert_db_credentials($tContents) { + global $conf; + + $tContents = str_replace('{mysql_server_ispconfig_user}', $conf["mysql"]["ispconfig_user"], $tContents); + $tContents = str_replace('{mysql_server_ispconfig_password}', $conf["mysql"]["ispconfig_password"], $tContents); + $tContents = str_replace('{mysql_server_database}', $conf["mysql"]["database"], $tContents); + $tContents = str_replace('{mysql_server_ip}', $conf["mysql"]["ip"], $tContents); + $tContents = str_replace('{mysql_server_host}',$conf['mysql']['host'], $tContents); + $tContents = str_replace('{mysql_server_port}',$conf["mysql"]["port"], $tContents); + + return $tContents; + } +} + +?> diff --git a/install/sql/README.txt b/install/sql/README.txt index 7159cfc37e5f480f7946a2fde2c4a20d73962f9c..fe15ce5403747dd82bd02da4c6989a7a247e1ac0 100644 --- a/install/sql/README.txt +++ b/install/sql/README.txt @@ -1,39 +1,39 @@ - ---------------------------------------------------------------------------------- -- Developer README ---------------------------------------------------------------------------------- - -When you add or modify a database field or table in the ISPConfig database, -then follow these steps: - -1) Add the field or table in the ispconfig3.sql file. This file contains the - complete database dump which is used when ISPConfig gets installed. - -2) Create a new file in the "incremental" subfolder wich contains the alter - table, or if it is a complete new table then the add table, statement(s) in - MySQL syntax which is/are required to modify the current ispconfig database - during update. The naming scheme of the sql patch update files is - upd_0001.sql, upd_0002.sql, upd_0003.sql etc. Ensure that the number that - you choose for the new file is a +1 increment of the number of the last - existing file and that the number is formatted with 4 digits. - - A patch file may contain one or more alter table statements. Every patch file - gets executed once in the database, so do not modify older (already released) - patch files, they will not get executed again if the update was already run - once on a system. - - After a patch has been executed, the dbversion field in the server table gets - increeased to the version number of the last installed patch. - - If you like to run a patch file again for testing purposes on your dev machine, - then set the number in "dbversion" field of the server table to be lower then - the number of your patch. - -Note: Incremental patches are supported for installed ISPConfig versions > 3.0.3. - If the installed version is < 3.0.3, then the full update method is used. - In other words, ISPConfig 3.0.3 is the patch release (dbversion) 0 as the - incremental update feature has been introduced in 3.0.3. - - - - + +--------------------------------------------------------------------------------- +- Developer README +--------------------------------------------------------------------------------- + +When you add or modify a database field or table in the ISPConfig database, +then follow these steps: + +1) Add the field or table in the ispconfig3.sql file. This file contains the + complete database dump which is used when ISPConfig gets installed. + +2) Create a new file in the "incremental" subfolder wich contains the alter + table, or if it is a complete new table then the add table, statement(s) in + MySQL syntax which is/are required to modify the current ispconfig database + during update. The naming scheme of the sql patch update files is + upd_0001.sql, upd_0002.sql, upd_0003.sql etc. Ensure that the number that + you choose for the new file is a +1 increment of the number of the last + existing file and that the number is formatted with 4 digits. + + A patch file may contain one or more alter table statements. Every patch file + gets executed once in the database, so do not modify older (already released) + patch files, they will not get executed again if the update was already run + once on a system. + + After a patch has been executed, the dbversion field in the server table gets + increeased to the version number of the last installed patch. + + If you like to run a patch file again for testing purposes on your dev machine, + then set the number in "dbversion" field of the server table to be lower then + the number of your patch. + +Note: Incremental patches are supported for installed ISPConfig versions > 3.0.3. + If the installed version is < 3.0.3, then the full update method is used. + In other words, ISPConfig 3.0.3 is the patch release (dbversion) 0 as the + incremental update feature has been introduced in 3.0.3. + + + + diff --git a/install/sql/incremental/upd_0007.sql b/install/sql/incremental/upd_0007.sql index a7697e84bd08914303ee0e442b877e41d9807948..cea38132291576f418117da7517f31147f106b8d 100644 --- a/install/sql/incremental/upd_0007.sql +++ b/install/sql/incremental/upd_0007.sql @@ -1,19 +1,19 @@ -ALTER TABLE client ADD COLUMN limit_mailmailinglist int(11) NOT NULL default '-1'; -ALTER TABLE client_template ADD COLUMN limit_mailmailinglist int(11) NOT NULL default '-1'; - -CREATE TABLE IF NOT EXISTS `mail_mailinglist` ( - `mailinglist_id` int(11) unsigned NOT NULL auto_increment, - `sys_userid` int(11) unsigned NOT NULL default '0', - `sys_groupid` int(11) unsigned NOT NULL default '0', - `sys_perm_user` varchar(5) NOT NULL, - `sys_perm_group` varchar(5) character set ucs2 NOT NULL, - `sys_perm_other` varchar(5) NOT NULL, - `server_id` int(11) unsigned NOT NULL default '0', - `domain` varchar(255) NOT NULL, - `listname` varchar(255) NOT NULL, - `email` varchar(255) NOT NULL, - `password` varchar(255) NOT NULL, - PRIMARY KEY (`mailinglist_id`) -) ENGINE=MyISAM AUTO_INCREMENT=1; - +ALTER TABLE client ADD COLUMN limit_mailmailinglist int(11) NOT NULL default '-1'; +ALTER TABLE client_template ADD COLUMN limit_mailmailinglist int(11) NOT NULL default '-1'; + +CREATE TABLE IF NOT EXISTS `mail_mailinglist` ( + `mailinglist_id` int(11) unsigned NOT NULL auto_increment, + `sys_userid` int(11) unsigned NOT NULL default '0', + `sys_groupid` int(11) unsigned NOT NULL default '0', + `sys_perm_user` varchar(5) NOT NULL, + `sys_perm_group` varchar(5) character set ucs2 NOT NULL, + `sys_perm_other` varchar(5) NOT NULL, + `server_id` int(11) unsigned NOT NULL default '0', + `domain` varchar(255) NOT NULL, + `listname` varchar(255) NOT NULL, + `email` varchar(255) NOT NULL, + `password` varchar(255) NOT NULL, + PRIMARY KEY (`mailinglist_id`) +) ENGINE=MyISAM AUTO_INCREMENT=1; + DROP TABLE `mail_mailman_domain`; \ No newline at end of file diff --git a/install/update.php b/install/update.php index 17f6c3c3ca16d5db5ad91fa33ac0a95a95532df1..fa1cb8313297a381d2de2da9e67a6e3cdbff3d99 100644 --- a/install/update.php +++ b/install/update.php @@ -1,358 +1,358 @@ -> Update \n\n"; - -//** Include the library with the basic installer functions -require_once('lib/install.lib.php'); - -//** Include the library with the basic updater functions -require_once('lib/update.lib.php'); - -//** Include the base class of the installer class -require_once('lib/installer_base.lib.php'); - -//** Ensure that current working directory is install directory -$cur_dir = getcwd(); -if(realpath(dirname(__FILE__)) != $cur_dir) die("Please run installation/update from _inside_ the install directory!\n"); - -//** Install logfile -define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log'); -define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../')); - -//** Check for ISPConfig 2.x versions -if(is_dir('/root/ispconfig') || is_dir('/home/admispconfig')) { - die('This software cannot be installed on a server wich runs ISPConfig 2.x.'); -} - -//** Get distribution identifier -$dist = get_distname(); - -include_once("/usr/local/ispconfig/server/lib/config.inc.php"); -$conf_old = $conf; -unset($conf); - -if($dist['id'] == '') die('Linux distribution or version not recognized.'); - -//** Include the distribution-specific installer class library and configuration -if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php'); -include_once('dist/lib/'.$dist['id'].'.lib.php'); -include_once('dist/conf/'.$dist['id'].'.conf.php'); - -//** Get hostname -exec('hostname -f', $tmp_out); -$conf['hostname'] = $tmp_out[0]; -unset($tmp_out); - -//** Set the mysql login information -$conf["mysql"]["host"] = $conf_old["db_host"]; -$conf["mysql"]["database"] = $conf_old["db_database"]; -$conf['mysql']['charset'] = 'utf8'; -$conf["mysql"]["ispconfig_user"] = $conf_old["db_user"]; -$conf["mysql"]["ispconfig_password"] = $conf_old["db_password"]; -$conf['language'] = $conf_old['language']; -if($conf['language'] == '{language}') $conf['language'] = 'en'; - -if(isset($conf_old["dbmaster_host"])) $conf["mysql"]["master_host"] = $conf_old["dbmaster_host"]; -if(isset($conf_old["dbmaster_database"])) $conf["mysql"]["master_database"] = $conf_old["dbmaster_database"]; -if(isset($conf_old["dbmaster_user"])) $conf["mysql"]["master_ispconfig_user"] = $conf_old["dbmaster_user"]; -if(isset($conf_old["dbmaster_password"])) $conf["mysql"]["master_ispconfig_password"] = $conf_old["dbmaster_password"]; - -//* Check if this is a master / slave setup -if($conf["mysql"]["master_host"] != '' && $conf["mysql"]["host"] != $conf["mysql"]["master_host"]) { - $conf['mysql']['master_slave_setup'] = 'y'; -} - -// Resolve the IP address of the mysql hostname. -if(!$conf['mysql']['ip'] = gethostbyname($conf['mysql']['host'])) die('Unable to resolve hostname'.$conf['mysql']['host']); - -$conf['server_id'] = intval($conf_old["server_id"]); -$conf['ispconfig_log_priority'] = $conf_old["log_priority"]; - -$inst = new installer(); -$inst->is_update = true; - -//** Detect the installed applications -$inst->find_installed_apps(); - -echo "This application will update ISPConfig 3 on your server.\n"; - -//** Initialize the MySQL server connection -include_once('lib/mysql.lib.php'); - -//** Database update is a bit brute force and should be rebuild later ;) - -/* - * Try to read the DB-admin settings - */ -$clientdb_host = ''; -$clientdb_user = ''; -$clientdb_password = ''; -include_once("/usr/local/ispconfig/server/lib/mysql_clientdb.conf"); -$conf["mysql"]["admin_user"] = $clientdb_user; -$conf["mysql"]["admin_password"] = $clientdb_password; -$clientdb_host = ''; -$clientdb_user = ''; -$clientdb_password = ''; - -//** Ask user for mysql admin_password if empty -if( empty($conf["mysql"]["admin_password"]) ) { - - $conf["mysql"]["admin_password"] = $inst->free_query('MySQL root password', $conf['mysql']['admin_password']); -} - -/* - * Prepare the dump of the database - */ -prepareDBDump(); - -//* initialize the database -$inst->db = new db(); - -//* initialize the master DB, if we have a multiserver setup -if($conf['mysql']['master_slave_setup'] == 'y') { - //** Get MySQL root credentials - $finished = false; - do { - $tmp_mysql_server_host = $inst->free_query('MySQL master server hostname', $conf['mysql']['master_host']); - $tmp_mysql_server_admin_user = $inst->free_query('MySQL master server root username', $conf['mysql']['master_admin_user']); - $tmp_mysql_server_admin_password = $inst->free_query('MySQL master server root password', $conf['mysql']['master_admin_password']); - $tmp_mysql_server_database = $inst->free_query('MySQL master server database name', $conf['mysql']['master_database']); - - //* Initialize the MySQL server connection - if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { - $conf['mysql']['master_host'] = $tmp_mysql_server_host; - $conf['mysql']['master_admin_user'] = $tmp_mysql_server_admin_user; - $conf['mysql']['master_admin_password'] = $tmp_mysql_server_admin_password; - $conf['mysql']['master_database'] = $tmp_mysql_server_database; - $finished = true; - } else { - swriteln($inst->lng('Unable to connect to mysql server').' '.mysql_error()); - } - } while ($finished == false); - unset($finished); - - // initialize the connection to the master database - $inst->dbmaster = new db(); - if($inst->dbmaster->linkId) $inst->dbmaster->closeConn(); - $inst->dbmaster->dbHost = $conf['mysql']["master_host"]; - $inst->dbmaster->dbName = $conf['mysql']["master_database"]; - $inst->dbmaster->dbUser = $conf['mysql']["master_admin_user"]; - $inst->dbmaster->dbPass = $conf['mysql']["master_admin_password"]; -} else { - $inst->dbmaster = $inst->db; -} - - -/* - * dump the new Database and reconfigure the server.ini - */ -updateDbAndIni(); - -/* - * Reconfigure the permisson if needed - * (if this is done at client side, only this client is updated. - * If this is done at server side, all clients are updated. - */ -//if($conf_old['dbmaster_user'] != '' or $conf_old['dbmaster_host'] != '') { - //** Update master database rights - $reconfigure_master_database_rights_answer = $inst->simple_query('Reconfigure Permissions in master database?', array('yes','no'),'no'); - - if($reconfigure_master_database_rights_answer == 'yes') { - $inst->grant_master_database_rights(); - } -//} - -//** Shall the services be reconfigured during update -$reconfigure_services_answer = $inst->simple_query('Reconfigure Services?', array('yes','no'),'yes'); - -if($reconfigure_services_answer == 'yes') { - - if($conf['services']['mail']) { - //** Configure postfix - swriteln('Configuring Postfix'); - $inst->configure_postfix('dont-create-certs'); - - //** Configure mailman - swriteln('Configuring Mailman'); - $inst->configure_mailman('update'); - - //* Configure Jailkit - swriteln('Configuring Jailkit'); - $inst->configure_jailkit(); - - if($conf['dovecot']['installed'] == true) { - //* Configure dovecot - swriteln('Configuring Dovecot'); - $inst->configure_dovecot(); - } else { - //** Configure saslauthd - swriteln('Configuring SASL'); - $inst->configure_saslauthd(); - - //** Configure PAM - swriteln('Configuring PAM'); - $inst->configure_pam(); - - //* Configure courier - swriteln('Configuring Courier'); - $inst->configure_courier(); - } - - //** Configure Spamasassin - swriteln('Configuring Spamassassin'); - $inst->configure_spamassassin(); - - //** Configure Amavis - swriteln('Configuring Amavisd'); - $inst->configure_amavis(); - - //** Configure Getmail - swriteln('Configuring Getmail'); - $inst->configure_getmail(); - } - - if($conf['services']['web']) { - //** Configure Pureftpd - swriteln('Configuring Pureftpd'); - $inst->configure_pureftpd(); - } - - if($conf['services']['dns']) { - //* Configure DNS - if($conf['powerdns']['installed'] == true) { - swriteln('Configuring PowerDNS'); - $inst->configure_powerdns(); - } elseif($conf['bind']['installed'] == true) { - swriteln('Configuring BIND'); - $inst->configure_bind(); - } else { - swriteln('Configuring MyDNS'); - $inst->configure_mydns(); - } - } - - if($conf['services']['web']) { - //** Configure Apache - swriteln('Configuring Apache'); - $inst->configure_apache(); - - //** Configure vlogger - swriteln('Configuring vlogger'); - $inst->configure_vlogger(); - - //** Configure apps vhost - swriteln('Configuring Apps vhost'); - $inst->configure_apps_vhost(); - } - - - //* Configure DBServer - swriteln('Configuring Database'); - $inst->configure_dbserver(); - - - //if(@is_dir('/etc/Bastille')) { - //* Configure Firewall - swriteln('Configuring Firewall'); - $inst->configure_firewall(); - //} -} - -//** Configure ISPConfig -swriteln('Updating ISPConfig'); - - -//** Customise the port ISPConfig runs on -$ispconfig_port_number = get_ispconfig_port_number(); -$conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', $ispconfig_port_number); - -// $ispconfig_ssl_default = (is_ispconfig_ssl_enabled() == true)?'y':'n'; -if(strtolower($inst->simple_query('Create new ISPConfig SSL certificate',array('yes','no'),'no')) == 'yes') { - $inst->make_ispconfig_ssl_cert(); -} - -$inst->install_ispconfig(); - -//** Configure Crontab -$update_crontab_answer = $inst->simple_query('Reconfigure Crontab?', array('yes','no'),'yes'); -if($update_crontab_answer == 'yes') { - swriteln('Updating Crontab'); - $inst->install_crontab(); -} - -//** Restart services: -if($reconfigure_services_answer == 'yes') { - swriteln('Restarting services ...'); - if($conf['mysql']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mysql']['init_script'])) system($conf['init_scripts'].'/'.$conf['mysql']['init_script'].' restart'); - if($conf['services']['mail']) { - if($conf['postfix']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart'); - if($conf['saslauthd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart'); - if($conf['amavis']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart'); - if($conf['clamav']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart'); - if($conf['courier']['courier-authdaemon'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart'); - if($conf['courier']['courier-imap'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart'); - if($conf['courier']['courier-imap-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart'); - if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); - if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); - if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); - if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart'); - } - if($conf['services']['web']) { - if($conf['apache']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); - if($conf['pureftpd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart'); - } - if($conf['services']['dns']) { - if($conf['mydns']['installed'] == true && $conf['mydns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null'); - if($conf['powerdns']['installed'] == true && $conf['powerdns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['powerdns']['init_script'])) system($conf['init_scripts'].'/'.$conf['powerdns']['init_script'].' restart &> /dev/null'); - if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['bind']['init_script'])) system($conf['init_scripts'].'/'.$conf['bind']['init_script'].' restart &> /dev/null'); - } -} - -echo "Update finished.\n"; - -?> +> Update \n\n"; + +//** Include the library with the basic installer functions +require_once('lib/install.lib.php'); + +//** Include the library with the basic updater functions +require_once('lib/update.lib.php'); + +//** Include the base class of the installer class +require_once('lib/installer_base.lib.php'); + +//** Ensure that current working directory is install directory +$cur_dir = getcwd(); +if(realpath(dirname(__FILE__)) != $cur_dir) die("Please run installation/update from _inside_ the install directory!\n"); + +//** Install logfile +define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log'); +define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../')); + +//** Check for ISPConfig 2.x versions +if(is_dir('/root/ispconfig') || is_dir('/home/admispconfig')) { + die('This software cannot be installed on a server wich runs ISPConfig 2.x.'); +} + +//** Get distribution identifier +$dist = get_distname(); + +include_once("/usr/local/ispconfig/server/lib/config.inc.php"); +$conf_old = $conf; +unset($conf); + +if($dist['id'] == '') die('Linux distribution or version not recognized.'); + +//** Include the distribution-specific installer class library and configuration +if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php'); +include_once('dist/lib/'.$dist['id'].'.lib.php'); +include_once('dist/conf/'.$dist['id'].'.conf.php'); + +//** Get hostname +exec('hostname -f', $tmp_out); +$conf['hostname'] = $tmp_out[0]; +unset($tmp_out); + +//** Set the mysql login information +$conf["mysql"]["host"] = $conf_old["db_host"]; +$conf["mysql"]["database"] = $conf_old["db_database"]; +$conf['mysql']['charset'] = 'utf8'; +$conf["mysql"]["ispconfig_user"] = $conf_old["db_user"]; +$conf["mysql"]["ispconfig_password"] = $conf_old["db_password"]; +$conf['language'] = $conf_old['language']; +if($conf['language'] == '{language}') $conf['language'] = 'en'; + +if(isset($conf_old["dbmaster_host"])) $conf["mysql"]["master_host"] = $conf_old["dbmaster_host"]; +if(isset($conf_old["dbmaster_database"])) $conf["mysql"]["master_database"] = $conf_old["dbmaster_database"]; +if(isset($conf_old["dbmaster_user"])) $conf["mysql"]["master_ispconfig_user"] = $conf_old["dbmaster_user"]; +if(isset($conf_old["dbmaster_password"])) $conf["mysql"]["master_ispconfig_password"] = $conf_old["dbmaster_password"]; + +//* Check if this is a master / slave setup +if($conf["mysql"]["master_host"] != '' && $conf["mysql"]["host"] != $conf["mysql"]["master_host"]) { + $conf['mysql']['master_slave_setup'] = 'y'; +} + +// Resolve the IP address of the mysql hostname. +if(!$conf['mysql']['ip'] = gethostbyname($conf['mysql']['host'])) die('Unable to resolve hostname'.$conf['mysql']['host']); + +$conf['server_id'] = intval($conf_old["server_id"]); +$conf['ispconfig_log_priority'] = $conf_old["log_priority"]; + +$inst = new installer(); +$inst->is_update = true; + +//** Detect the installed applications +$inst->find_installed_apps(); + +echo "This application will update ISPConfig 3 on your server.\n"; + +//** Initialize the MySQL server connection +include_once('lib/mysql.lib.php'); + +//** Database update is a bit brute force and should be rebuild later ;) + +/* + * Try to read the DB-admin settings + */ +$clientdb_host = ''; +$clientdb_user = ''; +$clientdb_password = ''; +include_once("/usr/local/ispconfig/server/lib/mysql_clientdb.conf"); +$conf["mysql"]["admin_user"] = $clientdb_user; +$conf["mysql"]["admin_password"] = $clientdb_password; +$clientdb_host = ''; +$clientdb_user = ''; +$clientdb_password = ''; + +//** Ask user for mysql admin_password if empty +if( empty($conf["mysql"]["admin_password"]) ) { + + $conf["mysql"]["admin_password"] = $inst->free_query('MySQL root password', $conf['mysql']['admin_password']); +} + +/* + * Prepare the dump of the database + */ +prepareDBDump(); + +//* initialize the database +$inst->db = new db(); + +//* initialize the master DB, if we have a multiserver setup +if($conf['mysql']['master_slave_setup'] == 'y') { + //** Get MySQL root credentials + $finished = false; + do { + $tmp_mysql_server_host = $inst->free_query('MySQL master server hostname', $conf['mysql']['master_host']); + $tmp_mysql_server_admin_user = $inst->free_query('MySQL master server root username', $conf['mysql']['master_admin_user']); + $tmp_mysql_server_admin_password = $inst->free_query('MySQL master server root password', $conf['mysql']['master_admin_password']); + $tmp_mysql_server_database = $inst->free_query('MySQL master server database name', $conf['mysql']['master_database']); + + //* Initialize the MySQL server connection + if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { + $conf['mysql']['master_host'] = $tmp_mysql_server_host; + $conf['mysql']['master_admin_user'] = $tmp_mysql_server_admin_user; + $conf['mysql']['master_admin_password'] = $tmp_mysql_server_admin_password; + $conf['mysql']['master_database'] = $tmp_mysql_server_database; + $finished = true; + } else { + swriteln($inst->lng('Unable to connect to mysql server').' '.mysql_error()); + } + } while ($finished == false); + unset($finished); + + // initialize the connection to the master database + $inst->dbmaster = new db(); + if($inst->dbmaster->linkId) $inst->dbmaster->closeConn(); + $inst->dbmaster->dbHost = $conf['mysql']["master_host"]; + $inst->dbmaster->dbName = $conf['mysql']["master_database"]; + $inst->dbmaster->dbUser = $conf['mysql']["master_admin_user"]; + $inst->dbmaster->dbPass = $conf['mysql']["master_admin_password"]; +} else { + $inst->dbmaster = $inst->db; +} + + +/* + * dump the new Database and reconfigure the server.ini + */ +updateDbAndIni(); + +/* + * Reconfigure the permisson if needed + * (if this is done at client side, only this client is updated. + * If this is done at server side, all clients are updated. + */ +//if($conf_old['dbmaster_user'] != '' or $conf_old['dbmaster_host'] != '') { + //** Update master database rights + $reconfigure_master_database_rights_answer = $inst->simple_query('Reconfigure Permissions in master database?', array('yes','no'),'no'); + + if($reconfigure_master_database_rights_answer == 'yes') { + $inst->grant_master_database_rights(); + } +//} + +//** Shall the services be reconfigured during update +$reconfigure_services_answer = $inst->simple_query('Reconfigure Services?', array('yes','no'),'yes'); + +if($reconfigure_services_answer == 'yes') { + + if($conf['services']['mail']) { + //** Configure postfix + swriteln('Configuring Postfix'); + $inst->configure_postfix('dont-create-certs'); + + //** Configure mailman + swriteln('Configuring Mailman'); + $inst->configure_mailman('update'); + + //* Configure Jailkit + swriteln('Configuring Jailkit'); + $inst->configure_jailkit(); + + if($conf['dovecot']['installed'] == true) { + //* Configure dovecot + swriteln('Configuring Dovecot'); + $inst->configure_dovecot(); + } else { + //** Configure saslauthd + swriteln('Configuring SASL'); + $inst->configure_saslauthd(); + + //** Configure PAM + swriteln('Configuring PAM'); + $inst->configure_pam(); + + //* Configure courier + swriteln('Configuring Courier'); + $inst->configure_courier(); + } + + //** Configure Spamasassin + swriteln('Configuring Spamassassin'); + $inst->configure_spamassassin(); + + //** Configure Amavis + swriteln('Configuring Amavisd'); + $inst->configure_amavis(); + + //** Configure Getmail + swriteln('Configuring Getmail'); + $inst->configure_getmail(); + } + + if($conf['services']['web']) { + //** Configure Pureftpd + swriteln('Configuring Pureftpd'); + $inst->configure_pureftpd(); + } + + if($conf['services']['dns']) { + //* Configure DNS + if($conf['powerdns']['installed'] == true) { + swriteln('Configuring PowerDNS'); + $inst->configure_powerdns(); + } elseif($conf['bind']['installed'] == true) { + swriteln('Configuring BIND'); + $inst->configure_bind(); + } else { + swriteln('Configuring MyDNS'); + $inst->configure_mydns(); + } + } + + if($conf['services']['web']) { + //** Configure Apache + swriteln('Configuring Apache'); + $inst->configure_apache(); + + //** Configure vlogger + swriteln('Configuring vlogger'); + $inst->configure_vlogger(); + + //** Configure apps vhost + swriteln('Configuring Apps vhost'); + $inst->configure_apps_vhost(); + } + + + //* Configure DBServer + swriteln('Configuring Database'); + $inst->configure_dbserver(); + + + //if(@is_dir('/etc/Bastille')) { + //* Configure Firewall + swriteln('Configuring Firewall'); + $inst->configure_firewall(); + //} +} + +//** Configure ISPConfig +swriteln('Updating ISPConfig'); + + +//** Customise the port ISPConfig runs on +$ispconfig_port_number = get_ispconfig_port_number(); +$conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', $ispconfig_port_number); + +// $ispconfig_ssl_default = (is_ispconfig_ssl_enabled() == true)?'y':'n'; +if(strtolower($inst->simple_query('Create new ISPConfig SSL certificate',array('yes','no'),'no')) == 'yes') { + $inst->make_ispconfig_ssl_cert(); +} + +$inst->install_ispconfig(); + +//** Configure Crontab +$update_crontab_answer = $inst->simple_query('Reconfigure Crontab?', array('yes','no'),'yes'); +if($update_crontab_answer == 'yes') { + swriteln('Updating Crontab'); + $inst->install_crontab(); +} + +//** Restart services: +if($reconfigure_services_answer == 'yes') { + swriteln('Restarting services ...'); + if($conf['mysql']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mysql']['init_script'])) system($conf['init_scripts'].'/'.$conf['mysql']['init_script'].' restart'); + if($conf['services']['mail']) { + if($conf['postfix']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart'); + if($conf['saslauthd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart'); + if($conf['amavis']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart'); + if($conf['clamav']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart'); + if($conf['courier']['courier-authdaemon'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart'); + if($conf['courier']['courier-imap'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart'); + if($conf['courier']['courier-imap-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart'); + if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); + if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); + if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); + if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart'); + } + if($conf['services']['web']) { + if($conf['apache']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); + if($conf['pureftpd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart'); + } + if($conf['services']['dns']) { + if($conf['mydns']['installed'] == true && $conf['mydns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null'); + if($conf['powerdns']['installed'] == true && $conf['powerdns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['powerdns']['init_script'])) system($conf['init_scripts'].'/'.$conf['powerdns']['init_script'].' restart &> /dev/null'); + if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['bind']['init_script'])) system($conf['init_scripts'].'/'.$conf['bind']['init_script'].' restart &> /dev/null'); + } +} + +echo "Update finished.\n"; + +?> diff --git a/interface/index.htm b/interface/index.htm index 39606dbb3710e1939027c58888cc37edf4c8d956..9e38208a2d2e5bf54750ea3ed68dea120ad39b0a 100644 --- a/interface/index.htm +++ b/interface/index.htm @@ -1,8 +1,8 @@ - - - - - - - - + + + + + + + + diff --git a/interface/lib/classes/auth.inc.php b/interface/lib/classes/auth.inc.php index 20094cf7606047cce00db744b5d95fb626edd9f2..450f25a3ca8f1095b3a4ac2060671cc0b45a6bb9 100644 --- a/interface/lib/classes/auth.inc.php +++ b/interface/lib/classes/auth.inc.php @@ -1,129 +1,129 @@ -db->queryOneRecord("SELECT client.limit_client FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id"); - if($client['limit_client'] > 0) { - return true; - } else { - return false; - } - } - - //** This function adds a given group id to a given user. - public function add_group_to_user($userid,$groupid) { - global $app; - - $userid = intval($userid); - $groupid = intval($groupid); - - if($userid > 0 && $groupid > 0) { - $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid"); - $groups = explode(',',$user['groups']); - if(!in_array($groupid,$groups)) $groups[] = $groupid; - $groups_string = implode(',',$groups); - $sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid"; - $app->db->query($sql); - return true; - } else { - return false; - } - } - - //** This function returns given client limit as integer, -1 means no limit - public function get_client_limit($userid, $limitname) - { - global $app; - - // simple query cache - if($this->client_limits===null) - $this->client_limits = $app->db->queryOneRecord("SELECT client.* FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id"); - - // isn't client -> no limit - if(!$this->client_limits) - return -1; - - if(isset($this->client_limits['limit_'.$limitname])) { - return $this->client_limits['limit_'.$limitname]; - } - } - - //** This function removes a given group id from a given user. - public function remove_group_from_user($userid,$groupid) { - global $app; - - $userid = intval($userid); - $groupid = intval($groupid); - - if($userid > 0 && $groupid > 0) { - $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid"); - $groups = explode(',',$user['groups']); - $key = array_search($groupid,$groups); - unset($groups[$key]); - $groups_string = implode(',',$groups); - $sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid"; - $app->db->query($sql); - return true; - } else { - return false; - } - } - - public function check_module_permissions($module) { - // Check if the current user has the permissions to access this module - if(!stristr($_SESSION["s"]["user"]["modules"],$module)) { - // echo "LOGIN_REDIRECT:/index.php"; - header("Location: /index.php"); - exit; - } - } - -} - +db->queryOneRecord("SELECT client.limit_client FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id"); + if($client['limit_client'] > 0) { + return true; + } else { + return false; + } + } + + //** This function adds a given group id to a given user. + public function add_group_to_user($userid,$groupid) { + global $app; + + $userid = intval($userid); + $groupid = intval($groupid); + + if($userid > 0 && $groupid > 0) { + $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid"); + $groups = explode(',',$user['groups']); + if(!in_array($groupid,$groups)) $groups[] = $groupid; + $groups_string = implode(',',$groups); + $sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid"; + $app->db->query($sql); + return true; + } else { + return false; + } + } + + //** This function returns given client limit as integer, -1 means no limit + public function get_client_limit($userid, $limitname) + { + global $app; + + // simple query cache + if($this->client_limits===null) + $this->client_limits = $app->db->queryOneRecord("SELECT client.* FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id"); + + // isn't client -> no limit + if(!$this->client_limits) + return -1; + + if(isset($this->client_limits['limit_'.$limitname])) { + return $this->client_limits['limit_'.$limitname]; + } + } + + //** This function removes a given group id from a given user. + public function remove_group_from_user($userid,$groupid) { + global $app; + + $userid = intval($userid); + $groupid = intval($groupid); + + if($userid > 0 && $groupid > 0) { + $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid"); + $groups = explode(',',$user['groups']); + $key = array_search($groupid,$groups); + unset($groups[$key]); + $groups_string = implode(',',$groups); + $sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid"; + $app->db->query($sql); + return true; + } else { + return false; + } + } + + public function check_module_permissions($module) { + // Check if the current user has the permissions to access this module + if(!stristr($_SESSION["s"]["user"]["modules"],$module)) { + // echo "LOGIN_REDIRECT:/index.php"; + header("Location: /index.php"); + exit; + } + } + +} + ?> \ No newline at end of file diff --git a/interface/lib/classes/form.inc.php b/interface/lib/classes/form.inc.php index f0e8de6454cffa88a37cf3092aa90ed26c9eebbc..99f6cfb6249759f5e897ffcb26c110ad0fdf766c 100644 --- a/interface/lib/classes/form.inc.php +++ b/interface/lib/classes/form.inc.php @@ -1,475 +1,475 @@ -tableDef = $table; - $this->table_name = $table_name; - $this->table_index = $table_index; - return true; - } - - function loadFormDef($file) { - global $app,$conf; - - include_once($file); - $this->formDef = $form; - return true; - } - - - /** - * Konvertiert die Daten des übergebenen assoziativen - * Arrays in "menschenlesbare" Form. - * Datentyp Konvertierung, z.B. für Ausgabe in Listen. - * - * @param record - * @return record - */ - function decode($record) { - if(is_array($record)) { - foreach($record as $key => $val) { - switch ($this->tableDef[$key]['datatype']) { - case 'VARCHAR': - $new_record[$key] = stripslashes($val); - break; - - case 'DATE': - if($val > 0) { - $new_record[$key] = date($this->dateformat,$val); - } - break; - - case 'INTEGER': - $new_record[$key] = intval($val); - break; - - case 'DOUBLE': - $new_record[$key] = $val; - break; - - case 'CURRENCY': - $new_record[$key] = number_format($val, 2, ',', ''); - break; - - default: - $new_record[$key] = stripslashes($val); - } - } - - } - return $new_record; - } - - /** - * Record für Ausgabe in Formularen vorbereiten. - * - * @param record = Datensatz als Array - * @param action = NEW oder EDIT - * @return record - */ - function getHTML($record,$action = 'NEW') { - - global $app; - - if(!is_array($this->tableDef)) $app->error("Keine Tabellendefinition vorhanden."); - - $new_record = array(); - if($action == 'EDIT') { - $record = $this->decode($record); - if(is_array($record)) { - foreach($record as $key => $val) { - switch ($this->tableDef[$key]['formtype']) { - case 'SELECT': - if(is_array($this->tableDef[$key]['value'])) { - $out = ''; - foreach($this->tableDef[$key]['value'] as $k => $v) { - $selected = ($k == $val)?' SELECTED':''; - $out .= "\r\n"; - } - } - $new_record[$key] = $out; - break; - case 'MULTIPLE': - if(is_array($this->tableDef[$key]['value'])) { - - // aufsplitten ergebnisse - $vals = explode($this->tableDef[$key]['separator'],$val); - - // HTML schreiben - $out = ''; - foreach($this->tableDef[$key]['value'] as $k => $v) { - - $selected = ''; - foreach($vals as $tvl) { - if(trim($tvl) == trim($k)) $selected = ' SELECTED'; - } - - $out .= "\r\n"; - } - } - $new_record[$key] = $out; - break; - - case 'PASSWORD': - $new_record[$key] = ''; - break; - - default: - $new_record[$key] = htmlspecialchars($val); - } - } - } - } else { - foreach($this->tableDef as $key => $val) { - switch ($this->tableDef[$key]['formtype']) { - case 'SELECT': - if(is_array($this->tableDef[$key]['value'])) { - $out = ''; - foreach($this->tableDef[$key]['value'] as $k => $v) { - $selected = ($k == $val)?' SELECTED':''; - $out .= "\r\n"; - } - } - $new_record[$key] = $out; - break; - case 'MULTIPLE': - if(is_array($this->tableDef[$key]['value'])) { - - // aufsplitten ergebnisse - $vals = explode($this->tableDef[$key]['separator'],$val); - - // HTML schreiben - $out = ''; - foreach($this->tableDef[$key]['value'] as $k => $v) { - - $out .= "\r\n"; - } - } - $new_record[$key] = $out; - break; - - case 'PASSWORD': - $new_record[$key] = ''; - break; - - default: - $new_record[$key] = htmlspecialchars($this->tableDef[$key]['value']); - } - } - - } - - if($this->debug == 1) $this->dbg($new_record); - - return $new_record; - } - - /** - * Record in "maschinen lesbares" Format überführen - * und Werte gegen reguläre Ausdrücke prüfen. - * - * @param record = Datensatz als Array - * @return record - */ - function encode($record) { - - $this->errorMessage = ''; - - if(is_array($record)) { - foreach($record as $key => $val) { - switch ($this->tableDef[$key]['datatype']) { - case 'VARCHAR': - if(!is_array($val)) { - $new_record[$key] = mysql_real_escape_string($val); - } else { - $new_record[$key] = implode($this->tableDef[$key]['separator'],$val); - } - break; - case 'DATE': - if($val > 0) { - list($tag,$monat,$jahr) = explode('.',$val); - $new_record[$key] = mktime(0,0,0,$monat,$tag,$jahr); - } - break; - case 'INTEGER': - $new_record[$key] = intval($val); - break; - case 'DOUBLE': - $new_record[$key] = mysql_real_escape_string($val); - break; - case 'CURRENCY': - $new_record[$key] = str_replace(",",".",$val); - break; - } - - if($this->tableDef[$key]['regex'] != '') { - // Enable that "." matches also newlines - $this->tableDef[$key]['regex'] .= 's'; - if(!preg_match($this->tableDef[$key]['regex'], $val)) { - $this->errorMessage .= $this->tableDef[$key]['errmsg']."
\r\n"; - } - } - } - - } - return $new_record; - } - - /** - * SQL Statement für Record erzeugen. - * - * @param record = Datensatz als Array - * @param action = INSERT oder UPDATE - * @param primary_id - * @return record - */ - function getSQL($record, $action = 'INSERT', $primary_id = 0, $sql_ext_where = '') { - - global $app; - - $record = $this->encode($record); - $sql_insert_key = ''; - $sql_insert_val = ''; - $sql_update = ''; - - if(!is_array($this->tableDef)) $app->error("Keine Tabellendefinition vorhanden."); - - // gehe durch alle Felder des Records - if(is_array($record)) { - foreach($record as $key => $val) { - // Wenn es kein leeres Passwortfeld ist - if (!($this->tableDef[$key]['formtype'] == 'PASSWORD' and $val == '')) { - // gehe durch alle Felder der TableDef - foreach($this->tableDef as $tk => $tv) { - // Wenn Feld in TableDef enthalten ist - if($tk == $key) { - // Erzeuge Insert oder Update Quelltext - if($action == "INSERT") { - - if($this->tableDef[$key]['formtype'] == 'PASSWORD') { - $sql_insert_key .= "`$key`, "; - $sql_insert_val .= "md5('$val'), "; - //} elseif($this->tableDef[$key]['formtype'] == 'MULTIPLE') { - // $val = implode($this->tableDef[$key]['separator'],$val); - // $sql_insert_key .= "`$key`, "; - // $sql_insert_val .= "'$val', "; - } else { - $sql_insert_key .= "`$key`, "; - $sql_insert_val .= "'$val', "; - } - - } else { - - if($this->tableDef[$key]['formtype'] == 'PASSWORD') { - $sql_update .= "`$key` = md5('$val'), "; - //} elseif($this->tableDef[$key]['formtype'] == 'MULTIPLE') { - // $val = implode($this->tableDef[$key]['separator'],$val); - // $sql_update .= "`$key` = '$val', "; - } else { - $sql_update .= "`$key` = '$val', "; - } - - } - } - } - } - } - } - - // Füge Backticks nur bei unvollständigen Tabellennamen ein - if(stristr($this->table_name,'.')) { - $escape = ''; - } else { - $escape = '`'; - } - - - if($action == "INSERT") { - $sql_insert_key = substr($sql_insert_key,0,-2); - $sql_insert_val = substr($sql_insert_val,0,-2); - $sql = "INSERT INTO ".$escape.$this->table_name.$escape." ($sql_insert_key) VALUES ($sql_insert_val)"; - } else { - if($primary_id != 0) { - $sql_update = substr($sql_update,0,-2); - $sql = "UPDATE ".$escape.$this->table_name.$escape." SET ".$sql_update." WHERE ".$this->table_index ." = ".$primary_id; - if($sql_ext_where != '') $sql .= " and ".$sql_ext_where; - } else { - $app->error("Primary ID fehlt!"); - } - } - - return $sql; - } - - /** - * Debugging arrays. - * - * @param array_data - */ - function dbg($array_data) { - - echo "
";
-		print_r($array_data);
-		echo "
"; - - } - - - function showForm() { - global $app,$conf; - - if(!is_array($this->formDef)) die("Form Definition wurde nicht geladen."); - - if($this->errorMessage == '') { - // wenn kein Fehler vorliegt - if($_REQUEST["next_tab"] != '') { - // wenn nächster Tab bekannt - $active_tab = $_REQUEST["next_tab"]; - } else { - // ansonsten ersten tab nehmen - $active_tab = $this->formDef["tabs"][0]["name"]; - } - } else { - // bei Fehlern den gleichen Tab nochmal anzeigen - $active_tab = $_SESSION["s"]["form"]["tab"]; - } - - // definiere Tabs - foreach( $this->formDef["tabs"] as $tab) { - - if($tab["name"] == $active_tab) { - $app->tpl->setInclude('content_tpl',$tab["template"]); - $tab["active"] = 1; - $_SESSION["s"]["form"]["tab"] = $tab["name"]; - } else { - $tab["active"] = 0; - } - - $frmTab[] = $tab; - } - - // setze Loop - $app->tpl->setLoop("formTab", $frmTab); - - // Formular action setzen - $app->tpl->setVar('form_action',$this->formDef["action"]); - } - - -} - +tableDef = $table; + $this->table_name = $table_name; + $this->table_index = $table_index; + return true; + } + + function loadFormDef($file) { + global $app,$conf; + + include_once($file); + $this->formDef = $form; + return true; + } + + + /** + * Konvertiert die Daten des übergebenen assoziativen + * Arrays in "menschenlesbare" Form. + * Datentyp Konvertierung, z.B. für Ausgabe in Listen. + * + * @param record + * @return record + */ + function decode($record) { + if(is_array($record)) { + foreach($record as $key => $val) { + switch ($this->tableDef[$key]['datatype']) { + case 'VARCHAR': + $new_record[$key] = stripslashes($val); + break; + + case 'DATE': + if($val > 0) { + $new_record[$key] = date($this->dateformat,$val); + } + break; + + case 'INTEGER': + $new_record[$key] = intval($val); + break; + + case 'DOUBLE': + $new_record[$key] = $val; + break; + + case 'CURRENCY': + $new_record[$key] = number_format($val, 2, ',', ''); + break; + + default: + $new_record[$key] = stripslashes($val); + } + } + + } + return $new_record; + } + + /** + * Record für Ausgabe in Formularen vorbereiten. + * + * @param record = Datensatz als Array + * @param action = NEW oder EDIT + * @return record + */ + function getHTML($record,$action = 'NEW') { + + global $app; + + if(!is_array($this->tableDef)) $app->error("Keine Tabellendefinition vorhanden."); + + $new_record = array(); + if($action == 'EDIT') { + $record = $this->decode($record); + if(is_array($record)) { + foreach($record as $key => $val) { + switch ($this->tableDef[$key]['formtype']) { + case 'SELECT': + if(is_array($this->tableDef[$key]['value'])) { + $out = ''; + foreach($this->tableDef[$key]['value'] as $k => $v) { + $selected = ($k == $val)?' SELECTED':''; + $out .= "\r\n"; + } + } + $new_record[$key] = $out; + break; + case 'MULTIPLE': + if(is_array($this->tableDef[$key]['value'])) { + + // aufsplitten ergebnisse + $vals = explode($this->tableDef[$key]['separator'],$val); + + // HTML schreiben + $out = ''; + foreach($this->tableDef[$key]['value'] as $k => $v) { + + $selected = ''; + foreach($vals as $tvl) { + if(trim($tvl) == trim($k)) $selected = ' SELECTED'; + } + + $out .= "\r\n"; + } + } + $new_record[$key] = $out; + break; + + case 'PASSWORD': + $new_record[$key] = ''; + break; + + default: + $new_record[$key] = htmlspecialchars($val); + } + } + } + } else { + foreach($this->tableDef as $key => $val) { + switch ($this->tableDef[$key]['formtype']) { + case 'SELECT': + if(is_array($this->tableDef[$key]['value'])) { + $out = ''; + foreach($this->tableDef[$key]['value'] as $k => $v) { + $selected = ($k == $val)?' SELECTED':''; + $out .= "\r\n"; + } + } + $new_record[$key] = $out; + break; + case 'MULTIPLE': + if(is_array($this->tableDef[$key]['value'])) { + + // aufsplitten ergebnisse + $vals = explode($this->tableDef[$key]['separator'],$val); + + // HTML schreiben + $out = ''; + foreach($this->tableDef[$key]['value'] as $k => $v) { + + $out .= "\r\n"; + } + } + $new_record[$key] = $out; + break; + + case 'PASSWORD': + $new_record[$key] = ''; + break; + + default: + $new_record[$key] = htmlspecialchars($this->tableDef[$key]['value']); + } + } + + } + + if($this->debug == 1) $this->dbg($new_record); + + return $new_record; + } + + /** + * Record in "maschinen lesbares" Format überführen + * und Werte gegen reguläre Ausdrücke prüfen. + * + * @param record = Datensatz als Array + * @return record + */ + function encode($record) { + + $this->errorMessage = ''; + + if(is_array($record)) { + foreach($record as $key => $val) { + switch ($this->tableDef[$key]['datatype']) { + case 'VARCHAR': + if(!is_array($val)) { + $new_record[$key] = mysql_real_escape_string($val); + } else { + $new_record[$key] = implode($this->tableDef[$key]['separator'],$val); + } + break; + case 'DATE': + if($val > 0) { + list($tag,$monat,$jahr) = explode('.',$val); + $new_record[$key] = mktime(0,0,0,$monat,$tag,$jahr); + } + break; + case 'INTEGER': + $new_record[$key] = intval($val); + break; + case 'DOUBLE': + $new_record[$key] = mysql_real_escape_string($val); + break; + case 'CURRENCY': + $new_record[$key] = str_replace(",",".",$val); + break; + } + + if($this->tableDef[$key]['regex'] != '') { + // Enable that "." matches also newlines + $this->tableDef[$key]['regex'] .= 's'; + if(!preg_match($this->tableDef[$key]['regex'], $val)) { + $this->errorMessage .= $this->tableDef[$key]['errmsg']."
\r\n"; + } + } + } + + } + return $new_record; + } + + /** + * SQL Statement für Record erzeugen. + * + * @param record = Datensatz als Array + * @param action = INSERT oder UPDATE + * @param primary_id + * @return record + */ + function getSQL($record, $action = 'INSERT', $primary_id = 0, $sql_ext_where = '') { + + global $app; + + $record = $this->encode($record); + $sql_insert_key = ''; + $sql_insert_val = ''; + $sql_update = ''; + + if(!is_array($this->tableDef)) $app->error("Keine Tabellendefinition vorhanden."); + + // gehe durch alle Felder des Records + if(is_array($record)) { + foreach($record as $key => $val) { + // Wenn es kein leeres Passwortfeld ist + if (!($this->tableDef[$key]['formtype'] == 'PASSWORD' and $val == '')) { + // gehe durch alle Felder der TableDef + foreach($this->tableDef as $tk => $tv) { + // Wenn Feld in TableDef enthalten ist + if($tk == $key) { + // Erzeuge Insert oder Update Quelltext + if($action == "INSERT") { + + if($this->tableDef[$key]['formtype'] == 'PASSWORD') { + $sql_insert_key .= "`$key`, "; + $sql_insert_val .= "md5('$val'), "; + //} elseif($this->tableDef[$key]['formtype'] == 'MULTIPLE') { + // $val = implode($this->tableDef[$key]['separator'],$val); + // $sql_insert_key .= "`$key`, "; + // $sql_insert_val .= "'$val', "; + } else { + $sql_insert_key .= "`$key`, "; + $sql_insert_val .= "'$val', "; + } + + } else { + + if($this->tableDef[$key]['formtype'] == 'PASSWORD') { + $sql_update .= "`$key` = md5('$val'), "; + //} elseif($this->tableDef[$key]['formtype'] == 'MULTIPLE') { + // $val = implode($this->tableDef[$key]['separator'],$val); + // $sql_update .= "`$key` = '$val', "; + } else { + $sql_update .= "`$key` = '$val', "; + } + + } + } + } + } + } + } + + // Füge Backticks nur bei unvollständigen Tabellennamen ein + if(stristr($this->table_name,'.')) { + $escape = ''; + } else { + $escape = '`'; + } + + + if($action == "INSERT") { + $sql_insert_key = substr($sql_insert_key,0,-2); + $sql_insert_val = substr($sql_insert_val,0,-2); + $sql = "INSERT INTO ".$escape.$this->table_name.$escape." ($sql_insert_key) VALUES ($sql_insert_val)"; + } else { + if($primary_id != 0) { + $sql_update = substr($sql_update,0,-2); + $sql = "UPDATE ".$escape.$this->table_name.$escape." SET ".$sql_update." WHERE ".$this->table_index ." = ".$primary_id; + if($sql_ext_where != '') $sql .= " and ".$sql_ext_where; + } else { + $app->error("Primary ID fehlt!"); + } + } + + return $sql; + } + + /** + * Debugging arrays. + * + * @param array_data + */ + function dbg($array_data) { + + echo "
";
+		print_r($array_data);
+		echo "
"; + + } + + + function showForm() { + global $app,$conf; + + if(!is_array($this->formDef)) die("Form Definition wurde nicht geladen."); + + if($this->errorMessage == '') { + // wenn kein Fehler vorliegt + if($_REQUEST["next_tab"] != '') { + // wenn nächster Tab bekannt + $active_tab = $_REQUEST["next_tab"]; + } else { + // ansonsten ersten tab nehmen + $active_tab = $this->formDef["tabs"][0]["name"]; + } + } else { + // bei Fehlern den gleichen Tab nochmal anzeigen + $active_tab = $_SESSION["s"]["form"]["tab"]; + } + + // definiere Tabs + foreach( $this->formDef["tabs"] as $tab) { + + if($tab["name"] == $active_tab) { + $app->tpl->setInclude('content_tpl',$tab["template"]); + $tab["active"] = 1; + $_SESSION["s"]["form"]["tab"] = $tab["name"]; + } else { + $tab["active"] = 0; + } + + $frmTab[] = $tab; + } + + // setze Loop + $app->tpl->setLoop("formTab", $frmTab); + + // Formular action setzen + $app->tpl->setVar('form_action',$this->formDef["action"]); + } + + +} + ?> \ No newline at end of file diff --git a/interface/lib/classes/functions.inc.php b/interface/lib/classes/functions.inc.php index 7de83e995918d864800084f14bbb0e52fae2a074..1839676eb3c56150fb8a79861d5c2346d6d79c8a 100644 --- a/interface/lib/classes/functions.inc.php +++ b/interface/lib/classes/functions.inc.php @@ -1,111 +1,111 @@ -error("Mail sending disabled in demo mode."); - - if($filepath != '') { - if(!file_exists($filepath)) $app->error("Mail attachement does not exist ".$filepath); - - $content = file_get_contents($filepath); - $content = chunk_split(base64_encode($content)); - $uid = strtoupper(md5(uniqid(time()))); - - if($filename == '') { - $path_parts = pathinfo($filepath); - $filename = $path_parts["basename"]; - unset($path_parts); - } - - $header = "From: $from\nReply-To: $from\n"; - $header .= "MIME-Version: 1.0\n"; - $header .= "Content-Type: multipart/mixed; boundary=$uid\n"; - - $header .= "--$uid\n"; - $header .= "Content-Type: text/plain\n"; - $header .= "Content-Transfer-Encoding: 8bit\n\n"; - $header .= "$text\n"; - - $header .= "--$uid\n"; - $header .= "Content-Type: $filetype; name=\"$filename\"\n"; - - $header .= "Content-Transfer-Encoding: base64\n"; - $header .= "Content-Disposition: attachment; filename=\"$filename\"\n\n"; - $header .= "$content\n"; - - $header .= "--$uid--"; - - mail($to, $subject, "", $header); - } else { - $header = "From: $from\nReply-To: $from\n"; - mail($to, $subject, $text, $header); - } - - return true; - } - - public function array_merge($array1,$array2) { - $out = $array1; - foreach($array2 as $key => $val) { - $out[$key] = $val; - } - return $out; - } - - public function currency_format($number) { - global $app; - $number_format_decimals = (int)$app->lng('number_format_decimals'); - $number_format_dec_point = $app->lng('number_format_dec_point'); - $number_format_thousands_sep = $app->lng('number_format_thousands_sep'); - if($number_format_thousands_sep == 'number_format_thousands_sep') $number_format_thousands_sep = ''; - return number_format((double)$number, $number_format_decimals, $number_format_dec_point, $number_format_thousands_sep); - } - - public function get_ispconfig_url() { - $url = (stristr($_SERVER['SERVER_PROTOCOL'],'HTTPS'))?'https':'http'; - $url .= '://'.$_SERVER['SERVER_NAME']; - if($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) { - $url .= ':'.$_SERVER['SERVER_PORT']; - } - return $url; - } - - -} - +error("Mail sending disabled in demo mode."); + + if($filepath != '') { + if(!file_exists($filepath)) $app->error("Mail attachement does not exist ".$filepath); + + $content = file_get_contents($filepath); + $content = chunk_split(base64_encode($content)); + $uid = strtoupper(md5(uniqid(time()))); + + if($filename == '') { + $path_parts = pathinfo($filepath); + $filename = $path_parts["basename"]; + unset($path_parts); + } + + $header = "From: $from\nReply-To: $from\n"; + $header .= "MIME-Version: 1.0\n"; + $header .= "Content-Type: multipart/mixed; boundary=$uid\n"; + + $header .= "--$uid\n"; + $header .= "Content-Type: text/plain\n"; + $header .= "Content-Transfer-Encoding: 8bit\n\n"; + $header .= "$text\n"; + + $header .= "--$uid\n"; + $header .= "Content-Type: $filetype; name=\"$filename\"\n"; + + $header .= "Content-Transfer-Encoding: base64\n"; + $header .= "Content-Disposition: attachment; filename=\"$filename\"\n\n"; + $header .= "$content\n"; + + $header .= "--$uid--"; + + mail($to, $subject, "", $header); + } else { + $header = "From: $from\nReply-To: $from\n"; + mail($to, $subject, $text, $header); + } + + return true; + } + + public function array_merge($array1,$array2) { + $out = $array1; + foreach($array2 as $key => $val) { + $out[$key] = $val; + } + return $out; + } + + public function currency_format($number) { + global $app; + $number_format_decimals = (int)$app->lng('number_format_decimals'); + $number_format_dec_point = $app->lng('number_format_dec_point'); + $number_format_thousands_sep = $app->lng('number_format_thousands_sep'); + if($number_format_thousands_sep == 'number_format_thousands_sep') $number_format_thousands_sep = ''; + return number_format((double)$number, $number_format_decimals, $number_format_dec_point, $number_format_thousands_sep); + } + + public function get_ispconfig_url() { + $url = (stristr($_SERVER['SERVER_PROTOCOL'],'HTTPS'))?'https':'http'; + $url .= '://'.$_SERVER['SERVER_NAME']; + if($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) { + $url .= ':'.$_SERVER['SERVER_PORT']; + } + return $url; + } + + +} + ?> \ No newline at end of file diff --git a/interface/lib/classes/plugin_base.inc.php b/interface/lib/classes/plugin_base.inc.php index cde853fc87d365128b76babb00d21e316b07a11e..5b69e03c4040ba8368b5ed9207c65d8b7f40b5bc 100644 --- a/interface/lib/classes/plugin_base.inc.php +++ b/interface/lib/classes/plugin_base.inc.php @@ -1,64 +1,64 @@ -options = $options; - $this->plugin_name = $plugin_name; - } - -} - +options = $options; + $this->plugin_name = $plugin_name; + } + +} + ?> \ No newline at end of file diff --git a/interface/lib/classes/plugin_dbhistory.inc.php b/interface/lib/classes/plugin_dbhistory.inc.php index 876dcaf048c7d3c448eec090ee615c21e4830ab9..ebd9e745e64fae91adae9f9a188a35ca281c4365 100644 --- a/interface/lib/classes/plugin_dbhistory.inc.php +++ b/interface/lib/classes/plugin_dbhistory.inc.php @@ -1,69 +1,69 @@ -tform->formDef["db_table"]; - $db_table_idx = $app->tform->formDef["db_table_idx"]; - $primary_id = $this->form->id; - if($_SESSION["s"]["user"]["typ"] == 'admin') { - $sql = "SELECT action, tstamp, user, data FROM sys_datalog WHERE dbtable = '".$db_table."' AND dbidx = '".$db_table_idx.":".$primary_id."'"; - } else { - $sql = "SELECT action, tstamp, user, data FROM sys_datalog WHERE user = '".$_SESSION["s"]["user"]["username"]."' dbtable = '".$db_table."' AND dbidx = '".$db_table_idx.":".$primary_id."'"; - } - - $records = $app->db->queryAllRecords($sql); - if(is_array($records)) { - $content .= ''; - foreach($records as $rec) { - $content .= ""; - } - $content .= '
".date("d.m.Y",$rec["tstamp"])."".$rec["user"]."
'; - } - - return $content; - - } -} - +tform->formDef["db_table"]; + $db_table_idx = $app->tform->formDef["db_table_idx"]; + $primary_id = $this->form->id; + if($_SESSION["s"]["user"]["typ"] == 'admin') { + $sql = "SELECT action, tstamp, user, data FROM sys_datalog WHERE dbtable = '".$db_table."' AND dbidx = '".$db_table_idx.":".$primary_id."'"; + } else { + $sql = "SELECT action, tstamp, user, data FROM sys_datalog WHERE user = '".$_SESSION["s"]["user"]["username"]."' dbtable = '".$db_table."' AND dbidx = '".$db_table_idx.":".$primary_id."'"; + } + + $records = $app->db->queryAllRecords($sql); + if(is_array($records)) { + $content .= ''; + foreach($records as $rec) { + $content .= ""; + } + $content .= '
".date("d.m.Y",$rec["tstamp"])."".$rec["user"]."
'; + } + + return $content; + + } +} + ?> \ No newline at end of file diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php index 0a56dcf995a5662ceb9557cafce2fd42100f3b18..ce9aa4a2ef6d8f4d4818d5d03c9c600bf930750b 100644 --- a/interface/lib/classes/remoting.inc.php +++ b/interface/lib/classes/remoting.inc.php @@ -1,150 +1,150 @@ -server = $server; - /* - $this->app = $app; - $this->conf = $conf; - */ - } - - //* remote login function - public function login($username, $password) - { - global $app, $conf, $server; - - if(empty($username)) { - $this->server->fault('login_username_empty', 'The login username is empty'); - return false; - } - - if(empty($password)) { - $this->server->fault('login_password_empty', 'The login password is empty'); - return false; - } - - //* Delete old remoting sessions - $sql = "DELETE FROM remote_session WHERE tstamp < ".time(); - $app->db->query($sql); - - $username = $app->db->quote($username); - $password = $app->db->quote($password); - - $sql = "SELECT * FROM remote_user WHERE remote_username = '$username' and remote_password = md5('$password')"; - $remote_user = $app->db->queryOneRecord($sql); - if($remote_user['remote_userid'] > 0) { - //* Create a remote user session - srand ((double)microtime()*1000000); - $remote_session = md5(rand()); - $remote_userid = $remote_user['remote_userid']; - $remote_functions = $remote_user['remote_functions']; - $tstamp = time() + $this->session_timeout; - $sql = 'INSERT INTO remote_session (remote_session,remote_userid,remote_functions,tstamp' - .') VALUES (' - ." '$remote_session',$remote_userid,'$remote_functions',$tstamp)"; - $app->db->query($sql); - return $remote_session; - } else { - $this->server->fault('login_failed', 'The login failed. Username or password wrong.'); - return false; - } - - } - - //* remote logout function - public function logout($session_id) - { - global $app; - - if(empty($session_id)) { - $this->server->fault('session_id_empty', 'The SessionID is empty.'); - return false; - } - - $session_id = $app->db->quote($session_id); - - $sql = "DELETE FROM remote_session WHERE remote_session = '$session_id'"; - $app->db->query($sql); - return ($app->db->affectedRows() == 1); - } - - - /** - Gets the server configuration - @param int session id - @param int server id - @param string section of the config field in the server table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc - @author Julio Montoya BeezNest 2010 - */ - public function server_get($session_id, $server_id, $section ='') { - global $app; - if(!$this->checkPerm($session_id, 'server_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - if (!empty($session_id) && !empty($server_id)) { - $app->uses('remoting_lib , getconf'); - $section_config = $app->getconf->get_server_config($server_id,$section); - return $section_config; - } else { - return false; - } - } - +server = $server; + /* + $this->app = $app; + $this->conf = $conf; + */ + } + + //* remote login function + public function login($username, $password) + { + global $app, $conf, $server; + + if(empty($username)) { + $this->server->fault('login_username_empty', 'The login username is empty'); + return false; + } + + if(empty($password)) { + $this->server->fault('login_password_empty', 'The login password is empty'); + return false; + } + + //* Delete old remoting sessions + $sql = "DELETE FROM remote_session WHERE tstamp < ".time(); + $app->db->query($sql); + + $username = $app->db->quote($username); + $password = $app->db->quote($password); + + $sql = "SELECT * FROM remote_user WHERE remote_username = '$username' and remote_password = md5('$password')"; + $remote_user = $app->db->queryOneRecord($sql); + if($remote_user['remote_userid'] > 0) { + //* Create a remote user session + srand ((double)microtime()*1000000); + $remote_session = md5(rand()); + $remote_userid = $remote_user['remote_userid']; + $remote_functions = $remote_user['remote_functions']; + $tstamp = time() + $this->session_timeout; + $sql = 'INSERT INTO remote_session (remote_session,remote_userid,remote_functions,tstamp' + .') VALUES (' + ." '$remote_session',$remote_userid,'$remote_functions',$tstamp)"; + $app->db->query($sql); + return $remote_session; + } else { + $this->server->fault('login_failed', 'The login failed. Username or password wrong.'); + return false; + } + + } + + //* remote logout function + public function logout($session_id) + { + global $app; + + if(empty($session_id)) { + $this->server->fault('session_id_empty', 'The SessionID is empty.'); + return false; + } + + $session_id = $app->db->quote($session_id); + + $sql = "DELETE FROM remote_session WHERE remote_session = '$session_id'"; + $app->db->query($sql); + return ($app->db->affectedRows() == 1); + } + + + /** + Gets the server configuration + @param int session id + @param int server id + @param string section of the config field in the server table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc + @author Julio Montoya BeezNest 2010 + */ + public function server_get($session_id, $server_id, $section ='') { + global $app; + if(!$this->checkPerm($session_id, 'server_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + if (!empty($session_id) && !empty($server_id)) { + $app->uses('remoting_lib , getconf'); + $section_config = $app->getconf->get_server_config($server_id,$section); + return $section_config; + } else { + return false; + } + } + public function server_get_serverid_by_ip($session_id, $ipaddress) { global $app; @@ -157,53 +157,53 @@ class remoting { return $all; } - //* Get mail domain details - public function mail_domain_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_domain_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/mail_domain.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a mail domain - public function mail_domain_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'mail_domain_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $primary_id = $this->insertQuery('../mail/form/mail_domain.tform.php',$client_id,$params); - return $primary_id; - } - - //* Update a mail domain - public function mail_domain_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'mail_domain_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/mail_domain.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - //* Delete a mail domain - public function mail_domain_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'mail_domain_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/mail_domain.tform.php', $primary_id); - return $affected_rows; - } - + //* Get mail domain details + public function mail_domain_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'mail_domain_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/mail_domain.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a mail domain + public function mail_domain_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'mail_domain_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $primary_id = $this->insertQuery('../mail/form/mail_domain.tform.php',$client_id,$params); + return $primary_id; + } + + //* Update a mail domain + public function mail_domain_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'mail_domain_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/mail_domain.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + //* Delete a mail domain + public function mail_domain_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'mail_domain_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/mail_domain.tform.php', $primary_id); + return $affected_rows; + } + //* Get mail mailinglist details public function mail_mailinglist_get($session_id, $primary_id) { @@ -251,2342 +251,2342 @@ class remoting { return $affected_rows; } - //* Get mail user details - public function mail_user_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_user_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/mail_user.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - - //* dodanie uzytkownika email - public function mail_user_add($session_id, $client_id, $params){ - if (!$this->checkPerm($session_id, 'mail_user_add')){ - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->insertQuery('../mail/form/mail_user.tform.php', $client_id, $params); - return $affected_rows; - } - - //* edycja uzytkownika email - public function mail_user_update($session_id, $client_id, $primary_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_user_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/mail_user.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - - //*usuniecie uzytkownika emial - public function mail_user_delete($session_id, $primary_id) - { - if (!$this->checkPerm($session_id, 'mail_user_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/mail_user.tform.php', $primary_id); - return $affected_rows; - } - - //* Get mail user filter details - public function mail_user_filter_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_user_filter_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/mail_user_filter.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - public function mail_user_filter_add($session_id, $client_id, $params) - { - global $app; - if (!$this->checkPerm($session_id, 'mail_user_filter_add')){ - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->insertQuery('../mail/form/mail_user_filter.tform.php', $client_id, $params,'mail:mail_user_filter:on_after_insert'); - // $app->plugin->raiseEvent('mail:mail_user_filter:on_after_insert',$this); - return $affected_rows; - } - - public function mail_user_filter_update($session_id, $client_id, $primary_id, $params) - { - global $app; - if (!$this->checkPerm($session_id, 'mail_user_filter_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/mail_user_filter.tform.php', $client_id, $primary_id, $params,'mail:mail_user_filter:on_after_update'); - // $app->plugin->raiseEvent('mail:mail_user_filter:on_after_update',$this); - return $affected_rows; - } - - public function mail_user_filter_delete($session_id, $primary_id) - { - global $app; - if (!$this->checkPerm($session_id, 'mail_user_filter_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/mail_user_filter.tform.php', $primary_id); - $app->plugin->raiseEvent('mail:mail_user_filter:on_after_delete',$this); - return $affected_rows; - } - - //* Get alias details - public function mail_alias_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_alias_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/mail_alias.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* aliasy email - public function mail_alias_add($session_id, $client_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_alias_add')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->insertQuery('../mail/form/mail_alias.tform.php', $client_id, $params); - return $affected_rows; - } - - - public function mail_alias_update($session_id, $client_id, $primary_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_alias_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/mail_alias.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - public function mail_alias_delete($session_id, $primary_id) - { - if (!$this->checkPerm($session_id, 'mail_alias_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/mail_alias.tform.php', $primary_id); - return $affected_rows; - } - - //* Get mail forwarding details - public function mail_forward_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_forward_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/mail_forward.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* przekierowania email - public function mail_forward_add($session_id, $client_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_forward_add')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->insertQuery('../mail/form/mail_forward.tform.php', $client_id, $params); - return $affected_rows; - } - - - public function mail_forward_update($session_id, $client_id, $primary_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_forward_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/mail_forward.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - - public function mail_forward_delete($session_id, $primary_id) - { - if (!$this->checkPerm($session_id, 'mail_forward_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/mail_forward.tform.php', $primary_id); - return $affected_rows; - } - - //* Get catchall details - public function mail_catchall_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_catchall_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/mail_domain_catchall.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* catchall e-mail - public function mail_catchall_add($session_id, $client_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_catchall_add')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->insertQuery('../mail/form/mail_domain_catchall.tform.php', $client_id, $params); - return $affected_rows; - } - - public function mail_catchall_update($session_id, $client_id, $primary_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_catchall_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/mail_domain_catchall.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - public function mail_catchall_delete($session_id, $primary_id) - { - if (!$this->checkPerm($session_id, 'mail_catchall_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/mail_domain_catchall.tform.php', $primary_id); - return $affected_rows; - } - - //* Get transport details - public function mail_transport_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_transport_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/mail_transport.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* przeniesienia e-mail - public function mail_transport_add($session_id, $client_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_transport_add')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->insertQuery('../mail/form/mail_transport.tform.php', $client_id, $params); - return $affected_rows; - } - - - public function mail_transport_update($session_id, $client_id, $primary_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_transport_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/mail_transport.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - - public function mail_transport_delete($session_id, $primary_id) - { - if (!$this->checkPerm($session_id, 'mail_transport_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/mail_transport.tform.php', $primary_id); - return $affected_rows; - } - - //* Get spamfilter whitelist details - public function mail_spamfilter_whitelist_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/spamfilter_whitelist.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* biała lista e-mail - public function mail_spamfilter_whitelist_add($session_id, $client_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_add')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->insertQuery('../mail/form/spamfilter_whitelist.tform.php', $client_id, $params); - return $affected_rows; - } - - - public function mail_spamfilter_whitelist_update($session_id, $client_id, $primary_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/spamfilter_whitelist.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - - public function mail_spamfilter_whitelist_delete($session_id, $primary_id) - { - if (!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/spamfilter_whitelist.tform.php', $primary_id); - return $affected_rows; - } - - //* Get spamfilter blacklist details - public function mail_spamfilter_blacklist_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/spamfilter_blacklist.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* czarna lista e-mail - public function mail_spamfilter_blacklist_add($session_id, $client_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_add')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->insertQuery('../mail/form/spamfilter_blacklist.tform.php', $client_id, $params); - return $affected_rows; - } - - - public function mail_spamfilter_blacklist_update($session_id, $client_id, $primary_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/spamfilter_blacklist.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - - public function mail_spamfilter_blacklist_delete($session_id, $primary_id) - { - if (!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/spamfilter_blacklist.tform.php', $primary_id); - return $affected_rows; - } - - //* Get spamfilter user details - public function mail_spamfilter_user_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_spamfilter_user_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/spamfilter_users.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* filtr spamu użytkowników e-mail - public function mail_spamfilter_user_add($session_id, $client_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_spamfilter_user_add')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->insertQuery('../mail/form/spamfilter_users.tform.php', $client_id, $params); - return $affected_rows; - } - - - public function mail_spamfilter_user_update($session_id, $client_id, $primary_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_spamfilter_user_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/spamfilter_users.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - - public function mail_spamfilter_user_delete($session_id, $primary_id) - { - if (!$this->checkPerm($session_id, 'mail_spamfilter_user_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/spamfilter_users.tform.php', $primary_id); - return $affected_rows; - } - - //* Get policy details - public function mail_policy_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_policy_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/spamfilter_policy.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* polityki filtrów spamu e-mail - public function mail_policy_add($session_id, $client_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_policy_add')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->insertQuery('../mail/form/spamfilter_policy.tform.php', $client_id, $params); - return $affected_rows; - } - - - public function mail_policy_update($session_id, $client_id, $primary_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_policy_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/spamfilter_policy.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - - public function mail_policy_delete($session_id, $primary_id) - { - if (!$this->checkPerm($session_id, 'mail_policy_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/spamfilter_policy.tform.php', $primary_id); - return $affected_rows; - } - - //* Get fetchmail details - public function mail_fetchmail_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_fetchmail_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/mail_get.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* fetchmail - public function mail_fetchmail_add($session_id, $client_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_fetchmail_add')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->insertQuery('../mail/form/mail_get.tform.php', $client_id, $params); - return $affected_rows; - } - - - public function mail_fetchmail_update($session_id, $client_id, $primary_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_fetchmail_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/mail_get.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - - public function mail_fetchmail_delete($session_id, $primary_id) - { - if (!$this->checkPerm($session_id, 'mail_fetchmail_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/mail_get.tform.php', $primary_id); - return $affected_rows; - } - - //* Get whitelist details - public function mail_whitelist_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_whitelist_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/mail_whitelist.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* wpisy białej listy - public function mail_whitelist_add($session_id, $client_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_whitelist_add')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->insertQuery('../mail/form/mail_whitelist.tform.php', $client_id, $params); - return $affected_rows; - } - - - public function mail_whitelist_update($session_id, $client_id, $primary_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_whitelist_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/mail_whitelist.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - - public function mail_whitelist_delete($session_id, $primary_id) - { - if (!$this->checkPerm($session_id, 'mail_whitelist_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/mail_whitelist.tform.php', $primary_id); - return $affected_rows; - } - - //* Get Blacklist details - public function mail_blacklist_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_blacklist_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/mail_blacklist.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* wpisy białej listy - public function mail_blacklist_add($session_id, $client_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_blacklist_add')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->insertQuery('../mail/form/mail_blacklist.tform.php', $client_id, $params); - return $affected_rows; - } - - - public function mail_blacklist_update($session_id, $client_id, $primary_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_blacklist_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/mail_blacklist.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - - public function mail_blacklist_delete($session_id, $primary_id) - { - if (!$this->checkPerm($session_id, 'mail_blacklist_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/mail_blacklist.tform.php', $primary_id); - return $affected_rows; - } - - //* Get filter details - public function mail_filter_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'mail_filter_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../mail/form/mail_content_filter.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* wpisy filtrow e-mail - public function mail_filter_add($session_id, $client_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_filter_add')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->insertQuery('../mail/form/mail_content_filter.tform.php', $client_id, $params); - return $affected_rows; - } - - - public function mail_filter_update($session_id, $client_id, $primary_id, $params) - { - if (!$this->checkPerm($session_id, 'mail_filter_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../mail/form/mail_content_filter.tform.php', $client_id, $primary_id, $params); - return $affected_rows; - } - - - public function mail_filter_delete($session_id, $primary_id) - { - if (!$this->checkPerm($session_id, 'mail_filter_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../mail/form/mail_content_filter.tform.php', $primary_id); - return $affected_rows; - } - - - - -/* - * - * - * - * * Client functions - * - * - */ - //* Get client details - public function client_get($session_id, $client_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'client_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../client/form/client.tform.php'); - return $app->remoting_lib->getDataRecord($client_id); - } - - public function client_get_id($session_id, $sys_userid) - { - global $app; - if(!$this->checkPerm($session_id, 'client_get_id')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - - $sys_userid = intval($sys_userid); - - $rec = $app->db->queryOneRecord("SELECT client_id FROM sys_user WHERE userid = ".$sys_userid); - if(isset($rec['client_id'])) { - return intval($rec['client_id']); - } else { - $this->server->fault('no_client_found', 'There is no sysuser account for this client ID.'); - return false; - } - - } - - - public function client_add($session_id, $reseller_id, $params) - { - if (!$this->checkPerm($session_id, 'client_add')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->klientadd('../client/form/client.tform.php',$reseller_id, $params); - return $affected_rows; - - } - - public function client_update($session_id, $client_id, $reseller_id, $params) - { - global $app; - - if (!$this->checkPerm($session_id, 'client_update')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../client/form/client.tform.php', $reseller_id, $client_id, $params); - - $app->remoting_lib->ispconfig_sysuser_update($params,$client_id); - - return $affected_rows; - } - - - public function client_delete($session_id,$client_id) - { - global $app; - - if (!$this->checkPerm($session_id, 'client_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../client/form/client.tform.php',$client_id); - - $app->remoting_lib->ispconfig_sysuser_delete($client_id); - - return $affected_rows; - } - - // ----------------------------------------------------------------------------------------------- - - public function client_delete_everything($session_id, $client_id) + //* Get mail user details + public function mail_user_get($session_id, $primary_id) { - global $app, $conf; - if(!$this->checkPerm($session_id, 'client_delete_everything')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $client_id = intval($client_id); - $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id"); - - $tables = 'client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_domain,web_traffic'; - $tables_array = explode(',',$tables); - $client_group_id = intval($client_group['groupid']); + global $app; - $table_list = array(); - if($client_group_id > 1) { - foreach($tables_array as $table) { - if($table != '') { - $records = $app->db->queryAllRecords("SELECT * FROM $table WHERE sys_groupid = ".$client_group_id); - $number = count($records); - if($number > 0) $table_list[] = array('table' => $table."(".$number.")"); - } - } + if(!$this->checkPerm($session_id, 'mail_user_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; } - - - if($client_id > 0) { - // remove the group of the client from the resellers group - $parent_client_id = intval($this->dataRecord['parent_client_id']); - $parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = $parent_client_id"); - $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id"); - $app->auth->remove_group_from_user($parent_user['userid'],$client_group['groupid']); - - // delete the group of the client - $app->db->query("DELETE FROM sys_group WHERE client_id = $client_id"); - - // delete the sys user(s) of the client - $app->db->query("DELETE FROM sys_user WHERE client_id = $client_id"); - - // Delete all records (sub-clients, mail, web, etc....) of this client. - $tables = 'client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_domain,web_traffic'; - $tables_array = explode(',',$tables); - $client_group_id = intval($client_group['groupid']); - if($client_group_id > 1) { - foreach($tables_array as $table) { - if($table != '') { - $records = $app->db->queryAllRecords("SELECT * FROM $table WHERE sys_groupid = ".$client_group_id); - // find the primary ID of the table - $table_info = $app->db->tableInfo($table); - $index_field = ''; - foreach($table_info as $tmp) { - if($tmp['option'] == 'primary') $index_field = $tmp['name']; - } - // Delete the records - if($index_field != '') { - if(is_array($records)) { - foreach($records as $rec) { - $app->db->datalogDelete($table, $index_field, $rec[$index_field]); - } - } - } - - } - } - } - - - + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/mail_user.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + + //* dodanie uzytkownika email + public function mail_user_add($session_id, $client_id, $params){ + if (!$this->checkPerm($session_id, 'mail_user_add')){ + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; } - - if (!$this->checkPerm($session_id, 'client_delete')) - { - $this->server->fault('permission_denied','You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../client/form/client.tform.php',$client_id); - - // $app->remoting_lib->ispconfig_sysuser_delete($client_id); - + $affected_rows = $this->insertQuery('../mail/form/mail_user.tform.php', $client_id, $params); + return $affected_rows; + } - return false; + //* edycja uzytkownika email + public function mail_user_update($session_id, $client_id, $primary_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_user_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/mail_user.tform.php', $client_id, $primary_id, $params); + return $affected_rows; } + - // Website functions --------------------------------------------------------------------------------------- - - //* Get cron details - public function sites_cron_get($session_id, $cron_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'sites_cron_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../sites/form/cron.tform.php'); - return $app->remoting_lib->getDataRecord($cron_id); - } - - //* Add a cron record - public function sites_cron_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'sites_cron_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../sites/form/cron.tform.php',$client_id,$params); - } - - //* Update cron record - public function sites_cron_update($session_id, $client_id, $cron_id, $params) - { - if(!$this->checkPerm($session_id, 'sites_cron_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../sites/form/cron.tform.php',$client_id,$cron_id,$params); - return $affected_rows; - } - - //* Delete cron record - public function sites_cron_delete($session_id, $cron_id) - { - if(!$this->checkPerm($session_id, 'sites_cron_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../sites/form/cron.tform.php',$cron_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------- - - //* Get record details - public function sites_database_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'sites_database_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../sites/form/database.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function sites_database_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'sites_database_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../sites/form/database.tform.php',$client_id,$params); - } - - //* Update a record - public function sites_database_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'sites_database_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../sites/form/database.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function sites_database_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'sites_database_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../sites/form/database.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------- - - //* Get record details - public function sites_ftp_user_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'sites_ftp_user_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../sites/form/ftp_user.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function sites_ftp_user_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'sites_ftp_user_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../sites/form/ftp_user.tform.php',$client_id,$params); - } - - //* Update a record - public function sites_ftp_user_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'sites_ftp_user_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../sites/form/ftp_user.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function sites_ftp_user_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'sites_ftp_user_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../sites/form/ftp_user.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------- - - //* Get record details - public function sites_shell_user_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'sites_shell_user_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../sites/form/shell_user.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function sites_shell_user_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'sites_shell_user_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../sites/form/shell_user.tform.php',$client_id,$params); - } - - //* Update a record - public function sites_shell_user_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'sites_shell_user_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../sites/form/shell_user.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function sites_shell_user_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'sites_shell_user_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../sites/form/shell_user.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------- - - //* Get record details - public function sites_web_domain_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'sites_web_domain_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../sites/form/web_domain.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function sites_web_domain_add($session_id, $client_id, $params, $readonly = false) + //*usuniecie uzytkownika emial + public function mail_user_delete($session_id, $primary_id) { - global $app; - if(!$this->checkPerm($session_id, 'sites_web_domain_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $domain_id = $this->insertQuery('../sites/form/web_domain.tform.php',$client_id,$params, 'sites:web_domain:on_after_insert'); - if ($readonly === true) - $app->db->query("UPDATE web_domain SET `sys_userid` = '1' WHERE domain_id = ".$domain_id); - return $domain_id; + if (!$this->checkPerm($session_id, 'mail_user_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; } + $affected_rows = $this->deleteQuery('../mail/form/mail_user.tform.php', $primary_id); + return $affected_rows; + } - //* Update a record - public function sites_web_domain_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'sites_web_domain_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../sites/form/web_domain.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function sites_web_domain_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'sites_web_domain_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../sites/form/web_domain.tform.php',$primary_id); - return $affected_rows; - } - - // ----------------------------------------------------------------------------------------------- - - //* Get record details - public function sites_web_aliasdomain_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../sites/form/web_aliasdomain.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function sites_web_aliasdomain_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../sites/form/web_aliasdomain.tform.php',$client_id,$params); - } - - //* Update a record - public function sites_web_aliasdomain_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../sites/form/web_aliasdomain.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function sites_web_aliasdomain_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../sites/form/web_aliasdomain.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------- - - //* Get record details - public function sites_web_subdomain_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'sites_web_subdomain_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../sites/form/web_subdomain.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function sites_web_subdomain_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'sites_web_subdomain_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../sites/form/web_subdomain.tform.php',$client_id,$params); - } - - //* Update a record - public function sites_web_subdomain_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'sites_web_subdomain_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../sites/form/web_subdomain.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function sites_web_subdomain_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'sites_web_subdomain_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../sites/form/web_subdomain.tform.php',$primary_id); - return $affected_rows; - } - - // ----------------------------------------------------------------------------------------------- - - //* Get record details - public function domains_domain_get($session_id, $primary_id) + //* Get mail user filter details + public function mail_user_filter_get($session_id, $primary_id) { global $app; - if(!$this->checkPerm($session_id, 'domains_domain_get')) { + if(!$this->checkPerm($session_id, 'mail_user_filter_get')) { $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); return false; } $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../domain/form/domain.tform.php'); + $app->remoting_lib->loadFormDef('../mail/form/mail_user_filter.tform.php'); return $app->remoting_lib->getDataRecord($primary_id); } + + public function mail_user_filter_add($session_id, $client_id, $params) + { + global $app; + if (!$this->checkPerm($session_id, 'mail_user_filter_add')){ + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->insertQuery('../mail/form/mail_user_filter.tform.php', $client_id, $params,'mail:mail_user_filter:on_after_insert'); + // $app->plugin->raiseEvent('mail:mail_user_filter:on_after_insert',$this); + return $affected_rows; + } - //* Add a record - public function domains_domain_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'domains_domain_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + public function mail_user_filter_update($session_id, $client_id, $primary_id, $params) + { + global $app; + if (!$this->checkPerm($session_id, 'mail_user_filter_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); return false; } - return $this->insertQuery('../domain/form/domain.tform.php',$client_id,$params); + $affected_rows = $this->updateQuery('../mail/form/mail_user_filter.tform.php', $client_id, $primary_id, $params,'mail:mail_user_filter:on_after_update'); + // $app->plugin->raiseEvent('mail:mail_user_filter:on_after_update',$this); + return $affected_rows; } - //* Delete a record - public function domains_domain_delete($session_id, $primary_id) + public function mail_user_filter_delete($session_id, $primary_id) + { + global $app; + if (!$this->checkPerm($session_id, 'mail_user_filter_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/mail_user_filter.tform.php', $primary_id); + $app->plugin->raiseEvent('mail:mail_user_filter:on_after_delete',$this); + return $affected_rows; + } + + //* Get alias details + public function mail_alias_get($session_id, $primary_id) { - if(!$this->checkPerm($session_id, 'domains_domain_delete')) { + global $app; + + if(!$this->checkPerm($session_id, 'mail_alias_get')) { $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); return false; } - $affected_rows = $this->deleteQuery('../domain/form/domain.tform.php',$primary_id); + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/mail_alias.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* aliasy email + public function mail_alias_add($session_id, $client_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_alias_add')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->insertQuery('../mail/form/mail_alias.tform.php', $client_id, $params); return $affected_rows; } -// ----------------------------------------------------------------------------------------------- - public function domains_get_all_by_user($session_id, $group_id) + public function mail_alias_update($session_id, $client_id, $primary_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_alias_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/mail_alias.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + public function mail_alias_delete($session_id, $primary_id) + { + if (!$this->checkPerm($session_id, 'mail_alias_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/mail_alias.tform.php', $primary_id); + return $affected_rows; + } + + //* Get mail forwarding details + public function mail_forward_get($session_id, $primary_id) { - global $app; - if(!$this->checkPerm($session_id, 'domains_get_all_by_user')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; + global $app; + + if(!$this->checkPerm($session_id, 'mail_forward_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; } - $group_id = intval($group_id); - $sql = "SELECT domain_id, domain FROM domain WHERE sys_groupid = $group_id "; - $all = $app->db->queryAllRecords($sql); - return $all; + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/mail_forward.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); } - - // DNS Function -------------------------------------------------------------------------------------------------- - - //* Get record details - public function dns_zone_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'dns_zone_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../dns/form/dns_soa.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function dns_zone_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_zone_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../dns/form/dns_soa.tform.php',$client_id,$params); - } - - //* Update a record - public function dns_zone_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_zone_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../dns/form/dns_soa.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function dns_zone_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'dns_zone_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../dns/form/dns_soa.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------------- - - //* Get record details - public function dns_aaaa_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'dns_aaaa_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../dns/form/dns_aaaa.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function dns_aaaa_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_aaaa_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../dns/form/dns_aaaa.tform.php',$client_id,$params); - } - - //* Update a record - public function dns_aaaa_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_aaaa_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../dns/form/dns_aaaa.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function dns_aaaa_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'dns_aaaa_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../dns/form/dns_aaaa.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------------- - - //* Get record details - public function dns_a_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'dns_a_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../dns/form/dns_a.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function dns_a_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_a_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../dns/form/dns_a.tform.php',$client_id,$params); - } - - //* Update a record - public function dns_a_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_a_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../dns/form/dns_a.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function dns_a_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'dns_a_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../dns/form/dns_a.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------------- - - //* Get record details - public function dns_alias_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'dns_alias_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../dns/form/dns_alias.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function dns_alias_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_alias_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../dns/form/dns_alias.tform.php',$client_id,$params); - } - - //* Update a record - public function dns_alias_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_alias_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../dns/form/dns_alias.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function dns_alias_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'dns_alias_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../dns/form/dns_alias.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------------- - - //* Get record details - public function dns_cname_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'dns_cname_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../dns/form/dns_cname.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function dns_cname_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_cname_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../dns/form/dns_cname.tform.php',$client_id,$params); - } - - //* Update a record - public function dns_cname_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_cname_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../dns/form/dns_cname.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function dns_cname_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'dns_cname_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../dns/form/dns_cname.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------------- - - //* Get record details - public function dns_hinfo_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'dns_hinfo_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../dns/form/dns_hinfo.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function dns_hinfo_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_hinfo_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../dns/form/dns_hinfo.tform.php',$client_id,$params); - } - - //* Update a record - public function dns_hinfo_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_hinfo_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../dns/form/dns_hinfo.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function dns_hinfo_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'dns_hinfo_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../dns/form/dns_hinfo.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------------- - - //* Get record details - public function dns_mx_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'dns_mx_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../dns/form/dns_mx.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function dns_mx_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_mx_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../dns/form/dns_mx.tform.php',$client_id,$params); - } - - //* Update a record - public function dns_mx_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_mx_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../dns/form/dns_mx.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function dns_mx_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'dns_mx_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../dns/form/dns_mx.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------------- - - //* Get record details - public function dns_ns_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'dns_ns_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../dns/form/dns_ns.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function dns_ns_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_ns_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../dns/form/dns_ns.tform.php',$client_id,$params); - } - - //* Update a record - public function dns_ns_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_ns_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../dns/form/dns_ns.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function dns_ns_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'dns_ns_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../dns/form/dns_ns.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------------- - - //* Get record details - public function dns_ptr_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'dns_ptr_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../dns/form/dns_ptr.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function dns_ptr_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_ptr_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../dns/form/dns_ptr.tform.php',$client_id,$params); - } - - //* Update a record - public function dns_ptr_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_ptr_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../dns/form/dns_ptr.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function dns_ptr_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'dns_ptr_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../dns/form/dns_ptr.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------------- - - //* Get record details - public function dns_rp_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'dns_rp_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../dns/form/dns_rp.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function dns_rp_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_rp_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../dns/form/dns_rp.tform.php',$client_id,$params); - } - - //* Update a record - public function dns_rp_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_rp_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../dns/form/dns_rp.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function dns_rp_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'dns_rp_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../dns/form/dns_rp.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------------- - - //* Get record details - public function dns_srv_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'dns_srv_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../dns/form/dns_srv.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function dns_srv_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_srv_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../dns/form/dns_srv.tform.php',$client_id,$params); - } - - //* Update a record - public function dns_srv_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_srv_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../dns/form/dns_srv.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function dns_srv_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'dns_srv_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../dns/form/dns_srv.tform.php',$primary_id); - return $affected_rows; - } - - // ---------------------------------------------------------------------------------------------------------------- - - //* Get record details - public function dns_txt_get($session_id, $primary_id) - { - global $app; - - if(!$this->checkPerm($session_id, 'dns_txt_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $app->uses('remoting_lib'); - $app->remoting_lib->loadFormDef('../dns/form/dns_txt.tform.php'); - return $app->remoting_lib->getDataRecord($primary_id); - } - - //* Add a record - public function dns_txt_add($session_id, $client_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_txt_add')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return $this->insertQuery('../dns/form/dns_txt.tform.php',$client_id,$params); - } - - //* Update a record - public function dns_txt_update($session_id, $client_id, $primary_id, $params) - { - if(!$this->checkPerm($session_id, 'dns_txt_update')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->updateQuery('../dns/form/dns_txt.tform.php',$client_id,$primary_id,$params); - return $affected_rows; - } - - //* Delete a record - public function dns_txt_delete($session_id, $primary_id) - { - if(!$this->checkPerm($session_id, 'dns_txt_delete')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $affected_rows = $this->deleteQuery('../dns/form/dns_txt.tform.php',$primary_id); - return $affected_rows; - } - - - - - - - - - - - - - - //** private functions ----------------------------------------------------------------------------------- - - - - - private function klientadd($formdef_file, $reseller_id, $params) - { - global $app, $tform, $remoting_lib; - $app->uses('remoting_lib'); - - //* Load the form definition - $app->remoting_lib->loadFormDef($formdef_file); - - //* load the user profile of the client - $app->remoting_lib->loadUserProfile($reseller_id); - - //* load the client template - if(isset($params['template_master']) and $params['template_master'] > 0) - { - $template=$app->db->queryOneRecord("SELECT * FROM client_template WHERE template_id=".intval($params['template_master'])); - $params=array_merge($params,$template); - } - - //* Get the SQL query - $sql = $app->remoting_lib->getSQL($params,'INSERT',0); - if($app->remoting_lib->errorMessage != '') { - $this->server->fault('data_processing_error', $app->remoting_lib->errorMessage); - return false; - } - - $app->db->query($sql); - - if($app->db->errorMessage != '') { - $this->server->fault('database_error', $app->db->errorMessage . ' '.$sql); - return false; - } - - - - $insert_id = $app->db->insertID(); - //$app->uses('tform'); - //* Save changes to Datalog - if($app->remoting_lib->formDef["db_history"] == 'yes') { - $new_rec = $app->remoting_lib->getDataRecord($insert_id); - $app->remoting_lib->datalogSave('INSERT',$primary_id,array(),$new_rec); - $app->remoting_lib->ispconfig_sysuser_add($params,$insert_id); - - if($reseller_id) { - $client_group = $app->db->queryOneRecord("SELECT * FROM sys_group WHERE client_id = ".$insert_id); - $reseller_user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE client_id = ".$reseller_id); - $app->auth->add_group_to_user($reseller_user['userid'], $client_group['groupid']); - $app->db->query("UPDATE client SET parent_client_id = ".$reseller_id." WHERE client_id = ".$insert_id); - } - - } - return $insert_id; - } - - private function insertQuery($formdef_file, $client_id, $params,$event_identifier = '') - { - global $app, $tform, $remoting_lib; - - $app->uses('remoting_lib'); - - //* load the user profile of the client - $app->remoting_lib->loadUserProfile($client_id); - - //* Load the form definition - $app->remoting_lib->loadFormDef($formdef_file); - - //* Get the SQL query - $sql = $app->remoting_lib->getSQL($params,'INSERT',0); - if($app->remoting_lib->errorMessage != '') { - $this->server->fault('data_processing_error', $app->remoting_lib->errorMessage); - return false; - } - - $app->db->query($sql); - - if($app->db->errorMessage != '') { - $this->server->fault('database_error', $app->db->errorMessage . ' '.$sql); - return false; - } - - $insert_id = $app->db->insertID(); - - // set a few values for compatibility with tform actions, mostly used by plugins - $this->id = $insert_id; - $this->dataRecord = $params; - - if($event_identifier != '') $app->plugin->raiseEvent($event_identifier,$this); - - //$app->uses('tform'); - //* Save changes to Datalog - if($app->remoting_lib->formDef["db_history"] == 'yes') { - $new_rec = $app->remoting_lib->getDataRecord($insert_id); - $app->remoting_lib->datalogSave('INSERT',$primary_id,array(),$new_rec); - } - return $insert_id; - } - - - private function updateQuery($formdef_file, $client_id, $primary_id, $params, $event_identifier = '') - { - global $app; - - $app->uses('remoting_lib'); - - //* load the user profile of the client - $app->remoting_lib->loadUserProfile($client_id); - - //* Load the form definition - $app->remoting_lib->loadFormDef($formdef_file); - - //* Get the SQL query - $sql = $app->remoting_lib->getSQL($params,'UPDATE',$primary_id); - if($app->remoting_lib->errorMessage != '') { - $this->server->fault('data_processing_error', $app->remoting_lib->errorMessage); - return false; - } - - $old_rec = $app->remoting_lib->getDataRecord($primary_id); - - // set a few values for compatibility with tform actions, mostly used by plugins - $this->oldDataRecord = $old_rec; - $this->id = $primary_id; - $this->dataRecord = $params; - - $app->db->query($sql); - - if($app->db->errorMessage != '') { - $this->server->fault('database_error', $app->db->errorMessage . ' '.$sql); - return false; - } - - $affected_rows = $app->db->affectedRows(); - - if($event_identifier != '') $app->plugin->raiseEvent($event_identifier,$this); - - //* Save changes to Datalog - if($app->remoting_lib->formDef["db_history"] == 'yes') { - $new_rec = $app->remoting_lib->getDataRecord($primary_id); - $app->remoting_lib->datalogSave('UPDATE',$primary_id,$old_rec,$new_rec); - } - - return $affected_rows; - } - - private function deleteQuery($formdef_file, $primary_id) - { - global $app; - - $app->uses('remoting_lib'); - - //* load the user profile of the client - $app->remoting_lib->loadUserProfile(0); - - //* Load the form definition - $app->remoting_lib->loadFormDef($formdef_file); - - $old_rec = $app->remoting_lib->getDataRecord($primary_id); - - // set a few values for compatibility with tform actions, mostly used by plugins - $this->oldDataRecord = $old_rec; - $this->id = $primary_id; - $this->dataRecord = $params; - - //* Get the SQL query - $sql = $app->remoting_lib->getDeleteSQL($primary_id); - - $app->db->query($sql); - - if($app->db->errorMessage != '') { - $this->server->fault('database_error', $app->db->errorMessage . ' '.$sql); - return false; - } - - $affected_rows = $app->db->affectedRows(); - - //* Save changes to Datalog - if($app->remoting_lib->formDef["db_history"] == 'yes') { - $app->remoting_lib->datalogSave('DELETE',$primary_id,$old_rec,array()); - } - - - return $affected_rows; - } - - - private function checkPerm($session_id, $function_name) - { - $dobre=array(); - $session = $this->getSession($session_id); - if(!$session){ - return false; - } - - $dobre= str_replace(';',',',$session['remote_functions']); - return in_array($function_name, explode(',', $dobre) ); - } - - - private function getSession($session_id) - { - global $app; - - if(empty($session_id)) { - $this->server->fault('session_id_empty','The SessionID is empty.'); - return false; - } - - $session_id = $app->db->quote($session_id); - - $now = time(); - $sql = "SELECT * FROM remote_session WHERE remote_session = '$session_id' AND tstamp >= $now"; - $session = $app->db->queryOneRecord($sql); - if($session['remote_userid'] > 0) { - return $session; - } else { - $this->server->fault('session_does_not_exist','The Session is expired or does not exist.'); - return false; - } - } - - //--- - - - /** - * Gets sites by $sys_userid & $sys_groupid - * @param int session id - * @param int user id - * @param array list of groups - * @return mixed array with sites by user - * @author Julio Montoya BeezNest 2010 - */ - public function client_get_sites_by_user($session_id, $sys_userid, $sys_groupid) { - global $app; - if(!$this->checkPerm($session_id, 'client_get_sites_by_user')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $sys_userid = intval($sys_userid); - $sys_groupid = explode(',', $sys_groupid); - $new_group = array(); - foreach($sys_groupid as $group_id) { - $new_group[] = intval( $group_id); - } - $group_list = implode(',', $new_group); - $sql ="SELECT domain, domain_id, document_root, active FROM web_domain WHERE ( (sys_userid = $sys_userid AND sys_perm_user LIKE '%r%') OR (sys_groupid IN ($group_list) AND sys_perm_group LIKE '%r%') OR sys_perm_other LIKE '%r%') AND type = 'vhost'"; - $result = $app->db->queryAllRecords($sql); - if(isset($result)) { - return $result; - } else { - $this->server->fault('no_client_found', 'There is no site for this user'); - return false; - } - } - - /** - * Change domains status - * @param int session id - * @param int site id - * @param string active or inactive string - * @return mixed false if error - * @author Julio Montoya BeezNest 2010 - */ - - public function sites_web_domain_set_status($session_id, $primary_id, $status) { - global $app; - if(!$this->checkPerm($session_id, 'sites_web_domain_set_status')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - if(in_array($status, array('active', 'inactive'))) { - if ($status == 'active') { - $status = 'y'; - } else { - $status = 'n'; - } - $sql = "UPDATE web_domain SET active = '$status' WHERE domain_id = ".intval($primary_id); - $app->db->query($sql); - $result = $app->db->affectedRows(); - return $result; - } else { - $this->server->fault('status_undefined', 'The status is not available'); - return false; - } - } - - /** - * Get sys_user information by username - * @param int session id - * @param string user's name - * @return mixed false if error - * @author Julio Montoya BeezNest 2010 - */ - public function client_get_by_username($session_id, $username) { - global $app; - if(!$this->checkPerm($session_id, 'client_get_by_username')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $username = $app->db->quote($username); - $rec = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE username = '".$username."'"); - if (isset($rec)) { - return $rec; - } else { - $this->server->fault('no_client_found', 'There is no user account for this user name.'); - return false; - } - } - - /** - * Changes client password - * - * @param int session id - * @param int client id - * @param string new password - * @return bool true if success - * @author Julio Montoya BeezNest 2010 - * - */ - public function client_change_password($session_id, $client_id, $new_password) { - global $app; - - if(!$this->checkPerm($session_id, 'client_change_password')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $client_id = intval($client_id); - $client = $app->db->queryOneRecord("SELECT client_id FROM client WHERE client_id = ".$client_id); - if($client['client_id'] > 0) { - $new_password = $app->db->quote($new_password); - $sql = "UPDATE client SET password = md5('".($new_password)."') WHERE client_id = ".$client_id; - $app->db->query($sql); - $sql = "UPDATE sys_user SET passwort = md5('".($new_password)."') WHERE client_id = ".$client_id; - $app->db->query($sql); - return true; - } else { - $this->server->fault('no_client_found', 'There is no user account for this client_id'); - return false; - } - } - - public function mail_domain_get_by_domain($session_id, $domain) { - global $app; - if(!$this->checkPerm($session_id, 'mail_domain_get_by_domain')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - if (!empty($domain_id)) { - $domain = $app->db->quote($domain); - $sql = "SELECT * FROM mail_domain WHERE domain = $domain"; - $result = $app->db->queryAllRecords($sql); - return $result; - } - return false; - } - - - - /** - * Get a list of functions - * @param int session id - * @return mixed array of the available functions - * @author Julio Montoya BeezNest 2010 - */ - public function get_function_list($session_id) - { - if(!$this->checkPerm($session_id, 'get_function_list')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - return get_class_methods($this); - } - - /** - * Get all databases by user - * @author Julio Montoya BeezNest 2010 - */ - public function sites_database_get_all_by_user($session_id, $client_id) - { - global $app; - if(!$this->checkPerm($session_id, 'sites_database_get_all_by_user')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $client_id = intval($client_id); - $sql = "SELECT database_id, database_name, database_user, database_password FROM web_database WHERE sys_userid = $client_id "; - $all = $app->db->queryAllRecords($sql); - return $all; - } - - /** - * Get all client templates - * @param int session id - * @author Julio Montoya BeezNest 2010 - */ - public function client_templates_get_all($session_id) { - global $app; - if(!$this->checkPerm($session_id, 'client_templates_get_all')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - $sql = "SELECT * FROM client_template"; - $result = $app->db->queryAllRecords($sql); - return $result; - } - - /** - * Get all DNS zone by user - *@author Julio Montoya BeezNest 2010 - */ - public function dns_zone_get_by_user($session_id, $client_id, $server_id) { - global $app; - if(!$this->checkPerm($session_id, 'dns_zone_get')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - if (!empty($client_id) && !empty($server_id)) { - $server_id = intval($server_id); - $client_id = intval($client_id); - $sql = "SELECT id, origin FROM dns_soa d INNER JOIN sys_user s on(d.sys_groupid = s.default_group) WHERE client_id = $client_id AND server_id = $server_id"; - $result = $app->db->queryAllRecords($sql); - return $result; - } - return false; - } - - - /** - * Changes DNS zone status - * @param int session id - * @param int dns soa id - * @param string status active or inactive string - * @author Julio Montoya BeezNest 2010 - */ - - public function dns_zone_set_status($session_id, $primary_id, $status) { - global $app; - if(!$this->checkPerm($session_id, 'dns_zone_set_status')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - if(in_array($status, array('active', 'inactive'))) { - if ($status == 'active') { - $status = 'Y'; - } else { - $status = 'N'; - } - $sql = "UPDATE dns_soa SET active = '$status' WHERE id = ".intval($primary_id); - $app->db->query($sql); - $result = $app->db->affectedRows(); - return $result; - } else { - $this->server->fault('status_undefined', 'The status is not available'); - return false; - } - } - - public function mail_domain_set_status($session_id, $primary_id, $status) { - global $app; - if(!$this->checkPerm($session_id, 'mail_domain_set_status')) { - $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - if(in_array($status, array('active', 'inactive'))) { - if ($status == 'active') { - $status = 'y'; - } else { - $status = 'n'; - } - $sql = "UPDATE mail_domain SET active = '$status' WHERE domain_id = ".intval($primary_id); - $app->db->query($sql); - $result = $app->db->affectedRows(); - return $result; - } else { - $this->server->fault('status_undefined', 'The status is not available'); - return false; - } - } -} + //* przekierowania email + public function mail_forward_add($session_id, $client_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_forward_add')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->insertQuery('../mail/form/mail_forward.tform.php', $client_id, $params); + return $affected_rows; + } + + + public function mail_forward_update($session_id, $client_id, $primary_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_forward_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/mail_forward.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + + public function mail_forward_delete($session_id, $primary_id) + { + if (!$this->checkPerm($session_id, 'mail_forward_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/mail_forward.tform.php', $primary_id); + return $affected_rows; + } + + //* Get catchall details + public function mail_catchall_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'mail_catchall_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/mail_domain_catchall.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* catchall e-mail + public function mail_catchall_add($session_id, $client_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_catchall_add')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->insertQuery('../mail/form/mail_domain_catchall.tform.php', $client_id, $params); + return $affected_rows; + } + + public function mail_catchall_update($session_id, $client_id, $primary_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_catchall_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/mail_domain_catchall.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + public function mail_catchall_delete($session_id, $primary_id) + { + if (!$this->checkPerm($session_id, 'mail_catchall_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/mail_domain_catchall.tform.php', $primary_id); + return $affected_rows; + } + + //* Get transport details + public function mail_transport_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'mail_transport_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/mail_transport.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* przeniesienia e-mail + public function mail_transport_add($session_id, $client_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_transport_add')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->insertQuery('../mail/form/mail_transport.tform.php', $client_id, $params); + return $affected_rows; + } + + + public function mail_transport_update($session_id, $client_id, $primary_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_transport_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/mail_transport.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + + public function mail_transport_delete($session_id, $primary_id) + { + if (!$this->checkPerm($session_id, 'mail_transport_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/mail_transport.tform.php', $primary_id); + return $affected_rows; + } + + //* Get spamfilter whitelist details + public function mail_spamfilter_whitelist_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/spamfilter_whitelist.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* biała lista e-mail + public function mail_spamfilter_whitelist_add($session_id, $client_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_add')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->insertQuery('../mail/form/spamfilter_whitelist.tform.php', $client_id, $params); + return $affected_rows; + } + + + public function mail_spamfilter_whitelist_update($session_id, $client_id, $primary_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/spamfilter_whitelist.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + + public function mail_spamfilter_whitelist_delete($session_id, $primary_id) + { + if (!$this->checkPerm($session_id, 'mail_spamfilter_whitelist_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/spamfilter_whitelist.tform.php', $primary_id); + return $affected_rows; + } + + //* Get spamfilter blacklist details + public function mail_spamfilter_blacklist_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/spamfilter_blacklist.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* czarna lista e-mail + public function mail_spamfilter_blacklist_add($session_id, $client_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_add')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->insertQuery('../mail/form/spamfilter_blacklist.tform.php', $client_id, $params); + return $affected_rows; + } + + + public function mail_spamfilter_blacklist_update($session_id, $client_id, $primary_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/spamfilter_blacklist.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + + public function mail_spamfilter_blacklist_delete($session_id, $primary_id) + { + if (!$this->checkPerm($session_id, 'mail_spamfilter_blacklist_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/spamfilter_blacklist.tform.php', $primary_id); + return $affected_rows; + } + + //* Get spamfilter user details + public function mail_spamfilter_user_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'mail_spamfilter_user_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/spamfilter_users.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* filtr spamu użytkowników e-mail + public function mail_spamfilter_user_add($session_id, $client_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_spamfilter_user_add')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->insertQuery('../mail/form/spamfilter_users.tform.php', $client_id, $params); + return $affected_rows; + } + + + public function mail_spamfilter_user_update($session_id, $client_id, $primary_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_spamfilter_user_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/spamfilter_users.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + + public function mail_spamfilter_user_delete($session_id, $primary_id) + { + if (!$this->checkPerm($session_id, 'mail_spamfilter_user_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/spamfilter_users.tform.php', $primary_id); + return $affected_rows; + } + + //* Get policy details + public function mail_policy_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'mail_policy_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/spamfilter_policy.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* polityki filtrów spamu e-mail + public function mail_policy_add($session_id, $client_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_policy_add')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->insertQuery('../mail/form/spamfilter_policy.tform.php', $client_id, $params); + return $affected_rows; + } + + + public function mail_policy_update($session_id, $client_id, $primary_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_policy_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/spamfilter_policy.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + + public function mail_policy_delete($session_id, $primary_id) + { + if (!$this->checkPerm($session_id, 'mail_policy_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/spamfilter_policy.tform.php', $primary_id); + return $affected_rows; + } + + //* Get fetchmail details + public function mail_fetchmail_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'mail_fetchmail_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/mail_get.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* fetchmail + public function mail_fetchmail_add($session_id, $client_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_fetchmail_add')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->insertQuery('../mail/form/mail_get.tform.php', $client_id, $params); + return $affected_rows; + } + + + public function mail_fetchmail_update($session_id, $client_id, $primary_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_fetchmail_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/mail_get.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + + public function mail_fetchmail_delete($session_id, $primary_id) + { + if (!$this->checkPerm($session_id, 'mail_fetchmail_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/mail_get.tform.php', $primary_id); + return $affected_rows; + } + + //* Get whitelist details + public function mail_whitelist_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'mail_whitelist_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/mail_whitelist.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* wpisy białej listy + public function mail_whitelist_add($session_id, $client_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_whitelist_add')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->insertQuery('../mail/form/mail_whitelist.tform.php', $client_id, $params); + return $affected_rows; + } + + + public function mail_whitelist_update($session_id, $client_id, $primary_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_whitelist_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/mail_whitelist.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + + public function mail_whitelist_delete($session_id, $primary_id) + { + if (!$this->checkPerm($session_id, 'mail_whitelist_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/mail_whitelist.tform.php', $primary_id); + return $affected_rows; + } + + //* Get Blacklist details + public function mail_blacklist_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'mail_blacklist_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/mail_blacklist.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* wpisy białej listy + public function mail_blacklist_add($session_id, $client_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_blacklist_add')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->insertQuery('../mail/form/mail_blacklist.tform.php', $client_id, $params); + return $affected_rows; + } + + + public function mail_blacklist_update($session_id, $client_id, $primary_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_blacklist_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/mail_blacklist.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + + public function mail_blacklist_delete($session_id, $primary_id) + { + if (!$this->checkPerm($session_id, 'mail_blacklist_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/mail_blacklist.tform.php', $primary_id); + return $affected_rows; + } + + //* Get filter details + public function mail_filter_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'mail_filter_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/mail_content_filter.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* wpisy filtrow e-mail + public function mail_filter_add($session_id, $client_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_filter_add')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->insertQuery('../mail/form/mail_content_filter.tform.php', $client_id, $params); + return $affected_rows; + } + + + public function mail_filter_update($session_id, $client_id, $primary_id, $params) + { + if (!$this->checkPerm($session_id, 'mail_filter_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/mail_content_filter.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + + public function mail_filter_delete($session_id, $primary_id) + { + if (!$this->checkPerm($session_id, 'mail_filter_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/mail_content_filter.tform.php', $primary_id); + return $affected_rows; + } + + + + +/* + * + * + * + * * Client functions + * + * + */ + //* Get client details + public function client_get($session_id, $client_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'client_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../client/form/client.tform.php'); + return $app->remoting_lib->getDataRecord($client_id); + } + + public function client_get_id($session_id, $sys_userid) + { + global $app; + if(!$this->checkPerm($session_id, 'client_get_id')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + + $sys_userid = intval($sys_userid); + + $rec = $app->db->queryOneRecord("SELECT client_id FROM sys_user WHERE userid = ".$sys_userid); + if(isset($rec['client_id'])) { + return intval($rec['client_id']); + } else { + $this->server->fault('no_client_found', 'There is no sysuser account for this client ID.'); + return false; + } + + } + + + public function client_add($session_id, $reseller_id, $params) + { + if (!$this->checkPerm($session_id, 'client_add')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->klientadd('../client/form/client.tform.php',$reseller_id, $params); + return $affected_rows; + + } + + public function client_update($session_id, $client_id, $reseller_id, $params) + { + global $app; + + if (!$this->checkPerm($session_id, 'client_update')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../client/form/client.tform.php', $reseller_id, $client_id, $params); + + $app->remoting_lib->ispconfig_sysuser_update($params,$client_id); + + return $affected_rows; + } + + + public function client_delete($session_id,$client_id) + { + global $app; + + if (!$this->checkPerm($session_id, 'client_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../client/form/client.tform.php',$client_id); + + $app->remoting_lib->ispconfig_sysuser_delete($client_id); + + return $affected_rows; + } + + // ----------------------------------------------------------------------------------------------- + + public function client_delete_everything($session_id, $client_id) + { + global $app, $conf; + if(!$this->checkPerm($session_id, 'client_delete_everything')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $client_id = intval($client_id); + $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id"); + + $tables = 'client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_domain,web_traffic'; + $tables_array = explode(',',$tables); + $client_group_id = intval($client_group['groupid']); + + $table_list = array(); + if($client_group_id > 1) { + foreach($tables_array as $table) { + if($table != '') { + $records = $app->db->queryAllRecords("SELECT * FROM $table WHERE sys_groupid = ".$client_group_id); + $number = count($records); + if($number > 0) $table_list[] = array('table' => $table."(".$number.")"); + } + } + } + + + if($client_id > 0) { + // remove the group of the client from the resellers group + $parent_client_id = intval($this->dataRecord['parent_client_id']); + $parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = $parent_client_id"); + $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id"); + $app->auth->remove_group_from_user($parent_user['userid'],$client_group['groupid']); + + // delete the group of the client + $app->db->query("DELETE FROM sys_group WHERE client_id = $client_id"); + + // delete the sys user(s) of the client + $app->db->query("DELETE FROM sys_user WHERE client_id = $client_id"); + + // Delete all records (sub-clients, mail, web, etc....) of this client. + $tables = 'client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_domain,web_traffic'; + $tables_array = explode(',',$tables); + $client_group_id = intval($client_group['groupid']); + if($client_group_id > 1) { + foreach($tables_array as $table) { + if($table != '') { + $records = $app->db->queryAllRecords("SELECT * FROM $table WHERE sys_groupid = ".$client_group_id); + // find the primary ID of the table + $table_info = $app->db->tableInfo($table); + $index_field = ''; + foreach($table_info as $tmp) { + if($tmp['option'] == 'primary') $index_field = $tmp['name']; + } + // Delete the records + if($index_field != '') { + if(is_array($records)) { + foreach($records as $rec) { + $app->db->datalogDelete($table, $index_field, $rec[$index_field]); + } + } + } + + } + } + } + + + + } + + if (!$this->checkPerm($session_id, 'client_delete')) + { + $this->server->fault('permission_denied','You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../client/form/client.tform.php',$client_id); + + // $app->remoting_lib->ispconfig_sysuser_delete($client_id); + + + return false; + } + + // Website functions --------------------------------------------------------------------------------------- + + //* Get cron details + public function sites_cron_get($session_id, $cron_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'sites_cron_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../sites/form/cron.tform.php'); + return $app->remoting_lib->getDataRecord($cron_id); + } + + //* Add a cron record + public function sites_cron_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'sites_cron_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../sites/form/cron.tform.php',$client_id,$params); + } + + //* Update cron record + public function sites_cron_update($session_id, $client_id, $cron_id, $params) + { + if(!$this->checkPerm($session_id, 'sites_cron_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../sites/form/cron.tform.php',$client_id,$cron_id,$params); + return $affected_rows; + } + + //* Delete cron record + public function sites_cron_delete($session_id, $cron_id) + { + if(!$this->checkPerm($session_id, 'sites_cron_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../sites/form/cron.tform.php',$cron_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------- + + //* Get record details + public function sites_database_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'sites_database_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../sites/form/database.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function sites_database_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'sites_database_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../sites/form/database.tform.php',$client_id,$params); + } + + //* Update a record + public function sites_database_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'sites_database_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../sites/form/database.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function sites_database_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'sites_database_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../sites/form/database.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------- + + //* Get record details + public function sites_ftp_user_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'sites_ftp_user_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../sites/form/ftp_user.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function sites_ftp_user_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'sites_ftp_user_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../sites/form/ftp_user.tform.php',$client_id,$params); + } + + //* Update a record + public function sites_ftp_user_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'sites_ftp_user_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../sites/form/ftp_user.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function sites_ftp_user_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'sites_ftp_user_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../sites/form/ftp_user.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------- + + //* Get record details + public function sites_shell_user_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'sites_shell_user_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../sites/form/shell_user.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function sites_shell_user_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'sites_shell_user_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../sites/form/shell_user.tform.php',$client_id,$params); + } + + //* Update a record + public function sites_shell_user_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'sites_shell_user_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../sites/form/shell_user.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function sites_shell_user_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'sites_shell_user_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../sites/form/shell_user.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------- + + //* Get record details + public function sites_web_domain_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'sites_web_domain_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../sites/form/web_domain.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function sites_web_domain_add($session_id, $client_id, $params, $readonly = false) + { + global $app; + if(!$this->checkPerm($session_id, 'sites_web_domain_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $domain_id = $this->insertQuery('../sites/form/web_domain.tform.php',$client_id,$params, 'sites:web_domain:on_after_insert'); + if ($readonly === true) + $app->db->query("UPDATE web_domain SET `sys_userid` = '1' WHERE domain_id = ".$domain_id); + return $domain_id; + } + + //* Update a record + public function sites_web_domain_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'sites_web_domain_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../sites/form/web_domain.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function sites_web_domain_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'sites_web_domain_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../sites/form/web_domain.tform.php',$primary_id); + return $affected_rows; + } + + // ----------------------------------------------------------------------------------------------- + + //* Get record details + public function sites_web_aliasdomain_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../sites/form/web_aliasdomain.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function sites_web_aliasdomain_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../sites/form/web_aliasdomain.tform.php',$client_id,$params); + } + + //* Update a record + public function sites_web_aliasdomain_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../sites/form/web_aliasdomain.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function sites_web_aliasdomain_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../sites/form/web_aliasdomain.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------- + + //* Get record details + public function sites_web_subdomain_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'sites_web_subdomain_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../sites/form/web_subdomain.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function sites_web_subdomain_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'sites_web_subdomain_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../sites/form/web_subdomain.tform.php',$client_id,$params); + } + + //* Update a record + public function sites_web_subdomain_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'sites_web_subdomain_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../sites/form/web_subdomain.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function sites_web_subdomain_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'sites_web_subdomain_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../sites/form/web_subdomain.tform.php',$primary_id); + return $affected_rows; + } + + // ----------------------------------------------------------------------------------------------- + + //* Get record details + public function domains_domain_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'domains_domain_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../domain/form/domain.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function domains_domain_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'domains_domain_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../domain/form/domain.tform.php',$client_id,$params); + } + + //* Delete a record + public function domains_domain_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'domains_domain_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../domain/form/domain.tform.php',$primary_id); + return $affected_rows; + } + +// ----------------------------------------------------------------------------------------------- + + public function domains_get_all_by_user($session_id, $group_id) + { + global $app; + if(!$this->checkPerm($session_id, 'domains_get_all_by_user')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $group_id = intval($group_id); + $sql = "SELECT domain_id, domain FROM domain WHERE sys_groupid = $group_id "; + $all = $app->db->queryAllRecords($sql); + return $all; + } + + + // DNS Function -------------------------------------------------------------------------------------------------- + + //* Get record details + public function dns_zone_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'dns_zone_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../dns/form/dns_soa.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function dns_zone_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_zone_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../dns/form/dns_soa.tform.php',$client_id,$params); + } + + //* Update a record + public function dns_zone_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_zone_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../dns/form/dns_soa.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function dns_zone_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'dns_zone_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../dns/form/dns_soa.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------------- + + //* Get record details + public function dns_aaaa_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'dns_aaaa_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../dns/form/dns_aaaa.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function dns_aaaa_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_aaaa_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../dns/form/dns_aaaa.tform.php',$client_id,$params); + } + + //* Update a record + public function dns_aaaa_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_aaaa_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../dns/form/dns_aaaa.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function dns_aaaa_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'dns_aaaa_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../dns/form/dns_aaaa.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------------- + + //* Get record details + public function dns_a_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'dns_a_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../dns/form/dns_a.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function dns_a_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_a_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../dns/form/dns_a.tform.php',$client_id,$params); + } + + //* Update a record + public function dns_a_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_a_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../dns/form/dns_a.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function dns_a_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'dns_a_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../dns/form/dns_a.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------------- + + //* Get record details + public function dns_alias_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'dns_alias_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../dns/form/dns_alias.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function dns_alias_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_alias_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../dns/form/dns_alias.tform.php',$client_id,$params); + } + + //* Update a record + public function dns_alias_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_alias_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../dns/form/dns_alias.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function dns_alias_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'dns_alias_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../dns/form/dns_alias.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------------- + + //* Get record details + public function dns_cname_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'dns_cname_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../dns/form/dns_cname.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function dns_cname_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_cname_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../dns/form/dns_cname.tform.php',$client_id,$params); + } + + //* Update a record + public function dns_cname_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_cname_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../dns/form/dns_cname.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function dns_cname_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'dns_cname_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../dns/form/dns_cname.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------------- + + //* Get record details + public function dns_hinfo_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'dns_hinfo_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../dns/form/dns_hinfo.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function dns_hinfo_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_hinfo_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../dns/form/dns_hinfo.tform.php',$client_id,$params); + } + + //* Update a record + public function dns_hinfo_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_hinfo_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../dns/form/dns_hinfo.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function dns_hinfo_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'dns_hinfo_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../dns/form/dns_hinfo.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------------- + + //* Get record details + public function dns_mx_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'dns_mx_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../dns/form/dns_mx.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function dns_mx_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_mx_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../dns/form/dns_mx.tform.php',$client_id,$params); + } + + //* Update a record + public function dns_mx_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_mx_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../dns/form/dns_mx.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function dns_mx_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'dns_mx_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../dns/form/dns_mx.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------------- + + //* Get record details + public function dns_ns_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'dns_ns_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../dns/form/dns_ns.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function dns_ns_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_ns_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../dns/form/dns_ns.tform.php',$client_id,$params); + } + + //* Update a record + public function dns_ns_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_ns_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../dns/form/dns_ns.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function dns_ns_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'dns_ns_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../dns/form/dns_ns.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------------- + + //* Get record details + public function dns_ptr_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'dns_ptr_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../dns/form/dns_ptr.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function dns_ptr_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_ptr_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../dns/form/dns_ptr.tform.php',$client_id,$params); + } + + //* Update a record + public function dns_ptr_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_ptr_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../dns/form/dns_ptr.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function dns_ptr_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'dns_ptr_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../dns/form/dns_ptr.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------------- + + //* Get record details + public function dns_rp_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'dns_rp_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../dns/form/dns_rp.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function dns_rp_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_rp_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../dns/form/dns_rp.tform.php',$client_id,$params); + } + + //* Update a record + public function dns_rp_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_rp_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../dns/form/dns_rp.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function dns_rp_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'dns_rp_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../dns/form/dns_rp.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------------- + + //* Get record details + public function dns_srv_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'dns_srv_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../dns/form/dns_srv.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function dns_srv_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_srv_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../dns/form/dns_srv.tform.php',$client_id,$params); + } + + //* Update a record + public function dns_srv_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_srv_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../dns/form/dns_srv.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function dns_srv_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'dns_srv_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../dns/form/dns_srv.tform.php',$primary_id); + return $affected_rows; + } + + // ---------------------------------------------------------------------------------------------------------------- + + //* Get record details + public function dns_txt_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'dns_txt_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../dns/form/dns_txt.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + //* Add a record + public function dns_txt_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_txt_add')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return $this->insertQuery('../dns/form/dns_txt.tform.php',$client_id,$params); + } + + //* Update a record + public function dns_txt_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'dns_txt_update')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../dns/form/dns_txt.tform.php',$client_id,$primary_id,$params); + return $affected_rows; + } + + //* Delete a record + public function dns_txt_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'dns_txt_delete')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../dns/form/dns_txt.tform.php',$primary_id); + return $affected_rows; + } + + + + + + + + + + + + + + //** private functions ----------------------------------------------------------------------------------- + + + + + private function klientadd($formdef_file, $reseller_id, $params) + { + global $app, $tform, $remoting_lib; + $app->uses('remoting_lib'); + + //* Load the form definition + $app->remoting_lib->loadFormDef($formdef_file); + + //* load the user profile of the client + $app->remoting_lib->loadUserProfile($reseller_id); + + //* load the client template + if(isset($params['template_master']) and $params['template_master'] > 0) + { + $template=$app->db->queryOneRecord("SELECT * FROM client_template WHERE template_id=".intval($params['template_master'])); + $params=array_merge($params,$template); + } + + //* Get the SQL query + $sql = $app->remoting_lib->getSQL($params,'INSERT',0); + if($app->remoting_lib->errorMessage != '') { + $this->server->fault('data_processing_error', $app->remoting_lib->errorMessage); + return false; + } + + $app->db->query($sql); + + if($app->db->errorMessage != '') { + $this->server->fault('database_error', $app->db->errorMessage . ' '.$sql); + return false; + } + + + + $insert_id = $app->db->insertID(); + //$app->uses('tform'); + //* Save changes to Datalog + if($app->remoting_lib->formDef["db_history"] == 'yes') { + $new_rec = $app->remoting_lib->getDataRecord($insert_id); + $app->remoting_lib->datalogSave('INSERT',$primary_id,array(),$new_rec); + $app->remoting_lib->ispconfig_sysuser_add($params,$insert_id); + + if($reseller_id) { + $client_group = $app->db->queryOneRecord("SELECT * FROM sys_group WHERE client_id = ".$insert_id); + $reseller_user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE client_id = ".$reseller_id); + $app->auth->add_group_to_user($reseller_user['userid'], $client_group['groupid']); + $app->db->query("UPDATE client SET parent_client_id = ".$reseller_id." WHERE client_id = ".$insert_id); + } + + } + return $insert_id; + } + + private function insertQuery($formdef_file, $client_id, $params,$event_identifier = '') + { + global $app, $tform, $remoting_lib; + + $app->uses('remoting_lib'); + + //* load the user profile of the client + $app->remoting_lib->loadUserProfile($client_id); + + //* Load the form definition + $app->remoting_lib->loadFormDef($formdef_file); + + //* Get the SQL query + $sql = $app->remoting_lib->getSQL($params,'INSERT',0); + if($app->remoting_lib->errorMessage != '') { + $this->server->fault('data_processing_error', $app->remoting_lib->errorMessage); + return false; + } + + $app->db->query($sql); + + if($app->db->errorMessage != '') { + $this->server->fault('database_error', $app->db->errorMessage . ' '.$sql); + return false; + } + + $insert_id = $app->db->insertID(); + + // set a few values for compatibility with tform actions, mostly used by plugins + $this->id = $insert_id; + $this->dataRecord = $params; + + if($event_identifier != '') $app->plugin->raiseEvent($event_identifier,$this); + + //$app->uses('tform'); + //* Save changes to Datalog + if($app->remoting_lib->formDef["db_history"] == 'yes') { + $new_rec = $app->remoting_lib->getDataRecord($insert_id); + $app->remoting_lib->datalogSave('INSERT',$primary_id,array(),$new_rec); + } + return $insert_id; + } + + + private function updateQuery($formdef_file, $client_id, $primary_id, $params, $event_identifier = '') + { + global $app; + + $app->uses('remoting_lib'); + + //* load the user profile of the client + $app->remoting_lib->loadUserProfile($client_id); + + //* Load the form definition + $app->remoting_lib->loadFormDef($formdef_file); + + //* Get the SQL query + $sql = $app->remoting_lib->getSQL($params,'UPDATE',$primary_id); + if($app->remoting_lib->errorMessage != '') { + $this->server->fault('data_processing_error', $app->remoting_lib->errorMessage); + return false; + } + + $old_rec = $app->remoting_lib->getDataRecord($primary_id); + + // set a few values for compatibility with tform actions, mostly used by plugins + $this->oldDataRecord = $old_rec; + $this->id = $primary_id; + $this->dataRecord = $params; + + $app->db->query($sql); + + if($app->db->errorMessage != '') { + $this->server->fault('database_error', $app->db->errorMessage . ' '.$sql); + return false; + } + + $affected_rows = $app->db->affectedRows(); + + if($event_identifier != '') $app->plugin->raiseEvent($event_identifier,$this); + + //* Save changes to Datalog + if($app->remoting_lib->formDef["db_history"] == 'yes') { + $new_rec = $app->remoting_lib->getDataRecord($primary_id); + $app->remoting_lib->datalogSave('UPDATE',$primary_id,$old_rec,$new_rec); + } + + return $affected_rows; + } + + private function deleteQuery($formdef_file, $primary_id) + { + global $app; + + $app->uses('remoting_lib'); + + //* load the user profile of the client + $app->remoting_lib->loadUserProfile(0); + + //* Load the form definition + $app->remoting_lib->loadFormDef($formdef_file); + + $old_rec = $app->remoting_lib->getDataRecord($primary_id); + + // set a few values for compatibility with tform actions, mostly used by plugins + $this->oldDataRecord = $old_rec; + $this->id = $primary_id; + $this->dataRecord = $params; + + //* Get the SQL query + $sql = $app->remoting_lib->getDeleteSQL($primary_id); + + $app->db->query($sql); + + if($app->db->errorMessage != '') { + $this->server->fault('database_error', $app->db->errorMessage . ' '.$sql); + return false; + } + + $affected_rows = $app->db->affectedRows(); + + //* Save changes to Datalog + if($app->remoting_lib->formDef["db_history"] == 'yes') { + $app->remoting_lib->datalogSave('DELETE',$primary_id,$old_rec,array()); + } + + + return $affected_rows; + } + + + private function checkPerm($session_id, $function_name) + { + $dobre=array(); + $session = $this->getSession($session_id); + if(!$session){ + return false; + } + + $dobre= str_replace(';',',',$session['remote_functions']); + return in_array($function_name, explode(',', $dobre) ); + } + + + private function getSession($session_id) + { + global $app; + + if(empty($session_id)) { + $this->server->fault('session_id_empty','The SessionID is empty.'); + return false; + } + + $session_id = $app->db->quote($session_id); + + $now = time(); + $sql = "SELECT * FROM remote_session WHERE remote_session = '$session_id' AND tstamp >= $now"; + $session = $app->db->queryOneRecord($sql); + if($session['remote_userid'] > 0) { + return $session; + } else { + $this->server->fault('session_does_not_exist','The Session is expired or does not exist.'); + return false; + } + } + + //--- + + + /** + * Gets sites by $sys_userid & $sys_groupid + * @param int session id + * @param int user id + * @param array list of groups + * @return mixed array with sites by user + * @author Julio Montoya BeezNest 2010 + */ + public function client_get_sites_by_user($session_id, $sys_userid, $sys_groupid) { + global $app; + if(!$this->checkPerm($session_id, 'client_get_sites_by_user')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $sys_userid = intval($sys_userid); + $sys_groupid = explode(',', $sys_groupid); + $new_group = array(); + foreach($sys_groupid as $group_id) { + $new_group[] = intval( $group_id); + } + $group_list = implode(',', $new_group); + $sql ="SELECT domain, domain_id, document_root, active FROM web_domain WHERE ( (sys_userid = $sys_userid AND sys_perm_user LIKE '%r%') OR (sys_groupid IN ($group_list) AND sys_perm_group LIKE '%r%') OR sys_perm_other LIKE '%r%') AND type = 'vhost'"; + $result = $app->db->queryAllRecords($sql); + if(isset($result)) { + return $result; + } else { + $this->server->fault('no_client_found', 'There is no site for this user'); + return false; + } + } + + /** + * Change domains status + * @param int session id + * @param int site id + * @param string active or inactive string + * @return mixed false if error + * @author Julio Montoya BeezNest 2010 + */ + + public function sites_web_domain_set_status($session_id, $primary_id, $status) { + global $app; + if(!$this->checkPerm($session_id, 'sites_web_domain_set_status')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + if(in_array($status, array('active', 'inactive'))) { + if ($status == 'active') { + $status = 'y'; + } else { + $status = 'n'; + } + $sql = "UPDATE web_domain SET active = '$status' WHERE domain_id = ".intval($primary_id); + $app->db->query($sql); + $result = $app->db->affectedRows(); + return $result; + } else { + $this->server->fault('status_undefined', 'The status is not available'); + return false; + } + } + + /** + * Get sys_user information by username + * @param int session id + * @param string user's name + * @return mixed false if error + * @author Julio Montoya BeezNest 2010 + */ + public function client_get_by_username($session_id, $username) { + global $app; + if(!$this->checkPerm($session_id, 'client_get_by_username')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $username = $app->db->quote($username); + $rec = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE username = '".$username."'"); + if (isset($rec)) { + return $rec; + } else { + $this->server->fault('no_client_found', 'There is no user account for this user name.'); + return false; + } + } + + /** + * Changes client password + * + * @param int session id + * @param int client id + * @param string new password + * @return bool true if success + * @author Julio Montoya BeezNest 2010 + * + */ + public function client_change_password($session_id, $client_id, $new_password) { + global $app; + + if(!$this->checkPerm($session_id, 'client_change_password')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $client_id = intval($client_id); + $client = $app->db->queryOneRecord("SELECT client_id FROM client WHERE client_id = ".$client_id); + if($client['client_id'] > 0) { + $new_password = $app->db->quote($new_password); + $sql = "UPDATE client SET password = md5('".($new_password)."') WHERE client_id = ".$client_id; + $app->db->query($sql); + $sql = "UPDATE sys_user SET passwort = md5('".($new_password)."') WHERE client_id = ".$client_id; + $app->db->query($sql); + return true; + } else { + $this->server->fault('no_client_found', 'There is no user account for this client_id'); + return false; + } + } + + public function mail_domain_get_by_domain($session_id, $domain) { + global $app; + if(!$this->checkPerm($session_id, 'mail_domain_get_by_domain')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + if (!empty($domain_id)) { + $domain = $app->db->quote($domain); + $sql = "SELECT * FROM mail_domain WHERE domain = $domain"; + $result = $app->db->queryAllRecords($sql); + return $result; + } + return false; + } + + + + /** + * Get a list of functions + * @param int session id + * @return mixed array of the available functions + * @author Julio Montoya BeezNest 2010 + */ + public function get_function_list($session_id) + { + if(!$this->checkPerm($session_id, 'get_function_list')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + return get_class_methods($this); + } + + /** + * Get all databases by user + * @author Julio Montoya BeezNest 2010 + */ + public function sites_database_get_all_by_user($session_id, $client_id) + { + global $app; + if(!$this->checkPerm($session_id, 'sites_database_get_all_by_user')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $client_id = intval($client_id); + $sql = "SELECT database_id, database_name, database_user, database_password FROM web_database WHERE sys_userid = $client_id "; + $all = $app->db->queryAllRecords($sql); + return $all; + } + + /** + * Get all client templates + * @param int session id + * @author Julio Montoya BeezNest 2010 + */ + public function client_templates_get_all($session_id) { + global $app; + if(!$this->checkPerm($session_id, 'client_templates_get_all')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $sql = "SELECT * FROM client_template"; + $result = $app->db->queryAllRecords($sql); + return $result; + } + + /** + * Get all DNS zone by user + *@author Julio Montoya BeezNest 2010 + */ + public function dns_zone_get_by_user($session_id, $client_id, $server_id) { + global $app; + if(!$this->checkPerm($session_id, 'dns_zone_get')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + if (!empty($client_id) && !empty($server_id)) { + $server_id = intval($server_id); + $client_id = intval($client_id); + $sql = "SELECT id, origin FROM dns_soa d INNER JOIN sys_user s on(d.sys_groupid = s.default_group) WHERE client_id = $client_id AND server_id = $server_id"; + $result = $app->db->queryAllRecords($sql); + return $result; + } + return false; + } + + + /** + * Changes DNS zone status + * @param int session id + * @param int dns soa id + * @param string status active or inactive string + * @author Julio Montoya BeezNest 2010 + */ + + public function dns_zone_set_status($session_id, $primary_id, $status) { + global $app; + if(!$this->checkPerm($session_id, 'dns_zone_set_status')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + if(in_array($status, array('active', 'inactive'))) { + if ($status == 'active') { + $status = 'Y'; + } else { + $status = 'N'; + } + $sql = "UPDATE dns_soa SET active = '$status' WHERE id = ".intval($primary_id); + $app->db->query($sql); + $result = $app->db->affectedRows(); + return $result; + } else { + $this->server->fault('status_undefined', 'The status is not available'); + return false; + } + } + + public function mail_domain_set_status($session_id, $primary_id, $status) { + global $app; + if(!$this->checkPerm($session_id, 'mail_domain_set_status')) { + $this->server->fault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + if(in_array($status, array('active', 'inactive'))) { + if ($status == 'active') { + $status = 'y'; + } else { + $status = 'n'; + } + $sql = "UPDATE mail_domain SET active = '$status' WHERE domain_id = ".intval($primary_id); + $app->db->query($sql); + $result = $app->db->affectedRows(); + return $result; + } else { + $this->server->fault('status_undefined', 'The status is not available'); + return false; + } + } +} ?> \ No newline at end of file diff --git a/interface/lib/classes/session.inc.php b/interface/lib/classes/session.inc.php index 34dfaa5ed61f5001321176e95def34fe2a131829..9c9fdf0a622fc812e5dc0bb4d8175ece94527974 100644 --- a/interface/lib/classes/session.inc.php +++ b/interface/lib/classes/session.inc.php @@ -1,129 +1,129 @@ -db = new db; - } - - function open ($save_path, $session_name) { - return true; - } - - function close () { - - if (!empty($this->session_array)) { - $result = $this->gc(ini_get('session.gc_maxlifetime')); - return $result; - } - return false; - } - - function read ($session_id) { - - $rec = $this->db->queryOneRecord("SELECT * FROM sys_session WHERE session_id = '".$this->db->quote($session_id)."'"); - - if (is_array($rec)) { - $this->session_array = $rec; - return $this->session_array['session_data']; - } else { - return ''; - } - } - - function write ($session_id, $session_data) { - - if (!empty($this->session_array) && $this->session_array['session_id'] != $session_id) { - $this->session_array = array(); - } - - // Dont write session_data to DB if session data has not been changed after reading it. - if(isset($this->session_array['session_data']) && $this->session_array['session_data'] != '' && $this->session_array['session_data'] == $session_data) { - $session_id = $this->db->quote($session_id); - $last_updated = date('Y-m-d H:i:s'); - $this->db->query("UPDATE sys_session SET last_updated = '$last_updated' WHERE session_id = '$session_id'"); - return true; - } - - - if ($this->session_array['session_id'] == '') { - $session_id = $this->db->quote($session_id); - $date_created = date('Y-m-d H:i:s'); - $last_updated = date('Y-m-d H:i:s'); - $session_data = $this->db->quote($session_data); - $sql = "INSERT INTO sys_session (session_id,date_created,last_updated,session_data) VALUES ('$session_id','$date_created','$last_updated','$session_data')"; - $this->db->query($sql); - - } else { - $session_id = $this->db->quote($session_id); - $last_updated = date('Y-m-d H:i:s'); - $session_data = $this->db->quote($session_data); - $sql = "UPDATE sys_session SET last_updated = '$last_updated', session_data = '$session_data' WHERE session_id = '$session_id'"; - $this->db->query($sql); - - } - - return true; - } - - function destroy ($session_id) { - - $session_id = $this->db->quote($session_id); - $sql = "DELETE FROM sys_session WHERE session_id = '$session_id'"; - $this->db->query($sql); - - return true; - } - - function gc ($max_lifetime) { - - $real_now = date('Y-m-d H:i:s'); - $dt1 = strtotime("$real_now -$max_lifetime seconds"); - $dt2 = date('Y-m-d H:i:s', $dt1); - - $sql = "DELETE FROM sys_session WHERE last_updated < '$dt2'"; - $this->db->query($sql); - - return true; - - } - - function __destruct () { - @session_write_close(); - - } - -} - +db = new db; + } + + function open ($save_path, $session_name) { + return true; + } + + function close () { + + if (!empty($this->session_array)) { + $result = $this->gc(ini_get('session.gc_maxlifetime')); + return $result; + } + return false; + } + + function read ($session_id) { + + $rec = $this->db->queryOneRecord("SELECT * FROM sys_session WHERE session_id = '".$this->db->quote($session_id)."'"); + + if (is_array($rec)) { + $this->session_array = $rec; + return $this->session_array['session_data']; + } else { + return ''; + } + } + + function write ($session_id, $session_data) { + + if (!empty($this->session_array) && $this->session_array['session_id'] != $session_id) { + $this->session_array = array(); + } + + // Dont write session_data to DB if session data has not been changed after reading it. + if(isset($this->session_array['session_data']) && $this->session_array['session_data'] != '' && $this->session_array['session_data'] == $session_data) { + $session_id = $this->db->quote($session_id); + $last_updated = date('Y-m-d H:i:s'); + $this->db->query("UPDATE sys_session SET last_updated = '$last_updated' WHERE session_id = '$session_id'"); + return true; + } + + + if ($this->session_array['session_id'] == '') { + $session_id = $this->db->quote($session_id); + $date_created = date('Y-m-d H:i:s'); + $last_updated = date('Y-m-d H:i:s'); + $session_data = $this->db->quote($session_data); + $sql = "INSERT INTO sys_session (session_id,date_created,last_updated,session_data) VALUES ('$session_id','$date_created','$last_updated','$session_data')"; + $this->db->query($sql); + + } else { + $session_id = $this->db->quote($session_id); + $last_updated = date('Y-m-d H:i:s'); + $session_data = $this->db->quote($session_data); + $sql = "UPDATE sys_session SET last_updated = '$last_updated', session_data = '$session_data' WHERE session_id = '$session_id'"; + $this->db->query($sql); + + } + + return true; + } + + function destroy ($session_id) { + + $session_id = $this->db->quote($session_id); + $sql = "DELETE FROM sys_session WHERE session_id = '$session_id'"; + $this->db->query($sql); + + return true; + } + + function gc ($max_lifetime) { + + $real_now = date('Y-m-d H:i:s'); + $dt1 = strtotime("$real_now -$max_lifetime seconds"); + $dt2 = date('Y-m-d H:i:s', $dt1); + + $sql = "DELETE FROM sys_session WHERE last_updated < '$dt2'"; + $this->db->query($sql); + + return true; + + } + + function __destruct () { + @session_write_close(); + + } + +} + ?> \ No newline at end of file diff --git a/interface/lib/classes/tpl_cache.inc.php b/interface/lib/classes/tpl_cache.inc.php index 18e7d385f9112067ccc5974f57f44bd0c6295005..a3999466a703e1fec5f27930debeb0b3a6a386a2 100644 --- a/interface/lib/classes/tpl_cache.inc.php +++ b/interface/lib/classes/tpl_cache.inc.php @@ -1,186 +1,186 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: cache.php,v 1.1 2003/07/08 12:32:06 platinum Exp $ - -/** - * Class uses all of vlibTemplate's functionality but caches the template files. - * It creates an identical tree structure to your filesystem but with cached files. - * - * @author Kelvin Jones - * @since 22/02/2002 - * @package vLIB - * @access public - */ - -class tplc extends tpl { - -/*-----------------------------------------------------------------------------\ -| DO NOT TOUCH ANYTHING IN THIS CLASS, IT MAY NOT WORK OTHERWISE | -\-----------------------------------------------------------------------------*/ - - var $_cache = 1; // tells vlibTemplate that we're caching - var $_cachefile; // full path to current cache file (even if it doesn't yet exist) - var $_cacheexists; // has this file been cached before - var $_cachefilelocked; // is this file currently locked whilst writing - var $_cachefiledir; // dir of current cache file - var $_clearcache = 0; - - - /** - * FUNCTION: clearCache - * will unset a file, and set $this->_cacheexists to 0. - * - * @access public - * @return boolean - */ - function clearCache() { - $this->_clearcache = 1; - return true; - } - - /** - * FUNCTION: recache - * alias for clearCache(). - * - * @access public - * @return boolean - */ - function recache() { - return $this->clearCache(); - } - - /** - * FUNCTION: setCacheLifeTime - * sets the lifetime of the cached file - * - * @param int $int number of seconds to set lifetime to - * @access public - * @return boolean - */ - function setCacheLifeTime($int = null) { - if ($int == null || !is_int($int)) return false; - if ($int == 0) $int = 60; - if ($int == -1) $int = 157680000; // set to 5 yrs time - $this->OPTIONS['CACHE_LIFETIME'] = $int; - return true; - } - - /** - * FUNCTION: setCacheExtension - * sets the extention of the cache file - * - * @param str $str name of new cache extention - * @access public - * @return boolean - */ - function setCacheExtension($str = null) { - if ($str == null || !preg_match('/^[a-z0-9]+$/', strtolower($str))) return false; - $this->OPTIONS['CACHE_EXTENSION'] = strtolower($str); - return true; - } - - -/*----------------------------------------\ - Private Functions ------------------------------------------*/ - - /** - * FUNCTION: _checkCache - * checks if there's a cache, if there is then it will read the cache file as the template. - */ - function _checkCache ($tmplfile) { - $this->_cachefile = $this->_getFilename($tmplfile); - if ($this->_clearcache) { - if (file_exists($this->_cachefile)) unlink($this->_cachefile); - return false; - } - - if (file_exists($this->_cachefile)) { - $this->_cacheexists = 1; - - // if it's expired - if ((filemtime($this->_cachefile) + $this->OPTIONS['CACHE_LIFETIME']) < date ('U') - || filectime($this->_cachefile) < filemtime($tmplfile)) { - $this->_cacheexists = 0; - return false; // so that we know to recache - } - else { - return true; - } - - } else { - $this->_cacheexists = 0; - return false; - } - } - - - /** - * FUNCTION: _getFilename - * gets the full pathname for the cached file - * - */ - function _getFilename($tmplfile) { - return $this->OPTIONS['CACHE_DIRECTORY'].'/'.md5('vlibCachestaR'.realpath($tmplfile)).'.'.$this->OPTIONS['CACHE_EXTENSION']; - } - - /** - * FUNCTION: _createCache - * creates the cached file - * - */ - function _createCache($data) { - $cache_file = $this->_cachefile; - if(!$this->_prepareDirs($cache_file)) return false; // prepare all of the directories - - $f = fopen ($cache_file, "w"); - flock($f, 2); // set an EXclusive lock - if (!$f) vlibTemplateError::raiseError('VT_ERROR_NO_CACHE_WRITE',KILL,$cache_file); - fputs ($f, $data); // write the parsed string from vlibTemplate - flock($f, 3); // UNlock file - fclose ($f); - touch ($cache_file); - return true; - } - - /** - * FUNCTION: _prepareDirs - * prepares the directory structure - * - */ - function _prepareDirs($file) { - if (empty($file)) die('no filename'); //do error in future - $filepath = dirname($file); - if (is_dir($filepath)) return true; - - $dirs = preg_split('/[\\/]/', $filepath); - $currpath; - foreach ($dirs as $dir) { - $currpath .= $dir .'/'; - $type = @filetype($currpath); - - ($type=='link') and $type = 'dir'; - if ($type != 'dir' && $type != false && !empty($type)) { - vlibTemplateError::raiseError('VT_ERROR_WRONG_CACHE_TYPE',KILL,'directory: '.$currpath.', type: '.$type); - } - if ($type == 'dir') { - continue; - } - else { - $s = @mkdir($currpath, 0775); - if (!$s) vlibTemplateError::raiseError('VT_ERROR_CACHE_MKDIR_FAILURE',KILL,'directory: '.$currpath); - } - } - return true; - } - -} // -- end vlibTemplateCache class + | +// +----------------------------------------------------------------------+ +// +// $Id: cache.php,v 1.1 2003/07/08 12:32:06 platinum Exp $ + +/** + * Class uses all of vlibTemplate's functionality but caches the template files. + * It creates an identical tree structure to your filesystem but with cached files. + * + * @author Kelvin Jones + * @since 22/02/2002 + * @package vLIB + * @access public + */ + +class tplc extends tpl { + +/*-----------------------------------------------------------------------------\ +| DO NOT TOUCH ANYTHING IN THIS CLASS, IT MAY NOT WORK OTHERWISE | +\-----------------------------------------------------------------------------*/ + + var $_cache = 1; // tells vlibTemplate that we're caching + var $_cachefile; // full path to current cache file (even if it doesn't yet exist) + var $_cacheexists; // has this file been cached before + var $_cachefilelocked; // is this file currently locked whilst writing + var $_cachefiledir; // dir of current cache file + var $_clearcache = 0; + + + /** + * FUNCTION: clearCache + * will unset a file, and set $this->_cacheexists to 0. + * + * @access public + * @return boolean + */ + function clearCache() { + $this->_clearcache = 1; + return true; + } + + /** + * FUNCTION: recache + * alias for clearCache(). + * + * @access public + * @return boolean + */ + function recache() { + return $this->clearCache(); + } + + /** + * FUNCTION: setCacheLifeTime + * sets the lifetime of the cached file + * + * @param int $int number of seconds to set lifetime to + * @access public + * @return boolean + */ + function setCacheLifeTime($int = null) { + if ($int == null || !is_int($int)) return false; + if ($int == 0) $int = 60; + if ($int == -1) $int = 157680000; // set to 5 yrs time + $this->OPTIONS['CACHE_LIFETIME'] = $int; + return true; + } + + /** + * FUNCTION: setCacheExtension + * sets the extention of the cache file + * + * @param str $str name of new cache extention + * @access public + * @return boolean + */ + function setCacheExtension($str = null) { + if ($str == null || !preg_match('/^[a-z0-9]+$/', strtolower($str))) return false; + $this->OPTIONS['CACHE_EXTENSION'] = strtolower($str); + return true; + } + + +/*----------------------------------------\ + Private Functions +-----------------------------------------*/ + + /** + * FUNCTION: _checkCache + * checks if there's a cache, if there is then it will read the cache file as the template. + */ + function _checkCache ($tmplfile) { + $this->_cachefile = $this->_getFilename($tmplfile); + if ($this->_clearcache) { + if (file_exists($this->_cachefile)) unlink($this->_cachefile); + return false; + } + + if (file_exists($this->_cachefile)) { + $this->_cacheexists = 1; + + // if it's expired + if ((filemtime($this->_cachefile) + $this->OPTIONS['CACHE_LIFETIME']) < date ('U') + || filectime($this->_cachefile) < filemtime($tmplfile)) { + $this->_cacheexists = 0; + return false; // so that we know to recache + } + else { + return true; + } + + } else { + $this->_cacheexists = 0; + return false; + } + } + + + /** + * FUNCTION: _getFilename + * gets the full pathname for the cached file + * + */ + function _getFilename($tmplfile) { + return $this->OPTIONS['CACHE_DIRECTORY'].'/'.md5('vlibCachestaR'.realpath($tmplfile)).'.'.$this->OPTIONS['CACHE_EXTENSION']; + } + + /** + * FUNCTION: _createCache + * creates the cached file + * + */ + function _createCache($data) { + $cache_file = $this->_cachefile; + if(!$this->_prepareDirs($cache_file)) return false; // prepare all of the directories + + $f = fopen ($cache_file, "w"); + flock($f, 2); // set an EXclusive lock + if (!$f) vlibTemplateError::raiseError('VT_ERROR_NO_CACHE_WRITE',KILL,$cache_file); + fputs ($f, $data); // write the parsed string from vlibTemplate + flock($f, 3); // UNlock file + fclose ($f); + touch ($cache_file); + return true; + } + + /** + * FUNCTION: _prepareDirs + * prepares the directory structure + * + */ + function _prepareDirs($file) { + if (empty($file)) die('no filename'); //do error in future + $filepath = dirname($file); + if (is_dir($filepath)) return true; + + $dirs = preg_split('/[\\/]/', $filepath); + $currpath; + foreach ($dirs as $dir) { + $currpath .= $dir .'/'; + $type = @filetype($currpath); + + ($type=='link') and $type = 'dir'; + if ($type != 'dir' && $type != false && !empty($type)) { + vlibTemplateError::raiseError('VT_ERROR_WRONG_CACHE_TYPE',KILL,'directory: '.$currpath.', type: '.$type); + } + if ($type == 'dir') { + continue; + } + else { + $s = @mkdir($currpath, 0775); + if (!$s) vlibTemplateError::raiseError('VT_ERROR_CACHE_MKDIR_FAILURE',KILL,'directory: '.$currpath); + } + } + return true; + } + +} // -- end vlibTemplateCache class ?> \ No newline at end of file diff --git a/interface/lib/classes/tpl_error.inc.php b/interface/lib/classes/tpl_error.inc.php index 29a9ae0fc451fd61199829a113d99896654e7fb2..5f6360978c89b616843f6ebeb38f84802b84741f 100644 --- a/interface/lib/classes/tpl_error.inc.php +++ b/interface/lib/classes/tpl_error.inc.php @@ -1,92 +1,92 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: error.php,v 1.1 2003/07/08 12:32:06 platinum Exp $ - -define('FATAL', E_USER_ERROR); -define('WARNING', E_USER_WARNING); -define('NOTICE', E_USER_NOTICE); -define('KILL', -1); // used for killing inside parsing. - -/** - * Class is used by vlibTemplate. - * It handles all of the error reporting for vlibTemplate. - * - * @author Kelvin Jones - * @since 06/03/2002 - * @package vLIB - * @access private - */ - -class vlibTemplateError { - -/*-----------------------------------------------------------------------------\ -| DO NOT TOUCH ANYTHING IN THIS CLASS IT MAY NOT WORK OTHERWISE | -\-----------------------------------------------------------------------------*/ - - function raiseError ($code, $level = null, $extra=null) { - if (!($level & error_reporting())&& $level != KILL) return; // binary AND checks for reporting level - - $error_codes = array( - 'VT_ERROR_NOFILE' => 'vlibTemplate Error: Template ('.$extra.') file not found.', - 'VT_ERROR_PARSE' => 'vlibTemplate Error: Parse error!
To debug this file, use vlibTemplateDebug instead of vlibTemplate in the class instantiation(i.e. new vlibTemplateDebug).', - 'VT_NOTICE_INVALID_TAG' => 'vlibTemplate Notice: Invalid tag ('.$extra.').', - 'VT_ERROR_INVALID_TAG' => 'vlibTemplate Error: Invalid tag ('.$extra.'). To disable this you must turn of the STRICT option.', - 'VT_NOTICE_INVALID_ATT' => 'vlibTemplate Notice: Invalid attribute ('.$extra.').', - 'VT_WARNING_INVALID_ARR' => 'vlibTemplate Warning: Invalid loop structure passed to vlibTemplate::setLoop() (loop name: '.$extra.').', - 'VT_ERROR_INVALID_ERROR_CODE' => 'vlibTemplate Error: Invalid error raised.', - 'VT_ERROR_WRONG_NO_PARAMS' => 'vlibTemplate Warning: Wrond parameter count passed to '.$extra.'.', - 'VT_ERROR_UNKNOWN_VAR' => 'vlibTemplate Error: template var not found.', - 'VT_ERROR_NO_CACHE_WRITE' => 'vlibTemplate Error: unable to write to cache file ('.$extra.').', - 'VT_ERROR_WRONG_CACHE_TYPE' => 'vlibTemplate Error: non-directory file found in cache root with same name as directory ('.$extra.').', - 'VT_ERROR_CACHE_MKDIR_FAILURE' => 'vlibTemplate Error: failed to create directory in cache root ('.$extra.').', - 'VT_WARNING_NOT_CACHE_OBJ' => 'vlibTemplate Warning: called a vlibTemplateCache function ('.$extra.') without instantiating the vlibTemplateCache class.', - 'VT_WARNING_LOOP_NOT_SET' => 'vlibTemplate Warning: called vlibTemplate::addRow() or vlibTemplate::addLoop() with an invalid loop name.', - 'VT_WARNING_INVALID_RESOURCE' => 'vlibTemplate Warning: Invalid resource type passed to vlibTemplate::setDbLoop() for Db "'.$extra.'".', - 'VT_WARNING_INVALID_LOOP_DB' => 'vlibTemplate Warning: Invalid Db type passed to vlibTemplate::setDbLoop(), "'.$extra.'" not currently available.', - 'VT_WARNING_INVALID_IF_OP' => 'vlibTemplate Warning: The Operator "'.$extra.'" is not supported by vlibTemplate.' - ); - - $error_levels = array( - 'VT_ERROR_NOFILE' => FATAL, - 'VT_ERROR_PARSE' => FATAL, - 'VT_NOTICE_INVALID_TAG' => NOTICE, - 'VT_ERROR_INVALID_TAG' => FATAL, - 'VT_NOTICE_INVALID_ATT' => NOTICE, - 'VT_WARNING_INVALID_ARR' => WARNING, - 'VT_ERROR_INVALID_ERROR_CODE' => FATAL, - 'VT_ERROR_WRONG_NO_PARAMS' => WARNING, - 'VT_ERROR_UNKNOWN_VAR' => WARNING, - 'VT_ERROR_NO_CACHE_WRITE' => KILL, - 'VT_ERROR_WRONG_CACHE_TYPE' => KILL, - 'VT_ERROR_CACHE_MKDIR_FAILURE' => KILL, - 'VT_WARNING_NOT_CACHE_OBJ' => WARNING, - 'VT_WARNING_LOOP_NOT_SET' => WARNING, - 'VT_WARNING_INVALID_RESOURCE' => WARNING, - 'VT_WARNING_INVALID_LOOP_DB' => WARNING, - 'VT_WARNING_INVALID_IF_OP' => WARNING - ); - - ($level === null) and $level = $error_levels[$code]; - if ($level == KILL) { - die ($error_codes[$code]); - } - - if ($msg = $error_codes[$code]) { - trigger_error($msg, $level); - } else { - $level = $error_levels['VT_ERROR_INVALID_ERROR_CODE']; - $msg = $error_codes['VT_ERROR_INVALID_ERROR_CODE']; - trigger_error($msg, $level); - } - return; - } -} + | +// +----------------------------------------------------------------------+ +// +// $Id: error.php,v 1.1 2003/07/08 12:32:06 platinum Exp $ + +define('FATAL', E_USER_ERROR); +define('WARNING', E_USER_WARNING); +define('NOTICE', E_USER_NOTICE); +define('KILL', -1); // used for killing inside parsing. + +/** + * Class is used by vlibTemplate. + * It handles all of the error reporting for vlibTemplate. + * + * @author Kelvin Jones + * @since 06/03/2002 + * @package vLIB + * @access private + */ + +class vlibTemplateError { + +/*-----------------------------------------------------------------------------\ +| DO NOT TOUCH ANYTHING IN THIS CLASS IT MAY NOT WORK OTHERWISE | +\-----------------------------------------------------------------------------*/ + + function raiseError ($code, $level = null, $extra=null) { + if (!($level & error_reporting())&& $level != KILL) return; // binary AND checks for reporting level + + $error_codes = array( + 'VT_ERROR_NOFILE' => 'vlibTemplate Error: Template ('.$extra.') file not found.', + 'VT_ERROR_PARSE' => 'vlibTemplate Error: Parse error!
To debug this file, use vlibTemplateDebug instead of vlibTemplate in the class instantiation(i.e. new vlibTemplateDebug).', + 'VT_NOTICE_INVALID_TAG' => 'vlibTemplate Notice: Invalid tag ('.$extra.').', + 'VT_ERROR_INVALID_TAG' => 'vlibTemplate Error: Invalid tag ('.$extra.'). To disable this you must turn of the STRICT option.', + 'VT_NOTICE_INVALID_ATT' => 'vlibTemplate Notice: Invalid attribute ('.$extra.').', + 'VT_WARNING_INVALID_ARR' => 'vlibTemplate Warning: Invalid loop structure passed to vlibTemplate::setLoop() (loop name: '.$extra.').', + 'VT_ERROR_INVALID_ERROR_CODE' => 'vlibTemplate Error: Invalid error raised.', + 'VT_ERROR_WRONG_NO_PARAMS' => 'vlibTemplate Warning: Wrond parameter count passed to '.$extra.'.', + 'VT_ERROR_UNKNOWN_VAR' => 'vlibTemplate Error: template var not found.', + 'VT_ERROR_NO_CACHE_WRITE' => 'vlibTemplate Error: unable to write to cache file ('.$extra.').', + 'VT_ERROR_WRONG_CACHE_TYPE' => 'vlibTemplate Error: non-directory file found in cache root with same name as directory ('.$extra.').', + 'VT_ERROR_CACHE_MKDIR_FAILURE' => 'vlibTemplate Error: failed to create directory in cache root ('.$extra.').', + 'VT_WARNING_NOT_CACHE_OBJ' => 'vlibTemplate Warning: called a vlibTemplateCache function ('.$extra.') without instantiating the vlibTemplateCache class.', + 'VT_WARNING_LOOP_NOT_SET' => 'vlibTemplate Warning: called vlibTemplate::addRow() or vlibTemplate::addLoop() with an invalid loop name.', + 'VT_WARNING_INVALID_RESOURCE' => 'vlibTemplate Warning: Invalid resource type passed to vlibTemplate::setDbLoop() for Db "'.$extra.'".', + 'VT_WARNING_INVALID_LOOP_DB' => 'vlibTemplate Warning: Invalid Db type passed to vlibTemplate::setDbLoop(), "'.$extra.'" not currently available.', + 'VT_WARNING_INVALID_IF_OP' => 'vlibTemplate Warning: The Operator "'.$extra.'" is not supported by vlibTemplate.' + ); + + $error_levels = array( + 'VT_ERROR_NOFILE' => FATAL, + 'VT_ERROR_PARSE' => FATAL, + 'VT_NOTICE_INVALID_TAG' => NOTICE, + 'VT_ERROR_INVALID_TAG' => FATAL, + 'VT_NOTICE_INVALID_ATT' => NOTICE, + 'VT_WARNING_INVALID_ARR' => WARNING, + 'VT_ERROR_INVALID_ERROR_CODE' => FATAL, + 'VT_ERROR_WRONG_NO_PARAMS' => WARNING, + 'VT_ERROR_UNKNOWN_VAR' => WARNING, + 'VT_ERROR_NO_CACHE_WRITE' => KILL, + 'VT_ERROR_WRONG_CACHE_TYPE' => KILL, + 'VT_ERROR_CACHE_MKDIR_FAILURE' => KILL, + 'VT_WARNING_NOT_CACHE_OBJ' => WARNING, + 'VT_WARNING_LOOP_NOT_SET' => WARNING, + 'VT_WARNING_INVALID_RESOURCE' => WARNING, + 'VT_WARNING_INVALID_LOOP_DB' => WARNING, + 'VT_WARNING_INVALID_IF_OP' => WARNING + ); + + ($level === null) and $level = $error_levels[$code]; + if ($level == KILL) { + die ($error_codes[$code]); + } + + if ($msg = $error_codes[$code]) { + trigger_error($msg, $level); + } else { + $level = $error_levels['VT_ERROR_INVALID_ERROR_CODE']; + $msg = $error_codes['VT_ERROR_INVALID_ERROR_CODE']; + trigger_error($msg, $level); + } + return; + } +} ?> \ No newline at end of file diff --git a/interface/lib/classes/validate_dns.inc.php b/interface/lib/classes/validate_dns.inc.php index 4606a0cefe6967235f15812b6df59a3346857427..faab6a058f68aa3135d9061df494b1b5de3e539f 100644 --- a/interface/lib/classes/validate_dns.inc.php +++ b/interface/lib/classes/validate_dns.inc.php @@ -1,287 +1,287 @@ -tform->wordbook['name_txt']; - break; - case "Data": - $desc = $app->tform->wordbook['data_txt']; - break; - case "RP mbox": - $desc = $app->tform->wordbook['rp_mbox_txt']; - break; - case "RP txtref": - $desc = $app->tform->wordbook['rp_txtref_txt']; - break; - case "SRV target": - $desc = $app->tform->wordbook['srv_target_txt']; - break; - case "Zone origin": - $desc = $app->tform->wordbook['zone_origin_txt']; - break; - case "Name server": - $desc = $app->tform->wordbook['ns_txt']; - break; - case "Admin email": - $desc = $app->tform->wordbook['mbox_txt']; - break; - } - - $error = ''; - - $valid_characters = "*ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-_"; - - if(strlen($field) > 255) $error .= $desc." ".$app->tform->wordbook['error_255_characters']."
\r\n"; - - $parts = explode(".", $field); - $i = 0; - $empty = 0; - foreach ($parts as $part){ - $i++; - - if(trim($part) == '') $empty += 1; - - if(strlen($part) > 63) $error .= $desc." ".$app->tform->wordbook['error_63_characters']."
\r\n"; - - if(strspn($part, $valid_characters) != strlen($part)) $error .= $desc." ".$app->tform->wordbook['error_invalid_characters']."
\r\n"; - - if(substr($part, 0, 1) == '-') $error .= $desc." ".$app->tform->wordbook['error_hyphen_begin']."
\r\n"; - if(substr($part, -1) == '-') $error .= $desc." ".$app->tform->wordbook['error_hyphen_end']."
\r\n"; - - if(strstr($part, "*")){ - if($wildcard_allowed){ - if($i != 1) $error .= $desc." ".$app->tform->wordbook['error_wildcard_non_initial_part']."
\r\n"; - - if($part != "*") $error .= $desc." ".$app->tform->wordbook['error_wildcard_mix']."
\r\n"; - } else { - $error .= $desc." ".$app->tform->wordbook['error_no_wildcard_allowed']."
\r\n"; - } - } - } - - if(substr($field, -1) == '.'){ - if($i > 2 && $empty > 1) $error .= $desc." ".$app->tform->wordbook['error_invalid_characters']."
\r\n"; - } else { - if($empty > 0 && $field != '') $error .= $desc." ".$app->tform->wordbook['error_invalid_characters']."
\r\n"; - } - - if(substr($field, -1) == '.' && $area == 'Name'){ - $soa = $app->db->queryOneRecord("SELECT * FROM soa WHERE id = ".$zoneid); - if(substr($field, (strlen($field) - strlen($soa['origin']))) != $soa['origin']) $error .= $desc." ".$app->tform->wordbook['error_out_of_zone']."
\r\n"; - } - - return $error; -} - -function validate_rp_data(&$data, $zoneid){ - global $app, $conf; - $error = ''; - $fields = explode(" ", trim($data)); - if(count($fields) != 2) return $error .= $app->tform->wordbook['data_txt']." ".$app->tform->wordbook['error_invalid_rp']."
\r\n"; - $mbox = $fields[0]; - $txtref = $fields[1]; - - $error .= $this->validate_field($mbox, 'RP mbox', $zoneid, 0); - $error .= $this->validate_field($txtref, 'RP txtref', $zoneid, 0); - - $data = $mbox." ".$txtref; - return $error; -} - -function validate_srv_data(&$data, $zoneid){ - global $app, $conf; - $error = ''; - - $fields = explode(" ", trim($data)); - if(count($fields) != 3) return $error .= $app->tform->wordbook['data_txt']." ".$app->tform->wordbook['error_invalid_srv']."
\r\n"; - - $weight = $fields[0]; - $port = $fields[1]; - $target = $fields[2]; - if($weight < 0 || $weight > 65535) $error .= $app->tform->wordbook['weight_txt']." (\"" . htmlentities($weight,ENT_QUOTES,$conf["html_content_encoding"])."\") ".$app->tform->wordbook['error_srv_out_of_range']."
\r\n"; - if($port < 0 || $port > 65535) $error .= $app->tform->wordbook['port_txt']." (\"".htmlentities($port,ENT_QUOTES,$conf["html_content_encoding"])."\") ".$app->tform->wordbook['error_srv_out_of_range']."
\r\n"; - - $error .= $this->validate_field($target, "SRV target", $zoneid, 0); - - $data = (int)$weight." ".(int)$port." ".$target; - return $error; -} - -function is_integer($value, $fieldname, $zero_allowed = 0){ - global $app, $conf; - - $error = ''; - - if(intval($value) != $value || !is_numeric($value)) $error .= $fieldname." ".$app->tform->wordbook['error_must_be_integer']."
\r\n"; - if($value > 2147483647) $error .= $fieldname." ".$app->tform->wordbook['error_must_not_be_greater_than_2147483647']."
\r\n"; - if(!$zero_allowed){ - if($value <= 0) $error .= $fieldname." ".$app->tform->wordbook['error_must_be_positive']."
\r\n"; - } else { - if($value < 0) $error .= $fieldname." ".$app->tform->wordbook['error_must_not_be_negative']."
\r\n"; - } - - return $error; -} - -function validate_rr(&$rr){ - global $app, $conf; - - $error = ''; - - $tmp_rr = $rr; - foreach($tmp_rr as $key => $val){ - $rr[$key] = trim($val); - } - unset($tmp_rr); - - $error .= $this->validate_field($rr['name'], 'Name', $rr['zone'], 1); - - switch ($rr['type']) { - case "A": - $ip_parts = explode(".", $rr['data']); - if(count($ip_parts) != 4){ - $error .= $app->tform->wordbook['data_txt']." ".$app->tform->wordbook['error_a']."
\r\n"; - } else { - for($n = 0; $n < 4; $n++){ - $q = $ip_parts[$n]; - if(!is_numeric($q) || (int)$q < 0 || (int)$q > 255 || trim($q) !== $q) $error .= $app->tform->wordbook['data_txt']." ".$app->tform->wordbook['error_a']."
\r\n"; - } - } - $rr['data'] = (int)$ip_parts[0].".".(int)$ip_parts[1].".".(int)$ip_parts[2].".".(int)$ip_parts[3]; - break; - case "AAAA": - $valid_chars = "ABCDEFabcdef1234567890:"; - - if(strspn($rr['data'], $valid_chars) != strlen($rr['data'])) $error .= $app->tform->wordbook['data_txt']." ".$app->tform->wordbook['error_aaaa']."
\r\n"; - break; - case "ALIAS": - $error .= $this->validate_field($rr['data'], 'Data', $rr['zone'], 0); - break; - case "CNAME": - $error .= $this->validate_field($rr['data'], 'Data', $rr['zone'], 0); - break; - case "HINFO": - if(!strchr($rr['data'], ' ')) $error .= $app->tform->wordbook['data_txt']." ".$app->tform->wordbook['error_hinfo']."
\r\n"; - break; - case "MX": - $error .= $this->validate_field($rr['data'], 'Data', $rr['zone'], 0); - $error .= $this->is_integer($rr['aux'], $app->tform->wordbook['aux_txt'], 1); - break; - case "NS": - $error .= $this->validate_field($rr['data'], 'Data', $rr['zone'], 0); - break; - case "PTR": - $error .= $this->validate_field($rr['data'], 'Data', $rr['zone'], 0); - if(substr($rr['data'], -1) != '.') $error .= $app->tform->wordbook['data_txt']." ".$app->tform->wordbook['error_ptr']."
\r\n"; - break; - case "RP": - $error .= $this->validate_rp_data($rr['data'], $rr['zone']); - break; - case "SRV": - $error .= $this->validate_srv_data($rr['data'], $rr['zone']); - $error .= $this->is_integer($rr['aux'], $app->tform->wordbook['aux_txt'], 1); - break; - case "TXT": - break; - } - - $error .= $this->is_integer($rr['ttl'], $app->tform->wordbook['ttl_txt']); - - - return $error; -} - -function validate_soa(&$soa){ - global $app, $conf; - - $error = ''; - - $tmp_soa = $soa; - foreach($tmp_soa as $key => $val){ - if($key != 'active') $soa[$key] = trim($val); - } - unset($tmp_soa); - - if($soa['origin'] == '') $error .= $app->tform->wordbook['origin_txt']." ".$app->tform->wordbook['error_empty']."
\r\n"; - if(substr($soa['origin'], -1) != '.') $error .= $app->tform->wordbook['origin_txt']." ".$app->tform->wordbook['error_dot']."
\r\n"; - $error .= $this->validate_field($soa['origin'], "Zone origin", $soa['id'], 0); - - $error .= $this->is_integer($soa['ttl'], $app->tform->wordbook['ttl_txt']); - - if($soa['ns'] == '') $error .= $app->tform->wordbook['ns_txt']." ".$app->tform->wordbook['error_empty']."
\r\n"; - $error .= $this->validate_field($soa['ns'], "Name server", $soa['id'], 0); - - if($soa['mbox'] == '') $error .= $app->tform->wordbook['mbox_txt']." ".$app->tform->wordbook['error_empty']."
\r\n"; - $error .= $this->validate_field($soa['mbox'], "Admin email", $soa['id'], 0); - - $error .= $this->is_integer($soa['refresh'], $app->tform->wordbook['refresh_txt']); - - $error .= $this->is_integer($soa['retry'], $app->tform->wordbook['retry_txt']); - - $error .= $this->is_integer($soa['expire'], $app->tform->wordbook['expire_txt']); - - $error .= $this->is_integer($soa['minimum'], $app->tform->wordbook['minimum_txt']); - - return $error; -} - -function increase_serial($serial){ - global $app, $conf; - - // increase serial - $serial_date = substr($serial, 0, 8); - $count = intval(substr($serial, 8, 2)); - $current_date = date("Ymd"); - if($serial_date >= $current_date){ - $count += 1; - if ($count > 99) { - $serial_date += 1; - $count = 0; - } - $count = str_pad($count, 2, "0", STR_PAD_LEFT); - $new_serial = $serial_date.$count; - } else { - $new_serial = $current_date.'01'; - } - return $new_serial; -} - +tform->wordbook['name_txt']; + break; + case "Data": + $desc = $app->tform->wordbook['data_txt']; + break; + case "RP mbox": + $desc = $app->tform->wordbook['rp_mbox_txt']; + break; + case "RP txtref": + $desc = $app->tform->wordbook['rp_txtref_txt']; + break; + case "SRV target": + $desc = $app->tform->wordbook['srv_target_txt']; + break; + case "Zone origin": + $desc = $app->tform->wordbook['zone_origin_txt']; + break; + case "Name server": + $desc = $app->tform->wordbook['ns_txt']; + break; + case "Admin email": + $desc = $app->tform->wordbook['mbox_txt']; + break; + } + + $error = ''; + + $valid_characters = "*ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-_"; + + if(strlen($field) > 255) $error .= $desc." ".$app->tform->wordbook['error_255_characters']."
\r\n"; + + $parts = explode(".", $field); + $i = 0; + $empty = 0; + foreach ($parts as $part){ + $i++; + + if(trim($part) == '') $empty += 1; + + if(strlen($part) > 63) $error .= $desc." ".$app->tform->wordbook['error_63_characters']."
\r\n"; + + if(strspn($part, $valid_characters) != strlen($part)) $error .= $desc." ".$app->tform->wordbook['error_invalid_characters']."
\r\n"; + + if(substr($part, 0, 1) == '-') $error .= $desc." ".$app->tform->wordbook['error_hyphen_begin']."
\r\n"; + if(substr($part, -1) == '-') $error .= $desc." ".$app->tform->wordbook['error_hyphen_end']."
\r\n"; + + if(strstr($part, "*")){ + if($wildcard_allowed){ + if($i != 1) $error .= $desc." ".$app->tform->wordbook['error_wildcard_non_initial_part']."
\r\n"; + + if($part != "*") $error .= $desc." ".$app->tform->wordbook['error_wildcard_mix']."
\r\n"; + } else { + $error .= $desc." ".$app->tform->wordbook['error_no_wildcard_allowed']."
\r\n"; + } + } + } + + if(substr($field, -1) == '.'){ + if($i > 2 && $empty > 1) $error .= $desc." ".$app->tform->wordbook['error_invalid_characters']."
\r\n"; + } else { + if($empty > 0 && $field != '') $error .= $desc." ".$app->tform->wordbook['error_invalid_characters']."
\r\n"; + } + + if(substr($field, -1) == '.' && $area == 'Name'){ + $soa = $app->db->queryOneRecord("SELECT * FROM soa WHERE id = ".$zoneid); + if(substr($field, (strlen($field) - strlen($soa['origin']))) != $soa['origin']) $error .= $desc." ".$app->tform->wordbook['error_out_of_zone']."
\r\n"; + } + + return $error; +} + +function validate_rp_data(&$data, $zoneid){ + global $app, $conf; + $error = ''; + $fields = explode(" ", trim($data)); + if(count($fields) != 2) return $error .= $app->tform->wordbook['data_txt']." ".$app->tform->wordbook['error_invalid_rp']."
\r\n"; + $mbox = $fields[0]; + $txtref = $fields[1]; + + $error .= $this->validate_field($mbox, 'RP mbox', $zoneid, 0); + $error .= $this->validate_field($txtref, 'RP txtref', $zoneid, 0); + + $data = $mbox." ".$txtref; + return $error; +} + +function validate_srv_data(&$data, $zoneid){ + global $app, $conf; + $error = ''; + + $fields = explode(" ", trim($data)); + if(count($fields) != 3) return $error .= $app->tform->wordbook['data_txt']." ".$app->tform->wordbook['error_invalid_srv']."
\r\n"; + + $weight = $fields[0]; + $port = $fields[1]; + $target = $fields[2]; + if($weight < 0 || $weight > 65535) $error .= $app->tform->wordbook['weight_txt']." (\"" . htmlentities($weight,ENT_QUOTES,$conf["html_content_encoding"])."\") ".$app->tform->wordbook['error_srv_out_of_range']."
\r\n"; + if($port < 0 || $port > 65535) $error .= $app->tform->wordbook['port_txt']." (\"".htmlentities($port,ENT_QUOTES,$conf["html_content_encoding"])."\") ".$app->tform->wordbook['error_srv_out_of_range']."
\r\n"; + + $error .= $this->validate_field($target, "SRV target", $zoneid, 0); + + $data = (int)$weight." ".(int)$port." ".$target; + return $error; +} + +function is_integer($value, $fieldname, $zero_allowed = 0){ + global $app, $conf; + + $error = ''; + + if(intval($value) != $value || !is_numeric($value)) $error .= $fieldname." ".$app->tform->wordbook['error_must_be_integer']."
\r\n"; + if($value > 2147483647) $error .= $fieldname." ".$app->tform->wordbook['error_must_not_be_greater_than_2147483647']."
\r\n"; + if(!$zero_allowed){ + if($value <= 0) $error .= $fieldname." ".$app->tform->wordbook['error_must_be_positive']."
\r\n"; + } else { + if($value < 0) $error .= $fieldname." ".$app->tform->wordbook['error_must_not_be_negative']."
\r\n"; + } + + return $error; +} + +function validate_rr(&$rr){ + global $app, $conf; + + $error = ''; + + $tmp_rr = $rr; + foreach($tmp_rr as $key => $val){ + $rr[$key] = trim($val); + } + unset($tmp_rr); + + $error .= $this->validate_field($rr['name'], 'Name', $rr['zone'], 1); + + switch ($rr['type']) { + case "A": + $ip_parts = explode(".", $rr['data']); + if(count($ip_parts) != 4){ + $error .= $app->tform->wordbook['data_txt']." ".$app->tform->wordbook['error_a']."
\r\n"; + } else { + for($n = 0; $n < 4; $n++){ + $q = $ip_parts[$n]; + if(!is_numeric($q) || (int)$q < 0 || (int)$q > 255 || trim($q) !== $q) $error .= $app->tform->wordbook['data_txt']." ".$app->tform->wordbook['error_a']."
\r\n"; + } + } + $rr['data'] = (int)$ip_parts[0].".".(int)$ip_parts[1].".".(int)$ip_parts[2].".".(int)$ip_parts[3]; + break; + case "AAAA": + $valid_chars = "ABCDEFabcdef1234567890:"; + + if(strspn($rr['data'], $valid_chars) != strlen($rr['data'])) $error .= $app->tform->wordbook['data_txt']." ".$app->tform->wordbook['error_aaaa']."
\r\n"; + break; + case "ALIAS": + $error .= $this->validate_field($rr['data'], 'Data', $rr['zone'], 0); + break; + case "CNAME": + $error .= $this->validate_field($rr['data'], 'Data', $rr['zone'], 0); + break; + case "HINFO": + if(!strchr($rr['data'], ' ')) $error .= $app->tform->wordbook['data_txt']." ".$app->tform->wordbook['error_hinfo']."
\r\n"; + break; + case "MX": + $error .= $this->validate_field($rr['data'], 'Data', $rr['zone'], 0); + $error .= $this->is_integer($rr['aux'], $app->tform->wordbook['aux_txt'], 1); + break; + case "NS": + $error .= $this->validate_field($rr['data'], 'Data', $rr['zone'], 0); + break; + case "PTR": + $error .= $this->validate_field($rr['data'], 'Data', $rr['zone'], 0); + if(substr($rr['data'], -1) != '.') $error .= $app->tform->wordbook['data_txt']." ".$app->tform->wordbook['error_ptr']."
\r\n"; + break; + case "RP": + $error .= $this->validate_rp_data($rr['data'], $rr['zone']); + break; + case "SRV": + $error .= $this->validate_srv_data($rr['data'], $rr['zone']); + $error .= $this->is_integer($rr['aux'], $app->tform->wordbook['aux_txt'], 1); + break; + case "TXT": + break; + } + + $error .= $this->is_integer($rr['ttl'], $app->tform->wordbook['ttl_txt']); + + + return $error; +} + +function validate_soa(&$soa){ + global $app, $conf; + + $error = ''; + + $tmp_soa = $soa; + foreach($tmp_soa as $key => $val){ + if($key != 'active') $soa[$key] = trim($val); + } + unset($tmp_soa); + + if($soa['origin'] == '') $error .= $app->tform->wordbook['origin_txt']." ".$app->tform->wordbook['error_empty']."
\r\n"; + if(substr($soa['origin'], -1) != '.') $error .= $app->tform->wordbook['origin_txt']." ".$app->tform->wordbook['error_dot']."
\r\n"; + $error .= $this->validate_field($soa['origin'], "Zone origin", $soa['id'], 0); + + $error .= $this->is_integer($soa['ttl'], $app->tform->wordbook['ttl_txt']); + + if($soa['ns'] == '') $error .= $app->tform->wordbook['ns_txt']." ".$app->tform->wordbook['error_empty']."
\r\n"; + $error .= $this->validate_field($soa['ns'], "Name server", $soa['id'], 0); + + if($soa['mbox'] == '') $error .= $app->tform->wordbook['mbox_txt']." ".$app->tform->wordbook['error_empty']."
\r\n"; + $error .= $this->validate_field($soa['mbox'], "Admin email", $soa['id'], 0); + + $error .= $this->is_integer($soa['refresh'], $app->tform->wordbook['refresh_txt']); + + $error .= $this->is_integer($soa['retry'], $app->tform->wordbook['retry_txt']); + + $error .= $this->is_integer($soa['expire'], $app->tform->wordbook['expire_txt']); + + $error .= $this->is_integer($soa['minimum'], $app->tform->wordbook['minimum_txt']); + + return $error; +} + +function increase_serial($serial){ + global $app, $conf; + + // increase serial + $serial_date = substr($serial, 0, 8); + $count = intval(substr($serial, 8, 2)); + $current_date = date("Ymd"); + if($serial_date >= $current_date){ + $count += 1; + if ($count > 99) { + $serial_date += 1; + $count = 0; + } + $count = str_pad($count, 2, "0", STR_PAD_LEFT); + $new_serial = $serial_date.$count; + } else { + $new_serial = $current_date.'01'; + } + return $new_serial; +} + } \ No newline at end of file diff --git a/interface/web/admin/form/firewall.tform.php b/interface/web/admin/form/firewall.tform.php index 2ff9d0e40978a442bce15c3e5ad484e1e216018b..4112a2a4973c1de13bccc1c0bfea695da6845fe1 100644 --- a/interface/web/admin/form/firewall.tform.php +++ b/interface/web/admin/form/firewall.tform.php @@ -1,112 +1,112 @@ - 0 id must match with id of current user -$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user -$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete -$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete -$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete - -$form["tabs"]['firewall'] = array ( - 'title' => "Firewall", - 'width' => 100, - 'template' => "templates/firewall_edit.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'server_id' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '', - 'validators' => array ( 0 => array ( 'type' => 'UNIQUE', - 'errmsg'=> 'firewall_error_unique'), - ), - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - 'tcp_port' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[\s0-9\,\:]{0,255}$/', - 'errmsg'=> 'tcp_ports_error_regex'), - ), - 'default' => '20,21,22,25,53,80,110,143,443,3306,8080,8081,10000', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'udp_port' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[\s0-9\,\:]{0,255}$/', - 'errmsg'=> 'tcp_ports_error_regex'), - ), - 'default' => '53,3306', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'active' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'y', - 'value' => array(0 => 'n',1 => 'y') - ), - ################################## - # ENDE Datatable fields - ################################## - ) -); - - + 0 id must match with id of current user +$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user +$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete + +$form["tabs"]['firewall'] = array ( + 'title' => "Firewall", + 'width' => 100, + 'template' => "templates/firewall_edit.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'server_id' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '', + 'validators' => array ( 0 => array ( 'type' => 'UNIQUE', + 'errmsg'=> 'firewall_error_unique'), + ), + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'tcp_port' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[\s0-9\,\:]{0,255}$/', + 'errmsg'=> 'tcp_ports_error_regex'), + ), + 'default' => '20,21,22,25,53,80,110,143,443,3306,8080,8081,10000', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'udp_port' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[\s0-9\,\:]{0,255}$/', + 'errmsg'=> 'tcp_ports_error_regex'), + ), + 'default' => '53,3306', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'active' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n',1 => 'y') + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + + ?> \ No newline at end of file diff --git a/interface/web/admin/form/remote_user.tform.php b/interface/web/admin/form/remote_user.tform.php index 3cc3e6dc87ea42564fcfc87fe152e8c604d71b60..1a3824a60bbb8df415eb3871ee72f0e34f76735d 100644 --- a/interface/web/admin/form/remote_user.tform.php +++ b/interface/web/admin/form/remote_user.tform.php @@ -1,162 +1,162 @@ - 0 id must match with id of current user -$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user -$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete -$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete -$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete - -$form["tabs"]['remote_user'] = array ( - 'title' => "Remote User", - 'width' => 100, - 'template' => "templates/remote_user_edit.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'remote_userid' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT remote_userid,remote_username FROM remote_user WHERE {AUTHSQL} ORDER BY remote_username', - 'keyfield'=> 'remote_userid', - 'valuefield'=> 'remote_username' - ), - 'value' => '' - ), - - 'remote_username' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'UNIQUE', - 'errmsg'=> 'username_error_unique'), - 1 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{0,64}$/', - 'errmsg'=> 'username_error_regex'), -2 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'username_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'remote_password' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'PASSWORD', - 'encryption' => 'MD5', - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'remote_functions' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'CHECKBOXARRAY', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => $function_list, - 'separator' => ';', - 'width' => '', - 'maxlength' => '', - 'rows' => '5', - 'cols' => '30' - ) - - ################################## - # ENDE Datatable fields - ################################## - ) -); - - - - - -?> + +$form["title"] = "Remote user"; +$form["description"] = ""; +$form["name"] = "remote_user"; +$form["action"] = "remote_user_edit.php"; +$form["db_table"] = "remote_user"; +$form["db_table_idx"] = "remote_userid"; +$form["db_history"] = "yes"; +$form["tab_default"] = "remote_user"; +$form["list_default"] = "remote_user_list.php"; +$form["auth"] = 'yes'; // yes / no + +$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user +$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user +$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete + +$form["tabs"]['remote_user'] = array ( + 'title' => "Remote User", + 'width' => 100, + 'template' => "templates/remote_user_edit.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'remote_userid' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT remote_userid,remote_username FROM remote_user WHERE {AUTHSQL} ORDER BY remote_username', + 'keyfield'=> 'remote_userid', + 'valuefield'=> 'remote_username' + ), + 'value' => '' + ), + + 'remote_username' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'UNIQUE', + 'errmsg'=> 'username_error_unique'), + 1 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-]{0,64}$/', + 'errmsg'=> 'username_error_regex'), +2 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'username_error_empty'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'remote_password' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'PASSWORD', + 'encryption' => 'MD5', + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'remote_functions' => array ( + 'datatype' => 'TEXT', + 'formtype' => 'CHECKBOXARRAY', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => $function_list, + 'separator' => ';', + 'width' => '', + 'maxlength' => '', + 'rows' => '5', + 'cols' => '30' + ) + + ################################## + # ENDE Datatable fields + ################################## + ) +); + + + + + +?> diff --git a/interface/web/admin/form/system_config.tform.php b/interface/web/admin/form/system_config.tform.php index 7c080ccbdfbff7fac4de2c6ffe84eec1f960d41e..bc3e972f80fd9c50ffa96395c04f57ecd503e702 100644 --- a/interface/web/admin/form/system_config.tform.php +++ b/interface/web/admin/form/system_config.tform.php @@ -1,270 +1,270 @@ - 0 id must match with id of current user -$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user -$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete -$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete -$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete - -$form["tabs"]['sites'] = array ( - 'title' => "Sites", - 'width' => 70, - 'template' => "templates/system_config_sites_edit.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'dbname_prefix' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[a-zA-Z0-0\-\_\[\]]{0,50}$/', - 'errmsg'=> 'dbname_prefix_error_regex'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'dbuser_prefix' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[a-zA-Z0-0\-\_\[\]]{0,50}$/', - 'errmsg'=> 'dbuser_prefix_error_regex'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'ftpuser_prefix' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[a-zA-Z0-0\-\_\[\]]{0,50}$/', - 'errmsg'=> 'ftpuser_prefix_error_regex'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'shelluser_prefix' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[a-zA-Z0-0\-\_\[\]]{0,50}$/', - 'errmsg'=> 'shelluser_prefix_error_regex'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'webdavuser_prefix' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[a-zA-Z0-0\-\_\[\]]{0,50}$/', - 'errmsg'=> 'webdavuser_prefix_error_regex'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'dblist_phpmyadmin_link' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n',1 => 'y') - ), - 'phpmyadmin_url' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[0-9a-zA-Z\:\/\-\.]{0,255}$/', - 'errmsg'=> 'phpmyadmin_url_error_regex'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'webftp_url' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[0-9a-zA-Z\:\/\-\.]{0,255}$/', - 'errmsg'=> 'webftp_url_error_regex'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - ################################## - # ENDE Datatable fields - ################################## - ) -); - -$form["tabs"]['mail'] = array ( - 'title' => "Mail", - 'width' => 70, - 'template' => "templates/system_config_mail_edit.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'mailboxlist_webmail_link' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n',1 => 'y') - ), - 'webmail_url' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[0-9a-zA-Z\:\/\-\.]{0,255}$/', - 'errmsg'=> 'webmail_url_error_regex'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'mailmailinglist_link' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n',1 => 'y') - ), - 'mailmailinglist_url' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[0-9a-zA-Z\:\/\-\.]{0,255}$/', - 'errmsg'=> 'mailinglist_url_error_regex'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'admin_mail' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'admin_name' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - ################################## - # ENDE Datatable fields - ################################## - ) -); - -$form["tabs"]['domains'] = array ( - 'title' => "Domains", - 'width' => 70, - 'template' => "templates/system_config_domains_edit.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'use_domain_module' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOX', - 'default' => 'n', - 'value' => array(0 => 'n',1 => 'y') - ), - 'new_domain_html' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '' - ), - ################################## - # ENDE Datatable fields - ################################## - ) -); - -$form["tabs"]['misc'] = array ( - 'title' => "Misc", - 'width' => 70, - 'template' => "templates/system_config_misc_edit.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'dashboard_atom_url' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => 'http://www.ispconfig.org/atom', - 'value' => '' - ), - ################################## - # ENDE Datatable fields - ################################## - ) -); - - -?> + 0 id must match with id of current user +$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user +$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete + +$form["tabs"]['sites'] = array ( + 'title' => "Sites", + 'width' => 70, + 'template' => "templates/system_config_sites_edit.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'dbname_prefix' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[a-zA-Z0-0\-\_\[\]]{0,50}$/', + 'errmsg'=> 'dbname_prefix_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'dbuser_prefix' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[a-zA-Z0-0\-\_\[\]]{0,50}$/', + 'errmsg'=> 'dbuser_prefix_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'ftpuser_prefix' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[a-zA-Z0-0\-\_\[\]]{0,50}$/', + 'errmsg'=> 'ftpuser_prefix_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'shelluser_prefix' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[a-zA-Z0-0\-\_\[\]]{0,50}$/', + 'errmsg'=> 'shelluser_prefix_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'webdavuser_prefix' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[a-zA-Z0-0\-\_\[\]]{0,50}$/', + 'errmsg'=> 'webdavuser_prefix_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'dblist_phpmyadmin_link' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'n', + 'value' => array(0 => 'n',1 => 'y') + ), + 'phpmyadmin_url' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[0-9a-zA-Z\:\/\-\.]{0,255}$/', + 'errmsg'=> 'phpmyadmin_url_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'webftp_url' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[0-9a-zA-Z\:\/\-\.]{0,255}$/', + 'errmsg'=> 'webftp_url_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + +$form["tabs"]['mail'] = array ( + 'title' => "Mail", + 'width' => 70, + 'template' => "templates/system_config_mail_edit.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'mailboxlist_webmail_link' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'n', + 'value' => array(0 => 'n',1 => 'y') + ), + 'webmail_url' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[0-9a-zA-Z\:\/\-\.]{0,255}$/', + 'errmsg'=> 'webmail_url_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'mailmailinglist_link' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'n', + 'value' => array(0 => 'n',1 => 'y') + ), + 'mailmailinglist_url' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/^[0-9a-zA-Z\:\/\-\.]{0,255}$/', + 'errmsg'=> 'mailinglist_url_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'admin_mail' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'admin_name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + +$form["tabs"]['domains'] = array ( + 'title' => "Domains", + 'width' => 70, + 'template' => "templates/system_config_domains_edit.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'use_domain_module' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'n', + 'value' => array(0 => 'n',1 => 'y') + ), + 'new_domain_html' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + +$form["tabs"]['misc'] = array ( + 'title' => "Misc", + 'width' => 70, + 'template' => "templates/system_config_misc_edit.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'dashboard_atom_url' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => 'http://www.ispconfig.org/atom', + 'value' => '' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); + + +?> diff --git a/interface/web/admin/form/users.tform.php b/interface/web/admin/form/users.tform.php index 1edbb0cc432afbb6a0e7dd78dd54c095ed3d7624..afe5956310d3b88bb1df985a630774538dc29937 100644 --- a/interface/web/admin/form/users.tform.php +++ b/interface/web/admin/form/users.tform.php @@ -1,456 +1,456 @@ - 0 id must match with id of current user -$form['auth_preset']['userid'] = 0; -//* 0 = default groupid of the user, > 0 id must match with groupid of current user -$form['auth_preset']['groupid'] = 0; - -//** Permissions are: r = read, i = insert, u = update, d = delete -$form['auth_preset']['perm_user'] = 'riud'; -$form['auth_preset']['perm_group'] = 'riud'; -$form['auth_preset']['perm_other'] = ''; - -//* Pick out modules -$modules_list = array(); -$handle = @opendir(ISPC_WEB_PATH); -while ($file = @readdir ($handle)) { - if ($file != '.' && $file != '..') { - if(@is_dir(ISPC_WEB_PATH."/$file")) { - if(is_file(ISPC_WEB_PATH."/$file/lib/module.conf.php") and $file != 'login' && $file != 'designer') { - $modules_list[$file] = $file; - } - } - } -} - -//* Load themes -$themes_list = array(); -$handle = @opendir(ISPC_THEMES_PATH); -while ($file = @readdir ($handle)) { - if (substr($file, 0, 1) != '.') { - if(@is_dir(ISPC_THEMES_PATH."/$file")) { - $themes_list[$file] = $file; - } - } -} - -//* Languages -$language_list = array(); -$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); -while ($file = @readdir ($handle)) { - if ($file != '.' && $file != '..') { - if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { - $tmp = substr($file, 0, 2); - $language_list[$tmp] = $tmp; - } - } -} - -//* Pick out groups -$groups_list = array(); -$tmp_records = $app->db->queryAllRecords('SELECT groupid, name FROM sys_group ORDER BY name'); -if(is_array($tmp_records)) { - foreach($tmp_records as $tmp_rec) { - $groups_list[$tmp_rec['groupid']] = $tmp_rec['name']; - } -} - -$form['tabs']['users'] = array ( - 'title' => 'Users', - 'width' => 80, - 'template' => 'templates/users_user_edit.htm', - 'fields' => array ( - ################################## - # Beginn Datenbankfelder - ################################## - 'username' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'username_empty'), - 1 => array ( 'type' => 'UNIQUE', - 'errmsg'=> 'username_unique'), - 2 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-\_]{0,64}$/', - 'errmsg'=> 'username_err'), - ), - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '15', - 'maxlength' => '30', - 'rows' => '', - 'cols' => '' - ), - 'passwort' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'PASSWORD', - 'encryption'=> 'CRYPT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '15', - 'maxlength' => '100', - 'rows' => '', - 'cols' => '' - ), - 'modules' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOXARRAY', - 'regex' => '', - 'errmsg' => '', - 'default' => 'admin,forms', - 'value' => $modules_list, - 'separator' => ',', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'startmodule' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => $modules_list, - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'app_theme' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'RADIO', - 'regex' => '', - 'errmsg' => '', - 'default' => 'default', - 'value' => $themes_list, - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'typ' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'RADIO', - 'regex' => '', - 'errmsg' => '', - 'default' => 'user', - 'value' => array ('user' => 'user', 'admin' => 'admin'), - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'active' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'CHECKBOX', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => array(0 => 0,1 => 1), - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'language' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => $language_list, - 'separator' => '', - 'width' => '30', - 'maxlength' => '2', - 'rows' => '', - 'cols' => '' - ) - ################################## - # ENDE Datenbankfelder - ################################## - ) -); -/* -$form['tabs']['address'] = array ( - 'title' => 'Address', - 'width' => 80, - 'template' => 'templates/users_address_edit.htm', - 'fields' => array ( - ################################## - # Beginn Datenbankfelder - ################################## - 'name' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'vorname' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'unternehmen' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'strasse' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'ort' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'plz' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'land' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'email' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'url' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'telefon' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'fax' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ) - - ################################## - # ENDE Datenbankfelder - ################################## - ) -); -*/ - -$form['tabs']['groups'] = array ( - 'title' => 'Groups', - 'width' => 80, - 'template' => 'templates/users_groups_edit.htm', - 'fields' => array ( - ################################## - # Beginn Datenbankfelder - ################################## - 'default_group' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => $groups_list, - 'separator' => ',', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'groups' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOXARRAY', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => $groups_list, - 'separator' => ',', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ) - - ################################## - # ENDE Datenbankfelder - ################################## - ) -); - + 0 id must match with id of current user +$form['auth_preset']['userid'] = 0; +//* 0 = default groupid of the user, > 0 id must match with groupid of current user +$form['auth_preset']['groupid'] = 0; + +//** Permissions are: r = read, i = insert, u = update, d = delete +$form['auth_preset']['perm_user'] = 'riud'; +$form['auth_preset']['perm_group'] = 'riud'; +$form['auth_preset']['perm_other'] = ''; + +//* Pick out modules +$modules_list = array(); +$handle = @opendir(ISPC_WEB_PATH); +while ($file = @readdir ($handle)) { + if ($file != '.' && $file != '..') { + if(@is_dir(ISPC_WEB_PATH."/$file")) { + if(is_file(ISPC_WEB_PATH."/$file/lib/module.conf.php") and $file != 'login' && $file != 'designer') { + $modules_list[$file] = $file; + } + } + } +} + +//* Load themes +$themes_list = array(); +$handle = @opendir(ISPC_THEMES_PATH); +while ($file = @readdir ($handle)) { + if (substr($file, 0, 1) != '.') { + if(@is_dir(ISPC_THEMES_PATH."/$file")) { + $themes_list[$file] = $file; + } + } +} + +//* Languages +$language_list = array(); +$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); +while ($file = @readdir ($handle)) { + if ($file != '.' && $file != '..') { + if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { + $tmp = substr($file, 0, 2); + $language_list[$tmp] = $tmp; + } + } +} + +//* Pick out groups +$groups_list = array(); +$tmp_records = $app->db->queryAllRecords('SELECT groupid, name FROM sys_group ORDER BY name'); +if(is_array($tmp_records)) { + foreach($tmp_records as $tmp_rec) { + $groups_list[$tmp_rec['groupid']] = $tmp_rec['name']; + } +} + +$form['tabs']['users'] = array ( + 'title' => 'Users', + 'width' => 80, + 'template' => 'templates/users_user_edit.htm', + 'fields' => array ( + ################################## + # Beginn Datenbankfelder + ################################## + 'username' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'username_empty'), + 1 => array ( 'type' => 'UNIQUE', + 'errmsg'=> 'username_unique'), + 2 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-\_]{0,64}$/', + 'errmsg'=> 'username_err'), + ), + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '15', + 'maxlength' => '30', + 'rows' => '', + 'cols' => '' + ), + 'passwort' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'PASSWORD', + 'encryption'=> 'CRYPT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '15', + 'maxlength' => '100', + 'rows' => '', + 'cols' => '' + ), + 'modules' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'regex' => '', + 'errmsg' => '', + 'default' => 'admin,forms', + 'value' => $modules_list, + 'separator' => ',', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'startmodule' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => $modules_list, + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'app_theme' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'RADIO', + 'regex' => '', + 'errmsg' => '', + 'default' => 'default', + 'value' => $themes_list, + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'typ' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'RADIO', + 'regex' => '', + 'errmsg' => '', + 'default' => 'user', + 'value' => array ('user' => 'user', 'admin' => 'admin'), + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'active' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'CHECKBOX', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => array(0 => 0,1 => 1), + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'language' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => $language_list, + 'separator' => '', + 'width' => '30', + 'maxlength' => '2', + 'rows' => '', + 'cols' => '' + ) + ################################## + # ENDE Datenbankfelder + ################################## + ) +); +/* +$form['tabs']['address'] = array ( + 'title' => 'Address', + 'width' => 80, + 'template' => 'templates/users_address_edit.htm', + 'fields' => array ( + ################################## + # Beginn Datenbankfelder + ################################## + 'name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'vorname' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'unternehmen' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'strasse' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'ort' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'plz' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'land' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'email' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'url' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'telefon' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'fax' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ) + + ################################## + # ENDE Datenbankfelder + ################################## + ) +); +*/ + +$form['tabs']['groups'] = array ( + 'title' => 'Groups', + 'width' => 80, + 'template' => 'templates/users_groups_edit.htm', + 'fields' => array ( + ################################## + # Beginn Datenbankfelder + ################################## + 'default_group' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => $groups_list, + 'separator' => ',', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'groups' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => $groups_list, + 'separator' => ',', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ) + + ################################## + # ENDE Datenbankfelder + ################################## + ) +); + ?> \ No newline at end of file diff --git a/interface/web/admin/lib/lang/en_server_config.lng b/interface/web/admin/lib/lang/en_server_config.lng index c97ca0e5eca3b970e701056c134cbf1a8dd06c9f..f672e9943cc83746c2353019ef52fa7fd2aa5187 100644 --- a/interface/web/admin/lib/lang/en_server_config.lng +++ b/interface/web/admin/lib/lang/en_server_config.lng @@ -1,84 +1,84 @@ - \ No newline at end of file diff --git a/interface/web/admin/lib/lang/en_users.lng b/interface/web/admin/lib/lang/en_users.lng index 0f9a1c5b5629e7cb98931bda27f29bdc44de3873..df0043881168040445f1f0de2e32c60b7a74c872 100644 --- a/interface/web/admin/lib/lang/en_users.lng +++ b/interface/web/admin/lib/lang/en_users.lng @@ -1,28 +1,28 @@ - + diff --git a/interface/web/admin/templates/firewall_edit.htm b/interface/web/admin/templates/firewall_edit.htm index 554f7d0a0c3fb862305357634e3c5fe07e8eb7de..4c59b55764153273b21a9fde3e7229b4d163264f 100644 --- a/interface/web/admin/templates/firewall_edit.htm +++ b/interface/web/admin/templates/firewall_edit.htm @@ -1,38 +1,38 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/admin/templates/groups_edit.htm b/interface/web/admin/templates/groups_edit.htm index 6a3434714fa7ffc38d4586f8d62f070a501aac98..34f1d81efbd93ddd5cbeb29ce79fe3a543ec64fc 100644 --- a/interface/web/admin/templates/groups_edit.htm +++ b/interface/web/admin/templates/groups_edit.htm @@ -1,26 +1,26 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/admin/templates/language_add.htm b/interface/web/admin/templates/language_add.htm index b0ebde4ff703af484f0758614748dee94f3db268..e395c6918cd0961c459766c1b5c9f61213a66c1f 100644 --- a/interface/web/admin/templates/language_add.htm +++ b/interface/web/admin/templates/language_add.htm @@ -1,32 +1,32 @@ -

-

- -
- -
-
Language Add -
- - -
-
- - -

{tmpl_var name='language_new_hint_txt'}

-
- - - - -
- - -
- -
- -
- -
+

+

+ +
+ +
+
Language Add +
+ + +
+
+ + +

{tmpl_var name='language_new_hint_txt'}

+
+ + + + +
+ + +
+ +
+ +
+ +
diff --git a/interface/web/admin/templates/language_edit.htm b/interface/web/admin/templates/language_edit.htm index 1e5d306bb8eaa92b2268632b7568b83983c31993..75376dfaa7999c89253c053a34b633f97c911e7b 100644 --- a/interface/web/admin/templates/language_edit.htm +++ b/interface/web/admin/templates/language_edit.htm @@ -1,32 +1,32 @@ -

-

- -
- -
-
Language File Edit: {tmpl_var name="file_path"} - - - - - - - - -
- - - - - - -
- - -
- - - -
- -
+

+

+ +
+ +
+
Language File Edit: {tmpl_var name="file_path"} + + + + + + + + +
+ + + + + + +
+ + +
+ + + +
+ +
diff --git a/interface/web/admin/templates/language_list.htm b/interface/web/admin/templates/language_list.htm index 4c8fb0c3125281ae8779538a9d4d79b09b13193f..1c05fd3878f7ae09e1b2b2d06b903cc7dcd1934f 100644 --- a/interface/web/admin/templates/language_list.htm +++ b/interface/web/admin/templates/language_list.htm @@ -1,47 +1,47 @@ -

-

- -
- -
-
Tools -
-
- - -
-
-
-
- - - -
+

+

+ +
+ +
+
Tools +
+
+ + +
+
+
+
+ + + +
diff --git a/interface/web/admin/templates/remote_action_ispcupdate.htm b/interface/web/admin/templates/remote_action_ispcupdate.htm index 87266222400a6a8b0a047d733e2b75e5af162f9a..156949a21aba9115bde247b92557062d2c021808 100644 --- a/interface/web/admin/templates/remote_action_ispcupdate.htm +++ b/interface/web/admin/templates/remote_action_ispcupdate.htm @@ -1,25 +1,25 @@ -

-

- -
- -
-
{tmpl_var name='do_ispcupdate_caption'} -
- - -
-
- - -

-
- -
- -
-
- -
+

+

+ +
+ +
+
{tmpl_var name='do_ispcupdate_caption'} +
+ + +
+
+ + +

+
+ +
+ +
+
+ +
diff --git a/interface/web/admin/templates/remote_action_osupdate.htm b/interface/web/admin/templates/remote_action_osupdate.htm index 27dc8e9c850812aba37eaceb67d992ae1bdb7ae4..4e2ac5a56e1fa30f2ee4c7fc5fd09387924f0ba3 100644 --- a/interface/web/admin/templates/remote_action_osupdate.htm +++ b/interface/web/admin/templates/remote_action_osupdate.htm @@ -1,25 +1,25 @@ -

-

- -
- -
-
{tmpl_var name='do_osupdate_caption'} -
- - -
-
- - -

-
- -
- -
-
- -
+

+

+ +
+ +
+
{tmpl_var name='do_osupdate_caption'} +
+ + +
+
+ + +

+
+ +
+ +
+
+ +
diff --git a/interface/web/admin/templates/server_config_cron_edit.htm b/interface/web/admin/templates/server_config_cron_edit.htm index 066693ed83089e005f0ce1834c04af5f17ade95c..c378938c4397e8a2c1ab07071f0602c7c3550e2c 100644 --- a/interface/web/admin/templates/server_config_cron_edit.htm +++ b/interface/web/admin/templates/server_config_cron_edit.htm @@ -1,30 +1,30 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/admin/templates/server_config_fastcgi_edit.htm b/interface/web/admin/templates/server_config_fastcgi_edit.htm index 8551d87abb5530b7e6670f5479416a6e95d6924c..6e1bfea33619bb11f4302f81c1e4cfc8c45dd68c 100644 --- a/interface/web/admin/templates/server_config_fastcgi_edit.htm +++ b/interface/web/admin/templates/server_config_fastcgi_edit.htm @@ -1,46 +1,46 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/admin/templates/server_config_getmail_edit.htm b/interface/web/admin/templates/server_config_getmail_edit.htm index fc86eb4cadc443a292910d4bf4f846c7c2b0225f..e8112cce4452e24176b185c376cb9e9a0584a769 100644 --- a/interface/web/admin/templates/server_config_getmail_edit.htm +++ b/interface/web/admin/templates/server_config_getmail_edit.htm @@ -1,22 +1,22 @@ -

-

- -
- -
-
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/admin/templates/server_config_jailkit_edit.htm b/interface/web/admin/templates/server_config_jailkit_edit.htm index 320fb875429a886a2522319e34fdc788ab3cd2e6..2dd603539acd4431c5fbfc7fd93b8d667bb3459f 100644 --- a/interface/web/admin/templates/server_config_jailkit_edit.htm +++ b/interface/web/admin/templates/server_config_jailkit_edit.htm @@ -1,34 +1,34 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/admin/templates/server_config_vlogger_edit.htm b/interface/web/admin/templates/server_config_vlogger_edit.htm index bf6a82ab31f92c3e3a53f348af2d93b468962b6f..f468faec72b28c313b8118712a4214f544a440ff 100644 --- a/interface/web/admin/templates/server_config_vlogger_edit.htm +++ b/interface/web/admin/templates/server_config_vlogger_edit.htm @@ -1,22 +1,22 @@ -

-

- -
- -
-
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/admin/templates/server_edit_config.htm b/interface/web/admin/templates/server_edit_config.htm index 02f6ef34d35b0378a86611afd51166aa2a37c750..31208dc3ed38a736c23c4871a70fcc9fbca68cea 100644 --- a/interface/web/admin/templates/server_edit_config.htm +++ b/interface/web/admin/templates/server_edit_config.htm @@ -1,22 +1,22 @@ -

-

- -
- -
-
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/admin/templates/server_ip_edit.htm b/interface/web/admin/templates/server_ip_edit.htm index 1ebe8bd91a02df425f50f70b02be17d46bd50b46..87e3d4bb77db7974a0ded9d23c7cccfb1d9044fd 100644 --- a/interface/web/admin/templates/server_ip_edit.htm +++ b/interface/web/admin/templates/server_ip_edit.htm @@ -1,34 +1,34 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
-

{tmpl_var name='virtualhost_txt'}

-
- {tmpl_var name='virtualhost'} -
-
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+

{tmpl_var name='virtualhost_txt'}

+
+ {tmpl_var name='virtualhost'} +
+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/admin/templates/software_package_install.htm b/interface/web/admin/templates/software_package_install.htm index d034de77d16abdc91a69a19b309fd649c1d7f9d2..fddda4f2de87f95924b11857fc3a3c3abe103a6c 100644 --- a/interface/web/admin/templates/software_package_install.htm +++ b/interface/web/admin/templates/software_package_install.htm @@ -1,30 +1,30 @@ -

-

- -
- -
-
- -
-
- -
-
-

 

-
- - -
- - - -

 

-
- - -
-
-
-
+

+

+ +
+ +
+
+ +
+
+ +
+
+

 

+
+ + +
+ + + +

 

+
+ + +
+
+
+
\ No newline at end of file diff --git a/interface/web/admin/templates/software_package_list.htm b/interface/web/admin/templates/software_package_list.htm index 2c16c583da6060e68ec74bb06717143627c40375..7a94318fd5c6277b103b8fd26d319870bfdde587 100644 --- a/interface/web/admin/templates/software_package_list.htm +++ b/interface/web/admin/templates/software_package_list.htm @@ -1,46 +1,46 @@ -

-

- -
- -
-
{tmpl_var name="toolsarea_head_txt"} -
- -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
{tmpl_var name="installed"}{tmpl_var name="package_title"}{tmpl_var name="package_description"}ispapp{tmpl_var name="package_id"}
-
-
- -
+

+

+ +
+ +
+
{tmpl_var name="toolsarea_head_txt"} +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
{tmpl_var name="installed"}{tmpl_var name="package_title"}{tmpl_var name="package_description"}ispapp{tmpl_var name="package_id"}
+
+
+ +
diff --git a/interface/web/admin/templates/software_repo_edit.htm b/interface/web/admin/templates/software_repo_edit.htm index af335ecf5cf7df3cec20ff177e35c266ef3e47d6..31b5db05c5400bc6bcb1aedac044c73a6f08e199 100644 --- a/interface/web/admin/templates/software_repo_edit.htm +++ b/interface/web/admin/templates/software_repo_edit.htm @@ -1,40 +1,40 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/admin/templates/software_update_list.htm b/interface/web/admin/templates/software_update_list.htm index db2b03631d02b2b1237f525a2a3dc899ba76658a..d707fc9ba98f8cf8ccd239f5af029d20e8867256 100644 --- a/interface/web/admin/templates/software_update_list.htm +++ b/interface/web/admin/templates/software_update_list.htm @@ -1,49 +1,49 @@ -

-

- -
- -
-
Tools -
-
- - -
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - -
{tmpl_var name="installed"}{tmpl_var name="update_title"}{tmpl_var name="version"}
-
-
- -
+

+

+ +
+ +
+
Tools +
+
+ + +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + +
{tmpl_var name="installed"}{tmpl_var name="update_title"}{tmpl_var name="version"}
+
+
+ +
diff --git a/interface/web/admin/templates/users_groups_edit.htm b/interface/web/admin/templates/users_groups_edit.htm index 004c7dbd6ec5f97fe2d402d6de86cd07bb25b2ab..0a1a9797f0fcdcc6b5430bbbfe55991de6f6c79d 100644 --- a/interface/web/admin/templates/users_groups_edit.htm +++ b/interface/web/admin/templates/users_groups_edit.htm @@ -1,30 +1,30 @@ -

-

- -
- -
-
-
- - -
-
-

{tmpl_var name='groups_txt'}

-
- {tmpl_var name='groups'} -
-
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+

{tmpl_var name='groups_txt'}

+
+ {tmpl_var name='groups'} +
+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/admin/templates/users_user_edit.htm b/interface/web/admin/templates/users_user_edit.htm index ce0017823f02b9e0507cc431b2088839c4d41e55..f16e9ebf352e5a3c65bb1dbef63a35b6c951bdfa 100644 --- a/interface/web/admin/templates/users_user_edit.htm +++ b/interface/web/admin/templates/users_user_edit.htm @@ -1,67 +1,67 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
-

{tmpl_var name='password_strength_txt'}

-
-

 

-
-
-

{tmpl_var name='modules_txt'}

-
- {tmpl_var name='modules'} -
-
-
- - -
-
-

{tmpl_var name='app_theme_txt'}

-
- {tmpl_var name='app_theme'} -
-
-
-

{tmpl_var name='typ_txt'}

-
- {tmpl_var name='typ'} -
-
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+

{tmpl_var name='password_strength_txt'}

+
+

 

+
+
+

{tmpl_var name='modules_txt'}

+
+ {tmpl_var name='modules'} +
+
+
+ + +
+
+

{tmpl_var name='app_theme_txt'}

+
+ {tmpl_var name='app_theme'} +
+
+
+

{tmpl_var name='typ_txt'}

+
+ {tmpl_var name='typ'} +
+
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/capp.php b/interface/web/capp.php index 354652ce37052055109fb5923641c52a9debcfe8..02f5c7faed7fb279031f7630225e9b07c277d1bf 100644 --- a/interface/web/capp.php +++ b/interface/web/capp.php @@ -1,56 +1,56 @@ -error($app->lng(301)); - -// lade Moduldaten in Session -if(is_file($mod."/lib/module.conf.php")) { - include_once($mod."/lib/module.conf.php"); - $_SESSION["s"]["module"] = $module; - echo "HEADER_REDIRECT:".$_SESSION["s"]["module"]["startpage"]; -} else { - $app->error($app->lng(302)); -} +error($app->lng(301)); + +// lade Moduldaten in Session +if(is_file($mod."/lib/module.conf.php")) { + include_once($mod."/lib/module.conf.php"); + $_SESSION["s"]["module"] = $module; + echo "HEADER_REDIRECT:".$_SESSION["s"]["module"]["startpage"]; +} else { + $app->error($app->lng(302)); +} ?> \ No newline at end of file diff --git a/interface/web/client/form/client.tform.php b/interface/web/client/form/client.tform.php index 61daec17598946c20721d30b25c69303829e8642..b6a54ae99d34588bf4f81b27a01dcb36aa65146c 100644 --- a/interface/web/client/form/client.tform.php +++ b/interface/web/client/form/client.tform.php @@ -1,860 +1,860 @@ - 0 id must match with id of current user -$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user -$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete -$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete -$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete - -//* Languages -$language_list = array(); -$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); -while ($file = @readdir ($handle)) { - if ($file != '.' && $file != '..') { - if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { - $tmp = substr($file, 0, 2); - $language_list[$tmp] = $tmp; - } - } -} - -//* Load themes -$themes_list = array(); -$handle = @opendir(ISPC_THEMES_PATH); -while ($file = @readdir ($handle)) { - if (substr($file, 0, 1) != '.') { - if(@is_dir(ISPC_THEMES_PATH."/$file")) { - $themes_list[$file] = $file; - } - } -} - -$form["tabs"]['address'] = array ( - 'title' => "Address", - 'width' => 100, - 'template' => "templates/client_edit_address.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'company_name' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'contact_name' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'contact_error_empty'), - ), - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'customer_no' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'username' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'username_error_empty'), - 1 => array ( 'type' => 'CUSTOM', - 'class' => 'validate_client', - 'function' => 'username_unique', - 'errmsg'=> 'username_error_unique'), - 2 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-\_]{0,64}$/', - 'errmsg'=> 'username_error_regex'), - ), - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'password' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'PASSWORD', - 'encryption'=> 'CRYPT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'language' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => $conf["language"], - 'value' => $language_list, - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'usertheme' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => 'default', - 'value' => $themes_list, - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'street' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'zip' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'city' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'state' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'country' => array ( - 'datatype' => 'VARCHAR', - - 'formtype' => 'SELECT', - 'default' => 'DE', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name', - 'keyfield'=> 'iso', - 'valuefield'=> 'printable_name' - ), - 'value' => '' - ), - 'telephone' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'mobile' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'fax' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'email' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'internet' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => 'http://', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'icq' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'vat_id' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'company_id' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '20', - 'rows' => '', - 'cols' => '' - ), - 'notes' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'TEXTAREA', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '', - 'maxlength' => '', - 'rows' => '10', - 'cols' => '30' - ), - ################################## - # END Datatable fields - ################################## - ) -); - -$form["tabs"]['limits'] = array ( - 'title' => "Limits", - 'width' => 80, - 'template' => "templates/client_edit_limits.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'template_master' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'CUSTOM', - 'class'=> 'custom_datasource', - 'function'=> 'master_templates' - ), - 'value' => '' - ), - 'template_additional' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - ), - 'default_mailserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'CUSTOM', - 'class'=> 'custom_datasource', - 'function'=> 'client_servers' - ), - 'value' => '', - 'name' => 'default_mailserver' - ), - 'limit_maildomain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_maildomain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailbox' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailbox_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailalias' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailalias_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailaliasdomain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailaliasdomain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailmailinglist' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailmailinglist_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailforward' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailforward_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailcatchall' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailcatchall_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailrouting' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailrouting_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailfilter' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailfilter_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_fetchmail' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailfetchmail_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailquota' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailquota_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_spamfilter_wblist' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_spamfilter_wblist_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_spamfilter_user' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_spamfilter_user_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_spamfilter_policy' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_spamfilter_policy_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'default_webserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'CUSTOM', - 'class'=> 'custom_datasource', - 'function'=> 'client_servers' - ), - 'value' => '', - 'name' => 'default_webserver' - ), - 'limit_web_domain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_domain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_web_quota' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_quota_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'web_php_options' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOXARRAY', - 'default' => '', - 'separator' => ',', - 'valuelimit' => 'client:web_php_options', - 'value' => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP') - ), - 'limit_web_aliasdomain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_aliasdomain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_web_subdomain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_subdomain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_ftp_user' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_ftp_user_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_shell_user' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_shell_user_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'ssh_chroot' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOXARRAY', - 'default' => '', - 'separator' => ',', - 'valuelimit' => 'client:ssh_chroot', - 'value' => array('no' => 'None', 'jailkit' => 'Jailkit') - ), - 'limit_webdav_user' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_webdav_user_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'default_dnsserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'CUSTOM', - 'class'=> 'custom_datasource', - 'function'=> 'client_servers' - ), - 'value' => '', - 'name' => 'default_dnsserver' - ), - 'limit_dns_zone' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_dns_zone_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_dns_slave_zone' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_dns_slave_zone_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_dns_record' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_dns_record_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_client' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_client_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'default_dbserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'CUSTOM', - 'class'=> 'custom_datasource', - 'function'=> 'client_servers' - ), - 'value' => '', - 'name' => 'default_dbserver' - ), - 'limit_database' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_database_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_cron' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_cron_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_cron_type' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => '', - 'value' => array('full' => 'Full Cron','chrooted' => 'Chrooted Cron','url' => 'URL Cron') - ), - 'limit_cron_frequency' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_cron_error_frequency'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_traffic_quota' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_traffic_quota_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - ################################## - # END Datatable fields - ################################## - ) -); - -/* -$form["tabs"]['ipaddress'] = array ( - 'title' => "IP Addresses", - 'width' => 100, - 'template' => "templates/client_edit_ipaddress.htm", - 'fields' => array ( - ################################## - # Beginn Datatable fields - ################################## - 'ip_address' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'CHECKBOXARRAY', - 'default' => '', - 'value' => array('192.168.0.1' => '192.168.0.1', '192.168.0.2' => '192.168.0.2'), - 'separator' => ';' - ), - ################################## - # ENDE Datatable fields - ################################## - ) -); -*/ - - -?> + 0 id must match with id of current user +$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user +$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete + +//* Languages +$language_list = array(); +$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); +while ($file = @readdir ($handle)) { + if ($file != '.' && $file != '..') { + if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { + $tmp = substr($file, 0, 2); + $language_list[$tmp] = $tmp; + } + } +} + +//* Load themes +$themes_list = array(); +$handle = @opendir(ISPC_THEMES_PATH); +while ($file = @readdir ($handle)) { + if (substr($file, 0, 1) != '.') { + if(@is_dir(ISPC_THEMES_PATH."/$file")) { + $themes_list[$file] = $file; + } + } +} + +$form["tabs"]['address'] = array ( + 'title' => "Address", + 'width' => 100, + 'template' => "templates/client_edit_address.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'company_name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'contact_name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'contact_error_empty'), + ), + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'customer_no' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'username' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'username_error_empty'), + 1 => array ( 'type' => 'CUSTOM', + 'class' => 'validate_client', + 'function' => 'username_unique', + 'errmsg'=> 'username_error_unique'), + 2 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-\_]{0,64}$/', + 'errmsg'=> 'username_error_regex'), + ), + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'password' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'PASSWORD', + 'encryption'=> 'CRYPT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'language' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => $conf["language"], + 'value' => $language_list, + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'usertheme' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'default', + 'value' => $themes_list, + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'street' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'zip' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'city' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'state' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'country' => array ( + 'datatype' => 'VARCHAR', + + 'formtype' => 'SELECT', + 'default' => 'DE', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name', + 'keyfield'=> 'iso', + 'valuefield'=> 'printable_name' + ), + 'value' => '' + ), + 'telephone' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'mobile' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'fax' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'email' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'internet' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => 'http://', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'icq' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'vat_id' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'company_id' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '20', + 'rows' => '', + 'cols' => '' + ), + 'notes' => array ( + 'datatype' => 'TEXT', + 'formtype' => 'TEXTAREA', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '', + 'maxlength' => '', + 'rows' => '10', + 'cols' => '30' + ), + ################################## + # END Datatable fields + ################################## + ) +); + +$form["tabs"]['limits'] = array ( + 'title' => "Limits", + 'width' => 80, + 'template' => "templates/client_edit_limits.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'template_master' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'master_templates' + ), + 'value' => '' + ), + 'template_additional' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + ), + 'default_mailserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'client_servers' + ), + 'value' => '', + 'name' => 'default_mailserver' + ), + 'limit_maildomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_maildomain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailbox' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailbox_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailalias' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailalias_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailaliasdomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailaliasdomain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailmailinglist' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailmailinglist_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailforward' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailforward_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailcatchall' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailcatchall_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailrouting' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailrouting_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailfilter' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailfilter_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_fetchmail' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailfetchmail_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailquota' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailquota_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_wblist' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_wblist_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_user_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_policy' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_policy_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'default_webserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'client_servers' + ), + 'value' => '', + 'name' => 'default_webserver' + ), + 'limit_web_domain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_domain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_web_quota' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_quota_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'web_php_options' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'separator' => ',', + 'valuelimit' => 'client:web_php_options', + 'value' => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP') + ), + 'limit_web_aliasdomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_aliasdomain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_web_subdomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_subdomain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_ftp_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_ftp_user_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_shell_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_shell_user_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'ssh_chroot' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'separator' => ',', + 'valuelimit' => 'client:ssh_chroot', + 'value' => array('no' => 'None', 'jailkit' => 'Jailkit') + ), + 'limit_webdav_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_webdav_user_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'default_dnsserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'client_servers' + ), + 'value' => '', + 'name' => 'default_dnsserver' + ), + 'limit_dns_zone' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_dns_zone_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_dns_slave_zone' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_dns_slave_zone_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_dns_record' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_dns_record_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_client' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_client_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'default_dbserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'client_servers' + ), + 'value' => '', + 'name' => 'default_dbserver' + ), + 'limit_database' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_database_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_cron' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_cron_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_cron_type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => '', + 'value' => array('full' => 'Full Cron','chrooted' => 'Chrooted Cron','url' => 'URL Cron') + ), + 'limit_cron_frequency' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_cron_error_frequency'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_traffic_quota' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_traffic_quota_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + ################################## + # END Datatable fields + ################################## + ) +); + +/* +$form["tabs"]['ipaddress'] = array ( + 'title' => "IP Addresses", + 'width' => 100, + 'template' => "templates/client_edit_ipaddress.htm", + 'fields' => array ( + ################################## + # Beginn Datatable fields + ################################## + 'ip_address' => array ( + 'datatype' => 'TEXT', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'value' => array('192.168.0.1' => '192.168.0.1', '192.168.0.2' => '192.168.0.2'), + 'separator' => ';' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); +*/ + + +?> diff --git a/interface/web/client/form/client_template.tform.php b/interface/web/client/form/client_template.tform.php index dc1627ce120e2f9526f228b686535fc1943a39e0..628def1a6989cfa5a797b342136b8103c5abc63d 100644 --- a/interface/web/client/form/client_template.tform.php +++ b/interface/web/client/form/client_template.tform.php @@ -1,524 +1,524 @@ - 0 id must match with id of current user -$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user -$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete -$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete -$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete - -//* Languages -$language_list = array(); -$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); -while ($file = @readdir ($handle)) { - if ($file != '.' && $file != '..') { - if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { - $tmp = substr($file, 0, 2); - $language_list[$tmp] = $tmp; - } - } -} - -$form["tabs"]['template'] = array ( - 'title' => "Template", - 'width' => 80, - 'template' => "templates/client_template_edit_template.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'template_type' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => 'm', - 'value' => array('m' => "Main Template",'a' => "Additional Template"), - ), - 'template_name' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'error_template_name_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - ################################## - # END Datatable fields - ################################## - ) -); - -$form["tabs"]['limits'] = array ( - 'title' => "Limits", - 'width' => 80, - 'template' => "templates/client_template_edit_limits.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'limit_maildomain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_maildomain_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailbox' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailbox_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailalias' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailalias_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailaliasdomain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailaliasdomain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailmailinglist' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailmailinglist_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailforward' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailforward_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailcatchall' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailcatchall_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailrouting' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailrouting_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailfilter' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailfilter_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_fetchmail' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailfetchmail_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailquota' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailquota_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_spamfilter_wblist' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_spamfilter_wblist_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_spamfilter_user' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_spamfilter_user_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_spamfilter_policy' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_spamfilter_policy_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_web_domain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_domain_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_web_quota' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_quota_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_web_aliasdomain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_aliasdomain_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_web_subdomain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_subdomain_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_ftp_user' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_ftp_user_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_shell_user' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_shell_user_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_webdav_user' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_webdav_user_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_dns_zone' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_dns_zone_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_dns_slave_zone' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_dns_slave_zone_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_dns_record' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_dns_record_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - /* - 'limit_client' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_client_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - */ - 'limit_database' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_database_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_cron' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_cron_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_cron_type' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => '', - 'value' => array('full' => 'Full Cron','chrooted' => 'Chrooted Cron','url' => 'URL Cron') - ), - 'limit_cron_frequency' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_cron_error_frequency'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_traffic_quota' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_traffic_quota_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - ################################## - # END Datatable fields - ################################## - ) -); - -?> + 0 id must match with id of current user +$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user +$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete + +//* Languages +$language_list = array(); +$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); +while ($file = @readdir ($handle)) { + if ($file != '.' && $file != '..') { + if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { + $tmp = substr($file, 0, 2); + $language_list[$tmp] = $tmp; + } + } +} + +$form["tabs"]['template'] = array ( + 'title' => "Template", + 'width' => 80, + 'template' => "templates/client_template_edit_template.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'template_type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'm', + 'value' => array('m' => "Main Template",'a' => "Additional Template"), + ), + 'template_name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'error_template_name_empty'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + ################################## + # END Datatable fields + ################################## + ) +); + +$form["tabs"]['limits'] = array ( + 'title' => "Limits", + 'width' => 80, + 'template' => "templates/client_template_edit_limits.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'limit_maildomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_maildomain_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailbox' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailbox_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailalias' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailalias_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailaliasdomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailaliasdomain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailmailinglist' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailmailinglist_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailforward' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailforward_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailcatchall' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailcatchall_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailrouting' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailrouting_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailfilter' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailfilter_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_fetchmail' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailfetchmail_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailquota' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailquota_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_wblist' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_wblist_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_user_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_policy' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_policy_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_web_domain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_domain_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_web_quota' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_quota_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_web_aliasdomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_aliasdomain_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_web_subdomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_subdomain_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_ftp_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_ftp_user_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_shell_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_shell_user_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_webdav_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_webdav_user_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_dns_zone' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_dns_zone_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_dns_slave_zone' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_dns_slave_zone_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_dns_record' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_dns_record_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + /* + 'limit_client' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_client_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + */ + 'limit_database' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_database_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_cron' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_cron_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_cron_type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => '', + 'value' => array('full' => 'Full Cron','chrooted' => 'Chrooted Cron','url' => 'URL Cron') + ), + 'limit_cron_frequency' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_cron_error_frequency'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_traffic_quota' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_traffic_quota_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + ################################## + # END Datatable fields + ################################## + ) +); + +?> diff --git a/interface/web/client/form/reseller.tform.php b/interface/web/client/form/reseller.tform.php index ebd8af79cd7c96127a3262a29eb0c846fb8f0426..e35447f3c84b4a59efc016778be0ce148b87d84e 100644 --- a/interface/web/client/form/reseller.tform.php +++ b/interface/web/client/form/reseller.tform.php @@ -1,640 +1,640 @@ - 0 id must match with id of current user -$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user -$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete -$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete -$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete - -//* Languages -$language_list = array(); -$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); -while ($file = @readdir ($handle)) { - if ($file != '.' && $file != '..') { - if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { - $tmp = substr($file, 0, 2); - $language_list[$tmp] = $tmp; - } - } -} - -$form["tabs"]['address'] = array ( - 'title' => "Address", - 'width' => 100, - 'template' => "templates/reseller_edit_address.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'company_name' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'contact_name' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'contact_error_empty'), - ), - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'customer_no' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'username' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'username_error_empty'), - 1 => array ( 'type' => 'CUSTOM', - 'class' => 'validate_client', - 'function' => 'username_unique', - 'errmsg'=> 'username_error_unique'), - 2 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-\_]{0,64}$/', - 'errmsg'=> 'username_error_regex'), - ), - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'password' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'PASSWORD', - 'encryption'=> 'CRYPT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'language' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => $conf["language"], - 'value' => $language_list, - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'usertheme' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => 'default', - 'value' => array('default' => 'default'), - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'street' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'zip' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'city' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'state' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'country' => array ( - 'datatype' => 'VARCHAR', - - 'formtype' => 'SELECT', - 'default' => 'DE', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name', - 'keyfield'=> 'iso', - 'valuefield'=> 'printable_name' - ), - 'value' => '' - ), - 'telephone' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'mobile' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'fax' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'email' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'internet' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => 'http://', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'icq' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'vat_id' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'notes' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'TEXTAREA', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '', - 'maxlength' => '', - 'rows' => '10', - 'cols' => '30' - ), - ################################## - # END Datatable fields - ################################## - ) -); - -$form["tabs"]['limits'] = array ( - 'title' => "Limits", - 'width' => 80, - 'template' => "templates/reseller_edit_limits.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'template_master' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'CUSTOM', - 'class'=> 'custom_datasource', - 'function'=> 'master_templates' - ), - 'value' => '' - ), - 'template_additional' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - ), - 'default_mailserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - 'limit_maildomain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_maildomain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailmailinglist' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailmailinglist_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailbox' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailbox_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailalias' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailalias_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailforward' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailforward_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailcatchall' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailcatchall_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailrouting' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailrouting_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailfilter' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailfilter_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_fetchmail' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailfetchmail_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_mailquota' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_mailquota_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_spamfilter_wblist' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_spamfilter_wblist_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_spamfilter_user' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_spamfilter_user_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_spamfilter_policy' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_spamfilter_policy_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'default_webserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE web_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - 'limit_web_domain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_domain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_web_quota' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_quota_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'web_php_options' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOXARRAY', - 'default' => '', - 'separator' => ',', - 'value' => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP') - ), - 'limit_web_aliasdomain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_aliasdomain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_web_subdomain' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_web_subdomain_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_ftp_user' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_ftp_user_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_shell_user' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_shell_user_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'ssh_chroot' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOXARRAY', - 'default' => '', - 'separator' => ',', - 'value' => array('no' => 'None', 'jailkit' => 'Jailkit') - ), + 0 id must match with id of current user +$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user +$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete + +//* Languages +$language_list = array(); +$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); +while ($file = @readdir ($handle)) { + if ($file != '.' && $file != '..') { + if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { + $tmp = substr($file, 0, 2); + $language_list[$tmp] = $tmp; + } + } +} + +$form["tabs"]['address'] = array ( + 'title' => "Address", + 'width' => 100, + 'template' => "templates/reseller_edit_address.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'company_name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'contact_name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'contact_error_empty'), + ), + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'customer_no' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'username' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'username_error_empty'), + 1 => array ( 'type' => 'CUSTOM', + 'class' => 'validate_client', + 'function' => 'username_unique', + 'errmsg'=> 'username_error_unique'), + 2 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-\_]{0,64}$/', + 'errmsg'=> 'username_error_regex'), + ), + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'password' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'PASSWORD', + 'encryption'=> 'CRYPT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'language' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => $conf["language"], + 'value' => $language_list, + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'usertheme' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'default', + 'value' => array('default' => 'default'), + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'street' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'zip' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'city' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'state' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'country' => array ( + 'datatype' => 'VARCHAR', + + 'formtype' => 'SELECT', + 'default' => 'DE', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name', + 'keyfield'=> 'iso', + 'valuefield'=> 'printable_name' + ), + 'value' => '' + ), + 'telephone' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'mobile' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'fax' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'email' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'internet' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => 'http://', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'icq' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'vat_id' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'notes' => array ( + 'datatype' => 'TEXT', + 'formtype' => 'TEXTAREA', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '', + 'maxlength' => '', + 'rows' => '10', + 'cols' => '30' + ), + ################################## + # END Datatable fields + ################################## + ) +); + +$form["tabs"]['limits'] = array ( + 'title' => "Limits", + 'width' => 80, + 'template' => "templates/reseller_edit_limits.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'template_master' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'master_templates' + ), + 'value' => '' + ), + 'template_additional' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + ), + 'default_mailserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'limit_maildomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_maildomain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailmailinglist' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailmailinglist_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailbox' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailbox_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailalias' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailalias_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailforward' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailforward_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailcatchall' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailcatchall_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailrouting' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailrouting_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailfilter' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailfilter_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_fetchmail' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailfetchmail_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailquota' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailquota_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_wblist' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_wblist_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_user_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_policy' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_policy_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'default_webserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE web_server = 1 AND {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'limit_web_domain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_domain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_web_quota' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_quota_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'web_php_options' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'separator' => ',', + 'value' => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP') + ), + 'limit_web_aliasdomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_aliasdomain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_web_subdomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_subdomain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_ftp_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_ftp_user_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_shell_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_shell_user_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'ssh_chroot' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'separator' => ',', + 'value' => array('no' => 'None', 'jailkit' => 'Jailkit') + ), 'limit_webdav_user' => array ( 'datatype' => 'INTEGER', 'formtype' => 'TEXT', @@ -649,177 +649,177 @@ $form["tabs"]['limits'] = array ( 'rows' => '', 'cols' => '' ), - 'default_dnsserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE dns_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - 'limit_dns_zone' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_dns_zone_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_dns_slave_zone' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_dns_slave_zone_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_dns_record' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_dns_record_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_client' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_client_error_notint'), - 1 => array ( 'type' => 'CUSTOM', - 'class' => 'validate_reseller', - 'function' => 'limit_client'), - ), - 'default' => '1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'default_dbserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE db_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - 'limit_database' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_database_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_cron' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_cron_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_cron_type' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => '', - 'value' => array('full' => 'Full Cron','chrooted' => 'Chrooted Cron','url' => 'URL Cron') - ), - 'limit_cron_frequency' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_cron_error_frequency'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_traffic_quota' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_traffic_quota_error_notint'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - ################################## - # END Datatable fields - ################################## - ) -); - -/* -$form["tabs"]['ipaddress'] = array ( - 'title' => "IP Addresses", - 'width' => 100, - 'template' => "templates/client_edit_ipaddress.htm", - 'fields' => array ( - ################################## - # Beginn Datatable fields - ################################## - 'ip_address' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'CHECKBOXARRAY', - 'default' => '', - 'value' => array('192.168.0.1' => '192.168.0.1', '192.168.0.2' => '192.168.0.2'), - 'separator' => ';' - ), - ################################## - # ENDE Datatable fields - ################################## - ) -); -*/ - - -?> + 'default_dnsserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE dns_server = 1 AND {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'limit_dns_zone' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_dns_zone_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_dns_slave_zone' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_dns_slave_zone_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_dns_record' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_dns_record_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_client' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_client_error_notint'), + 1 => array ( 'type' => 'CUSTOM', + 'class' => 'validate_reseller', + 'function' => 'limit_client'), + ), + 'default' => '1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'default_dbserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE db_server = 1 AND {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'limit_database' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_database_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_cron' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_cron_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_cron_type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => '', + 'value' => array('full' => 'Full Cron','chrooted' => 'Chrooted Cron','url' => 'URL Cron') + ), + 'limit_cron_frequency' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_cron_error_frequency'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_traffic_quota' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_traffic_quota_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + ################################## + # END Datatable fields + ################################## + ) +); + +/* +$form["tabs"]['ipaddress'] = array ( + 'title' => "IP Addresses", + 'width' => 100, + 'template' => "templates/client_edit_ipaddress.htm", + 'fields' => array ( + ################################## + # Beginn Datatable fields + ################################## + 'ip_address' => array ( + 'datatype' => 'TEXT', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'value' => array('192.168.0.1' => '192.168.0.1', '192.168.0.2' => '192.168.0.2'), + 'separator' => ';' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); +*/ + + +?> diff --git a/interface/web/client/lib/admin.conf.php b/interface/web/client/lib/admin.conf.php index a45d4403455c5c46f438046f088398e241cbc3d9..67c94a5742572786e8c7c2ae67750c31231a4b64 100644 --- a/interface/web/client/lib/admin.conf.php +++ b/interface/web/client/lib/admin.conf.php @@ -1,2 +1,2 @@ - \ No newline at end of file diff --git a/interface/web/client/templates/client_edit_address.htm b/interface/web/client/templates/client_edit_address.htm index 520c3fa32c7c4f31bfbaa5cb8aa5425edfd14010..850804637bdd2d58e6e8ebe00cf6f5a12636a098 100644 --- a/interface/web/client/templates/client_edit_address.htm +++ b/interface/web/client/templates/client_edit_address.htm @@ -1,114 +1,114 @@ -

-

- -
- -
-
Address -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='password_strength_txt'}

-
-

 

-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
- {tmpl_var name='required_fields_txt'} -
- - - -
- - -
-
- -
+

+

+ +
+ +
+
Address +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='password_strength_txt'}

+
+

 

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ {tmpl_var name='required_fields_txt'} +
+ + + +
+ + +
+
+ +
diff --git a/interface/web/client/templates/client_edit_limits.htm b/interface/web/client/templates/client_edit_limits.htm index ae6ad737bb4af8092e8bdaabdd73e3b0f402e7db..c8b8819dd07a2cae39739c72f15a0de3a143e2a6 100644 --- a/interface/web/client/templates/client_edit_limits.htm +++ b/interface/web/client/templates/client_edit_limits.htm @@ -1,202 +1,202 @@ -

-

- -
- - -
-
{tmpl_var name="toolsarea_head_txt"} -
- - -
-
-
-
- -
-
Limits - -
- - -
-
- - -


{tmpl_var name='template_additional_list'}
- -
-
-   -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -  MB -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -  MB -
-
-

{tmpl_var name='web_php_options_txt'}

-
- {tmpl_var name='web_php_options'} -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='ssh_chroot_txt'}

-
- {tmpl_var name='ssh_chroot'} -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -  MB -
-
- - - -
- - -
-
- -
+

+

+ +
+ + +
+
{tmpl_var name="toolsarea_head_txt"} +
+ + +
+
+
+
+ +
+
Limits + +
+ + +
+
+ + +


{tmpl_var name='template_additional_list'}
+ +
+
+   +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +  MB +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +  MB +
+
+

{tmpl_var name='web_php_options_txt'}

+
+ {tmpl_var name='web_php_options'} +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='ssh_chroot_txt'}

+
+ {tmpl_var name='ssh_chroot'} +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +  MB +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/client/templates/client_template_edit_limits.htm b/interface/web/client/templates/client_template_edit_limits.htm index 5e405a177f6619dd46d6f04873ead7b1b4c63bbb..a1c67129e947e0634a7121d3365d358e589d2f5b 100644 --- a/interface/web/client/templates/client_template_edit_limits.htm +++ b/interface/web/client/templates/client_template_edit_limits.htm @@ -1,136 +1,136 @@ -

-

- -
- -
-
Limits -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -  MB -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -  MB -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
Limits +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +  MB +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +  MB +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/client/templates/client_template_edit_template.htm b/interface/web/client/templates/client_template_edit_template.htm index 6c9d905340c747b10454ae98010cc0f732e336eb..a3a8fe577b6f7da04c968bfc75a8c2b01ac68cb7 100644 --- a/interface/web/client/templates/client_template_edit_template.htm +++ b/interface/web/client/templates/client_template_edit_template.htm @@ -1,28 +1,28 @@ -

-

- -
- -
-
Template -
- - -
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
Template +
+ + +
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/client/templates/reseller_edit_limits.htm b/interface/web/client/templates/reseller_edit_limits.htm index 280a24ed198da2c40e29545f464a17bfa2f1889c..7ac35191725c07fa94fca3eafc144f9b66a78bf9 100644 --- a/interface/web/client/templates/reseller_edit_limits.htm +++ b/interface/web/client/templates/reseller_edit_limits.htm @@ -1,191 +1,191 @@ -

-

- -
- -
-
Limits - -
- - -
-
- - - {tmpl_var name='template_additional_list'} - -
-
-   -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -  MB -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -  MB -
-
-

{tmpl_var name='web_php_options_txt'}

-
- {tmpl_var name='web_php_options'} -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='ssh_chroot_txt'}

-
- {tmpl_var name='ssh_chroot'} -
-
+

+

+ +
+ +
+
Limits + +
+ + +
+
+ + + {tmpl_var name='template_additional_list'} + +
+
+   +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +  MB +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +  MB +
+
+

{tmpl_var name='web_php_options_txt'}

+
+ {tmpl_var name='web_php_options'} +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='ssh_chroot_txt'}

+
+ {tmpl_var name='ssh_chroot'} +
+
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -  MB -
-
- - - -
- - -
-
- -
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +  MB +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/dashboard/dashlets/limits.php b/interface/web/dashboard/dashlets/limits.php index b020def549975970eddf7a712a0f0cf48f8dc34c..81f8701746e5faa4de6d47a14b2724b43138d49d 100644 --- a/interface/web/dashboard/dashlets/limits.php +++ b/interface/web/dashboard/dashlets/limits.php @@ -1,177 +1,177 @@ - 'limit_maildomain', - 'db_table' => 'mail_domain', - 'db_where' => ''); - - $limits[] = array('field' => 'limit_mailmailinglist', - 'db_table' => 'mail_mailinglist', - 'db_where' => ''); - - $limits[] = array('field' => 'limit_mailbox', - 'db_table' => 'mail_user', - 'db_where' => ''); - - $limits[] = array('field' => 'limit_mailalias', - 'db_table' => 'mail_forwarding', - 'db_where' => "type = 'alias'"); - - $limits[] = array('field' => 'limit_mailaliasdomain', - 'db_table' => 'mail_forwarding', - 'db_where' => "type = 'aliasdomain'"); - - $limits[] = array('field' => 'limit_mailforward', - 'db_table' => 'mail_forwarding', - 'db_where' => "type = 'forward'"); - - $limits[] = array('field' => 'limit_mailcatchall', - 'db_table' => 'mail_forwarding', - 'db_where' => "type = 'catchall'"); - - $limits[] = array('field' => 'limit_mailrouting', - 'db_table' => 'mail_transport', - 'db_where' => ""); - - $limits[] = array('field' => 'limit_mailfilter', - 'db_table' => 'mail_user_filter', - 'db_where' => ""); - - $limits[] = array('field' => 'limit_fetchmail', - 'db_table' => 'mail_get', - 'db_where' => ""); - - $limits[] = array('field' => 'limit_spamfilter_wblist', - 'db_table' => 'spamfilter_wblist', - 'db_where' => ""); - - $limits[] = array('field' => 'limit_spamfilter_user', - 'db_table' => 'spamfilter_users', - 'db_where' => ""); - - $limits[] = array('field' => 'limit_spamfilter_policy', - 'db_table' => 'spamfilter_policy', - 'db_where' => ""); - - $limits[] = array('field' => 'limit_web_domain', - 'db_table' => 'web_domain', - 'db_where' => "type = 'vhost'"); - - $limits[] = array('field' => 'limit_web_subdomain', - 'db_table' => 'web_domain', - 'db_where' => "type = 'subdomain'"); - - $limits[] = array('field' => 'limit_web_aliasdomain', - 'db_table' => 'web_domain', - 'db_where' => "type = 'alias'"); - - $limits[] = array('field' => 'limit_ftp_user', - 'db_table' => 'ftp_user', - 'db_where' => ""); - - $limits[] = array('field' => 'limit_shell_user', - 'db_table' => 'shell_user', - 'db_where' => ""); - - $limits[] = array('field' => 'limit_dns_zone', - 'db_table' => 'dns_soa', - 'db_where' => ""); - - $limits[] = array('field' => 'limit_dns_slave_zone', - 'db_table' => 'dns_slave', - 'db_where' => ""); - - $limits[] = array('field' => 'limit_dns_record', - 'db_table' => 'dns_rr', - 'db_where' => ""); - - $limits[] = array('field' => 'limit_database', - 'db_table' => 'web_database', - 'db_where' => ""); - - $limits[] = array('field' => 'limit_cron', - 'db_table' => 'cron', - 'db_where' => ""); - - $limits[] = array('field' => 'limit_client', - 'db_table' => 'client', - 'db_where' => ""); - - - - - //* Loading Template - $app->uses('tpl,tform'); - - $tpl = new tpl; - $tpl->newTemplate("dashlets/templates/limits.htm"); - - $wb = array(); - $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dashlet_limits.lng'; - if(is_file($lng_file)) include($lng_file); - $tpl->setVar($wb); - - if($app->auth->is_admin()) { - $user_is_admin = true; - } else { - $user_is_admin = false; - } - $tpl->setVar('is_admin',$user_is_admin); - - if($user_is_admin == false) { - $client_group_id = $_SESSION["s"]["user"]["default_group"]; - $client = $app->db->queryOneRecord("SELECT * FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); - } - - $rows = array(); - foreach($limits as $limit) { - $field = $limit['field']; - if($user_is_admin) { - $value = $wb['unlimited_txt']; - } else { - $value = $client[$field]; - } - if($value != 0 || $value == $wb['unlimited_txt']) { - $value_formatted = ($value == '-1')?$wb['unlimited_txt']:$value; - $rows[] = array('field' => $field, - 'field_txt' => $wb[$field.'_txt'], - 'value' => $value_formatted, - 'usage' => $this->_get_limit_usage($limit)); - } - } - $tpl->setLoop('rows',$rows); - - - return $tpl->grab(); - - } - - function _get_limit_usage($limit) { - global $app; - - $sql = "SELECT count(sys_userid) as number FROM ".$limit['db_table']." WHERE "; - if($limit['db_where'] != '') $sql .= $limit['db_where']." AND "; - $sql .= $app->tform->getAuthSQL('r'); - $rec = $app->db->queryOneRecord($sql); - return $rec['number']; - - } - -} - - - - - - - - -?> + 'limit_maildomain', + 'db_table' => 'mail_domain', + 'db_where' => ''); + + $limits[] = array('field' => 'limit_mailmailinglist', + 'db_table' => 'mail_mailinglist', + 'db_where' => ''); + + $limits[] = array('field' => 'limit_mailbox', + 'db_table' => 'mail_user', + 'db_where' => ''); + + $limits[] = array('field' => 'limit_mailalias', + 'db_table' => 'mail_forwarding', + 'db_where' => "type = 'alias'"); + + $limits[] = array('field' => 'limit_mailaliasdomain', + 'db_table' => 'mail_forwarding', + 'db_where' => "type = 'aliasdomain'"); + + $limits[] = array('field' => 'limit_mailforward', + 'db_table' => 'mail_forwarding', + 'db_where' => "type = 'forward'"); + + $limits[] = array('field' => 'limit_mailcatchall', + 'db_table' => 'mail_forwarding', + 'db_where' => "type = 'catchall'"); + + $limits[] = array('field' => 'limit_mailrouting', + 'db_table' => 'mail_transport', + 'db_where' => ""); + + $limits[] = array('field' => 'limit_mailfilter', + 'db_table' => 'mail_user_filter', + 'db_where' => ""); + + $limits[] = array('field' => 'limit_fetchmail', + 'db_table' => 'mail_get', + 'db_where' => ""); + + $limits[] = array('field' => 'limit_spamfilter_wblist', + 'db_table' => 'spamfilter_wblist', + 'db_where' => ""); + + $limits[] = array('field' => 'limit_spamfilter_user', + 'db_table' => 'spamfilter_users', + 'db_where' => ""); + + $limits[] = array('field' => 'limit_spamfilter_policy', + 'db_table' => 'spamfilter_policy', + 'db_where' => ""); + + $limits[] = array('field' => 'limit_web_domain', + 'db_table' => 'web_domain', + 'db_where' => "type = 'vhost'"); + + $limits[] = array('field' => 'limit_web_subdomain', + 'db_table' => 'web_domain', + 'db_where' => "type = 'subdomain'"); + + $limits[] = array('field' => 'limit_web_aliasdomain', + 'db_table' => 'web_domain', + 'db_where' => "type = 'alias'"); + + $limits[] = array('field' => 'limit_ftp_user', + 'db_table' => 'ftp_user', + 'db_where' => ""); + + $limits[] = array('field' => 'limit_shell_user', + 'db_table' => 'shell_user', + 'db_where' => ""); + + $limits[] = array('field' => 'limit_dns_zone', + 'db_table' => 'dns_soa', + 'db_where' => ""); + + $limits[] = array('field' => 'limit_dns_slave_zone', + 'db_table' => 'dns_slave', + 'db_where' => ""); + + $limits[] = array('field' => 'limit_dns_record', + 'db_table' => 'dns_rr', + 'db_where' => ""); + + $limits[] = array('field' => 'limit_database', + 'db_table' => 'web_database', + 'db_where' => ""); + + $limits[] = array('field' => 'limit_cron', + 'db_table' => 'cron', + 'db_where' => ""); + + $limits[] = array('field' => 'limit_client', + 'db_table' => 'client', + 'db_where' => ""); + + + + + //* Loading Template + $app->uses('tpl,tform'); + + $tpl = new tpl; + $tpl->newTemplate("dashlets/templates/limits.htm"); + + $wb = array(); + $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dashlet_limits.lng'; + if(is_file($lng_file)) include($lng_file); + $tpl->setVar($wb); + + if($app->auth->is_admin()) { + $user_is_admin = true; + } else { + $user_is_admin = false; + } + $tpl->setVar('is_admin',$user_is_admin); + + if($user_is_admin == false) { + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + $client = $app->db->queryOneRecord("SELECT * FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); + } + + $rows = array(); + foreach($limits as $limit) { + $field = $limit['field']; + if($user_is_admin) { + $value = $wb['unlimited_txt']; + } else { + $value = $client[$field]; + } + if($value != 0 || $value == $wb['unlimited_txt']) { + $value_formatted = ($value == '-1')?$wb['unlimited_txt']:$value; + $rows[] = array('field' => $field, + 'field_txt' => $wb[$field.'_txt'], + 'value' => $value_formatted, + 'usage' => $this->_get_limit_usage($limit)); + } + } + $tpl->setLoop('rows',$rows); + + + return $tpl->grab(); + + } + + function _get_limit_usage($limit) { + global $app; + + $sql = "SELECT count(sys_userid) as number FROM ".$limit['db_table']." WHERE "; + if($limit['db_where'] != '') $sql .= $limit['db_where']." AND "; + $sql .= $app->tform->getAuthSQL('r'); + $rec = $app->db->queryOneRecord($sql); + return $rec['number']; + + } + +} + + + + + + + + +?> diff --git a/interface/web/dashboard/dashlets/modules.php b/interface/web/dashboard/dashlets/modules.php index b958de69e36384ec9175696de8824e2f90fe8655..cfb2e129daf6476d7f83dd2709941b33610342bc 100644 --- a/interface/web/dashboard/dashlets/modules.php +++ b/interface/web/dashboard/dashlets/modules.php @@ -1,55 +1,55 @@ -uses('tpl'); - - $tpl = new tpl; - $tpl->newTemplate("dashlets/templates/modules.htm"); - - $wb = array(); - $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dashlet_modules.lng'; - if(is_file($lng_file)) include($lng_file); - $tpl->setVar($wb); - - /* - * Show all modules, the user is allowed to use - */ - $modules = explode(',', $_SESSION['s']['user']['modules']); - $mod = array(); - if(is_array($modules)) { - foreach($modules as $mt) { - if(is_file('../' . $mt . '/lib/module.conf.php')) { - if(!preg_match("/^[a-z]{2,20}$/i", $mt)) die('module name contains unallowed chars.'); - include_once('../' . $mt.'/lib/module.conf.php'); - /* We don't want to show the dashboard */ - if ($mt != 'dashboard') { - $module_title = $app->lng($module['title']); - if(strlen($module_title) > 8) $module_title = substr($module_title,0,7).'..'; - $mod[] = array( 'modules_title' => $module_title, - 'modules_startpage' => $module['startpage'], - 'modules_name' => $module['name']); - } - } - } - - $tpl->setloop('modules', $mod); - } - - return $tpl->grab(); - - } -} - - - - - - - - +uses('tpl'); + + $tpl = new tpl; + $tpl->newTemplate("dashlets/templates/modules.htm"); + + $wb = array(); + $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dashlet_modules.lng'; + if(is_file($lng_file)) include($lng_file); + $tpl->setVar($wb); + + /* + * Show all modules, the user is allowed to use + */ + $modules = explode(',', $_SESSION['s']['user']['modules']); + $mod = array(); + if(is_array($modules)) { + foreach($modules as $mt) { + if(is_file('../' . $mt . '/lib/module.conf.php')) { + if(!preg_match("/^[a-z]{2,20}$/i", $mt)) die('module name contains unallowed chars.'); + include_once('../' . $mt.'/lib/module.conf.php'); + /* We don't want to show the dashboard */ + if ($mt != 'dashboard') { + $module_title = $app->lng($module['title']); + if(strlen($module_title) > 8) $module_title = substr($module_title,0,7).'..'; + $mod[] = array( 'modules_title' => $module_title, + 'modules_startpage' => $module['startpage'], + 'modules_name' => $module['name']); + } + } + } + + $tpl->setloop('modules', $mod); + } + + return $tpl->grab(); + + } +} + + + + + + + + ?> \ No newline at end of file diff --git a/interface/web/dashboard/lib/custom_menu.inc.php b/interface/web/dashboard/lib/custom_menu.inc.php index 0effc49e199df30d54ac6dd1644652b14074709c..60b95ddc6adf54aa0d1b245b215b059808595461 100644 --- a/interface/web/dashboard/lib/custom_menu.inc.php +++ b/interface/web/dashboard/lib/custom_menu.inc.php @@ -1,76 +1,76 @@ -uses('simplepie'); - -$app->tpl->newTemplate('dashboard/templates/custom_menu.htm'); - -$app->uses('getconf'); - $misc_config = $app->getconf->get_global_config('misc'); - -//* We want to show the news only to the admin user -if($misc_config['dashboard_atom_url'] != '') { - - if(!isset($_SESSION['s']['rss_news'])) { - - $app->simplepie->set_feed_url($misc_config['dashboard_atom_url']); - $app->simplepie->enable_cache(false); - $app->simplepie->init(); - $items = $app->simplepie->get_items(); - - $rows = array(); - $n = 1; - - foreach ($items as $item) - { - //* We want to show only the first 10 news records - if($n <= 10) { - $rows[] = array('title' => $item->get_title(), - 'link' => $item->get_link(), - 'content' => $item->get_content(), - 'date' => $item->get_date('Y-m-d') - ); - } - $n++; - } - - $_SESSION['s']['rss_news'] = $rows; - - } else { - $rows = $_SESSION['s']['rss_news']; - } - - $app->tpl->setVar('latest_news_txt',$app->lng('latest_news_txt')); - -} - -$app->tpl->setLoop('news',$rows); - -?> +uses('simplepie'); + +$app->tpl->newTemplate('dashboard/templates/custom_menu.htm'); + +$app->uses('getconf'); + $misc_config = $app->getconf->get_global_config('misc'); + +//* We want to show the news only to the admin user +if($misc_config['dashboard_atom_url'] != '') { + + if(!isset($_SESSION['s']['rss_news'])) { + + $app->simplepie->set_feed_url($misc_config['dashboard_atom_url']); + $app->simplepie->enable_cache(false); + $app->simplepie->init(); + $items = $app->simplepie->get_items(); + + $rows = array(); + $n = 1; + + foreach ($items as $item) + { + //* We want to show only the first 10 news records + if($n <= 10) { + $rows[] = array('title' => $item->get_title(), + 'link' => $item->get_link(), + 'content' => $item->get_content(), + 'date' => $item->get_date('Y-m-d') + ); + } + $n++; + } + + $_SESSION['s']['rss_news'] = $rows; + + } else { + $rows = $_SESSION['s']['rss_news']; + } + + $app->tpl->setVar('latest_news_txt',$app->lng('latest_news_txt')); + +} + +$app->tpl->setLoop('news',$rows); + +?> diff --git a/interface/web/dashboard/templates/custom_menu.htm b/interface/web/dashboard/templates/custom_menu.htm index 3d2a62c7303e28ee2f500f2fce5940720b9a7f48..8fe5bbf14ee5beee857ef1bfb881f9713bd9b39d 100644 --- a/interface/web/dashboard/templates/custom_menu.htm +++ b/interface/web/dashboard/templates/custom_menu.htm @@ -1,8 +1,8 @@ -
+

+

+ +
+ +
+
Message +
+ +

{tmpl_var name='subject'}

+
+
+ +

{tmpl_var name='message'}

+
+
+
+ +
+
+ +
+ + diff --git a/interface/web/index.php b/interface/web/index.php index 9c312824e616462cfbbe5d53c314e9f04d470291..b8b32ec78aaa8a250e2b8209045b3b219ed5b145 100644 --- a/interface/web/index.php +++ b/interface/web/index.php @@ -1,41 +1,41 @@ -uses('tpl'); -$app->tpl->newTemplate('main.tpl.htm'); - -$app->tpl_defaults(); -$app->tpl->pparse(); +uses('tpl'); +$app->tpl->newTemplate('main.tpl.htm'); + +$app->tpl_defaults(); +$app->tpl->pparse(); ?> \ No newline at end of file diff --git a/interface/web/js/yui/datatable/assets/datatable.css b/interface/web/js/yui/datatable/assets/datatable.css index bdf4a7ae24f4d11b77858537b95e523b3975ab56..4885ff73864399ec881b5cad62641586bd7670da 100644 --- a/interface/web/js/yui/datatable/assets/datatable.css +++ b/interface/web/js/yui/datatable/assets/datatable.css @@ -4,79 +4,79 @@ Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.2.0 */ -/*debug css -.example span, .example .yui-dt-columntext {border:1px solid red;}*/ - -/*foundational css*/ -td { - overflow:hidden; -} - -.yui-dt-headcontainer { - position:relative; - -} - -.yui-dt-headtext { - position:relative; - border-right:10px; -} - -.yui-dt-headresizer { - position:absolute; - margin-right:-6px; - right:0; - bottom:0; - width:6px; - height:100%; - cursor:w-resize; - cursor:col-resize; -} - -.yui-dt-firstlink,.yui-dt-prevlink,.yui-dt-nextlink,.yui-dt-lastlink,.yui-dt-pagelink { - cursor:hand; - cursor:pointer; - text-decoration:underline; -} - -.yui-dt-scrollable { - width:20em; - margin-bottom:3em; -} - - -.yui-dt-scrollable thead { - background:#696969; /* IE needs a bgcolor to hide tbody as it scrolls */ - border:1px solid #000; - display:block; /* enables tbody scrolling for safari and opera */ -} - -.yui-dt-scrollable thead th { - width:10em; /* any value seems to here, just need something */ -} - -tbody.yui-dt-scrollable { - display:block; /* enables tbody scrolling for safari and opera */ - height:10em; - overflow:auto; /* for scrolling other than IE */ -} - -/* IE specific */ -.yui-dt-scrollable { - height:10em; - *overflow-y:auto; -} - -.yui-dt-scrollable tbody { - *height:auto; /* override the non IE height */ -} - -.yui-dt-scrollable thead tr { - position:relative; /* IE cant scroll tbody, so trick it into fixing thead */ -} - -.yui-dt-scrollable tbody td { - width:10em; -} - - +/*debug css +.example span, .example .yui-dt-columntext {border:1px solid red;}*/ + +/*foundational css*/ +td { + overflow:hidden; +} + +.yui-dt-headcontainer { + position:relative; + +} + +.yui-dt-headtext { + position:relative; + border-right:10px; +} + +.yui-dt-headresizer { + position:absolute; + margin-right:-6px; + right:0; + bottom:0; + width:6px; + height:100%; + cursor:w-resize; + cursor:col-resize; +} + +.yui-dt-firstlink,.yui-dt-prevlink,.yui-dt-nextlink,.yui-dt-lastlink,.yui-dt-pagelink { + cursor:hand; + cursor:pointer; + text-decoration:underline; +} + +.yui-dt-scrollable { + width:20em; + margin-bottom:3em; +} + + +.yui-dt-scrollable thead { + background:#696969; /* IE needs a bgcolor to hide tbody as it scrolls */ + border:1px solid #000; + display:block; /* enables tbody scrolling for safari and opera */ +} + +.yui-dt-scrollable thead th { + width:10em; /* any value seems to here, just need something */ +} + +tbody.yui-dt-scrollable { + display:block; /* enables tbody scrolling for safari and opera */ + height:10em; + overflow:auto; /* for scrolling other than IE */ +} + +/* IE specific */ +.yui-dt-scrollable { + height:10em; + *overflow-y:auto; +} + +.yui-dt-scrollable tbody { + *height:auto; /* override the non IE height */ +} + +.yui-dt-scrollable thead tr { + position:relative; /* IE cant scroll tbody, so trick it into fixing thead */ +} + +.yui-dt-scrollable tbody td { + width:10em; +} + + diff --git a/interface/web/js/yui/logger/assets/logger.css b/interface/web/js/yui/logger/assets/logger.css index a723cfee3bd7105b13f9e50ef2176ddae587cbe2..bca6e0b6c7261bbe9b9e9a098a7fd45f32545d95 100644 --- a/interface/web/js/yui/logger/assets/logger.css +++ b/interface/web/js/yui/logger/assets/logger.css @@ -4,23 +4,23 @@ Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.2.0 */ -/* logger default styles */ -/* font size is controlled here: default 77% */ -#yui-log {position:absolute;top:1em;right:1em;font-size:77%;text-align:left;} -/* width is controlled here: default 31em */ -.yui-log {padding:1em;width:31em;background-color:#AAA;border:1px solid black;font-family:monospace;z-index:9000;} -.yui-log p {margin:1px;padding:.1em;} -.yui-log button {font-family:monospace;} -.yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;color:#FFF;} -/* height is controlled here: default 20em*/ -.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;} -.yui-log .yui-log-ft {margin-top:.5em;margin-bottom:1em;} -.yui-log .yui-log-ft .yui-log-categoryfilters {} -.yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;} -.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;} -.yui-log .yui-log-filtergrp {margin-right:.5em;} -.yui-log .info {background-color:#A7CC25;} /* A7CC25 green */ -.yui-log .warn {background-color:#F58516;} /* F58516 orange */ -.yui-log .error {background-color:#E32F0B;} /* E32F0B red */ -.yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */ -.yui-log .window {background-color:#F2E886;} /* F2E886 tan */ +/* logger default styles */ +/* font size is controlled here: default 77% */ +#yui-log {position:absolute;top:1em;right:1em;font-size:77%;text-align:left;} +/* width is controlled here: default 31em */ +.yui-log {padding:1em;width:31em;background-color:#AAA;border:1px solid black;font-family:monospace;z-index:9000;} +.yui-log p {margin:1px;padding:.1em;} +.yui-log button {font-family:monospace;} +.yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;color:#FFF;} +/* height is controlled here: default 20em*/ +.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;} +.yui-log .yui-log-ft {margin-top:.5em;margin-bottom:1em;} +.yui-log .yui-log-ft .yui-log-categoryfilters {} +.yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;} +.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;} +.yui-log .yui-log-filtergrp {margin-right:.5em;} +.yui-log .info {background-color:#A7CC25;} /* A7CC25 green */ +.yui-log .warn {background-color:#F58516;} /* F58516 orange */ +.yui-log .error {background-color:#E32F0B;} /* E32F0B red */ +.yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */ +.yui-log .window {background-color:#F2E886;} /* F2E886 tan */ diff --git a/interface/web/login/templates/password_reset.htm b/interface/web/login/templates/password_reset.htm index f3f99d2250fc3d2ffbad4eb24400873f7fdcb2c3..d47210ad49c06dfb7799e03e15cbbfdd37762752 100644 --- a/interface/web/login/templates/password_reset.htm +++ b/interface/web/login/templates/password_reset.htm @@ -1,33 +1,33 @@ -

Password Reset

-

- -
- - -

-
- -

ERROR

-
- -
-
Password reset -
- - -
-
- - -
-
- - - - -
- -
-
- -
+

Password Reset

+

+ +
+ + +

+
+ +

ERROR

+
+ +
+
Password reset +
+ + +
+
+ + +
+
+ + + + +
+ +
+
+ +
diff --git a/interface/web/mail/form/mail_mailinglist.tform.php b/interface/web/mail/form/mail_mailinglist.tform.php index 1b4ce690800d7b6c6a51bc020c71a2a1e65e6a11..b0e390b4684eb0bba35bac4c82b3aa7259587606 100644 --- a/interface/web/mail/form/mail_mailinglist.tform.php +++ b/interface/web/mail/form/mail_mailinglist.tform.php @@ -1,122 +1,122 @@ - 0 id must match with id of current user -$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user -$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete -$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete -$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete - -$form["tabs"]['mailinglist'] = array ( - 'title' => "Mailing List", - 'width' => 100, - 'template' => "templates/mail_mailinglist_edit.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'server_id' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - 'domain' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'domain_error_empty'), - 1 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-]{2,255}\.[a-zA-Z\-]{2,10}$/', - 'errmsg'=> 'domain_error_regex'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'listname' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'listname_error_empty'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'email' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISEMAIL', - 'errmsg'=> 'email_error_isemail'), - ), - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - 'password' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'PASSWORD', - 'encryption'=> 'CLEARTEXT', - 'default' => '', - 'value' => '', - 'width' => '30', - 'maxlength' => '255' - ), - ################################## - # ENDE Datatable fields - ################################## - ) -); + 0 id must match with id of current user +$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user +$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete + +$form["tabs"]['mailinglist'] = array ( + 'title' => "Mailing List", + 'width' => 100, + 'template' => "templates/mail_mailinglist_edit.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'server_id' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + 'domain' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'domain_error_empty'), + 1 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-]{2,255}\.[a-zA-Z\-]{2,10}$/', + 'errmsg'=> 'domain_error_regex'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'listname' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'listname_error_empty'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'email' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISEMAIL', + 'errmsg'=> 'email_error_isemail'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + 'password' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'PASSWORD', + 'encryption'=> 'CLEARTEXT', + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); ?> \ No newline at end of file diff --git a/interface/web/mail/lib/admin.conf.php b/interface/web/mail/lib/admin.conf.php index a45d4403455c5c46f438046f088398e241cbc3d9..67c94a5742572786e8c7c2ae67750c31231a4b64 100644 --- a/interface/web/mail/lib/admin.conf.php +++ b/interface/web/mail/lib/admin.conf.php @@ -1,2 +1,2 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/lang/en_mail_alias_list.lng b/interface/web/mail/lib/lang/en_mail_alias_list.lng index 10d5a6c7eb58b2fd7730655f879b0ee7ac586d9c..2a6fbc32ad894734f5d9e4a6ecc48427146e00a2 100644 --- a/interface/web/mail/lib/lang/en_mail_alias_list.lng +++ b/interface/web/mail/lib/lang/en_mail_alias_list.lng @@ -1,8 +1,8 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/lang/en_mail_blacklist_list.lng b/interface/web/mail/lib/lang/en_mail_blacklist_list.lng index 9eb28ce3bca51a08d3e0eed34a81932165754827..322d8bda9410455f0169cadc907e2c426b729cb9 100644 --- a/interface/web/mail/lib/lang/en_mail_blacklist_list.lng +++ b/interface/web/mail/lib/lang/en_mail_blacklist_list.lng @@ -1,10 +1,10 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/lang/en_mail_domain_admin_list.lng b/interface/web/mail/lib/lang/en_mail_domain_admin_list.lng index 03350cf80081de15e2d73ef51e8b20002c8ff658..c56e27b8e89e337ec3569b0758a3fe14f0c2ed91 100644 --- a/interface/web/mail/lib/lang/en_mail_domain_admin_list.lng +++ b/interface/web/mail/lib/lang/en_mail_domain_admin_list.lng @@ -1,8 +1,8 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/lang/en_mail_domain_catchall_list.lng b/interface/web/mail/lib/lang/en_mail_domain_catchall_list.lng index 589423b9a51521719255d5647bbde53ffc29ebed..386737fb137cfe2236cc31a4453f6903861d6de4 100644 --- a/interface/web/mail/lib/lang/en_mail_domain_catchall_list.lng +++ b/interface/web/mail/lib/lang/en_mail_domain_catchall_list.lng @@ -1,9 +1,9 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/lang/en_mail_forward_list.lng b/interface/web/mail/lib/lang/en_mail_forward_list.lng index f850512f1db646dc081cf68f5efee6ecb96b4786..9d10b1cabd0f3c54e8af76bbffca70e4bec6d7d2 100644 --- a/interface/web/mail/lib/lang/en_mail_forward_list.lng +++ b/interface/web/mail/lib/lang/en_mail_forward_list.lng @@ -1,8 +1,8 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/lang/en_mail_mailinglist.lng b/interface/web/mail/lib/lang/en_mail_mailinglist.lng index 44790b1ad46dd87823b2ac1c8baf4470452dfc54..f7ada3e384d677d5e23ccc222f5d27654ea95f22 100644 --- a/interface/web/mail/lib/lang/en_mail_mailinglist.lng +++ b/interface/web/mail/lib/lang/en_mail_mailinglist.lng @@ -1,15 +1,15 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/lang/en_mail_mailinglist_list.lng b/interface/web/mail/lib/lang/en_mail_mailinglist_list.lng index ec48108bf965e3872afb6c08fe89d70865228197..0f88589718948a602add7351f2f71f0a4e02ba52 100644 --- a/interface/web/mail/lib/lang/en_mail_mailinglist_list.lng +++ b/interface/web/mail/lib/lang/en_mail_mailinglist_list.lng @@ -1,5 +1,5 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/lang/en_mail_spamfilter_list.lng b/interface/web/mail/lib/lang/en_mail_spamfilter_list.lng index 22316fa12becc29f34382a1279ea038272fe1a33..bcc1f83b2bac33ade5dd22d70f704d52613bedb0 100644 --- a/interface/web/mail/lib/lang/en_mail_spamfilter_list.lng +++ b/interface/web/mail/lib/lang/en_mail_spamfilter_list.lng @@ -1,8 +1,8 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/lang/en_mail_transport_list.lng b/interface/web/mail/lib/lang/en_mail_transport_list.lng index febadb874b365d63dee83ca7342fede8b98d6ca5..5dfb8091fc592d1fa67038e3cfe4e7c12634a71a 100644 --- a/interface/web/mail/lib/lang/en_mail_transport_list.lng +++ b/interface/web/mail/lib/lang/en_mail_transport_list.lng @@ -1,9 +1,9 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/lang/en_mail_whitelist_list.lng b/interface/web/mail/lib/lang/en_mail_whitelist_list.lng index 22aedf23d097a3e10f04a9b6f37289815c754c84..5396c721e6b04094be8335c88e39b0261509c7f1 100644 --- a/interface/web/mail/lib/lang/en_mail_whitelist_list.lng +++ b/interface/web/mail/lib/lang/en_mail_whitelist_list.lng @@ -1,10 +1,10 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/lang/en_spamfilter_policy_list.lng b/interface/web/mail/lib/lang/en_spamfilter_policy_list.lng index 1e87733a0f1706934569a5f298424944e7fbfc4a..f534123dee3d17e3a06216fa5d0705ad90f53bd6 100644 --- a/interface/web/mail/lib/lang/en_spamfilter_policy_list.lng +++ b/interface/web/mail/lib/lang/en_spamfilter_policy_list.lng @@ -1,9 +1,9 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/lang/en_spamfilter_users_list.lng b/interface/web/mail/lib/lang/en_spamfilter_users_list.lng index 75fc98e76cb493f1d9bf7825e8f91aef5fc0578f..aa8fea39ba0e5a43839ba39685c50f7e1286a056 100644 --- a/interface/web/mail/lib/lang/en_spamfilter_users_list.lng +++ b/interface/web/mail/lib/lang/en_spamfilter_users_list.lng @@ -1,10 +1,10 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/lang/en_spamfilter_whitelist_list.lng b/interface/web/mail/lib/lang/en_spamfilter_whitelist_list.lng index 72495f5e0931baa5e08f041f192b6fadbdeea216..e5efd3f4d283bad72a58efe607b13ddae88787ae 100644 --- a/interface/web/mail/lib/lang/en_spamfilter_whitelist_list.lng +++ b/interface/web/mail/lib/lang/en_spamfilter_whitelist_list.lng @@ -1,9 +1,9 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/lang/fr_mail_user.lng b/interface/web/mail/lib/lang/fr_mail_user.lng index 9af401fe7c5f14e1f867f145680b8fe21343e907..c2cc1b1ad5dbde6a4b4fc392d676af96e4111bfd 100644 --- a/interface/web/mail/lib/lang/fr_mail_user.lng +++ b/interface/web/mail/lib/lang/fr_mail_user.lng @@ -22,8 +22,8 @@ $wb['no_policy'] = '- non activé -'; $wb['limit_mailbox_txt'] = 'The max. number of mailboxes for your account is reached.'; $wb['limit_mailquota_txt'] = 'The max space for mailboxes is reached. The max. available space in MB is'; $wb['welcome_mail_subject'] = 'Bienvenue sur votre nouveau compte mail.'; -$wb['welcome_mail_message'] = 'Bienvenue sur votre nouveau compte mail. - +$wb['welcome_mail_message'] = 'Bienvenue sur votre nouveau compte mail. + Votre webmaster.'; $wb['disableimap_txt'] = 'Désactiver IMAP'; $wb['disablepop3_txt'] = 'Désactiver POP3'; diff --git a/interface/web/mail/lib/lang/id_mail_alias_list.lng b/interface/web/mail/lib/lang/id_mail_alias_list.lng index 10d5a6c7eb58b2fd7730655f879b0ee7ac586d9c..2a6fbc32ad894734f5d9e4a6ecc48427146e00a2 100644 --- a/interface/web/mail/lib/lang/id_mail_alias_list.lng +++ b/interface/web/mail/lib/lang/id_mail_alias_list.lng @@ -1,8 +1,8 @@ - \ No newline at end of file diff --git a/interface/web/mail/lib/module.conf.php b/interface/web/mail/lib/module.conf.php index 522845c6eec60dc8f31f097ee54995ed384bc0f5..11fad78c5f05f3f46127a00516627a6acd224b15 100644 --- a/interface/web/mail/lib/module.conf.php +++ b/interface/web/mail/lib/module.conf.php @@ -1,200 +1,200 @@ -auth->get_user_id(); - -$module['name'] = 'mail'; -$module['title'] = 'top_menu_email'; -$module['template'] = 'module.tpl.htm'; -$module['startpage'] = 'mail/mail_domain_list.php'; -$module['tab_width'] = ''; - - -//**** Email accounts menu -$items = array(); - -if($app->auth->get_client_limit($userid,'maildomain') != 0) -{ - $items[] = array( 'title' => 'Domain', - 'target' => 'content', - 'link' => 'mail/mail_domain_list.php', - 'html_id' => 'mail_domain_list'); -} - -if($app->auth->get_client_limit($userid,'mailaliasdomain') != 0) -{ - $items[] = array( 'title' => 'Domain Alias', - 'target' => 'content', - 'link' => 'mail/mail_aliasdomain_list.php', - 'html_id' => 'mail_aliasdomain_list'); -} - -if($app->auth->get_client_limit($userid,'mailbox') != 0) -{ - $items[] = array( 'title' => 'Email Mailbox', - 'target' => 'content', - 'link' => 'mail/mail_user_list.php', - 'html_id' => 'mail_user_list'); -} - -if($app->auth->get_client_limit($userid,'mailalias') != 0) -{ - $items[] = array( 'title' => 'Email Alias', - 'target' => 'content', - 'link' => 'mail/mail_alias_list.php', - 'html_id' => 'mail_alias_list'); -} - -if($app->auth->get_client_limit($userid,'mailforward') != 0) -{ - $items[] = array( 'title' => 'Email Forward', - 'target' => 'content', - 'link' => 'mail/mail_forward_list.php', - 'html_id' => 'mail_forward_list'); -} - -if($app->auth->get_client_limit($userid,'mailcatchall') != 0) -{ - $items[] = array( 'title' => 'Email Catchall', - 'target' => 'content', - 'link' => 'mail/mail_domain_catchall_list.php', - 'html_id' => 'mail_domain_catchall_list'); -} - -if($app->auth->get_client_limit($userid,'mailrouting') != 0) -{ - $items[] = array( 'title' => 'Email Routing', - 'target' => 'content', - 'link' => 'mail/mail_transport_list.php', - 'html_id' => 'mail_transport_list'); -} - -if(count($items)) -{ - $module['nav'][] = array( 'title' => 'Email Accounts', - 'open' => 1, - 'items' => $items); -} - -//**** Mailinglist menu -$items = array(); - -if($app->auth->get_client_limit($userid,'mailmailinglist') != 0) -{ - $items[] = array( 'title' => 'Mailing List', - 'target' => 'content', - 'link' => 'mail/mail_mailinglist_list.php', - 'html_id' => 'mail_mailinglist_list'); -} - -if(count($items)) -{ - $module['nav'][] = array( 'title' => 'Mailing List', - 'open' => 1, - 'items' => $items); -} - -//**** Spamfilter menu -$items = array(); - -if($app->auth->get_client_limit($userid,'spamfilter_wblist') != 0) -{ - $items[] = array( 'title' => 'Whitelist', - 'target' => 'content', - 'link' => 'mail/spamfilter_whitelist_list.php', - 'html_id' => 'spamfilter_whitelist_list'); - - $items[] = array( 'title' => 'Blacklist', - 'target' => 'content', - 'link' => 'mail/spamfilter_blacklist_list.php', - 'html_id' => 'spamfilter_blacklist_list'); -} - -if($app->auth->is_admin()) { - - $items[] = array( 'title' => 'User / Domain', - 'target' => 'content', - 'link' => 'mail/spamfilter_users_list.php', - 'html_id' => 'spamfilter_users_list'); - - $items[] = array( 'title' => 'Policy', - 'target' => 'content', - 'link' => 'mail/spamfilter_policy_list.php', - 'html_id' => 'spamfilter_policy_list'); - -// $items[] = array( 'title' => 'Server Settings', -// 'target' => 'content', -// 'link' => 'mail/spamfilter_config_list.php'); -} - -if(count($items)) -{ - $module['nav'][] = array( 'title' => 'Spamfilter', - 'open' => 1, - 'items' => $items); -} - -//**** Fetchmail menu -$items = array(); - -if($app->auth->get_client_limit($userid,'fetchmail') != 0) -{ - $items[] = array( 'title' => 'Fetchmail', - 'target' => 'content', - 'link' => 'mail/mail_get_list.php', - 'html_id' => 'mail_get_list'); - - $module['nav'][] = array( 'title' => 'Fetchmail', - 'open' => 1, - 'items' => $items); -} - - - -//**** Statistics menu -$items = array(); - -$items[] = array( 'title' => 'Mailbox traffic', - 'target' => 'content', - 'link' => 'mail/mail_user_stats.php', - 'html_id' => 'mail_user_stats'); - - - -$module['nav'][] = array( 'title' => 'Statistics', - 'open' => 1, - 'items' => $items); - - -//**** Global filters menu -$items = array(); -if($_SESSION['s']['user']['typ'] == 'admin') { - - $items[] = array( 'title' => 'Postfix Whitelist', - 'target' => 'content', - 'link' => 'mail/mail_whitelist_list.php', - 'html_id' => 'mail_whitelist_list'); - - - $items[] = array( 'title' => 'Postfix Blacklist', - 'target' => 'content', - 'link' => 'mail/mail_blacklist_list.php', - 'html_id' => 'mail_blacklist_list'); - - - $items[] = array( 'title' => 'Content Filter', - 'target' => 'content', - 'link' => 'mail/mail_content_filter_list.php', - 'html_id' => 'mail_content_filter_list'); - - - $items[] = array( 'title' => 'Relay Recipients', - 'target' => 'content', - 'link' => 'mail/mail_relay_recipient_list.php', - 'html_id' => 'mail_relay_recipient_list'); - - - $module['nav'][] = array( 'title' => 'Global Filters', - 'open' => 1, - 'items' => $items); -} +auth->get_user_id(); + +$module['name'] = 'mail'; +$module['title'] = 'top_menu_email'; +$module['template'] = 'module.tpl.htm'; +$module['startpage'] = 'mail/mail_domain_list.php'; +$module['tab_width'] = ''; + + +//**** Email accounts menu +$items = array(); + +if($app->auth->get_client_limit($userid,'maildomain') != 0) +{ + $items[] = array( 'title' => 'Domain', + 'target' => 'content', + 'link' => 'mail/mail_domain_list.php', + 'html_id' => 'mail_domain_list'); +} + +if($app->auth->get_client_limit($userid,'mailaliasdomain') != 0) +{ + $items[] = array( 'title' => 'Domain Alias', + 'target' => 'content', + 'link' => 'mail/mail_aliasdomain_list.php', + 'html_id' => 'mail_aliasdomain_list'); +} + +if($app->auth->get_client_limit($userid,'mailbox') != 0) +{ + $items[] = array( 'title' => 'Email Mailbox', + 'target' => 'content', + 'link' => 'mail/mail_user_list.php', + 'html_id' => 'mail_user_list'); +} + +if($app->auth->get_client_limit($userid,'mailalias') != 0) +{ + $items[] = array( 'title' => 'Email Alias', + 'target' => 'content', + 'link' => 'mail/mail_alias_list.php', + 'html_id' => 'mail_alias_list'); +} + +if($app->auth->get_client_limit($userid,'mailforward') != 0) +{ + $items[] = array( 'title' => 'Email Forward', + 'target' => 'content', + 'link' => 'mail/mail_forward_list.php', + 'html_id' => 'mail_forward_list'); +} + +if($app->auth->get_client_limit($userid,'mailcatchall') != 0) +{ + $items[] = array( 'title' => 'Email Catchall', + 'target' => 'content', + 'link' => 'mail/mail_domain_catchall_list.php', + 'html_id' => 'mail_domain_catchall_list'); +} + +if($app->auth->get_client_limit($userid,'mailrouting') != 0) +{ + $items[] = array( 'title' => 'Email Routing', + 'target' => 'content', + 'link' => 'mail/mail_transport_list.php', + 'html_id' => 'mail_transport_list'); +} + +if(count($items)) +{ + $module['nav'][] = array( 'title' => 'Email Accounts', + 'open' => 1, + 'items' => $items); +} + +//**** Mailinglist menu +$items = array(); + +if($app->auth->get_client_limit($userid,'mailmailinglist') != 0) +{ + $items[] = array( 'title' => 'Mailing List', + 'target' => 'content', + 'link' => 'mail/mail_mailinglist_list.php', + 'html_id' => 'mail_mailinglist_list'); +} + +if(count($items)) +{ + $module['nav'][] = array( 'title' => 'Mailing List', + 'open' => 1, + 'items' => $items); +} + +//**** Spamfilter menu +$items = array(); + +if($app->auth->get_client_limit($userid,'spamfilter_wblist') != 0) +{ + $items[] = array( 'title' => 'Whitelist', + 'target' => 'content', + 'link' => 'mail/spamfilter_whitelist_list.php', + 'html_id' => 'spamfilter_whitelist_list'); + + $items[] = array( 'title' => 'Blacklist', + 'target' => 'content', + 'link' => 'mail/spamfilter_blacklist_list.php', + 'html_id' => 'spamfilter_blacklist_list'); +} + +if($app->auth->is_admin()) { + + $items[] = array( 'title' => 'User / Domain', + 'target' => 'content', + 'link' => 'mail/spamfilter_users_list.php', + 'html_id' => 'spamfilter_users_list'); + + $items[] = array( 'title' => 'Policy', + 'target' => 'content', + 'link' => 'mail/spamfilter_policy_list.php', + 'html_id' => 'spamfilter_policy_list'); + +// $items[] = array( 'title' => 'Server Settings', +// 'target' => 'content', +// 'link' => 'mail/spamfilter_config_list.php'); +} + +if(count($items)) +{ + $module['nav'][] = array( 'title' => 'Spamfilter', + 'open' => 1, + 'items' => $items); +} + +//**** Fetchmail menu +$items = array(); + +if($app->auth->get_client_limit($userid,'fetchmail') != 0) +{ + $items[] = array( 'title' => 'Fetchmail', + 'target' => 'content', + 'link' => 'mail/mail_get_list.php', + 'html_id' => 'mail_get_list'); + + $module['nav'][] = array( 'title' => 'Fetchmail', + 'open' => 1, + 'items' => $items); +} + + + +//**** Statistics menu +$items = array(); + +$items[] = array( 'title' => 'Mailbox traffic', + 'target' => 'content', + 'link' => 'mail/mail_user_stats.php', + 'html_id' => 'mail_user_stats'); + + + +$module['nav'][] = array( 'title' => 'Statistics', + 'open' => 1, + 'items' => $items); + + +//**** Global filters menu +$items = array(); +if($_SESSION['s']['user']['typ'] == 'admin') { + + $items[] = array( 'title' => 'Postfix Whitelist', + 'target' => 'content', + 'link' => 'mail/mail_whitelist_list.php', + 'html_id' => 'mail_whitelist_list'); + + + $items[] = array( 'title' => 'Postfix Blacklist', + 'target' => 'content', + 'link' => 'mail/mail_blacklist_list.php', + 'html_id' => 'mail_blacklist_list'); + + + $items[] = array( 'title' => 'Content Filter', + 'target' => 'content', + 'link' => 'mail/mail_content_filter_list.php', + 'html_id' => 'mail_content_filter_list'); + + + $items[] = array( 'title' => 'Relay Recipients', + 'target' => 'content', + 'link' => 'mail/mail_relay_recipient_list.php', + 'html_id' => 'mail_relay_recipient_list'); + + + $module['nav'][] = array( 'title' => 'Global Filters', + 'open' => 1, + 'items' => $items); +} ?> \ No newline at end of file diff --git a/interface/web/mail/list/mail_mailinglist.list.php b/interface/web/mail/list/mail_mailinglist.list.php index 27842a5d346facb04c243ea863a7e16d1c7f26e9..4070b22b04b0eb45c1656f193a1bd65f341dd4c0 100644 --- a/interface/web/mail/list/mail_mailinglist.list.php +++ b/interface/web/mail/list/mail_mailinglist.list.php @@ -1,67 +1,67 @@ - "listname", - 'datatype' => "VARCHAR", - 'formtype' => "TEXT", - 'op' => "like", - 'prefix' => "%", - 'suffix' => "%", - 'width' => "", - 'value' => ""); - -$liste["item"][] = array( 'field' => "domain", - 'datatype' => "VARCHAR", - 'formtype' => "TEXT", - 'op' => "like", - 'prefix' => "%", - 'suffix' => "%", - 'width' => "", - 'value' => ""); - + "listname", + 'datatype' => "VARCHAR", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'width' => "", + 'value' => ""); + +$liste["item"][] = array( 'field' => "domain", + 'datatype' => "VARCHAR", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'width' => "", + 'value' => ""); + ?> \ No newline at end of file diff --git a/interface/web/mail/mail_domain_del.php b/interface/web/mail/mail_domain_del.php index 456a7335a36f65749d58d4d5aba361047d41604b..d686341e63b1c69bb39fdaa64127c8606e7cae26 100644 --- a/interface/web/mail/mail_domain_del.php +++ b/interface/web/mail/mail_domain_del.php @@ -1,98 +1,98 @@ -auth->check_module_permissions('mail'); - -// Loading classes -$app->uses('tpl,tform,tform_actions'); -$app->load('tform_actions'); - -class page_action extends tform_actions { - - function onBeforeDelete() { - global $app; $conf; - - $domain = $this->dataRecord['domain']; - - // Before we delete the email domain, - // we will delete all depending records. - - // Delete all forwardings where the osurce or destination belongs to this domain - $records = $app->db->queryAllRecords("SELECT forwarding_id as id FROM mail_forwarding WHERE source like '%@".$app->db->quote($domain)."' OR destination like '%@".$app->db->quote($domain)."'"); - foreach($records as $rec) { - $app->db->datalogDelete('mail_forwarding','forwarding_id',$rec['id']); - } - - // Delete all fetchmail accounts where destination belongs to this domain - $records = $app->db->queryAllRecords("SELECT mailget_id as id FROM mail_get WHERE destination like '%@".$app->db->quote($domain)."'"); - foreach($records as $rec) { - $app->db->datalogDelete('mail_get','mailget_id',$rec['id']); - } - - // Delete all mailboxes where destination belongs to this domain - $records = $app->db->queryAllRecords("SELECT mailuser_id as id FROM mail_user WHERE email like '%@".$app->db->quote($domain)."'"); - foreach($records as $rec) { - $app->db->datalogDelete('mail_user','mailuser_id',$rec['id']); - } - - // Delete all spamfilters that belong to this domain - $records = $app->db->queryAllRecords("SELECT id FROM spamfilter_users WHERE email = '@".$app->db->quote($domain)."'"); - foreach($records as $rec) { - $app->db->datalogDelete('spamfilter_users','id',$rec['id']); - } - - // Delete all mailinglists that belong to this domain - $records = $app->db->queryAllRecords("SELECT mailinglist_id FROM mail_mailinglist WHERE domain = '".$app->db->quote($domain)."'"); - foreach($records as $rec) { - $app->db->datalogDelete('mail_mailinglist','mailinglist_id',$rec['id']); - } - - } -} - -$page = new page_action; -$page->onDelete(); - +auth->check_module_permissions('mail'); + +// Loading classes +$app->uses('tpl,tform,tform_actions'); +$app->load('tform_actions'); + +class page_action extends tform_actions { + + function onBeforeDelete() { + global $app; $conf; + + $domain = $this->dataRecord['domain']; + + // Before we delete the email domain, + // we will delete all depending records. + + // Delete all forwardings where the osurce or destination belongs to this domain + $records = $app->db->queryAllRecords("SELECT forwarding_id as id FROM mail_forwarding WHERE source like '%@".$app->db->quote($domain)."' OR destination like '%@".$app->db->quote($domain)."'"); + foreach($records as $rec) { + $app->db->datalogDelete('mail_forwarding','forwarding_id',$rec['id']); + } + + // Delete all fetchmail accounts where destination belongs to this domain + $records = $app->db->queryAllRecords("SELECT mailget_id as id FROM mail_get WHERE destination like '%@".$app->db->quote($domain)."'"); + foreach($records as $rec) { + $app->db->datalogDelete('mail_get','mailget_id',$rec['id']); + } + + // Delete all mailboxes where destination belongs to this domain + $records = $app->db->queryAllRecords("SELECT mailuser_id as id FROM mail_user WHERE email like '%@".$app->db->quote($domain)."'"); + foreach($records as $rec) { + $app->db->datalogDelete('mail_user','mailuser_id',$rec['id']); + } + + // Delete all spamfilters that belong to this domain + $records = $app->db->queryAllRecords("SELECT id FROM spamfilter_users WHERE email = '@".$app->db->quote($domain)."'"); + foreach($records as $rec) { + $app->db->datalogDelete('spamfilter_users','id',$rec['id']); + } + + // Delete all mailinglists that belong to this domain + $records = $app->db->queryAllRecords("SELECT mailinglist_id FROM mail_mailinglist WHERE domain = '".$app->db->quote($domain)."'"); + foreach($records as $rec) { + $app->db->datalogDelete('mail_mailinglist','mailinglist_id',$rec['id']); + } + + } +} + +$page = new page_action; +$page->onDelete(); + ?> \ No newline at end of file diff --git a/interface/web/mail/mail_domain_edit.php b/interface/web/mail/mail_domain_edit.php index c323d3c3286d7a78b4c687f2dc71d408991c720e..06ce64baf7fa6632c739867f6da01881df1a9bb4 100644 --- a/interface/web/mail/mail_domain_edit.php +++ b/interface/web/mail/mail_domain_edit.php @@ -1,370 +1,370 @@ -auth->check_module_permissions('mail'); - -// Loading classes -$app->uses('tpl,tform,tform_actions'); -$app->load('tform_actions'); - -class page_action extends tform_actions { - - function onShowNew() { - global $app, $conf; - - // we will check only users, not admins - if($_SESSION["s"]["user"]["typ"] == 'user') { - if(!$app->tform->checkClientLimit('limit_maildomain')) { - $app->error($app->tform->wordbook["limit_maildomain_txt"]); - } - if(!$app->tform->checkResellerLimit('limit_maildomain')) { - $app->error('Reseller: '.$app->tform->wordbook["limit_maildomain_txt"]); - } - } - - parent::onShowNew(); - } - - function onShowEnd() { - global $app, $conf; - - if($_SESSION["s"]["user"]["typ"] == 'admin') { - // Getting Clients of the user - if($_SESSION["s"]["user"]["typ"] == 'admin') { - $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name"; - } else { - $client_group_id = $_SESSION["s"]["user"]["default_group"]; - $sql = "SELECT client.client_id, limit_web_domain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"; - } - $clients = $app->db->queryAllRecords($sql); - $client_select = ''; - if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= ""; - $tmp_data_record = $app->tform->getDataRecord($this->id); - if(is_array($clients)) { - foreach( $clients as $client) { - $selected = ($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':''; - $client_select .= "\r\n"; - } - } - $app->tpl->setVar("client_group_id",$client_select); - - } elseif ($_SESSION["s"]["user"]["typ"] != 'admin' && $app->auth->has_clients($_SESSION['s']['user']['userid'])) { - - // Get the limits of the client - $client_group_id = $_SESSION["s"]["user"]["default_group"]; - $client = $app->db->queryOneRecord("SELECT client.client_id, contact_name, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id order by contact_name"); - - // Set the mailserver to the default server of the client - $tmp = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = $client[default_mailserver]"); - $app->tpl->setVar("server_id",""); - unset($tmp); - - // Fill the client select field - $sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']; - $clients = $app->db->queryAllRecords($sql); - $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); - $client_select = ''; - $tmp_data_record = $app->tform->getDataRecord($this->id); - if(is_array($clients)) { - foreach( $clients as $client) { - $selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':''; - $client_select .= "\r\n"; - } - } - $app->tpl->setVar("client_group_id",$client_select); - - } - - /* - * Now we have to check, if we should use the domain-module to select the domain - * or not - */ - $app->uses('ini_parser,getconf'); - $settings = $app->getconf->get_global_config('domains'); - if ($settings['use_domain_module'] == 'y') { - /* - * The domain-module is in use. - */ - $client_group_id = $_SESSION["s"]["user"]["default_group"]; - /* - * The admin can select ALL domains, the user only the domains assigned to him - */ - $sql = "SELECT domain FROM domain "; - if ($_SESSION["s"]["user"]["typ"] != 'admin') { - $sql .= "WHERE sys_groupid =" . $client_group_id; - } - $sql .= " ORDER BY domain"; - $domains = $app->db->queryAllRecords($sql); - $domain_select = ''; - if(is_array($domains) && sizeof($domains) > 0) { - /* We have domains in the list, so create the drop-down-list */ - foreach( $domains as $domain) { - $domain_select .= "\r\n"; - } - $app->tpl->setVar("domain_option",$domain_select); - } - - - // Get the spamfilter policys for the user - $tmp_user = $app->db->queryOneRecord("SELECT policy_id FROM spamfilter_users WHERE email = '@".$this->dataRecord["domain"]."'"); - $sql = "SELECT id, policy_name FROM spamfilter_policy WHERE ".$app->tform->getAuthSQL('r'); - $policys = $app->db->queryAllRecords($sql); - $policy_select = ""; - if(is_array($policys)) { - foreach( $policys as $p) { - $selected = ($p["id"] == $tmp_user["policy_id"])?'SELECTED':''; - $policy_select .= "\r\n"; - } - } - $app->tpl->setVar("policy",$policy_select); - unset($policys); - unset($policy_select); - unset($tmp_user); - - if($this->id > 0) { - //* we are editing a existing record - $app->tpl->setVar("edit_disabled", 1); - $app->tpl->setVar("server_id_value", $this->dataRecord["server_id"]); - } else { - $app->tpl->setVar("edit_disabled", 0); - } - - parent::onShowEnd(); - } - - function onSubmit() { - global $app, $conf; - if($_SESSION["s"]["user"]["typ"] != 'admin') { - - // Get the limits of the client - $client_group_id = $_SESSION["s"]["user"]["default_group"]; - $client = $app->db->queryOneRecord("SELECT limit_maildomain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); - - // When the record is updated - if($this->id > 0) { - // restore the server ID if the user is not admin and record is edited - $tmp = $app->db->queryOneRecord("SELECT server_id FROM mail_domain WHERE domain_id = ".intval($this->id)); - $this->dataRecord["server_id"] = $tmp["server_id"]; - unset($tmp); - // When the record is inserted - } else { - // set the server ID to the default mailserver of the client - $this->dataRecord["server_id"] = $client["default_mailserver"]; - - // Check if the user may add another mail_domain - if($client["limit_maildomain"] >= 0) { - $tmp = $app->db->queryOneRecord("SELECT count(domain_id) as number FROM mail_domain WHERE sys_groupid = $client_group_id"); - if($tmp["number"] >= $client["limit_maildomain"]) { - $app->error($app->tform->wordbook["limit_maildomain_txt"]); - } - } - } - - // Clients may not set the client_group_id, so we unset them if user is not a admin - if(!$app->auth->has_clients($_SESSION['s']['user']['userid'])) unset($this->dataRecord["client_group_id"]); - } - - //* make sure that the email domain is lowercase - if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]); - - - parent::onSubmit(); - } - - function onAfterInsert() { - global $app, $conf; - - // make sure that the record belongs to the client group and not the admin group when a dmin inserts it - // also make sure that the user can not delete domain created by a admin - if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) { - $client_group_id = intval($this->dataRecord["client_group_id"]); - $app->db->query("UPDATE mail_domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id); - } - if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) { - $client_group_id = intval($this->dataRecord["client_group_id"]); - $app->db->query("UPDATE mail_domain SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE domain_id = ".$this->id); - } - - // Spamfilter policy - $policy_id = intval($this->dataRecord["policy"]); - if($policy_id > 0) { - $tmp_user = $app->db->queryOneRecord("SELECT id FROM spamfilter_users WHERE email = '@".mysql_real_escape_string($this->dataRecord["domain"])."'"); - if($tmp_user["id"] > 0) { - // There is already a record that we will update - $app->db->datalogUpdate('spamfilter_users', "policy_id = $ploicy_id", 'id', $tmp_user["id"]); - } else { - $tmp_domain = $app->db->queryOneRecord("SELECT sys_groupid FROM mail_domain WHERE domain_id = ".$this->id); - // We create a new record - $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `priority`, `policy_id`, `email`, `fullname`, `local`) - VALUES (".$_SESSION["s"]["user"]["userid"].", ".$tmp_domain["sys_groupid"].", 'riud', 'riud', '', ".$this->dataRecord["server_id"].", 5, ".$policy_id.", '@".mysql_real_escape_string($this->dataRecord["domain"])."', '@".mysql_real_escape_string($this->dataRecord["domain"])."', 'Y')"; - $app->db->datalogInsert('spamfilter_users', $insert_data, 'id'); - unset($tmp_domain); - } - } // endif spamfilter policy - } - - function onBeforeUpdate() { - global $app, $conf; - - //* Check if the server has been changed - // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway - if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) { - $rec = $app->db->queryOneRecord("SELECT server_id, domain from mail_domain WHERE domain_id = ".$this->id); - if($rec['server_id'] != $this->dataRecord["server_id"]) { - //* Add a error message and switch back to old server - $app->tform->errorMessage .= $app->lng('The Server can not be changed.'); - $this->dataRecord["server_id"] = $rec['server_id']; - } - unset($rec); - //* If the user is neither admin nor reseller - } else { - //* We do not allow users to change a domain which has been created by the admin - $rec = $app->db->queryOneRecord("SELECT domain from mail_domain WHERE domain_id = ".$this->id); - if($rec['domain'] != $this->dataRecord["domain"] && $app->tform->checkPerm($this->id,'u')) { - //* Add a error message and switch back to old server - $app->tform->errorMessage .= $app->lng('The Domain can not be changed. Please ask your Administrator if you want to change the domain name.'); - $this->dataRecord["domain"] = $rec['domain']; - } - unset($rec); - } - } - - - - function onAfterUpdate() { - global $app, $conf; - - // make sure that the record belongs to the clinet group and not the admin group when admin inserts it - // also make sure that the user can not delete domain created by a admin - if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) { - $client_group_id = intval($this->dataRecord["client_group_id"]); - $app->db->query("UPDATE mail_domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id); - } - if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) { - $client_group_id = intval($this->dataRecord["client_group_id"]); - $app->db->query("UPDATE mail_domain SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE domain_id = ".$this->id); - } - - // Spamfilter policy - $policy_id = intval($this->dataRecord["policy"]); - $tmp_user = $app->db->queryOneRecord("SELECT id FROM spamfilter_users WHERE email = '@".mysql_real_escape_string($this->dataRecord["domain"])."'"); - if($policy_id > 0) { - if($tmp_user["id"] > 0) { - // There is already a record that we will update - $app->db->datalogUpdate('spamfilter_users', "policy_id = $policy_id", 'id', $tmp_user["id"]); - } else { - $tmp_domain = $app->db->queryOneRecord("SELECT sys_groupid FROM mail_domain WHERE domain_id = ".$this->id); - // We create a new record - $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `priority`, `policy_id`, `email`, `fullname`, `local`) - VALUES (".$_SESSION["s"]["user"]["userid"].", ".$tmp_domain["sys_groupid"].", 'riud', 'riud', '', ".$this->dataRecord["server_id"].", 5, ".$policy_id.", '@".mysql_real_escape_string($this->dataRecord["domain"])."', '@".mysql_real_escape_string($this->dataRecord["domain"])."', 'Y')"; - $app->db->datalogInsert('spamfilter_users', $insert_data, 'id'); - unset($tmp_domain); - } - } else { - if($tmp_user["id"] > 0) { - // There is already a record but the user shall have no policy, so we delete it - $app->db->datalogDelete('spamfilter_users', 'id', $tmp_user["id"]); - } - } // endif spamfilter policy - //** If the domain name or owner has been changed, change the domain and owner in all mailbox records - if($this->oldDataRecord['domain'] != $this->dataRecord['domain'] || (isset($this->dataRecord['client_group_id']) && $this->oldDataRecord['sys_groupid'] != $this->dataRecord['client_group_id'])) { - $app->uses('getconf'); - $mail_config = $app->getconf->get_server_config($this->dataRecord["server_id"],'mail'); - - //* Update the mailboxes - $mailusers = $app->db->queryAllRecords("SELECT * FROM mail_user WHERE email like '%@".mysql_real_escape_string($this->oldDataRecord['domain'])."'"); - $sys_groupid = (isset($this->dataRecord['client_group_id']))?$this->dataRecord['client_group_id']:$this->oldDataRecord['sys_groupid']; - if(is_array($mailusers)) { - foreach($mailusers as $rec) { - // setting Maildir, Homedir, UID and GID - $mail_parts = explode("@",$rec['email']); - $maildir = str_replace("[domain]",$this->dataRecord['domain'],$mail_config["maildir_path"]); - $maildir = str_replace("[localpart]",$mail_parts[0],$maildir); - $maildir = mysql_real_escape_string($maildir); - $email = mysql_real_escape_string($mail_parts[0].'@'.$this->dataRecord['domain']); - $app->db->datalogUpdate('mail_user', "maildir = '$maildir', email = '$email', sys_groupid = '$sys_groupid'", 'mailuser_id', $rec['mailuser_id']); - } - } - - //* Update the aliases - $forwardings = $app->db->queryAllRecords("SELECT * FROM mail_forwarding WHERE source like '%@".mysql_real_escape_string($this->oldDataRecord['domain'])."' OR destination like '%@".mysql_real_escape_string($this->oldDataRecord['domain'])."'"); - if(is_array($forwardings)) { - foreach($forwardings as $rec) { - $destination = mysql_real_escape_string(str_replace($this->oldDataRecord['domain'],$this->dataRecord['domain'],$rec['destination'])); - $source = mysql_real_escape_string(str_replace($this->oldDataRecord['domain'],$this->dataRecord['domain'],$rec['source'])); - $app->db->datalogUpdate('mail_forwarding', "source = '$source', destination = '$destination', sys_groupid = '$sys_groupid'", 'forwarding_id', $rec['forwarding_id']); - } - } - - //* Update the mailinglist - $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $sys_groupid WHERE domain = '".mysql_real_escape_string($this->oldDataRecord['domain'])."'"); - - //* Delete the old spamfilter record - $tmp = $app->db->queryOneRecord("SELECT id FROM spamfilter_users WHERE email = '@".mysql_real_escape_string($this->oldDataRecord["domain"])."'"); - $app->db->datalogDelete('spamfilter_users', 'id', $tmp["id"]); - unset($tmp); - - } // end if domain name changed - - } - -} - -$page = new page_action; -$page->onLoad(); - +auth->check_module_permissions('mail'); + +// Loading classes +$app->uses('tpl,tform,tform_actions'); +$app->load('tform_actions'); + +class page_action extends tform_actions { + + function onShowNew() { + global $app, $conf; + + // we will check only users, not admins + if($_SESSION["s"]["user"]["typ"] == 'user') { + if(!$app->tform->checkClientLimit('limit_maildomain')) { + $app->error($app->tform->wordbook["limit_maildomain_txt"]); + } + if(!$app->tform->checkResellerLimit('limit_maildomain')) { + $app->error('Reseller: '.$app->tform->wordbook["limit_maildomain_txt"]); + } + } + + parent::onShowNew(); + } + + function onShowEnd() { + global $app, $conf; + + if($_SESSION["s"]["user"]["typ"] == 'admin') { + // Getting Clients of the user + if($_SESSION["s"]["user"]["typ"] == 'admin') { + $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name"; + } else { + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + $sql = "SELECT client.client_id, limit_web_domain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"; + } + $clients = $app->db->queryAllRecords($sql); + $client_select = ''; + if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= ""; + $tmp_data_record = $app->tform->getDataRecord($this->id); + if(is_array($clients)) { + foreach( $clients as $client) { + $selected = ($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':''; + $client_select .= "\r\n"; + } + } + $app->tpl->setVar("client_group_id",$client_select); + + } elseif ($_SESSION["s"]["user"]["typ"] != 'admin' && $app->auth->has_clients($_SESSION['s']['user']['userid'])) { + + // Get the limits of the client + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + $client = $app->db->queryOneRecord("SELECT client.client_id, contact_name, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id order by contact_name"); + + // Set the mailserver to the default server of the client + $tmp = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = $client[default_mailserver]"); + $app->tpl->setVar("server_id",""); + unset($tmp); + + // Fill the client select field + $sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']; + $clients = $app->db->queryAllRecords($sql); + $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); + $client_select = ''; + $tmp_data_record = $app->tform->getDataRecord($this->id); + if(is_array($clients)) { + foreach( $clients as $client) { + $selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':''; + $client_select .= "\r\n"; + } + } + $app->tpl->setVar("client_group_id",$client_select); + + } + + /* + * Now we have to check, if we should use the domain-module to select the domain + * or not + */ + $app->uses('ini_parser,getconf'); + $settings = $app->getconf->get_global_config('domains'); + if ($settings['use_domain_module'] == 'y') { + /* + * The domain-module is in use. + */ + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + /* + * The admin can select ALL domains, the user only the domains assigned to him + */ + $sql = "SELECT domain FROM domain "; + if ($_SESSION["s"]["user"]["typ"] != 'admin') { + $sql .= "WHERE sys_groupid =" . $client_group_id; + } + $sql .= " ORDER BY domain"; + $domains = $app->db->queryAllRecords($sql); + $domain_select = ''; + if(is_array($domains) && sizeof($domains) > 0) { + /* We have domains in the list, so create the drop-down-list */ + foreach( $domains as $domain) { + $domain_select .= "\r\n"; + } + $app->tpl->setVar("domain_option",$domain_select); + } + + + // Get the spamfilter policys for the user + $tmp_user = $app->db->queryOneRecord("SELECT policy_id FROM spamfilter_users WHERE email = '@".$this->dataRecord["domain"]."'"); + $sql = "SELECT id, policy_name FROM spamfilter_policy WHERE ".$app->tform->getAuthSQL('r'); + $policys = $app->db->queryAllRecords($sql); + $policy_select = ""; + if(is_array($policys)) { + foreach( $policys as $p) { + $selected = ($p["id"] == $tmp_user["policy_id"])?'SELECTED':''; + $policy_select .= "\r\n"; + } + } + $app->tpl->setVar("policy",$policy_select); + unset($policys); + unset($policy_select); + unset($tmp_user); + + if($this->id > 0) { + //* we are editing a existing record + $app->tpl->setVar("edit_disabled", 1); + $app->tpl->setVar("server_id_value", $this->dataRecord["server_id"]); + } else { + $app->tpl->setVar("edit_disabled", 0); + } + + parent::onShowEnd(); + } + + function onSubmit() { + global $app, $conf; + if($_SESSION["s"]["user"]["typ"] != 'admin') { + + // Get the limits of the client + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + $client = $app->db->queryOneRecord("SELECT limit_maildomain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); + + // When the record is updated + if($this->id > 0) { + // restore the server ID if the user is not admin and record is edited + $tmp = $app->db->queryOneRecord("SELECT server_id FROM mail_domain WHERE domain_id = ".intval($this->id)); + $this->dataRecord["server_id"] = $tmp["server_id"]; + unset($tmp); + // When the record is inserted + } else { + // set the server ID to the default mailserver of the client + $this->dataRecord["server_id"] = $client["default_mailserver"]; + + // Check if the user may add another mail_domain + if($client["limit_maildomain"] >= 0) { + $tmp = $app->db->queryOneRecord("SELECT count(domain_id) as number FROM mail_domain WHERE sys_groupid = $client_group_id"); + if($tmp["number"] >= $client["limit_maildomain"]) { + $app->error($app->tform->wordbook["limit_maildomain_txt"]); + } + } + } + + // Clients may not set the client_group_id, so we unset them if user is not a admin + if(!$app->auth->has_clients($_SESSION['s']['user']['userid'])) unset($this->dataRecord["client_group_id"]); + } + + //* make sure that the email domain is lowercase + if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]); + + + parent::onSubmit(); + } + + function onAfterInsert() { + global $app, $conf; + + // make sure that the record belongs to the client group and not the admin group when a dmin inserts it + // also make sure that the user can not delete domain created by a admin + if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) { + $client_group_id = intval($this->dataRecord["client_group_id"]); + $app->db->query("UPDATE mail_domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id); + } + if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) { + $client_group_id = intval($this->dataRecord["client_group_id"]); + $app->db->query("UPDATE mail_domain SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE domain_id = ".$this->id); + } + + // Spamfilter policy + $policy_id = intval($this->dataRecord["policy"]); + if($policy_id > 0) { + $tmp_user = $app->db->queryOneRecord("SELECT id FROM spamfilter_users WHERE email = '@".mysql_real_escape_string($this->dataRecord["domain"])."'"); + if($tmp_user["id"] > 0) { + // There is already a record that we will update + $app->db->datalogUpdate('spamfilter_users', "policy_id = $ploicy_id", 'id', $tmp_user["id"]); + } else { + $tmp_domain = $app->db->queryOneRecord("SELECT sys_groupid FROM mail_domain WHERE domain_id = ".$this->id); + // We create a new record + $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `priority`, `policy_id`, `email`, `fullname`, `local`) + VALUES (".$_SESSION["s"]["user"]["userid"].", ".$tmp_domain["sys_groupid"].", 'riud', 'riud', '', ".$this->dataRecord["server_id"].", 5, ".$policy_id.", '@".mysql_real_escape_string($this->dataRecord["domain"])."', '@".mysql_real_escape_string($this->dataRecord["domain"])."', 'Y')"; + $app->db->datalogInsert('spamfilter_users', $insert_data, 'id'); + unset($tmp_domain); + } + } // endif spamfilter policy + } + + function onBeforeUpdate() { + global $app, $conf; + + //* Check if the server has been changed + // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway + if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) { + $rec = $app->db->queryOneRecord("SELECT server_id, domain from mail_domain WHERE domain_id = ".$this->id); + if($rec['server_id'] != $this->dataRecord["server_id"]) { + //* Add a error message and switch back to old server + $app->tform->errorMessage .= $app->lng('The Server can not be changed.'); + $this->dataRecord["server_id"] = $rec['server_id']; + } + unset($rec); + //* If the user is neither admin nor reseller + } else { + //* We do not allow users to change a domain which has been created by the admin + $rec = $app->db->queryOneRecord("SELECT domain from mail_domain WHERE domain_id = ".$this->id); + if($rec['domain'] != $this->dataRecord["domain"] && $app->tform->checkPerm($this->id,'u')) { + //* Add a error message and switch back to old server + $app->tform->errorMessage .= $app->lng('The Domain can not be changed. Please ask your Administrator if you want to change the domain name.'); + $this->dataRecord["domain"] = $rec['domain']; + } + unset($rec); + } + } + + + + function onAfterUpdate() { + global $app, $conf; + + // make sure that the record belongs to the clinet group and not the admin group when admin inserts it + // also make sure that the user can not delete domain created by a admin + if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) { + $client_group_id = intval($this->dataRecord["client_group_id"]); + $app->db->query("UPDATE mail_domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id); + } + if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) { + $client_group_id = intval($this->dataRecord["client_group_id"]); + $app->db->query("UPDATE mail_domain SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE domain_id = ".$this->id); + } + + // Spamfilter policy + $policy_id = intval($this->dataRecord["policy"]); + $tmp_user = $app->db->queryOneRecord("SELECT id FROM spamfilter_users WHERE email = '@".mysql_real_escape_string($this->dataRecord["domain"])."'"); + if($policy_id > 0) { + if($tmp_user["id"] > 0) { + // There is already a record that we will update + $app->db->datalogUpdate('spamfilter_users', "policy_id = $policy_id", 'id', $tmp_user["id"]); + } else { + $tmp_domain = $app->db->queryOneRecord("SELECT sys_groupid FROM mail_domain WHERE domain_id = ".$this->id); + // We create a new record + $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `priority`, `policy_id`, `email`, `fullname`, `local`) + VALUES (".$_SESSION["s"]["user"]["userid"].", ".$tmp_domain["sys_groupid"].", 'riud', 'riud', '', ".$this->dataRecord["server_id"].", 5, ".$policy_id.", '@".mysql_real_escape_string($this->dataRecord["domain"])."', '@".mysql_real_escape_string($this->dataRecord["domain"])."', 'Y')"; + $app->db->datalogInsert('spamfilter_users', $insert_data, 'id'); + unset($tmp_domain); + } + } else { + if($tmp_user["id"] > 0) { + // There is already a record but the user shall have no policy, so we delete it + $app->db->datalogDelete('spamfilter_users', 'id', $tmp_user["id"]); + } + } // endif spamfilter policy + //** If the domain name or owner has been changed, change the domain and owner in all mailbox records + if($this->oldDataRecord['domain'] != $this->dataRecord['domain'] || (isset($this->dataRecord['client_group_id']) && $this->oldDataRecord['sys_groupid'] != $this->dataRecord['client_group_id'])) { + $app->uses('getconf'); + $mail_config = $app->getconf->get_server_config($this->dataRecord["server_id"],'mail'); + + //* Update the mailboxes + $mailusers = $app->db->queryAllRecords("SELECT * FROM mail_user WHERE email like '%@".mysql_real_escape_string($this->oldDataRecord['domain'])."'"); + $sys_groupid = (isset($this->dataRecord['client_group_id']))?$this->dataRecord['client_group_id']:$this->oldDataRecord['sys_groupid']; + if(is_array($mailusers)) { + foreach($mailusers as $rec) { + // setting Maildir, Homedir, UID and GID + $mail_parts = explode("@",$rec['email']); + $maildir = str_replace("[domain]",$this->dataRecord['domain'],$mail_config["maildir_path"]); + $maildir = str_replace("[localpart]",$mail_parts[0],$maildir); + $maildir = mysql_real_escape_string($maildir); + $email = mysql_real_escape_string($mail_parts[0].'@'.$this->dataRecord['domain']); + $app->db->datalogUpdate('mail_user', "maildir = '$maildir', email = '$email', sys_groupid = '$sys_groupid'", 'mailuser_id', $rec['mailuser_id']); + } + } + + //* Update the aliases + $forwardings = $app->db->queryAllRecords("SELECT * FROM mail_forwarding WHERE source like '%@".mysql_real_escape_string($this->oldDataRecord['domain'])."' OR destination like '%@".mysql_real_escape_string($this->oldDataRecord['domain'])."'"); + if(is_array($forwardings)) { + foreach($forwardings as $rec) { + $destination = mysql_real_escape_string(str_replace($this->oldDataRecord['domain'],$this->dataRecord['domain'],$rec['destination'])); + $source = mysql_real_escape_string(str_replace($this->oldDataRecord['domain'],$this->dataRecord['domain'],$rec['source'])); + $app->db->datalogUpdate('mail_forwarding', "source = '$source', destination = '$destination', sys_groupid = '$sys_groupid'", 'forwarding_id', $rec['forwarding_id']); + } + } + + //* Update the mailinglist + $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $sys_groupid WHERE domain = '".mysql_real_escape_string($this->oldDataRecord['domain'])."'"); + + //* Delete the old spamfilter record + $tmp = $app->db->queryOneRecord("SELECT id FROM spamfilter_users WHERE email = '@".mysql_real_escape_string($this->oldDataRecord["domain"])."'"); + $app->db->datalogDelete('spamfilter_users', 'id', $tmp["id"]); + unset($tmp); + + } // end if domain name changed + + } + +} + +$page = new page_action; +$page->onLoad(); + ?> \ No newline at end of file diff --git a/interface/web/mail/mail_mailinglist_del.php b/interface/web/mail/mail_mailinglist_del.php index a0f0a8fb1a4c13c223f67c55dbcc217e47d323ca..1622aefb010b4efb0ab4d1abdb2f6467e8f7373e 100644 --- a/interface/web/mail/mail_mailinglist_del.php +++ b/interface/web/mail/mail_mailinglist_del.php @@ -1,58 +1,58 @@ -auth->check_module_permissions('mail'); - -// Loading classes -$app->uses('tpl,tform,tform_actions'); -$app->load('tform_actions'); - -class page_action extends tform_actions { -} - -$page = new page_action; -$page->onDelete(); - +auth->check_module_permissions('mail'); + +// Loading classes +$app->uses('tpl,tform,tform_actions'); +$app->load('tform_actions'); + +class page_action extends tform_actions { +} + +$page = new page_action; +$page->onDelete(); + ?> \ No newline at end of file diff --git a/interface/web/mail/mail_mailinglist_edit.php b/interface/web/mail/mail_mailinglist_edit.php index 9729757db0651ed694557f5a2b24b882c9db781d..81e518f4c27a19607eace5012b8dc5551eb75ad4 100644 --- a/interface/web/mail/mail_mailinglist_edit.php +++ b/interface/web/mail/mail_mailinglist_edit.php @@ -1,256 +1,256 @@ -auth->check_module_permissions('mail'); - -// Loading classes -$app->uses('tpl,tform,tform_actions'); -$app->load('tform_actions'); - -class page_action extends tform_actions { - - - function onShowNew() { - global $app, $conf; - - // we will check only users, not admins - if($_SESSION["s"]["user"]["typ"] == 'user') { - if(!$app->tform->checkClientLimit('limit_mailmailinglist')) { - $app->error($app->tform->wordbook["limit_mailmailinglist_txt"]); - } - if(!$app->tform->checkResellerLimit('limit_mailmailinglist')) { - $app->error('Reseller: '.$app->tform->wordbook["limit_mailmailinglist_txt"]); - } - } - - parent::onShowNew(); - } - - function onShowEnd() { - global $app, $conf; - - if($_SESSION["s"]["user"]["typ"] == 'admin') { - // Getting Clients of the user - if($_SESSION["s"]["user"]["typ"] == 'admin') { - $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name"; - } else { - $client_group_id = $_SESSION["s"]["user"]["default_group"]; - $sql = "SELECT client.client_id, limit_web_domain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"; - } - $clients = $app->db->queryAllRecords($sql); - $client_select = ''; - if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= ""; - $tmp_data_record = $app->tform->getDataRecord($this->id); - if(is_array($clients)) { - foreach( $clients as $client) { - $selected = ($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':''; - $client_select .= "\r\n"; - } - } - $app->tpl->setVar("client_group_id",$client_select); - - } elseif ($_SESSION["s"]["user"]["typ"] != 'admin' && $app->auth->has_clients($_SESSION['s']['user']['userid'])) { - - // Get the limits of the client - $client_group_id = $_SESSION["s"]["user"]["default_group"]; - $client = $app->db->queryOneRecord("SELECT client.client_id, contact_name, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id order by contact_name"); - - // Fill the client select field - $sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']; - $clients = $app->db->queryAllRecords($sql); - $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); - $client_select = ''; - $tmp_data_record = $app->tform->getDataRecord($this->id); - if(is_array($clients)) { - foreach( $clients as $client) { - $selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':''; - $client_select .= "\r\n"; - } - } - $app->tpl->setVar("client_group_id",$client_select); - } - - // Getting Domains of the user - $sql = "SELECT domain FROM mail_domain WHERE ".$app->tform->getAuthSQL('r').' ORDER BY domain'; - $domains = $app->db->queryAllRecords($sql); - $domain_select = ''; - if(is_array($domains)) { - foreach( $domains as $domain) { - $selected = ($domain["domain"] == $this->dataRecord["domain"])?'SELECTED':''; - $domain_select .= "\r\n"; - } - } - $app->tpl->setVar("domain_option",$domain_select); - - if($this->id > 0) { - //* we are editing a existing record - $app->tpl->setVar("edit_disabled", 1); - $app->tpl->setVar("listname_value", $this->dataRecord["listname"]); - $app->tpl->setVar("domain_value", $this->dataRecord["domain"]); - $app->tpl->setVar("email_value", $this->dataRecord["email"]); - } else { - $app->tpl->setVar("edit_disabled", 0); - } - - parent::onShowEnd(); - } - - function onSubmit() { - global $app, $conf; - - if($_SESSION["s"]["user"]["typ"] != 'admin') { - - // Get the limits of the client - $client_group_id = $_SESSION["s"]["user"]["default_group"]; - $client = $app->db->queryOneRecord("SELECT limit_mailmailinglist, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); - - //* Check if Domain belongs to user - if(isset($_POST["domain"])) { - $domain = $app->db->queryOneRecord("SELECT domain FROM mail_domain WHERE domain = '".$this->dataRecord["domain"]."' AND ".$app->tform->getAuthSQL('r')); - if($domain["domain"] != $this->dataRecord["domain"]) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm"); - } - - // When the record is updated - if($this->id == 0) { - //Check if email is in use - $check = $app->db->queryOneRecord("SELECT count(source) as number FROM mail_forwarding WHERE source = '".$this->dataRecord["listname"]."@".$this->dataRecord["domain"]."'"); - if($check['number'] != 0) { - $app->error($app->tform->wordbook["email_in_use_txt"]); - } - - $check = $app->db->queryOneRecord("SELECT count(email) as number FROM mail_user WHERE email = '".$this->dataRecord["listname"]."@".$this->dataRecord["domain"]."'"); - if($check['number'] != 0) { - $app->error($app->tform->wordbook["email_in_use_txt"]); - } - - $check = $app->db->queryOneRecord("SELECT count(mailinglist_id) as number FROM mail_mailinglist WHERE listname = '".$this->dataRecord["listname"]."' AND domain = '".$this->dataRecord["domain"]."'"); - if($check['number'] != 0) { - $app->error($app->tform->wordbook["email_in_use_txt"]); - } - - // Check if the user may add another mail_domain - if($client["limit_mailmailinglist"] >= 0) { - $tmp = $app->db->queryOneRecord("SELECT count(mailinglist_id) as number FROM mail_mailinglist WHERE sys_groupid = $client_group_id"); - if($tmp["number"] >= $client["limit_mailmailinglist"]) { - $app->error($app->tform->wordbook["limit_mailmailinglist_txt"]); - } - } - } - - // Clients may not set the client_group_id, so we unset them if user is not a admin - if(!$app->auth->has_clients($_SESSION['s']['user']['userid'])) unset($this->dataRecord["client_group_id"]); - } - - //* make sure that the email domain is lowercase - if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]); - - parent::onSubmit(); - } - - function onBeforeInsert() { - global $app, $conf; - - // Set the server id of the mailinglist = server ID of mail domain. - $domain = $app->db->queryOneRecord("SELECT server_id FROM mail_domain WHERE domain = '".$this->dataRecord["domain"]."'"); - $this->dataRecord["server_id"] = $domain['server_id']; - } - - function onAfterInsert() { - global $app, $conf; - - // make sure that the record belongs to the client group and not the admin group when a dmin inserts it - // also make sure that the user can not delete domain created by a admin - if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) { - $client_group_id = intval($this->dataRecord["client_group_id"]); - $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE mailinglist_id = ".$this->id); - } - if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) { - $client_group_id = intval($this->dataRecord["client_group_id"]); - $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE mailinglist_id = ".$this->id); - } - } - - function onBeforeUpdate() { - global $app, $conf; - - //* Check if the server has been changed - // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway - if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) { - $rec = $app->db->queryOneRecord("SELECT server_id, domain from mail_mailinglist WHERE mailinglist_id = ".$this->id); - $this->dataRecord["server_id"] = $rec['server_id']; - unset($rec); - //* If the user is neither admin nor reseller - } else { - //* We do not allow users to change a domain which has been created by the admin - $rec = $app->db->queryOneRecord("SELECT domain from mail_mailinglist WHERE mailinglist_id = ".$this->id); - if($rec['domain'] != $this->dataRecord["domain"] && $app->tform->checkPerm($this->id,'u')) { - //* Add a error message and switch back to old server - $app->tform->errorMessage .= $app->lng('The Domain can not be changed. Please ask your Administrator if you want to change the domain name.'); - $this->dataRecord["domain"] = $rec['domain']; - } - unset($rec); - } - } - - function onAfterUpdate() { - global $app, $conf; - - // make sure that the record belongs to the clinet group and not the admin group when admin inserts it - // also make sure that the user can not delete domain created by a admin - if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) { - $client_group_id = intval($this->dataRecord["client_group_id"]); - $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE mailinglist_id = ".$this->id); - } - if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) { - $client_group_id = intval($this->dataRecord["client_group_id"]); - $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE mailinglist_id = ".$this->id); - } - } - -} - -$app->tform_actions = new page_action; -$app->tform_actions->onLoad(); - -?> +auth->check_module_permissions('mail'); + +// Loading classes +$app->uses('tpl,tform,tform_actions'); +$app->load('tform_actions'); + +class page_action extends tform_actions { + + + function onShowNew() { + global $app, $conf; + + // we will check only users, not admins + if($_SESSION["s"]["user"]["typ"] == 'user') { + if(!$app->tform->checkClientLimit('limit_mailmailinglist')) { + $app->error($app->tform->wordbook["limit_mailmailinglist_txt"]); + } + if(!$app->tform->checkResellerLimit('limit_mailmailinglist')) { + $app->error('Reseller: '.$app->tform->wordbook["limit_mailmailinglist_txt"]); + } + } + + parent::onShowNew(); + } + + function onShowEnd() { + global $app, $conf; + + if($_SESSION["s"]["user"]["typ"] == 'admin') { + // Getting Clients of the user + if($_SESSION["s"]["user"]["typ"] == 'admin') { + $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name"; + } else { + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + $sql = "SELECT client.client_id, limit_web_domain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"; + } + $clients = $app->db->queryAllRecords($sql); + $client_select = ''; + if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= ""; + $tmp_data_record = $app->tform->getDataRecord($this->id); + if(is_array($clients)) { + foreach( $clients as $client) { + $selected = ($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':''; + $client_select .= "\r\n"; + } + } + $app->tpl->setVar("client_group_id",$client_select); + + } elseif ($_SESSION["s"]["user"]["typ"] != 'admin' && $app->auth->has_clients($_SESSION['s']['user']['userid'])) { + + // Get the limits of the client + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + $client = $app->db->queryOneRecord("SELECT client.client_id, contact_name, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id order by contact_name"); + + // Fill the client select field + $sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']; + $clients = $app->db->queryAllRecords($sql); + $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']); + $client_select = ''; + $tmp_data_record = $app->tform->getDataRecord($this->id); + if(is_array($clients)) { + foreach( $clients as $client) { + $selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':''; + $client_select .= "\r\n"; + } + } + $app->tpl->setVar("client_group_id",$client_select); + } + + // Getting Domains of the user + $sql = "SELECT domain FROM mail_domain WHERE ".$app->tform->getAuthSQL('r').' ORDER BY domain'; + $domains = $app->db->queryAllRecords($sql); + $domain_select = ''; + if(is_array($domains)) { + foreach( $domains as $domain) { + $selected = ($domain["domain"] == $this->dataRecord["domain"])?'SELECTED':''; + $domain_select .= "\r\n"; + } + } + $app->tpl->setVar("domain_option",$domain_select); + + if($this->id > 0) { + //* we are editing a existing record + $app->tpl->setVar("edit_disabled", 1); + $app->tpl->setVar("listname_value", $this->dataRecord["listname"]); + $app->tpl->setVar("domain_value", $this->dataRecord["domain"]); + $app->tpl->setVar("email_value", $this->dataRecord["email"]); + } else { + $app->tpl->setVar("edit_disabled", 0); + } + + parent::onShowEnd(); + } + + function onSubmit() { + global $app, $conf; + + if($_SESSION["s"]["user"]["typ"] != 'admin') { + + // Get the limits of the client + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + $client = $app->db->queryOneRecord("SELECT limit_mailmailinglist, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); + + //* Check if Domain belongs to user + if(isset($_POST["domain"])) { + $domain = $app->db->queryOneRecord("SELECT domain FROM mail_domain WHERE domain = '".$this->dataRecord["domain"]."' AND ".$app->tform->getAuthSQL('r')); + if($domain["domain"] != $this->dataRecord["domain"]) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm"); + } + + // When the record is updated + if($this->id == 0) { + //Check if email is in use + $check = $app->db->queryOneRecord("SELECT count(source) as number FROM mail_forwarding WHERE source = '".$this->dataRecord["listname"]."@".$this->dataRecord["domain"]."'"); + if($check['number'] != 0) { + $app->error($app->tform->wordbook["email_in_use_txt"]); + } + + $check = $app->db->queryOneRecord("SELECT count(email) as number FROM mail_user WHERE email = '".$this->dataRecord["listname"]."@".$this->dataRecord["domain"]."'"); + if($check['number'] != 0) { + $app->error($app->tform->wordbook["email_in_use_txt"]); + } + + $check = $app->db->queryOneRecord("SELECT count(mailinglist_id) as number FROM mail_mailinglist WHERE listname = '".$this->dataRecord["listname"]."' AND domain = '".$this->dataRecord["domain"]."'"); + if($check['number'] != 0) { + $app->error($app->tform->wordbook["email_in_use_txt"]); + } + + // Check if the user may add another mail_domain + if($client["limit_mailmailinglist"] >= 0) { + $tmp = $app->db->queryOneRecord("SELECT count(mailinglist_id) as number FROM mail_mailinglist WHERE sys_groupid = $client_group_id"); + if($tmp["number"] >= $client["limit_mailmailinglist"]) { + $app->error($app->tform->wordbook["limit_mailmailinglist_txt"]); + } + } + } + + // Clients may not set the client_group_id, so we unset them if user is not a admin + if(!$app->auth->has_clients($_SESSION['s']['user']['userid'])) unset($this->dataRecord["client_group_id"]); + } + + //* make sure that the email domain is lowercase + if(isset($this->dataRecord["domain"])) $this->dataRecord["domain"] = strtolower($this->dataRecord["domain"]); + + parent::onSubmit(); + } + + function onBeforeInsert() { + global $app, $conf; + + // Set the server id of the mailinglist = server ID of mail domain. + $domain = $app->db->queryOneRecord("SELECT server_id FROM mail_domain WHERE domain = '".$this->dataRecord["domain"]."'"); + $this->dataRecord["server_id"] = $domain['server_id']; + } + + function onAfterInsert() { + global $app, $conf; + + // make sure that the record belongs to the client group and not the admin group when a dmin inserts it + // also make sure that the user can not delete domain created by a admin + if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) { + $client_group_id = intval($this->dataRecord["client_group_id"]); + $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE mailinglist_id = ".$this->id); + } + if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) { + $client_group_id = intval($this->dataRecord["client_group_id"]); + $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE mailinglist_id = ".$this->id); + } + } + + function onBeforeUpdate() { + global $app, $conf; + + //* Check if the server has been changed + // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway + if($_SESSION["s"]["user"]["typ"] == 'admin' || $app->auth->has_clients($_SESSION['s']['user']['userid'])) { + $rec = $app->db->queryOneRecord("SELECT server_id, domain from mail_mailinglist WHERE mailinglist_id = ".$this->id); + $this->dataRecord["server_id"] = $rec['server_id']; + unset($rec); + //* If the user is neither admin nor reseller + } else { + //* We do not allow users to change a domain which has been created by the admin + $rec = $app->db->queryOneRecord("SELECT domain from mail_mailinglist WHERE mailinglist_id = ".$this->id); + if($rec['domain'] != $this->dataRecord["domain"] && $app->tform->checkPerm($this->id,'u')) { + //* Add a error message and switch back to old server + $app->tform->errorMessage .= $app->lng('The Domain can not be changed. Please ask your Administrator if you want to change the domain name.'); + $this->dataRecord["domain"] = $rec['domain']; + } + unset($rec); + } + } + + function onAfterUpdate() { + global $app, $conf; + + // make sure that the record belongs to the clinet group and not the admin group when admin inserts it + // also make sure that the user can not delete domain created by a admin + if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) { + $client_group_id = intval($this->dataRecord["client_group_id"]); + $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE mailinglist_id = ".$this->id); + } + if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) { + $client_group_id = intval($this->dataRecord["client_group_id"]); + $app->db->query("UPDATE mail_mailinglist SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE mailinglist_id = ".$this->id); + } + } + +} + +$app->tform_actions = new page_action; +$app->tform_actions->onLoad(); + +?> diff --git a/interface/web/mail/mail_mailinglist_list.php b/interface/web/mail/mail_mailinglist_list.php index b466c522d9f829a91dc5601d981cdf4f1ca4a134..732b14391bae62c2af3f109317aa5a659d090806 100644 --- a/interface/web/mail/mail_mailinglist_list.php +++ b/interface/web/mail/mail_mailinglist_list.php @@ -1,44 +1,44 @@ -auth->check_module_permissions('mail'); - -$app->load('listform_actions'); - - -class list_action extends listform_actions { - - function onShow() { - global $app,$conf; - - $app->uses('getconf'); - $global_config = $app->getconf->get_global_config('mail'); - - if($global_config['mailmailinglist_link'] == 'y') { - $app->tpl->setVar('mailmailinglist_link',1); - } else { - $app->tpl->setVar('mailmailinglist_link',0); - } - - parent::onShow(); - } - -} - -$list = new list_action; -$list->onLoad(); - - +auth->check_module_permissions('mail'); + +$app->load('listform_actions'); + + +class list_action extends listform_actions { + + function onShow() { + global $app,$conf; + + $app->uses('getconf'); + $global_config = $app->getconf->get_global_config('mail'); + + if($global_config['mailmailinglist_link'] == 'y') { + $app->tpl->setVar('mailmailinglist_link',1); + } else { + $app->tpl->setVar('mailmailinglist_link',0); + } + + parent::onShow(); + } + +} + +$list = new list_action; +$list->onLoad(); + + ?> \ No newline at end of file diff --git a/interface/web/mail/mailinglist.php b/interface/web/mail/mailinglist.php index 67b35e179a197bddd2b514266501d5257f14f068..9940e64cc473f8faf41a60f4ee24bfb665de3369 100644 --- a/interface/web/mail/mailinglist.php +++ b/interface/web/mail/mailinglist.php @@ -1,68 +1,68 @@ -auth->check_module_permissions('mail'); - -/* get the id of the mail (must be int!) */ -if (!isset($_GET['id'])){ - die ("No List selected!"); -} -$listId = intval($_GET['id']); - -/* - * Get the data to connect to the database - */ -$dbData = $app->db->queryAllRecords("SELECT server_id, listname FROM mail_mailinglist WHERE mailinglist_id = " . $listId); -$serverId = intval($dbData[0]['server_id']); -if ($serverId == 0){ - die ("No List - Server found!"); -} - -$serverData = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ".$serverId); - -$app->uses('getconf'); -$global_config = $app->getconf->get_global_config('mail'); - -if($global_config['mailmailinglist_url'] != '') { - header('Location:' . $global_config['mailmailinglist_url']); -} else { - -/* - * We only redirect to the login-form, so there is no need, to check any rights - */ - isset($_SERVER['HTTPS'])? $http = 'https' : $http = 'http'; - header('Location:' . $http . '://' . $serverData['server_name'] . '/cgi-bin/mailman/admin/' . $dbData[0]['listname']); -} -exit; +auth->check_module_permissions('mail'); + +/* get the id of the mail (must be int!) */ +if (!isset($_GET['id'])){ + die ("No List selected!"); +} +$listId = intval($_GET['id']); + +/* + * Get the data to connect to the database + */ +$dbData = $app->db->queryAllRecords("SELECT server_id, listname FROM mail_mailinglist WHERE mailinglist_id = " . $listId); +$serverId = intval($dbData[0]['server_id']); +if ($serverId == 0){ + die ("No List - Server found!"); +} + +$serverData = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ".$serverId); + +$app->uses('getconf'); +$global_config = $app->getconf->get_global_config('mail'); + +if($global_config['mailmailinglist_url'] != '') { + header('Location:' . $global_config['mailmailinglist_url']); +} else { + +/* + * We only redirect to the login-form, so there is no need, to check any rights + */ + isset($_SERVER['HTTPS'])? $http = 'https' : $http = 'http'; + header('Location:' . $http . '://' . $serverData['server_name'] . '/cgi-bin/mailman/admin/' . $dbData[0]['listname']); +} +exit; ?> \ No newline at end of file diff --git a/interface/web/mail/templates/mail_alias_edit.htm b/interface/web/mail/templates/mail_alias_edit.htm index 0606ab64d8070f91680b0be153e21e6a19503dfb..af8444cfd425a360dc43615723b8e70cf4e858b5 100644 --- a/interface/web/mail/templates/mail_alias_edit.htm +++ b/interface/web/mail/templates/mail_alias_edit.htm @@ -1,39 +1,39 @@ -

-

- -
- -
-
-
-

* {tmpl_var name='email_txt'}

-
- - - -
-
-
- - -
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+

* {tmpl_var name='email_txt'}

+
+ + + +
+
+
+ + +
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/mail_blacklist_edit.htm b/interface/web/mail/templates/mail_blacklist_edit.htm index e64fe2d5da009120196fac32fcf47c19321c31c7..63531fdd836868fa4b65ce012355915bc4248bf3 100644 --- a/interface/web/mail/templates/mail_blacklist_edit.htm +++ b/interface/web/mail/templates/mail_blacklist_edit.htm @@ -1,41 +1,41 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/mail_content_filter_edit.htm b/interface/web/mail/templates/mail_content_filter_edit.htm index ffe844e8d2462141db6967b866e205e8b8168fac..e93c26c139d6563cd791358b7be106a38986cb6f 100644 --- a/interface/web/mail/templates/mail_content_filter_edit.htm +++ b/interface/web/mail/templates/mail_content_filter_edit.htm @@ -1,50 +1,50 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/mail_domain_admin_list.htm b/interface/web/mail/templates/mail_domain_admin_list.htm index b0e14e5f7f5cba38f5902ae65a519b63703bbc5b..a2b4ba62e838a9cd2c407f9cb55a5e08b3d13869 100644 --- a/interface/web/mail/templates/mail_domain_admin_list.htm +++ b/interface/web/mail/templates/mail_domain_admin_list.htm @@ -17,27 +17,27 @@ - - - - + + + + - - - - + + + + - - - - + + + +
 
{tmpl_var name="active"}{tmpl_var name="sys_groupid"}{tmpl_var name="server_id"}{tmpl_var name="domain"}{tmpl_var name="active"}{tmpl_var name="sys_groupid"}{tmpl_var name="server_id"}{tmpl_var name="domain"}
{tmpl_var name='delete_txt'} diff --git a/interface/web/mail/templates/mail_domain_catchall_edit.htm b/interface/web/mail/templates/mail_domain_catchall_edit.htm index cd412dde69534b945815208f38a040f0a0182426..90b8af7b4476d5aaede228dab00b37d2caf1a550 100644 --- a/interface/web/mail/templates/mail_domain_catchall_edit.htm +++ b/interface/web/mail/templates/mail_domain_catchall_edit.htm @@ -1,38 +1,38 @@ -

-

- -
- -
-
-
-

{tmpl_var name='email_txt'}

-
- - -
-
-
- - -
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+

{tmpl_var name='email_txt'}

+
+ + +
+
+
+ + +
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/mail_get_edit.htm b/interface/web/mail/templates/mail_get_edit.htm index 2da485e38d04d3ee07a06802c01356b33aa21a91..6d45cdb1159073d66b666d09c3ee1204ef2bc8ac 100644 --- a/interface/web/mail/templates/mail_get_edit.htm +++ b/interface/web/mail/templates/mail_get_edit.htm @@ -1,54 +1,54 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='source_delete_txt'}

-
- {tmpl_var name='source_delete'} -
-
-
- - -
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='source_delete_txt'}

+
+ {tmpl_var name='source_delete'} +
+
+
+ + +
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/mail_mailinglist_edit.htm b/interface/web/mail/templates/mail_mailinglist_edit.htm index 2ac742ee1b973fcbe6e8630c00a8fa99e9bab512..bbf993df9266dc8c6a64825b37a4af130a4fb1eb 100644 --- a/interface/web/mail/templates/mail_mailinglist_edit.htm +++ b/interface/web/mail/templates/mail_mailinglist_edit.htm @@ -1,80 +1,80 @@ -

-

- -
- -
-
Mailing List - -
- - -
-
- - -
- - -
-
- - -
- - - -
- -
- - - -
-
- - - -
- -
- - -
-
- - -
-
- - -
-
-
- - -
-
-

{tmpl_var name='password_strength_txt'}

-
-

 

-
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
Mailing List + +
+ + +
+
+ + +
+ + +
+
+ + +
+ + + +
+ +
+ + + +
+
+ + + +
+ +
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+

{tmpl_var name='password_strength_txt'}

+
+

 

+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/mail_mailinglist_list.htm b/interface/web/mail/templates/mail_mailinglist_list.htm index 58da87ecc96e015b9a6cca80ebcf283a042b7bcf..37b0be7c8be130db4db4a647ae7763d357d4d62e 100644 --- a/interface/web/mail/templates/mail_mailinglist_list.htm +++ b/interface/web/mail/templates/mail_mailinglist_list.htm @@ -1,53 +1,53 @@ -

- -
- -
-
{tmpl_var name="toolsarea_head_txt"} -
- -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
{tmpl_var name="listname"}{tmpl_var name="domain"} - -
-
-
- -
+

+ +
+ +
+
{tmpl_var name="toolsarea_head_txt"} +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="listname"}{tmpl_var name="domain"} + +
+
+
+ +
diff --git a/interface/web/mail/templates/mail_relay_recipient_list.htm b/interface/web/mail/templates/mail_relay_recipient_list.htm index 331aa5e2b890af1169defdb7f4971420eaea2cfa..0a648e4264abb2ff30405f697bb08feecf23f3a5 100644 --- a/interface/web/mail/templates/mail_relay_recipient_list.htm +++ b/interface/web/mail/templates/mail_relay_recipient_list.htm @@ -17,24 +17,24 @@ - - - + + + - - - + + + - - - + + +
 
{tmpl_var name="active"}{tmpl_var name="server_id"}{tmpl_var name="source"}{tmpl_var name="active"}{tmpl_var name="server_id"}{tmpl_var name="source"}
{tmpl_var name='delete_txt'} diff --git a/interface/web/mail/templates/mail_transport_edit.htm b/interface/web/mail/templates/mail_transport_edit.htm index 5f16db366232a0d3e0faf56f91a46c87cf0e1f68..b6e1c9762cf138224bc70cd946a79d6b9f53afa6 100644 --- a/interface/web/mail/templates/mail_transport_edit.htm +++ b/interface/web/mail/templates/mail_transport_edit.htm @@ -1,56 +1,56 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='mx_txt'}

-
- -
-
-
- - -
-
- - -
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='mx_txt'}

+
+ +
+
+
+ + +
+
+ + +
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/mail_user_custom_rules_edit.htm b/interface/web/mail/templates/mail_user_custom_rules_edit.htm index 0ca1b3c6ec6e0612eff92b029e6e067a0cbe6f6f..33d597d9be0e19c149166373ff8afc7007ee7739 100644 --- a/interface/web/mail/templates/mail_user_custom_rules_edit.htm +++ b/interface/web/mail/templates/mail_user_custom_rules_edit.htm @@ -1,22 +1,22 @@ -

-

- -
- -
-
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/mail_user_stats_list.htm b/interface/web/mail/templates/mail_user_stats_list.htm index 47e4b07b67c62c37253a5d3dd0295512a9f978ef..b7f0d28ae5aba36379cd797b375cd48717fe278a 100644 --- a/interface/web/mail/templates/mail_user_stats_list.htm +++ b/interface/web/mail/templates/mail_user_stats_list.htm @@ -1,52 +1,52 @@ -

-

- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
{tmpl_var name="email"}{tmpl_var name="this_month"} MB{tmpl_var name="last_month"} MB{tmpl_var name="this_year"} MB{tmpl_var name="last_year"} MB -
-
-
-
-
- -
+

+

+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="email"}{tmpl_var name="this_month"} MB{tmpl_var name="last_month"} MB{tmpl_var name="this_year"} MB{tmpl_var name="last_year"} MB +
+
+
+
+
+ +
diff --git a/interface/web/mail/templates/mail_whitelist_edit.htm b/interface/web/mail/templates/mail_whitelist_edit.htm index d8e6b8b53bdd0f0d9e2e62ec47d9acc65db33356..dc31da2df1e1c1ece15eaebf5fc82aef36cf2f89 100644 --- a/interface/web/mail/templates/mail_whitelist_edit.htm +++ b/interface/web/mail/templates/mail_whitelist_edit.htm @@ -1,41 +1,41 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/spamfilter_blacklist_edit.htm b/interface/web/mail/templates/spamfilter_blacklist_edit.htm index 36058d9a4c8a10d59d540bbc2c2f8c977a055327..750c4b1e21905fa4b48bba0ac7502a81979e6007 100644 --- a/interface/web/mail/templates/spamfilter_blacklist_edit.htm +++ b/interface/web/mail/templates/spamfilter_blacklist_edit.htm @@ -1,49 +1,49 @@ -

-

- -
- -
-
- -
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - - -
- - -
-
- -
+

+

+ +
+ +
+
+ +
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/spamfilter_config_getmail_edit.htm b/interface/web/mail/templates/spamfilter_config_getmail_edit.htm index 1bdb88675bb5c6f4ed8b3a86b505271d4848f198..49f5ff1a6304b1cdd0006ae7ef40565f517fdb33 100644 --- a/interface/web/mail/templates/spamfilter_config_getmail_edit.htm +++ b/interface/web/mail/templates/spamfilter_config_getmail_edit.htm @@ -1,22 +1,22 @@ -

-

- -
- -
-
- - - - -
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+ + + + +
+ + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/spamfilter_config_mail_edit.htm b/interface/web/mail/templates/spamfilter_config_mail_edit.htm index 3526589ab1d6918b387c7aea5647796af6609288..50d43cdaf24424165af1efb8a613f3f6545b8cfd 100644 --- a/interface/web/mail/templates/spamfilter_config_mail_edit.htm +++ b/interface/web/mail/templates/spamfilter_config_mail_edit.htm @@ -1,66 +1,66 @@ -

-

- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/spamfilter_config_server_edit.htm b/interface/web/mail/templates/spamfilter_config_server_edit.htm index ac45009fd285f23f4338fbc2277c50f7b7a22760..e5b5428798360c5f114b55ee9d39c1595c662b32 100644 --- a/interface/web/mail/templates/spamfilter_config_server_edit.htm +++ b/interface/web/mail/templates/spamfilter_config_server_edit.htm @@ -1,38 +1,38 @@ -

-

- -
- -
-
- - - - - - - - - - - - - - - - - - - - -
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/spamfilter_other_edit.htm b/interface/web/mail/templates/spamfilter_other_edit.htm index 76889a6a948f3adc8dbfd143b072e62677ccf70c..6b8c739da3b46875a7bfda0c7f026327817a1ec9 100644 --- a/interface/web/mail/templates/spamfilter_other_edit.htm +++ b/interface/web/mail/templates/spamfilter_other_edit.htm @@ -1,80 +1,80 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -  Bytes -
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +  Bytes +
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/spamfilter_policy_edit.htm b/interface/web/mail/templates/spamfilter_policy_edit.htm index b725df5fb379adb1b9567d354f254c1c3114d1eb..6a0d2acd4a2866b89eca414f967e53aac733f8d4 100644 --- a/interface/web/mail/templates/spamfilter_policy_edit.htm +++ b/interface/web/mail/templates/spamfilter_policy_edit.htm @@ -1,64 +1,64 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/spamfilter_quarantine_edit.htm b/interface/web/mail/templates/spamfilter_quarantine_edit.htm index de33b33c8c5e26e197e0326c02e6370d3ae5dfaf..565ec84de6c0ae5fe89214bca5d1fe4de98e482f 100644 --- a/interface/web/mail/templates/spamfilter_quarantine_edit.htm +++ b/interface/web/mail/templates/spamfilter_quarantine_edit.htm @@ -1,44 +1,44 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
- -
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/spamfilter_taglevel_edit.htm b/interface/web/mail/templates/spamfilter_taglevel_edit.htm index aef98d3d249c83bbf9610b5d45b892db5df9a100..e111a24ed5312b2475f0584753bde844ddecf972 100644 --- a/interface/web/mail/templates/spamfilter_taglevel_edit.htm +++ b/interface/web/mail/templates/spamfilter_taglevel_edit.htm @@ -1,52 +1,52 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/spamfilter_users_edit.htm b/interface/web/mail/templates/spamfilter_users_edit.htm index 01d5699228b257e7eb931b027461aa8110ff54fe..86520a513aefc7f3c3df2a4098a362593225a168 100644 --- a/interface/web/mail/templates/spamfilter_users_edit.htm +++ b/interface/web/mail/templates/spamfilter_users_edit.htm @@ -1,50 +1,50 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/mail/templates/spamfilter_whitelist_edit.htm b/interface/web/mail/templates/spamfilter_whitelist_edit.htm index 3ef8f5fb2ff43d393011f3dbb02c946bf83d1419..138364b7652b5e12a81d037959e4f415a9cf55e5 100644 --- a/interface/web/mail/templates/spamfilter_whitelist_edit.htm +++ b/interface/web/mail/templates/spamfilter_whitelist_edit.htm @@ -1,49 +1,49 @@ -

-

- -
- -
-
- -
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - - -
- - -
-
- -
+

+

+ +
+ +
+
+ +
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + + +
+ + +
+
+ +
diff --git a/interface/web/monitor/lib/admin.conf.php b/interface/web/monitor/lib/admin.conf.php index a45d4403455c5c46f438046f088398e241cbc3d9..67c94a5742572786e8c7c2ae67750c31231a4b64 100644 --- a/interface/web/monitor/lib/admin.conf.php +++ b/interface/web/monitor/lib/admin.conf.php @@ -1,2 +1,2 @@ - \ No newline at end of file diff --git a/interface/web/monitor/templates/datalog_list.htm b/interface/web/monitor/templates/datalog_list.htm index 93eede0574c5b3ada76e4397548435c83387aa56..0ddba820acf24cc44bda4d72067867d82853304d 100644 --- a/interface/web/monitor/templates/datalog_list.htm +++ b/interface/web/monitor/templates/datalog_list.htm @@ -1,49 +1,49 @@ -

-

- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
 
{tmpl_var name="tstamp"}{tmpl_var name="server_id"}{tmpl_var name="action"}{tmpl_var name="dbtable"} -
- -
-
-
-
- -
+

+

+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
 
{tmpl_var name="tstamp"}{tmpl_var name="server_id"}{tmpl_var name="action"}{tmpl_var name="dbtable"} +
+ +
+
+
+
+ +
diff --git a/interface/web/monitor/templates/show_data.htm b/interface/web/monitor/templates/show_data.htm index f83440fe46364f905453a27fb341974e522e184b..96ac62d7ddbfafd68dfa30653ac63eff9a8790de 100644 --- a/interface/web/monitor/templates/show_data.htm +++ b/interface/web/monitor/templates/show_data.htm @@ -1,12 +1,12 @@ -

-

- -
- -
-
-
-
-
- -
+

+

+ +
+ +
+
+
+
+
+ +
diff --git a/interface/web/monitor/templates/show_log.htm b/interface/web/monitor/templates/show_log.htm index b6077277cdb656d06c34b3bcbce2b778585536b6..3b7be6d1acbf88a9911a6a9b604f6df39edf6943 100644 --- a/interface/web/monitor/templates/show_log.htm +++ b/interface/web/monitor/templates/show_log.htm @@ -1,25 +1,25 @@ -

-

- -
- -
-
-
-
- - -
-
-
-
- -
-
-
-
-
- -
+

+

+ +
+ +
+
+
+
+ + +
+
+
+
+ +
+
+
+
+
+ +
diff --git a/interface/web/monitor/templates/show_sys_state.htm b/interface/web/monitor/templates/show_sys_state.htm index 904361cb1f410d0bc831c0da72fab229edc35f1d..994173826089af1240069ac85f14cb27b1a945ae 100644 --- a/interface/web/monitor/templates/show_sys_state.htm +++ b/interface/web/monitor/templates/show_sys_state.htm @@ -1,25 +1,25 @@ -

-

- -
- -
-
-
-
- - -
-
-
-
- -
-
-
-
-
- -
+

+

+ +
+ +
+
+
+
+ + +
+
+
+
+ +
+
+
+
+
+ +
diff --git a/interface/web/monitor/templates/syslog_list.htm b/interface/web/monitor/templates/syslog_list.htm index 0bbb03cfbc5e5a7ee015a04bf9786f303d7ab918..5f87c79ef9256ea39c02588a33e78409a70d2021 100644 --- a/interface/web/monitor/templates/syslog_list.htm +++ b/interface/web/monitor/templates/syslog_list.htm @@ -1,56 +1,56 @@ -

-

- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
 
{tmpl_var name="tstamp"}{tmpl_var name="server_id"}{tmpl_var name="loglevel"}{tmpl_var name="message"} - - - - - - -
-
-
- -
+

+

+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
 
{tmpl_var name="tstamp"}{tmpl_var name="server_id"}{tmpl_var name="loglevel"}{tmpl_var name="message"} + + + + + + +
+
+
+ +
diff --git a/interface/web/nav.php b/interface/web/nav.php index d563bb534863d069336db66622b1fe95da05f7bc..0c57adbd9a36e1d0af3238514bd74c9ccb07a732 100644 --- a/interface/web/nav.php +++ b/interface/web/nav.php @@ -1,115 +1,115 @@ -uses('tpl'); - -//** Top Naviation -if(isset($_GET['nav']) && $_GET['nav'] == 'top') { - - $app->tpl->newTemplate('topnav.tpl.htm'); - - //* Check User Login and current module - if(isset($_SESSION["s"]["user"]) && $_SESSION["s"]["user"]['active'] == 1 && is_array($_SESSION['s']['module'])) { - //* Loading modules of the user and building top navigation - $modules = explode(',', $_SESSION['s']['user']['modules']); - /* - * If the dashboard is in the list of modules it always has to be the first! - */ - if (in_array('dashboard', $modules)) { - $key = array_search('dashboard', $modules); - unset($modules[$key]); - $modules = array_merge(array('dashboard'), $modules); - } - if(is_array($modules)) { - foreach($modules as $mt) { - if(is_file($mt.'/lib/module.conf.php')) { - if(!preg_match("/^[a-z]{2,20}$/i", $mt)) die('module name contains unallowed chars.'); - include_once($mt.'/lib/module.conf.php'); - $active = ($module['name'] == $_SESSION['s']['module']['name']) ? 1 : 0; - $topnav[] = array( 'title' => $app->lng($module['title']), - 'active' => $active, - 'module' => $module['name']); - } - } - } - } else { - //* Loading Login Module - include_once('login/lib/module.conf.php'); - $_SESSION['s']['module'] = $module; - $topnav[] = array( 'title' => 'Login', - 'active' => 1); - $module = null; - unset($module); - } - - //* Topnavigation - $app->tpl->setLoop('nav_top',$topnav); - -} - -//** Side Naviation -if(isset($_GET['nav']) && $_GET['nav'] == 'side') { - - if(isset($_SESSION['s']['module']['name']) && is_file($_SESSION['s']['module']['name'].'/lib/custom_menu.inc.php')) { - include_once($_SESSION['s']['module']['name'].'/lib/custom_menu.inc.php'); - } else { - - $app->tpl->newTemplate('sidenav.tpl.htm'); - - //* translating module navigation - $nav_translated = array(); - if(isset($_SESSION['s']['module']['nav']) && is_array($_SESSION['s']['module']['nav'])) { - foreach($_SESSION['s']['module']['nav'] as $nav) { - $tmp_items = array(); - foreach($nav['items'] as $item) { - $item['title'] = $app->lng($item['title']); - $tmp_items[] = $item; - } - $nav['title'] = $app->lng($nav['title']); - $nav['startpage'] = $nav['items'][0]['link']; - $nav['items'] = $tmp_items; - $nav_translated[] = $nav; - } - } else { - $nav_translated = null; - } - $app->tpl->setLoop('nav_left',$nav_translated); - - } - -} - -$app->tpl_defaults(); -$app->tpl->pparse(); - +uses('tpl'); + +//** Top Naviation +if(isset($_GET['nav']) && $_GET['nav'] == 'top') { + + $app->tpl->newTemplate('topnav.tpl.htm'); + + //* Check User Login and current module + if(isset($_SESSION["s"]["user"]) && $_SESSION["s"]["user"]['active'] == 1 && is_array($_SESSION['s']['module'])) { + //* Loading modules of the user and building top navigation + $modules = explode(',', $_SESSION['s']['user']['modules']); + /* + * If the dashboard is in the list of modules it always has to be the first! + */ + if (in_array('dashboard', $modules)) { + $key = array_search('dashboard', $modules); + unset($modules[$key]); + $modules = array_merge(array('dashboard'), $modules); + } + if(is_array($modules)) { + foreach($modules as $mt) { + if(is_file($mt.'/lib/module.conf.php')) { + if(!preg_match("/^[a-z]{2,20}$/i", $mt)) die('module name contains unallowed chars.'); + include_once($mt.'/lib/module.conf.php'); + $active = ($module['name'] == $_SESSION['s']['module']['name']) ? 1 : 0; + $topnav[] = array( 'title' => $app->lng($module['title']), + 'active' => $active, + 'module' => $module['name']); + } + } + } + } else { + //* Loading Login Module + include_once('login/lib/module.conf.php'); + $_SESSION['s']['module'] = $module; + $topnav[] = array( 'title' => 'Login', + 'active' => 1); + $module = null; + unset($module); + } + + //* Topnavigation + $app->tpl->setLoop('nav_top',$topnav); + +} + +//** Side Naviation +if(isset($_GET['nav']) && $_GET['nav'] == 'side') { + + if(isset($_SESSION['s']['module']['name']) && is_file($_SESSION['s']['module']['name'].'/lib/custom_menu.inc.php')) { + include_once($_SESSION['s']['module']['name'].'/lib/custom_menu.inc.php'); + } else { + + $app->tpl->newTemplate('sidenav.tpl.htm'); + + //* translating module navigation + $nav_translated = array(); + if(isset($_SESSION['s']['module']['nav']) && is_array($_SESSION['s']['module']['nav'])) { + foreach($_SESSION['s']['module']['nav'] as $nav) { + $tmp_items = array(); + foreach($nav['items'] as $item) { + $item['title'] = $app->lng($item['title']); + $tmp_items[] = $item; + } + $nav['title'] = $app->lng($nav['title']); + $nav['startpage'] = $nav['items'][0]['link']; + $nav['items'] = $tmp_items; + $nav_translated[] = $nav; + } + } else { + $nav_translated = null; + } + $app->tpl->setLoop('nav_left',$nav_translated); + + } + +} + +$app->tpl_defaults(); +$app->tpl->pparse(); + ?> \ No newline at end of file diff --git a/interface/web/sites/cron_del.php b/interface/web/sites/cron_del.php index 516b4473b9eacfc9a20f89b1888033fc80d3c95b..484e5073c739e604fbfaa7cba7549cfa64b2a624 100644 --- a/interface/web/sites/cron_del.php +++ b/interface/web/sites/cron_del.php @@ -1,64 +1,64 @@ -auth->check_module_permissions('sites'); - -$app->uses('tpl,tform,tform_actions'); -$app->load('tform_actions'); - -class page_action extends tform_actions { - - function onBeforeDelete() { - global $app; $conf; - - if($app->tform->checkPerm($this->id,'d') == false) $app->error($app->lng('error_no_delete_permission')); - } -} - -$page = new page_action; -$page->onDelete(); - +auth->check_module_permissions('sites'); + +$app->uses('tpl,tform,tform_actions'); +$app->load('tform_actions'); + +class page_action extends tform_actions { + + function onBeforeDelete() { + global $app; $conf; + + if($app->tform->checkPerm($this->id,'d') == false) $app->error($app->lng('error_no_delete_permission')); + } +} + +$page = new page_action; +$page->onDelete(); + ?> \ No newline at end of file diff --git a/interface/web/sites/cron_list.php b/interface/web/sites/cron_list.php index 68e23163f254e410db9a24f090f87ed7df10477f..dcd9a547e8cc6a36a73d6dba849b4195c9178640 100644 --- a/interface/web/sites/cron_list.php +++ b/interface/web/sites/cron_list.php @@ -1,23 +1,23 @@ -auth->check_module_permissions('sites'); - -$app->uses('listform_actions'); - -$app->listform_actions->onLoad(); - - +auth->check_module_permissions('sites'); + +$app->uses('listform_actions'); + +$app->listform_actions->onLoad(); + + ?> \ No newline at end of file diff --git a/interface/web/sites/lib/admin.conf.php b/interface/web/sites/lib/admin.conf.php index a45d4403455c5c46f438046f088398e241cbc3d9..67c94a5742572786e8c7c2ae67750c31231a4b64 100644 --- a/interface/web/sites/lib/admin.conf.php +++ b/interface/web/sites/lib/admin.conf.php @@ -1,2 +1,2 @@ - \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_database_admin_list.lng b/interface/web/sites/lib/lang/en_database_admin_list.lng index d076d60cf5306030ee93559fea7fb40571f7f9db..a49adcdadde6f2ada62bbaf65ee95ba7c2ec4f87 100644 --- a/interface/web/sites/lib/lang/en_database_admin_list.lng +++ b/interface/web/sites/lib/lang/en_database_admin_list.lng @@ -1,10 +1,10 @@ - \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_user_quota_stats_list.lng b/interface/web/sites/lib/lang/en_user_quota_stats_list.lng index 943c13babc3b469c5ddf7f4c953c3974c60cec04..1d4290856c82b5829a045eef1a6ce9c095851f7a 100644 --- a/interface/web/sites/lib/lang/en_user_quota_stats_list.lng +++ b/interface/web/sites/lib/lang/en_user_quota_stats_list.lng @@ -1,8 +1,8 @@ - \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_web_domain.lng b/interface/web/sites/lib/lang/en_web_domain.lng index 3f166cf022d81501091425ae447c28138e323b92..d709cc50fec61e69f784ed450f558193791e612c 100644 --- a/interface/web/sites/lib/lang/en_web_domain.lng +++ b/interface/web/sites/lib/lang/en_web_domain.lng @@ -1,75 +1,75 @@ - \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_web_domain_admin_list.lng b/interface/web/sites/lib/lang/en_web_domain_admin_list.lng index f8b37f4f840af0c9fabf80af33ef69ca02999eab..e8825ae321ef43391c871589ca1e7144123d4946 100644 --- a/interface/web/sites/lib/lang/en_web_domain_admin_list.lng +++ b/interface/web/sites/lib/lang/en_web_domain_admin_list.lng @@ -1,9 +1,9 @@ - \ No newline at end of file diff --git a/interface/web/sites/templates/cron_edit.htm b/interface/web/sites/templates/cron_edit.htm index 39f9bc6469f9888bb53968d0c499d9d6c7af09dc..bebccbfef23bd5e514d211724e06f6ebc26240a8 100644 --- a/interface/web/sites/templates/cron_edit.htm +++ b/interface/web/sites/templates/cron_edit.htm @@ -1,68 +1,68 @@ -

-

- -
- -
-
Cron Job -
- - - - - - - - -
-
- - -

e.g. *, */3, 10-20

-
-
- - -

e.g. *, */2, 0, 10-12

-
-
- - -

e.g. *, */4, 1-5

-
-
- - -

e.g. *, 1-6

-
-
- - -

e.g. *, 0, 1-5

-
-
- - -

e.g. /var/www/clients/client1/myscript.sh or http://www.mydomain.com/path/script.php

-
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
Cron Job +
+ + + + + + + + +
+
+ + +

e.g. *, */3, 10-20

+
+
+ + +

e.g. *, */2, 0, 10-12

+
+
+ + +

e.g. *, */4, 1-5

+
+
+ + +

e.g. *, 1-6

+
+
+ + +

e.g. *, 0, 1-5

+
+
+ + +

e.g. /var/www/clients/client1/myscript.sh or http://www.mydomain.com/path/script.php

+
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/sites/templates/database_admin_list.htm b/interface/web/sites/templates/database_admin_list.htm index face8e4a00eea121a262f9630cb7a179d0d7d164..7cb228d99fcff5cf9f9515d9d7833c853687eb75 100644 --- a/interface/web/sites/templates/database_admin_list.htm +++ b/interface/web/sites/templates/database_admin_list.htm @@ -17,33 +17,33 @@ - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + +
 
{tmpl_var name="active"}{tmpl_var name="remote_access"}{tmpl_var name="sys_groupid"}{tmpl_var name="server_id"}{tmpl_var name="database_user"}{tmpl_var name="database_name"}{tmpl_var name="active"}{tmpl_var name="remote_access"}{tmpl_var name="sys_groupid"}{tmpl_var name="server_id"}{tmpl_var name="database_user"}{tmpl_var name="database_name"}
{tmpl_var name='admin_txt'} diff --git a/interface/web/sites/templates/ftp_user_advanced.htm b/interface/web/sites/templates/ftp_user_advanced.htm index 1520630b539fd42e752aeed3d3e073f8e6d5bfc8..85e6c66ef3dd650a01a8c29feca8da11ad91cea0 100644 --- a/interface/web/sites/templates/ftp_user_advanced.htm +++ b/interface/web/sites/templates/ftp_user_advanced.htm @@ -1,50 +1,50 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
- -

 {tmpl_var name='quota_files_unity_txt'}

-
-
- -

 MB

-
-
- -

 MB

-
-
- -

 kb/s

-
-
- -

 kb/s

-
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ +

 {tmpl_var name='quota_files_unity_txt'}

+
+
+ +

 MB

+
+
+ +

 MB

+
+
+ +

 kb/s

+
+
+ +

 kb/s

+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/sites/templates/ftp_user_advanced_client.htm b/interface/web/sites/templates/ftp_user_advanced_client.htm index fd8d617cedc423822c51bb2570bad378e7631835..5698bb00f63cfc1acdea9d4f40c71a55f2b47d91 100644 --- a/interface/web/sites/templates/ftp_user_advanced_client.htm +++ b/interface/web/sites/templates/ftp_user_advanced_client.htm @@ -1,22 +1,22 @@ -

-

- -
- -
-
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/sites/templates/ftp_user_edit.htm b/interface/web/sites/templates/ftp_user_edit.htm index f7588b33183d19048fe15568cb9730bde03466ef..d3c6d78963bde7a54172975214c1434f96519625 100644 --- a/interface/web/sites/templates/ftp_user_edit.htm +++ b/interface/web/sites/templates/ftp_user_edit.htm @@ -1,48 +1,48 @@ -

-

- -
- -
-
-
- - -
-
- -
{tmpl_var name='username_prefix'}
- -
-
- - -
-
-

{tmpl_var name='password_strength_txt'}

-
-

 

-
-
- -

 MB

-
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ +
{tmpl_var name='username_prefix'}
+ +
+
+ + +
+
+

{tmpl_var name='password_strength_txt'}

+
+

 

+
+
+ +

 MB

+
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/sites/templates/shell_user_advanced.htm b/interface/web/sites/templates/shell_user_advanced.htm index eb7d8ceb11d2316ddbd4d7d6db909d8884568ab6..870614c3442f4fb5f2b3d40e38aebd72f12bd90d 100644 --- a/interface/web/sites/templates/shell_user_advanced.htm +++ b/interface/web/sites/templates/shell_user_advanced.htm @@ -1,34 +1,34 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/sites/templates/shell_user_edit.htm b/interface/web/sites/templates/shell_user_edit.htm index 6e2c3d9f8138ef8030b47d760a00f6b58af14216..45bdcc40876e39d34d2674c1322da8d48aded47c 100644 --- a/interface/web/sites/templates/shell_user_edit.htm +++ b/interface/web/sites/templates/shell_user_edit.htm @@ -1,66 +1,66 @@ -

-

- -
- -
-
-
- - - - - - - - -
-
- -
{tmpl_var name='username_prefix'}
- -
-
- - -
-
-

{tmpl_var name='password_strength_txt'}

-
-

 

-
-
- - -
-
- -

 MB

-
-
- - -
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + + + + + + + +
+
+ +
{tmpl_var name='username_prefix'}
+ +
+
+ + +
+
+

{tmpl_var name='password_strength_txt'}

+
+

 

+
+
+ + +
+
+ +

 MB

+
+
+ + +
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/sites/templates/user_quota_stats_list.htm b/interface/web/sites/templates/user_quota_stats_list.htm index f7b7eaa085eb2c501699a6c8df41871fb0871e59..b005d60cd8d5fdbca1993f882febb78c91add861 100644 --- a/interface/web/sites/templates/user_quota_stats_list.htm +++ b/interface/web/sites/templates/user_quota_stats_list.htm @@ -7,30 +7,30 @@ - + - + - + - + - + - +
 
     
{tmpl_var name="domain"}{tmpl_var name="domain"} {tmpl_var name="system_user"} {tmpl_var name="used"} {tmpl_var name="soft"}{tmpl_var name="hard"}{tmpl_var name="hard"}
  diff --git a/interface/web/sites/templates/web_aliasdomain_edit.htm b/interface/web/sites/templates/web_aliasdomain_edit.htm index 82773d1ccf77fb43780b0a21337630680a6f3278..688ed520b30b661a6fc3f743ddd16fee5054c106 100644 --- a/interface/web/sites/templates/web_aliasdomain_edit.htm +++ b/interface/web/sites/templates/web_aliasdomain_edit.htm @@ -1,56 +1,56 @@ -

-

- -
- -
-
-
- - - - - - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + + + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/sites/templates/web_domain_admin_list.htm b/interface/web/sites/templates/web_domain_admin_list.htm index 7290f1f8e46c2b08f4a3eb061467e2589562d1b9..efb72862e296044a4cfa3aa25112c252ec3af601 100644 --- a/interface/web/sites/templates/web_domain_admin_list.htm +++ b/interface/web/sites/templates/web_domain_admin_list.htm @@ -17,30 +17,30 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/interface/web/themes/default/templates/module_tree.tpl.htm b/interface/web/themes/default/templates/module_tree.tpl.htm index b0895789ab97c225f126acfdf811ee10602989af..bb6242d0b659b21387ff1014163997acad9506d7 100644 --- a/interface/web/themes/default/templates/module_tree.tpl.htm +++ b/interface/web/themes/default/templates/module_tree.tpl.htm @@ -1,38 +1,38 @@ - - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/interface/web/themes/default/templates/sidenav.tpl.htm b/interface/web/themes/default/templates/sidenav.tpl.htm index 71cb9bb017aaf1ec6535253157edca202f92373c..c71361c2bd4577478b534be7544aff6ad79d0fe9 100644 --- a/interface/web/themes/default/templates/sidenav.tpl.htm +++ b/interface/web/themes/default/templates/sidenav.tpl.htm @@ -1,24 +1,24 @@ - + diff --git a/interface/web/themes/default/templates/tabbed_form.tpl.htm b/interface/web/themes/default/templates/tabbed_form.tpl.htm index 0e31bc0565f834059e65d76ac35faa93057786b7..c4e618da4e55acffc2625f531db81ae4ee68d529 100644 --- a/interface/web/themes/default/templates/tabbed_form.tpl.htm +++ b/interface/web/themes/default/templates/tabbed_form.tpl.htm @@ -1,28 +1,28 @@ - -

-
-
-
    - - -
  • - -
  • -
    -
    -
-
-
- - -

-
- -

ERROR

-
- - -
- - - + +

+
+
+
    + + +
  • + +
  • +
    +
    +
+
+
+ + +

+
+ +

ERROR

+
+ + +
+ + + diff --git a/interface/web/themes/default/templates/topnav.tpl.htm b/interface/web/themes/default/templates/topnav.tpl.htm index 668df7ba37acddd1b22b8e8bd3f7115e92c5cd60..562f4a0f07a8746533d321ae9bece1c801d9070a 100644 --- a/interface/web/themes/default/templates/topnav.tpl.htm +++ b/interface/web/themes/default/templates/topnav.tpl.htm @@ -1,9 +1,9 @@ -
    - - -
  • - -
  • -
    -
    -
+
    + + +
  • + +
  • +
    +
    +
diff --git a/interface/web/themes/default/yaml/!important.txt b/interface/web/themes/default/yaml/!important.txt index dfdf80ddac9f19d930067441466cf3fbabf511e9..ce2cc2df1b853b00297ffe171028b52c3f6c3482 100644 --- a/interface/web/themes/default/yaml/!important.txt +++ b/interface/web/themes/default/yaml/!important.txt @@ -1,4 +1,4 @@ -DON'T EDIT ANYTHING INSIDE THIS DIRECTORY! - -This theme is based on YAML V3.0.6, Build: 080609 (http://www.yaml.de/) -CSS-Styles can be changed in the /themes/default/css/ directory +DON'T EDIT ANYTHING INSIDE THIS DIRECTORY! + +This theme is based on YAML V3.0.6, Build: 080609 (http://www.yaml.de/) +CSS-Styles can be changed in the /themes/default/css/ directory diff --git a/interface/web/themes/default/yaml/core/base.css b/interface/web/themes/default/yaml/core/base.css index 632248e2f53474c38ab9d55031a62f48c2d131c0..bc24d1550eff9ed9c2143530947e07a936ec8a0b 100644 --- a/interface/web/themes/default/yaml/core/base.css +++ b/interface/web/themes/default/yaml/core/base.css @@ -1,229 +1,229 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) YAML core stylesheet - * (de) YAML Basis-Stylesheet - * - * Don't make any changes in this file! - * Your changes should be placed in any css-file in your own stylesheet folder. - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - */ - -@media all -{ - /*------------------------------------------------------------------------------------------------------*/ - - /** - * @section browser reset - * @see http://www.yaml.de/en/documentation/css-components/base-stylesheet.html - */ - - /* (en) Global reset of paddings and margins for all HTML elements */ - /* (de) Globales Zurücksetzen der Innen- und Außenabstände für alle HTML-Elemente */ - * { margin:0; padding: 0; } - - /* (en) Correction: margin/padding reset caused too small select boxes. */ - /* (de) Korrektur: Das Zurücksetzen der Abstände verursacht zu kleine Selectboxen. */ - option { padding-left: 0.4em; } - - /** - * (en) Global fix of the Italics bugs in IE 5.x and IE 6 - * (de) Globale Korrektur des Italics Bugs des IE 5.x und IE 6 - * - * @bugfix - * @affected IE 5.x/Win, IE6 - * @css-for IE 5.x/Win, IE6 - * @valid yes - */ - * html body * { overflow:visible; } - * html iframe, * html frame { overflow:auto; } - * html frameset { overflow:hidden; } - - /* (en) Forcing vertical scrollbars in Netscape, Firefox and Safari browsers */ - /* (de) Erzwingen vertikaler Scrollbalken in Netscape, Firefox und Safari Browsern */ - html { height: 100%; margin-bottom: 1px; } - body { - /* (en) Fix for rounding errors when scaling font sizes in older versions of Opera browser */ - /* (de) Beseitigung von Rundungsfehler beim Skalieren von Schriftgrößen in älteren Opera Versionen */ - font-size: 100.01%; - - /* (en) Standard values for colors and text alignment */ - /* (de) Vorgabe der Standardfarben und Textausrichtung */ - color: #000; - background: #fff; - text-align: left; - } - - /* (en) Clear borders for
and elements */ - /* (de) Rahmen für
und Elemente löschen */ - fieldset, img { border: 0 solid; } - - /* (en) new standard values for lists, blockquote and cite */ - /* (de) Neue Standardwerte für Listen & Zitate */ - ul, ol, dl { margin: 0 0 1em 1em } - li { margin-left: 1.5em; line-height: 1.5em; } - - dt { font-weight: bold; } - dd { margin: 0 0 1em 2em; } - - blockquote { margin: 0 0 1em 1.5em; } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * @section base layout | Basis Layout - * @see http://www.yaml.de/en/documentation/css-components/base-stylesheet.html - * - * |-------------------------------| - * | #header | - * |-------------------------------| - * | #col1 | #col3 | #col2 | - * | 200 px | flexible | 200px | - * |-------------------------------| - * | #footer | - * |-------------------------------| - */ - - #header { position:relative; } - - /* (en) Text Alignment for #topnav content */ - /* (de) Textausrichtung für #topnav Inhalte */ - #topnav { text-align: right; } - - /* (en) Absolute positioning only within #header */ - /* (de) Absolute Positionierung erfolgt nur innerhalb von #header */ - #header #topnav { - position:absolute; - top: 10px; - right: 10px; - } - - /* (en) Backup for correct positioning */ - /* (de) Absicherung korrekte Positionierung */ - #header, #nav, #main, #footer { clear:both; } - - /* (en/de) Standard: 200 Pixel */ - #col1 { float: left; width: 200px } - /* (en/de) Standard: 200 Pixel */ - #col2 { float:right; width: 200px } - /* (en) Standard: center column with flexible width */ - /* (de) Standard: Flexible mittlere Spalte */ - #col3 { width:auto; margin: 0 200px } - - /* (en) Preparation for absolute positioning within content columns */ - /* (de) Vorbereitung für absolute Positionierungen innerhalb der Inhaltsspalten */ - #col1_content, #col2_content, #col3_content { position:relative; } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * @section generic classes for layout switching | Generische Klassen zur Layoutumschaltung - * @see http://www.yaml.de/en/documentation/css-components/base-stylesheet.html - * - * .hidecol1 -> 2-column-layout (using #col2 and #col3) - * .hidecol2 -> 2-column-layout (using #col1 and #col3) - * .hideboth -> single-column-layout (using #col3) - */ - - .hideboth #col3 { margin-left: 0; margin-right: 0; } - .hidecol1 #col3 { margin-left: 0; margin-right: 200px; } - .hidecol2 #col3 { margin-left: 200px; margin-right: 0; } - - .hideboth #col1, .hideboth #col2, .hidecol1 #col1, .hidecol2 #col2 { display:none; } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * @section clearing methods - * @see http://yaml.de/en/documentation/basics/general.html - */ - - /* (en) clearfix method for clearing floats */ - /* (de) Clearfix-Methode zum Clearen der Float-Umgebungen */ - .clearfix:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; - } - - /* (en) essential for Safari browser !! */ - /* (de) Diese Angabe benötigt der Safari-Browser zwingend !! */ - .clearfix { display: block; } - - /* (en) overflow method for clearing floats */ - /* (de) Overflow-Methode zum Clearen der Float-Umgebungen */ - .floatbox { overflow:hidden; } - - /* (en) IE-Clearing: Only used in Internet Explorer, switched on in iehacks.css */ - /* (de) IE-Clearing: Benötigt nur der Internet Explorer und über iehacks.css zugeschaltet */ - #ie_clearing { display: none; } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * @section subtemplates - * @see http://www.yaml.de/en/documentation/practice/subtemplates.html - */ - - .subcolumns { width: 100%; overflow:hidden; } - - /* (en) alternative class for optional support of old Mozilla/Netscape browers */ - /* (de) Alternative Klasse zur optionalen Unterstützung alter Mozilla/Netscape-Brower */ - .subcolumns_oldgecko { width: 100%; float:left; } - - .c50l, .c25l, .c33l, .c38l, .c66l, .c75l, .c62l {float: left; } - .c50r, .c25r, .c33r, .c38r, .c66r, .c75r, .c62r {float: right; margin-left: -5px; } - - .c25l, .c25r { width: 25%; } - .c33l, .c33r { width: 33.333%; } - .c50l, .c50r { width: 50%; } - .c66l, .c66r { width: 66.666%; } - .c75l, .c75r { width: 75%; } - .c38l, .c38r { width: 38.2%; } - .c62l, .c62r { width: 61.8%; } - - .subc { padding: 0 0.5em; } - .subcl { padding: 0 1em 0 0; } - .subcr { padding: 0 0 0 1em; } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * @section hidden elements | Versteckte Elemente - * @see http://www.yaml.de/en/documentation/basics/skip-links.html - * - * (en) skip links and hidden content - * (de) Skip-Links und versteckte Inhalte - */ - - /* (en) classes for invisible elements in the base layout */ - /* (de) Klassen für unsichtbare Elemente im Basislayout */ - .skip, .hideme, .print { - position: absolute; - top: -1000em; - left: -1000em; - height: 1px; - width: 1px; - } - - /* (en) make skip links visible when using tab navigation */ - /* (de) Skip-Links für Tab-Navigation sichtbar schalten */ - .skip:focus, .skip:active { - position: static; - top: 0; - left: 0; - height: auto; - width: auto; - } -} +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) YAML core stylesheet + * (de) YAML Basis-Stylesheet + * + * Don't make any changes in this file! + * Your changes should be placed in any css-file in your own stylesheet folder. + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + */ + +@media all +{ + /*------------------------------------------------------------------------------------------------------*/ + + /** + * @section browser reset + * @see http://www.yaml.de/en/documentation/css-components/base-stylesheet.html + */ + + /* (en) Global reset of paddings and margins for all HTML elements */ + /* (de) Globales Zurücksetzen der Innen- und Außenabstände für alle HTML-Elemente */ + * { margin:0; padding: 0; } + + /* (en) Correction: margin/padding reset caused too small select boxes. */ + /* (de) Korrektur: Das Zurücksetzen der Abstände verursacht zu kleine Selectboxen. */ + option { padding-left: 0.4em; } + + /** + * (en) Global fix of the Italics bugs in IE 5.x and IE 6 + * (de) Globale Korrektur des Italics Bugs des IE 5.x und IE 6 + * + * @bugfix + * @affected IE 5.x/Win, IE6 + * @css-for IE 5.x/Win, IE6 + * @valid yes + */ + * html body * { overflow:visible; } + * html iframe, * html frame { overflow:auto; } + * html frameset { overflow:hidden; } + + /* (en) Forcing vertical scrollbars in Netscape, Firefox and Safari browsers */ + /* (de) Erzwingen vertikaler Scrollbalken in Netscape, Firefox und Safari Browsern */ + html { height: 100%; margin-bottom: 1px; } + body { + /* (en) Fix for rounding errors when scaling font sizes in older versions of Opera browser */ + /* (de) Beseitigung von Rundungsfehler beim Skalieren von Schriftgrößen in älteren Opera Versionen */ + font-size: 100.01%; + + /* (en) Standard values for colors and text alignment */ + /* (de) Vorgabe der Standardfarben und Textausrichtung */ + color: #000; + background: #fff; + text-align: left; + } + + /* (en) Clear borders for
and elements */ + /* (de) Rahmen für
und Elemente löschen */ + fieldset, img { border: 0 solid; } + + /* (en) new standard values for lists, blockquote and cite */ + /* (de) Neue Standardwerte für Listen & Zitate */ + ul, ol, dl { margin: 0 0 1em 1em } + li { margin-left: 1.5em; line-height: 1.5em; } + + dt { font-weight: bold; } + dd { margin: 0 0 1em 2em; } + + blockquote { margin: 0 0 1em 1.5em; } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * @section base layout | Basis Layout + * @see http://www.yaml.de/en/documentation/css-components/base-stylesheet.html + * + * |-------------------------------| + * | #header | + * |-------------------------------| + * | #col1 | #col3 | #col2 | + * | 200 px | flexible | 200px | + * |-------------------------------| + * | #footer | + * |-------------------------------| + */ + + #header { position:relative; } + + /* (en) Text Alignment for #topnav content */ + /* (de) Textausrichtung für #topnav Inhalte */ + #topnav { text-align: right; } + + /* (en) Absolute positioning only within #header */ + /* (de) Absolute Positionierung erfolgt nur innerhalb von #header */ + #header #topnav { + position:absolute; + top: 10px; + right: 10px; + } + + /* (en) Backup for correct positioning */ + /* (de) Absicherung korrekte Positionierung */ + #header, #nav, #main, #footer { clear:both; } + + /* (en/de) Standard: 200 Pixel */ + #col1 { float: left; width: 200px } + /* (en/de) Standard: 200 Pixel */ + #col2 { float:right; width: 200px } + /* (en) Standard: center column with flexible width */ + /* (de) Standard: Flexible mittlere Spalte */ + #col3 { width:auto; margin: 0 200px } + + /* (en) Preparation for absolute positioning within content columns */ + /* (de) Vorbereitung für absolute Positionierungen innerhalb der Inhaltsspalten */ + #col1_content, #col2_content, #col3_content { position:relative; } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * @section generic classes for layout switching | Generische Klassen zur Layoutumschaltung + * @see http://www.yaml.de/en/documentation/css-components/base-stylesheet.html + * + * .hidecol1 -> 2-column-layout (using #col2 and #col3) + * .hidecol2 -> 2-column-layout (using #col1 and #col3) + * .hideboth -> single-column-layout (using #col3) + */ + + .hideboth #col3 { margin-left: 0; margin-right: 0; } + .hidecol1 #col3 { margin-left: 0; margin-right: 200px; } + .hidecol2 #col3 { margin-left: 200px; margin-right: 0; } + + .hideboth #col1, .hideboth #col2, .hidecol1 #col1, .hidecol2 #col2 { display:none; } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * @section clearing methods + * @see http://yaml.de/en/documentation/basics/general.html + */ + + /* (en) clearfix method for clearing floats */ + /* (de) Clearfix-Methode zum Clearen der Float-Umgebungen */ + .clearfix:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; + } + + /* (en) essential for Safari browser !! */ + /* (de) Diese Angabe benötigt der Safari-Browser zwingend !! */ + .clearfix { display: block; } + + /* (en) overflow method for clearing floats */ + /* (de) Overflow-Methode zum Clearen der Float-Umgebungen */ + .floatbox { overflow:hidden; } + + /* (en) IE-Clearing: Only used in Internet Explorer, switched on in iehacks.css */ + /* (de) IE-Clearing: Benötigt nur der Internet Explorer und über iehacks.css zugeschaltet */ + #ie_clearing { display: none; } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * @section subtemplates + * @see http://www.yaml.de/en/documentation/practice/subtemplates.html + */ + + .subcolumns { width: 100%; overflow:hidden; } + + /* (en) alternative class for optional support of old Mozilla/Netscape browers */ + /* (de) Alternative Klasse zur optionalen Unterstützung alter Mozilla/Netscape-Brower */ + .subcolumns_oldgecko { width: 100%; float:left; } + + .c50l, .c25l, .c33l, .c38l, .c66l, .c75l, .c62l {float: left; } + .c50r, .c25r, .c33r, .c38r, .c66r, .c75r, .c62r {float: right; margin-left: -5px; } + + .c25l, .c25r { width: 25%; } + .c33l, .c33r { width: 33.333%; } + .c50l, .c50r { width: 50%; } + .c66l, .c66r { width: 66.666%; } + .c75l, .c75r { width: 75%; } + .c38l, .c38r { width: 38.2%; } + .c62l, .c62r { width: 61.8%; } + + .subc { padding: 0 0.5em; } + .subcl { padding: 0 1em 0 0; } + .subcr { padding: 0 0 0 1em; } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * @section hidden elements | Versteckte Elemente + * @see http://www.yaml.de/en/documentation/basics/skip-links.html + * + * (en) skip links and hidden content + * (de) Skip-Links und versteckte Inhalte + */ + + /* (en) classes for invisible elements in the base layout */ + /* (de) Klassen für unsichtbare Elemente im Basislayout */ + .skip, .hideme, .print { + position: absolute; + top: -1000em; + left: -1000em; + height: 1px; + width: 1px; + } + + /* (en) make skip links visible when using tab navigation */ + /* (de) Skip-Links für Tab-Navigation sichtbar schalten */ + .skip:focus, .skip:active { + position: static; + top: 0; + left: 0; + height: auto; + width: auto; + } +} diff --git a/interface/web/themes/default/yaml/core/iehacks.css b/interface/web/themes/default/yaml/core/iehacks.css index 85445964d700e738a08c32288119cd403c470ba1..41c3ee420256fc02f889bc7e29f97ef6b867142a 100644 --- a/interface/web/themes/default/yaml/core/iehacks.css +++ b/interface/web/themes/default/yaml/core/iehacks.css @@ -1,310 +1,310 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) YAML core stylesheet - structure-independent bugfixes of IE/Win CSS-bugs - * (de) YAML Basis-Stylesheet - Strukturunabhängige Bugfixes von CSS-Bugs des IE/Win - * - * Don't make any changes in this file! - * Your changes should be added to a separate patch-file. - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - * @appdef yaml - */ - -@media all -{ - /** - * (en) Debugging: When you see a green background, IE is getting this stylesheet - * (de) Fehlersuche: Hintergrund leuchtet grün, wenn das Stylesheet korrekt geladen wurde - * - * @debug - * @app-yaml-default disabled - */ - - /* body { background: #0f0; background-image: none; } */ - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * (en) Forcing vertical scrollbars is not needed in IE (only for Firefox/Netscape/Safari) - * (de) Erzwingen vertikaler Scrollbalken im IE nicht benötigt (nur im Firefox/Netscape/Safari) - * - * @workaround - * @affected IE 5.x/Win, IE6, IE7 - * @css-for IE 5.x/Win, IE6, IE7 - * @valid yes - */ - - html { height: auto; margin-bottom:0; } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * (en) Fixes IE5.x and IE6 overflow behavior of textarea and input elements elements - * (de) Korrigiert das fehlerhafte overflow-Verhalten von textarea und input-Elementen - * - * @workaround - * @affected IE 5.x/Win, IE6 - * @css-for IE 5.x/Win, IE6 - * @valid no - */ - - * html textarea { overflow:scroll; overflow-x: hidden; } - * html input { overflow: hidden; } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * (en) Stability fixes with 'position:relative' - * (de) Stabilitätsverbesserungen durch 'position:relative' - * - * @bugfix - * @affected IE 5.x/Win, IE6, IE7 - * @css-for IE 5.x/Win, IE6, IE7 - * @valid yes - */ - - body { position:relative; } /* Essential in IE7 for correct layout scaling ... */ - * html body { position:static; } /* ... but not for IE5.x and IE6 */ - #main { position: relative; } /* helpful for several problems in older IE versions*/ - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * (en) Clearfix Method for containing floats in IE - * (de) Clearfix-Anpassung für diverse IE-Versionen - * - * @workaround - * @see http://www.456bereastreet.com/archive/200603/new_clearing_method_needed_for_ie7/#comment28 - * @affected IE 5.x/Win, IE6, IE7 - * @css-for IE 5.x/Win, IE6, IE7 - * @valid yes - */ - - - .clearfix { display: inline-block; } /* ... especial for IE7 */ - .clearfix { display: block; } /* ... für IE5,IE6,IE7 */ - * html .clearfix { height: 1%; } /* ... für IE5 + IE6/Win | hasLayout aktivieren */ - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * (en) Adjustment of .floatbox class for IE - * (de) Anpassung der .floatbox-Klasse für IE - * - * @workaround - * @affected IE 5.x/Win, IE6 - * @css-for IE 5.x/Win, IE6 - * @valid yes - */ - - * html .floatbox { width:100%; } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * (en) Special class for oversized content element - * (de) Spezielle Klasse für übergroße Inhaltselemente - * - * @workaround - * @affected IE 5.x/Win, IE6 - * @css-for IE 5.x/Win, IE6 - * @valid yes - */ - - .slidebox { - position:relative; - margin-right: -1000px; - height: 1%; - } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * (en): Bugfix for partially displayed column separators - * (de): Bugfix für unvollständige Darstellung der Spalteninhalte / Spaltentrenner - * - * @bugfix - * @affected IE 5.x/Win, IE6 - * @css-for IE 5.x/Win, IE6 - * @valid yes - */ - - * html #col1, - * html #col2, - * html #col3 { position:relative; } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * (en) Preventing several css bugs by forcing "hasLayout" - * (de) Vermeidung verschiedenster Bugs durch Erzwingen von "hasLayout" - * - * @workaround - * @affected IE 5.x/Win, IE6, IE7 - * @css-for IE 5.x/Win, IE6, IE7 - * @valid no - */ - - body { height: 1%; } - #page_margins, #page, #header, #nav, #main, #footer { zoom:1; } /* IE6 & IE7 */ - #page_margins, #page { height: 1%; } /* IE 5.x */ - * html #header, * html #nav, * html #main, * html #footer { width: 100%; } /* IE 5.x & IE6 */ - * html #header, * html #nav, * html #main, * html #footer { wid\th: auto; } /* IE 6 */ - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * Disappearing List-Background Bug - * @see http://www.positioniseverything.net/explorer/ie-listbug.html - * - * @bugfix - * @affected IE 5.x/Win, IE6 - * @css-for IE 5.x/Win, IE6 - * @valid yes - */ - * html ul, * html ol, * html dl { position: relative; } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * List-Numbering Bug - * - * @bugfix - * @affected IE 5.x/Win, IE6, IE7 - * @css-for IE 5.x/Win, IE6, IE7 - * @valid yes - */ - body ol li { display:list-item; } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * (en) Workaround for 'collapsing margin at #col3' when using CSS-property clear - * Left margin of #col3 collapses when using clear:both in 1-3-2 (or 2-3-1) layout and right column is the - * longest and left column is the shortest one. For IE6 and IE7 a special workaround was developed - * in YAML. - * - * (de) Workaround für 'kollabierenden Margin an #col3' bei Verwendung der CSS-Eigenschaft clear - * Der linke Margin von #col3 kollabiert bei der Verwendung von clear:both im 1-3-2 (oder 2-3-1) Layout - * wenn gleichzeitig die rechte Spalte die kürzeste und die rechte die Längste ist. Im IE6 und IE7 lässt - * sich der Bug durch eine speziell für YAML entwickelten Workaround umgehen. - * - * @workaround - * @affected IE 5.x/Win, IE6, IE7 - * @css-for IE 5.x/Win, IE6, IE7 - * @valid no - */ - - #ie_clearing { - /* (en) Only a small help for debugging */ - /* (de) Nur eine kleine Hilfe zur Fehlersuche */ - position:static; - - /* (en) Make container visible in IE */ - /* (de) Container sichtbar machen im IE */ - display:block; - - /* (en) No fix possible in IE5.x, normal clearing used instead */ - /* (de) Kein Fix im IE5.x möglich, daher normales Clearing */ - \clear:both; - - /* (en) forcing clearing-like behavior with a simple oversized container in IE6 & IE7*/ - /* (de) IE-Clearing mit 100%-DIV für IE6 bzw. übergroßem Container im IE7 */ - width: 100%; - font-size:0px; - margin: -2px 0 -1em 1px; - } - - * html #ie_clearing { margin: -2px 0 -1em 0; } - #col3_content {margin-bottom:-2px; } - - /* (en) avoid horizontal scrollbars in IE7 in borderless layouts because of negative margins */ - /* (de) Vermeidung horizontaler Scrollbalken bei randabfallenden Layouts im IE7 */ - html { margin-right: 1px; } - * html { margin-right: 0 } - - - /* (en) Bugfix: Essential for IE7 */ - /* (de) Bugfix: Notwendig im IE7 */ - #col3 { position:relative; z-index: -1; } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * IE/Win Guillotine Bug - * @see http://www.positioniseverything.net/explorer/guillotine.html - * - * @workaround - * @affected IE 5.x/Win, IE6 - * @css-for IE 5.x/Win, IE6 - * @valid yes - */ - - * html body a, * html body a:hover { background-color: transparent; } - -} - -@media screen, projection -{ - /** - * (en) IE-Adjustments for content columns and subtemplates - * (de) IE-Anpassung für Spaltencontainer und Subtemplates - * - * Doubled Float-Margin Bug - * @see http://positioniseverything.net/explorer/doubled-margin.html - * - * @bugfix - * @affected IE 5.x/Win, IE6 - * @css-for IE 5.x/Win, IE6, IE7 - * @valid yes - */ - - #col1, #col2 { display:inline; } - - .c50l, .c25l, .c33l, .c38l, .c66l, .c75l, .c62l, - .c50r, .c25r, .c33r, .c38r, .c66r, .c75r, .c62r { display:inline; } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * Internet Explorer and the Expanding Box Problem - * @see http://www.positioniseverything.net/explorer/expandingboxbug.html - * - * @workaround - * @affected IE 5.x/Win, IE6 - * @css-for IE 5.x/Win, IE6 - * @valid yes - */ - - * html #col1_content, - * html #col2_content, - * html #col3_content { word-wrap: break-word; } - - * html .subcolumns .subc, - * html .subcolumns .subcl, - * html .subcolumns .subcr { word-wrap: break-word; overflow:hidden; } -} - -@media print -{ - /** - * (en) Avoid unneeded page breaks of #col3 content in print layout. - * (de) Vermeiden von unnötigen Seitenumbrüchen beim Ausdruck der Spalte #col3. - * - * @bugfix - * @affected IE7 - * @css-for IE 5.x/Win, IE6, IE7 - * @valid yes - */ - - #col3 { height: 1%; } -} +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) YAML core stylesheet - structure-independent bugfixes of IE/Win CSS-bugs + * (de) YAML Basis-Stylesheet - Strukturunabhängige Bugfixes von CSS-Bugs des IE/Win + * + * Don't make any changes in this file! + * Your changes should be added to a separate patch-file. + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + * @appdef yaml + */ + +@media all +{ + /** + * (en) Debugging: When you see a green background, IE is getting this stylesheet + * (de) Fehlersuche: Hintergrund leuchtet grün, wenn das Stylesheet korrekt geladen wurde + * + * @debug + * @app-yaml-default disabled + */ + + /* body { background: #0f0; background-image: none; } */ + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * (en) Forcing vertical scrollbars is not needed in IE (only for Firefox/Netscape/Safari) + * (de) Erzwingen vertikaler Scrollbalken im IE nicht benötigt (nur im Firefox/Netscape/Safari) + * + * @workaround + * @affected IE 5.x/Win, IE6, IE7 + * @css-for IE 5.x/Win, IE6, IE7 + * @valid yes + */ + + html { height: auto; margin-bottom:0; } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * (en) Fixes IE5.x and IE6 overflow behavior of textarea and input elements elements + * (de) Korrigiert das fehlerhafte overflow-Verhalten von textarea und input-Elementen + * + * @workaround + * @affected IE 5.x/Win, IE6 + * @css-for IE 5.x/Win, IE6 + * @valid no + */ + + * html textarea { overflow:scroll; overflow-x: hidden; } + * html input { overflow: hidden; } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * (en) Stability fixes with 'position:relative' + * (de) Stabilitätsverbesserungen durch 'position:relative' + * + * @bugfix + * @affected IE 5.x/Win, IE6, IE7 + * @css-for IE 5.x/Win, IE6, IE7 + * @valid yes + */ + + body { position:relative; } /* Essential in IE7 for correct layout scaling ... */ + * html body { position:static; } /* ... but not for IE5.x and IE6 */ + #main { position: relative; } /* helpful for several problems in older IE versions*/ + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * (en) Clearfix Method for containing floats in IE + * (de) Clearfix-Anpassung für diverse IE-Versionen + * + * @workaround + * @see http://www.456bereastreet.com/archive/200603/new_clearing_method_needed_for_ie7/#comment28 + * @affected IE 5.x/Win, IE6, IE7 + * @css-for IE 5.x/Win, IE6, IE7 + * @valid yes + */ + + + .clearfix { display: inline-block; } /* ... especial for IE7 */ + .clearfix { display: block; } /* ... für IE5,IE6,IE7 */ + * html .clearfix { height: 1%; } /* ... für IE5 + IE6/Win | hasLayout aktivieren */ + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * (en) Adjustment of .floatbox class for IE + * (de) Anpassung der .floatbox-Klasse für IE + * + * @workaround + * @affected IE 5.x/Win, IE6 + * @css-for IE 5.x/Win, IE6 + * @valid yes + */ + + * html .floatbox { width:100%; } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * (en) Special class for oversized content element + * (de) Spezielle Klasse für übergroße Inhaltselemente + * + * @workaround + * @affected IE 5.x/Win, IE6 + * @css-for IE 5.x/Win, IE6 + * @valid yes + */ + + .slidebox { + position:relative; + margin-right: -1000px; + height: 1%; + } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * (en): Bugfix for partially displayed column separators + * (de): Bugfix für unvollständige Darstellung der Spalteninhalte / Spaltentrenner + * + * @bugfix + * @affected IE 5.x/Win, IE6 + * @css-for IE 5.x/Win, IE6 + * @valid yes + */ + + * html #col1, + * html #col2, + * html #col3 { position:relative; } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * (en) Preventing several css bugs by forcing "hasLayout" + * (de) Vermeidung verschiedenster Bugs durch Erzwingen von "hasLayout" + * + * @workaround + * @affected IE 5.x/Win, IE6, IE7 + * @css-for IE 5.x/Win, IE6, IE7 + * @valid no + */ + + body { height: 1%; } + #page_margins, #page, #header, #nav, #main, #footer { zoom:1; } /* IE6 & IE7 */ + #page_margins, #page { height: 1%; } /* IE 5.x */ + * html #header, * html #nav, * html #main, * html #footer { width: 100%; } /* IE 5.x & IE6 */ + * html #header, * html #nav, * html #main, * html #footer { wid\th: auto; } /* IE 6 */ + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * Disappearing List-Background Bug + * @see http://www.positioniseverything.net/explorer/ie-listbug.html + * + * @bugfix + * @affected IE 5.x/Win, IE6 + * @css-for IE 5.x/Win, IE6 + * @valid yes + */ + * html ul, * html ol, * html dl { position: relative; } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * List-Numbering Bug + * + * @bugfix + * @affected IE 5.x/Win, IE6, IE7 + * @css-for IE 5.x/Win, IE6, IE7 + * @valid yes + */ + body ol li { display:list-item; } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * (en) Workaround for 'collapsing margin at #col3' when using CSS-property clear + * Left margin of #col3 collapses when using clear:both in 1-3-2 (or 2-3-1) layout and right column is the + * longest and left column is the shortest one. For IE6 and IE7 a special workaround was developed + * in YAML. + * + * (de) Workaround für 'kollabierenden Margin an #col3' bei Verwendung der CSS-Eigenschaft clear + * Der linke Margin von #col3 kollabiert bei der Verwendung von clear:both im 1-3-2 (oder 2-3-1) Layout + * wenn gleichzeitig die rechte Spalte die kürzeste und die rechte die Längste ist. Im IE6 und IE7 lässt + * sich der Bug durch eine speziell für YAML entwickelten Workaround umgehen. + * + * @workaround + * @affected IE 5.x/Win, IE6, IE7 + * @css-for IE 5.x/Win, IE6, IE7 + * @valid no + */ + + #ie_clearing { + /* (en) Only a small help for debugging */ + /* (de) Nur eine kleine Hilfe zur Fehlersuche */ + position:static; + + /* (en) Make container visible in IE */ + /* (de) Container sichtbar machen im IE */ + display:block; + + /* (en) No fix possible in IE5.x, normal clearing used instead */ + /* (de) Kein Fix im IE5.x möglich, daher normales Clearing */ + \clear:both; + + /* (en) forcing clearing-like behavior with a simple oversized container in IE6 & IE7*/ + /* (de) IE-Clearing mit 100%-DIV für IE6 bzw. übergroßem Container im IE7 */ + width: 100%; + font-size:0px; + margin: -2px 0 -1em 1px; + } + + * html #ie_clearing { margin: -2px 0 -1em 0; } + #col3_content {margin-bottom:-2px; } + + /* (en) avoid horizontal scrollbars in IE7 in borderless layouts because of negative margins */ + /* (de) Vermeidung horizontaler Scrollbalken bei randabfallenden Layouts im IE7 */ + html { margin-right: 1px; } + * html { margin-right: 0 } + + + /* (en) Bugfix: Essential for IE7 */ + /* (de) Bugfix: Notwendig im IE7 */ + #col3 { position:relative; z-index: -1; } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * IE/Win Guillotine Bug + * @see http://www.positioniseverything.net/explorer/guillotine.html + * + * @workaround + * @affected IE 5.x/Win, IE6 + * @css-for IE 5.x/Win, IE6 + * @valid yes + */ + + * html body a, * html body a:hover { background-color: transparent; } + +} + +@media screen, projection +{ + /** + * (en) IE-Adjustments for content columns and subtemplates + * (de) IE-Anpassung für Spaltencontainer und Subtemplates + * + * Doubled Float-Margin Bug + * @see http://positioniseverything.net/explorer/doubled-margin.html + * + * @bugfix + * @affected IE 5.x/Win, IE6 + * @css-for IE 5.x/Win, IE6, IE7 + * @valid yes + */ + + #col1, #col2 { display:inline; } + + .c50l, .c25l, .c33l, .c38l, .c66l, .c75l, .c62l, + .c50r, .c25r, .c33r, .c38r, .c66r, .c75r, .c62r { display:inline; } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * Internet Explorer and the Expanding Box Problem + * @see http://www.positioniseverything.net/explorer/expandingboxbug.html + * + * @workaround + * @affected IE 5.x/Win, IE6 + * @css-for IE 5.x/Win, IE6 + * @valid yes + */ + + * html #col1_content, + * html #col2_content, + * html #col3_content { word-wrap: break-word; } + + * html .subcolumns .subc, + * html .subcolumns .subcl, + * html .subcolumns .subcr { word-wrap: break-word; overflow:hidden; } +} + +@media print +{ + /** + * (en) Avoid unneeded page breaks of #col3 content in print layout. + * (de) Vermeiden von unnötigen Seitenumbrüchen beim Ausdruck der Spalte #col3. + * + * @bugfix + * @affected IE7 + * @css-for IE 5.x/Win, IE6, IE7 + * @valid yes + */ + + #col3 { height: 1%; } +} diff --git a/interface/web/themes/default/yaml/core/print_base.css b/interface/web/themes/default/yaml/core/print_base.css index 54c6a396901999e74dd8efa9c440c5b9a735def7..4418795dc474fa95c20c0dcf38ec5d594ceddbb3 100644 --- a/interface/web/themes/default/yaml/core/print_base.css +++ b/interface/web/themes/default/yaml/core/print_base.css @@ -1,120 +1,120 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) YAML core stylesheet - print layout - * (de) YAML Core-Stylesheet - Druck Layout - * - * Don't make any changes in this file! - * Your changes should be added to 'print_xyz_draft.css' drafts from 'yaml/print/' folder. - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - */ - -@media print -{ - /*------------------------------------------------------------------------------------------------------*/ - - /** - * @section layout preparation - * @see http://www.yaml.de/en/documentation/css-components/layout-for-print-media.html - */ - - /* (en) Preparing base layout for print */ - /* (de) Basislayout für Druck aufbereiten */ - body, #page_margins, #page, #main { margin:0; padding: 0; border: 0; } - #page_margins, #page { width: 100% !important; min-width:0; max-width: none; } - #header { height: auto; } - - /* (en) Hide unneeded container of the screenlayout in print layout */ - /* (de) Für den Druck nicht benötigte Container des Layouts abschalten */ - #topnav, #nav, #search, #footer { display: none; } - - /* (en) Linearising subtemplates */ - /* (de) Linearisierung der Subtemplates */ - .c25l, .c33l, .c38l, .c50l, .c62l, .c66l, .c75l, - .c25r, .c33r, .c38r, .c50r, .c62r, .c66r, .c75r { - width: 100%; margin:0; float:none; overflow:visible; display:table; - } - .subc, .subcl, .subcr { margin: 0; padding: 0; } - - /* (en) make .print class visible */ - /* (de) .print-Klasse sichtbar schalten */ - .print { position: static; top: 0; left: 0; height: auto; width: auto; } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * @section content preparation - * @see http://www.yaml.de/en/documentation/css-components/layout-for-print-media.html - */ - - /* (en) Change font to serif */ - /* (de) Zeichensatz auf Serifen umstellen */ - body * { font-family: "Times New Roman", Times, serif; } - code, pre { font-family:"Courier New", Courier, mono; } - body { font-size: 12pt; } - - /* (en) Avoid page breaks right after headings */ - /* (de) Vermeidung von Seitenumbrüchen direkt nach einer Überschrift */ - h1,h2,h3,h4,h5,h6 { page-break-after:avoid; } - - /* (en) Format acronyms and abbreviations for print*/ - /* (de) Auszeichnung von Abkürzungen */ - abbr[title]:after, - acronym[title]:after { content: '(' attr(title) ')'; } - - /* (en) Disable background graphics of links */ - /* (de) Abschalten evlt. vorhandener Hintergrundgrafiken zur Linkkennzeichnung */ - #page a[href^="http:"], - #page a[href^="https:"] { padding-left: 0; background-image: none; } - - /* (en) Enable URL output in print layout */ - /* (de) Sichtbare Auszeichnung der URLs von Links */ - a[href]:after { - content:" "; - color:#444; - background:inherit; - font-style:italic; - } - - /* (en) Preparation for optional column labels */ - /* (de) Vorbereitung für optionale Spaltenauszeichnung */ - #col1_content:before, #col2_content:before, #col3_content:before { - content: ""; - color:#888; - background:inherit; - display:block; - font-weight:bold; - font-size:1.5em; - } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * @section browser fixes for print layouts - * @see http://www.yaml.de/en/documentation/css-components/layout-for-print-media.html - */ - - /** - * (en) overflow:hidden Bug in print layouts - * (de) overflow:hidden Bug in Drucklayouts - * - * @bugfix - * @since 3.0 - * @affected FF2.0, IE7 - * @css-for all browsers - * @valid yes - */ - - .floatbox, - .subcolumns, - .subcolums_oldgecko { overflow:visible; display: table; } -} +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) YAML core stylesheet - print layout + * (de) YAML Core-Stylesheet - Druck Layout + * + * Don't make any changes in this file! + * Your changes should be added to 'print_xyz_draft.css' drafts from 'yaml/print/' folder. + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + */ + +@media print +{ + /*------------------------------------------------------------------------------------------------------*/ + + /** + * @section layout preparation + * @see http://www.yaml.de/en/documentation/css-components/layout-for-print-media.html + */ + + /* (en) Preparing base layout for print */ + /* (de) Basislayout für Druck aufbereiten */ + body, #page_margins, #page, #main { margin:0; padding: 0; border: 0; } + #page_margins, #page { width: 100% !important; min-width:0; max-width: none; } + #header { height: auto; } + + /* (en) Hide unneeded container of the screenlayout in print layout */ + /* (de) Für den Druck nicht benötigte Container des Layouts abschalten */ + #topnav, #nav, #search, #footer { display: none; } + + /* (en) Linearising subtemplates */ + /* (de) Linearisierung der Subtemplates */ + .c25l, .c33l, .c38l, .c50l, .c62l, .c66l, .c75l, + .c25r, .c33r, .c38r, .c50r, .c62r, .c66r, .c75r { + width: 100%; margin:0; float:none; overflow:visible; display:table; + } + .subc, .subcl, .subcr { margin: 0; padding: 0; } + + /* (en) make .print class visible */ + /* (de) .print-Klasse sichtbar schalten */ + .print { position: static; top: 0; left: 0; height: auto; width: auto; } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * @section content preparation + * @see http://www.yaml.de/en/documentation/css-components/layout-for-print-media.html + */ + + /* (en) Change font to serif */ + /* (de) Zeichensatz auf Serifen umstellen */ + body * { font-family: "Times New Roman", Times, serif; } + code, pre { font-family:"Courier New", Courier, mono; } + body { font-size: 12pt; } + + /* (en) Avoid page breaks right after headings */ + /* (de) Vermeidung von Seitenumbrüchen direkt nach einer Überschrift */ + h1,h2,h3,h4,h5,h6 { page-break-after:avoid; } + + /* (en) Format acronyms and abbreviations for print*/ + /* (de) Auszeichnung von Abkürzungen */ + abbr[title]:after, + acronym[title]:after { content: '(' attr(title) ')'; } + + /* (en) Disable background graphics of links */ + /* (de) Abschalten evlt. vorhandener Hintergrundgrafiken zur Linkkennzeichnung */ + #page a[href^="http:"], + #page a[href^="https:"] { padding-left: 0; background-image: none; } + + /* (en) Enable URL output in print layout */ + /* (de) Sichtbare Auszeichnung der URLs von Links */ + a[href]:after { + content:" "; + color:#444; + background:inherit; + font-style:italic; + } + + /* (en) Preparation for optional column labels */ + /* (de) Vorbereitung für optionale Spaltenauszeichnung */ + #col1_content:before, #col2_content:before, #col3_content:before { + content: ""; + color:#888; + background:inherit; + display:block; + font-weight:bold; + font-size:1.5em; + } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * @section browser fixes for print layouts + * @see http://www.yaml.de/en/documentation/css-components/layout-for-print-media.html + */ + + /** + * (en) overflow:hidden Bug in print layouts + * (de) overflow:hidden Bug in Drucklayouts + * + * @bugfix + * @since 3.0 + * @affected FF2.0, IE7 + * @css-for all browsers + * @valid yes + */ + + .floatbox, + .subcolumns, + .subcolums_oldgecko { overflow:visible; display: table; } +} diff --git a/interface/web/themes/default/yaml/core/slim_base.css b/interface/web/themes/default/yaml/core/slim_base.css index ef205e1d788305fc64068caa55a8b5b9fb0cce91..75596ca9fe77259fe8cc55088298eee2f0e0ba0b 100644 --- a/interface/web/themes/default/yaml/core/slim_base.css +++ b/interface/web/themes/default/yaml/core/slim_base.css @@ -1,50 +1,50 @@ -@charset "UTF-8"; -/* "Yet Another Multicolumn Layout" v3.0.6 (c) by Dirk Jesse (http://www.yaml.de) -* $Revision: 202 $ $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ */ -@media all { -*{margin:0;padding:0} -option{padding-left:.4em} -* html body *{overflow:visible} -* html iframe,* html frame{overflow:auto} -* html frameset{overflow:hidden} -html{height:100%;margin-bottom:1px} -body{font-size:100.01%;color:#000;background:#fff;text-align:left} -fieldset,img{border:0 solid} -ul,ol,dl{margin:0 0 1em 1em} -li{margin-left:1.5em;line-height:1.5em} -dt{font-weight:700} -dd{margin:0 0 1em 2em} -blockquote{margin:0 0 1em 1.5em} -#header{position:relative} -#topnav{text-align:right} -#header #topnav{position:absolute;top:10px;right:10px} -#header,#nav,#main,#footer{clear:both} -#col1{float:left;width:200px} -#col2{float:right;width:200px} -#col3{width:auto;margin:0 200px} -#col1_content,#col2_content,#col3_content{position:relative} -.hideboth #col3{margin-left:0;margin-right:0} -.hidecol1 #col3{margin-left:0;margin-right:200px} -.hidecol2 #col3{margin-left:200px;margin-right:0} -.hideboth #col1,.hideboth #col2,.hidecol1 #col1,.hidecol2 #col2{display:none} -.clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden} -.clearfix{display:block} -.floatbox{overflow:hidden} -#ie_clearing{display:none} -.subcolumns{width:100%;overflow:hidden} -.subcolumns_oldgecko{width:100%;float:left} -.c50l,.c25l,.c33l,.c38l,.c66l,.c75l,.c62l{float:left} -.c50r,.c25r,.c33r,.c38r,.c66r,.c75r,.c62r{float:right;margin-left:-5px} -.c25l,.c25r{width:25%} -.c33l,.c33r{width:33.333%} -.c50l,.c50r{width:50%} -.c66l,.c66r{width:66.666%} -.c75l,.c75r{width:75%} -.c38l,.c38r{width:38.2%} -.c62l,.c62r{width:61.8%} -.subc{padding:0 .5em} -.subcl{padding:0 1em 0 0} -.subcr{padding:0 0 0 1em} -.skip,.hideme,.print{position:absolute;top:-1000em;left:-1000em;height:1px;width:1px} -.skip:focus,.skip:active{position:static;top:0;left:0;height:auto;width:auto} +@charset "UTF-8"; +/* "Yet Another Multicolumn Layout" v3.0.6 (c) by Dirk Jesse (http://www.yaml.de) +* $Revision: 202 $ $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ */ +@media all { +*{margin:0;padding:0} +option{padding-left:.4em} +* html body *{overflow:visible} +* html iframe,* html frame{overflow:auto} +* html frameset{overflow:hidden} +html{height:100%;margin-bottom:1px} +body{font-size:100.01%;color:#000;background:#fff;text-align:left} +fieldset,img{border:0 solid} +ul,ol,dl{margin:0 0 1em 1em} +li{margin-left:1.5em;line-height:1.5em} +dt{font-weight:700} +dd{margin:0 0 1em 2em} +blockquote{margin:0 0 1em 1.5em} +#header{position:relative} +#topnav{text-align:right} +#header #topnav{position:absolute;top:10px;right:10px} +#header,#nav,#main,#footer{clear:both} +#col1{float:left;width:200px} +#col2{float:right;width:200px} +#col3{width:auto;margin:0 200px} +#col1_content,#col2_content,#col3_content{position:relative} +.hideboth #col3{margin-left:0;margin-right:0} +.hidecol1 #col3{margin-left:0;margin-right:200px} +.hidecol2 #col3{margin-left:200px;margin-right:0} +.hideboth #col1,.hideboth #col2,.hidecol1 #col1,.hidecol2 #col2{display:none} +.clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden} +.clearfix{display:block} +.floatbox{overflow:hidden} +#ie_clearing{display:none} +.subcolumns{width:100%;overflow:hidden} +.subcolumns_oldgecko{width:100%;float:left} +.c50l,.c25l,.c33l,.c38l,.c66l,.c75l,.c62l{float:left} +.c50r,.c25r,.c33r,.c38r,.c66r,.c75r,.c62r{float:right;margin-left:-5px} +.c25l,.c25r{width:25%} +.c33l,.c33r{width:33.333%} +.c50l,.c50r{width:50%} +.c66l,.c66r{width:66.666%} +.c75l,.c75r{width:75%} +.c38l,.c38r{width:38.2%} +.c62l,.c62r{width:61.8%} +.subc{padding:0 .5em} +.subcl{padding:0 1em 0 0} +.subcr{padding:0 0 0 1em} +.skip,.hideme,.print{position:absolute;top:-1000em;left:-1000em;height:1px;width:1px} +.skip:focus,.skip:active{position:static;top:0;left:0;height:auto;width:auto} } \ No newline at end of file diff --git a/interface/web/themes/default/yaml/core/slim_iehacks.css b/interface/web/themes/default/yaml/core/slim_iehacks.css index 0b46deb4e77716da2c9e1281457807c5f56a8c93..a201c14796191d0ae5d6ac12ec526d34c4ea35f8 100644 --- a/interface/web/themes/default/yaml/core/slim_iehacks.css +++ b/interface/web/themes/default/yaml/core/slim_iehacks.css @@ -1,36 +1,36 @@ -@charset UTF-8; -/* "Yet Another Multicolumn Layout" v3.0.6 (c) by Dirk Jesse (http://www.yaml.de) -* $Revision: 202 $ $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ */ -@media all { -html{height:auto;margin-bottom:0;margin-right:1px} -* html textarea{overflow:scroll;overflow-x:hidden} -* html input{overflow:hidden} -body{position:relative;height:1%} -* html body{position:static} -#main{position:relative} -.clearfix{display:inline-block} -.clearfix{display:block} -* html .clearfix{height:1%} -* html .floatbox{width:100%} -.slidebox{position:relative;margin-right:-1000px;height:1%} -* html #col1,* html #col2,* html #col3{position:relative} -#page_margins,#page,#header,#nav,#main,#footer{zoom:1} -#page_margins,#page{height:1%} -* html #header,* html #nav,* html #main,* html #footer{width:100%;wid\th:auto} -* html ul,* html ol,* html dl{position:relative} -body ol li{display:list-item} -#ie_clearing{position:static;display:block;\clear:both;width:100%;font-size:0;margin:-2px 0 -1em 1px} -* html #ie_clearing{margin:-2px 0 -1em} -#col3_content{margin-bottom:-2px} -* html{margin-right:0} -#col3{position:relative;z-index:-1} -* html body a,* html body a:hover{background-color:transparent} -} -@media screen,projection { -#col1,#col2,.c50l,.c25l,.c33l,.c38l,.c66l,.c75l,.c62l,.c50r,.c25r,.c33r,.c38r,.c66r,.c75r,.c62r{display:inline} -* html #col1_content,* html #col2_content,* html #col3_content{word-wrap:break-word} -* html .subcolumns .subc,* html .subcolumns .subcl,* html .subcolumns .subcr{word-wrap:break-word;overflow:hidden} -} -@media print { -#col3{height:1%} +@charset UTF-8; +/* "Yet Another Multicolumn Layout" v3.0.6 (c) by Dirk Jesse (http://www.yaml.de) +* $Revision: 202 $ $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ */ +@media all { +html{height:auto;margin-bottom:0;margin-right:1px} +* html textarea{overflow:scroll;overflow-x:hidden} +* html input{overflow:hidden} +body{position:relative;height:1%} +* html body{position:static} +#main{position:relative} +.clearfix{display:inline-block} +.clearfix{display:block} +* html .clearfix{height:1%} +* html .floatbox{width:100%} +.slidebox{position:relative;margin-right:-1000px;height:1%} +* html #col1,* html #col2,* html #col3{position:relative} +#page_margins,#page,#header,#nav,#main,#footer{zoom:1} +#page_margins,#page{height:1%} +* html #header,* html #nav,* html #main,* html #footer{width:100%;wid\th:auto} +* html ul,* html ol,* html dl{position:relative} +body ol li{display:list-item} +#ie_clearing{position:static;display:block;\clear:both;width:100%;font-size:0;margin:-2px 0 -1em 1px} +* html #ie_clearing{margin:-2px 0 -1em} +#col3_content{margin-bottom:-2px} +* html{margin-right:0} +#col3{position:relative;z-index:-1} +* html body a,* html body a:hover{background-color:transparent} +} +@media screen,projection { +#col1,#col2,.c50l,.c25l,.c33l,.c38l,.c66l,.c75l,.c62l,.c50r,.c25r,.c33r,.c38r,.c66r,.c75r,.c62r{display:inline} +* html #col1_content,* html #col2_content,* html #col3_content{word-wrap:break-word} +* html .subcolumns .subc,* html .subcolumns .subcl,* html .subcolumns .subcr{word-wrap:break-word;overflow:hidden} +} +@media print { +#col3{height:1%} } \ No newline at end of file diff --git a/interface/web/themes/default/yaml/core/slim_print_base.css b/interface/web/themes/default/yaml/core/slim_print_base.css index 42a5d5b069f090af2d8c5d9a7f347e1a8042889b..f371b158c378c7bc258cb8eee665dbe6bdd4c4f3 100644 --- a/interface/web/themes/default/yaml/core/slim_print_base.css +++ b/interface/web/themes/default/yaml/core/slim_print_base.css @@ -1,21 +1,21 @@ -@charset "UTF-8"; -/* "Yet Another Multicolumn Layout" v3.0.6 (c) by Dirk Jesse (http://www.yaml.de) -* $Revision: 202 $ $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ */ -@media print { -body,#page_margins,#page,#main{border:0;margin:0;padding:0} -#page_margins,#page{width:100%!important;min-width:0;max-width:none} -#header{height:auto} -#topnav,#nav,#search,#footer{display:none} -.c25l,.c33l,.c38l,.c50l,.c62l,.c66l,.c75l,.c25r,.c33r,.c38r,.c50r,.c62r,.c66r,.c75r{width:100%;float:none;overflow:visible;display:table;margin:0} -.subc,.subcl,.subcr{margin:0;padding:0} -.print{position:static;top:0;left:0;height:auto;width:auto} -body *{font-family:"Times New Roman", Times, serif} -code,pre{font-family:"Courier New", Courier, mono} -body{font-size:12pt} -h1,h2,h3,h4,h5,h6{page-break-after:avoid} -abbr[title]:after,acronym[title]:after{content:'(' attr(title) ')'} -#page a[href^="http:"],#page a[href^="https:"]{padding-left:0;background-image:none} -a[href]:after{content:" ";color:#444;background:inherit;font-style:italic} -#col1_content:before,#col2_content:before,#col3_content:before{content:"";color:#888;background:inherit;display:block;font-weight:700;font-size:1.5em} -.floatbox,.subcolumns,.subcolums_oldgecko{overflow:visible;display:table} +@charset "UTF-8"; +/* "Yet Another Multicolumn Layout" v3.0.6 (c) by Dirk Jesse (http://www.yaml.de) +* $Revision: 202 $ $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ */ +@media print { +body,#page_margins,#page,#main{border:0;margin:0;padding:0} +#page_margins,#page{width:100%!important;min-width:0;max-width:none} +#header{height:auto} +#topnav,#nav,#search,#footer{display:none} +.c25l,.c33l,.c38l,.c50l,.c62l,.c66l,.c75l,.c25r,.c33r,.c38r,.c50r,.c62r,.c66r,.c75r{width:100%;float:none;overflow:visible;display:table;margin:0} +.subc,.subcl,.subcr{margin:0;padding:0} +.print{position:static;top:0;left:0;height:auto;width:auto} +body *{font-family:"Times New Roman", Times, serif} +code,pre{font-family:"Courier New", Courier, mono} +body{font-size:12pt} +h1,h2,h3,h4,h5,h6{page-break-after:avoid} +abbr[title]:after,acronym[title]:after{content:'(' attr(title) ')'} +#page a[href^="http:"],#page a[href^="https:"]{padding-left:0;background-image:none} +a[href]:after{content:" ";color:#444;background:inherit;font-style:italic} +#col1_content:before,#col2_content:before,#col3_content:before{content:"";color:#888;background:inherit;display:block;font-weight:700;font-size:1.5em} +.floatbox,.subcolumns,.subcolums_oldgecko{overflow:visible;display:table} } \ No newline at end of file diff --git a/interface/web/themes/default/yaml/debug/debug.css b/interface/web/themes/default/yaml/debug/debug.css index 0c4269b13315dd57e484f4ea6ed44a4f25177bd7..f0a1304f77962218211436e42c324631eac43ae0 100644 --- a/interface/web/themes/default/yaml/debug/debug.css +++ b/interface/web/themes/default/yaml/debug/debug.css @@ -1,157 +1,157 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) YAML debugging stylesheet - * (de) YAML Stylesheet zur Fehlersuche - * - * Don't make any changes in this file! - * Your changes should be placed in any css-file in your own stylesheet folder. - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 43 $ - * @lastmodified $Date: 2007-06-11 16:09:28 +0200 (Mo, 11 Jun 2007) $ - */ - -@media all -{ - /*------------------------------------------------------------------------------------------------------*/ - - /** - * @section layout preparation for debugging - * @see http://www.yaml.de/en/documentation/practice/drafting-and-debugging.html - */ - - /* Adding debugging background */ - body { background: transparent url(images/grid_pattern.png) top left no-repeat !important; } - - /* CSS-Warning, if core stylesheet 'iehacks.css' is missing in the layout */ - *:first-child+html #ie_clearing { display:block; } - * html #ie_clearing { display:block; } - - #ie_clearing { - width: 500px; - font-size: 25px; - position:absolute; - top: -2px; - left:0px; - background: url("images/warning_iehacks.gif") top left no-repeat; - } - - /** - * @section pixel grid - */ - - .bg_grid { - background-image:url(images/grid_pattern.png) !important; - background-repeat:no-repeat; - background-position:top left !important; - } - - /** - * @section transparency - */ - - .transOFF { -moz-opacity: 1.0; opacity: 1.0; filter: alpha(Opacity=100);} - .trans50, - .transON { -moz-opacity: 0.5; opacity: 0.5; filter: alpha(Opacity=50);} - .trans25 { -moz-opacity: 0.25; opacity: 0.25; filter: alpha(Opacity=25);} - .trans75 { -moz-opacity: 0.75; opacity: 0.75; filter: alpha(Opacity=75);} - - /** - * @section colors - */ - - .bg_red { background-color: #f00 !important;} - .bg_blue { background-color: #00f !important;} - .bg_green { background-color: #0f0 !important;} - - /** - * @visualize semantic structure - * - * Many thanks to Tomas Caspers for some ideas - */ - - div[id] { padding: 0 !important; margin: 2px; border: 1px #000 solid !important; } - div[id]:before { - display:block; - color: #fff; - background: #800; - padding: 2px; - font: bold .8em "Lucida console", monospace; - content: "[div #"attr(id)"]"; - } - - div[class="floatbox"] { background: #f4f4f4; } - div[class="floatbox"]:before { - display:block; - color: #fff; - background: #66a; - padding: 2px; - font: bold .8em "Lucida console", monospace; - content: "[div ."attr(class)"]"; - } - - div[class="subcolumns"] { background: #f8f8f8; } - div[class="subcolumns"]:before { - display:block; - color: #fff; - background: #444; - padding: 2px; - font: bold .8em "Lucida console", monospace; - content: "[div ."attr(class)"]"; - } - - div[class="subcolumns"] > div:before { - display:block; - color: #fff; - background: #080; - padding: 2px; - font: bold .8em "Lucida console", monospace; - content: "[div ."attr(class)"]"; - } - - div[class="subc"], div[class="subcl"], div[class="subcr"] { background: #eee; } - div[class="subc"]:before, div[class="subcl"]:before, div[class="subcr"]:before { - display:block; - color: #fff; - background: #6a6; - padding: 2px; - font: bold .8em "Lucida console", monospace; - content: "[div ."attr(class)"]"; - } - - h1:before { content: "[h1] "; } - h2:before { content: "[h2] "; } - h3:before { content: "[h3] "; } - h4:before { content: "[h4] "; } - h5:before { content: "[h5] "; } - h6:before { content: "[h6] "; } - - a:hover:before { content: " ( href='" attr(href) "' ) "; } - a:hover:after { content: " [ title='"attr(title)"' ] "; } - - img:after { content:" ( alt='" attr(alt)"' ) "; } - - address, blockquote, dl, fieldset, form, h1, h2, h3, h4, ol, p, pre, ul { - border: 1px dotted #888; - margin: 2px; - padding: 2px; - display: block; - } - - /** - * @visualize inline elements - * - * Many thanks to Tomas Caspers for some ideas - */ - - abbr, acronym { background: #d9eaff; } - q, cite, dfn, kbd { background: #ffe3f6; } - /* :lang(de), :lang(en), :lang(fr), :lang(es) { background: #d9efaa !important; } */ -} +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) YAML debugging stylesheet + * (de) YAML Stylesheet zur Fehlersuche + * + * Don't make any changes in this file! + * Your changes should be placed in any css-file in your own stylesheet folder. + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 43 $ + * @lastmodified $Date: 2007-06-11 16:09:28 +0200 (Mo, 11 Jun 2007) $ + */ + +@media all +{ + /*------------------------------------------------------------------------------------------------------*/ + + /** + * @section layout preparation for debugging + * @see http://www.yaml.de/en/documentation/practice/drafting-and-debugging.html + */ + + /* Adding debugging background */ + body { background: transparent url(images/grid_pattern.png) top left no-repeat !important; } + + /* CSS-Warning, if core stylesheet 'iehacks.css' is missing in the layout */ + *:first-child+html #ie_clearing { display:block; } + * html #ie_clearing { display:block; } + + #ie_clearing { + width: 500px; + font-size: 25px; + position:absolute; + top: -2px; + left:0px; + background: url("images/warning_iehacks.gif") top left no-repeat; + } + + /** + * @section pixel grid + */ + + .bg_grid { + background-image:url(images/grid_pattern.png) !important; + background-repeat:no-repeat; + background-position:top left !important; + } + + /** + * @section transparency + */ + + .transOFF { -moz-opacity: 1.0; opacity: 1.0; filter: alpha(Opacity=100);} + .trans50, + .transON { -moz-opacity: 0.5; opacity: 0.5; filter: alpha(Opacity=50);} + .trans25 { -moz-opacity: 0.25; opacity: 0.25; filter: alpha(Opacity=25);} + .trans75 { -moz-opacity: 0.75; opacity: 0.75; filter: alpha(Opacity=75);} + + /** + * @section colors + */ + + .bg_red { background-color: #f00 !important;} + .bg_blue { background-color: #00f !important;} + .bg_green { background-color: #0f0 !important;} + + /** + * @visualize semantic structure + * + * Many thanks to Tomas Caspers for some ideas + */ + + div[id] { padding: 0 !important; margin: 2px; border: 1px #000 solid !important; } + div[id]:before { + display:block; + color: #fff; + background: #800; + padding: 2px; + font: bold .8em "Lucida console", monospace; + content: "[div #"attr(id)"]"; + } + + div[class="floatbox"] { background: #f4f4f4; } + div[class="floatbox"]:before { + display:block; + color: #fff; + background: #66a; + padding: 2px; + font: bold .8em "Lucida console", monospace; + content: "[div ."attr(class)"]"; + } + + div[class="subcolumns"] { background: #f8f8f8; } + div[class="subcolumns"]:before { + display:block; + color: #fff; + background: #444; + padding: 2px; + font: bold .8em "Lucida console", monospace; + content: "[div ."attr(class)"]"; + } + + div[class="subcolumns"] > div:before { + display:block; + color: #fff; + background: #080; + padding: 2px; + font: bold .8em "Lucida console", monospace; + content: "[div ."attr(class)"]"; + } + + div[class="subc"], div[class="subcl"], div[class="subcr"] { background: #eee; } + div[class="subc"]:before, div[class="subcl"]:before, div[class="subcr"]:before { + display:block; + color: #fff; + background: #6a6; + padding: 2px; + font: bold .8em "Lucida console", monospace; + content: "[div ."attr(class)"]"; + } + + h1:before { content: "[h1] "; } + h2:before { content: "[h2] "; } + h3:before { content: "[h3] "; } + h4:before { content: "[h4] "; } + h5:before { content: "[h5] "; } + h6:before { content: "[h6] "; } + + a:hover:before { content: " ( href='" attr(href) "' ) "; } + a:hover:after { content: " [ title='"attr(title)"' ] "; } + + img:after { content:" ( alt='" attr(alt)"' ) "; } + + address, blockquote, dl, fieldset, form, h1, h2, h3, h4, ol, p, pre, ul { + border: 1px dotted #888; + margin: 2px; + padding: 2px; + display: block; + } + + /** + * @visualize inline elements + * + * Many thanks to Tomas Caspers for some ideas + */ + + abbr, acronym { background: #d9eaff; } + q, cite, dfn, kbd { background: #ffe3f6; } + /* :lang(de), :lang(en), :lang(fr), :lang(es) { background: #d9efaa !important; } */ +} diff --git a/interface/web/themes/default/yaml/navigation/nav_vlist.css b/interface/web/themes/default/yaml/navigation/nav_vlist.css index af2f7e890c4d787ff76b39b6343f894f561c4a3e..7f1a5b9335690a3f48a1e74af0eebbe2aba8a3fa 100644 --- a/interface/web/themes/default/yaml/navigation/nav_vlist.css +++ b/interface/web/themes/default/yaml/navigation/nav_vlist.css @@ -1,109 +1,109 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) Vertical list navigation "vlist" - * (de) Vertikale Navigationsliste "vlist" - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - */ - -@media all -{ - #submenu { - width: 100%; - overflow: hidden; - margin: 2.4em 0 1.5em 0; - list-style-type: none; - border-top: 2px #ddd solid; - border-bottom: 2px #ddd solid; - } - - #submenu ul { list-style-type: none; margin:0; padding: 0; } - #submenu li { float:left; width: 100%; margin:0; padding: 0; } - - #submenu a, - #submenu strong { - display:block; - width: 90%; - padding: 3px 0px 3px 10%; - text-decoration: none; - background-color:#fff; - color: #444; - border-bottom: 1px #eee solid; - } - - /* Menu Title */ - #submenu li#title { - width: 90%; - padding: 3px 0px 3px 10%; - font-weight: bold; - color: #444; - background-color: #fff; - border-bottom: 4px #888 solid; - } - - #submenu li span { - display:block; - width: 90%; - padding: 3px 0px 3px 10%; - font-weight: bold; - border-bottom: 1px #ddd solid; - } - - /* Level 1 */ - #submenu li#active, - #submenu li strong { - width: 90%; - padding: 3px 0px 3px 10%; - font-weight: bold; - color: #fff; - background-color:#aab; - border-bottom: 1px #eee solid; - } - - #submenu li a { width: 90%; padding-left: 10%; background-color:#fff; color: #444; } - #submenu li a:focus, - #submenu li a:hover, - #submenu li a:active { background-color:#f63; color: #fff; } - - /* Level 2 */ - #submenu li ul li a, - #submenu li ul li#active, - #submenu li ul li strong, - #submenu li ul li span { width: 80%; padding-left: 20%; } - - #submenu li ul li a { background-color:#f8f8f8; color: #666; } - #submenu li ul li a:focus, - #submenu li ul li a:hover, - #submenu li ul li a:active { background-color:#f63; color: #fff; } - - /* Level 3 */ - #submenu li ul li ul li a, - #submenu li ul li ul li#active, - #submenu li ul li ul li strong, - #submenu li ul li ul li span { width: 70%; padding-left: 30%; } - - #submenu li ul li ul li a { background-color:#fcfcfc; color: #888; } - #submenu li ul li ul li a:focus, - #submenu li ul li ul li a:hover, - #submenu li ul li ul li a:active { background-color:#f63; color: #fff; } - - /* Level 4 */ - #submenu li ul li ul li ul li a, - #submenu li ul li ul li ul li#active, - #submenu li ul li ul li ul li strong, - #submenu li ul li ul li ul li span { width: 60%; padding-left: 40%; } - - #submenu li ul li ul li ul li a { background-color:#ffffff; color: #aaa; } - #submenu li ul li ul li ul li a:focus, - #submenu li ul li ul li ul li a:hover, - #submenu li ul li ul li ul li a:active { background-color:#f63; color: #fff; } +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) Vertical list navigation "vlist" + * (de) Vertikale Navigationsliste "vlist" + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + */ + +@media all +{ + #submenu { + width: 100%; + overflow: hidden; + margin: 2.4em 0 1.5em 0; + list-style-type: none; + border-top: 2px #ddd solid; + border-bottom: 2px #ddd solid; + } + + #submenu ul { list-style-type: none; margin:0; padding: 0; } + #submenu li { float:left; width: 100%; margin:0; padding: 0; } + + #submenu a, + #submenu strong { + display:block; + width: 90%; + padding: 3px 0px 3px 10%; + text-decoration: none; + background-color:#fff; + color: #444; + border-bottom: 1px #eee solid; + } + + /* Menu Title */ + #submenu li#title { + width: 90%; + padding: 3px 0px 3px 10%; + font-weight: bold; + color: #444; + background-color: #fff; + border-bottom: 4px #888 solid; + } + + #submenu li span { + display:block; + width: 90%; + padding: 3px 0px 3px 10%; + font-weight: bold; + border-bottom: 1px #ddd solid; + } + + /* Level 1 */ + #submenu li#active, + #submenu li strong { + width: 90%; + padding: 3px 0px 3px 10%; + font-weight: bold; + color: #fff; + background-color:#aab; + border-bottom: 1px #eee solid; + } + + #submenu li a { width: 90%; padding-left: 10%; background-color:#fff; color: #444; } + #submenu li a:focus, + #submenu li a:hover, + #submenu li a:active { background-color:#f63; color: #fff; } + + /* Level 2 */ + #submenu li ul li a, + #submenu li ul li#active, + #submenu li ul li strong, + #submenu li ul li span { width: 80%; padding-left: 20%; } + + #submenu li ul li a { background-color:#f8f8f8; color: #666; } + #submenu li ul li a:focus, + #submenu li ul li a:hover, + #submenu li ul li a:active { background-color:#f63; color: #fff; } + + /* Level 3 */ + #submenu li ul li ul li a, + #submenu li ul li ul li#active, + #submenu li ul li ul li strong, + #submenu li ul li ul li span { width: 70%; padding-left: 30%; } + + #submenu li ul li ul li a { background-color:#fcfcfc; color: #888; } + #submenu li ul li ul li a:focus, + #submenu li ul li ul li a:hover, + #submenu li ul li ul li a:active { background-color:#f63; color: #fff; } + + /* Level 4 */ + #submenu li ul li ul li ul li a, + #submenu li ul li ul li ul li#active, + #submenu li ul li ul li ul li strong, + #submenu li ul li ul li ul li span { width: 60%; padding-left: 40%; } + + #submenu li ul li ul li ul li a { background-color:#ffffff; color: #aaa; } + #submenu li ul li ul li ul li a:focus, + #submenu li ul li ul li ul li a:hover, + #submenu li ul li ul li ul li a:active { background-color:#f63; color: #fff; } } \ No newline at end of file diff --git a/interface/web/themes/default/yaml/patches/patch_layout_draft.css b/interface/web/themes/default/yaml/patches/patch_layout_draft.css index 83e835357b1e20f18e6733ca865c6dfa1549f8ce..4490d7f1fb41bc23fcc28b1c05fceb0c9ef6af77 100644 --- a/interface/web/themes/default/yaml/patches/patch_layout_draft.css +++ b/interface/web/themes/default/yaml/patches/patch_layout_draft.css @@ -1,29 +1,29 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) Example of a patch stylesheet for the Internet Explorer - * (de) Beispiel für ein Anpassungs-Stylesheet für den Internet Explorer - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - */ - -/* Layout independent adjustments | Layout-unabhängige Anpassungen ----------------------------------- */ -@import url(/yaml/core/iehacks.css); - -/* Box model adjustments for vlist navigation | Box-Modell-Anpassungen für vlist-Navigation */ -/* @import url(/yaml/patches/patch_nav_vlist.css); */ - -/* Layout-dependent adjustments | Layout-abhängige Anpassungen --------------------------------------- */ -@media screen, projection -{ - /* add your adjustments here | Fügen Sie Ihre Anpassungen hier ein */ - -} +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) Example of a patch stylesheet for the Internet Explorer + * (de) Beispiel für ein Anpassungs-Stylesheet für den Internet Explorer + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + */ + +/* Layout independent adjustments | Layout-unabhängige Anpassungen ----------------------------------- */ +@import url(/yaml/core/iehacks.css); + +/* Box model adjustments for vlist navigation | Box-Modell-Anpassungen für vlist-Navigation */ +/* @import url(/yaml/patches/patch_nav_vlist.css); */ + +/* Layout-dependent adjustments | Layout-abhängige Anpassungen --------------------------------------- */ +@media screen, projection +{ + /* add your adjustments here | Fügen Sie Ihre Anpassungen hier ein */ + +} diff --git a/interface/web/themes/default/yaml/patches/patch_nav_vlist.css b/interface/web/themes/default/yaml/patches/patch_nav_vlist.css index 21041be29427a118094ee56262baf9490011fcf6..cbf29487f90cd06f3b2721a7e760322ed9a3ae51 100644 --- a/interface/web/themes/default/yaml/patches/patch_nav_vlist.css +++ b/interface/web/themes/default/yaml/patches/patch_nav_vlist.css @@ -1,61 +1,61 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) IE adjustment stylesheet for YAML vlist navigation - * Import this file within the IE-patch-file if needed in your layout - * - * (de) IE Anpassungs-Stylesheet für YAML vlist-Navigation - * Einbindung ins Layout erfolgt über den Import innerhalb des IE-Anspassungs-Stylesheet - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - */ - -@media screen, projection -{ - /** - * Box Model Bug - * (en) Adjustment of width values for list elements of the menu in IE 5.x/Win. - * Note: If IE6 is running in quirks mode, it also needs 100% values! - * - * (de) Korrektur der Breitenangaben der Listenelemente des Submenüs im IE 5.x/Win. - * Hinweis: Befindet sich der IE6 im Quirks Mode, so benötigt er ebenfalls 100%-Werte ! - * - * @bugfix - * @affected IE 5.x/Win (IE6 in Quirks-Mode) - * @css-for IE 5.x/Win, IE6 - * @valid no - */ - - /* level 1 */ - * html #submenu li a, - * html #submenu li strong, - * html #submenu li span, - * html #submenu li#title, - * html #submenu li#active { width: 100%; w\idth: 90%; } - - /* level 2 */ - * html #submenu li ul li a, - * html #submenu li ul li strong, - * html #submenu li ul li span, - * html #submenu li ul li#active { width: 100%; w\idth: 80%; } - - /* level 3 */ - * html #submenu li ul li ul li a, - * html #submenu li ul li ul li strong, - * html #submenu li ul li ul li span, - * html #submenu li ul li ul li#active { width: 100%; w\idth: 70%; } - - /* level 4 */ - * html #submenu li ul li ul li ul li a, - * html #submenu li ul li ul li ul li strong, - * html #submenu li ul li ul li ul li span, - * html #submenu li ul li ul li ul li#active { width: 100%; w\idth: 60%; } -} +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) IE adjustment stylesheet for YAML vlist navigation + * Import this file within the IE-patch-file if needed in your layout + * + * (de) IE Anpassungs-Stylesheet für YAML vlist-Navigation + * Einbindung ins Layout erfolgt über den Import innerhalb des IE-Anspassungs-Stylesheet + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + */ + +@media screen, projection +{ + /** + * Box Model Bug + * (en) Adjustment of width values for list elements of the menu in IE 5.x/Win. + * Note: If IE6 is running in quirks mode, it also needs 100% values! + * + * (de) Korrektur der Breitenangaben der Listenelemente des Submenüs im IE 5.x/Win. + * Hinweis: Befindet sich der IE6 im Quirks Mode, so benötigt er ebenfalls 100%-Werte ! + * + * @bugfix + * @affected IE 5.x/Win (IE6 in Quirks-Mode) + * @css-for IE 5.x/Win, IE6 + * @valid no + */ + + /* level 1 */ + * html #submenu li a, + * html #submenu li strong, + * html #submenu li span, + * html #submenu li#title, + * html #submenu li#active { width: 100%; w\idth: 90%; } + + /* level 2 */ + * html #submenu li ul li a, + * html #submenu li ul li strong, + * html #submenu li ul li span, + * html #submenu li ul li#active { width: 100%; w\idth: 80%; } + + /* level 3 */ + * html #submenu li ul li ul li a, + * html #submenu li ul li ul li strong, + * html #submenu li ul li ul li span, + * html #submenu li ul li ul li#active { width: 100%; w\idth: 70%; } + + /* level 4 */ + * html #submenu li ul li ul li ul li a, + * html #submenu li ul li ul li ul li strong, + * html #submenu li ul li ul li ul li span, + * html #submenu li ul li ul li ul li#active { width: 100%; w\idth: 60%; } +} diff --git a/interface/web/themes/default/yaml/print/print_003_draft.css b/interface/web/themes/default/yaml/print/print_003_draft.css index 29c6df6291347a51c419795c3bf6558bbbd4cc02..0363b4ee820562dd423c698494fb4fd7cc7b913d 100644 --- a/interface/web/themes/default/yaml/print/print_003_draft.css +++ b/interface/web/themes/default/yaml/print/print_003_draft.css @@ -1,32 +1,32 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) print stylesheet - * (de) Druck-Stylesheet - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - */ - -/* import print base styles | Basisformatierung für Drucklayout einbinden */ -@import url(../core/print_base.css); - -/* #col1 - 0 -** #col2 - 0 -** #col3 - x -*/ - -@media print -{ - #col1 { display:none; } - #col2 { display:none; } - - #col3, #col3_content { width: 100%; margin:0; padding: 0; border:0; } +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) print stylesheet + * (de) Druck-Stylesheet + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + */ + +/* import print base styles | Basisformatierung für Drucklayout einbinden */ +@import url(../core/print_base.css); + +/* #col1 - 0 +** #col2 - 0 +** #col3 - x +*/ + +@media print +{ + #col1 { display:none; } + #col2 { display:none; } + + #col3, #col3_content { width: 100%; margin:0; padding: 0; border:0; } } \ No newline at end of file diff --git a/interface/web/themes/default/yaml/print/print_020_draft.css b/interface/web/themes/default/yaml/print/print_020_draft.css index 885b0b9915459f4c8800d209c8788455bc89d55a..2ded4f1143ee4c7f82efedbd6f7121ee8fd6fdd7 100644 --- a/interface/web/themes/default/yaml/print/print_020_draft.css +++ b/interface/web/themes/default/yaml/print/print_020_draft.css @@ -1,31 +1,31 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) print stylesheet - * (de) Druck-Stylesheet - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - */ - -/* import print base styles | Basisformatierung für Drucklayout einbinden */ -@import url(../core/print_base.css); - -/* #col1 - 0 -** #col2 - x -** #col3 - 0 -*/ -@media print -{ - #col1 { display:none; } - #col3 { display:none; } - - #col2, #col2_content { float:none; width: 100%; margin: 0; padding: 0; border: 0; } +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) print stylesheet + * (de) Druck-Stylesheet + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + */ + +/* import print base styles | Basisformatierung für Drucklayout einbinden */ +@import url(../core/print_base.css); + +/* #col1 - 0 +** #col2 - x +** #col3 - 0 +*/ +@media print +{ + #col1 { display:none; } + #col3 { display:none; } + + #col2, #col2_content { float:none; width: 100%; margin: 0; padding: 0; border: 0; } } \ No newline at end of file diff --git a/interface/web/themes/default/yaml/print/print_023_draft.css b/interface/web/themes/default/yaml/print/print_023_draft.css index a80bb087538e8b97b128b6611fe7d7afb628e7c1..e005a588aec4b0837e4cdc56555a7c1921135f00 100644 --- a/interface/web/themes/default/yaml/print/print_023_draft.css +++ b/interface/web/themes/default/yaml/print/print_023_draft.css @@ -1,40 +1,40 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) print stylesheet - * (de) Druck-Stylesheet - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - */ - -/* import print base styles | Basisformatierung für Drucklayout einbinden */ -@import url(../core/print_base.css); - -/* #col1 - 0 -** #col2 - x -** #col3 - x -*/ - -@media print -{ - #col1 { display:none; } - - #col2, #col2_content { float:none; width: 100%; margin: 0; padding: 0; border: 0; } - #col2_content { page-break-after:always; } - - #col3, #col3_content {width: 100%; margin:0; padding: 0; border:0; } - - /* Optional Column Labels | Optionale Spaltenauszeichnung - #col2_content:before { content:" [ left | middle | right column ]"; } - #col3_content:before { content:" [ left | middle | right column ]"; } - */ -} - +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) print stylesheet + * (de) Druck-Stylesheet + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + */ + +/* import print base styles | Basisformatierung für Drucklayout einbinden */ +@import url(../core/print_base.css); + +/* #col1 - 0 +** #col2 - x +** #col3 - x +*/ + +@media print +{ + #col1 { display:none; } + + #col2, #col2_content { float:none; width: 100%; margin: 0; padding: 0; border: 0; } + #col2_content { page-break-after:always; } + + #col3, #col3_content {width: 100%; margin:0; padding: 0; border:0; } + + /* Optional Column Labels | Optionale Spaltenauszeichnung + #col2_content:before { content:" [ left | middle | right column ]"; } + #col3_content:before { content:" [ left | middle | right column ]"; } + */ +} + diff --git a/interface/web/themes/default/yaml/print/print_100_draft.css b/interface/web/themes/default/yaml/print/print_100_draft.css index 99f29b4f127980072a9761902e48940453ebc1db..2a6c71b197f0c8a21d853814ab0411dd6b964b76 100644 --- a/interface/web/themes/default/yaml/print/print_100_draft.css +++ b/interface/web/themes/default/yaml/print/print_100_draft.css @@ -1,31 +1,31 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) print stylesheet - * (de) Druck-Stylesheet - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - */ - -/* import print base styles | Basisformatierung für Drucklayout einbinden */ -@import url(../core/print_base.css); - -/* #col1 - x -** #col2 - 0 -** #col3 - 0 -*/ -@media print -{ - #col1, #col1_content { float:none; width: 100%; margin: 0; padding: 0; border: 0; } - - #col2 { display:none; } - #col3 { display:none; } -} +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) print stylesheet + * (de) Druck-Stylesheet + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + */ + +/* import print base styles | Basisformatierung für Drucklayout einbinden */ +@import url(../core/print_base.css); + +/* #col1 - x +** #col2 - 0 +** #col3 - 0 +*/ +@media print +{ + #col1, #col1_content { float:none; width: 100%; margin: 0; padding: 0; border: 0; } + + #col2 { display:none; } + #col3 { display:none; } +} diff --git a/interface/web/themes/default/yaml/print/print_103_draft.css b/interface/web/themes/default/yaml/print/print_103_draft.css index 983e61a4ad38c2f1c23a5a8aeff369a60bc53447..a436374703a79c012a0d17f0b58406e8d9f1992c 100644 --- a/interface/web/themes/default/yaml/print/print_103_draft.css +++ b/interface/web/themes/default/yaml/print/print_103_draft.css @@ -1,38 +1,38 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) print stylesheet - * (de) Druck-Stylesheet - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - */ - -/* import print base styles | Basisformatierung für Drucklayout einbinden */ -@import url(../core/print_base.css); - -/* #col1 - x -** #col2 - 0 -** #col3 - x -*/ -@media print -{ - #col1, #col1_content {float:none; width: 100%; margin: 0; padding: 0; border: 0; } - #col1_content {page-break-after:always; } - - #col2 { display:none; } - - #col3, #col3_content { width: 100%; margin:0; padding: 0; border:0; } - - /* Optional Column Labels | Optionale Spaltenauszeichnung - #col1_content:before { content:" [ left | middle | right column ]"; } - #col3_content:before { content:" [ left | middle | right column ]"; } - */ +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) print stylesheet + * (de) Druck-Stylesheet + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + */ + +/* import print base styles | Basisformatierung für Drucklayout einbinden */ +@import url(../core/print_base.css); + +/* #col1 - x +** #col2 - 0 +** #col3 - x +*/ +@media print +{ + #col1, #col1_content {float:none; width: 100%; margin: 0; padding: 0; border: 0; } + #col1_content {page-break-after:always; } + + #col2 { display:none; } + + #col3, #col3_content { width: 100%; margin:0; padding: 0; border:0; } + + /* Optional Column Labels | Optionale Spaltenauszeichnung + #col1_content:before { content:" [ left | middle | right column ]"; } + #col3_content:before { content:" [ left | middle | right column ]"; } + */ } \ No newline at end of file diff --git a/interface/web/themes/default/yaml/print/print_120_draft.css b/interface/web/themes/default/yaml/print/print_120_draft.css index 43f0950601cdf24ad04615077c1bd993d2037542..50ee5714976dd93066ff61ee2799f79fe9c8cb42 100644 --- a/interface/web/themes/default/yaml/print/print_120_draft.css +++ b/interface/web/themes/default/yaml/print/print_120_draft.css @@ -1,39 +1,39 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) print stylesheet - * (de) Druck-Stylesheet - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - */ - -/* import print base styles | Basisformatierung für Drucklayout einbinden */ -@import url(../core/print_base.css); - -/* #col1 - x -** #col2 - x -** #col3 - 0 -*/ -@media print -{ - #col1, #col1_content { float:none; width: 100%; margin: 0; padding: 0; border: 0; } - #col1_content { page-break-after:always; } - - #col2, #col2_content { float:none; width: 100%; margin: 0; padding: 0; border: 0; } - #col2_content { page-break-after:always; } - - #col3 { display:none; } - - /* Optional Column Labels | Optionale Spaltenauszeichnung - #col1_content:before { content:" [ left | middle | right column ]"; } - #col2_content:before { content:" [ left | middle | right column ]"; } - */ -} +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) print stylesheet + * (de) Druck-Stylesheet + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + */ + +/* import print base styles | Basisformatierung für Drucklayout einbinden */ +@import url(../core/print_base.css); + +/* #col1 - x +** #col2 - x +** #col3 - 0 +*/ +@media print +{ + #col1, #col1_content { float:none; width: 100%; margin: 0; padding: 0; border: 0; } + #col1_content { page-break-after:always; } + + #col2, #col2_content { float:none; width: 100%; margin: 0; padding: 0; border: 0; } + #col2_content { page-break-after:always; } + + #col3 { display:none; } + + /* Optional Column Labels | Optionale Spaltenauszeichnung + #col1_content:before { content:" [ left | middle | right column ]"; } + #col2_content:before { content:" [ left | middle | right column ]"; } + */ +} diff --git a/interface/web/themes/default/yaml/print/print_123_draft.css b/interface/web/themes/default/yaml/print/print_123_draft.css index d2586db76c39d0c167304914ff329448a66755eb..42a7de1d5a3aa82dabcd19670f030c13cc34d541 100644 --- a/interface/web/themes/default/yaml/print/print_123_draft.css +++ b/interface/web/themes/default/yaml/print/print_123_draft.css @@ -1,40 +1,40 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) print stylesheet - * (de) Druck-Stylesheet - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - */ - -/* import print base styles | Basisformatierung für Drucklayout einbinden */ -@import url(../core/print_base.css); - -/* #col1 - x -** #col2 - x -** #col3 - x -*/ -@media print -{ - #col1, #col1_content { float:none; width: 100%; margin: 0; padding: 0; border: 0; } - #col1_content { page-break-after:always; } - - #col2, #col2_content { float:none; width: 100%; margin: 0; padding: 0; border: 0; } - #col2_content { page-break-after:always; } - - #col3, #col3_content { width: 100%; margin:0; padding: 0; border:0; } - - /* Optional Column Labels | Optionale Spaltenauszeichnung - #col1_content:before { content:" [ left | middle | right column ]"; } - #col2_content:before { content:" [ left | middle | right column ]"; } - #col3_content:before { content:" [ left | middle | right column ]"; } - */ +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) print stylesheet + * (de) Druck-Stylesheet + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + */ + +/* import print base styles | Basisformatierung für Drucklayout einbinden */ +@import url(../core/print_base.css); + +/* #col1 - x +** #col2 - x +** #col3 - x +*/ +@media print +{ + #col1, #col1_content { float:none; width: 100%; margin: 0; padding: 0; border: 0; } + #col1_content { page-break-after:always; } + + #col2, #col2_content { float:none; width: 100%; margin: 0; padding: 0; border: 0; } + #col2_content { page-break-after:always; } + + #col3, #col3_content { width: 100%; margin:0; padding: 0; border:0; } + + /* Optional Column Labels | Optionale Spaltenauszeichnung + #col1_content:before { content:" [ left | middle | right column ]"; } + #col2_content:before { content:" [ left | middle | right column ]"; } + #col3_content:before { content:" [ left | middle | right column ]"; } + */ } \ No newline at end of file diff --git a/interface/web/themes/default/yaml/screen/basemod_draft.css b/interface/web/themes/default/yaml/screen/basemod_draft.css index c738ee0ed813be12ebcd5552c0a6c3f1439b9b49..6d33ff8ddad28f0c48c2c714b84762b4f2434ed0 100644 --- a/interface/web/themes/default/yaml/screen/basemod_draft.css +++ b/interface/web/themes/default/yaml/screen/basemod_draft.css @@ -1,70 +1,70 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) Template for designing a screen layout - * (de) Gestaltungsvorlage für die Erstellung eines Screenlayouts - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - */ - -@media screen, projection -{ - /*------------------------------------------------------------------------------------------------------*/ - - /** - * Design of the Basic Layout | Gestaltung des YAML Basis-Layouts - * - * @section layout-basics - */ - - /* Page margins and background | Randbereiche & Seitenhintergrund */ - body { } - - /* Layout: Width, Background, Border | Layout: Breite, Hintergrund, Rahmen */ - #page_margins { } - #page{ } - - /* Design of the Main Layout Elements | Gestaltung der Hauptelemente des Layouts */ - #header { } - #topnav { } - - #main { } - - #footer { } - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * Formatting of the Content Area | Formatierung der Inhaltsbereichs - * - * @section layout-main - */ - - #col1 { } - #col1_content { } - - #col2 { } - #col2_content { } - - #col3 { } - #col3_content { } - - - /*------------------------------------------------------------------------------------------------------*/ - - /** - * Design of Additional Layout Elements | Gestaltung weiterer Layoutelemente - * - * @section layout-misc - */ - - +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) Template for designing a screen layout + * (de) Gestaltungsvorlage für die Erstellung eines Screenlayouts + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + */ + +@media screen, projection +{ + /*------------------------------------------------------------------------------------------------------*/ + + /** + * Design of the Basic Layout | Gestaltung des YAML Basis-Layouts + * + * @section layout-basics + */ + + /* Page margins and background | Randbereiche & Seitenhintergrund */ + body { } + + /* Layout: Width, Background, Border | Layout: Breite, Hintergrund, Rahmen */ + #page_margins { } + #page{ } + + /* Design of the Main Layout Elements | Gestaltung der Hauptelemente des Layouts */ + #header { } + #topnav { } + + #main { } + + #footer { } + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * Formatting of the Content Area | Formatierung der Inhaltsbereichs + * + * @section layout-main + */ + + #col1 { } + #col1_content { } + + #col2 { } + #col2_content { } + + #col3 { } + #col3_content { } + + + /*------------------------------------------------------------------------------------------------------*/ + + /** + * Design of Additional Layout Elements | Gestaltung weiterer Layoutelemente + * + * @section layout-misc + */ + + } \ No newline at end of file diff --git a/interface/web/themes/default/yaml/screen/content_default.css b/interface/web/themes/default/yaml/screen/content_default.css index 5742599df130919c9460beb658d2e8a60cc1df23..1852ac1169bf11724692ed443b9e11d61904b818 100644 --- a/interface/web/themes/default/yaml/screen/content_default.css +++ b/interface/web/themes/default/yaml/screen/content_default.css @@ -1,170 +1,170 @@ -@charset "UTF-8"; -/** - * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework - * - * (en) Uniform design of standard content elements - * (de) Einheitliche Standardformatierungen für die wichtigten Inhalts-Elemente - * - * @copyright Copyright 2005-2008, Dirk Jesse - * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), - * YAML-C (http://www.yaml.de/en/license/license-conditions.html) - * @link http://www.yaml.de - * @package yaml - * @version 3.0.6 - * @revision $Revision: 202 $ - * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ - * @appdef yaml - */ - -@media all -{ - /** - * Fonts - * (en) font-family and font-size selection for headings and standard text elements - * (de) Zeichensatz und Schriftgrößen für Überschriften und übliche Text-Elemente - * - * @section content-fonts - */ - - /* (en) reset font size for all elements to standard (16 Pixel) */ - /* (de) Alle Schriftgrößen auf Standardgröße (16 Pixel) zurücksetzen */ - html * { font-size: 100.01%; } - - /* (en) reset monospaced elements to font size 16px in Gecko browsers */ - /* (de) Schriftgröße von monospaced Elemente auf 16 Pixel setzen */ - textarea, pre, tt, code { - font-family:"Courier New", Courier, monospace; - } - - /* (en) base layout gets standard font size 12px */ - /* (de) Basis-Layout erhält Standardschriftgröße von 12 Pixeln */ - body { - font-family: 'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif; - font-size: 75.00%; - } - - h1,h2,h3,h4,h5,h6 { font-weight:bold; margin: 0 0 0.25em 0; } - h1 { font-size: 200% } /* 24px */ - h2 { font-size: 166.67% } /* 20px */ - h3 { font-size: 150% } /* 18px */ - h4 { font-size: 133.33% } /* 16px */ - h5 { font-size: 116.67% } /* 14px */ - h6 { font-size: 116.67%; font-style:italic; } /* 14px */ - - p { line-height: 1.5em; margin: 0 0 1em 0; } - - /* ### Lists | Listen #### */ - - ul, ol, dl { line-height: 1.5em; margin: 0 0 1em 1em; } - li { margin-left: 1.5em; line-height: 1.5em; } - - dt { font-weight: bold; } - dd { margin: 0 0 1em 2em; } - - /* ### text formatting | Textauszeichnung ### */ - - cite, blockquote { font-style:italic; } - blockquote { margin: 0 0 1em 1.5em; } - - strong,b { font-weight: bold; } - em,i { font-style:italic; } - - pre, code { font-family: monospace; font-size: 1.1em; } - - acronym, abbr { - letter-spacing: .07em; - border-bottom: .1em dashed #c00; - cursor: help; - } - - /** - * Generic Content Classes - * (en) standard classes for positioning and highlighting - * (de) Standardklassen zur Positionierung und Hervorhebung - * - * @section content-generic-classes - */ - - .note { background: #dfd; padding: 1em; border-top: 1px #bdb dotted; border-bottom: 1px #bdb dotted; } - .important { background: #ffd; padding: 1em; border-top: 1px #ddb dotted; border-bottom: 1px #ddb dotted; } - .warning { background: #fdd; padding: 1em; border-top: 1px #dbb dotted; border-bottom: 1px #dbb dotted; } - - .float_left { float: left; display:inline; margin-right: 1em; margin-bottom: 0.15em; } - .float_right { float: right; display:inline; margin-left: 1em; margin-bottom: 0.15em; } - .center { text-align:center; margin: 0.5em auto; } - - /** - * External Links - * - * (en) Formatting of hyperlinks - * (de) Gestaltung von Hyperlinks - * - */ - - a { color: #900; text-decoration:none; } - a:focus, - a:hover, - a:active { background-color: #fee; text-decoration:underline; } - - #topnav a { color: #aac; font-weight: bold; background:transparent; text-decoration:none; } - #topnav a:focus, - #topnav a:hover, - #topnav a:active{ text-decoration:underline; background-color: transparent; } - - #footer a { color: #aac; background:transparent; font-weight: bold; } - #footer a:focus, - #footer a:hover, - #footer a:active { color: #fff; background-color: transparent; text-decoration:underline; } - - /** - * (en) Emphasizing external Hyperlinks via CSS - * (de) Hervorhebung externer Hyperlinks mit CSS - * - * @section content-external-links - * @app-yaml-default disabled - */ - - /* - #main a[href^="http://www.my-domain.com"], - #main a[href^="https://www.my-domain.com"] - { - padding-left: 12px; - background-image: url('your_image.gif'); - background-repeat: no-repeat; - background-position: 0 0.45em; - } - */ - - /** - * Tables | Tabellen - * (en) Generic classes for table-width and design definition - * (de) Generische Klassen für die Tabellenbreite und Gestaltungsvorschriften für Tabellen - * - * @section content-tables - */ - - table { width: auto; border-collapse:collapse; margin-bottom: 0.5em; } - table.full { width: 100%; } - table.fixed { table-layout:fixed; } - - th,td { padding: 0.5em; } - thead th { background: #444; color: #fff; } - tbody th { background: #ccc; color: #333; } - tbody th.sub { background: #ddd; color: #333; } - - /** - * Miscellaneous | Sonstiges - * - * @section content-misc - */ - - hr { - color: #fff; - background:transparent; - margin: 0 0 0.5em 0; - padding: 0 0 0.5em 0; - border:0; - border-bottom: 1px #000 solid; - } -} - +@charset "UTF-8"; +/** + * "Yet Another Multicolumn Layout" - (X)HTML/CSS Framework + * + * (en) Uniform design of standard content elements + * (de) Einheitliche Standardformatierungen für die wichtigten Inhalts-Elemente + * + * @copyright Copyright 2005-2008, Dirk Jesse + * @license CC-A 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-C (http://www.yaml.de/en/license/license-conditions.html) + * @link http://www.yaml.de + * @package yaml + * @version 3.0.6 + * @revision $Revision: 202 $ + * @lastmodified $Date: 2008-06-07 14:29:18 +0200 (Sa, 07 Jun 2008) $ + * @appdef yaml + */ + +@media all +{ + /** + * Fonts + * (en) font-family and font-size selection for headings and standard text elements + * (de) Zeichensatz und Schriftgrößen für Überschriften und übliche Text-Elemente + * + * @section content-fonts + */ + + /* (en) reset font size for all elements to standard (16 Pixel) */ + /* (de) Alle Schriftgrößen auf Standardgröße (16 Pixel) zurücksetzen */ + html * { font-size: 100.01%; } + + /* (en) reset monospaced elements to font size 16px in Gecko browsers */ + /* (de) Schriftgröße von monospaced Elemente auf 16 Pixel setzen */ + textarea, pre, tt, code { + font-family:"Courier New", Courier, monospace; + } + + /* (en) base layout gets standard font size 12px */ + /* (de) Basis-Layout erhält Standardschriftgröße von 12 Pixeln */ + body { + font-family: 'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif; + font-size: 75.00%; + } + + h1,h2,h3,h4,h5,h6 { font-weight:bold; margin: 0 0 0.25em 0; } + h1 { font-size: 200% } /* 24px */ + h2 { font-size: 166.67% } /* 20px */ + h3 { font-size: 150% } /* 18px */ + h4 { font-size: 133.33% } /* 16px */ + h5 { font-size: 116.67% } /* 14px */ + h6 { font-size: 116.67%; font-style:italic; } /* 14px */ + + p { line-height: 1.5em; margin: 0 0 1em 0; } + + /* ### Lists | Listen #### */ + + ul, ol, dl { line-height: 1.5em; margin: 0 0 1em 1em; } + li { margin-left: 1.5em; line-height: 1.5em; } + + dt { font-weight: bold; } + dd { margin: 0 0 1em 2em; } + + /* ### text formatting | Textauszeichnung ### */ + + cite, blockquote { font-style:italic; } + blockquote { margin: 0 0 1em 1.5em; } + + strong,b { font-weight: bold; } + em,i { font-style:italic; } + + pre, code { font-family: monospace; font-size: 1.1em; } + + acronym, abbr { + letter-spacing: .07em; + border-bottom: .1em dashed #c00; + cursor: help; + } + + /** + * Generic Content Classes + * (en) standard classes for positioning and highlighting + * (de) Standardklassen zur Positionierung und Hervorhebung + * + * @section content-generic-classes + */ + + .note { background: #dfd; padding: 1em; border-top: 1px #bdb dotted; border-bottom: 1px #bdb dotted; } + .important { background: #ffd; padding: 1em; border-top: 1px #ddb dotted; border-bottom: 1px #ddb dotted; } + .warning { background: #fdd; padding: 1em; border-top: 1px #dbb dotted; border-bottom: 1px #dbb dotted; } + + .float_left { float: left; display:inline; margin-right: 1em; margin-bottom: 0.15em; } + .float_right { float: right; display:inline; margin-left: 1em; margin-bottom: 0.15em; } + .center { text-align:center; margin: 0.5em auto; } + + /** + * External Links + * + * (en) Formatting of hyperlinks + * (de) Gestaltung von Hyperlinks + * + */ + + a { color: #900; text-decoration:none; } + a:focus, + a:hover, + a:active { background-color: #fee; text-decoration:underline; } + + #topnav a { color: #aac; font-weight: bold; background:transparent; text-decoration:none; } + #topnav a:focus, + #topnav a:hover, + #topnav a:active{ text-decoration:underline; background-color: transparent; } + + #footer a { color: #aac; background:transparent; font-weight: bold; } + #footer a:focus, + #footer a:hover, + #footer a:active { color: #fff; background-color: transparent; text-decoration:underline; } + + /** + * (en) Emphasizing external Hyperlinks via CSS + * (de) Hervorhebung externer Hyperlinks mit CSS + * + * @section content-external-links + * @app-yaml-default disabled + */ + + /* + #main a[href^="http://www.my-domain.com"], + #main a[href^="https://www.my-domain.com"] + { + padding-left: 12px; + background-image: url('your_image.gif'); + background-repeat: no-repeat; + background-position: 0 0.45em; + } + */ + + /** + * Tables | Tabellen + * (en) Generic classes for table-width and design definition + * (de) Generische Klassen für die Tabellenbreite und Gestaltungsvorschriften für Tabellen + * + * @section content-tables + */ + + table { width: auto; border-collapse:collapse; margin-bottom: 0.5em; } + table.full { width: 100%; } + table.fixed { table-layout:fixed; } + + th,td { padding: 0.5em; } + thead th { background: #444; color: #fff; } + tbody th { background: #ccc; color: #333; } + tbody th.sub { background: #ddd; color: #333; } + + /** + * Miscellaneous | Sonstiges + * + * @section content-misc + */ + + hr { + color: #fff; + background:transparent; + margin: 0 0 0.5em 0; + padding: 0 0 0.5em 0; + border:0; + border-bottom: 1px #000 solid; + } +} + diff --git a/interface/web/themes/default_64_navimg/css/additional.css b/interface/web/themes/default_64_navimg/css/additional.css index 61bed3f8592cac27bea6efe120bd6030a5c567c3..465f042d3816f54431ed6d2644d00b55d1e7ecbf 100644 --- a/interface/web/themes/default_64_navimg/css/additional.css +++ b/interface/web/themes/default_64_navimg/css/additional.css @@ -1,60 +1,60 @@ -@media all -{ - #topNav a { - background-color: #D3D3D3; - background-position: center top; - background-repeat: no-repeat; - color:black; - display:inline-block; - height:20px; - padding-top:68px; - text-align:center; - text-decoration:none; - width:97px; - } - - .topnav-admin { - background-image: url('/themes/default/icons/x64/system.png') !important; - } - - .topnav-client { - background-image: url('/themes/default/icons/x64/client.png') !important; - } - - .topnav-mail { - background-image: url('/themes/default/icons/x64/email.png') !important; - } - - .topnav-monitor { - background-image: url('/themes/default/icons/x64/monitor.png') !important; - } - - .topnav-sites { - background-image: url('/themes/default/icons/x64/sites.png') !important; - } - - .topnav-dns { - background-image: url('/themes/default/icons/x64/dns.png') !important; - } - - .topnav-tools { - background-image: url('/themes/default/icons/x64/tools.png') !important; - } - - .topnav-help { - background-image: url('/themes/default/icons/x64/help.png') !important; - } - - .topnav- { - background-image: url('/themes/default/icons/x64/login.png') !important; - } - - .topnav-domain { - background-image: url('/themes/default/icons/x64/domain.png') !important; - } - - .topnav-dashboard { - background-image: url('/themes/default/icons/x64/dashboard.png') !important; - } - +@media all +{ + #topNav a { + background-color: #D3D3D3; + background-position: center top; + background-repeat: no-repeat; + color:black; + display:inline-block; + height:20px; + padding-top:68px; + text-align:center; + text-decoration:none; + width:97px; + } + + .topnav-admin { + background-image: url('/themes/default/icons/x64/system.png') !important; + } + + .topnav-client { + background-image: url('/themes/default/icons/x64/client.png') !important; + } + + .topnav-mail { + background-image: url('/themes/default/icons/x64/email.png') !important; + } + + .topnav-monitor { + background-image: url('/themes/default/icons/x64/monitor.png') !important; + } + + .topnav-sites { + background-image: url('/themes/default/icons/x64/sites.png') !important; + } + + .topnav-dns { + background-image: url('/themes/default/icons/x64/dns.png') !important; + } + + .topnav-tools { + background-image: url('/themes/default/icons/x64/tools.png') !important; + } + + .topnav-help { + background-image: url('/themes/default/icons/x64/help.png') !important; + } + + .topnav- { + background-image: url('/themes/default/icons/x64/login.png') !important; + } + + .topnav-domain { + background-image: url('/themes/default/icons/x64/domain.png') !important; + } + + .topnav-dashboard { + background-image: url('/themes/default/icons/x64/dashboard.png') !important; + } + } \ No newline at end of file diff --git a/interface/web/themes/default_no_navimg/css/additional.css b/interface/web/themes/default_no_navimg/css/additional.css index c5ceae24988e8d933089dc258361c100bdc94999..01ca51f3faedc7ca7bbb9d5cd5145010d910feba 100644 --- a/interface/web/themes/default_no_navimg/css/additional.css +++ b/interface/web/themes/default_no_navimg/css/additional.css @@ -1,60 +1,60 @@ -@media all -{ - #topNav a { - background-color: #D3D3D3; - background-position: center top; - background-repeat: no-repeat; - color:black; - display:inline-block; - height:20px; - padding-top:5px; - text-align:center; - text-decoration:none; - width:97px; - } - - .topnav-admin { - background-image: none !important; - } - - .topnav-client { - background-image: none !important; - } - - .topnav-mail { - background-image: none !important; - } - - .topnav-monitor { - background-image: none !important; - } - - .topnav-sites { - background-image: none !important; - } - - .topnav-dns { - background-image: none !important; - } - - .topnav-tools { - background-image: none !important; - } - - .topnav-help { - background-image: none !important; - } - - .topnav- { - background-image: none !important; - } - - .topnav-domain { - background-image: none !important; - } - - .topnav-dashboard { - background-image: none !important; - } - +@media all +{ + #topNav a { + background-color: #D3D3D3; + background-position: center top; + background-repeat: no-repeat; + color:black; + display:inline-block; + height:20px; + padding-top:5px; + text-align:center; + text-decoration:none; + width:97px; + } + + .topnav-admin { + background-image: none !important; + } + + .topnav-client { + background-image: none !important; + } + + .topnav-mail { + background-image: none !important; + } + + .topnav-monitor { + background-image: none !important; + } + + .topnav-sites { + background-image: none !important; + } + + .topnav-dns { + background-image: none !important; + } + + .topnav-tools { + background-image: none !important; + } + + .topnav-help { + background-image: none !important; + } + + .topnav- { + background-image: none !important; + } + + .topnav-domain { + background-image: none !important; + } + + .topnav-dashboard { + background-image: none !important; + } + } \ No newline at end of file diff --git a/interface/web/tools/form/user_settings.tform.php b/interface/web/tools/form/user_settings.tform.php index f261b1150c25607e430dc032cd91c96ab3cb08af..65316114d7bb6dca63833bdf3555228392eb57cf 100644 --- a/interface/web/tools/form/user_settings.tform.php +++ b/interface/web/tools/form/user_settings.tform.php @@ -1,164 +1,164 @@ - 0 id must match with id of current user -$form['auth_preset']['userid'] = 0; -//* 0 = default groupid of the user, > 0 id must match with groupid of current user -$form['auth_preset']['groupid'] = 0; - -//** Permissions are: r = read, i = insert, u = update, d = delete -$form['auth_preset']['perm_user'] = 'riud'; -$form['auth_preset']['perm_group'] = 'riud'; -$form['auth_preset']['perm_other'] = ''; - -//* Languages -$language_list = array(); -$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); -while ($file = @readdir ($handle)) { - if ($file != '.' && $file != '..') { - if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { - $tmp = substr($file, 0, 2); - $language_list[$tmp] = $tmp; - } - } -} - -$form['tabs']['users'] = array ( - 'title' => 'Settings', - 'width' => 80, - 'template' => 'templates/user_settings.htm', - 'fields' => array ( - ################################## - # Beginn Datenbankfelder - ################################## - 'passwort' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'PASSWORD', - 'encryption'=> 'CRYPT', - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '15', - 'maxlength' => '100', - 'rows' => '', - 'cols' => '' - ), - 'language' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'language_is_empty'), - 1 => array ( 'type' => 'REGEX', - 'regex' => '/^[a-z]{2}$/i', - 'errmsg'=> 'language_regex_mismatch'), - ), - 'regex' => '', - 'errmsg' => '', - 'default' => '', - 'value' => $language_list, - 'separator' => '', - 'width' => '30', - 'maxlength' => '2', - 'rows' => '', - 'cols' => '' - ), - 'id_rsa' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT id_rsa FROM client WHERE {AUTHSQL}', - 'valuefield'=> 'id_rsa' - ), - 'value' => '' - ), - 'ssh_rsa' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT ssh_rsa FROM client WHERE {AUTHSQL}', - 'valuefield'=> 'ssh_rsa' - ), - 'value' => '' - ) - ################################## - # ENDE Datenbankfelder - ################################## - ) -); - - -?> + 0 id must match with id of current user +$form['auth_preset']['userid'] = 0; +//* 0 = default groupid of the user, > 0 id must match with groupid of current user +$form['auth_preset']['groupid'] = 0; + +//** Permissions are: r = read, i = insert, u = update, d = delete +$form['auth_preset']['perm_user'] = 'riud'; +$form['auth_preset']['perm_group'] = 'riud'; +$form['auth_preset']['perm_other'] = ''; + +//* Languages +$language_list = array(); +$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); +while ($file = @readdir ($handle)) { + if ($file != '.' && $file != '..') { + if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { + $tmp = substr($file, 0, 2); + $language_list[$tmp] = $tmp; + } + } +} + +$form['tabs']['users'] = array ( + 'title' => 'Settings', + 'width' => 80, + 'template' => 'templates/user_settings.htm', + 'fields' => array ( + ################################## + # Beginn Datenbankfelder + ################################## + 'passwort' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'PASSWORD', + 'encryption'=> 'CRYPT', + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '15', + 'maxlength' => '100', + 'rows' => '', + 'cols' => '' + ), + 'language' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'language_is_empty'), + 1 => array ( 'type' => 'REGEX', + 'regex' => '/^[a-z]{2}$/i', + 'errmsg'=> 'language_regex_mismatch'), + ), + 'regex' => '', + 'errmsg' => '', + 'default' => '', + 'value' => $language_list, + 'separator' => '', + 'width' => '30', + 'maxlength' => '2', + 'rows' => '', + 'cols' => '' + ), + 'id_rsa' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT id_rsa FROM client WHERE {AUTHSQL}', + 'valuefield'=> 'id_rsa' + ), + 'value' => '' + ), + 'ssh_rsa' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT ssh_rsa FROM client WHERE {AUTHSQL}', + 'valuefield'=> 'ssh_rsa' + ), + 'value' => '' + ) + ################################## + # ENDE Datenbankfelder + ################################## + ) +); + + +?> diff --git a/interface/web/tools/templates/user_settings.htm b/interface/web/tools/templates/user_settings.htm index a3202adb7763350435f0155173f3915cc02579ec..b257fcc9dde7935f6583e6e6e13d600fcaadc591 100644 --- a/interface/web/tools/templates/user_settings.htm +++ b/interface/web/tools/templates/user_settings.htm @@ -1,44 +1,44 @@ -

-

- -
- -
-
-
- - -
-
-

{tmpl_var name='password_strength_txt'}

-
-

 

-
-
- - -
-
- - -
-
- - -
-
- - -
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+

{tmpl_var name='password_strength_txt'}

+
+

 

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + + +
+ + +
+
+ +
diff --git a/server/lib/classes/tpl_cache.inc.php b/server/lib/classes/tpl_cache.inc.php index 18e7d385f9112067ccc5974f57f44bd0c6295005..a3999466a703e1fec5f27930debeb0b3a6a386a2 100644 --- a/server/lib/classes/tpl_cache.inc.php +++ b/server/lib/classes/tpl_cache.inc.php @@ -1,186 +1,186 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: cache.php,v 1.1 2003/07/08 12:32:06 platinum Exp $ - -/** - * Class uses all of vlibTemplate's functionality but caches the template files. - * It creates an identical tree structure to your filesystem but with cached files. - * - * @author Kelvin Jones - * @since 22/02/2002 - * @package vLIB - * @access public - */ - -class tplc extends tpl { - -/*-----------------------------------------------------------------------------\ -| DO NOT TOUCH ANYTHING IN THIS CLASS, IT MAY NOT WORK OTHERWISE | -\-----------------------------------------------------------------------------*/ - - var $_cache = 1; // tells vlibTemplate that we're caching - var $_cachefile; // full path to current cache file (even if it doesn't yet exist) - var $_cacheexists; // has this file been cached before - var $_cachefilelocked; // is this file currently locked whilst writing - var $_cachefiledir; // dir of current cache file - var $_clearcache = 0; - - - /** - * FUNCTION: clearCache - * will unset a file, and set $this->_cacheexists to 0. - * - * @access public - * @return boolean - */ - function clearCache() { - $this->_clearcache = 1; - return true; - } - - /** - * FUNCTION: recache - * alias for clearCache(). - * - * @access public - * @return boolean - */ - function recache() { - return $this->clearCache(); - } - - /** - * FUNCTION: setCacheLifeTime - * sets the lifetime of the cached file - * - * @param int $int number of seconds to set lifetime to - * @access public - * @return boolean - */ - function setCacheLifeTime($int = null) { - if ($int == null || !is_int($int)) return false; - if ($int == 0) $int = 60; - if ($int == -1) $int = 157680000; // set to 5 yrs time - $this->OPTIONS['CACHE_LIFETIME'] = $int; - return true; - } - - /** - * FUNCTION: setCacheExtension - * sets the extention of the cache file - * - * @param str $str name of new cache extention - * @access public - * @return boolean - */ - function setCacheExtension($str = null) { - if ($str == null || !preg_match('/^[a-z0-9]+$/', strtolower($str))) return false; - $this->OPTIONS['CACHE_EXTENSION'] = strtolower($str); - return true; - } - - -/*----------------------------------------\ - Private Functions ------------------------------------------*/ - - /** - * FUNCTION: _checkCache - * checks if there's a cache, if there is then it will read the cache file as the template. - */ - function _checkCache ($tmplfile) { - $this->_cachefile = $this->_getFilename($tmplfile); - if ($this->_clearcache) { - if (file_exists($this->_cachefile)) unlink($this->_cachefile); - return false; - } - - if (file_exists($this->_cachefile)) { - $this->_cacheexists = 1; - - // if it's expired - if ((filemtime($this->_cachefile) + $this->OPTIONS['CACHE_LIFETIME']) < date ('U') - || filectime($this->_cachefile) < filemtime($tmplfile)) { - $this->_cacheexists = 0; - return false; // so that we know to recache - } - else { - return true; - } - - } else { - $this->_cacheexists = 0; - return false; - } - } - - - /** - * FUNCTION: _getFilename - * gets the full pathname for the cached file - * - */ - function _getFilename($tmplfile) { - return $this->OPTIONS['CACHE_DIRECTORY'].'/'.md5('vlibCachestaR'.realpath($tmplfile)).'.'.$this->OPTIONS['CACHE_EXTENSION']; - } - - /** - * FUNCTION: _createCache - * creates the cached file - * - */ - function _createCache($data) { - $cache_file = $this->_cachefile; - if(!$this->_prepareDirs($cache_file)) return false; // prepare all of the directories - - $f = fopen ($cache_file, "w"); - flock($f, 2); // set an EXclusive lock - if (!$f) vlibTemplateError::raiseError('VT_ERROR_NO_CACHE_WRITE',KILL,$cache_file); - fputs ($f, $data); // write the parsed string from vlibTemplate - flock($f, 3); // UNlock file - fclose ($f); - touch ($cache_file); - return true; - } - - /** - * FUNCTION: _prepareDirs - * prepares the directory structure - * - */ - function _prepareDirs($file) { - if (empty($file)) die('no filename'); //do error in future - $filepath = dirname($file); - if (is_dir($filepath)) return true; - - $dirs = preg_split('/[\\/]/', $filepath); - $currpath; - foreach ($dirs as $dir) { - $currpath .= $dir .'/'; - $type = @filetype($currpath); - - ($type=='link') and $type = 'dir'; - if ($type != 'dir' && $type != false && !empty($type)) { - vlibTemplateError::raiseError('VT_ERROR_WRONG_CACHE_TYPE',KILL,'directory: '.$currpath.', type: '.$type); - } - if ($type == 'dir') { - continue; - } - else { - $s = @mkdir($currpath, 0775); - if (!$s) vlibTemplateError::raiseError('VT_ERROR_CACHE_MKDIR_FAILURE',KILL,'directory: '.$currpath); - } - } - return true; - } - -} // -- end vlibTemplateCache class + | +// +----------------------------------------------------------------------+ +// +// $Id: cache.php,v 1.1 2003/07/08 12:32:06 platinum Exp $ + +/** + * Class uses all of vlibTemplate's functionality but caches the template files. + * It creates an identical tree structure to your filesystem but with cached files. + * + * @author Kelvin Jones + * @since 22/02/2002 + * @package vLIB + * @access public + */ + +class tplc extends tpl { + +/*-----------------------------------------------------------------------------\ +| DO NOT TOUCH ANYTHING IN THIS CLASS, IT MAY NOT WORK OTHERWISE | +\-----------------------------------------------------------------------------*/ + + var $_cache = 1; // tells vlibTemplate that we're caching + var $_cachefile; // full path to current cache file (even if it doesn't yet exist) + var $_cacheexists; // has this file been cached before + var $_cachefilelocked; // is this file currently locked whilst writing + var $_cachefiledir; // dir of current cache file + var $_clearcache = 0; + + + /** + * FUNCTION: clearCache + * will unset a file, and set $this->_cacheexists to 0. + * + * @access public + * @return boolean + */ + function clearCache() { + $this->_clearcache = 1; + return true; + } + + /** + * FUNCTION: recache + * alias for clearCache(). + * + * @access public + * @return boolean + */ + function recache() { + return $this->clearCache(); + } + + /** + * FUNCTION: setCacheLifeTime + * sets the lifetime of the cached file + * + * @param int $int number of seconds to set lifetime to + * @access public + * @return boolean + */ + function setCacheLifeTime($int = null) { + if ($int == null || !is_int($int)) return false; + if ($int == 0) $int = 60; + if ($int == -1) $int = 157680000; // set to 5 yrs time + $this->OPTIONS['CACHE_LIFETIME'] = $int; + return true; + } + + /** + * FUNCTION: setCacheExtension + * sets the extention of the cache file + * + * @param str $str name of new cache extention + * @access public + * @return boolean + */ + function setCacheExtension($str = null) { + if ($str == null || !preg_match('/^[a-z0-9]+$/', strtolower($str))) return false; + $this->OPTIONS['CACHE_EXTENSION'] = strtolower($str); + return true; + } + + +/*----------------------------------------\ + Private Functions +-----------------------------------------*/ + + /** + * FUNCTION: _checkCache + * checks if there's a cache, if there is then it will read the cache file as the template. + */ + function _checkCache ($tmplfile) { + $this->_cachefile = $this->_getFilename($tmplfile); + if ($this->_clearcache) { + if (file_exists($this->_cachefile)) unlink($this->_cachefile); + return false; + } + + if (file_exists($this->_cachefile)) { + $this->_cacheexists = 1; + + // if it's expired + if ((filemtime($this->_cachefile) + $this->OPTIONS['CACHE_LIFETIME']) < date ('U') + || filectime($this->_cachefile) < filemtime($tmplfile)) { + $this->_cacheexists = 0; + return false; // so that we know to recache + } + else { + return true; + } + + } else { + $this->_cacheexists = 0; + return false; + } + } + + + /** + * FUNCTION: _getFilename + * gets the full pathname for the cached file + * + */ + function _getFilename($tmplfile) { + return $this->OPTIONS['CACHE_DIRECTORY'].'/'.md5('vlibCachestaR'.realpath($tmplfile)).'.'.$this->OPTIONS['CACHE_EXTENSION']; + } + + /** + * FUNCTION: _createCache + * creates the cached file + * + */ + function _createCache($data) { + $cache_file = $this->_cachefile; + if(!$this->_prepareDirs($cache_file)) return false; // prepare all of the directories + + $f = fopen ($cache_file, "w"); + flock($f, 2); // set an EXclusive lock + if (!$f) vlibTemplateError::raiseError('VT_ERROR_NO_CACHE_WRITE',KILL,$cache_file); + fputs ($f, $data); // write the parsed string from vlibTemplate + flock($f, 3); // UNlock file + fclose ($f); + touch ($cache_file); + return true; + } + + /** + * FUNCTION: _prepareDirs + * prepares the directory structure + * + */ + function _prepareDirs($file) { + if (empty($file)) die('no filename'); //do error in future + $filepath = dirname($file); + if (is_dir($filepath)) return true; + + $dirs = preg_split('/[\\/]/', $filepath); + $currpath; + foreach ($dirs as $dir) { + $currpath .= $dir .'/'; + $type = @filetype($currpath); + + ($type=='link') and $type = 'dir'; + if ($type != 'dir' && $type != false && !empty($type)) { + vlibTemplateError::raiseError('VT_ERROR_WRONG_CACHE_TYPE',KILL,'directory: '.$currpath.', type: '.$type); + } + if ($type == 'dir') { + continue; + } + else { + $s = @mkdir($currpath, 0775); + if (!$s) vlibTemplateError::raiseError('VT_ERROR_CACHE_MKDIR_FAILURE',KILL,'directory: '.$currpath); + } + } + return true; + } + +} // -- end vlibTemplateCache class ?> \ No newline at end of file diff --git a/server/lib/classes/tpl_error.inc.php b/server/lib/classes/tpl_error.inc.php index 2f139882b91ffd21ea3ca3d6b10fb3d61fec5efb..d15b80a2ca183e2c50c4caadf8cfa9edeb445412 100644 --- a/server/lib/classes/tpl_error.inc.php +++ b/server/lib/classes/tpl_error.inc.php @@ -1,92 +1,92 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: error.php,v 1.1 2003/07/08 12:32:06 platinum Exp $ - -define('FATAL', E_USER_ERROR); -define('WARNING', E_USER_WARNING); -define('NOTICE', E_USER_NOTICE); -define('KILL', -1); // used for killing inside parsing. - -/** - * Class is used by vlibTemplate. - * It handles all of the error reporting for vlibTemplate. - * - * @author Kelvin Jones - * @since 06/03/2002 - * @package vLIB - * @access private - */ - -class vlibTemplateError { - -/*-----------------------------------------------------------------------------\ -| DO NOT TOUCH ANYTHING IN THIS CLASS IT MAY NOT WORK OTHERWISE | -\-----------------------------------------------------------------------------*/ - - function raiseError ($code, $level = null, $extra=null) { - if (!($level & error_reporting())&& $level != KILL) return; // binary AND checks for reporting level - - $error_codes = array( - 'VT_ERROR_NOFILE' => 'vlibTemplate Error: Template ('.$extra.') file not found.', - 'VT_ERROR_PARSE' => 'vlibTemplate Error: Parse error!
To debug this file, use vlibTemplateDebug instead of vlibTemplate in the class instantiation(i.e. new vlibTemplateDebug).', - 'VT_NOTICE_INVALID_TAG' => 'vlibTemplate Notice: Invalid tag ('.$extra.').', - 'VT_ERROR_INVALID_TAG' => 'vlibTemplate Error: Invalid tag ('.$extra.'). To disable this you must turn of the STRICT option.', - 'VT_NOTICE_INVALID_ATT' => 'vlibTemplate Notice: Invalid attribute ('.$extra.').', - 'VT_WARNING_INVALID_ARR' => 'vlibTemplate Warning: Invalid loop structure passed to vlibTemplate::setLoop() (loop name: '.$extra.').', - 'VT_ERROR_INVALID_ERROR_CODE' => 'vlibTemplate Error: Invalid error raised.', - 'VT_ERROR_WRONG_NO_PARAMS' => 'vlibTemplate Warning: Wrond parameter count passed to '.$extra.'.', - 'VT_ERROR_UNKNOWN_VAR' => 'vlibTemplate Error: template var not found.', - 'VT_ERROR_NO_CACHE_WRITE' => 'vlibTemplate Error: unable to write to cache file ('.$extra.').', - 'VT_ERROR_WRONG_CACHE_TYPE' => 'vlibTemplate Error: non-directory file found in cache root with same name as directory ('.$extra.').', - 'VT_ERROR_CACHE_MKDIR_FAILURE' => 'vlibTemplate Error: failed to create directory in cache root ('.$extra.').', - 'VT_WARNING_NOT_CACHE_OBJ' => 'vlibTemplate Warning: called a vlibTemplateCache function ('.$extra.') without instantiating the vlibTemplateCache class.', - 'VT_WARNING_LOOP_NOT_SET' => 'vlibTemplate Warning: called vlibTemplate::addRow() or vlibTemplate::addLoop() with an invalid loop name.', - 'VT_WARNING_INVALID_RESOURCE' => 'vlibTemplate Warning: Invalid resource type passed to vlibTemplate::setDbLoop() for Db "'.$extra.'".', - 'VT_WARNING_INVALID_LOOP_DB' => 'vlibTemplate Warning: Invalid Db type passed to vlibTemplate::setDbLoop(), "'.$extra.'" not currently available.', - 'VT_WARNING_INVALID_IF_OP' => 'vlibTemplate Warning: The Operator "'.$extra.'" is not supported by vlibTemplate.' - ); - - $error_levels = array( - 'VT_ERROR_NOFILE' => FATAL, - 'VT_ERROR_PARSE' => FATAL, - 'VT_NOTICE_INVALID_TAG' => NOTICE, - 'VT_ERROR_INVALID_TAG' => FATAL, - 'VT_NOTICE_INVALID_ATT' => NOTICE, - 'VT_WARNING_INVALID_ARR' => WARNING, - 'VT_ERROR_INVALID_ERROR_CODE' => FATAL, - 'VT_ERROR_WRONG_NO_PARAMS' => WARNING, - 'VT_ERROR_UNKNOWN_VAR' => WARNING, - 'VT_ERROR_NO_CACHE_WRITE' => KILL, - 'VT_ERROR_WRONG_CACHE_TYPE' => KILL, - 'VT_ERROR_CACHE_MKDIR_FAILURE' => KILL, - 'VT_WARNING_NOT_CACHE_OBJ' => WARNING, - 'VT_WARNING_LOOP_NOT_SET' => WARNING, - 'VT_WARNING_INVALID_RESOURCE' => WARNING, - 'VT_WARNING_INVALID_LOOP_DB' => WARNING, - 'VT_WARNING_INVALID_IF_OP' => WARNING - ); - - ($level === null) and $level = $error_levels[$code]; - if ($level == KILL) { - die ($error_codes[$code]); - } - - if ($msg = $error_codes[$code]) { - trigger_error($msg, $level); - } else { - $level = $error_levels['VT_ERROR_INVALID_ERROR_CODE']; - $msg = $error_codes['VT_ERROR_INVALID_ERROR_CODE']; - trigger_error($msg, $level); - } - return; - } -} + | +// +----------------------------------------------------------------------+ +// +// $Id: error.php,v 1.1 2003/07/08 12:32:06 platinum Exp $ + +define('FATAL', E_USER_ERROR); +define('WARNING', E_USER_WARNING); +define('NOTICE', E_USER_NOTICE); +define('KILL', -1); // used for killing inside parsing. + +/** + * Class is used by vlibTemplate. + * It handles all of the error reporting for vlibTemplate. + * + * @author Kelvin Jones + * @since 06/03/2002 + * @package vLIB + * @access private + */ + +class vlibTemplateError { + +/*-----------------------------------------------------------------------------\ +| DO NOT TOUCH ANYTHING IN THIS CLASS IT MAY NOT WORK OTHERWISE | +\-----------------------------------------------------------------------------*/ + + function raiseError ($code, $level = null, $extra=null) { + if (!($level & error_reporting())&& $level != KILL) return; // binary AND checks for reporting level + + $error_codes = array( + 'VT_ERROR_NOFILE' => 'vlibTemplate Error: Template ('.$extra.') file not found.', + 'VT_ERROR_PARSE' => 'vlibTemplate Error: Parse error!
To debug this file, use vlibTemplateDebug instead of vlibTemplate in the class instantiation(i.e. new vlibTemplateDebug).', + 'VT_NOTICE_INVALID_TAG' => 'vlibTemplate Notice: Invalid tag ('.$extra.').', + 'VT_ERROR_INVALID_TAG' => 'vlibTemplate Error: Invalid tag ('.$extra.'). To disable this you must turn of the STRICT option.', + 'VT_NOTICE_INVALID_ATT' => 'vlibTemplate Notice: Invalid attribute ('.$extra.').', + 'VT_WARNING_INVALID_ARR' => 'vlibTemplate Warning: Invalid loop structure passed to vlibTemplate::setLoop() (loop name: '.$extra.').', + 'VT_ERROR_INVALID_ERROR_CODE' => 'vlibTemplate Error: Invalid error raised.', + 'VT_ERROR_WRONG_NO_PARAMS' => 'vlibTemplate Warning: Wrond parameter count passed to '.$extra.'.', + 'VT_ERROR_UNKNOWN_VAR' => 'vlibTemplate Error: template var not found.', + 'VT_ERROR_NO_CACHE_WRITE' => 'vlibTemplate Error: unable to write to cache file ('.$extra.').', + 'VT_ERROR_WRONG_CACHE_TYPE' => 'vlibTemplate Error: non-directory file found in cache root with same name as directory ('.$extra.').', + 'VT_ERROR_CACHE_MKDIR_FAILURE' => 'vlibTemplate Error: failed to create directory in cache root ('.$extra.').', + 'VT_WARNING_NOT_CACHE_OBJ' => 'vlibTemplate Warning: called a vlibTemplateCache function ('.$extra.') without instantiating the vlibTemplateCache class.', + 'VT_WARNING_LOOP_NOT_SET' => 'vlibTemplate Warning: called vlibTemplate::addRow() or vlibTemplate::addLoop() with an invalid loop name.', + 'VT_WARNING_INVALID_RESOURCE' => 'vlibTemplate Warning: Invalid resource type passed to vlibTemplate::setDbLoop() for Db "'.$extra.'".', + 'VT_WARNING_INVALID_LOOP_DB' => 'vlibTemplate Warning: Invalid Db type passed to vlibTemplate::setDbLoop(), "'.$extra.'" not currently available.', + 'VT_WARNING_INVALID_IF_OP' => 'vlibTemplate Warning: The Operator "'.$extra.'" is not supported by vlibTemplate.' + ); + + $error_levels = array( + 'VT_ERROR_NOFILE' => FATAL, + 'VT_ERROR_PARSE' => FATAL, + 'VT_NOTICE_INVALID_TAG' => NOTICE, + 'VT_ERROR_INVALID_TAG' => FATAL, + 'VT_NOTICE_INVALID_ATT' => NOTICE, + 'VT_WARNING_INVALID_ARR' => WARNING, + 'VT_ERROR_INVALID_ERROR_CODE' => FATAL, + 'VT_ERROR_WRONG_NO_PARAMS' => WARNING, + 'VT_ERROR_UNKNOWN_VAR' => WARNING, + 'VT_ERROR_NO_CACHE_WRITE' => KILL, + 'VT_ERROR_WRONG_CACHE_TYPE' => KILL, + 'VT_ERROR_CACHE_MKDIR_FAILURE' => KILL, + 'VT_WARNING_NOT_CACHE_OBJ' => WARNING, + 'VT_WARNING_LOOP_NOT_SET' => WARNING, + 'VT_WARNING_INVALID_RESOURCE' => WARNING, + 'VT_WARNING_INVALID_LOOP_DB' => WARNING, + 'VT_WARNING_INVALID_IF_OP' => WARNING + ); + + ($level === null) and $level = $error_levels[$code]; + if ($level == KILL) { + die ($error_codes[$code]); + } + + if ($msg = $error_codes[$code]) { + trigger_error($msg, $level); + } else { + $level = $error_levels['VT_ERROR_INVALID_ERROR_CODE']; + $msg = $error_codes['VT_ERROR_INVALID_ERROR_CODE']; + trigger_error($msg, $level); + } + return; + } +} ?> \ No newline at end of file diff --git a/server/mods-available/mail_module.inc.php b/server/mods-available/mail_module.inc.php index 1b7f9575ba7fdfb0c5859f31b1ea2ea3ac36c975..23e0b8d7df713e01fdb9aec2de0f26e7145198b2 100644 --- a/server/mods-available/mail_module.inc.php +++ b/server/mods-available/mail_module.inc.php @@ -1,162 +1,162 @@ -plugins->announceEvents($this->module_name,$this->actions_available); - - /* - As we want to get notified of any changes on several database tables, - we register for them. - - The following function registers the function "functionname" - to be executed when a record for the table "dbtable" is - processed in the sys_datalog. "classname" is the name of the - class that contains the function functionname. - */ - - $app->modules->registerTableHook('mail_access','mail_module','process'); - $app->modules->registerTableHook('mail_domain','mail_module','process'); - $app->modules->registerTableHook('mail_forwarding','mail_module','process'); - $app->modules->registerTableHook('mail_transport','mail_module','process'); - $app->modules->registerTableHook('mail_user','mail_module','process'); - $app->modules->registerTableHook('mail_get','mail_module','process'); - $app->modules->registerTableHook('mail_content_filter','mail_module','process'); - $app->modules->registerTableHook('mail_mailinglist','mail_module','process'); - - } - - /* - This function is called when a change in one of the registered tables is detected. - The function then raises the events for the plugins. - */ - - function process($tablename,$action,$data) { - global $app; - - switch ($tablename) { - case 'mail_access': - if($action == 'i') $app->plugins->raiseEvent('mail_access_insert',$data); - if($action == 'u') $app->plugins->raiseEvent('mail_access_update',$data); - if($action == 'd') $app->plugins->raiseEvent('mail_access_delete',$data); - break; - case 'mail_domain': - if($action == 'i') $app->plugins->raiseEvent('mail_domain_insert',$data); - if($action == 'u') $app->plugins->raiseEvent('mail_domain_update',$data); - if($action == 'd') $app->plugins->raiseEvent('mail_domain_delete',$data); - break; - case 'mail_forwarding': - if($action == 'i') $app->plugins->raiseEvent('mail_forwarding_insert',$data); - if($action == 'u') $app->plugins->raiseEvent('mail_forwarding_update',$data); - if($action == 'd') $app->plugins->raiseEvent('mail_forwarding_delete',$data); - break; - case 'mail_transport': - if($action == 'i') $app->plugins->raiseEvent('mail_transport_insert',$data); - if($action == 'u') $app->plugins->raiseEvent('mail_transport_update',$data); - if($action == 'd') $app->plugins->raiseEvent('mail_transport_delete',$data); - break; - case 'mail_user': - if($action == 'i') $app->plugins->raiseEvent('mail_user_insert',$data); - if($action == 'u') $app->plugins->raiseEvent('mail_user_update',$data); - if($action == 'd') $app->plugins->raiseEvent('mail_user_delete',$data); - break; - case 'mail_get': - if($action == 'i') $app->plugins->raiseEvent('mail_get_insert',$data); - if($action == 'u') $app->plugins->raiseEvent('mail_get_update',$data); - if($action == 'd') $app->plugins->raiseEvent('mail_get_delete',$data); - break; - case 'mail_content_filter': - if($action == 'i') $app->plugins->raiseEvent('mail_content_filter_insert',$data); - if($action == 'u') $app->plugins->raiseEvent('mail_content_filter_update',$data); - if($action == 'd') $app->plugins->raiseEvent('mail_content_filter_delete',$data); - break; - case 'mail_mailinglist': - if($action == 'i') $app->plugins->raiseEvent('mail_mailinglist_insert',$data); - if($action == 'u') $app->plugins->raiseEvent('mail_mailinglist_update',$data); - if($action == 'd') $app->plugins->raiseEvent('mail_mailinglist_delete',$data); - break; - } // end switch - } // end function - -} // end class - +plugins->announceEvents($this->module_name,$this->actions_available); + + /* + As we want to get notified of any changes on several database tables, + we register for them. + + The following function registers the function "functionname" + to be executed when a record for the table "dbtable" is + processed in the sys_datalog. "classname" is the name of the + class that contains the function functionname. + */ + + $app->modules->registerTableHook('mail_access','mail_module','process'); + $app->modules->registerTableHook('mail_domain','mail_module','process'); + $app->modules->registerTableHook('mail_forwarding','mail_module','process'); + $app->modules->registerTableHook('mail_transport','mail_module','process'); + $app->modules->registerTableHook('mail_user','mail_module','process'); + $app->modules->registerTableHook('mail_get','mail_module','process'); + $app->modules->registerTableHook('mail_content_filter','mail_module','process'); + $app->modules->registerTableHook('mail_mailinglist','mail_module','process'); + + } + + /* + This function is called when a change in one of the registered tables is detected. + The function then raises the events for the plugins. + */ + + function process($tablename,$action,$data) { + global $app; + + switch ($tablename) { + case 'mail_access': + if($action == 'i') $app->plugins->raiseEvent('mail_access_insert',$data); + if($action == 'u') $app->plugins->raiseEvent('mail_access_update',$data); + if($action == 'd') $app->plugins->raiseEvent('mail_access_delete',$data); + break; + case 'mail_domain': + if($action == 'i') $app->plugins->raiseEvent('mail_domain_insert',$data); + if($action == 'u') $app->plugins->raiseEvent('mail_domain_update',$data); + if($action == 'd') $app->plugins->raiseEvent('mail_domain_delete',$data); + break; + case 'mail_forwarding': + if($action == 'i') $app->plugins->raiseEvent('mail_forwarding_insert',$data); + if($action == 'u') $app->plugins->raiseEvent('mail_forwarding_update',$data); + if($action == 'd') $app->plugins->raiseEvent('mail_forwarding_delete',$data); + break; + case 'mail_transport': + if($action == 'i') $app->plugins->raiseEvent('mail_transport_insert',$data); + if($action == 'u') $app->plugins->raiseEvent('mail_transport_update',$data); + if($action == 'd') $app->plugins->raiseEvent('mail_transport_delete',$data); + break; + case 'mail_user': + if($action == 'i') $app->plugins->raiseEvent('mail_user_insert',$data); + if($action == 'u') $app->plugins->raiseEvent('mail_user_update',$data); + if($action == 'd') $app->plugins->raiseEvent('mail_user_delete',$data); + break; + case 'mail_get': + if($action == 'i') $app->plugins->raiseEvent('mail_get_insert',$data); + if($action == 'u') $app->plugins->raiseEvent('mail_get_update',$data); + if($action == 'd') $app->plugins->raiseEvent('mail_get_delete',$data); + break; + case 'mail_content_filter': + if($action == 'i') $app->plugins->raiseEvent('mail_content_filter_insert',$data); + if($action == 'u') $app->plugins->raiseEvent('mail_content_filter_update',$data); + if($action == 'd') $app->plugins->raiseEvent('mail_content_filter_delete',$data); + break; + case 'mail_mailinglist': + if($action == 'i') $app->plugins->raiseEvent('mail_mailinglist_insert',$data); + if($action == 'u') $app->plugins->raiseEvent('mail_mailinglist_update',$data); + if($action == 'd') $app->plugins->raiseEvent('mail_mailinglist_delete',$data); + break; + } // end switch + } // end function + +} // end class + ?> \ No newline at end of file diff --git a/server/mods-available/remoteaction_core_module.inc.php b/server/mods-available/remoteaction_core_module.inc.php index 93752334405fe4a83e961fc2b5fbc2794f08c430..f24fadde5ee12db3faa5590ef58868e7c3307b42 100644 --- a/server/mods-available/remoteaction_core_module.inc.php +++ b/server/mods-available/remoteaction_core_module.inc.php @@ -1,204 +1,204 @@ -_execActions(); - } - - /* - This function is called when a change in one of the registered tables is detected. - The function then raises the events for the plugins. - */ - function process($tablename, $action, $data) { - // not needed - } // end function - - private function _actionDone($id, $state) { - /* - * First set the state - */ - global $app; - $sql = "UPDATE sys_remoteaction " . - "SET action_state = '" . $app->dbmaster->quote($state) . "' " . - "WHERE action_id = " . intval($id); - $app->dbmaster->query($sql); - - /* - * Then save the maxid for the next time... - */ - $fp = fopen(dirname(__FILE__) . "/../lib/remote_action.inc.php", 'wb'); - $content = '"; - fwrite($fp, $content); - fclose($fp); - } - - - /** - * This method searches for scheduled actions and exec then - */ - private function _execActions() { - global $app; - global $conf; - - /* the id of the server as int */ - $server_id = intval($conf["server_id"]); - - /* - * First we (till and i, oliver) thought, it was enough to write - * "select from where action_status = 'pending'" and then execute this actions. - * But it is not! - * If a hacker can hack into a server, she can change the valus of action_status - * and so re-exec a action, executed some days bevore. So she can (for example) - * stop a service, a admin stopped some days before! To avoid this, we ignore - * the status (it is only for the interface to show) and use our own maxid - */ - include_once (dirname(__FILE__) . "/../lib/remote_action.inc.php"); - - /* - * Get all actions this server should execute - */ - $sql = "SELECT action_id, action_type, action_param " . - "FROM sys_remoteaction " . - "WHERE server_id = " . $server_id . " ". - " AND action_id > " . intval($maxid_remote_action) . " ". - "ORDER BY action_id"; - $actions = $app->dbmaster->queryAllRecords($sql); - - /* - * process all actions - */ - if(is_array($actions)) { - foreach ($actions as $action) { - if ($action['action_type'] == 'os_update') { - /* do the update */ - $this->_doOsUpdate($action); - /* this action takes so much time, - * we stop executing the actions not to waste more time */ - return; - } - if ($action['action_type'] == 'ispc_update') { - /* do the update */ - $this->_doIspCUpdate($action); - /* this action takes so much time, - * we stop executing the actions not to waste more time */ - return; - } - } - } - } - - private function _doOsUpdate($action) { - /* - * Do the update - */ - //TODO : change this when distribution information has been integrated into server record - if(file_exists('/etc/gentoo-release')) { - exec("glsa-check -f --nocolor affected"); - } - else { - exec("aptitude update"); - exec("aptitude upgrade -y"); - } - - /* - * All well done! - */ - $this->_actionDone($action['action_id'], 'ok'); - } - - private function _doIspCUpdate($action) { - - // Ensure that this code is not executed twice as this would cause a loop in case of a failure - $this->_actionDone($action['action_id'], 'ok'); - - /* - * Get the version-number of the newest version - */ - $new_version = @file_get_contents('http://www.ispconfig.org/downloads/ispconfig3_version.txt'); - $new_version = trim($new_version); - - /* - * Do the update - */ - - /* jump into the temporary dir */ - $oldDir = getcwd(); - chdir("/tmp"); - - /* delete the old files (if there are any...) */ - exec("rm /tmp/ISPConfig-" . $new_version . ".tar.gz"); - exec("rm /tmp/ispconfig3_install -R"); - - /* get the newest version */ - exec("wget http://www.ispconfig.org/downloads/ISPConfig-" . $new_version . ".tar.gz"); - - /* extract the files */ - exec("tar xvfz ISPConfig-" . $new_version . ".tar.gz"); - - /* - * Initialize the automated update - * (the update is then done next start of server.sh - */ - chdir("/tmp/ispconfig3_install/install"); - exec("touch autoupdate"); - - /* - * do some clean-up - */ - exec("rm /tmp/ISPConfig-" . $new_version . ".tar.gz"); - - /* - * go back to the "old path" - */ - chdir($oldDir); - - /* - * All well done! - */ - //$this->_actionDone($action['action_id'], 'ok'); - } -} +_execActions(); + } + + /* + This function is called when a change in one of the registered tables is detected. + The function then raises the events for the plugins. + */ + function process($tablename, $action, $data) { + // not needed + } // end function + + private function _actionDone($id, $state) { + /* + * First set the state + */ + global $app; + $sql = "UPDATE sys_remoteaction " . + "SET action_state = '" . $app->dbmaster->quote($state) . "' " . + "WHERE action_id = " . intval($id); + $app->dbmaster->query($sql); + + /* + * Then save the maxid for the next time... + */ + $fp = fopen(dirname(__FILE__) . "/../lib/remote_action.inc.php", 'wb'); + $content = '"; + fwrite($fp, $content); + fclose($fp); + } + + + /** + * This method searches for scheduled actions and exec then + */ + private function _execActions() { + global $app; + global $conf; + + /* the id of the server as int */ + $server_id = intval($conf["server_id"]); + + /* + * First we (till and i, oliver) thought, it was enough to write + * "select from where action_status = 'pending'" and then execute this actions. + * But it is not! + * If a hacker can hack into a server, she can change the valus of action_status + * and so re-exec a action, executed some days bevore. So she can (for example) + * stop a service, a admin stopped some days before! To avoid this, we ignore + * the status (it is only for the interface to show) and use our own maxid + */ + include_once (dirname(__FILE__) . "/../lib/remote_action.inc.php"); + + /* + * Get all actions this server should execute + */ + $sql = "SELECT action_id, action_type, action_param " . + "FROM sys_remoteaction " . + "WHERE server_id = " . $server_id . " ". + " AND action_id > " . intval($maxid_remote_action) . " ". + "ORDER BY action_id"; + $actions = $app->dbmaster->queryAllRecords($sql); + + /* + * process all actions + */ + if(is_array($actions)) { + foreach ($actions as $action) { + if ($action['action_type'] == 'os_update') { + /* do the update */ + $this->_doOsUpdate($action); + /* this action takes so much time, + * we stop executing the actions not to waste more time */ + return; + } + if ($action['action_type'] == 'ispc_update') { + /* do the update */ + $this->_doIspCUpdate($action); + /* this action takes so much time, + * we stop executing the actions not to waste more time */ + return; + } + } + } + } + + private function _doOsUpdate($action) { + /* + * Do the update + */ + //TODO : change this when distribution information has been integrated into server record + if(file_exists('/etc/gentoo-release')) { + exec("glsa-check -f --nocolor affected"); + } + else { + exec("aptitude update"); + exec("aptitude upgrade -y"); + } + + /* + * All well done! + */ + $this->_actionDone($action['action_id'], 'ok'); + } + + private function _doIspCUpdate($action) { + + // Ensure that this code is not executed twice as this would cause a loop in case of a failure + $this->_actionDone($action['action_id'], 'ok'); + + /* + * Get the version-number of the newest version + */ + $new_version = @file_get_contents('http://www.ispconfig.org/downloads/ispconfig3_version.txt'); + $new_version = trim($new_version); + + /* + * Do the update + */ + + /* jump into the temporary dir */ + $oldDir = getcwd(); + chdir("/tmp"); + + /* delete the old files (if there are any...) */ + exec("rm /tmp/ISPConfig-" . $new_version . ".tar.gz"); + exec("rm /tmp/ispconfig3_install -R"); + + /* get the newest version */ + exec("wget http://www.ispconfig.org/downloads/ISPConfig-" . $new_version . ".tar.gz"); + + /* extract the files */ + exec("tar xvfz ISPConfig-" . $new_version . ".tar.gz"); + + /* + * Initialize the automated update + * (the update is then done next start of server.sh + */ + chdir("/tmp/ispconfig3_install/install"); + exec("touch autoupdate"); + + /* + * do some clean-up + */ + exec("rm /tmp/ISPConfig-" . $new_version . ".tar.gz"); + + /* + * go back to the "old path" + */ + chdir($oldDir); + + /* + * All well done! + */ + //$this->_actionDone($action['action_id'], 'ok'); + } +} ?> \ No newline at end of file diff --git a/server/plugins-available/mailman_plugin.inc.php b/server/plugins-available/mailman_plugin.inc.php index 5e13ba3bfba930c825b129014eae2a0716c69ecd..823bf85d5ebb8c7094a0b45f3b6e4abe0a7a22a7 100644 --- a/server/plugins-available/mailman_plugin.inc.php +++ b/server/plugins-available/mailman_plugin.inc.php @@ -1,155 +1,155 @@ -plugins->registerEvent('mail_mailinglist_insert','mailman_plugin','insert'); - $app->plugins->registerEvent('mail_mailinglist_update','mailman_plugin','update'); - $app->plugins->registerEvent('mail_mailinglist_delete','mailman_plugin','delete'); - - - - } - - function insert($event_name,$data) { - global $app, $conf; - - $this->update_config(); - - exec("/usr/lib/mailman/bin/newlist -u ".$data["new"]["domain"]." -e ".$data["new"]["domain"]." ".$data["new"]["listname"]." ".$data["new"]["email"]." ".$data["new"]["password"].""); - - exec($conf['init_scripts'] . '/' . 'mailman reload &> /dev/null'); - - $app->db->query("UPDATE mail_mailinglist SET password = '' WHERE mailinglist_id = ".$data["new"]['mailinglist_id']); - - } - - // The purpose of this plugin is to rewrite the main.cf file - function update($event_name,$data) { - global $app, $conf; - - exec("/usr/lib/mailman/bin/change_pw -l ".$data["new"]["listname"]." -p ".$data["new"]["password"].""); - - exec($conf['init_scripts'] . '/' . 'mailman reload &> /dev/null'); - - $app->db->query("UPDATE mail_mailinglist SET password = '' WHERE mailinglist_id = ".$data["new"]['mailinglist_id']); - - } - - function delete($event_name,$data) { - global $app, $conf; - - $this->update_config(); - - exec("/usr/lib/mailman/bin/rmlist -a ".$data["old"]["listname"]); - - exec($conf['init_scripts'] . '/' . 'mailman reload &> /dev/null'); - - } - - function update_config() { - global $app, $conf; - - copy($this->mailman_config_dir.'mm_cfg.py',$this->mailman_config_dir.'mm_cfg.py'); - - // load the server configuration options - $app->uses('getconf'); - $server_config = $app->getconf->get_server_config($conf['server_id'], 'server'); - - // load files - $content = file_get_contents($conf["rootpath"]."/conf/mm_cfg.py.master"); - $old_file = file_get_contents($this->mailman_config_dir."/mm_cfg.py"); - - $old_options = array(); - $lines = explode("\n", $old_file); - foreach ($lines as $line) - { - if (strlen($line) && substr($line, 0, 1) != '#') - { - list($key, $value) = explode("=", $line); - if (!empty($value)) - { - $key = rtrim($key); - $old_options[$key] = trim($value); - } - } - } - - // create virtual_domains list - $domainAll = $app->db->queryAllRecords("SELECT domain FROM mail_mailinglist GROUP BY domain"); - $virtual_domains = ''; - foreach($domainAll as $domain) - { - if ($domainAll[0]['domain'] == $domain['domain']) - $virtual_domains .= "'".$domain['domain']."'"; - else - $virtual_domains .= ", '".$domain['domain']."'"; - } - - $content = str_replace('{hostname}', $server_config['hostname'], $content); - $content = str_replace('{default_language}', $old_options['DEFAULT_SERVER_LANGUAGE'], $content); - $content = str_replace('{virtual_domains}', $virtual_domains, $content); - - file_put_contents($this->mailman_config_dir."/mm_cfg.py", $content); - } - -} // end class - -?> +plugins->registerEvent('mail_mailinglist_insert','mailman_plugin','insert'); + $app->plugins->registerEvent('mail_mailinglist_update','mailman_plugin','update'); + $app->plugins->registerEvent('mail_mailinglist_delete','mailman_plugin','delete'); + + + + } + + function insert($event_name,$data) { + global $app, $conf; + + $this->update_config(); + + exec("/usr/lib/mailman/bin/newlist -u ".$data["new"]["domain"]." -e ".$data["new"]["domain"]." ".$data["new"]["listname"]." ".$data["new"]["email"]." ".$data["new"]["password"].""); + + exec($conf['init_scripts'] . '/' . 'mailman reload &> /dev/null'); + + $app->db->query("UPDATE mail_mailinglist SET password = '' WHERE mailinglist_id = ".$data["new"]['mailinglist_id']); + + } + + // The purpose of this plugin is to rewrite the main.cf file + function update($event_name,$data) { + global $app, $conf; + + exec("/usr/lib/mailman/bin/change_pw -l ".$data["new"]["listname"]." -p ".$data["new"]["password"].""); + + exec($conf['init_scripts'] . '/' . 'mailman reload &> /dev/null'); + + $app->db->query("UPDATE mail_mailinglist SET password = '' WHERE mailinglist_id = ".$data["new"]['mailinglist_id']); + + } + + function delete($event_name,$data) { + global $app, $conf; + + $this->update_config(); + + exec("/usr/lib/mailman/bin/rmlist -a ".$data["old"]["listname"]); + + exec($conf['init_scripts'] . '/' . 'mailman reload &> /dev/null'); + + } + + function update_config() { + global $app, $conf; + + copy($this->mailman_config_dir.'mm_cfg.py',$this->mailman_config_dir.'mm_cfg.py'); + + // load the server configuration options + $app->uses('getconf'); + $server_config = $app->getconf->get_server_config($conf['server_id'], 'server'); + + // load files + $content = file_get_contents($conf["rootpath"]."/conf/mm_cfg.py.master"); + $old_file = file_get_contents($this->mailman_config_dir."/mm_cfg.py"); + + $old_options = array(); + $lines = explode("\n", $old_file); + foreach ($lines as $line) + { + if (strlen($line) && substr($line, 0, 1) != '#') + { + list($key, $value) = explode("=", $line); + if (!empty($value)) + { + $key = rtrim($key); + $old_options[$key] = trim($value); + } + } + } + + // create virtual_domains list + $domainAll = $app->db->queryAllRecords("SELECT domain FROM mail_mailinglist GROUP BY domain"); + $virtual_domains = ''; + foreach($domainAll as $domain) + { + if ($domainAll[0]['domain'] == $domain['domain']) + $virtual_domains .= "'".$domain['domain']."'"; + else + $virtual_domains .= ", '".$domain['domain']."'"; + } + + $content = str_replace('{hostname}', $server_config['hostname'], $content); + $content = str_replace('{default_language}', $old_options['DEFAULT_SERVER_LANGUAGE'], $content); + $content = str_replace('{virtual_domains}', $virtual_domains, $content); + + file_put_contents($this->mailman_config_dir."/mm_cfg.py", $content); + } + +} // end class + +?>
 
{tmpl_var name="domain_id"}{tmpl_var name="active"}{tmpl_var name="sys_groupid"}{tmpl_var name="server_id"}{tmpl_var name="domain"}{tmpl_var name="domain_id"}{tmpl_var name="active"}{tmpl_var name="sys_groupid"}{tmpl_var name="server_id"}{tmpl_var name="domain"}
{tmpl_var name='delete_txt'} diff --git a/interface/web/sites/templates/web_domain_redirect.htm b/interface/web/sites/templates/web_domain_redirect.htm index 89e6fab80aae282bfb7a792cdddb058c57afea56..8f07bef02a2e227e8c31dd215bc84bf10418df08 100644 --- a/interface/web/sites/templates/web_domain_redirect.htm +++ b/interface/web/sites/templates/web_domain_redirect.htm @@ -1,28 +1,28 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/sites/templates/web_subdomain_edit.htm b/interface/web/sites/templates/web_subdomain_edit.htm index 2206cf7bd56de5bd2263aff9851920d761a755dc..c0bc0f7ed266c5fe650a74b427b43066dad9d8c9 100644 --- a/interface/web/sites/templates/web_subdomain_edit.htm +++ b/interface/web/sites/templates/web_subdomain_edit.htm @@ -1,42 +1,42 @@ -

-

- -
- -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/sites/templates/webdav_user_edit.htm b/interface/web/sites/templates/webdav_user_edit.htm index 37d46a8ed9b15a6040662c9171d2d066f6ee15e1..4b6b4edfda5d783c679aeab6c8bc3072f49637de 100644 --- a/interface/web/sites/templates/webdav_user_edit.htm +++ b/interface/web/sites/templates/webdav_user_edit.htm @@ -1,58 +1,58 @@ -

-

- -
- -
-
-
- - - - - - - - -
-
- -
{tmpl_var name='username_prefix'}
- disabled="disabled"/> -
-
- - -
-
-

{tmpl_var name='password_strength_txt'}

-
-

 

-
-
-

{tmpl_var name='active_txt'}

-
- {tmpl_var name='active'} -
-
-
- -
webdav/
- disabled="disabled"/> -
- -
- - - -
- - -
-
- -
+

+

+ +
+ +
+
+
+ + + + + + + + +
+
+ +
{tmpl_var name='username_prefix'}
+ disabled="disabled"/> +
+
+ + +
+
+

{tmpl_var name='password_strength_txt'}

+
+

 

+
+
+

{tmpl_var name='active_txt'}

+
+ {tmpl_var name='active'} +
+
+
+ +
webdav/
+ disabled="disabled"/> +
+ +
+ + + +
+ + +
+
+ +
diff --git a/interface/web/temp/en.lng b/interface/web/temp/en.lng index 3ce72dc44a53c9150c36b74b615cc6f6c39f1cae..ccb478659839bb4acc82a493c4683d47d886bd7c 100644 --- a/interface/web/temp/en.lng +++ b/interface/web/temp/en.lng @@ -344,34 +344,34 @@ $wb['phpmyadmin_url_txt'] = 'PHPMyAdmin URL'; ?> --|admin|en|en_users.lng - + --|admin|en|en_users_list.lng --|mail|en|en_mail_alias_list.lng - --|mail|en|en_mail_blacklist.lng --|mail|en|en_mail_blacklist_list.lng - --|mail|en|en_mail_content_filter.lng --|mail|en|en_mail_domain_catchall_list.lng - --|mail|en|en_mail_domain_list.lng --|mail|en|en_mail_forward_list.lng - --|mail|en|en_mail_get.lng --|mail|en|en_mail_spamfilter_list.lng - --|mail|en|en_mail_transport.lng --|mail|en|en_mail_transport_list.lng - --|mail|en|en_mail_user.lng --|mail|en|en_mail_user_list.lng - --|mail|en|en_mail_user_stats_list.lng --|mail|en|en_mail_whitelist_list.lng - --|mail|en|en_spamfilter_blacklist.lng --|mail|en|en_spamfilter_policy_list.lng - --|mail|en|en_spamfilter_users.lng --|mail|en|en_spamfilter_users_list.lng - --|mail|en|en_spamfilter_whitelist.lng --|mail|en|en_spamfilter_whitelist_list.lng - --|monitor|en|en.lng --|sites|en|en_web_subdomain.lng - --|sites|en|en_web_subdomain_list.lng -
  - - - - -
-
- - - - -
 
- - - - - - - - -
- -
-
-
-
-
-
 
  + + + + +
+
+ + + + +
 
+ + + + + + + + +
+ +
+
+
+
+
+
 
  - - - - - -
-
- - - - -
 
- - - - - - - - -
- -
-
-
-
-
-
 
  + + + + + +
+
+ + + + +
 
+ + + + + + + + +
+ +
+
+
+
+
+