Compare commits

...

148 Commits

Author SHA1 Message Date
Florian Aders (EleRas)
f34fdc0b42 Tagging Froxlor 0.9.12 2010-08-23 06:49:14 +00:00
Michael Kaufmann (d00p)
5d36c7228d - set version to 0.9.12, preparing for tag 2010-08-23 06:43:22 +00:00
Michael Kaufmann (d00p)
cf2dabc714 - use correct function to validate directory, fixes #385 2010-08-20 14:45:37 +00:00
Michael Kaufmann (d00p)
a63e752dde - various language improvements/corrections, fixes #380 #381 2010-08-18 05:23:30 +00:00
Michael Kaufmann (d00p)
ec1696ebab - woops, fixed language-file, refs #354 2010-08-17 06:47:13 +00:00
Michael Kaufmann (d00p)
7730a57dbf - add missing language-strings, refs #354 2010-08-17 06:45:46 +00:00
Michael Kaufmann (d00p)
e444ebff62 - clear php-fcgi-starter directories so no old files for non-existing domains are on the filesystem, fixes #367 2010-08-17 06:40:20 +00:00
Michael Kaufmann (d00p)
015f51f8d3 - added email template for "forgot password" function, fixes #354 2010-08-17 06:19:57 +00:00
Michael Kaufmann (d00p)
40ba41497b - added 'company' and 'salutation' to some templates, fixes #376 2010-08-17 06:02:31 +00:00
Michael Kaufmann (d00p)
2a5494c85a - remove unused replacer-variable in admin_customers.php
- add already-implemented replacers to the templates so users actually know they exist
2010-08-13 08:39:56 +00:00
Michael Kaufmann (d00p)
ffe20960d5 - add redirect-code descriptions to customer-domain view, fixes #360 2010-08-12 12:32:26 +00:00
Michael Kaufmann (d00p)
040f151d65 - added possibility to customize authname of directory-protection, fixes #345 2010-08-11 07:48:56 +00:00
Michael Kaufmann (d00p)
db286077f8 - setting cronjob interval of "reset support ticket usage" to 1 day (there is a cycle-setting which controls the reset) 2010-08-11 07:09:57 +00:00
Michael Kaufmann (d00p)
90bd5c3512 - possibility to enter a different path for 'awstats.pl' because it might not be in the same directory as 'awstats_buildsstaticpages.pl', fixes #343 2010-08-10 12:07:53 +00:00
Michael Kaufmann (d00p)
ee29c406ab - add possibility to define email templates for "new database by customer" and "new ftp account by customer" 2010-08-10 09:21:07 +00:00
Michael Kaufmann (d00p)
599d179c4d - fix returnvalue of _getImmutableFunction() 2010-08-10 08:20:20 +00:00
Michael Kaufmann (d00p)
4b84d978d1 - check for 'chattr' command, and use 'chflags' (FreeBSD) if not found, fixes #339
- add license-header to function.storeDefaultIndex.php
2010-08-10 07:57:48 +00:00
Michael Kaufmann (d00p)
91c1928309 - only check for ticket-values if ticket-system is enabled when adding/editing an admin 2010-08-09 11:07:27 +00:00
Michael Kaufmann (d00p)
9d4d6efdb9 - set / as default value for ftp-homedir in customer_ftp, fixes #338 2010-08-09 06:35:16 +00:00
Michael Kaufmann (d00p)
81cef92443 - set "add_date" also for standard-subdomain, fixes #340 2010-08-09 06:30:03 +00:00
Michael Kaufmann (d00p)
734686ff33 - add trailing slash to validate path if needed, fixes #331
- correct HTML special-character in german.lng.php
2010-08-09 06:11:41 +00:00
Michael Kaufmann (d00p)
0d897f13e3 - prevent "sub-but-full-domain" to be used as "sub-but-full-domain" again 2010-08-06 08:46:55 +00:00
Michael Kaufmann (d00p)
05436211dd - just some minor fixes in gentoo-dovecot.conf 2010-08-06 07:09:52 +00:00
Michael Kaufmann (d00p)
ed9235d341 - add possibility to add a subdomain of another domain as "full"-domain in admin-interface, fixes #329 2010-08-06 05:43:28 +00:00
Michael Kaufmann (d00p)
ee7177bdec - fix function correctErrorDocument(), refs #267 2010-08-05 07:36:24 +00:00
Michael Kaufmann (d00p)
74da53c822 - allow setting path-to-file or simple-string as error-document (only file is valid for lighttpd), fixes #267 2010-08-05 07:10:27 +00:00
Michael Kaufmann (d00p)
0f0ae6eb6d - set correct default-value on "change password" view, fixes #317 2010-08-05 06:32:40 +00:00
Michael Kaufmann (d00p)
472291e59d - merging branch d00p/perl-suexec-workaround to trunk, fixes #319 2010-08-05 06:19:53 +00:00
Michael Kaufmann (d00p)
86c881a63c - use correct commands with apache on Gentoo when creating vhosts-dir/-file 2010-08-04 11:51:57 +00:00
Michael Kaufmann (d00p)
f95431c55e - only validate password if given in customer_mysql, fixes #325 2010-08-03 05:29:57 +00:00
Michael Kaufmann (d00p)
f2f022ba30 - add ftp-quota-sql for pure-ftpd under gentoo 2010-08-02 07:30:56 +00:00
Michael Kaufmann (d00p)
1a62e9413d - remove base_dir-directive from dovecot.conf as we use the default value anyway, fixes #311
- added pure-ftp configuration-template for Gentoo
2010-08-02 06:54:57 +00:00
Michael Kaufmann (d00p)
e53e3f9843 - correct description for "save mailpasswords in cleartext" settting, fixes #315 2010-07-30 07:50:28 +00:00
Michael Kaufmann (d00p)
69391309bc - use correct $_POST-values on update 2010-07-30 05:42:19 +00:00
Michael Kaufmann (d00p)
038e9947c1 - remove deprecated function mysql_list_tables() from install.php 2010-07-29 11:00:27 +00:00
Michael Kaufmann (d00p)
5c4a38e4de - beautification in gentoo-config-templates 2010-07-28 12:23:59 +00:00
Michael Kaufmann (d00p)
a0d7997778 - forgot to set version string to 0.9.12-svn1 2010-07-28 10:44:47 +00:00
Michael Kaufmann (d00p)
d660165470 - fixed configuration permissions for pure-ftp, fixes #309
- fixed configuration permissions for dovecot, fixes #310
- fixed some minor config-template issues
2010-07-28 06:08:14 +00:00
Michael Kaufmann (d00p)
735f890e56 - improve autoresponder-cron, refs #308
- let phpMailer-Class throw its exception so we can catch them
2010-07-27 09:59:53 +00:00
Michael Kaufmann (d00p)
a2ab73fa41 - add possibility to use FCGID also for Froxlor itself, fixes #305
- make extra settings menu for FCGID
- replace deprecated function 'ereg_replace' in lighttpd-cronjob
2010-07-27 08:42:59 +00:00
Michael Kaufmann (d00p)
f7f1907546 - set version to 0.9.11 2010-07-26 07:43:12 +00:00
Michael Kaufmann (d00p)
ced78ac6f7 - use correct table-field for email deletion, refs #245 2010-07-24 19:42:03 +00:00
Michael Kaufmann (d00p)
fe3728d522 - fix wrong variable in e-mail data deletion, it actually does work now :P (thx to acidfreeze), fixes #245 2010-07-24 18:55:48 +00:00
Michael Kaufmann (d00p)
f858f045d6 - add task to remove ftp-user data on filesystem correctly 2010-07-24 17:59:05 +00:00
Michael Kaufmann (d00p)
51673f3569 - only show checkbox for e-mail file deletion if there really is some data on the filesystem 2010-07-24 17:26:24 +00:00
Michael Kaufmann (d00p)
e430092eda - fixed lang-variable in getRedirectCodes() 2010-07-22 07:01:47 +00:00
Michael Kaufmann (d00p)
eaf70765d5 - possibility to specify perl path (only necessary on lighttpd) 2010-07-22 06:56:17 +00:00
Michael Kaufmann (d00p)
9191bc6c08 - don't cut single slash if diroptions path is equal to the docroot 2010-07-22 06:36:24 +00:00
Michael Kaufmann (d00p)
d1d772f790 - added possibility to run perl-scripts (if allowed by admin) via directory-options
- for use in lighttpd you have to add "mod_cgi" to the modules-list (and maybe patch lighttpd-cron if perl is not installed in /usr/bin)
2010-07-22 06:02:38 +00:00
Michael Kaufmann (d00p)
edc7a91519 - tell PHPMailer to throw Exceptions so we can catch them, fixes #298 2010-07-22 05:28:21 +00:00
Michael Kaufmann (d00p)
4eb177e65f - set umask in php-starter files (fcgid), fixes #299 2010-07-19 09:48:54 +00:00
Michael Kaufmann (d00p)
5f34dfa968 - add possibility to define password-complexity, fixes #292 2010-07-19 08:06:18 +00:00
Michael Kaufmann (d00p)
c43574a714 - possibility to remove email data also if only account is being removed but not the address itself, refs #245
- possibility to remove ftp-homedir on deletion of a ftp-user, fixes #293
2010-07-19 06:03:49 +00:00
Michael Kaufmann (d00p)
525b6ee98d - keep consistence in filenames, fixes #290
refs #290
2010-07-19 05:35:32 +00:00
Michael Kaufmann (d00p)
e5814b14d9 - fix correct insert of domain-redirect code, fixes #296 2010-07-14 06:37:08 +00:00
Michael Kaufmann (d00p)
e5cd9ad727 - fix accessibility of Froxlor
- added option to decide how Froxlor is being reached
- set version to 0.9.10
2010-06-28 08:53:41 +00:00
Michael Kaufmann (d00p)
cc5c30cc69 - check for defined variable in makeCorrectFile as an undefined may return unwanted values 2010-06-28 08:23:11 +00:00
Michael Kaufmann (d00p)
cf2104e989 - fix wrong variable name 2010-06-28 08:18:12 +00:00
Michael Kaufmann (d00p)
14b7be0a4f - fix undefined (and also unneeded) variable in cron-job 2010-06-25 05:27:09 +00:00
Michael Kaufmann (d00p)
e6c385da10 - fix maildir checking (returned error even if the path exists and is readable) 2010-06-24 20:10:47 +00:00
Michael Kaufmann (d00p)
57124d040d - don't delete everything if the path is the domains document-root (protect basedir, awstats|webalizer-dir and place default index), fixes #273
refs #273
2010-06-24 08:11:43 +00:00
Michael Kaufmann (d00p)
67c55c5a25 - remove installed files when APS packages has been removed, fixes #273
refs #273
2010-06-24 07:26:49 +00:00
Michael Kaufmann (d00p)
f86e4f39d3 - add missing label-string for httpuser and httpgroup settings 2010-06-21 08:38:13 +00:00
Michael Kaufmann (d00p)
5e162b018d - nicer and safer way of determine the customer-id out of the aps-database name 2010-06-17 11:32:14 +00:00
Michael Kaufmann (d00p)
9851ac53cc - show aps-databases also customer-mysql overview, fixes #272
- aps-databases are now increasing the customers mysql-contingent, refs #278
- customers viewing the aps-list are now notified if a package requires a database but the contingent is used up
- the update will add all web[X]aps[Y] databases to the according customer regardless of contingent
- fix tiny issue in preconfig
- setting version to 0.9.10-svn2


refs #272,278
2010-06-17 09:21:14 +00:00
Michael Kaufmann (d00p)
794c4d3b55 - show message-box if customer has no/insufficient aps-contingent, fixed #278
refs #278
2010-06-17 06:30:59 +00:00
Michael Kaufmann (d00p)
530b6da6e8 - fix htpasswd stuff in lighty, fixes #281 2010-06-17 05:56:36 +00:00
Florian Aders (EleRas)
6986ffefbe Fixed bug in languageselect 2010-06-16 20:13:12 +00:00
Florian Aders (EleRas)
e6eefc9913 Fixed typo, fixes #279 2010-06-16 20:02:28 +00:00
Florian Aders (EleRas)
3cd66a9fc4 Now the same for trunk, if someone only checks out trunk ;) 2010-06-16 18:16:37 +00:00
Florian Aders (EleRas)
a1c98e4012 Fixing login - languageselector, fixes #277 2010-06-16 16:26:31 +00:00
Florian Aders (EleRas)
cc7610d436 I hate stupid bugs, still fixing #276 2010-06-16 12:38:53 +00:00
Florian Aders (EleRas)
36efb04f86 Stupid bug-- 2010-06-16 12:34:22 +00:00
Florian Aders (EleRas)
dcc5859eb8 remove waiting createuser - tasks while removing a customer, fixes #276 2010-06-16 12:28:32 +00:00
Michael Kaufmann (d00p)
1557e5b7a3 - only ask for httpgroup/httpuser if not set before
- version decrease back to 0.9.10-svn1 (the two update-procedures have to be executed at the same update-level)
2010-06-16 12:18:14 +00:00
Michael Kaufmann (d00p)
9a41d35f98 - forgot a dot xD 2010-06-16 12:07:36 +00:00
Michael Kaufmann (d00p)
65a7983edc - don't make httpuser/httpgroup-setting hidden
- setting version to 0.9.10-svn2
2010-06-16 12:04:28 +00:00
Michael Kaufmann (d00p)
7b4a34ee69 - use system-settings of awstats-path for configuration-commands, fixes #275 2010-06-16 11:34:48 +00:00
Michael Kaufmann (d00p)
fb63dac2d1 - sorry, wrong checking, corrected now 2010-06-16 10:11:29 +00:00
Michael Kaufmann (d00p)
f9b014f640 - check for missing settings due to forgotten updates in syscp-installs (years ago)
- setting version to 0.9.10-svn1
2010-06-16 10:02:17 +00:00
Michael Kaufmann (d00p)
fe15ff4913 - determine correct path of Froxlor in webserver-cron, fixes #270 2010-06-15 05:40:08 +00:00
Michael Kaufmann (d00p)
cb128e5020 - implemented APS-1.2 standard 2010-06-14 08:09:17 +00:00
Florian Aders (EleRas)
2c3a11cff9 Preparing tagging of 0.9.9 2010-06-14 07:58:38 +00:00
Robert Foerster (Dessa)
7dbb715f04 partly revert r547 2010-06-09 11:42:36 +00:00
Robert Foerster (Dessa)
cdc2c8b1e4 gentoo apparently ships mod_cgi.conf by default unconditionally (but does not enable it), so lets just indicate that in the config as well 2010-06-09 10:55:29 +00:00
Michael Kaufmann (d00p)
ba33268596 - use username or guid depending on fcgid settings for chowning awstats/webalizer files 2010-06-08 20:39:21 +00:00
Michael Kaufmann (d00p)
fd96e4b42e - give ssl-vhost files another name that non-ssl vhost files, now really fixes #254 2010-06-08 11:13:22 +00:00
Michael Kaufmann (d00p)
950c9d7373 - on ssl-redirect, only create webroot for vhost, fixes #254 2010-06-08 06:16:48 +00:00
Michael Kaufmann (d00p)
470fb9a02a - found a better place to run the chowning, refs #258 2010-06-08 05:53:07 +00:00
Michael Kaufmann (d00p)
f2a4c52110 - chown awstats/webalizer directory after traffic-cron, fixes #258 2010-06-08 05:51:23 +00:00
Michael Kaufmann (d00p)
10cfdb137a - fix sed-command in config-templates, fixes #263 2010-06-07 11:14:49 +00:00
Michael Kaufmann (d00p)
323e2210c3 - don't create absolut paths additionally as relative paths in customers docroot, fixes #259 2010-06-04 05:50:23 +00:00
Michael Kaufmann (d00p)
d256ddfcbc - added possibility to let the cron create mail-specific A-records (mail, imap, pop3, smtp) even when MX-servers are given, fixes #242 2010-06-02 10:08:01 +00:00
Michael Kaufmann (d00p)
de250df0cb - added possiblility for customer to get its e-mail account data deleted from the filesystem when removing an account from the panel, fixes #245 2010-06-02 05:57:44 +00:00
Michael Kaufmann (d00p)
e7c9b4d402 - variable name corrections, fixes #256 2010-06-01 05:17:53 +00:00
Michael Kaufmann (d00p)
f3719d339e - set version to 0.9.8 2010-05-31 09:01:29 +00:00
Michael Kaufmann (d00p)
efc353256d - only check for colon if document-root is not a domain-name (redirect), fixes #253 2010-05-31 08:28:12 +00:00
Michael Kaufmann (d00p)
f4026c1df5 - catch exception if update.log can't be opened in /tmp/ (which should never happen) 2010-05-31 06:04:51 +00:00
Michael Kaufmann (d00p)
eed7776e86 - use better english 2010-05-30 09:31:11 +00:00
Robert Foerster (Dessa)
aface6b425 fix some typos in preconfig, thanks to tomreyn 2010-05-29 22:03:26 +00:00
Florian Aders (EleRas)
b0fb3a31f7 correczing functionname makeCorrectPath to makeCorrectDir, fixes #252 2010-05-29 18:53:16 +00:00
Florian Aders (EleRas)
b01d37d085 Updated italian languagefile, thx to Emilien :) 2010-05-27 21:10:40 +00:00
Michael Kaufmann (d00p)
72e6e2af24 - change minimum value for dns-TTL to 1 hour instead of 1 day, refs #166 2010-05-27 20:34:49 +00:00
Michael Kaufmann (d00p)
0db11bf0f8 - same with 05_froxlor_default_errorhandler.conf 2010-05-27 10:20:37 +00:00
Michael Kaufmann (d00p)
07e388c554 - secure path to 05_froxlor_dirfix_nofcgid.conf apache config file 2010-05-27 10:18:57 +00:00
Robert Foerster (Dessa)
84c9ac7e82 tweak dovecot configuration for lucid to work, fixes 248 2010-05-25 22:19:29 +00:00
Michael Kaufmann (d00p)
e572c072a9 - corrected 'last password change' calculation in libnss-configurations, fixes #244 2010-05-21 05:24:18 +00:00
Florian Aders (EleRas)
f6f7b2e4be Fixing it on the right place, d00p was correct, i apologize -.- 2010-05-19 12:29:32 +00:00
Michael Kaufmann (d00p)
5a0973dfa3 - respect lighttpd user and don't put "DocumentRoot" into the ip-specialsettings 2010-05-19 10:59:01 +00:00
Michael Kaufmann (d00p)
268f3b0a24 bugfix template 2010-05-19 10:46:42 +00:00
Michael Kaufmann (d00p)
348de6da35 - simplify awstats configuration, fixes #241 2010-05-19 06:07:02 +00:00
Michael Kaufmann (d00p)
82958cd8c2 - check for disabled accounts in libnss-configurations, fixes #237 2010-05-19 05:54:13 +00:00
Michael Kaufmann (d00p)
264bc50451 - respect admins open_basedir path settings (if more than one path), fixes #238 2010-05-18 11:48:58 +00:00
Michael Kaufmann (d00p)
2ce7e9728f set version to 0.9.7 final 2010-05-17 10:23:25 +00:00
Robert Foerster (Dessa)
8c0bef06c6 consistency is hard... it is... really! 2010-05-17 09:24:23 +00:00
Robert Foerster (Dessa)
7a493fad80 - remove empty apache2 dir from the templates
- actually include lucid in the templates (do'h)
- reworded comments in dovecot configs and fix a typo
- recorded merge of revision 898 via svnmerge from http://Dessa@svn.froxlor.org/branches/mgozdzik
2010-05-17 09:14:30 +00:00
Michael Kaufmann (d00p)
891835d542 don't use the same varname twice 2010-05-17 09:10:02 +00:00
Michael Kaufmann (d00p)
1876ed1459 - validate our update.log file, if not writeable etc. create it in /tmp/ 2010-05-17 08:52:37 +00:00
Michael Kaufmann (d00p)
711f54662c - show START and END of update.log
- tiny beautification in updater
2010-05-17 08:42:32 +00:00
Robert Foerster (Dessa)
f331dee8a1 add Ubuntu Lucid Config Templates, fixes #171 2010-05-17 08:42:17 +00:00
Michael Kaufmann (d00p)
3f0d94c157 fixing sql-queries in updater 2010-05-17 08:29:02 +00:00
Michael Kaufmann (d00p)
f5576606e1 - added description for redirect-codes
- increase version number to 0.9.7-svn3
2010-05-17 08:26:55 +00:00
Michael Kaufmann (d00p)
34de2c03c4 - removed potential undefined variable in admin_index.php
- show also outstanding APS-tasks in admin-overview, fixes #231
2010-05-17 07:01:46 +00:00
Michael Kaufmann (d00p)
225be93610 - correcting constructor-call of FileLogger 2010-05-17 06:15:03 +00:00
Michael Kaufmann (d00p)
089b03de38 - create update.log on update in folder /install/ 2010-05-17 06:09:30 +00:00
Michael Kaufmann (d00p)
785e8f0938 - added configuration templates for FreeBSD's libnss-mysql, fixes #228 2010-05-17 05:33:32 +00:00
Florian Aders (EleRas)
ea24918785 Don't revert preconfig if no domain is found for open_basedir - update 2010-05-14 16:32:46 +00:00
Florian Aders (EleRas)
daa8e45582 Decode the Punycode wshile showing domains with wrong open_basedir 2010-05-12 13:14:18 +00:00
Florian Aders (EleRas)
aa45bf5f70 Forgot that we have http:// in documentroots 2010-05-12 13:08:06 +00:00
Florian Aders (EleRas)
b64bfaeb92 Updating all "wrong" domains regarding open_basedir to use the customerroot instead the documentroot 2010-05-12 13:02:56 +00:00
Michael Kaufmann (d00p)
659d673ffa - renaming file (typo) 2010-05-12 06:52:41 +00:00
Michael Kaufmann (d00p)
65e0962111 - fixed open_basedir issues, fixes #227 2010-05-12 06:52:11 +00:00
Michael Kaufmann (d00p)
a5cf1a0ac9 - pre-select correct domain-path on domain-edit (customer-panel), fixes #225 2010-05-11 11:16:14 +00:00
Michael Kaufmann (d00p)
465f29531e - Customer can now select http-redirect-code for domains (if path is an URL), only works for apache as lighttpd does not support this until version 1.5.0, fixes #184 2010-05-11 08:50:35 +00:00
Florian Aders (EleRas)
88b0c70d0c Renamed username and passwiort - fields while adding a customer to prevent autocomplete of the browsers, fixes #224 2010-05-11 06:19:44 +00:00
Michael Kaufmann (d00p)
4c1b30a081 - pass 'awstatsprog' parameter to awstats_buildstaticpages.pl, fixes #213 2010-05-10 12:18:12 +00:00
Michael Kaufmann (d00p)
afdd94ff9e - corrected postfix/main.cf for dovecot-usage, fixes #217 2010-05-10 09:02:56 +00:00
Michael Kaufmann (d00p)
0b8c1441ef - remove all APS-related data when removing a customer, fixes #216 2010-05-10 08:42:50 +00:00
Michael Kaufmann (d00p)
83b1d85730 - fixed overwriting of mysql-result-array, fixes #215
- fixed invalid SQL-query, fixes #212
2010-05-10 05:37:24 +00:00
Florian Aders (EleRas)
399664c65a Adding documwentroot to default ip, fixes #211 2010-05-07 14:25:08 +00:00
Michael Kaufmann (d00p)
2830bb722f - added possibility to get new ftp-user data e-mailed to customer, fixes #208 2010-05-07 06:13:07 +00:00
Michael Kaufmann (d00p)
7e733e60ee - wups, one escaping too much :p 2010-05-04 10:31:25 +00:00
Michael Kaufmann (d00p)
1f6e3c271b - validateUrl needed to idna-convert the url if its a domain, also needed new regex (subfolder, etc.) 2010-05-04 10:30:02 +00:00
Michael Kaufmann (d00p)
9c79654cf4 - corrected validation of Domain and URL (stupid php-bug) 2010-05-04 09:54:10 +00:00
Michael Kaufmann (d00p)
7ea04992e3 - remove old fcgi-starter files etc. if customer has been deleted (only if 'delete userfiles' is checked!), fixes #200 2010-05-04 07:04:08 +00:00
Michael Kaufmann (d00p)
29a949d3d2 - display number of results in overview, fixes #195 2010-05-04 06:43:23 +00:00
Michael Kaufmann (d00p)
36ed2b4dc2 set default resource-values on create-customer form, fixes #190 2010-05-04 05:56:42 +00:00
Florian Aders (EleRas)
9d50eca251 Damn, overlooked the line disabling quota again, refs #13 2010-05-03 13:58:23 +00:00
190 changed files with 6415 additions and 891 deletions

View File

@@ -62,6 +62,15 @@ return array(
'default' => 0,
'save_method' => 'storeSettingField',
),
'panel_password_regex' => array(
'label' => $lng['serversettings']['panel_password_regex'],
'settinggroup' => 'panel',
'varname' => 'password_regex',
'type' => 'string',
'default' => '',
/* 'plausibility_check_method' => 'checkValidRegEx', */
'save_method' => 'storeSettingField',
),
'customer_accountprefix' => array(
'label' => $lng['serversettings']['accountprefix'],
'settinggroup' => 'customer',

View File

@@ -58,6 +58,14 @@ return array(
'default' => '',
'save_method' => 'storeSettingHostname',
),
'system_froxlordirectlyviahostname' => array(
'label' => $lng['serversettings']['froxlordirectlyviahostname'],
'settinggroup' => 'system',
'varname' => 'froxlordirectlyviahostname',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'system_stdsubdomain' => array(
'label' => $lng['serversettings']['stdsubdomainhost'],
'settinggroup' => 'system',
@@ -101,18 +109,6 @@ return array(
'default' => true,
'save_method' => 'storeSettingField',
),
'system_httpuser' => array(
'settinggroup' => 'system',
'varname' => 'httpuser',
'type' => 'hidden',
'default' => 'www-data',
),
'system_httpgroup' => array(
'settinggroup' => 'system',
'varname' => 'httpgroup',
'type' => 'hidden',
'default' => 'www-data',
),
'system_debug_cron' => array(
'label' => $lng['serversettings']['cron']['debug'],
'settinggroup' => 'system',

View File

@@ -33,6 +33,22 @@ return array(
'save_method' => 'storeSettingField',
'overview_option' => true
),
'system_httpuser' => array(
'label' => $lng['admin']['webserver_user'],
'settinggroup' => 'system',
'varname' => 'httpuser',
'type' => 'string',
'default' => 'www-data',
'save_method' => 'storeSettingField',
),
'system_httpgroup' => array(
'label' => $lng['admin']['webserver_group'],
'settinggroup' => 'system',
'varname' => 'httpgroup',
'type' => 'string',
'default' => 'www-data',
'save_method' => 'storeSettingField',
),
'system_apacheconf_vhost' => array(
'label' => $lng['serversettings']['apacheconf_vhost'],
'settinggroup' => 'system',
@@ -152,6 +168,24 @@ return array(
'default' => '',
'save_method' => 'storeSettingField',
),
'customredirect_enabled' => array(
'label' => $lng['serversettings']['customredirect_enabled'],
'settinggroup' => 'customredirect',
'varname' => 'enabled',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'customredirect_default' => array(
'label' => $lng['serversettings']['customredirect_default'],
'settinggroup' => 'customredirect',
'varname' => 'default',
'type' => 'option',
'default' => '1',
'option_mode' => 'one',
'option_options_method' => 'getRedirectCodes',
'save_method' => 'storeSettingField',
),
),
),
'ssl' => array(

View File

@@ -0,0 +1,125 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Settings
* @version $Id$
*/
return array(
'groups' => array(
'fcgid' => array(
'title' => $lng['admin']['fcgid_settings'],
'fields' => array(
'system_mod_fcgid_enabled' => array(
'label' => $lng['serversettings']['mod_fcgid'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'overview_option' => true
),
'system_mod_fcgid_enabled_ownvhost' => array(
'label' => $lng['serversettings']['mod_fcgid_ownvhost'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_ownvhost',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_httpuser' => array(
'label' => $lng['admin']['mod_fcgid_user'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_httpuser',
'type' => 'string',
'default' => 'froxlorlocal',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_httpgroup' => array(
'label' => $lng['admin']['mod_fcgid_group'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_httpgroup',
'type' => 'string',
'default' => 'froxlorlocal',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_configdir' => array(
'label' => $lng['serversettings']['mod_fcgid']['configdir'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_configdir',
'type' => 'string',
'string_type' => 'dir',
'default' => '/var/www/php-fcgi-scripts/',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_tmpdir' => array(
'label' => $lng['serversettings']['mod_fcgid']['tmpdir'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_tmpdir',
'type' => 'string',
'string_type' => 'dir',
'default' => '/var/customers/tmp/',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_peardir' => array(
'label' => $lng['serversettings']['mod_fcgid']['peardir'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_peardir',
'type' => 'string',
'string_type' => 'dir',
'string_delimiter' => ':',
'string_emptyallowed' => true,
'default' => '/usr/share/php/:/usr/share/php5/',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_wrapper' => array(
'label' => $lng['serversettings']['mod_fcgid']['wrapper'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_wrapper',
'type' => 'option',
'option_options' => array(0 => 'ScriptAlias', 1=> 'FCGIWrapper'),
'default' => 1,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_starter' => array(
'label' => $lng['serversettings']['mod_fcgid']['starter'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_starter',
'type' => 'int',
'default' => 0,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_maxrequests' => array(
'label' => $lng['serversettings']['mod_fcgid']['maxrequests'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_maxrequests',
'type' => 'int',
'default' => 250,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_defaultini' => array(
'label' => $lng['serversettings']['mod_fcgid']['defaultini'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_defaultini',
'type' => 'option',
'default' => '1',
'option_mode' => 'one',
'option_options_method' => 'getPhpConfigs',
'save_method' => 'storeSettingField',
),
),
),
),
);
?>

View File

@@ -0,0 +1,52 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Settings
* @version $Id$
*/
return array(
'groups' => array(
'perl' => array(
'title' => $lng['admin']['perl_settings'],
'fields' => array(
'perl_path' => array(
'label' => $lng['serversettings']['perl_path'],
'settinggroup' => 'system',
'varname' => 'perl_path',
'type' => 'string',
'default' => '/usr/bin/perl',
'save_method' => 'storeSettingField',
),
'system_perl_suexecworkaround' => array(
'label' => $lng['serversettings']['perl']['suexecworkaround'],
'settinggroup' => 'perl',
'varname' => 'suexecworkaround',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'system_perl_suexeccgipath' => array(
'label' => $lng['serversettings']['perl']['suexeccgipath'],
'settinggroup' => 'perl',
'varname' => 'suexecpath',
'type' => 'string',
'default' => '/var/www/cgi-bin/',
'save_method' => 'storeSettingField',
),
),
),
),
);
?>

View File

@@ -49,6 +49,15 @@ return array(
'default' => '/usr/bin/',
'save_method' => 'storeSettingField',
),
'system_awstats_awstatspath' => array(
'label' => $lng['serversettings']['awstats_awstatspath'],
'settinggroup' => 'system',
'varname' => 'awstats_awstatspath',
'type' => 'string',
'string_type' => 'dir',
'default' => '/usr/bin/',
'save_method' => 'storeSettingField',
),
'system_awstats_conf' => array(
'label' => $lng['serversettings']['awstats_conf'],
'settinggroup' => 'system',

View File

@@ -59,13 +59,21 @@ return array(
'default' => '',
'save_method' => 'storeSettingField',
),
'system_dns_createmailentry' => array(
'label' => $lng['serversettings']['mail_also_with_mxservers'],
'settinggroup' => 'system',
'varname' => 'dns_createmailentry',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField'
),
'system_defaultttl' => array(
'label' => $lng['serversettings']['defaultttl'],
'settinggroup' => 'system',
'varname' => 'defaultttl',
'type' => 'int',
'default' => 604800, /* 1 week */
'int_min' => 86400, /* 1 day */
'int_min' => 3600, /* 1 hour */
'int_max' => 2147483647, /* integer max */
'save_method' => 'storeSettingField',
),

View File

@@ -59,7 +59,7 @@ return array(
'type' => 'option',
'default' => '',
'option_mode' => 'multiple',
'option_options' => array('gd' => 'GD Library', 'pcre' => 'PCRE', 'ioncube' => 'ionCube', 'ioncube loader' => 'ionCube Loader', 'curl' => 'curl', 'mcrypt' => 'mcrypt', 'imap' => 'imap'),
'option_options' => array('gd' => 'GD Library', 'pcre' => 'PCRE', 'ioncube' => 'ionCube', 'ioncube loader' => 'ionCube Loader', 'curl' => 'curl', 'mcrypt' => 'mcrypt', 'imap' => 'imap', 'json' => 'json', 'ldap' => 'LDAP', 'hash' => 'hash', 'mbstring' => 'mbstring'),
'save_method' => 'storeSettingApsPhpExtensions',
),
'aps_php-function' => array(

View File

@@ -38,78 +38,6 @@ return array(
'default' => true,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_enabled' => array(
'label' => $lng['serversettings']['mod_fcgid'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_configdir' => array(
'label' => $lng['serversettings']['mod_fcgid']['configdir'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_configdir',
'type' => 'string',
'string_type' => 'dir',
'default' => '/var/www/php-fcgi-scripts/',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_tmpdir' => array(
'label' => $lng['serversettings']['mod_fcgid']['tmpdir'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_tmpdir',
'type' => 'string',
'string_type' => 'dir',
'default' => '/var/customers/tmp/',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_peardir' => array(
'label' => $lng['serversettings']['mod_fcgid']['peardir'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_peardir',
'type' => 'string',
'string_type' => 'dir',
'string_delimiter' => ':',
'string_emptyallowed' => true,
'default' => '/usr/share/php/:/usr/share/php5/',
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_wrapper' => array(
'label' => $lng['serversettings']['mod_fcgid']['wrapper'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_wrapper',
'type' => 'option',
'option_options' => array(0 => 'ScriptAlias', 1=> 'FCGIWrapper'),
'default' => 0,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_starter' => array(
'label' => $lng['serversettings']['mod_fcgid']['starter'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_starter',
'type' => 'int',
'default' => 0,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_maxrequests' => array(
'label' => $lng['serversettings']['mod_fcgid']['maxrequests'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_maxrequests',
'type' => 'int',
'default' => 250,
'save_method' => 'storeSettingField',
),
'system_mod_fcgid_defaultini' => array(
'label' => $lng['serversettings']['mod_fcgid']['defaultini'],
'settinggroup' => 'system',
'varname' => 'mod_fcgid_defaultini',
'type' => 'option',
'default' => '1',
'option_mode' => 'one',
'option_options_method' => 'getPhpConfigs',
'save_method' => 'storeSettingField',
),
),
),
),

View File

@@ -93,6 +93,7 @@ if($page == 'admins'
$i++;
}
$admincount = $db->num_rows($result);
eval("echo \"" . getTemplate("admins/admins") . "\";");
}
elseif($action == 'su')
@@ -219,6 +220,8 @@ if($page == 'admins'
$ftps = - 1;
}
if($settings['ticket']['enabled'] == 1)
{
$tickets = intval_ressource($_POST['tickets']);
if(isset($_POST['tickets_ul'])
@@ -226,6 +229,11 @@ if($page == 'admins'
{
$tickets = - 1;
}
}
else
{
$tickets = 0;
}
$mysqls = intval_ressource($_POST['mysqls']);
@@ -499,12 +507,19 @@ if($page == 'admins'
$ftps = - 1;
}
if($settings['ticket']['enabled'] == 1)
{
$tickets = intval_ressource($_POST['tickets']);
if(isset($_POST['tickets_ul']))
{
$tickets = - 1;
}
}
else
{
$tickets = 0;
}
$mysqls = intval_ressource($_POST['mysqls']);

View File

@@ -67,7 +67,8 @@ if($page == 'customers'
'c.email_quota_used' => $lng['customer']['email_quota'] . ' (' . $lng['panel']['used'] . ')',
'c.deactivated' => $lng['admin']['deactivated'],
'c.lastlogin_succ' => $lng['admin']['lastlogin_succ'],
'c.phpenabled' => $lng['admin']['phpenabled']
'c.phpenabled' => $lng['admin']['phpenabled'],
'c.perlenabled' => $lng['admin']['perlenabled']
);
if($settings['ticket']['enabled'] == 1)
@@ -115,6 +116,7 @@ if($page == 'customers'
$i++;
}
$customercount = $db->num_rows($result);
eval("echo \"" . getTemplate("customers/customers") . "\";");
}
elseif($action == 'su'
@@ -184,14 +186,34 @@ if($page == 'customers'
$db->query("DELETE FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `customerid`='" . (int)$id . "'");
$db->query("DELETE FROM `" . TABLE_MAIL_USERS . "` WHERE `customerid`='" . (int)$id . "'");
$db->query("DELETE FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`='" . (int)$id . "'");
$result = $db->query("SELECT `username` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$id . "'");
while($row = $db->fetch_array($result))
$result2 = $db->query("SELECT `username` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$id . "'");
while($row = $db->fetch_array($result2))
{
$db->query("DELETE FROM `" . TABLE_FTP_QUOTATALLIES . "` WHERE `name`='" . $row['username'] . "'");
}
$db->query("DELETE FROM `" . TABLE_FTP_GROUPS . "` WHERE `customerid`='" . (int)$id . "'");
$db->query("DELETE FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$id . "'");
$db->query("DELETE FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid`='" . (int)$id . "'");
// Delete all waiting "create user" -tasks for this user, #276
// Note: the WHERE selects part of a serialized array, but it should be safe this way
$db->query("DELETE FROM `" . TABLE_PANEL_TASKS . "` WHERE `type` = '2' AND `data` LIKE '%:\"" . $db->escape($result['loginname']) . "\";%';");
// remove everything APS-related, #216
$apsresult = $db->query("SELECT `ID` FROM `".TABLE_APS_INSTANCES."` WHERE `CustomerID`='".(int)$id."'");
while($apsrow = $db->fetch_array($apsresult))
{
// remove all package related settings
$db->query("DELETE FROM `".TABLE_APS_SETTINGS."` WHERE `InstanceID` = '".(int)$apsrow['ID']."'");
// maybe some leftovers in the tasks
$db->query("DELETE FROM `".TABLE_APS_TASKS."` WHERE `InstanceID` = '".(int)$apsrow['ID']."'");
}
// now remove all user instances
$db->query("DELETE FROM `".TABLE_APS_INSTANCES."` WHERE `CustomerID`='".(int)$id."'");
// eventually some temp-setting-leftovers
$db->query("DELETE FROM `".TABLE_APS_TEMP_SETTINGS."` WHERE `CustomerID`='".(int)$id."'");
// eof APS-related removings, #216
$admin_update_query = "UPDATE `" . TABLE_PANEL_ADMINS . "` SET `customers_used` = `customers_used` - 1 ";
$admin_update_query.= ", `domains_used` = `domains_used` - 0" . (int)($domains_deleted - $result['subdomains_used']);
@@ -235,6 +257,11 @@ if($page == 'customers'
$admin_update_query.= ", `tickets_used` = `tickets_used` - 0" . (int)$result['tickets'];
}
if($result['aps_packages'] != '-1')
{
$admin_update_query.= ", `aps_packages` = `aps_packages` - 0" . (int)$result['aps_packages'];
}
if(($result['diskspace'] / 1024) != '-1')
{
$admin_update_query.= ", `diskspace_used` = `diskspace_used` - 0" . (int)$result['diskspace'];
@@ -393,10 +420,11 @@ if($page == 'customers'
}
$createstdsubdomain = intval($_POST['createstdsubdomain']);
$password = validate($_POST['customer_password'], 'password');
$password = validate($_POST['new_customer_password'], 'password');
$password = validatePassword($password);
$sendpassword = intval($_POST['sendpassword']);
$phpenabled = intval($_POST['phpenabled']);
$perlenabled = intval($_POST['perlenabled']);
$diskspace = $diskspace * 1024;
$traffic = $traffic * 1024 * 1024;
@@ -447,11 +475,11 @@ if($page == 'customers'
}
else
{
if(isset($_POST['loginname'])
&& $_POST['loginname'] != '')
if(isset($_POST['new_loginname'])
&& $_POST['new_loginname'] != '')
{
$accountnumber = intval($settings['system']['lastaccountnumber']);
$loginname = validate($_POST['loginname'], 'loginname', '/^[a-z0-9\-_]+$/i');
$loginname = validate($_POST['new_loginname'], 'loginname', '/^[a-z0-9\-_]+$/i');
// Accounts which match systemaccounts are not allowed, filtering them
@@ -499,12 +527,17 @@ if($page == 'customers'
$phpenabled = '1';
}
if($perlenabled != '0')
{
$perlenabled = '1';
}
if($password == '')
{
$password = substr(md5(uniqid(microtime(), 1)), 12, 6);
}
$result = $db->query("INSERT INTO `" . TABLE_PANEL_CUSTOMERS . "` (`adminid`, `loginname`, `password`, `name`, `firstname`, `company`, `street`, `zipcode`, `city`, `phone`, `fax`, `email`, `customernumber`, `def_language`, `documentroot`, `guid`, `diskspace`, `traffic`, `subdomains`, `emails`, `email_accounts`, `email_forwarders`, `email_quota`, `ftps`, `tickets`, `mysqls`, `standardsubdomain`, `phpenabled`, `imap`, `pop3`, `aps_packages`) VALUES ('" . (int)$userinfo['adminid'] . "', '" . $db->escape($loginname) . "', '" . md5($password) . "', '" . $db->escape($name) . "', '" . $db->escape($firstname) . "', '" . $db->escape($company) . "', '" . $db->escape($street) . "', '" . $db->escape($zipcode) . "', '" . $db->escape($city) . "', '" . $db->escape($phone) . "', '" . $db->escape($fax) . "', '" . $db->escape($email) . "', '" . $db->escape($customernumber) . "','" . $db->escape($def_language) . "', '" . $db->escape($documentroot) . "', '" . $db->escape($guid) . "', '" . $db->escape($diskspace) . "', '" . $db->escape($traffic) . "', '" . $db->escape($subdomains) . "', '" . $db->escape($emails) . "', '" . $db->escape($email_accounts) . "', '" . $db->escape($email_forwarders) . "', '" . $db->escape($email_quota) . "', '" . $db->escape($ftps) . "', '" . $db->escape($tickets) . "', '" . $db->escape($mysqls) . "', '0', '" . $db->escape($phpenabled) . "', '" . $db->escape($email_imap) . "', '" . $db->escape($email_pop3) . "', '" . (int)$number_of_aps_packages . "')");
$result = $db->query("INSERT INTO `" . TABLE_PANEL_CUSTOMERS . "` (`adminid`, `loginname`, `password`, `name`, `firstname`, `company`, `street`, `zipcode`, `city`, `phone`, `fax`, `email`, `customernumber`, `def_language`, `documentroot`, `guid`, `diskspace`, `traffic`, `subdomains`, `emails`, `email_accounts`, `email_forwarders`, `email_quota`, `ftps`, `tickets`, `mysqls`, `standardsubdomain`, `phpenabled`, `imap`, `pop3`, `aps_packages`, `perlenabled`) VALUES ('" . (int)$userinfo['adminid'] . "', '" . $db->escape($loginname) . "', '" . md5($password) . "', '" . $db->escape($name) . "', '" . $db->escape($firstname) . "', '" . $db->escape($company) . "', '" . $db->escape($street) . "', '" . $db->escape($zipcode) . "', '" . $db->escape($city) . "', '" . $db->escape($phone) . "', '" . $db->escape($fax) . "', '" . $db->escape($email) . "', '" . $db->escape($customernumber) . "','" . $db->escape($def_language) . "', '" . $db->escape($documentroot) . "', '" . $db->escape($guid) . "', '" . $db->escape($diskspace) . "', '" . $db->escape($traffic) . "', '" . $db->escape($subdomains) . "', '" . $db->escape($emails) . "', '" . $db->escape($email_accounts) . "', '" . $db->escape($email_forwarders) . "', '" . $db->escape($email_quota) . "', '" . $db->escape($ftps) . "', '" . $db->escape($tickets) . "', '" . $db->escape($mysqls) . "', '0', '" . $db->escape($phpenabled) . "', '" . $db->escape($email_imap) . "', '" . $db->escape($email_pop3) . "', '" . (int)$number_of_aps_packages . "', '" . $db->escape($perlenabled) . "')");
$customerid = $db->insert_id();
$admin_update_query = "UPDATE `" . TABLE_PANEL_ADMINS . "` SET `customers_used` = `customers_used` + 1";
@@ -625,7 +658,8 @@ if($page == 'customers'
"`openbasedir` = '1', " .
"`safemode` = '1', " .
"`speciallogfile` = '0', " .
"`specialsettings` = ''");
"`specialsettings` = '', " .
"`add_date` = '".date('Y-m-d')."'");
$domainid = $db->insert_id();
$db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `standardsubdomain`=\'' . (int)$domainid . '\' WHERE `customerid`=\'' . (int)$customerid . '\'');
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added standardsubdomain for user '" . $loginname . "'");
@@ -637,7 +671,6 @@ if($page == 'customers'
$replace_arr = array(
'FIRSTNAME' => $firstname,
'NAME' => $name,
'TITLE' => $title,
'COMPANY' => $company,
'SALUTATION' => getCorrectUserSalutation(array('firstname' => $firstname, 'name' => $name, 'company' => $company)),
'USERNAME' => $loginname,
@@ -703,6 +736,7 @@ if($page == 'customers'
$email_pop3 = makeyesno('email_pop3', '1', '0', '1');
$sendpassword = makeyesno('sendpassword', '1', '0', '1');
$phpenabled = makeyesno('phpenabled', '1', '0', '1');
$perlenabled = makeyesno('perlenabled', '1', '0', '0');
eval("echo \"" . getTemplate("customers/customers_add") . "\";");
}
}
@@ -728,7 +762,7 @@ if($page == 'customers'
$email = $idna_convert->encode(validate($_POST['email'], 'email'));
$customernumber = validate($_POST['customernumber'], 'customer number', '/^[A-Za-z0-9 \-]*$/Di');
$def_language = validate($_POST['def_language'], 'default language');
$password = validate($_POST['customer_password'], 'new password');
$password = validate($_POST['new_customer_password'], 'new password');
$diskspace = intval_ressource($_POST['diskspace']);
if(isset($_POST['diskspace_ul']))
@@ -826,6 +860,7 @@ if($page == 'customers'
$createstdsubdomain = intval($_POST['createstdsubdomain']);
$deactivated = intval($_POST['deactivated']);
$phpenabled = intval($_POST['phpenabled']);
$perlenabled = intval($_POST['perlenabled']);
$diskspace = $diskspace * 1024;
$traffic = $traffic * 1024 * 1024;
@@ -904,7 +939,7 @@ if($page == 'customers'
$_stdsubdomain = $result['loginname'] . '.' . $settings['system']['hostname'];
}
$db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` " . "(`domain`, `customerid`, `adminid`, `parentdomainid`, `ipandport`, `documentroot`, `zonefile`, `isemaildomain`, `caneditdomain`, `openbasedir`, `safemode`, `speciallogfile`, `specialsettings`) " . "VALUES ('" . $db->escape($_stdsubdomain) . "', '" . (int)$result['customerid'] . "', '" . (int)$userinfo['adminid'] . "', '-1', '" . $db->escape($settings['system']['defaultip']) . "', '" . $db->escape($result['documentroot']) . "', '', '0', '0', '1', '1', '0', '')");
$db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` " . "(`domain`, `customerid`, `adminid`, `parentdomainid`, `ipandport`, `documentroot`, `zonefile`, `isemaildomain`, `caneditdomain`, `openbasedir`, `safemode`, `speciallogfile`, `specialsettings`, `add_date`) " . "VALUES ('" . $db->escape($_stdsubdomain) . "', '" . (int)$result['customerid'] . "', '" . (int)$userinfo['adminid'] . "', '-1', '" . $db->escape($settings['system']['defaultip']) . "', '" . $db->escape($result['documentroot']) . "', '', '0', '0', '1', '1', '0', '', '".date('Y-m-d')."'");
$domainid = $db->insert_id();
$db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `standardsubdomain`=\'' . (int)$domainid . '\' WHERE `customerid`=\'' . (int)$result['customerid'] . '\'');
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added standardsubdomain for user '" . $result['loginname'] . "'");
@@ -930,7 +965,13 @@ if($page == 'customers'
$phpenabled = '1';
}
if($phpenabled != $result['phpenabled'])
if($perlenabled != '0')
{
$perlenabled = '1';
}
if($phpenabled != $result['phpenabled']
|| $perlenabled != $result['perlenabled'])
{
inserttask('1');
}
@@ -958,7 +999,7 @@ if($page == 'customers'
$db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET `imap`='" . (int)$email_imap . "' WHERE `customerid`='" . (int)$id . "'");
}
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `name`='" . $db->escape($name) . "', `firstname`='" . $db->escape($firstname) . "', `company`='" . $db->escape($company) . "', `street`='" . $db->escape($street) . "', `zipcode`='" . $db->escape($zipcode) . "', `city`='" . $db->escape($city) . "', `phone`='" . $db->escape($phone) . "', `fax`='" . $db->escape($fax) . "', `email`='" . $db->escape($email) . "', `customernumber`='" . $db->escape($customernumber) . "', `def_language`='" . $db->escape($def_language) . "', `password` = '" . $password . "', `diskspace`='" . $db->escape($diskspace) . "', `traffic`='" . $db->escape($traffic) . "', `subdomains`='" . $db->escape($subdomains) . "', `emails`='" . $db->escape($emails) . "', `email_accounts` = '" . $db->escape($email_accounts) . "', `email_forwarders`='" . $db->escape($email_forwarders) . "', `ftps`='" . $db->escape($ftps) . "', `tickets`='" . $db->escape($tickets) . "', `mysqls`='" . $db->escape($mysqls) . "', `deactivated`='" . $db->escape($deactivated) . "', `phpenabled`='" . $db->escape($phpenabled) . "', `email_quota`='" . $db->escape($email_quota) . "', `imap`='" . $db->escape($email_imap) . "', `pop3`='" . $db->escape($email_pop3) . "', `aps_packages`='" . (int)$number_of_aps_packages . "' WHERE `customerid`='" . (int)$id . "'");
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `name`='" . $db->escape($name) . "', `firstname`='" . $db->escape($firstname) . "', `company`='" . $db->escape($company) . "', `street`='" . $db->escape($street) . "', `zipcode`='" . $db->escape($zipcode) . "', `city`='" . $db->escape($city) . "', `phone`='" . $db->escape($phone) . "', `fax`='" . $db->escape($fax) . "', `email`='" . $db->escape($email) . "', `customernumber`='" . $db->escape($customernumber) . "', `def_language`='" . $db->escape($def_language) . "', `password` = '" . $password . "', `diskspace`='" . $db->escape($diskspace) . "', `traffic`='" . $db->escape($traffic) . "', `subdomains`='" . $db->escape($subdomains) . "', `emails`='" . $db->escape($emails) . "', `email_accounts` = '" . $db->escape($email_accounts) . "', `email_forwarders`='" . $db->escape($email_forwarders) . "', `ftps`='" . $db->escape($ftps) . "', `tickets`='" . $db->escape($tickets) . "', `mysqls`='" . $db->escape($mysqls) . "', `deactivated`='" . $db->escape($deactivated) . "', `phpenabled`='" . $db->escape($phpenabled) . "', `email_quota`='" . $db->escape($email_quota) . "', `imap`='" . $db->escape($email_imap) . "', `pop3`='" . $db->escape($email_pop3) . "', `aps_packages`='" . (int)$number_of_aps_packages . "', `perlenabled`='" . $db->escape($perlenabled) . "' WHERE `customerid`='" . (int)$id . "'");
$admin_update_query = "UPDATE `" . TABLE_PANEL_ADMINS . "` SET `customers_used` = `customers_used` ";
if($mysqls != '-1'
@@ -1223,6 +1264,7 @@ if($page == 'customers'
$createstdsubdomain = makeyesno('createstdsubdomain', '1', '0', (($result['standardsubdomain'] != '0') ? '1' : '0'));
$phpenabled = makeyesno('phpenabled', '1', '0', $result['phpenabled']);
$perlenabled = makeyesno('perlenabled', '1', '0', $result['perlenabled']);
$deactivated = makeyesno('deactivated', '1', '0', $result['deactivated']);
$email_imap = makeyesno('email_imap', '1', '0', $result['imap']);
$email_pop3 = makeyesno('email_pop3', '1', '0', $result['pop3']);

View File

@@ -130,6 +130,8 @@ if($page == 'domains'
$i++;
}
$domainscount = $db->num_rows($result);
// Display the list
eval("echo \"" . getTemplate("domains/domains") . "\";");
@@ -155,7 +157,15 @@ if($page == 'domains'
standard_error('domains_cantdeletedomainwithapsinstances');
}
$query = 'SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` WHERE (`id`="' . (int)$id . '" OR `parentdomainid`="' . (int)$id . '") AND `isemaildomain`="1"';
// check for deletion of main-domains which are logically subdomains, #329
$rsd_sql = '';
$remove_subbutmain_domains = isset($_POST['delete_userfiles']) ? 1 : 0;
if($remove_subbutmain_domains == 1)
{
$rsd_sql .= ' OR `ismainbutsubto` = "'.(int)$id.'"';
}
$query = 'SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` WHERE (`id`="' . (int)$id . '" OR `parentdomainid`="' . (int)$id . '"'.$rsd_sql.') AND `isemaildomain`="1"';
$subResult = $db->query($query);
$idString = array();
@@ -175,11 +185,12 @@ if($page == 'domains'
$log->logAction(ADM_ACTION, LOG_NOTICE, "deleted domain/s from mail-tables");
}
$db->query("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `id`='" . (int)$id . "' OR `parentdomainid`='" . (int)$result['id'] . "'");
$db->query("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `id`='" . (int)$id . "' OR `parentdomainid`='" . (int)$result['id'] . "'".$rsd_sql);
$deleted_domains = (int)$db->affected_rows();
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `subdomains_used` = `subdomains_used` - " . (int)($deleted_domains - 1) . " WHERE `customerid` = '" . (int)$result['customerid'] . "'");
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `domains_used` = `domains_used` - 1 WHERE `adminid` = '" . (int)$userinfo['adminid'] . "'");
$db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `standardsubdomain`=\'0\' WHERE `standardsubdomain`=\'' . (int)$result['id'] . '\' AND `customerid`=\'' . (int)$result['customerid'] . '\'');
$db->query("DELETE FROM `" . TABLE_PANEL_DOMAINREDIRECTS . "` WHERE `did` = '".(int)$id."'");
$log->logAction(ADM_ACTION, LOG_INFO, "deleted domain/subdomains (#" . $result['id'] . ")");
updateCounters();
inserttask('1');
@@ -188,7 +199,12 @@ if($page == 'domains'
}
else
{
ask_yesno('admin_domain_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['domain']));
$showcheck = false;
if(domainHasMainSubDomains($id))
{
$showcheck = true;
}
ask_yesno_withcheckbox('admin_domain_reallydelete', 'remove_subbutmain_domains', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['domain']), $showcheck);
}
}
}
@@ -213,6 +229,7 @@ if($page == 'domains'
$wwwserveralias = intval($_POST['wwwserveralias']);
$speciallogfile = intval($_POST['speciallogfile']);
$aliasdomain = intval($_POST['alias']);
$issubof = intval($_POST['issubof']);
$customerid = intval($_POST['customerid']);
$customer = $db->query_first("SELECT * FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `customerid`='" . (int)$customerid . "' " . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = '" . (int)$userinfo['adminid'] . "' ") . " ");
@@ -366,9 +383,16 @@ if($page == 'domains'
}
if(!preg_match('/^https?\:\/\//', $documentroot))
{
if(strstr($documentroot, ":") !== FALSE)
{
standard_error('pathmaynotcontaincolon');
}
else
{
$documentroot = makeCorrectDir($documentroot);
}
}
$domain_check = $db->query_first("SELECT `id`, `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain` = '" . $db->escape(strtolower($domain)) . "'");
$aliasdomain_check = array(
@@ -378,7 +402,7 @@ if($page == 'domains'
if($aliasdomain != 0)
{
// also check ip/port combination to be the same, #176
$aliasdomain_check = $db->query_first('SELECT `d`.id` FROM `' . TABLE_PANEL_DOMAINS . '` `d`,`' . TABLE_PANEL_CUSTOMERS . '` `c` WHERE `d`.`customerid`=\'' . (int)$customerid . '\' AND `d`.`aliasdomain` IS NULL AND `d`.`id`<>`c`.`standardsubdomain` AND `c`.`customerid`=\'' . (int)$customerid . '\' AND `d`.`id`=\'' . (int)$aliasdomain . '\' AND `d`.`ipandport` = \''.(int)$ipandport.'\'');
$aliasdomain_check = $db->query_first('SELECT `d`.`id` FROM `' . TABLE_PANEL_DOMAINS . '` `d`,`' . TABLE_PANEL_CUSTOMERS . '` `c` WHERE `d`.`customerid`=\'' . (int)$customerid . '\' AND `d`.`aliasdomain` IS NULL AND `d`.`id`<>`c`.`standardsubdomain` AND `c`.`customerid`=\'' . (int)$customerid . '\' AND `d`.`id`=\'' . (int)$aliasdomain . '\' AND `d`.`ipandport` = \''.(int)$ipandport.'\'');
}
if($openbasedir != '1')
@@ -437,6 +461,11 @@ if($page == 'domains'
$caneditdomain = '0';
}
if($issubof <= '0')
{
$issubof = '0';
}
if($domain == '')
{
standard_error(array('stringisempty', 'mydomain'));
@@ -490,7 +519,8 @@ if($page == 'domains'
'mod_fcgid_starter' => $mod_fcgid_starter,
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
'specialsettings' => $specialsettings,
'registration_date' => $registration_date
'registration_date' => $registration_date,
'issubof' => $issubof
);
$security_questions = array(
@@ -512,7 +542,7 @@ if($page == 'domains'
}
}
$db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` (`domain`, `customerid`, `adminid`, `documentroot`, `ipandport`,`aliasdomain`, `zonefile`, `dkim`, `wwwserveralias`, `isbinddomain`, `isemaildomain`, `email_only`, `subcanemaildomain`, `caneditdomain`, `openbasedir`, `safemode`,`speciallogfile`, `specialsettings`, `ssl`, `ssl_redirect`, `ssl_ipandport`, `add_date`, `registration_date`, `phpsettingid`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`) VALUES ('" . $db->escape($domain) . "', '" . (int)$customerid . "', '" . (int)$adminid . "', '" . $db->escape($documentroot) . "', '" . $db->escape($ipandport) . "', " . (($aliasdomain != 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ", '" . $db->escape($zonefile) . "', '" . $db->escape($dkim) . "', '" . $db->escape($wwwserveralias) . "', '" . $db->escape($isbinddomain) . "', '" . $db->escape($isemaildomain) . "', '" . $db->escape($email_only) . "', '" . $db->escape($subcanemaildomain) . "', '" . $db->escape($caneditdomain) . "', '" . $db->escape($openbasedir) . "', '" . $db->escape($safemode) . "', '" . $db->escape($speciallogfile) . "', '" . $db->escape($specialsettings) . "', '" . $ssl . "', '" . $ssl_redirect . "' , '" . $ssl_ipandport . "', '" . $db->escape(time()) . "', '" . $db->escape($registration_date) . "', '" . (int)$phpsettingid . "', '" . (int)$mod_fcgid_starter . "', '" . (int)$mod_fcgid_maxrequests . "')");
$db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` (`domain`, `customerid`, `adminid`, `documentroot`, `ipandport`,`aliasdomain`, `zonefile`, `dkim`, `wwwserveralias`, `isbinddomain`, `isemaildomain`, `email_only`, `subcanemaildomain`, `caneditdomain`, `openbasedir`, `safemode`,`speciallogfile`, `specialsettings`, `ssl`, `ssl_redirect`, `ssl_ipandport`, `add_date`, `registration_date`, `phpsettingid`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`, `ismainbutsubto`) VALUES ('" . $db->escape($domain) . "', '" . (int)$customerid . "', '" . (int)$adminid . "', '" . $db->escape($documentroot) . "', '" . $db->escape($ipandport) . "', " . (($aliasdomain != 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ", '" . $db->escape($zonefile) . "', '" . $db->escape($dkim) . "', '" . $db->escape($wwwserveralias) . "', '" . $db->escape($isbinddomain) . "', '" . $db->escape($isemaildomain) . "', '" . $db->escape($email_only) . "', '" . $db->escape($subcanemaildomain) . "', '" . $db->escape($caneditdomain) . "', '" . $db->escape($openbasedir) . "', '" . $db->escape($safemode) . "', '" . $db->escape($speciallogfile) . "', '" . $db->escape($specialsettings) . "', '" . $ssl . "', '" . $ssl_redirect . "' , '" . $ssl_ipandport . "', '" . $db->escape(time()) . "', '" . $db->escape($registration_date) . "', '" . (int)$phpsettingid . "', '" . (int)$mod_fcgid_starter . "', '" . (int)$mod_fcgid_maxrequests . "', '".(int)$issubof."')");
$domainid = $db->insert_id();
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `domains_used` = `domains_used` + 1 WHERE `adminid` = '" . (int)$adminid . "'");
$log->logAction(ADM_ACTION, LOG_INFO, "added domain '" . $domain . "'");
@@ -604,6 +634,14 @@ if($page == 'domains'
$domains.= makeoption($idna_convert->decode($row_domain['domain']) . ' (' . $row_domain['loginname'] . ')', $row_domain['id']);
}
$subtodomains = makeoption($lng['domains']['nosubtomaindomain'], 0, NULL, true);
$result_domains = $db->query("SELECT `d`.`id`, `d`.`domain`, `c`.`loginname` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c` WHERE `d`.`aliasdomain` IS NULL AND `d`.`parentdomainid`=0 AND `d`.`ismainbutsubto`=0 " . $standardsubdomains . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = '" . (int)$userinfo['adminid'] . "'") . " AND `d`.`customerid`=`c`.`customerid` ORDER BY `loginname`, `domain` ASC");
while($row_domain = $db->fetch_array($result_domains))
{
$subtodomains.= makeoption($idna_convert->decode($row_domain['domain']) . ' (' . $row_domain['loginname'] . ')', $row_domain['id']);
}
$phpconfigs = '';
$configs = $db->query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`");
@@ -714,6 +752,7 @@ if($page == 'domains'
}
$aliasdomain = intval($_POST['alias']);
$issubof = intval($_POST['issubof']);
$isemaildomain = intval($_POST['isemaildomain']);
$email_only = intval($_POST['email_only']);
$subcanemaildomain = intval($_POST['subcanemaildomain']);
@@ -742,6 +781,12 @@ if($page == 'domains'
{
$documentroot = $customer['documentroot'];
}
if(!preg_match('/^https?\:\/\//', $documentroot)
&& strstr($documentroot, ":") !== FALSE
) {
standard_error('pathmaynotcontaincolon');
}
}
else
{
@@ -900,6 +945,11 @@ if($page == 'domains'
standard_error('domainisaliasorothercustomer');
}
if($issubof <= '0')
{
$issubof = '0';
}
$params = array(
'id' => $id,
'page' => $page,
@@ -926,7 +976,8 @@ if($page == 'domains'
'mod_fcgid_starter' => $mod_fcgid_starter,
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
'specialsettings' => $specialsettings,
'registration_date' => $registration_date
'registration_date' => $registration_date,
'issubof' => $issubof
);
$security_questions = array(
@@ -960,7 +1011,8 @@ if($page == 'domains'
|| $mod_fcgid_starter != $result['mod_fcgid_starter']
|| $mod_fcgid_maxrequests != $result['mod_fcgid_maxrequests']
|| $specialsettings != $result['specialsettings']
|| $aliasdomain != $result['aliasdomain'])
|| $aliasdomain != $result['aliasdomain']
|| $issubof != $result['ismainbutsubto'])
{
inserttask('1');
}
@@ -1022,7 +1074,7 @@ if($page == 'domains'
$log->logAction(ADM_ACTION, LOG_INFO, "removed specialsettings on all subdomains of domain #" . $id);
}
$result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `customerid` = '" . (int)$customerid . "', `adminid` = '" . (int)$adminid . "', `documentroot`='" . $db->escape($documentroot) . "', `ipandport`='" . $db->escape($ipandport) . "', `ssl`='" . (int)$ssl . "', `ssl_redirect`='" . (int)$ssl_redirect . "', `ssl_ipandport`='" . (int)$ssl_ipandport . "', `aliasdomain`=" . (($aliasdomain != 0 && $alias_check == 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ", `isbinddomain`='" . $db->escape($isbinddomain) . "', `isemaildomain`='" . $db->escape($isemaildomain) . "', `email_only`='" . $db->escape($email_only) . "', `subcanemaildomain`='" . $db->escape($subcanemaildomain) . "', `dkim`='" . $db->escape($dkim) . "', `caneditdomain`='" . $db->escape($caneditdomain) . "', `zonefile`='" . $db->escape($zonefile) . "', `wwwserveralias`='" . $db->escape($wwwserveralias) . "', `openbasedir`='" . $db->escape($openbasedir) . "', `safemode`='" . $db->escape($safemode) . "', `phpsettingid`='" . $db->escape($phpsettingid) . "', `mod_fcgid_starter`='" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests`='" . $db->escape($mod_fcgid_maxrequests) . "', `specialsettings`='" . $db->escape($specialsettings) . "', `registration_date`='" . $db->escape($registration_date) . "' WHERE `id`='" . (int)$id . "'");
$result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `customerid` = '" . (int)$customerid . "', `adminid` = '" . (int)$adminid . "', `documentroot`='" . $db->escape($documentroot) . "', `ipandport`='" . $db->escape($ipandport) . "', `ssl`='" . (int)$ssl . "', `ssl_redirect`='" . (int)$ssl_redirect . "', `ssl_ipandport`='" . (int)$ssl_ipandport . "', `aliasdomain`=" . (($aliasdomain != 0 && $alias_check == 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ", `isbinddomain`='" . $db->escape($isbinddomain) . "', `isemaildomain`='" . $db->escape($isemaildomain) . "', `email_only`='" . $db->escape($email_only) . "', `subcanemaildomain`='" . $db->escape($subcanemaildomain) . "', `dkim`='" . $db->escape($dkim) . "', `caneditdomain`='" . $db->escape($caneditdomain) . "', `zonefile`='" . $db->escape($zonefile) . "', `wwwserveralias`='" . $db->escape($wwwserveralias) . "', `openbasedir`='" . $db->escape($openbasedir) . "', `safemode`='" . $db->escape($safemode) . "', `phpsettingid`='" . $db->escape($phpsettingid) . "', `mod_fcgid_starter`='" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests`='" . $db->escape($mod_fcgid_maxrequests) . "', `specialsettings`='" . $db->escape($specialsettings) . "', `registration_date`='" . $db->escape($registration_date) . "', `ismainbutsubto`='" . (int)$issubof . "' WHERE `id`='" . (int)$id . "'");
$result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `customerid` = '" . (int)$customerid . "', `adminid` = '" . (int)$adminid . "', `ipandport`='" . $db->escape($ipandport) . "', `openbasedir`='" . $db->escape($openbasedir) . "', `safemode`='" . $db->escape($safemode) . "', `phpsettingid`='" . $db->escape($phpsettingid) . "', `mod_fcgid_starter`='" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests`='" . $db->escape($mod_fcgid_maxrequests) . "'" . $upd_specialsettings . $updatechildren . " WHERE `parentdomainid`='" . (int)$id . "'");
$log->logAction(ADM_ACTION, LOG_INFO, "edited domain #" . $id);
$redirect_props = Array(
@@ -1078,6 +1130,14 @@ if($page == 'domains'
$domains.= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id'], $result['aliasdomain']);
}
$subtodomains = makeoption($lng['domains']['nosubtomaindomain'], 0, NULL, true);
$result_domains = $db->query("SELECT `d`.`id`, `d`.`domain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c` WHERE `d`.`aliasdomain` IS NULL AND `d`.`parentdomainid`=0 AND `d`.`id`<>'" . (int)$result['id'] . "' AND `c`.`standardsubdomain`<>`d`.`id` AND `d`.`customerid`='" . (int)$result['customerid'] . "' AND `c`.`customerid`=`d`.`customerid` ORDER BY `d`.`domain` ASC");
while($row_domain = $db->fetch_array($result_domains))
{
$subtodomains.= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id'], $result['ismainbutsubto']);
}
if($userinfo['ip'] == "-1")
{
$result_ipsandports = $db->query("SELECT `id`, `ip`, `port` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `ssl`='0' ORDER BY `ip`, `port` ASC");

View File

@@ -100,7 +100,7 @@ if($page == 'overview')
&& count($latestversion) >= 1)
{
$_version = $latestversion[0];
$_message = $latestversion[1];
$_message = isset($latestversion[1]) ? $latestversion[1] : '';
$_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
$lookfornewversion_lable = $_version;
@@ -281,9 +281,14 @@ elseif($page == 'change_language')
{
$language_options = '';
$default_lang = $settings['panel']['standardlanguage'];
if($userinfo['def_language'] != '') {
$default_lang = $userinfo['def_language'];
}
while(list($language_file, $language_name) = each($languages))
{
$language_options.= makeoption($language_name, $language_file, $userinfo['def_language'], true);
$language_options.= makeoption($language_name, $language_file, $default_lang, true);
}
eval("echo \"" . getTemplate("index/change_language") . "\";");

View File

@@ -215,5 +215,3 @@ elseif($page == 'enforcequotas'
ask_yesno('admin_quotas_reallyenforce', $filename, array('page' => $page));
}
}
?>

View File

@@ -53,7 +53,10 @@ $available_templates = array(
'new_ticket_for_customer',
'new_ticket_by_staff',
'new_reply_ticket_by_customer',
'new_reply_ticket_by_staff'
'new_reply_ticket_by_staff',
'new_database_by_customer',
'new_ftpaccount_by_customer',
'password_reset'
);
$file_templates = array(
'index_html'

View File

@@ -107,7 +107,7 @@ if($action == "add")
}
$date_from_off = makecheckbox('date_from_off', $lng['panel']['not_activated'], '-1', false, '-1', true, true);
$date_until_off = makecheckbox('date_from_off', $lng['panel']['not_activated'], '-1', false, '-1', true, true);
$date_until_off = makecheckbox('date_until_off', $lng['panel']['not_activated'], '-1', false, '-1', true, true);
eval("echo \"" . getTemplate("email/autoresponder_add") . "\";");
}
@@ -229,7 +229,7 @@ if($action == "edit")
$deactivated = '0';
$date_until = date('d-m-Y', $date_until);
}
$date_from_off = makecheckbox('date_until_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true);
$date_until_off = makecheckbox('date_until_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true);
$checked = '';

View File

@@ -226,6 +226,7 @@ elseif($page == 'domains')
$aliasdomain_check = array(
'id' => 0
);
$_doredirect = false;
if($aliasdomain != 0)
{
@@ -238,6 +239,7 @@ elseif($page == 'domains')
&& validateUrl($idna_convert->encode($_POST['url'])))
{
$path = $_POST['url'];
$_doredirect = true;
}
else
{
@@ -249,6 +251,14 @@ elseif($page == 'domains')
{
$path = $userinfo['documentroot'] . '/' . $path;
$path = makeCorrectDir($path);
if (strstr($path, ":") !== FALSE)
{
standard_error('pathmaynotcontaincolon');
}
}
else
{
$_doredirect = true;
}
if(isset($_POST['openbasedir_path'])
@@ -326,6 +336,13 @@ elseif($page == 'domains')
`ssl_redirect` = '" . $ssl_redirect . "',
`phpsettingid` = '" . $phpsid_result['phpsettingid'] . "'");
if($_doredirect)
{
$did = $db->insert_id();
$redirect = isset($_POST['redirectcode']) ? (int)$_POST['redirectcode'] : $settings['customredirect']['default'];
addRedirectToDomain($did, $redirect);
}
$result = $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `subdomains_used`=`subdomains_used`+1 WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
$log->logAction(USR_ACTION, LOG_INFO, "added subdomain '" . $completedomain . "'");
inserttask('1');
@@ -351,6 +368,16 @@ elseif($page == 'domains')
$aliasdomains.= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id']);
}
if($settings['customredirect']['enabled'] == '1')
{
$redirectcode = '';
$codes = getRedirectCodesArray();
foreach($codes as $rc)
{
$redirectcode .= makeoption($rc['code']. ' ('.$lng['redirect_desc'][$rc['desc']].')', $rc['id'], $settings['customredirect']['default']);
}
}
$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']);
$openbasedir = makeoption($lng['domain']['docroot'], 0, NULL, true) . makeoption($lng['domain']['homedir'], 1, NULL, true);
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
@@ -364,6 +391,7 @@ elseif($page == 'domains')
$result = $db->query_first("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isemaildomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `d`.`ssl_redirect`, `d`.`aliasdomain`, `d`.`openbasedir_path`, `d`.`ipandport`, `pd`.`subcanemaildomain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_DOMAINS . "` `pd` WHERE `d`.`customerid`='" . (int)$userinfo['customerid'] . "' AND `d`.`id`='" . (int)$id . "' AND ((`d`.`parentdomainid`!='0' AND `pd`.`id`=`d`.`parentdomainid`) OR (`d`.`parentdomainid`='0' AND `pd`.`id`=`d`.`id`)) AND `d`.`caneditdomain`='1'");
$alias_check = $db->query_first('SELECT COUNT(`id`) AS count FROM `' . TABLE_PANEL_DOMAINS . '` WHERE `aliasdomain`=\'' . (int)$result['id'] . '\'');
$alias_check = $alias_check['count'];
$_doredirect = false;
if(isset($result['customerid'])
&& $result['customerid'] == $userinfo['customerid'])
@@ -376,6 +404,7 @@ elseif($page == 'domains')
&& validateUrl($idna_convert->encode($_POST['url'])))
{
$path = $_POST['url'];
$_doredirect = true;
}
else
{
@@ -387,6 +416,14 @@ elseif($page == 'domains')
{
$path = $userinfo['documentroot'] . '/' . $path;
$path = makeCorrectDir($path);
if (strstr($path, ":") !== FALSE)
{
standard_error('pathmaynotcontaincolon');
}
}
else
{
$_doredirect = true;
}
$aliasdomain = intval($_POST['alias']);
@@ -461,6 +498,12 @@ elseif($page == 'domains')
$log->logAction(USR_ACTION, LOG_NOTICE, "automatically deleted mail-table entries for '" . $idna_convert->decode($result['domain']) . "'");
}
if($_doredirect)
{
$redirect = isset($_POST['redirectcode']) ? (int)$_POST['redirectcode'] : false;
updateRedirectOfDomain($id, $redirect);
}
if($path != $result['documentroot']
|| $isemaildomain != $result['isemaildomain']
|| $iswildcarddomain != $result['iswildcarddomain']
@@ -502,6 +545,17 @@ elseif($page == 'domains')
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], $result['documentroot']);
}
if($settings['customredirect']['enabled'] == '1')
{
$def_code = getDomainRedirectId($id);
$redirectcode = '';
$codes = getRedirectCodesArray();
foreach($codes as $rc)
{
$redirectcode .= makeoption($rc['code']. ' ('.$lng['redirect_desc'][$rc['desc']].')', $rc['id'], $def_code);
}
}
$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']);
$iswildcarddomain = makeyesno('iswildcarddomain', '1', '0', $result['iswildcarddomain']);
$isemaildomain = makeyesno('isemaildomain', '1', '0', $result['isemaildomain']);

View File

@@ -139,8 +139,10 @@ elseif($page == 'emails')
}
}
$emaildomains_count = $db->query_first("SELECT COUNT(`id`) AS `count` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . $userinfo['customerid'] . "' AND `isemaildomain`='1' ORDER BY `domain` ASC");
$emaildomains_count = $db->query_first("SELECT COUNT(`id`) AS `count` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `isemaildomain`='1' ORDER BY `domain` ASC");
$emaildomains_count = $emaildomains_count['count'];
$emailscount = $db->num_rows($result);
eval("echo \"" . getTemplate("email/emails") . "\";");
}
elseif($action == 'delete'
@@ -182,6 +184,12 @@ elseif($page == 'emails')
$number_forwarders = 0;
}
if(isset($_POST['delete_userfiles'])
&& (int)$_POST['delete_userfiles'] == 1)
{
inserttask('7', $userinfo['loginname'], $result['email_full']);
}
$db->query("DELETE FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `emails_used`=`emails_used` - 1 , `email_forwarders_used` = `email_forwarders_used` - " . (int)$number_forwarders . " $update_users_query_addon WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
$log->logAction(USR_ACTION, LOG_INFO, "deleted email address '" . $result['email'] . "'");
@@ -189,7 +197,12 @@ elseif($page == 'emails')
}
else
{
ask_yesno('email_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full']));
if(maildirExists($result)) {
$show_checkbox = true;
} else {
$show_checkbox = false;
}
ask_yesno_withcheckbox('email_reallydelete', 'admin_customer_alsoremovemail', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full']), $show_checkbox);
}
}
}
@@ -600,13 +613,19 @@ elseif($page == 'accounts')
$quota = 0;
}
if(isset($_POST['delete_userfiles'])
&& (int)$_POST['delete_userfiles'] == 1)
{
inserttask('7', $userinfo['loginname'], $result['email_full']);
}
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_accounts_used` = `email_accounts_used` - 1, `email_quota_used` = `email_quota_used` - " . (int)$quota . " WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
$log->logAction(USR_ACTION, LOG_INFO, "deleted email account for '" . $result['email_full'] . "'");
redirectTo($filename, Array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s));
}
else
{
ask_yesno('email_reallydelete_account', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full']));
ask_yesno_withcheckbox('email_reallydelete_account', 'admin_customer_alsoremovemail', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full']));
}
}
}

View File

@@ -49,7 +49,7 @@ elseif($page == 'htpasswds')
'path' => $lng['panel']['path']
);
$paging = new paging($userinfo, $db, TABLE_PANEL_HTPASSWDS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
$result = $db->query("SELECT `id`, `username`, `path` FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
$paging->setEntries($db->num_rows($result));
$sortcode = $paging->getHtmlSortCode($lng);
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
@@ -81,7 +81,7 @@ elseif($page == 'htpasswds')
elseif($action == 'delete'
&& $id != 0)
{
$result = $db->query_first("SELECT `id`, `customerid`, `username`, `path` FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
if(isset($result['username'])
&& $result['username'] != '')
@@ -114,6 +114,7 @@ elseif($page == 'htpasswds')
$userpath = $path;
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
$username = validate($_POST['username'], 'username', '/^[a-zA-Z0-9][a-zA-Z0-9\-_]+\$?$/');
$authname = validate($_POST['directory_authname'], 'directory_authname', '/^[a-zA-Z0-9][a-zA-Z0-9\-_ ]+\$?$/');
validate($_POST['directory_password'], 'password');
$username_path_check = $db->query_first("SELECT `id`, `username`, `path` FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `username`='" . $db->escape($username) . "' AND `path`='" . $db->escape($path) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "'");
@@ -151,7 +152,7 @@ elseif($page == 'htpasswds')
}
else
{
$db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` (`customerid`, `username`, `password`, `path`) VALUES ('" . (int)$userinfo['customerid'] . "', '" . $db->escape($username) . "', '" . $db->escape($password) . "', '" . $db->escape($path) . "')");
$db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` (`customerid`, `username`, `password`, `path`, `authname`) VALUES ('" . (int)$userinfo['customerid'] . "', '" . $db->escape($username) . "', '" . $db->escape($password) . "', '" . $db->escape($path) . "', '" . $db->escape($authname) . "')");
$log->logAction(USR_ACTION, LOG_INFO, "added htpasswd for '" . $username . " (" . $path . ")'");
inserttask('1');
redirectTo($filename, Array('page' => $page, 's' => $s));
@@ -166,7 +167,7 @@ elseif($page == 'htpasswds')
elseif($action == 'edit'
&& $id != 0)
{
$result = $db->query_first("SELECT `id`, `username`, `path` FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
if(isset($result['username'])
&& $result['username'] != '')
@@ -175,6 +176,7 @@ elseif($page == 'htpasswds')
&& $_POST['send'] == 'send')
{
validate($_POST['directory_password'], 'password');
$authname = validate($_POST['directory_authname'], 'directory_authname', '/^[a-zA-Z0-9][a-zA-Z0-9\-_ ]+\$?$/');
if(CRYPT_STD_DES == 1)
{
@@ -186,13 +188,25 @@ elseif($page == 'htpasswds')
$password = crypt($_POST['directory_password']);
}
if($_POST['directory_password'] == '')
$pwd_sql = '';
if($_POST['directory_password'] != '')
{
standard_error(array('stringisempty', 'mypassword'));
$pwd_sql = "`password`='" . $db->escape($password) . "' ";
}
else
$auth_sql = '';
if($authname != $result['authname'])
{
$db->query("UPDATE `" . TABLE_PANEL_HTPASSWDS . "` SET `password`='" . $db->escape($password) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
$auth_sql = "`authname`='" . $db->escape($authname) . "' ";
}
if($pwd_sql != '' || $auth_sql != '')
{
if($pwd_sql !='' && $auth_sql != '') {
$pwd_sql.= ', ';
}
$db->query("UPDATE `" . TABLE_PANEL_HTPASSWDS . "` SET ".$pwd_sql.$auth_sql." WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
$log->logAction(USR_ACTION, LOG_INFO, "edited htpasswd for '" . $result['username'] . " (" . $result['path'] . ")'");
inserttask('1');
redirectTo($filename, Array('page' => $page, 's' => $s));
@@ -221,10 +235,11 @@ elseif($page == 'htaccess')
'options_indexes' => $lng['extras']['view_directory'],
'error404path' => $lng['extras']['error404path'],
'error403path' => $lng['extras']['error403path'],
'error500path' => $lng['extras']['error500path']
'error500path' => $lng['extras']['error500path'],
'options_cgi' => $lng['extras']['execute_perl']
);
$paging = new paging($userinfo, $db, TABLE_PANEL_HTACCESS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
$result = $db->query("SELECT `id`, `path`, `options_indexes`, `error404path`, `error403path`, `error500path` FROM `" . TABLE_PANEL_HTACCESS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_HTACCESS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
$paging->setEntries($db->num_rows($result));
$sortcode = $paging->getHtmlSortCode($lng);
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
@@ -234,6 +249,8 @@ elseif($page == 'htaccess')
$count = 0;
$htaccess = '';
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
while($row = $db->fetch_array($result))
{
if($paging->checkDisplay($i))
@@ -241,10 +258,14 @@ elseif($page == 'htaccess')
if(strpos($row['path'], $userinfo['documentroot']) === 0)
{
$row['path'] = substr($row['path'], strlen($userinfo['documentroot']));
// don't show nothing wehn it's the docroot, show slash
if ($row['path'] == '') { $row['path'] = '/'; }
}
$row['options_indexes'] = str_replace('1', $lng['panel']['yes'], $row['options_indexes']);
$row['options_indexes'] = str_replace('0', $lng['panel']['no'], $row['options_indexes']);
$row['options_cgi'] = str_replace('1', $lng['panel']['yes'], $row['options_cgi']);
$row['options_cgi'] = str_replace('0', $lng['panel']['no'], $row['options_cgi']);
$row = htmlentities_array($row);
eval("\$htaccess.=\"" . getTemplate("extras/htaccess_htaccess") . "\";");
$count++;
@@ -293,35 +314,18 @@ elseif($page == 'htaccess')
standard_error('invalidpath');
}
if(($_POST['error404path'] === '')
|| (validateUrl($idna_convert->encode($_POST['error404path']))))
if(isset($_POST['options_cgi']))
{
$error404path = $_POST['error404path'];
$options_cgi = intval($_POST['options_cgi']);
}
else
{
standard_error('mustbeurl');
$options_cgi = '0';
}
if(($_POST['error403path'] === '')
|| (validateUrl($idna_convert->encode($_POST['error403path']))))
{
$error403path = $_POST['error403path'];
}
else
{
standard_error('mustbeurl');
}
if(($_POST['error500path'] === '')
|| (validateUrl($idna_convert->encode($_POST['error500path']))))
{
$error500path = $_POST['error500path'];
}
else
{
standard_error('mustbeurl');
}
$error404path = correctErrorDocument($_POST['error404path']);
$error403path = correctErrorDocument($_POST['error403path']);
$error500path = correctErrorDocument($_POST['error500path']);
if($path_dupe_check['path'] == $path)
{
@@ -333,7 +337,15 @@ elseif($page == 'htaccess')
}
else
{
$db->query('INSERT INTO `' . TABLE_PANEL_HTACCESS . '` (`customerid`, `path`, `options_indexes`, `error404path`, `error403path`, `error500path` ) VALUES ("' . (int)$userinfo['customerid'] . '", "' . $db->escape($path) . '", "' . $db->escape($_POST['options_indexes'] == '1' ? '1' : '0') . '", "' . $db->escape($error404path) . '", "' . $db->escape($error403path) . '", "' . $db->escape($error500path) . '" )');
$db->query('INSERT INTO `' . TABLE_PANEL_HTACCESS . '` SET
`customerid` = "'.(int)$userinfo['customerid'].'",
`path` = "'.$db->escape($path).'",
`options_indexes` = "'.$db->escape($_POST['options_indexes'] == '1' ? '1' : '0').'",
`error404path` = "'.$db->escape($error404path).'",
`error403path` = "'.$db->escape($error403path).'",
`error500path` = "'.$db->escape($error500path).'",
`options_cgi` = "'.$db->escape($options_cgi).'"');
$log->logAction(USR_ACTION, LOG_INFO, "added htaccess for '" . $path . "'");
inserttask('1');
redirectTo($filename, Array('page' => $page, 's' => $s));
@@ -342,7 +354,9 @@ elseif($page == 'htaccess')
else
{
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
$options_indexes = makeyesno('options_indexes', '1', '0', '1');
$options_indexes = makeyesno('options_indexes', '1', '0', '0');
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
$options_cgi = makeyesno('options_cgi', '1', '0', '0');
eval("echo \"" . getTemplate("extras/htaccess_add") . "\";");
}
}
@@ -359,49 +373,30 @@ elseif($page == 'htaccess')
&& $_POST['send'] == 'send')
{
$option_indexes = intval($_POST['options_indexes']);
$options_cgi = isset($_POST['options_cgi']) ? intval($_POST['options_cgi']) : 0;
if($option_indexes != '1')
{
$option_indexes = '0';
}
if(($_POST['error404path'] === '')
|| (validateUrl($idna_convert->encode($_POST['error404path']))))
if($options_cgi != '1')
{
$error404path = $_POST['error404path'];
}
else
{
standard_error('mustbeurl');
$options_cgi = '0';
}
if(($_POST['error403path'] === '')
|| (validateUrl($idna_convert->encode($_POST['error403path']))))
{
$error403path = $_POST['error403path'];
}
else
{
standard_error('mustbeurl');
}
if(($_POST['error500path'] === '')
|| (validateUrl($idna_convert->encode($_POST['error500path']))))
{
$error500path = $_POST['error500path'];
}
else
{
standard_error('mustbeurl');
}
$error404path = correctErrorDocument($_POST['error404path']);
$error403path = correctErrorDocument($_POST['error403path']);
$error500path = correctErrorDocument($_POST['error500path']);
if(($option_indexes != $result['options_indexes'])
|| ($error404path != $result['error404path'])
|| ($error403path != $result['error403path'])
|| ($error500path != $result['error500path']))
|| ($error500path != $result['error500path'])
|| ($options_cgi != $result['options_cgi']))
{
inserttask('1');
$db->query('UPDATE `' . TABLE_PANEL_HTACCESS . '` SET `options_indexes` = "' . $db->escape($option_indexes) . '", `error404path` = "' . $db->escape($error404path) . '", `error403path` = "' . $db->escape($error403path) . '", `error500path` = "' . $db->escape($error500path) . '" WHERE `customerid` = "' . (int)$userinfo['customerid'] . '" AND `id` = "' . (int)$id . '"');
$db->query('UPDATE `' . TABLE_PANEL_HTACCESS . '` SET `options_indexes` = "' . $db->escape($option_indexes) . '", `error404path` = "' . $db->escape($error404path) . '", `error403path` = "' . $db->escape($error403path) . '", `error500path` = "' . $db->escape($error500path) . '", `options_cgi` = "' . $db->escape($options_cgi) . '" WHERE `customerid` = "' . (int)$userinfo['customerid'] . '" AND `id` = "' . (int)$id . '"');
$log->logAction(USR_ACTION, LOG_INFO, "edited htaccess for '" . str_replace($userinfo['documentroot'], '', $result['path']) . "'");
}
@@ -412,12 +407,16 @@ elseif($page == 'htaccess')
if(strpos($result['path'], $userinfo['documentroot']) === 0)
{
$result['path'] = substr($result['path'], strlen($userinfo['documentroot']));
// don't show nothing wehn it's the docroot, show slash
if ($result['path'] == '') { $result['path'] = '/'; }
}
$result['error404path'] = $result['error404path'];
$result['error403path'] = $result['error403path'];
$result['error500path'] = $result['error500path'];
$options_indexes = makeyesno('options_indexes', '1', '0', $result['options_indexes']);
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
$options_cgi = makeyesno('options_cgi', '1', '0', $result['options_cgi']);
$result = htmlentities_array($result);
eval("echo \"" . getTemplate("extras/htaccess_edit") . "\";");
}

View File

@@ -106,8 +106,6 @@ elseif($page == 'accounts')
$log->logAction(USR_ACTION, LOG_INFO, "deleted ftp-account '" . $result['username'] . "'");
$db->query("UPDATE `" . TABLE_FTP_GROUPS . "` SET `members`=REPLACE(`members`,'," . $db->escape($result['username']) . "','') WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
// $db->query("DELETE FROM `".TABLE_FTP_GROUPS."` WHERE `customerid`='".$userinfo['customerid']."' AND `id`='$id'");
if($userinfo['ftps_used'] == '1')
{
$resetaccnumber = " , `ftp_lastaccountnumber`='0'";
@@ -117,12 +115,19 @@ elseif($page == 'accounts')
$resetaccnumber = '';
}
// refs #293
if(isset($_POST['delete_userfiles'])
&& (int)$_POST['delete_userfiles'] == 1)
{
inserttask('8', $userinfo['loginname'], $result['homedir']);
}
$result = $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `ftps_used`=`ftps_used`-1 $resetaccnumber WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
redirectTo($filename, Array('page' => $page, 's' => $s));
}
else
{
ask_yesno('ftp_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['username']);
ask_yesno_withcheckbox('ftp_reallydelete', 'admin_customer_alsoremoveftphomedir', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['username']);
}
}
else
@@ -142,6 +147,12 @@ elseif($page == 'accounts')
$password = validate($_POST['ftp_password'], 'password');
$password = validatePassword($password);
$sendinfomail = intval($_POST['sendinfomail']);
if($sendinfomail != 1)
{
$sendinfomail = 0;
}
if($settings['customer']['ftpatdomain'] == '1')
{
$ftpusername = validate($_POST['ftp_username'], 'username', '/^[a-zA-Z0-9][a-zA-Z0-9\-_]+\$?$/');
@@ -191,12 +202,51 @@ elseif($page == 'accounts')
$log->logAction(USR_ACTION, LOG_INFO, "added ftp-account '" . $username . " (" . $path . ")'");
inserttask(5);
if($sendinfomail == 1)
{
$replace_arr = array(
'CUST_NAME' => getCorrectUserSalutation($userinfo),
'USR_NAME' => $username,
'USR_PASS' => $password,
'USR_PATH' => makeCorrectDir(substr($path, strlen($userinfo['documentroot'])))
);
$def_language = $userinfo['def_language'];
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'new_ftpaccount_by_customer_subject\'');
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['ftp_add']['infomail_subject']), $replace_arr));
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'new_ftpaccount_by_customer_mailbody\'');
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['ftp_add']['infomail_body']['main']), $replace_arr));
$_mailerror = false;
try {
$mail->Subject = $mail_subject;
$mail->AltBody = $mail_body;
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
$mail->AddAddress($userinfo['email'], getCorrectUserSalutation($userinfo));
$mail->Send();
} catch(phpmailerException $e) {
$mailerr_msg = $e->errorMessage();
$_mailerror = true;
} catch (Exception $e) {
$mailerr_msg = $e->getMessage();
$_mailerror = true;
}
if ($_mailerror) {
$log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
standard_error('errorsendingmail', $userinfo['email']);
}
$mail->ClearAddresses();
}
redirectTo($filename, Array('page' => $page, 's' => $s));
}
}
else
{
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], '/');
if($settings['customer']['ftpatdomain'] == '1')
{
@@ -210,6 +260,8 @@ elseif($page == 'accounts')
}
}
$sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
eval("echo \"" . getTemplate("ftp/accounts_add") . "\";");
}
}

View File

@@ -172,9 +172,14 @@ elseif($page == 'change_language')
{
$language_options = '';
$default_lang = $settings['panel']['standardlanguage'];
if($userinfo['def_language'] != '') {
$default_lang = $userinfo['def_language'];
}
while(list($language_file, $language_name) = each($languages))
{
$language_options.= makeoption($language_name, $language_file, $userinfo['def_language'], true);
$language_options.= makeoption($language_name, $language_file, $default_lang, true);
}
eval("echo \"" . getTemplate("index/change_language") . "\";");

View File

@@ -52,7 +52,7 @@ elseif($page == 'mysqls')
'description' => $lng['mysql']['databasedescription']
);
$paging = new paging($userinfo, $db, TABLE_PANEL_DATABASES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
$result = $db->query("SELECT `id`, `databasename`, `description`, `dbserver` FROM `" . TABLE_PANEL_DATABASES . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_DATABASES . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
$paging->setEntries($db->num_rows($result));
$sortcode = $paging->getHtmlSortCode($lng);
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
@@ -194,11 +194,10 @@ elseif($page == 'mysqls')
if($sendinfomail == 1)
{
$pma = '';
$pma = $lng['admin']['notgiven'];
if($settings['panel']['phpmyadmin_url'] != '')
{
$r_arr = array('URI' => $settings['panel']['phpmyadmin_url']);
$pma = replace_variables($lng['customer']['mysql_add']['infomail_body']['pma'], $r_arr);
$pma = $settings['panel']['phpmyadmin_url'];
}
$replace_arr = array(
@@ -210,11 +209,15 @@ elseif($page == 'mysqls')
'PMA_URI' => $pma
);
$mail_body = replace_variables($lng['customer']['mysql_add']['infomail_body']['main'], $replace_arr);
$def_language = $userinfo['def_language'];
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'new_database_by_customer_subject\'');
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['mysql_add']['infomail_subject']), $replace_arr));
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'new_database_by_customer_mailbody\'');
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['mysql_add']['infomail_body']['main']), $replace_arr));
$_mailerror = false;
try {
$mail->Subject = $lng['customer']['mysql_add']['infomail_subject'];
$mail->Subject = $mail_subject;
$mail->AltBody = $mail_body;
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
$mail->AddAddress($userinfo['email'], getCorrectUserSalutation($userinfo));
@@ -270,14 +273,14 @@ elseif($page == 'mysqls')
&& $_POST['send'] == 'send')
{
// Only change Password if it is set, do nothing if it is empty! -- PH 2004-11-29
$password = validate($_POST['mysql_password'], 'password');
$password = validatePassword($password);
if($password != '')
{
// Begin root-session
// validate password
$password = validatePassword($password);
// Begin root-session
$db_root = new db($sql_root[$result['dbserver']]['host'], $sql_root[$result['dbserver']]['user'], $sql_root[$result['dbserver']]['password'], '');
unset($db_root->password);
foreach(array_map('trim', explode(',', $settings['system']['mysql_access_host'])) as $mysql_access_host)

View File

@@ -221,14 +221,14 @@ if($action == 'forgotpwd')
{
$loginname = validate($_POST['loginname'], 'loginname');
$email = validateEmail($_POST['loginemail'], 'email');
$sql = "SELECT `customerid`, `firstname`, `name`, `email`, `loginname` FROM `" . TABLE_PANEL_CUSTOMERS . "`
$sql = "SELECT `adminid`, `customerid`, `firstname`, `name`, `company`, `email`, `loginname`, `def_language` FROM `" . TABLE_PANEL_CUSTOMERS . "`
WHERE `loginname`='" . $db->escape($loginname) . "'
AND `email`='" . $db->escape($email) . "'";
$result = $db->query($sql);
if($db->num_rows() == 0)
{
$sql = "SELECT `adminid`, `name`, `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "`
$sql = "SELECT `adminid`, `name`, `email`, `loginname`, `def_language` FROM `" . TABLE_PANEL_ADMINS . "`
WHERE `loginname`='" . $db->escape($loginname) . "'
AND `email`='" . $db->escape($email) . "'";
$result = $db->query($sql);
@@ -280,13 +280,26 @@ if($action == 'forgotpwd')
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
$rstlog->logAction(USR_ACTION, LOG_WARNING, "Password for user '" . $user['loginname'] . "' has been reset!");
$replace_arr = array(
'SALUTATION' => getCorrectUserSalutation($user),
'USERNAME' => $user['loginname'],
'PASSWORD' => $password
);
$body = strtr($lng['pwdreminder']['body'], array('%s' => $user['firstname'] . ' ' . $user['name'], '%p' => $password));
$def_language = ($user['def_language'] != '') ? $user['def_language'] : $settings['panel']['standardlanguage'];
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$user['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'password_reset_subject\'');
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['pwdreminder']['subject']), $replace_arr));
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$user['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'password_reset_mailbody\'');
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $body), $replace_arr));
$_mailerror = false;
try {
$mail->Subject = $lng['pwdreminder']['subject'];
$mail->AltBody = $body;
$mail->MsgHTML(str_replace("\\n", "<br />", $body));
$mail->Subject = $mail_subject;
$mail->AltBody = $mail_body;
$mail->MsgHTML(str_replace("\\n", "<br />", $mail_body));
$mail->AddAddress($user['email'], $user['firstname'] . ' ' . $user['name']);
$mail->Send();
} catch(phpmailerException $e) {

View File

@@ -227,6 +227,7 @@ CREATE TABLE `panel_customers` (
`imap` tinyint(1) NOT NULL default '1',
`aps_packages` int(5) NOT NULL default '0',
`aps_packages_used` int(5) NOT NULL default '0',
`perlenabled` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`customerid`),
UNIQUE KEY `loginname` (`loginname`)
) TYPE=MyISAM ;
@@ -248,6 +249,7 @@ CREATE TABLE `panel_databases` (
`databasename` varchar(255) NOT NULL default '',
`description` varchar(255) NOT NULL default '',
`dbserver` int(11) unsigned NOT NULL default '0',
`apsdb` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `customerid` (`customerid`)
) TYPE=MyISAM ;
@@ -299,6 +301,7 @@ CREATE TABLE `panel_domains` (
`phpsettingid` INT( 11 ) UNSIGNED NOT NULL DEFAULT '1',
`mod_fcgid_starter` int(4) default '-1',
`mod_fcgid_maxrequests` int(4) default '-1',
`ismainbutsubto` int(11) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `customerid` (`customerid`),
KEY `parentdomain` (`parentdomainid`),
@@ -355,6 +358,7 @@ CREATE TABLE `panel_htaccess` (
`error403path` varchar(255) NOT NULL default '',
`error500path` varchar(255) NOT NULL default '',
`error401path` varchar(255) NOT NULL default '',
`options_cgi` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
@@ -376,6 +380,7 @@ CREATE TABLE `panel_htpasswds` (
`path` varchar(255) NOT NULL default '',
`username` varchar(255) NOT NULL default '',
`password` varchar(255) NOT NULL default '',
`authname` varchar(255) NOT NULL default 'Restricted Area',
PRIMARY KEY (`id`),
KEY `customerid` (`customerid`)
) TYPE=MyISAM ;
@@ -451,7 +456,7 @@ INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) V
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (18, 'system', 'vmail_homedir', '/var/customers/mail/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (19, 'system', 'bindconf_directory', '/etc/bind/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (20, 'system', 'bindreload_command', '/etc/init.d/bind9 reload');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9.6');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9.12');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (23, 'system', 'hostname', 'SERVERNAME');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (24, 'login', 'maxloginattempts', '3');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (25, 'login', 'deactivatetime', '900');
@@ -523,7 +528,7 @@ INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) V
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (92, 'admin', 'show_version_login', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (93, 'admin', 'show_version_footer', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (94, 'admin', 'froxlor_graphic', 'images/header.gif');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (95, 'system', 'mod_fcgid_wrapper', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (95, 'system', 'mod_fcgid_wrapper', '1');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (96, 'system', 'mod_fcgid_starter', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (97, 'system', 'mod_fcgid_peardir', '/usr/share/php/:/usr/share/php5/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (98, 'system', 'index_file_extension', 'html');
@@ -568,7 +573,18 @@ INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) V
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (137, 'ticket', 'default_priority', '2');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (138, 'system', 'mod_fcgid_defaultini', '1');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (139, 'system', 'ftpserver', 'proftpd');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (140, 'customredirect', 'enabled', '1');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (141, 'customredirect', 'default', '1');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (142, 'system', 'dns_createmailentry', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (143, 'system', 'froxlordirectlyviahostname', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (144, 'panel', 'password_regex', '');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (145, 'system', 'perl_path', '/usr/bin/perl');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (146, 'system', 'mod_fcgid_ownvhost', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (147, 'system', 'mod_fcgid_httpuser', 'froxlorlocal');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (148, 'system', 'mod_fcgid_httpgroup', 'froxlorlocal');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (149, 'perl', 'suexecworkaround', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (150, 'perl', 'suexecpath', '/var/www/cgi-bin/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (151, 'system', 'awstats_awstatspath', '/usr/bin/');
# --------------------------------------------------------
@@ -828,6 +844,7 @@ CREATE TABLE IF NOT EXISTS `panel_syslog` (
# Table structure for table `mail_autoresponder`
#
DROP TABLE IF EXISTS `mail_autoresponder`;
CREATE TABLE `mail_autoresponder` (
`email` varchar(255) NOT NULL default '',
`message` text NOT NULL,
@@ -852,6 +869,7 @@ CREATE TABLE `mail_autoresponder` (
# Table structure for table `panel_phpconfigs`
#
DROP TABLE IF EXISTS `panel_phpconfigs`;
CREATE TABLE `panel_phpconfigs` (
`id` int(11) unsigned NOT NULL auto_increment,
`description` varchar(50) NOT NULL,
@@ -875,6 +893,7 @@ INSERT INTO `panel_phpconfigs` (`id`, `description`, `binary`, `file_extensions`
# Tabellenstruktur fuer Tabelle `aps_instances`
#
DROP TABLE IF EXISTS `aps_instances`;
CREATE TABLE IF NOT EXISTS `aps_instances` (
`ID` int(4) NOT NULL auto_increment,
`CustomerID` int(4) NOT NULL,
@@ -889,6 +908,7 @@ CREATE TABLE IF NOT EXISTS `aps_instances` (
# Tabellenstruktur fuer Tabelle `aps_packages`
#
DROP TABLE IF EXISTS `aps_packages`;
CREATE TABLE IF NOT EXISTS `aps_packages` (
`ID` int(4) NOT NULL auto_increment,
`Path` varchar(500) NOT NULL,
@@ -905,6 +925,7 @@ CREATE TABLE IF NOT EXISTS `aps_packages` (
# Tabellenstruktur fuer Tabelle `aps_settings`
#
DROP TABLE IF EXISTS `aps_settings`;
CREATE TABLE IF NOT EXISTS `aps_settings` (
`ID` int(4) NOT NULL auto_increment,
`InstanceID` int(4) NOT NULL,
@@ -919,6 +940,7 @@ CREATE TABLE IF NOT EXISTS `aps_settings` (
# Tabellenstruktur fuer Tabelle `aps_tasks`
#
DROP TABLE IF EXISTS `aps_tasks`;
CREATE TABLE IF NOT EXISTS `aps_tasks` (
`ID` int(4) NOT NULL auto_increment,
`InstanceID` int(4) NOT NULL,
@@ -932,6 +954,7 @@ CREATE TABLE IF NOT EXISTS `aps_tasks` (
# Tabellenstruktur fuer Tabelle `aps_temp_settings`
#
DROP TABLE IF EXISTS `aps_temp_settings`;
CREATE TABLE IF NOT EXISTS `aps_temp_settings` (
`ID` int(4) NOT NULL auto_increment,
`PackageID` int(4) NOT NULL,
@@ -947,6 +970,7 @@ CREATE TABLE IF NOT EXISTS `aps_temp_settings` (
# Tabellenstruktur fuer Tabelle `cronjobs_run`
#
DROP TABLE IF EXISTS `cronjobs_run`;
CREATE TABLE IF NOT EXISTS `cronjobs_run` (
`id` bigint(20) NOT NULL auto_increment,
`module` varchar(250) NOT NULL,
@@ -968,7 +992,7 @@ INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`,
INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (4, 'froxlor/autoresponder', 'cron_autoresponder.php', '5 MINUTE', '0', 'cron_autoresponder');
INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (5, 'froxlor/aps', 'cron_apsupdater.php', '1 HOUR', '0', 'cron_apsupdater');
INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (6, 'froxlor/core', 'cron_traffic.php', '1 DAY', '1', 'cron_traffic');
INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (7, 'froxlor/ticket', 'cron_used_tickets_reset.php', '1 MONTH', '1', 'cron_ticketsreset');
INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (7, 'froxlor/ticket', 'cron_used_tickets_reset.php', '1 DAY', '1', 'cron_ticketsreset');
INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (8, 'froxlor/ticket', 'cron_ticketarchive.php', '1 MONTH', '1', 'cron_ticketarchive');
# --------------------------------------------------------
@@ -977,6 +1001,7 @@ INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`,
# Tabellenstruktur fuer Tabelle `ftp_quotalimits`
#
DROP TABLE IF EXISTS `ftp_quotalimits`;
CREATE TABLE IF NOT EXISTS `ftp_quotalimits` (
`name` varchar(30) default NULL,
`quota_type` enum('user','group','class','all') NOT NULL default 'user',
@@ -1002,6 +1027,7 @@ INSERT INTO `ftp_quotalimits` (`name`, `quota_type`, `per_session`, `limit_type`
# Tabellenstruktur fuer Tabelle `ftp_quotatallies`
#
DROP TABLE IF EXISTS `ftp_quotatallies`;
CREATE TABLE IF NOT EXISTS `ftp_quotatallies` (
`name` varchar(30) NOT NULL,
`quota_type` enum('user','group','class','all') NOT NULL,
@@ -1012,3 +1038,41 @@ CREATE TABLE IF NOT EXISTS `ftp_quotatallies` (
`files_out_used` int(10) unsigned NOT NULL,
`files_xfer_used` int(10) unsigned NOT NULL
) ENGINE=MyISAM;
# --------------------------------------------------------
#
# Tabellenstruktur fuer Tabelle `redirect_codes`
#
DROP TABLE IF EXISTS `redirect_codes`;
CREATE TABLE IF NOT EXISTS `redirect_codes` (
`id` int(5) NOT NULL auto_increment,
`code` varchar(3) NOT NULL,
`desc` varchar(200) NOT NULL,
`enabled` tinyint(1) DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM;
#
# Dumping data for table `redirect_codes`
#
INSERT INTO `redirect_codes` (`id`, `code`, `desc`, `enabled`) VALUES (1, '---', 'rc_default', 1);
INSERT INTO `redirect_codes` (`id`, `code`, `desc`, `enabled`) VALUES (2, '301', 'rc_movedperm', 1);
INSERT INTO `redirect_codes` (`id`, `code`, `desc`, `enabled`) VALUES (3, '302', 'rc_found', 1);
INSERT INTO `redirect_codes` (`id`, `code`, `desc`, `enabled`) VALUES (4, '303', 'rc_seeother', 1);
INSERT INTO `redirect_codes` (`id`, `code`, `desc`, `enabled`) VALUES (5, '307', 'rc_tempred', 1);
# --------------------------------------------------------
#
# Tabellenstruktur fuer Tabelle `domain_redirect_codes`
#
DROP TABLE IF EXISTS `domain_redirect_codes`;
CREATE TABLE IF NOT EXISTS `domain_redirect_codes` (
`rid` int(5) NOT NULL,
`did` int(11) unsigned NOT NULL,
UNIQUE KEY `rc` (`rid`, `did`)
) ENGINE=MyISAM;

View File

@@ -499,9 +499,19 @@ if(isset($_POST['installstep'])
//first we make a backup of the old DB if it exists
status_message('begin', $lng['install']['backup_old_db']);
$result = mysql_list_tables($mysql_database);
if($result)
$sql = "SHOW TABLES FROM $mysql_database";
$result = mysql_query($sql);
// check the first row
$row = mysql_fetch_row($result);
$tables_exist = false;
if(isset($row[0]) && $row[0] != '')
{
$tables_exist = true;
}
if($tables_exist)
{
$filename = "/tmp/froxlor_backup_" . date('YmdHi') . ".sql";
@@ -637,6 +647,7 @@ if(isset($_POST['installstep'])
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/lighttpd/froxlor-htpasswd/' WHERE `settinggroup` = 'system' AND `varname` = 'apacheconf_htpasswddir'");
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/init.d/lighttpd reload' WHERE `settinggroup` = 'system' AND `varname` = 'apachereload_command'");
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/lighttpd/lighttpd.pem' WHERE `settinggroup` = 'system' AND `varname` = 'ssl_cert_file'");
$ssettings = '';
}
// insert the lastcronrun to be the installation date

View File

@@ -280,7 +280,8 @@ if(isFroxlorVersion('0.9-r3'))
if(isFroxlorVersion('0.9-r4'))
{
showUpdateStep("Updating from 0.9-r4 to 0.9 final", false);
showUpdateStep("Updating from 0.9-r4 to 0.9 final");
lastStepStatus(0);
updateToVersion('0.9');
}
@@ -414,13 +415,14 @@ if(isFroxlorVersion('0.9.4'))
) {
showUpdateStep("Updating awstats path setting");
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/usr/bin/' WHERE `settinggroup` = 'system' AND `varname` = 'awstats_path';");
lastStepStatus(0);
}
else
elseif(!isset($settings['system']['awstats_path']))
{
showUpdateStep("Adding new awstats path setting");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'awstats_path', '/usr/bin/');");
}
lastStepStatus(0);
}
if(isset($settings['system']['awstats_domain_file'])
&& $settings['system']['awstats_domain_file'] != ''
@@ -550,21 +552,21 @@ if(isFroxlorVersion('0.9.6-svn2'))
if(isset($_POST['update_deferr_401'])
&& trim($_POST['update_deferr_401']) != ''
) {
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err500', '".$db->escape($_POST['update_deferr_401'])."');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err401', '".$db->escape($_POST['update_deferr_401'])."');");
$err401 = true;
}
if(isset($_POST['update_deferr_403'])
&& trim($_POST['update_deferr_403']) != ''
) {
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err500', '".$db->escape($_POST['update_deferr_403'])."');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err403', '".$db->escape($_POST['update_deferr_403'])."');");
$err403 = true;
}
if(isset($_POST['update_deferr_404'])
&& trim($_POST['update_deferr_404']) != ''
) {
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err500', '".$db->escape($_POST['update_deferr_404'])."');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err404', '".$db->escape($_POST['update_deferr_404'])."');");
$err404 = true;
}
}
@@ -633,7 +635,7 @@ if(isFroxlorVersion('0.9.6-svn5'))
$db->query("INSERT INTO `panel_settings` SET `settinggroup` = 'system', `varname` = 'ftpserver', `value` = '".$db->escape($update_defsys_ftpserver)."';");
// add proftpd quota
$db->query("CREATE TABLE`ftp_quotalimits` (`name` varchar(30) default NULL, `quota_type` enum('user','group','class','all') NOT NULL default 'user', `per_session` enum('false','true') NOT NULL default 'false', `limit_type` enum('soft','hard') NOT NULL default 'hard', `bytes_in_avail` float NOT NULL, `bytes_out_avail` float NOT NULL, `bytes_xfer_avail` float NOT NULL, `files_in_avail` int(10) unsigned NOT NULL, `files_out_avail` int(10) unsigned NOT NULL, `files_xfer_avail` int(10) unsigned NOT NULL) ENGINE=MyISAM;");
$db->query("CREATE TABLE `ftp_quotalimits` (`name` varchar(30) default NULL, `quota_type` enum('user','group','class','all') NOT NULL default 'user', `per_session` enum('false','true') NOT NULL default 'false', `limit_type` enum('soft','hard') NOT NULL default 'hard', `bytes_in_avail` float NOT NULL, `bytes_out_avail` float NOT NULL, `bytes_xfer_avail` float NOT NULL, `files_in_avail` int(10) unsigned NOT NULL, `files_out_avail` int(10) unsigned NOT NULL, `files_xfer_avail` int(10) unsigned NOT NULL) ENGINE=MyISAM;");
$db->query("INSERT INTO `ftp_quotalimits` (`name`, `quota_type`, `per_session`, `limit_type`, `bytes_in_avail`, `bytes_out_avail`, `bytes_xfer_avail`, `files_in_avail`, `files_out_avail`, `files_xfer_avail`) VALUES ('froxlor', 'user', 'false', 'hard', 0, 0, 0, 0, 0, 0);");
@@ -661,4 +663,367 @@ if(isFroxlorVersion('0.9.6-svn6'))
updateToVersion('0.9.6');
}
?>
if(isFroxlorVersion('0.9.6'))
{
showUpdateStep("Updating from 0.9.6 to 0.9.7-svn1", false);
$update_customredirect_enable = isset($_POST['update_customredirect_enable']) ? 1 : 0;
$update_customredirect_default = isset($_POST['update_customredirect_default']) ? (int)$_POST['update_customredirect_default'] : 1;
showUpdateStep("Adding new tables to database");
$db->query("CREATE TABLE IF NOT EXISTS `redirect_codes` (
`id` int(5) NOT NULL auto_increment,
`code` varchar(3) NOT NULL,
`enabled` tinyint(1) DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM;");
$db->query("CREATE TABLE IF NOT EXISTS `domain_redirect_codes` (
`rid` int(5) NOT NULL,
`did` int(11) unsigned NOT NULL,
UNIQUE KEY `rc` (`rid`, `did`)
) ENGINE=MyISAM;");
lastStepStatus(0);
showUpdateStep("Filling new tables with default data");
$db->query("INSERT INTO `redirect_codes` (`id`, `code`, `enabled`) VALUES (1, '---', 1);");
$db->query("INSERT INTO `redirect_codes` (`id`, `code`, `enabled`) VALUES (2, '301', 1);");
$db->query("INSERT INTO `redirect_codes` (`id`, `code`, `enabled`) VALUES (3, '302', 1);");
$db->query("INSERT INTO `redirect_codes` (`id`, `code`, `enabled`) VALUES (4, '303', 1);");
$db->query("INSERT INTO `redirect_codes` (`id`, `code`, `enabled`) VALUES (5, '307', 1);");
lastStepStatus(0);
showUpdateStep("Updating domains");
$res = $db->query("SELECT `id` FROM `".TABLE_PANEL_DOMAINS."` ORDER BY `id` ASC");
$updated_domains = 0;
while($d = $db->fetch_array($res))
{
$db->query("INSERT INTO `domain_redirect_codes` (`rid`, `did`) VALUES ('".(int)$update_customredirect_default."', '".(int)$d['id']."');");
$updated_domains++;
}
lastStepStatus(0, 'Updated '.$updated_domains.' domain(s)');
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('customredirect', 'enabled', '".(int)$update_customredirect_enable."');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('customredirect', 'default', '".(int)$update_customredirect_default."');");
lastStepStatus(0);
// need to fix default-error-copy-and-paste-shizzle
showUpdateStep("Checking if anything is ok with the default-error-handler");
if(!isset($settings['defaultwebsrverrhandler']['err404']))
{
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err404', '');");
}
if(!isset($settings['defaultwebsrverrhandler']['err403']))
{
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err403', '');");
}
if(!isset($settings['defaultwebsrverrhandler']['err401']))
{
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err401', '');");
}
lastStepStatus(0);
updateToVersion('0.9.7-svn1');
}
if(isFroxlorVersion('0.9.7-svn1'))
{
showUpdateStep("Updating from 0.9.7-svn1 to 0.9.7-svn2", false);
showUpdateStep("Updating open_basedir due to security - issue");
$result = $db->query("SELECT `id` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `documentroot` LIKE '%:%' AND `documentroot` NOT LIKE 'http://%' AND `openbasedir_path` = '0' AND `openbasedir` = '1'");
while($row = $db->fetch_array($result))
{
$db->query("UPDATE `".TABLE_PANEL_DOMAINS."` SET `openbasedir_path` = '1' WHERE `id` = " . $row['id']);
}
lastStepStatus(0);
updateToVersion('0.9.7-svn2');
}
if(isFroxlorVersion('0.9.7-svn2'))
{
showUpdateStep("Updating from 0.9.7-svn2 to 0.9.7-svn3", false);
showUpdateStep("Updating database tables");
$db->query("ALTER TABLE `redirect_codes` ADD `desc` varchar(200) NOT NULL AFTER `code`;");
lastStepStatus(0);
showUpdateStep("Updating field-values");
$db->query("UPDATE `redirect_codes` SET `desc` = 'rc_default' WHERE `code` = '---';");
$db->query("UPDATE `redirect_codes` SET `desc` = 'rc_movedperm' WHERE `code` = '301';");
$db->query("UPDATE `redirect_codes` SET `desc` = 'rc_found' WHERE `code` = '302';");
$db->query("UPDATE `redirect_codes` SET `desc` = 'rc_seeother' WHERE `code` = '303';");
$db->query("UPDATE `redirect_codes` SET `desc` = 'rc_tempred' WHERE `code` = '307';");
lastStepStatus(0);
updateToVersion('0.9.7-svn3');
}
if(isFroxlorVersion('0.9.7-svn3'))
{
showUpdateStep("Updating from 0.9.7-svn3 to 0.9.7 final");
lastStepStatus(0);
updateToVersion('0.9.7');
}
if(isFroxlorVersion('0.9.7'))
{
showUpdateStep("Updating from 0.9.7 to 0.9.8 final");
lastStepStatus(0);
updateToVersion('0.9.8');
}
if(isFroxlorVersion('0.9.8'))
{
showUpdateStep("Updating from 0.9.8 to 0.9.9-svn1", false);
$update_defdns_mailentry = isset($_POST['update_defdns_mailentry']) ? '1' : '0';
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'dns_createmailentry', '".(int)$update_defdns_mailentry."');");
lastStepStatus(0);
updateToVersion('0.9.9-svn1');
}
if(isFroxlorVersion('0.9.9-svn1'))
{
showUpdateStep("Updating from 0.9.9-svn1 to 0.9.9 final");
lastStepStatus(0);
updateToVersion('0.9.9');
}
if(isFroxlorVersion('0.9.9'))
{
showUpdateStep("Updating from 0.9.9 to 0.9.10-svn1", false);
showUpdateStep("Checking whether you are missing any settings", false);
$nonefound = true;
$update_httpuser = isset($_POST['update_httpuser']) ? $_POST['update_httpuser'] : false;
$update_httpgroup = isset($_POST['update_httpgroup']) ? $_POST['update_httpgroup'] : false;
if($update_httpuser !== false)
{
$nonefound = false;
showUpdateStep("Adding missing setting 'httpuser'");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'httpuser', '".$update_httpuser."');");
lastStepStatus(0);
}
if($update_httpgroup !== false)
{
$nonefound = false;
showUpdateStep("Adding missing setting 'httpgroup'");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'httpgroup', '".$update_httpgroup."');");
lastStepStatus(0);
}
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'debug_cron'");
if(!isset($result) || !isset($result['value']))
{
$nonefound = false;
showUpdateStep("Adding missing setting 'debug_cron'");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'debug_cron', '0');");
lastStepStatus(0);
}
if($nonefound) {
showUpdateStep("No missing settings found");
lastStepStatus(0);
}
updateToVersion('0.9.10-svn1');
}
if(isFroxlorVersion('0.9.10-svn1'))
{
showUpdateStep("Updating from 0.9.10-svn1 to 0.9.10-svn2", false);
showUpdateStep("Updating database table definition for panel_databases");
$db->query("ALTER TABLE `" . TABLE_PANEL_DATABASES . "` ADD `apsdb` tinyint(1) NOT NULL default '0' AFTER `dbserver`;");
lastStepStatus(0);
showUpdateStep("Adding APS databases to customers overview");
$count_dbupdates = 0;
$db_root = null;
openRootDB();
$result = $db_root->query("SHOW DATABASES;");
while($row = $db_root->fetch_array($result))
{
if(preg_match('/^web([0-9]+)aps([0-9]+)$/', $row['Database'], $matches))
{
$cid = $matches[1];
$databasedescription = 'APS DB';
$result = $db->query('INSERT INTO `' . TABLE_PANEL_DATABASES . '` (`customerid`, `databasename`, `description`, `dbserver`, `apsdb`) VALUES ("' . (int)$cid . '", "' . $db->escape($row['Database']) . '", "' . $db->escape($databasedescription) . '", "0", "1")');
$result = $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`+1 WHERE `customerid`="' . (int)$cid . '"');
$count_dbupdates++;
}
}
closeRootDB();
if($count_dbupdates > 0) {
lastStepStatus(0, "Found ".$count_dbupdates." customer APS databases");
} else {
lastStepStatus(0, "None found");
}
updateToVersion('0.9.10-svn2');
}
if(isFroxlorVersion('0.9.10-svn2'))
{
showUpdateStep("Updating from 0.9.10-svn2 to 0.9.10", false);
$update_directlyviahostname = isset($_POST['update_directlyviahostname']) ? (int)$_POST['update_directlyviahostname'] : '0';
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'froxlordirectlyviahostname', '".(int)$update_directlyviahostname."');");
lastStepStatus(0);
updateToVersion('0.9.10');
}
if(isFroxlorVersion('0.9.10'))
{
showUpdateStep("Updating from 0.9.10 to 0.9.11-svn1", false);
$update_pwdregex = isset($_POST['update_pwdregex']) ? $_POST['update_pwdregex'] : '';
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'password_regex', '".$db->escape($update_pwdregex)."');");
lastStepStatus(0);
updateToVersion('0.9.11-svn1');
}
if(isFroxlorVersion('0.9.11-svn1'))
{
showUpdateStep("Updating from 0.9.11-svn1 to 0.9.11-svn2", false);
showUpdateStep("Adding perl/CGI directory fields");
$db->query("ALTER TABLE `".TABLE_PANEL_HTACCESS."` ADD `options_cgi` tinyint(1) NOT NULL default '0' AFTER `error401path`;");
$db->query("ALTER TABLE `".TABLE_PANEL_CUSTOMERS."` ADD `perlenabled` tinyint(1) NOT NULL default '0' AFTER `aps_packages_used`;");
lastStepStatus(0);
updateToVersion('0.9.11-svn2');
}
if(isFroxlorVersion('0.9.11-svn2'))
{
showUpdateStep("Updating from 0.9.11-svn2 to 0.9.11-svn3", false);
$update_perlpath = isset($_POST['update_perlpath']) ? $_POST['update_perlpath'] : '/usr/bin/perl';
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'perl_path', '".$db->escape($update_perlpath)."');");
lastStepStatus(0);
updateToVersion('0.9.11-svn3');
}
if(isFroxlorVersion('0.9.11-svn3'))
{
showUpdateStep("Updating from 0.9.11-svn3 to 0.9.11 final");
lastStepStatus(0);
updateToVersion('0.9.11');
}
if(isFroxlorVersion('0.9.11'))
{
showUpdateStep("Updating from 0.9.11 to 0.9.12-svn1", false);
$update_fcgid_ownvhost = isset($_POST['update_fcgid_ownvhost']) ? (int)$_POST['update_fcgid_ownvhost'] : '0';
$update_fcgid_httpuser = isset($_POST['update_fcgid_httpuser']) ? $_POST['update_fcgid_httpuser'] : 'froxlorlocal';
$update_fcgid_httpgroup = isset($_POST['update_fcgid_ownvhost']) ? $_POST['update_fcgid_ownvhost'] : 'froxlorlocal';
if($update_fcgid_httpuser == '') {
$update_fcgid_httpuser = 'froxlorlocal';
}
if($update_fcgid_httpgroup == '') {
$update_fcgid_httpgroup = 'froxlorlocal';
}
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'mod_fcgid_ownvhost', '".$db->escape($update_fcgid_ownvhost)."');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'mod_fcgid_httpuser', '".$db->escape($update_fcgid_httpuser)."');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'mod_fcgid_httpgroup', '".$db->escape($update_fcgid_httpgroup)."');");
lastStepStatus(0);
updateToVersion('0.9.12-svn1');
}
if(isFroxlorVersion('0.9.12-svn1'))
{
showUpdateStep("Updating from 0.9.12-svn1 to 0.9.12-svn2", false);
$update_perl_suexecworkaround = isset($_POST['update_perl_suexecworkaround']) ? (int)$_POST['update_perl_suexecworkaround'] : '0';
$update_perl_suexecpath = isset($_POST['update_perl_suexecpath']) ? makeCorrectDir($_POST['update_perl_suexecpath']) : '/var/www/cgi-bin/';
if($update_perl_suexecpath == '') {
$update_perl_suexecpath = '/var/www/cgi-bin/';
}
showUpdateStep("Adding new settings for perl/CGI");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('perl', 'suexecworkaround', '".$db->escape($update_perl_suexecworkaround)."');");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('perl', 'suexecpath', '".$db->escape($update_perl_suexecpath)."');");
lastStepStatus(0);
updateToVersion('0.9.12-svn2');
}
if(isFroxlorVersion('0.9.12-svn2'))
{
showUpdateStep("Updating from 0.9.12-svn2 to 0.9.12-svn3", false);
showUpdateStep("Adding new field to domain table");
$db->query("ALTER TABLE `".TABLE_PANEL_DOMAINS."` ADD `ismainbutsubto` int(11) unsigned NOT NULL default '0' AFTER `mod_fcgid_maxrequests`;");
lastStepStatus(0);
updateToVersion('0.9.12-svn3');
}
if(isFroxlorVersion('0.9.12-svn3'))
{
showUpdateStep("Updating from 0.9.12-svn3 to 0.9.12-svn4", false);
$update_awstats_awstatspath = isset($_POST['update_awstats_awstatspath']) ? makeCorrectDir($_POST['update_awstats_awstatspath']) : $settings['system']['awstats_path'];
showUpdateStep("Adding new settings for awstats");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'awstats_awstatspath', '".$db->escape($update_awstats_awstatspath)."');");
lastStepStatus(0);
updateToVersion('0.9.12-svn4');
}
if(isFroxlorVersion('0.9.12-svn4'))
{
showUpdateStep("Updating from 0.9.12-svn4 to 0.9.12-svn5", false);
showUpdateStep("Setting ticket-usage-reset cronjob interval to 1 day");
$db->query("UPDATE `cronjobs_run` SET `interval`='1 DAY' WHERE `cronfile`='cron_used_tickets_reset.php';");
lastStepStatus(0);
updateToVersion('0.9.12-svn5');
}
if(isFroxlorVersion('0.9.12-svn5'))
{
showUpdateStep("Updating from 0.9.12-svn5 to 0.9.12-svn6", false);
showUpdateStep("Adding new field to table 'panel_htpasswds'");
$db->query("ALTER TABLE `".TABLE_PANEL_HTPASSWDS."` ADD `authname` varchar(255) NOT NULL default 'Restricted Area' AFTER `password`;");
lastStepStatus(0);
updateToVersion('0.9.12-svn6');
}
if(isFroxlorVersion('0.9.12-svn6'))
{
showUpdateStep("Updating from 0.9.12-svn6 to 0.9.12 final");
lastStepStatus(0);
updateToVersion('0.9.12');
}

View File

@@ -33,7 +33,7 @@ function getPreConfig($current_version)
include_once makeCorrectFile(dirname(__FILE__).'/preconfig/0.9/preconfig_0.9.inc.php');
parseAndOutputPreconfig($has_preconfig, $return, $current_version);
$return .= '<br /><br />'.makecheckbox('update_changesagreed', '<strong>I have read the update notifications and I am aware of the changes made to my system.</strong>', '1', true, '0', true);
$return .= '<br /><br />'.makecheckbox('update_changesagreed', '<strong>I have read the update notifications above and I am aware of the changes made to my system.</strong>', '1', true, '0', true);
$return .= '</div>';
$return .= '<input type="hidden" name="update_preconfig" value="1" />';
@@ -55,7 +55,7 @@ function versionInUpdate($current_version, $version_to_check)
// to compare it correctly
if($pos_a === false && $pos_b !== false)
{
$current_version.= '-svn0';
$current_version.= '-svn9999';
}
return version_compare($current_version, $version_to_check, '<');

View File

@@ -26,7 +26,7 @@
*/
function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
{
global $settings, $lng;
global $settings, $lng, $db;
if(versionInUpdate($current_version, '0.9.4-svn2'))
{
@@ -83,8 +83,8 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
if(versionInUpdate($current_version, '0.9.6-svn5'))
{
$has_preconfig = true;
$description = 'If you have more than one PHP-configurations defined in Froxlor you can know set a default one which will be used for every domain.';
$question = '<strong>Select default PHP-configuration:</strong>&nbsp;';
$description = 'If you have more than one PHP configurations defined in Froxlor you can now set a default one which will be used for every domain.';
$question = '<strong>Select default PHP configuration:</strong>&nbsp;';
$question .= '<select name="update_defsys_phpconfig">';
$configs_array = getPhpConfigs();
$configs = '';
@@ -107,4 +107,176 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
$question .= '</select>';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.7-svn1'))
{
$has_preconfig = true;
$description = 'You can now choose whether customers can select the http-redirect code and which of them acts as default.';
$question = '<strong>Allow customer chosen redirects?:</strong>&nbsp;';
$question.= makeyesno('update_customredirect_enable', '1', '0', '1').'<br /><br />';
$question.= '<strong>Select default redirect code (default: empty):</strong>&nbsp;';
$question.= '<select name="update_customredirect_default">';
$redirects = makeoption('--- ('.$lng['redirect_desc']['rc_default'].')', 1, '1');
$redirects.= makeoption('301 ('.$lng['redirect_desc']['rc_movedperm'].')', 2, '1');
$redirects.= makeoption('302 ('.$lng['redirect_desc']['rc_found'].')', 3, '1');
$redirects.= makeoption('303 ('.$lng['redirect_desc']['rc_seeother'].')', 4, '1');
$redirects.= makeoption('307 ('.$lng['redirect_desc']['rc_tempred'].')', 5, '1');
$question .= $redirects.'</select>';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.7-svn2'))
{
$result = $db->query("SELECT `domain` FROM " . TABLE_PANEL_DOMAINS . " WHERE `documentroot` LIKE '%:%' AND `documentroot` NOT LIKE 'http://%' AND `openbasedir_path` = '0' AND `openbasedir` = '1'");
$wrongOpenBasedirDomain = array();
while($row = $db->fetch_array($result))
{
$wrongOpenBasedirDomain[] = $row['domain'];
}
if(count($wrongOpenBasedirDomain) > 0)
{
$has_preconfig = true;
$description = 'Resetting the open_basedir to customer - root';
$question = '<strong>Due to a security - issue regarding open_basedir, Froxlor will set the open_basedir for the following domains to the customers root instead of the chosen documentroot:</strong><br />&nbsp;';
$question.= '<ul>';
$idna_convert = new idna_convert_wrapper();
foreach($wrongOpenBasedirDomain as $domain)
{
$question.= '<li>' . $idna_convert->decode($domain) . '</li>';
}
$question.= '</ul>';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}
if(versionInUpdate($current_version, '0.9.9-svn1'))
{
$has_preconfig = true;
$description = 'When entering MX servers to Froxlor there was no mail-, imap-, pop3- and smtp-"A record" created. You can now chose whether this should be done or not.';
$question = '<strong>Do you want these A-records to be created even with MX servers given?:</strong>&nbsp;';
$question.= makeyesno('update_defdns_mailentry', '1', '0', '0');
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.10-svn1'))
{
$has_nouser = false;
$has_nogroup = false;
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'");
if(!isset($result) || !isset($result['value']))
{
$has_preconfig = true;
$has_nouser = true;
$guessed_user = 'www-data';
if(function_exists('posix_getuid')
&& function_exists('posix_getpwuid')
) {
$_httpuser = posix_getpwuid(posix_getuid());
$guessed_user = $_httpuser['name'];
}
}
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'");
if(!isset($result) || !isset($result['value']))
{
$has_preconfig = true;
$has_nogroup = true;
$guessed_group = 'www-data';
if(function_exists('posix_getgid')
&& function_exists('posix_getgrgid')
) {
$_httpgroup = posix_getgrgid(posix_getgid());
$guessed_group = $_httpgroup['name'];
}
}
if($has_nouser || $has_nogroup)
{
$description = 'Please enter the correct username/groupname of the webserver on your system We\'re guessing the user but it might not be correct, so please check.';
if($has_nouser)
{
$question = '<strong>Please enter the webservers username:</strong>&nbsp;<input type="text" class="text" name="update_httpuser" value="'.$guessed_user.'" />';
}
elseif($has_nogroup)
{
$question2 = '<strong>Please enter the webservers groupname:</strong>&nbsp;<input type="text" class="text" name="update_httpgroup" value="'.$guessed_group.'" />';
if($has_nouser) {
$question .= '<br /><br />'.$question2;
} else {
$question = $question2;
}
}
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}
if(versionInUpdate($current_version, '0.9.10'))
{
$has_preconfig = true;
$description = 'you can now decide whether Froxlor should be reached via hostname/froxlor or directly via the hostname.';
$question = '<strong>Do you want Froxlor to be reached directly via the hostname?:</strong>&nbsp;';
$question.= makeyesno('update_directlyviahostname', '1', '0', '0');
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.11-svn1'))
{
$has_preconfig = true;
$description = 'It is possible to enhance security with setting a regular expression to force your customers to enter more complex passwords.';
$question = '<strong>Enter a regular expression to force a higher password complexity (leave empty for none):</strong>&nbsp;';
$question.= '<input type="text" class="text" name="update_pwdregex" value="" />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.11-svn3'))
{
$has_preconfig = true;
$description = 'As Froxlor can now handle perl, you have to specify where the perl executable is (only if you\'re running lighttpd, else just leave empty).';
$question = '<strong>Path to perl (default \'/usr/bin/perl\'):</strong>&nbsp;';
$question.= '<input type="text" class="text" name="update_perlpath" value="/usr/bin/perl" />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.12-svn1'))
{
if($settings['system']['mod_fcgid'] == 1)
{
$has_preconfig = true;
$description = 'You can chose whether you want Froxlor to use FCGID itself too now.';
$question = '<strong>Use FCGID for the Froxlor Panel?:</strong>&nbsp;';
$question.= makeyesno('update_fcgid_ownvhost', '1', '0', '0').'<br /><br />';
$question.= '<strong>If \'yes\', please specify local user/group (have to exist, Froxlor does not add them automatically):</strong><br /><br />';
$question.= 'Local user:&nbsp;';
$question.= '<input type="text" class="text" name="update_fcgid_httpuser" value="froxlorlocal" /><br /><br />';
$question.= 'Local group:&nbsp;';
$question.= '<input type="text" class="text" name="update_fcgid_ownvhost" value="froxlorlocal" /><br />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}
if(versionInUpdate($current_version, '0.9.12-svn2'))
{
$has_preconfig = true;
$description = 'Many apache user will have problems using perl/CGI as the customer docroots are not within the suexec path. Froxlor provides a simple workaround for that.';
$question = '<strong>Enable Apache/SuExec/Perl workaround?:</strong>&nbsp;';
$question.= makeyesno('update_perl_suexecworkaround', '1', '0', '0').'<br /><br />';
$question.= '<strong>If \'yes\', please specify a path within the suexec path where Froxlor will create symlinks to customer perl-enabled paths:</strong><br /><br />';
$question.= 'Path for symlinks (must be within suexec path):&nbsp;';
$question.= '<input type="text" class="text" name="update_perl_suexecpath" value="/var/www/cgi-bin/" /><br />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.12-svn4'))
{
if((int)$settings['system']['awstats_enabled'] == 1)
{
$has_preconfig = true;
$description = 'Due to different paths of awstats_buildstaticpages.pl and awstats.pl you can set a different path for awstats.pl now.';
$question = '<strong>Path to \'awstats.pl\'?:</strong>&nbsp;';
$question.= '<input type="text" class="text" name="update_awstats_awstatspath" value="'.$settings['system']['awstats_path'].'" /><br />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}
}

View File

@@ -19,6 +19,18 @@
$updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'), $db, $settings);
$updatelogfile = validateUpdateLogFile(makeCorrectFile(dirname(__FILE__).'/update.log'));
$filelog = FileLogger::getInstanceOf(array('loginname' => 'updater'), $settings);
$filelog->setLogFile($updatelogfile);
// if first writing does not work we'll stop, tell the user to fix it
// and then let him try again.
try {
$filelog->logAction(ADM_ACTION, LOG_WARNING, '-------------- START LOG --------------');
} catch(Exception $e) {
standard_error('exception', $e->getMessage());
}
/*
* since froxlor, we have to check if there's still someone
* out there using syscp and needs to upgrade
@@ -90,6 +102,8 @@ if(!isFroxlor())
if(isFroxlor())
{
include_once (makeCorrectFile(dirname(__FILE__).'/updates/froxlor/0.9/update_0.9.inc.php'));
$filelog->logAction(ADM_ACTION, LOG_WARNING, '--------------- END LOG ---------------');
unset($filelog);
}
?>

View File

@@ -32,6 +32,7 @@ class ApsInstaller extends ApsParser
private $RealPath = '';
private $RootDir = '';
private $Hosts = '';
private $aps_version = '1.0';
/**
* constructor of class. setup some basic variables
@@ -73,6 +74,8 @@ class ApsInstaller extends ApsParser
$XmlContent = file_get_contents($this->RootDir . 'packages/' . $Row['Path'] . '/APP-META.xml');
$Xml = new SimpleXMLElement($XmlContent);
$this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0';
//check for unparseable xml data
if($Xml == false)
@@ -146,9 +149,16 @@ class ApsInstaller extends ApsParser
$ReturnStatus = 0;
// make configure-script executable
chmod($this->RealPath . $this->DomainPath . '/install_scripts/configure', 0755);
if($this->aps_version != '1.0')
{
$scriptname = (string)$Xml->service->provision->{'configuration-script'}['name'];
} else {
$scriptname = 'configure';
}
$Return = safe_exec('php ' . escapeshellarg($this->RealPath . $this->DomainPath . '/install_scripts/configure') . ' install', $ReturnStatus);
chmod($this->RealPath . $this->DomainPath . '/install_scripts/'.$scriptname, 0755);
$Return = safe_exec('php ' . escapeshellarg($this->RealPath . $this->DomainPath . '/install_scripts/'.$scriptname) . ' install', $ReturnStatus);
if($ReturnStatus != 0)
{
@@ -209,16 +219,24 @@ class ApsInstaller extends ApsParser
}
elseif($Task == TASK_REMOVE)
{
//FIXME cleanup installation
//remove files from: $this->RealPath . $this->DomainPath . '/'
//remove permissions
//drop database
// check for database
if ($this->aps_version == '1.0')
{
// the good ole way
$XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('db', 'http://apstandard.com/ns/1/db');
$XmlDb = new DynamicProperties;
$XmlDb->db->id = getXPathValue($Xml, '//db:id');
}
if($XmlDb->db->id)
{
//database management
//drop database permissions
$Database = 'web' . $Row['CustomerID'] . 'aps' . $Row['InstanceID'];
foreach(array_map('trim', explode(',', $this->Hosts)) as $DatabaseHost)
@@ -228,8 +246,15 @@ class ApsInstaller extends ApsParser
$this->db_root->query('DELETE FROM `mysql`.`user` WHERE `User` = "' . $this->db->escape($Database) . '" AND `Host` = "' . $this->db->escape($DatabaseHost) . '"');
}
//drop database
$this->db_root->query('DROP DATABASE IF EXISTS `' . $this->db->escape($Database) . '`');
$this->db_root->query('FLUSH PRIVILEGES');
/*
* remove database from customer-mysql overview, #272
*/
$this->db->query('DELETE FROM `' . TABLE_PANEL_DATABASES . '` WHERE `customerid`="' . (int)$Row['CustomerID'] . '" AND `databasename`="' . $this->db->escape($Database) . '" AND `apsdb`="1"');
$result = $this->db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`-1 WHERE `customerid`="' . (int)$Row['CustomerID'] . '"');
}
//remove task & delete package instance + settings
@@ -237,6 +262,20 @@ class ApsInstaller extends ApsParser
$this->db->query('DELETE FROM `' . TABLE_APS_TASKS . '` WHERE `Task` = ' . TASK_REMOVE . ' AND `InstanceID` = ' . $this->db->escape($Row['InstanceID']));
$this->db->query('DELETE FROM `' . TABLE_APS_INSTANCES . '` WHERE `ID` = ' . $this->db->escape($Row['InstanceID']));
$this->db->query('DELETE FROM `' . TABLE_APS_SETTINGS . '` WHERE `InstanceID` = ' . $this->db->escape($Row['InstanceID']));
//remove data, #273
if($this->DomainPath != '' && $this->DomainPath != '/') {
self::UnlinkRecursive($this->RealPath . $this->DomainPath . '/');
} else {
// save awstats/webalizer folder if it's the docroot
self::UnlinkRecursive($this->RealPath . $this->DomainPath . '/', true);
// place standard-index file
$loginname = getLoginNameByUid($Row['CustomerID']);
if($loginname !== false)
{
storeDefaultIndex($loginname, $this->RealPath . $this->DomainPath . '/');
}
}
}
}
@@ -278,6 +317,19 @@ class ApsInstaller extends ApsParser
private function PrepareFiles($Xml, $Row, $Task)
{
if($this->aps_version != '1.0')
{
$mapping = $Xml->service->provision->{'url-mapping'}->mapping;
$mapping_path = $Xml->service->provision->{'url-mapping'}->mapping['path'];
$mapping_url = $Xml->service->provision->{'url-mapping'}->mapping['url'];
}
else
{
$mapping = $Xml->mapping;
$mapping_path = $Xml->mapping['path'];
$mapping_url = $Xml->mapping['url'];
}
if($Task == TASK_INSTALL)
{
//FIXME truncate customer directory
@@ -287,7 +339,7 @@ class ApsInstaller extends ApsParser
//extract all files and chown them to the customer guid
if(self::ExtractZip($this->RootDir . 'packages/' . $Row['Path'] . '/' . $Row['Path'], $Xml->mapping['path'], $this->RealPath . $this->DomainPath . '/') == false
if(self::ExtractZip($this->RootDir . 'packages/' . $Row['Path'] . '/' . $Row['Path'], $mapping_path, $this->RealPath . $this->DomainPath . '/') == false
|| self::ExtractZip($this->RootDir . 'packages/' . $Row['Path'] . '/' . $Row['Path'], 'scripts', $this->RealPath . $this->DomainPath . '/install_scripts/') == false)
{
$this->db->query('UPDATE `' . TABLE_APS_INSTANCES . '` SET `Status` = ' . INSTANCE_ERROR . ' WHERE `ID` = ' . $this->db->escape($Row['InstanceID']));
@@ -319,7 +371,7 @@ class ApsInstaller extends ApsParser
//recursive mappings
self::PrepareMappings($Xml->mapping, $Xml->mapping['url'], $this->RealPath . $this->DomainPath . '/');
self::PrepareMappings($mapping, $mapping_url, $this->RealPath . $this->DomainPath . '/');
return true;
}
@@ -336,6 +388,8 @@ class ApsInstaller extends ApsParser
//check for special PHP permissions
//must be done with xpath otherwise check not possible (XML parser problem with attributes)
if($ParentMapping && $ParentMapping !== null)
{
$ParentMapping->registerXPathNamespace('p', 'http://apstandard.com/ns/1/php');
$Result = $ParentMapping->xpath('p:permissions');
@@ -366,6 +420,7 @@ class ApsInstaller extends ApsParser
chmod($Path, 0222);
}
}
}
//set environment variables
@@ -373,7 +428,8 @@ class ApsInstaller extends ApsParser
putenv('WEB_' . $EnvVariable . '_DIR=' . $Path);
//resolve deeper mappings
if($ParentMapping && $ParentMapping !== null)
{
foreach($ParentMapping->mapping as $Mapping)
{
//recursive check of other mappings
@@ -388,6 +444,7 @@ class ApsInstaller extends ApsParser
}
}
}
}
/**
* setup domain environment variables for the installation script
@@ -433,9 +490,22 @@ class ApsInstaller extends ApsParser
private function PrepareDatabase($Xml, $Row, $Task)
{
global $db_root;
$XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
if ($this->aps_version == '1.0')
{
// the good ole way
$XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('db', 'http://apstandard.com/ns/1/db');
$XmlDb = new DynamicProperties;
$XmlDb->db->id = getXPathValue($Xml, '//db:id');
}
if($XmlDb->db->id)
{
//database management
@@ -456,6 +526,13 @@ class ApsInstaller extends ApsParser
}
$this->db_root->query('FLUSH PRIVILEGES');
/*
* add database to customers databases, #272
*/
$databasedescription = $Xml->name.' '.$Xml->version.' (Release ' . $Xml->release . ')';
$result = $this->db->query('INSERT INTO `' . TABLE_PANEL_DATABASES . '` (`customerid`, `databasename`, `description`, `dbserver`, `apsdb`) VALUES ("' . (int)$Row['CustomerID'] . '", "' . $this->db->escape($NewDatabase) . '", "' . $this->db->escape($databasedescription) . '", "0", "1")');
$result = $this->db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`+1 WHERE `customerid`="' . (int)$Row['CustomerID'] . '"');
}
//get first mysql access host
@@ -576,5 +653,3 @@ class ApsInstaller extends ApsParser
return false;
}
}
?>

View File

@@ -38,6 +38,7 @@ class ApsParser
private $settings = array();
private $db = false;
private $RootDir = '';
private $aps_version = '1.0';
/**
* Constructor of class, setup basic variables needed by the class
@@ -399,9 +400,9 @@ class ApsParser
* unlink files recursively
*
* @param dir directory to delete recursive
* @param boolean whether the base-directory should be kept or not
*/
protected function UnlinkRecursive($Dir)
protected function UnlinkRecursive($Dir, $save_base = false)
{
if(!$DirHandle = @opendir($Dir))return;
@@ -410,6 +411,12 @@ class ApsParser
if($Object == '.'
|| $Object == '..')continue;
if($save_base
&& (strtoupper($Object) == 'AWSTATS' || strtoupper($Object) == 'WEBALIZER')
) {
continue;
}
if(!@unlink($Dir . '/' . $Object))
{
self::UnlinkRecursive($Dir . '/' . $Object);
@@ -417,8 +424,11 @@ class ApsParser
}
closedir($DirHandle);
if(!$save_base)
{
@rmdir($Dir);
}
}
/**
* function provides package management for admins
@@ -988,14 +998,26 @@ class ApsParser
if($Xml == false)continue;
$Icon = './images/default.png';
$this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0';
//show data and status of package
if($Xml->icon['path'])
if($this->aps_version != '1.0')
{
$Icon = './packages/' . $Row2['Path'] . '/' . basename($Xml->icon['path']);
$iconpath = $Xml->presentation->icon['path'];
$Summary = htmlspecialchars($Xml->presentation->summary);
}
else
{
$iconpath = $Xml->icon['path'];
$Summary = htmlspecialchars($Xml->summary);
}
if($iconpath)
{
$Icon = './packages/' . $Row2['Path'] . '/' . basename($iconpath);
}
$Summary = $Xml->summary;
$Fieldname = $lng['aps']['version'];
$Fieldvalue = $Xml->version . ' (Release ' . $Xml->release . ')';
eval("\$Data.=\"" . getTemplate("aps/data") . "\";");
@@ -1338,23 +1360,43 @@ class ApsParser
private function InstallNewPackage($Filename)
{
global $lng;
global $lng, $userinfo;
if(file_exists($Filename)
&& $Xml = self::GetXmlFromZip($Filename))
{
$Error = array();
$this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0';
//check alot of stuff if package is supported
//php modules
if ($this->aps_version == '1.0')
{
// the good ole way
$XmlPhp = $Xml->requirements->children('http://apstandard.com/ns/1/php');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('php', 'http://apstandard.com/ns/1/php');
$XmlPhp = new DynamicProperties;
$XmlPhp->extension = getXPathValue($Xml, '//php:extension', false);
$XmlPhp->function = getXPathValue($Xml, '//php:function', false);
}
if($XmlPhp->extension)
{
$ExtensionsLoaded = get_loaded_extensions();
foreach($XmlPhp->extension as $Extension)
{
if(strtolower($Extension) == 'php')
{
continue;
}
if(!in_array($Extension, $ExtensionsLoaded)
&& !self::CheckException('php', 'extension', $Extension))
{
@@ -1389,6 +1431,11 @@ class ApsParser
);
foreach($PhpValues as $Value)
{
if ($this->aps_version != '1.0')
{
$XmlPhp->{$Value} = getXPathValue($Xml, '//php:'.$Value);
}
if($XmlPhp->{$Value})
{
if(self::TrueFalseIniGet($Value) != $XmlPhp->{$Value}
@@ -1399,6 +1446,11 @@ class ApsParser
}
}
if ($this->aps_version != '1.0')
{
$XmlPhp->{'post-max-size'} = getXPathValue($Xml, '//php:post-max-size');
}
if($XmlPhp->{'post-max-size'})
{
if(self::PhpMemorySizeToBytes(ini_get('post_max_size')) < intval($XmlPhp->{'post-max-size'})
@@ -1408,6 +1460,11 @@ class ApsParser
}
}
if ($this->aps_version != '1.0')
{
$XmlPhp->{'memory-limit'} = getXPathValue($Xml, '//php:memory-limit');
}
if($XmlPhp->{'memory-limit'})
{
if(self::PhpMemorySizeToBytes(ini_get('memory_limit')) < intval($XmlPhp->{'memory-limit'})
@@ -1417,6 +1474,11 @@ class ApsParser
}
}
if ($this->aps_version != '1.0')
{
$XmlPhp->{'max-execution-time'} = getXPathValue($Xml, '//php:max-execution-time');
}
if($XmlPhp->{'max-execution-time'})
{
if(ini_get('max_execution_time') < intval($XmlPhp->{'max-execution-time'})
@@ -1450,7 +1512,21 @@ class ApsParser
//database
if ($this->aps_version == '1.0')
{
// the good ole way
$XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('db', 'http://apstandard.com/ns/1/db');
$XmlDb = new DynamicProperties;
$XmlDb->db->id = getXPathValue($Xml, '//db:id');
$XmlDb->db->{'server-type'} = getXPathValue($Xml, '//db:server-type');
$XmlDb->db->{'server-min-version'} = getXPathValue($Xml, '//db:server-min-version');
}
if($XmlDb->db->id)
{
@@ -1467,7 +1543,21 @@ class ApsParser
//ASP.NET
if ($this->aps_version == '1.0')
{
// the good ole way
$XmlAsp = $Xml->requirements->children('http://apstandard.com/ns/1/aspnet');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('aspnet', 'http://apstandard.com/ns/1/aspnet');
$XmlAsp = new DynamicProperties;
$XmlAsp->handler = getXPathValue($Xml, '//aspnet:handler');
$XmlAsp->permissions = getXPathValue($Xml, '//aspnet:permissions');
$XmlAsp->version = getXPathValue($Xml, '//aspnet:version');
}
if($XmlAsp->handler
|| $XmlAsp->permissions
@@ -1478,7 +1568,19 @@ class ApsParser
//CGI
if ($this->aps_version == '1.0')
{
// the good ole way
$XmlCgi = $Xml->requirements->children('http://apstandard.com/ns/1/cgi');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('cgi', 'http://apstandard.com/ns/1/cgi');
$XmlCgi = new DynamicProperties;
$XmlCgi->handler = getXPathValue($Xml, '//cgi:handler');
}
if($XmlCgi->handler)
{
@@ -1487,7 +1589,20 @@ class ApsParser
//webserver modules
if ($this->aps_version == '1.0')
{
// the good ole way
$XmlWebserver = $Xml->requirements->children('http://apstandard.com/ns/1/apache');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('apache', 'http://apstandard.com/ns/1/apache');
$XmlWebserver = new DynamicProperties;
$XmlWebserver->{'required-module'} = getXPathValue($Xml, '//apache:required-module');
$XmlWebserver->htaccess = getXPathValue($Xml, '//apache:htaccess');
}
if($XmlWebserver->{'required-module'})
{
@@ -1527,7 +1642,21 @@ class ApsParser
//validation against a charset not possible in current version
foreach($Xml->settings->group as $Group)
if ($this->aps_version == '1.0')
{
// the good ole way
$aps_settings_array = $Xml->settings->group;
}
else
{
// since 1.1
$aps_settings_array = $Xml->{'global-settings'}->setting;
if(!is_array($aps_settings_array)) {
$aps_settings_array = $Xml->service->settings->group;
}
}
foreach($aps_settings_array as $Group)
{
foreach($Group->setting as $Setting)
{
@@ -1544,6 +1673,8 @@ class ApsParser
//check different errors/features in submappings
if ($this->aps_version == '1.0')
{
$Return = self::CheckSubmappings($Xml->mapping, $Xml->mapping['url']);
if(count($Return) != 0)
@@ -1553,6 +1684,7 @@ class ApsParser
if(!in_array($Value, $Error))$Error[] = $Value;
}
}
}
//check already installed versions
@@ -1617,9 +1749,19 @@ class ApsParser
//copy screenshots
if($Xml->screenshot)
if ($this->aps_version != '1.0')
{
foreach($Xml->screenshot as $Screenshot)
$xml_screenshots = $Xml->presentation->screenshot;;
}
else
{
$xml_screenshots = $Xml->screenshot;
}
if($xml_screenshots)
{
foreach($xml_screenshots as $Screenshot)
{
self::GetContentFromZip($Filename, $Screenshot['path'], $Destination . basename($Screenshot['path']));
}
@@ -1627,17 +1769,36 @@ class ApsParser
//copy icon
if($Xml->icon['path'])
if ($this->aps_version != '1.0')
{
self::GetContentFromZip($Filename, $Xml->icon['path'], $Destination . basename($Xml->icon['path']));
$xml_iconpath = $Xml->presentation->icon['path'];
}
else
{
$xml_iconpath = $Xml->icon['path'];
}
if($xml_iconpath)
{
self::GetContentFromZip($Filename, $xml_iconpath, $Destination . basename($xml_iconpath));
}
//copy license
if($Xml->license
&& $Xml->license->text->file)
if ($this->aps_version != '1.0')
{
self::GetContentFromZip($Filename, $Xml->license->text->file, $Destination . 'license.txt');
$xml_license = $Xml->service->license;
}
else
{
$xml_license = $Xml->license;
}
if($xml_license
&& $xml_license->text->file)
{
self::GetContentFromZip($Filename, $xml_license->text->file, $Destination . 'license.txt');
}
//insert package to database
@@ -1679,7 +1840,7 @@ class ApsParser
public function MainHandler($Action)
{
global $lng, $filename, $s, $page, $action, $Id;
global $lng, $filename, $s, $page, $action, $Id, $userinfo;
//check for basic functions, classes and permissions
@@ -2030,6 +2191,13 @@ class ApsParser
return;
}
// no more contingent, #278
if($userinfo['aps_packages'] == $userinfo['aps_packages_used']
&& $userinfo['aps_packages'] != '-1'
){
self::InfoBox($lng['aps']['nocontingent']);
}
//show packages
while($Row3 = $this->db->fetch_array($result2))
@@ -2363,10 +2531,26 @@ class ApsParser
if($Xml == false)return false;
$this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0';
//check all data fields of xml file against inut of customer
if ($this->aps_version == '1.0')
{
// the good ole way
$aps_settings_array = $Xml->settings->group;
}
else
{
// since 1.1
$aps_settings_array = $Xml->{'global-settings'}->setting;
if(!is_array($aps_settings_array)) {
$aps_settings_array = $Xml->service->settings->group;
}
}
$Error = array();
foreach($Xml->settings->group as $Group)
foreach($aps_settings_array as $Group)
{
foreach($Group->setting as $Setting)
{
@@ -2542,7 +2726,19 @@ class ApsParser
//database required?
if ($this->aps_version == '1.0')
{
// the good ole way
$XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('db', 'http://apstandard.com/ns/1/db');
$XmlDb = new DynamicProperties;
$XmlDb->db->id = getXPathValue($Xml, '//db:id');
}
if($XmlDb->db->id)
{
@@ -2664,10 +2860,19 @@ class ApsParser
self::SetInstallationValue($PackageId, $CustomerId, 'main_location', '');
}
if($Xml->license)
if ($this->aps_version != '1.0')
{
if($Xml->license['must-accept']
&& $Xml->license['must-accept'] == 'true')
$xml_license = $Xml->service->license;
}
else
{
$xml_license = $Xml->license;
}
if($xml_license)
{
if($xml_license['must-accept']
&& $xml_license['must-accept'] == 'true')
{
if(isset($_POST['license'])
&& $_POST['license'] == 'true')
@@ -2712,6 +2917,8 @@ class ApsParser
if($Xml == false)return false;
$this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0';
//show notifcation if customer has reached his installation limit
if($this->userinfo['aps_packages'] != '-1'
@@ -2725,9 +2932,18 @@ class ApsParser
$Icon = './images/default.png';
if($Xml->icon['path'])
if($this->aps_version != '1.0')
{
$Icon = './packages/' . $Row['Path'] . '/' . basename($Xml->icon['path']);
$iconpath = $Xml->presentation->icon['path'];
}
else
{
$iconpath = $Xml->icon['path'];
}
if($iconpath)
{
$Icon = './packages/' . $Row['Path'] . '/' . basename($iconpath);
}
//show error message if some input was wrong
@@ -2761,7 +2977,7 @@ class ApsParser
{
if($Value)
{
if($Row3['ID'] == $Value)
if($Row3['id'] == $Value)
{
$Temp.= '<option selected="selected" value="' . $Row3['id'] . '">' . $Row3['domain'] . '</option>';
}
@@ -2813,7 +3029,19 @@ class ApsParser
//database required?
if ($this->aps_version == '1.0')
{
// the good ole way
$XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('db', 'http://apstandard.com/ns/1/db');
$XmlDb = new DynamicProperties;
$XmlDb->db->id = getXPathValue($Xml, '//db:id');
}
if($XmlDb->db->id)
{
@@ -2832,7 +3060,21 @@ class ApsParser
eval("\$Data.=\"" . getTemplate("aps/data") . "\";");
}
foreach($Xml->settings->group as $Group)
if ($this->aps_version == '1.0')
{
// the good ole way
$aps_settings_array = $Xml->settings->group;
}
else
{
// since 1.1
$aps_settings_array = $Xml->{'global-settings'}->setting;
if(!is_array($aps_settings_array)) {
$aps_settings_array = $Xml->service->settings->group;
}
}
foreach($aps_settings_array as $Group)
{
$GroupPrinted = false;
foreach($Group->setting as $Setting)
@@ -3015,16 +3257,25 @@ class ApsParser
}
}
if($Xml->license)
if ($this->aps_version != '1.0')
{
$xml_license = $Xml->service->license;
}
else
{
$xml_license = $Xml->license;
}
if($xml_license)
{
$Temp = '';
if($Xml->license['must-accept']
&& $Xml->license['must-accept'] == 'true')
if($xml_license['must-accept']
&& $xml_license['must-accept'] == 'true')
{
if($Xml->license->text->name)$Temp.= $Xml->license->text->name . '<br/>';
if($xml_license->text->name)$Temp.= $xml_license->text->name . '<br/>';
if($Xml->license->text->file)
if($xml_license->text->file)
{
$Temp.= '<textarea name="text" rows="10" cols="55">';
$FileContent = file_get_contents('./packages/' . $Row['Path'] . '/license.txt');
@@ -3037,7 +3288,7 @@ class ApsParser
}
else
{
$Temp.= '<a target="_blank" href="' . htmlspecialchars($Xml->license->text->url) . '">' . $lng['aps']['error_license'] . '</a>';
$Temp.= '<a target="_blank" href="' . htmlspecialchars($xml_license->text->url) . '">' . $lng['aps']['error_license'] . '</a>';
$Groupname = $lng['aps']['license'];
$Fieldname = $lng['aps']['license'];
$Fieldvalue = $Temp;
@@ -3088,14 +3339,37 @@ class ApsParser
if($Xml == false)return false;
$Icon = './images/default.png';
//show icon and basic data
$this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0';
if($Xml->icon['path'])
//show icon and basic data
if($this->aps_version != '1.0')
{
$Icon = './packages/' . $Row['Path'] . '/' . basename($Xml->icon['path']);
$iconpath = $Xml->presentation->icon['path'];
$Summary = htmlspecialchars($Xml->presentation->summary);
$categories = $Xml->presentation->categories;
$languages = $Xml->presentation->languages;
$description = $Xml->presentation->description;
$changelogs = $Xml->presentation->changelog;
$license = $Xml->service->license;
$screenshots = $Xml->presentation->screenshot;
}
else
{
$iconpath = $Xml->icon['path'];
$Summary = htmlspecialchars($Xml->summary);
$categories = $Xml->categories;
$languages = $Xml->languages;
$description = $Xml->description;
$changelogs = $Xml->changelog;
$license = $Xml->license;
$screenshots = $Xml->screenshot;
}
if($iconpath)
{
$Icon = './packages/' . $Row['Path'] . '/' . basename($iconpath);
}
$Summary = htmlspecialchars($Xml->summary);
$Fieldname = $lng['aps']['version'];
$Fieldvalue = $Xml->version . ' (Release ' . $Xml->release . ')';
eval("\$Data.=\"" . getTemplate("aps/data") . "\";");
@@ -3120,12 +3394,12 @@ class ApsParser
//show categories
if($Xml->categories)
if($categories)
{
$Temp = '';
foreach($Xml->categories->category as $Categories)
foreach($categories->category as $_categories)
{
$Temp.= htmlspecialchars($Categories[0]) . '<br/>';
$Temp.= htmlspecialchars($_categories[0]) . '<br/>';
}
$Fieldname = $lng['aps']['categories'];
@@ -3135,12 +3409,12 @@ class ApsParser
//show available languages
if($Xml->languages)
if($languages)
{
$Temp = '';
foreach($Xml->languages->language as $Languages)
foreach($languages->language as $_languages)
{
$Temp.= $Languages[0] . ' ';
$Temp.= $_languages[0] . ' ';
}
$Fieldname = $lng['aps']['languages'];
@@ -3153,7 +3427,7 @@ class ApsParser
if($All == true)
{
$Fieldname = $lng['aps']['long_description'];
$Fieldvalue = htmlspecialchars($Xml->description);
$Fieldvalue = htmlspecialchars($description);
eval("\$Data.=\"" . getTemplate("aps/data") . "\";");
//show config script language
@@ -3168,7 +3442,7 @@ class ApsParser
//show changelog
$Temp = '<ul>';
foreach($Xml->changelog->version as $Versions)
foreach($changelogs->version as $Versions)
{
$Temp.= '<li><strong>' . $Versions['version'] . ' (Release ' . $Versions['release'] . ')</strong>';
$Temp.= '<ul>';
@@ -3187,13 +3461,13 @@ class ApsParser
//show license
if($Xml->license)
if($license)
{
if($Xml->license->text->file)
if($license->text->file)
{
$Temp = '';
if($Xml->license->text->name)$Temp = $Xml->license->text->name . '<br/>';
if($license->text->name)$Temp = $license->text->name . '<br/>';
$Temp.= '<form name="license" action="#"><textarea name="text" rows="10" cols="70">';
$FileContent = file_get_contents('./packages/' . $Row['Path'] . '/license.txt');
$Temp.= htmlentities($FileContent, ENT_QUOTES, 'ISO-8859-1');
@@ -3205,23 +3479,23 @@ class ApsParser
else
{
$Fieldname = $lng['aps']['license'];
$Fieldvalue = '<a target="_blank" href="' . htmlspecialchars($Xml->license->text->url) . '">' . $lng['aps']['linktolicense'] . '</a>';
$Fieldvalue = '<a target="_blank" href="' . htmlspecialchars($license->text->url) . '">' . $lng['aps']['linktolicense'] . '</a>';
eval("\$Data.=\"" . getTemplate("aps/data") . "\";");
}
}
//show screenshots
if($Xml->screenshot)
if($screenshots)
{
$Count = 0;
$Temp = '';
foreach($Xml->screenshot as $Screenshot)
foreach($screenshots as $Screenshot)
{
$Count+= 1;
$Temp.= '<img src="./packages/' . $Row['Path'] . '/' . basename($Screenshot['path']) . '" alt="' . $Screenshot->description . '"/><br/><em>' . $Screenshot->description . '</em><br/>';
if(count($Xml->screenshot) != $Count)$Temp.= '<br/>';
if(count($screenshots) != $Count)$Temp.= '<br/>';
}
$Fieldname = $lng['aps']['screenshots'];
@@ -3230,6 +3504,41 @@ class ApsParser
}
}
/*
* check if packages needs a database
* and if the customer has contingent for that, #272
*/
if ($this->aps_version == '1.0')
{
// the good ole way
$XmlDb = $Xml->requirements->children('http://apstandard.com/ns/1/db');
}
else
{
// since 1.1
$Xml->registerXPathNamespace('db', 'http://apstandard.com/ns/1/db');
$XmlDb = new DynamicProperties;
$XmlDb->db->id = getXPathValue($Xml, '//db:id');
}
if($XmlDb->db->id)
{
if($userinfo['mysqls_used'] < $userinfo['mysqls']
|| $userinfo['mysqls'] == '-1'
){
$can_use_db = true;
} else {
$can_use_db = false;
}
} else { $can_use_db = true; }
$db_info = '';
if(!$can_use_db)
{
$db_info = $lng['aps']['packageneedsdb'];
}
eval("echo \"" . getTemplate("aps/package") . "\";");
unset($Xml);
}

View File

@@ -0,0 +1,18 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package APS
* @version $Id$
*/
class DynamicProperties { /* empty class for some magic */ }

View File

@@ -169,7 +169,7 @@ class FileLogger extends AbstractLogger
}
}
private function setLogFile($filename = null)
public function setLogFile($filename = null)
{
if($filename != null
&& $filename != ''

View File

@@ -255,12 +255,14 @@ class ticket
{
// Get e-mail message for customer
$usr = $this->db->query_first('SELECT `name`, `firstname`, `email`
$usr = $this->db->query_first('SELECT `name`, `firstname`, `company`, `email`
FROM `' . TABLE_PANEL_CUSTOMERS . '`
WHERE `customerid` = "' . (int)$customerid . '"');
$replace_arr = array(
'FIRSTNAME' => $usr['firstname'],
'NAME' => $usr['name'],
'COMPANY' => $usr['company'],
'SALUTATION' => getCorrectUserSalutation($usr),
'SUBJECT' => $this->Get('subject', true)
);
}

View File

@@ -262,7 +262,7 @@ return Array(
'apt-get install xinetd'
),
'files' => Array(
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
'etc_xinetd.d_froxlor' => '/etc/xinetd.d/froxlor'
),
'restart' => Array(
'/etc/init.d/xinetd restart'
@@ -272,11 +272,9 @@ return Array(
'label' => 'Awstats',
'commands' => Array(
'apt-get install awstats',
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl /usr/lib/cgi-bin/',
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
),
'files' => Array(
'etc_awstats.model.conf' => makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl '.makeCorrectDir($settings['system']['awstats_path']),
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
),
),
'libnss' => Array(

View File

@@ -58,7 +58,7 @@ return Array(
'cd /usr/ports/dns/powerdns',
'make config',
'make install',
'echo "add pdns_enable=\"YES\"" >> /etc/rc.conf',
'echo "pdns_enable=\"YES\"" >> /etc/rc.conf',
),
'files' => Array(
'usr_local_etc_pdns_pdns.conf' => '/usr/local/etc/pdns/pdns.conf'
@@ -155,7 +155,7 @@ return Array(
'set ManageSieve support (optional)',
'set MySQL support ',
'make install',
'echo "add dovecot_enable=\"YES\"" >> /etc/rc.conf'
'echo "dovecot_enable=\"YES\"" >> /etc/rc.conf'
),
'files' => Array(
'usr_local_etc_dovecot.conf' => '/usr/local/etc/dovecot.conf',
@@ -163,7 +163,8 @@ return Array(
),
'commands_2' => Array(
'echo "dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient}" >> /usr/local/etc/postfix/master.cf'
flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient}" >> /usr/local/etc/postfix/master.cf',
'chmod 0640 /usr/local/etc/dovecot-sql.conf'
),
'restart' => Array(
'sh /usr/local/etc/rc.d/dovecot restart'
@@ -198,10 +199,32 @@ return Array(
'commands' => Array(
'cd /usr/ports/www/awstats/',
'make install clean',
'cp /usr/local/www/awstats/cgi-bin/awstats.model.conf '.makeCorrectDir($settings['system']['awstats_conf'])
'cp /usr/local/www/awstats/cgi-bin/awstats.model.conf '.makeCorrectDir($settings['system']['awstats_conf']),
'sed -i.bak \'s/^LogFile/# LogFile/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^LogType/# LogType/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^LogFormat/# LogFormat/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^LogSeparator/# LogSeparator/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^SiteDomain/# SiteDomain/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf')
)
),
'libnss' => Array(
'label' => 'libnss (system login with mysql)',
'commands_1' => Array(
'cd /usr/ports/net/libnss-mysql',
'make install clean',
'echo "nscd_enable=\"YES\"" >> /etc/rc.conf'
),
'files' => Array(
'etc_awstats.model.conf' => makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
'usr_local_etc_libnss-mysql.cfg' => '/usr/local/etc/libnss-mysql.cfg',
'usr_local_etc_libnss-mysql-root.cfg' => '/usr/local/etc/libnss-mysql-root.cfg',
'etc_nsswitch.conf' => '/etc/nsswitch.conf'
),
'commands_2' => Array(
'chmod 600 /usr/local/etc/libnss-mysql.cfg /usr/local/etc/libnss-mysql-root.cfg'
),
'restart' => Array(
'sh /etc/rc.d/nscd restart'
)
)
)

View File

@@ -27,10 +27,10 @@ return Array(
'apache2' => Array(
'label' => 'Apache2 Webserver',
'commands' => Array(
'touch ' . $settings['system']['apacheconf_vhost'],
$configcommand['vhost'],
'chown root:0 ' . $settings['system']['apacheconf_vhost'],
'chmod 0600 ' . $settings['system']['apacheconf_vhost'],
'touch ' . $settings['system']['apacheconf_diroptions'],
$configcommand['diroptions'],
'chown root:0 ' . $settings['system']['apacheconf_diroptions'],
'chmod 0600 ' . $settings['system']['apacheconf_diroptions'],
'mkdir -p ' . $settings['system']['documentroot_prefix'],
@@ -251,6 +251,7 @@ milter_default_action = accept" >> /etc/postfix/main.cf'
'dovecot' => Array(
'label' => 'Dovecot',
'commands_1' => Array(
'emerge -av dovecot',
'mv dovecot.conf dovecot.conf.gentoo',
'mv dovecot-sql.conf dovecot-sql.conf.gentoo',
'touch dovecot.conf',
@@ -260,6 +261,9 @@ milter_default_action = accept" >> /etc/postfix/main.cf'
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
),
'commands_2' => Array(
'chmod 0640 /etc/dovecot/dovecot-sql.conf'
),
'restart' => Array(
'/etc/init.d/dovecot restart'
)
@@ -284,6 +288,26 @@ milter_default_action = accept" >> /etc/postfix/main.cf'
'/etc/init.d/proftpd restart'
)
),
'pureftpd' => Array(
'label' => 'PureFTPD',
'commands_1' => Array(
'emerge pure-ftpd'
),
'files' => Array(
'etc_conf.d_pure-ftpd' => '/etc/conf.d/pure-ftpd',
'etc_pureftpd-mysql.conf' => '/etc/pureftpd-mysql.conf'
),
'commands_2' => Array(
'chown root:0 /etc/conf.d/pure-ftpd',
'chmod 0644 /etc/conf.d/pure-ftpd',
'chown root:0 /etc/pureftpd-mysql.conf',
'chmod 0600 /etc/pureftpd-mysql.conf'
),
'restart' => Array(
'rc-update add pure-ftpd default',
'/etc/init.d/pure-ftpd restart'
)
)
)
),
'etc' => Array(
@@ -310,7 +334,7 @@ milter_default_action = accept" >> /etc/postfix/main.cf'
'emerge -av xinetd'
),
'files' => Array(
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
'etc_xinetd.d_froxlor' => '/etc/xinetd.d/froxlor'
),
'restart' => Array(
'/etc/init.d/xinetd restart'
@@ -320,21 +344,21 @@ milter_default_action = accept" >> /etc/postfix/main.cf'
'label' => 'Awstats',
'commands' => Array(
'emerge awstats',
'awstats_configure.pl'
),
'files' => Array(
'etc_awstats.model.conf' => makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
'awstats_configure.pl',
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
),
),
'libnss' => Array(
'label' => 'libnss (system login with mysql)',
'commands_1' => Array(
'emerge -av libnss-mysql'
),
'files' => Array(
'etc_libnss-mysql.cfg' => '/etc/libnss-mysql.cfg',
'etc_libnss-mysql-root.cfg' => '/etc/libnss-mysql-root.cfg',
'etc_nsswitch.conf' => '/etc/nsswitch.conf',
),
'commands' => Array(
'emerge -av libnss-mysql',
'commands_2' => Array(
'chmod 600 /etc/libnss-mysql.cfg /etc/libnss-mysql-root.cfg'
),
'restart' => Array(

View File

@@ -220,13 +220,16 @@ return Array(
),
'dovecot' => Array(
'label' => 'Dovecot',
'commands' => Array(
'/etc/init.d/dovecot stop',
'commands_1' => Array(
'apt-get install dovecot-imapd dovecot-pop3d dovecot-postfix',
),
'files' => Array(
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
),
'commands_2' => Array(
'chmod 0640 /etc/dovecot/dovecot-sql.conf'
),
'restart' => Array(
'/etc/init.d/dovecot restart'
)
@@ -251,6 +254,9 @@ return Array(
),
'pure-ftpd' => Array(
'label' => 'Pure FTPd',
'commands_1' => Array(
'apt-get install pure-ftpd-common pure-ftpd-mysql'
),
'files' => Array(
'etc_pure-ftpd_conf_MinUID' => '/etc/pure-ftpd/conf/MinUID',
'etc_pure-ftpd_conf_MySQLConfigFile' => '/etc/pure-ftpd/conf/MySQLConfigFile',
@@ -263,6 +269,9 @@ return Array(
'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind',
'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common'
),
'commands_2' => Array(
'chmod 0640 /etc/pure-ftpd/db/mysql.conf'
),
'restart' => Array(
'/etc/init.d/pure-ftpd-mysql restart'
)
@@ -287,7 +296,7 @@ return Array(
'apt-get install xinetd'
),
'files' => Array(
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
'etc_xinetd.d_froxlor' => '/etc/xinetd.d/froxlor'
),
'restart' => Array(
'/etc/init.d/xinetd restart'
@@ -297,11 +306,9 @@ return Array(
'label' => 'Awstats',
'commands' => Array(
'apt-get install awstats',
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl /usr/lib/cgi-bin/',
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
),
'files' => Array(
'etc_awstats.model.conf' => makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl '.makeCorrectDir($settings['system']['awstats_path']),
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
),
),
'libnss' => Array(

View File

@@ -224,13 +224,16 @@ return Array(
),
'dovecot' => Array(
'label' => 'Dovecot',
'commands' => Array(
'commands_1' => Array(
'apt-get install dovecot-imapd dovecot-pop3d'
),
'files' => Array(
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
),
'commands_2' => Array(
'chmod 0640 /etc/dovecot/dovecot-sql.conf'
),
'restart' => Array(
'/etc/init.d/dovecot restart'
)
@@ -256,7 +259,7 @@ return Array(
),
'pure-ftpd' => Array(
'label' => 'Pure FTPd',
'commands' => Array(
'commands_1' => Array(
'apt-get install pure-ftpd-common pure-ftpd-mysql'
),
'files' => Array(
@@ -271,6 +274,9 @@ return Array(
'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind',
'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common'
),
'commands_2' => Array(
'chmod 0640 /etc/pure-ftpd/db/mysql.conf'
),
'restart' => Array(
'/etc/init.d/pure-ftpd-mysql restart'
)
@@ -295,7 +301,7 @@ return Array(
'apt-get install xinetd'
),
'files' => Array(
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
'etc_xinetd.d_froxlor' => '/etc/xinetd.d/froxlor'
),
'restart' => Array(
'/etc/init.d/xinetd restart'
@@ -305,11 +311,9 @@ return Array(
'label' => 'Awstats',
'commands' => Array(
'apt-get install awstats',
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl /usr/lib/cgi-bin/',
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
),
'files' => Array(
'etc_awstats.model.conf' => makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl '.makeCorrectDir($settings['system']['awstats_path']),
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
),
),
'libnss' => Array(

View File

@@ -0,0 +1,341 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Configfiles
* @version $Id: lenny.inc.php 860 2010-04-30 16:38:02Z Dessa $
*/
return Array(
'ubuntu_lucid' => Array(
'label' => 'Ubuntu 10.04 (Lucid)',
'services' => Array(
'http' => Array(
'label' => $lng['admin']['configfiles']['http'],
'daemons' => Array(
'apache2' => Array(
'label' => 'Apache 2',
'commands' => Array(
'mkdir -p ' . $settings['system']['documentroot_prefix'],
'mkdir -p ' . $settings['system']['logfiles_directory'],
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '',
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
'a2dismod userdir'
),
'restart' => Array(
'/etc/init.d/apache2 restart'
),
),
'lighttpd' => Array(
'label' => 'Lighttpd Webserver',
'commands_1' => Array(
'apt-get install lighttpd',
),
'files' => Array(
'etc_lighttpd.conf' => '/etc/lighttpd/lighttpd.conf',
),
'commands_2' => Array(
$configcommand['vhost'],
$configcommand['diroptions'],
$configcommand['v_inclighty'],
$configcommand['d_inclighty'],
'lighty-disable-mod cgi',
'lighty-disable-mod fastcgi',
'mkdir -p ' . $settings['system']['documentroot_prefix'],
'mkdir -p ' . $settings['system']['logfiles_directory'],
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '',
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir']
),
'restart' => Array(
'/etc/init.d/lighttpd restart'
)
)
)
),
'dns' => Array(
'label' => $lng['admin']['configfiles']['dns'],
'daemons' => Array(
'bind' => Array(
'label' => 'Bind9',
'commands' => Array(
'apt-get install bind9',
'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf',
'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
'chown root:bind ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
'chmod 0644 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
),
'restart' => Array(
'/etc/init.d/bind9 restart'
)
),
'powerdns' => Array(
'label' => 'PowerDNS',
'files' => Array(
'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf',
'etc_powerdns_pdns-froxlor.conf' => '/etc/powerdns/pdns_froxlor.conf',
),
'restart' => Array(
'/etc/init.d/pdns restart'
)
),
)
),
'smtp' => Array(
'label' => $lng['admin']['configfiles']['smtp'],
'daemons' => Array(
'postfix_courier' => Array(
'label' => 'Postfix/Courier',
'commands' => Array(
'apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql',
'mkdir -p /var/spool/postfix/etc/pam.d',
'mkdir -p /var/spool/postfix/var/run/mysqld',
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
'mkdir -p ' . $settings['system']['vmail_homedir'],
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
'touch /etc/postfix/sasl/smtpd.conf',
'chown root:root /etc/postfix/main.cf',
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chown root:root /etc/postfix/sasl/smtpd.conf',
'chmod 0644 /etc/postfix/main.cf',
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chmod 0600 /etc/postfix/sasl/smtpd.conf',
),
'files' => Array(
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
'etc_postfix_sasl_smtpd.conf' => '/etc/postfix/sasl/smtpd.conf'
),
'restart' => Array(
'/etc/init.d/postfix restart',
'newaliases'
)
),
'postfix_dovecot' => Array(
'label' => 'Postfix/Dovecot',
'commands' => Array(
'apt-get install postfix postfix-mysql',
'mkdir -p /var/spool/postfix/etc/pam.d',
'mkdir -p /var/spool/postfix/var/run/mysqld',
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
'mkdir -p ' . $settings['system']['vmail_homedir'],
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chown root:root /etc/postfix/main.cf',
'chown root:root /etc/postfix/master.cf',
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
'chmod 0644 /etc/postfix/main.cf',
'chmod 0644 /etc/postfix/master.cf',
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
),
'files' => Array(
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf'
),
'restart' => Array(
'/etc/init.d/postfix restart',
'newaliases'
)
),
'postfix_mxaccess' => Array(
'label' => 'Postfix MX-Access (anti spam)',
'files' => Array(
'etc_postfix_mx_access' => '/etc/postfix/mx_access',
'etc_postfix_main.cf' => '/etc/postfix/main.cf'
),
'commands_1' => Array(
'postmap /etc/postfix/mx_access'
),
'restart' => Array(
'/etc/init.d/postfix restart'
)
),
'exim4' => Array(
'label' => 'Exim4',
'commands_1' => Array(
'dpkg-reconfigure exim4-config',
'# choose "no configuration at this time" and "splitted configuration files" in the dialog'
),
'files' => Array(
'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt.rul' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul',
'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config',
'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options',
'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config',
'etc_exim4_conf.d_transport_30_froxlor-config' => '/etc/exim4/conf.d/transport/30_froxlor-config'
),
'commands_2' => Array(
'chmod o-rx /var/lib/exim4',
'chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options'
),
'restart' => Array(
'/etc/init.d/exim4 restart'
)
)
)
),
'mail' => Array(
'label' => $lng['admin']['configfiles']['mail'],
'daemons' => Array(
'courier' => Array(
'label' => 'Courier',
'commands' => Array(
'apt-get install courier-pop courier-imap courier-authlib-mysql'
),
'files' => Array(
'etc_courier_authdaemonrc' => '/etc/courier/authdaemonrc',
'etc_courier_authmysqlrc' => '/etc/courier/authmysqlrc'
),
'restart' => Array(
'/etc/init.d/courier-authdaemon restart',
'/etc/init.d/courier-pop restart'
)
),
'dovecot' => Array(
'label' => 'Dovecot',
'commands_1' => Array(
'apt-get install dovecot-imapd dovecot-pop3d dovecot-postfix'
),
'files' => Array(
'etc_dovecot_auth.d_01-dovecot-postfix.auth' => '/etc/dovecot/auth.d/01-dovecot-postfix.auth',
'etc_dovecot_conf.d_01-dovecot-postfix.conf' => '/etc/dovecot/conf.d/01-dovecot-postfix.conf',
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
),
'commands_2' => Array(
'chmod 0640 /etc/dovecot/dovecot-sql.conf'
),
'restart' => Array(
'/etc/init.d/dovecot restart'
)
)
)
),
'ftp' => Array(
'label' => $lng['admin']['configfiles']['ftp'],
'daemons' => Array(
'proftpd' => Array(
'label' => 'ProFTPd',
'commands' => Array(
'apt-get install proftpd-basic proftpd-mod-mysql'
),
'files' => Array(
'etc_proftpd_sql.conf' => '/etc/proftpd/sql.conf',
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
),
'restart' => Array(
'/etc/init.d/proftpd restart'
)
),
'pure-ftpd' => Array(
'label' => 'Pure FTPd',
'commands_1' => Array(
'apt-get install pure-ftpd-common pure-ftpd-mysql'
),
'files' => Array(
'etc_pure-ftpd_conf_MinUID' => '/etc/pure-ftpd/conf/MinUID',
'etc_pure-ftpd_conf_MySQLConfigFile' => '/etc/pure-ftpd/conf/MySQLConfigFile',
'etc_pure-ftpd_conf_NoAnonymous' => '/etc/pure-ftpd/conf/NoAnonymous',
'etc_pure-ftpd_conf_MaxIdleTime' => '/etc/pure-ftpd/conf/MaxIdleTime',
'etc_pure-ftpd_conf_ChrootEveryone' => '/etc/pure-ftpd/conf/ChrootEveryone',
'etc_pure-ftpd_conf_PAMAuthentication' => '/etc/pure-ftpd/conf/PAMAuthentication',
'etc_pure-ftpd_db_mysql.conf' => '/etc/pure-ftpd/db/mysql.conf',
'etc_pure-ftpd_conf_CustomerProof' => '/etc/pure-ftpd/conf/CustomerProof',
'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind',
'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common'
),
'commands_2' => Array(
'chmod 0640 /etc/pure-ftpd/db/mysql.conf'
),
'restart' => Array(
'/etc/init.d/pure-ftpd-mysql restart'
)
),
)
),
'etc' => Array(
'label' => $lng['admin']['configfiles']['etc'],
'daemons' => Array(
'cron' => Array(
'label' => 'Crond (cronscript)',
'files' => Array(
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
),
'restart' => Array(
'/etc/init.d/cron restart'
)
),
'xinetd' => Array(
'label' => 'xinet.d (froxlor updates in realtime)',
'commands' => Array(
'apt-get install xinetd'
),
'files' => Array(
'etc_xinetd.d_froxlor' => '/etc/xinetd.d/froxlor'
),
'restart' => Array(
'/etc/init.d/xinetd restart'
)
),
'awstats' => Array(
'label' => 'Awstats',
'commands' => Array(
'apt-get install awstats',
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl '.makeCorrectDir($settings['system']['awstats_path']),
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
),
),
'libnss' => Array(
'label' => 'libnss (system login with mysql)',
'commands' => Array(
'apt-get install libnss-mysql nscd',
'chmod 600 /etc/nss-mysql.conf /etc/nss-mysql-root.conf'
),
'files' => Array(
'etc_nss-mysql.conf' => '/etc/nss-mysql.conf',
'etc_nss-mysql-root.conf' => '/etc/nss-mysql-root.conf',
'etc_nsswitch.conf' => '/etc/nsswitch.conf',
),
'restart' => Array(
'/etc/init.d/nscd restart'
)
)
)
)
)
)
);
?>

View File

@@ -154,10 +154,8 @@ return Array(
'label' => 'Awstats',
'commands' => Array(
'awstats_configure.pl',
makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
),
'files' => Array(
'etc_awstats.model.conf' => makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
)
)
)

View File

@@ -45,6 +45,6 @@ else
$cfgPath = 'lib/configfiles/';
$configfiles = Array();
$configfiles = array_merge(include $cfgPath . 'lenny.inc.php', include $cfgPath . 'etch.inc.php', include $cfgPath . 'hardy.inc.php', include $cfgPath . 'gentoo.inc.php', include $cfgPath . 'suse10.inc.php', include $cfgPath . 'freebsd.inc.php');
$configfiles = array_merge(include $cfgPath . 'lenny.inc.php', include $cfgPath . 'etch.inc.php', include $cfgPath . 'hardy.inc.php', include $cfgPath . 'lucid.inc.php', include $cfgPath . 'gentoo.inc.php', include $cfgPath . 'suse10.inc.php', include $cfgPath . 'freebsd.inc.php');
?>

View File

@@ -0,0 +1,30 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package APS
* @version $Id$
*/
function getXPathValue($xmlobj = null, $path = null, $single = true)
{
$result = null;
$tmpxml = new DynamicProperties;
$tmpxml = ($xmlobj->xpath($path)) ? $xmlobj->xpath($path) : false;
if($result !== false)
{
$result = ($single == true) ? (string)$tmpxml[0] : $tmpxml;
}
return $result;
}

View File

@@ -0,0 +1,66 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* set the immutable flag for a file
*
* @param string $filename the file to set the flag for
*
* @return boolean
*/
function setImmutable($filename = null)
{
safe_exec(_getImmutableFunction(false).escapeshellarg($filename));
}
/**
* removes the immutable flag for a file
*
* @param string $filename the file to set the flag for
*
* @return boolean
*/
function removeImmutable($filename = null)
{
safe_exec(_getImmutableFunction(true).escapeshellarg($filename));
}
/**
* internal function to check whether
* to use chattr (Linux) or chflags (FreeBSD)
*
* @param boolean $remove whether to use +i|schg (false) or -i|noschg (true)
*
* @return string functionname + parameter (not the file)
*/
function _getImmutableFunction($remove = false)
{
$output = array();
$return_var = 0;
exec('which chattr 2>&1', $output, $return_var);
if((int)$return_var != 0)
{
// FreeBSD style
return 'chflags '.(($remove === true) ? 'noschg ' : 'schg ');
}
else
{
// Linux style
return 'chattr '.(($remove === true) ? '-i ' : '+i ');
}
}

View File

@@ -0,0 +1,40 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* check whether a maildir exists on the filesystem
*
* @param array $result all mail-info of customer
*
* @return boolean
*/
function maildirExists($result = null)
{
global $settings;
if(is_array($result))
{
$loginname = getCustomerDetail($result['customerid'], 'loginname');
if($loginname !== false) {
$maildir = makeCorrectDir($settings['system']['vmail_homedir'] .'/'. $loginname .'/'. $result['email_full']);
if(@file_exists($maildir)) {
return true;
}
}
}
return false;
}

View File

@@ -29,6 +29,15 @@
function makeCorrectFile($filename)
{
if (!isset($filename)
|| trim($filename) == ''
) {
$error = 'Given filename for function '.__FUNCTION__.' is empty.'."\n";
$error.= 'This is very dangerous and should not happen.'."\n";
$error.= 'Please inform the Froxlor team about this issue so they can fix it.';
die($error);
}
if(substr($filename, 0, 1) != '/')
{
$filename = '/' . $filename;

View File

@@ -24,6 +24,8 @@
* @param integer uid The uid which must match the found directories
* @param integer gid The gid which must match the found direcotries
* @param string fieldType Either "Manual" or "Dropdown"
* @param string value the value for the input-field
*
* @return string The html tag for the choosen $fieldType
*
* @author Martin Burchert <martin.burchert@syscp.de>
@@ -42,6 +44,12 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '')
}
elseif($fieldType == 'Dropdown')
{
// path is given without starting slash
// but dirList holds the paths with starting slash
// so we just add one here to get the correct
// default path selected, #225
$value = '/'.$value;
$dirList = findDirs($path, $uid, $gid);
natcasesort($dirList);
@@ -64,8 +72,11 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '')
}
else
{
// remove starting slash we added
// for the Dropdown, #225
$value = substr($value, 1);
$field = $lng['panel']['toomanydirs'];
$field.= '<input type="text" name="path" value="' . htmlspecialchars($value) . '" />';
$field.= '<br /><input type="text" name="path" value="' . htmlspecialchars($value) . '" />';
}
}
else

View File

@@ -27,6 +27,7 @@
* @param int The uid of the user
* @param int The gid of the user
* @param bool Place standard-index.html into the new folder
* @param bool Allow creating a directory out of the customers docroot
*
* @return bool true if everything went okay, false if something went wrong
*
@@ -34,7 +35,7 @@
* @author Martin Burchert <martin.burchert@syscp.org>
*/
function mkDirWithCorrectOwnership($homeDir, $dirToCreate, $uid, $gid, $placeindex = false)
function mkDirWithCorrectOwnership($homeDir, $dirToCreate, $uid, $gid, $placeindex = false, $allow_notwithinhomedir = false)
{
$returncode = true;
@@ -47,16 +48,20 @@ function mkDirWithCorrectOwnership($homeDir, $dirToCreate, $uid, $gid, $placeind
if(substr($dirToCreate, 0, strlen($homeDir)) == $homeDir)
{
$subdir = substr($dirToCreate, strlen($homeDir));
$within_homedir = true;
}
else
{
$subdir = $dirToCreate;
$within_homedir = false;
}
$subdir = makeCorrectDir($subdir);
$subdirlen = strlen($subdir);
$subdirs = array();
array_push($subdirs, $dirToCreate);
if($within_homedir || !$allow_notwithinhomedir)
{
$subdirlen = strlen($subdir);
$offset = 0;
while($offset < $subdirlen)
@@ -66,6 +71,11 @@ function mkDirWithCorrectOwnership($homeDir, $dirToCreate, $uid, $gid, $placeind
$offset++;
array_push($subdirs, makeCorrectDir($homeDir . $subdirelem));
}
}
else
{
array_push($subdirs, $dirToCreate);
}
$subdirs = array_unique($subdirs);
sort($subdirs);

View File

@@ -48,6 +48,7 @@ function safe_exec($exec_string, &$return_value = false)
'du',
'chmod',
'chattr',
'chflags', /* freebsd equivalent to linux' chattr */
$settings['system']['apachereload_command'],
$settings['system']['bindreload_command'],
$settings['dkim']['dkimrestart_command'],

View File

@@ -1,5 +1,20 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* store the default index-file in a given destination folder
*

View File

@@ -58,6 +58,11 @@ function validateFormFieldString($fieldname, $fielddata, $newfieldvalue)
}
elseif(isset($fielddata['string_type']) && $fielddata['string_type'] == 'dir')
{
// add trailing slash to validate path if needed
// refs #331
if(substr($newfieldvalue, -1) != '/') {
$newfieldvalue.= '/';
}
$returnvalue = ($newfieldvalue == makeCorrectDir($newfieldvalue));
}
elseif(isset($fielddata['string_type']) && $fielddata['string_type'] == 'file')

View File

@@ -0,0 +1,70 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/*
* this functions validates a given value as ErrorDocument
* refs #267
*
* @param string error-document-string
*
* @return string error-document-string
*
*/
function correctErrorDocument($errdoc = null)
{
global $settings, $idna_convert;
if($errdoc !== null && $errdoc != '')
{
// not a URL
if((strtoupper(substr($errdoc, 0, 5)) != 'HTTP:'
&& strtoupper(substr($errdoc, 0, 6)) != 'HTTPS:')
|| !validateUrl($idna_convert->encode($errdoc)))
{
// a file
if(substr($errdoc, 0, 1) != '"')
{
$errdoc = makeCorrectFile($errdoc);
// apache needs a starting-slash (starting at the domains-docroot)
if(!substr($errdoc, 0, 1) == '/') {
$errdoc = '/'.$errdoc;
}
}
// a string (check for ending ")
else
{
// string won't work for lighty
if($settings['system']['webserver'] == 'lighttpd')
{
standard_error('stringerrordocumentnotvalidforlighty');
}
elseif(substr($errdoc, -1) != '"')
{
$errdoc .= '"';
}
}
}
else
{
if($settings['system']['webserver'] == 'lighttpd')
{
standard_error('urlerrordocumentnotvalidforlighty');
}
}
}
return $errdoc;
}

View File

@@ -229,6 +229,59 @@ function getOutstandingTasks()
}
}
$query2 = "SELECT DISTINCT `Task` FROM `".TABLE_APS_TASKS."` ORDER BY `Task` ASC";
$result2 = $db->query($query2);
while($row2 = $db->fetch_array($result2))
{
/*
* install
*/
if($row2['Task'] == '1')
{
$task_desc = $lng['tasks']['aps_task_install'];
}
/*
* remove
*/
elseif($row2['Task'] == '2')
{
$task_desc = $lng['tasks']['aps_task_remove'];
}
/*
* reconfigure
*/
elseif($row2['Task'] == '3')
{
$task_desc = $lng['tasks']['aps_task_reconfigure'];
}
/*
* upgrade
*/
elseif($row2['Task'] == '4')
{
$task_desc = $lng['tasks']['aps_task_upgrade'];
}
/*
* system update
*/
elseif($row2['Task'] == '5')
{
$task_desc = $lng['tasks']['aps_task_sysupdate'];
}
/*
* system download
*/
elseif($row2['Task'] == '6')
{
$task_desc = $lng['tasks']['aps_task_sysdownload'];
}
if($task_desc != '') {
$tasks .= '<li>'.$task_desc.'</li>';
}
}
if(trim($tasks) == '') {
$outstanding_tasks .= '<li>'.$lng['tasks']['noneoutstanding'].'</li>';
} else {

View File

@@ -0,0 +1,42 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/*
* Function customerHasPerlEnabled
*
* returns true or false whether perl is
* enabled for the given customer
*
* @param int customer-id
*
* @return boolean
*/
function customerHasPerlEnabled($cid = 0)
{
global $db;
if($cid > 0)
{
$result = $db->query_first("SELECT `perlenabled` FROM `".TABLE_PANEL_CUSTOMERS."` WHERE `customerid` = '".(int)$cid."'");
if(is_array($result)
&& isset($result['perlenabled'])
) {
return ($result['perlenabled'] == '1') ? true : false;
}
}
return false;
}

View File

@@ -0,0 +1,60 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* check whether a domain has subdomains added as full-domains
* #329
*
* @param int $id domain-id
*
* @return boolean
*/
function domainHasMainSubDomains($id = 0)
{
global $db;
$sql = "SELECT COUNT(`id`) as `mainsubs` FROM `".TABLE_PANEL_DOMAINS."` WHERE `ismainbutsubto` = '".(int)$id."'";
$result = $db->query_first($sql);
if(isset($result['mainsubs'])
&& $result['mainsubs'] > 0
) {
return true;
}
return false;
}
/**
* check whether a subof-domain exists
* #329
*
* @param int $id subof-domain-id
*
* @return boolean
*/
function domainMainToSubExists($id = 0)
{
global $db;
$sql = "SELECT `id` FROM `".TABLE_PANEL_DOMAINS."` WHERE `id` = '".(int)$id."'";
$result = $db->query_first($sql);
if(isset($result['id'])
&& $result['id'] > 0
) {
return true;
}
return false;
}

View File

@@ -62,6 +62,28 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '')
$db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`, `data`) VALUES ("6", "' . $db->escape($data) . '")');
$doupdate = true;
}
elseif($type == '7'
&& $param1 != ''
&& $param2 != '')
{
$data = Array();
$data['loginname'] = $param1;
$data['email'] = $param2;
$data = serialize($data);
$db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`, `data`) VALUES ("7", "' . $db->escape($data) . '")');
$doupdate = true;
}
elseif($type == '8'
&& $param1 != ''
&& $param2 != '')
{
$data = Array();
$data['loginname'] = $param1;
$data['homedir'] = $param2;
$data = serialize($data);
$db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`, `data`) VALUES ("8", "' . $db->escape($data) . '")');
$doupdate = true;
}
if($doupdate === true
&& (int)$settings['system']['realtime_port'] !== 0

View File

@@ -26,7 +26,7 @@
*
* @return null
*/
function openRootDB($debugHandler, $lockfile)
function openRootDB($debugHandler = false, $lockfile = false)
{
global $db_root;
@@ -47,14 +47,22 @@ function openRootDB($debugHandler, $lockfile)
/**
* Do not proceed further if no database connection could be established
*/
if(isset($debugHandler) && $debugHandler !== false)
{
fclose($debugHandler);
}
if(isset($lockfile) && $lockfile !== false)
{
unlink($lockfile);
}
die('root can\'t connect to mysqlserver. Please check userdata.inc.php! Exiting...');
}
unset($db_root->password);
if(isset($debugHandler) && $debugHandler !== false)
{
fwrite($debugHandler, 'Database-rootconnection established' . "\n");
}
unset($sql);
}

View File

@@ -115,7 +115,7 @@ function hasUpdates($to_check = null)
*/
function showUpdateStep($task = null, $needs_status = true)
{
global $updatelog;
global $updatelog, $filelog;
// output
echo $task;
@@ -126,6 +126,7 @@ function showUpdateStep($task = null, $needs_status = true)
}
$updatelog->logAction(ADM_ACTION, LOG_WARNING, $task);
$filelog->logAction(ADM_ACTION, LOG_WARNING, $task);
}
/*
@@ -140,7 +141,7 @@ function showUpdateStep($task = null, $needs_status = true)
*/
function lastStepStatus($status = -1, $message = '')
{
global $updatelog;
global $updatelog, $filelog;
switch($status)
{
@@ -164,8 +165,35 @@ function lastStepStatus($status = -1, $message = '')
// output
echo "<span style=\"margin-left: 5em; font-weight: bold; color: #".$status_color."\">".$status_sign."</span><br />";
if($status == -1)
if($status == -1 || $status == 2)
{
$updatelog->logAction(ADM_ACTION, LOG_WARNING, 'Attention - last update task failed!!!');
$filelog->logAction(ADM_ACTION, LOG_WARNING, 'Attention - last update task failed!!!');
}
elseif($status == 0 || $status == 1)
{
$filelog->logAction(ADM_ACTION, LOG_WARNING, 'Success');
}
}
/**
* validate if full path to update.log is sane
* if not, the update.log is created in /tmp/
*
* @param string $filename the file name to validate
*
* @return string the full path with filename (can differ if not writeable => /tmp)
*/
function validateUpdateLogFile($filename)
{
if(!is_dir($filename))
{
$fh = @fopen($filename, 'a');
if($fh)
{
fclose($fh);
return $filename;
}
}
return '/tmp/froxlor_update.log';
}

View File

@@ -0,0 +1,164 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $$
*/
/**
* return an array of all enabled redirect-codes
*
* @return array array of enabled redirect-codes
*/
function getRedirectCodesArray()
{
global $db;
$sql = "SELECT * FROM `".TABLE_PANEL_REDIRECTCODES."` WHERE `enabled` = '1' ORDER BY `id` ASC";
$result = $db->query($sql);
$codes = array();
while($rc = $db->fetch_array($result))
{
$codes[] = $rc;
}
return $codes;
}
/**
* return an array of all enabled redirect-codes
* for the settings form
*
* @return array array of enabled redirect-codes
*/
function getRedirectCodes()
{
global $db, $lng;
$sql = "SELECT * FROM `".TABLE_PANEL_REDIRECTCODES."` WHERE `enabled` = '1' ORDER BY `id` ASC";
$result = $db->query($sql);
$codes = array();
while($rc = $db->fetch_array($result))
{
$codes[$rc['id']] = $rc['code']. ' ('.$lng['redirect_desc'][$rc['desc']].')';
}
return $codes;
}
/**
* returns the redirect-code for a given
* domain-id
*
* @param integer $domainid id of the domain
*
* @return string redirect-code
*/
function getDomainRedirectCode($domainid = 0)
{
global $db;
$code = '';
if($domainid > 0)
{
$sql = "SELECT `r`.`code` as `redirect`
FROM `".TABLE_PANEL_REDIRECTCODES."` `r`, `".TABLE_PANEL_DOMAINREDIRECTS."` `rc`
WHERE `r`.`id` = `rc`.`rid` and `rc`.`did` = '".(int)$domainid."'";
$result = $db->query_first($sql);
if(is_array($result)
&& isset($result['redirect'])
) {
$code = ($result['redirect'] == '---') ? '' : $result['redirect'];
}
}
return $code;
}
/**
* returns the redirect-id for a given
* domain-id
*
* @param integer $domainid id of the domain
*
* @return integer redirect-code-id
*/
function getDomainRedirectId($domainid = 0)
{
global $db;
$code = 1;
if($domainid > 0)
{
$sql = "SELECT `r`.`id` as `redirect`
FROM `".TABLE_PANEL_REDIRECTCODES."` `r`, `".TABLE_PANEL_DOMAINREDIRECTS."` `rc`
WHERE `r`.`id` = `rc`.`rid` and `rc`.`did` = '".(int)$domainid."'";
$result = $db->query_first($sql);
if(is_array($result)
&& isset($result['redirect'])
) {
$code = (int)$result['redirect'];
}
}
return $code;
}
/**
* adds a redirectcode for a domain
*
* @param integer $domainid id of the domain to add the code for
* @param integer $redirect selected redirect-id
*
* @return null
*/
function addRedirectToDomain($domainid = 0, $redirect = 1)
{
global $db;
if($domainid > 0)
{
$db->query("INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."`
SET `rid` = '".(int)$redirect."', `did` = '".(int)$domainid."'");
}
}
/**
* updates the redirectcode of a domain
* if redirect-code is false, nothing happens
*
* @param integer $domainid id of the domain to update
* @param integer $redirect selected redirect-id or false
*
* @return null
*/
function updateRedirectOfDomain($domainid = 0, $redirect = false)
{
global $db;
if($redirect == false)
{
return;
}
if($domainid > 0)
{
$db->query("DELETE FROM `".TABLE_PANEL_DOMAINREDIRECTS."`
WHERE `did` = '".(int)$domainid."'");
$db->query("INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."`
SET `rid` = '".(int)$redirect."', `did` = '".(int)$domainid."'");
}
}

View File

@@ -66,7 +66,7 @@ function ask_yesno($text, $yesfile, $params = array(), $targetname = '')
exit;
}
function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '')
function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true)
{
global $userinfo, $db, $s, $header, $footer, $lng;
@@ -90,7 +90,11 @@ function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $
$chk_text = $lng['question'][$chk_text];
}
if ($show_checkbox) {
$checkbox = makecheckbox('delete_userfiles', $chk_text, '1', false, '0', true, true);
} else {
$checkbox = '<input type="hidden" name="delete_userfiles" value="0" />' . "\n";;
}
$text = strtr($text, array('%s' => $targetname));
eval("echo \"" . getTemplate('misc/question_yesno_checkbox', '1') . "\";");

View File

@@ -11,7 +11,7 @@
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Language
* @package Functions
* @version $Id$
*/

View File

@@ -0,0 +1,45 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* checks give path for security issues
* and returns a string that can be appended
* to a line for a open_basedir directive
*
* @param string $path the path to check and append
* @param boolean $first if true, no ':' will be prefixed to the path
*
* @return string
*/
function appendOpenBasedirPath($path = '', $first = false)
{
$path = makeCorrectDir($path);
if($path != ''
&& $path != '/'
&& !preg_match("#^/dev#i", $path)
&& !preg_match("#^/proc#i", $path)
&& !preg_match("#^/etc#i", $path)
&& !preg_match("#^/sys#i", $path)
&& !preg_match("#:#", $path)
) {
if($first)
return $path;
return ':' . $path;
}
return '';
}

View File

@@ -0,0 +1,32 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* validates a given regex
*
* @param string $regex regex to validate
*
* @return boolean
*/
function checkValidRegEx($regex = null)
{
if($regex == null || $regex == '') {
return true;
}
}

View File

@@ -39,23 +39,14 @@ function validateDomain($domainname)
// there is a bug in php 5.2.13 - 5.3.2 which
// lets filter_var fail if the domain has
// a dash (-) in it. #
if(version_compare("5.2.13", PHP_VERSION, "=")
|| version_compare("5.3.2", PHP_VERSION, "="))
{
// a dash (-) in it. As the PHP_VERSION constant
// gives also patch-brandings, e.g. '5.3.2-pl0-gentoo'
// we just always use our regex
$pattern = '/^http:\/\/([a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?\.)+[a-z]{2,6}$/i';
if(preg_match($pattern, $domainname_tmp))
{
return $domainname;
}
}
else
{
if(filter_var($domainname_tmp, FILTER_VALIDATE_URL) !== false && filter_var($domainname_tmp, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED) === false && filter_var($domainname_tmp, FILTER_VALIDATE_URL, FILTER_FLAG_QUERY_REQUIRED) === false)
{
return $domainname;
}
}
return false;
}

View File

@@ -39,5 +39,14 @@ function validatePassword($password = null)
);
}
if ($settings['panel']['password_regex'] != '') {
$password = validate(
$password,
$settings['panel']['password_regex'],
$settings['panel']['password_regex'],
'notrequiredpasswordcomplexity'
);
}
return $password;
}

View File

@@ -28,28 +28,22 @@
function validateUrl($url)
{
global $idna_convert;
if(strtolower(substr($url, 0, 7)) != "http://"
&& strtolower(substr($url, 0, 8)) != "https://")
{
$url = 'http://' . $url;
}
if(version_compare("5.2.13", PHP_VERSION, "=")
|| version_compare("5.3.2", PHP_VERSION, "="))
{
$pattern = '/^https?:\/\/([a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?\.)+[a-z]{2,6}$/i';
// needs converting
$url = $idna_convert->encode($url);
$pattern = "/^https?:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?$/i";
if(preg_match($pattern, $url))
{
return true;
}
}
else
{
if(filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) !== false)
{
return true;
}
}
// not an fqdn
if(strtolower(substr($url, 0, 7)) == "http://"

View File

@@ -265,9 +265,16 @@ foreach($langs as $key => $value)
$languages[$key] = $key;
}
if(!isset($userinfo['def_language'])
|| !isset($languages[$userinfo['def_language']]))
if (isset($userinfo['language']) && isset($languages[$userinfo['language']]))
{
// default: use language from session, #277
$language = $userinfo['language'];
}
else
{
if(!isset($userinfo['def_language'])
|| !isset($languages[$userinfo['def_language']]))
{
if(isset($_GET['language'])
&& isset($languages[$_GET['language']]))
{
@@ -277,10 +284,11 @@ if(!isset($userinfo['def_language'])
{
$language = $settings['panel']['standardlanguage'];
}
}
else
{
}
else
{
$language = $userinfo['def_language'];
}
}
// include every english language file we can get
@@ -422,7 +430,7 @@ if($page == '')
/**
* Initialize the mailingsystem
*/
$mail = new PHPMailer();
$mail = new PHPMailer(true);
if(PHPMailer::ValidateAddress($settings['panel']['adminmail']) !== false)
{
// set return-to address and custom sender-name, see #76

View File

@@ -51,6 +51,8 @@ define('TABLE_APS_SETTINGS', 'aps_settings');
define('TABLE_APS_TASKS', 'aps_tasks');
define('TABLE_APS_TEMP_SETTINGS', 'aps_temp_settings');
define('TABLE_PANEL_CRONRUNS', 'cronjobs_run');
define('TABLE_PANEL_REDIRECTCODES', 'redirect_codes');
define('TABLE_PANEL_DOMAINREDIRECTS', 'domain_redirect_codes');
// APS constants
@@ -70,7 +72,7 @@ define('PACKAGE_ENABLED', 2);
// VERSION INFO
$version = '0.9.6';
$version = '0.9.12';
$dbversion = '2';
$branding = '';

View File

@@ -171,10 +171,10 @@ $lng['extras']['error404path'] = '404';
$lng['extras']['error403path'] = '403';
$lng['extras']['error500path'] = '500';
$lng['extras']['error401path'] = '401';
$lng['extras']['errordocument404path'] = 'URL to ErrorDocument 404';
$lng['extras']['errordocument403path'] = 'URL to ErrorDocument 403';
$lng['extras']['errordocument500path'] = 'URL to ErrorDocument 500';
$lng['extras']['errordocument401path'] = 'URL to ErrorDocument 401';
$lng['extras']['errordocument404path'] = 'ErrorDocument 404';
$lng['extras']['errordocument403path'] = 'ErrorDocument 403';
$lng['extras']['errordocument500path'] = 'ErrorDocument 500';
$lng['extras']['errordocument401path'] = 'ErrorDocument 401';
/**
* Errors
@@ -256,6 +256,8 @@ $lng['question']['ftp_reallydelete'] = 'Do you really want to delete the FTP acc
$lng['question']['mysql_reallydelete'] = 'Do you really want to delete the database %s? This cannot be undone!';
$lng['question']['admin_configs_reallyrebuild'] = 'Do you really want to rebuild all config files?';
$lng['question']['admin_customer_alsoremovefiles'] = 'Remove user files too?';
$lng['question']['admin_customer_alsoremovemail'] = 'Completely remove email data from filesystem?';
$lng['question']['admin_customer_alsoremoveftphomedir'] = 'Also remove FTP-user homedir?';
/**
* Mails
@@ -318,8 +320,10 @@ $lng['admin']['templates']['mailbody'] = 'Mail body';
$lng['admin']['templates']['createcustomer'] = 'Welcome mail for new customers';
$lng['admin']['templates']['pop_success'] = 'Welcome mail for new email accounts';
$lng['admin']['templates']['template_replace_vars'] = 'Variables to be replaced in the template:';
$lng['admin']['templates']['SALUTATION'] = 'Replaced with a correct salutation (name or company)';
$lng['admin']['templates']['FIRSTNAME'] = 'Replaced with the customers firstname.';
$lng['admin']['templates']['NAME'] = 'Replaced with the customers name.';
$lng['admin']['templates']['COMPANY'] = 'Replaces with the customers company name';
$lng['admin']['templates']['USERNAME'] = 'Replaced with the customers account username.';
$lng['admin']['templates']['PASSWORD'] = 'Replaced with the customers account password.';
$lng['admin']['templates']['EMAIL'] = 'Replaced with the address of the POP3/IMAP account.';
@@ -493,7 +497,7 @@ $lng['admin']['mailserversettings'] = 'Mailserver settings';
$lng['admin']['nameserversettings'] = 'Nameserver settings';
$lng['admin']['updatecounters'] = 'Recalculate resource usage';
$lng['question']['admin_counters_reallyupdate'] = 'Do you really want to recalculate resource usage?';
$lng['panel']['pathDescription'] = 'If the directory doesn\'t exist, it will be created automatically.';
$lng['panel']['pathDescription'] = 'If the directory doesn\'t exist, it will be created automatically.<br /><br />If you want a redirect to another domain than this entry has to start with http:// or https://';
// ADDED IN 1.2.16-svn6
@@ -514,7 +518,7 @@ $lng['changepassword']['also_change_webalizer'] = ' also change password of the
// ADDED IN 1.2.16-svn8
$lng['serversettings']['mailpwcleartext']['title'] = 'Also save passwords of mail accounts unencrypted in database';
$lng['serversettings']['mailpwcleartext']['description'] = 'If this is set to yes, all passwords will also be saved unencrypted (clear text, plain readable for everyone with database access) in the mail_users-table. Only activate this if you really need it!';
$lng['serversettings']['mailpwcleartext']['description'] = 'If this is set to yes, all passwords will also be saved unencrypted (clear text, plain readable for everyone with database access) in the mail_users-table. Only activate this if you intend to use SASL!';
$lng['serversettings']['mailpwcleartext']['removelink'] = 'Click here to wipe all unencrypted passwords from the table.';
$lng['question']['admin_cleartextmailpws_reallywipe'] = 'Do you really want to wipe all unencrypted mail account passwords from the table mail_users? This cannot be reverted!';
$lng['admin']['configfiles']['overview'] = 'Overview';
@@ -1064,7 +1068,7 @@ $lng['aps']['nospecialchars'] = 'Special characters are not allowed in the searc
$lng['aps']['noitemsfound'] = 'No Packages were found!';
$lng['aps']['nopackagesinstalled'] = 'You haven\'t installed any package yet which could be shown.';
$lng['aps']['instance_install'] = 'Package Installation pending';
$lng['aps']['instance_task_active'] = 'Installation running at this moment';
$lng['aps']['instance_task_active'] = 'Package is currently being processed';
$lng['aps']['instance_success'] = 'Package is installed/was installed successfully';
$lng['aps']['instance_error'] = 'Package isn\'t installed - there occured some errors on the Installation';
$lng['aps']['instance_uninstall'] = 'Package Uninstallation pending';
@@ -1350,10 +1354,9 @@ $lng['serversettings']['stdsubdomainhost']['description'] = 'What hostname shoul
// ADDED IN FROXLOR 0.9.4-svn1
$lng['ftp']['account_edit'] = 'Edit ftp account';
$lng['ftp']['editpassdescription'] = 'Set new password or leave blank for no change.';
$lng['mysql']['sendinfomail'] = 'Send data via email to me';
$lng['customer']['sendinfomail'] = 'Send data via email to me';
$lng['customer']['mysql_add']['infomail_subject'] = '[Froxlor] New database created';
$lng['customer']['mysql_add']['infomail_body']['pma'] = "\nYou can access your databases using phpMyAdmin via {URI}\n";
$lng['customer']['mysql_add']['infomail_body']['main'] = "Hello {CUST_NAME},\n\nyou have just added a new database. Here is the entered information:\n\nDatabasename: {DB_NAME}\nPassword: {DB_PASS}\nDescription: {DB_DESC}\nDB-Hostname: {DB_SRV}\n{PMA_URI}\nYours sincerely, the Froxlor-Team";
$lng['customer']['mysql_add']['infomail_body']['main'] = "Hello {CUST_NAME},\n\nyou have just added a new database. Here is the entered information:\n\nDatabasename: {DB_NAME}\nPassword: {DB_PASS}\nDescription: {DB_DESC}\nDB-Hostname: {DB_SRV}\nphpMyAdmin: {PMA_URI}\nYours sincerely, the Froxlor-Team";
$lng['error']['domains_cantdeletedomainwithapsinstances'] = 'You cannot delete a domain which is used by an installed APS package. You have to uninstall it first.';
$lng['serversettings']['awstats_path'] = 'Path to AWStats \'awstats_buildstaticpages.pl\'';
$lng['serversettings']['awstats_conf'] = 'AWStats configuration path';
@@ -1391,4 +1394,108 @@ $lng['serversettings']['ftpserver']['desc'] = 'If pureftpd is selected the .ftpq
// CHANGED IN FROXLOR 0.9.6-svn6
$lng['serversettings']['ftpprefix']['description'] = 'Which prefix should ftp accounts have?<br/><b>If you change this you also have to change the Quota SQL Query in your FTP Server config file in case you use it!</b> ';
// ADDED IN FROXLOR 0.9.7-svn1
$lng['customer']['ftp_add']['infomail_subject'] = '[Froxlor] New ftp-user created';
$lng['customer']['ftp_add']['infomail_body']['main'] = "Hello {CUST_NAME},\n\nyou have just added a new ftp-user. Here is the entered information:\n\nUsername: {USR_NAME}\nPassword: {USR_PASS}\nPath: {USR_PATH}\n\nYours sincerely, the Froxlor-Team";
$lng['domains']['redirectifpathisurl'] = 'Redirect code (default: empty)';
$lng['domains']['redirectifpathisurlinfo'] = 'You only need to select one of these if you entered an URL as path';
$lng['serversettings']['customredirect_enabled']['title'] = 'Allow customer redirects';
$lng['serversettings']['customredirect_enabled']['description'] = 'Allow customers to choose the http-status code for redirects which will be used';
$lng['serversettings']['customredirect_default']['title'] = 'Default redirect';
$lng['serversettings']['customredirect_default']['description'] = 'Set the default redirect-code which should be used if the customer does not set it himself';
// ADDED IN FROXLOR 0.9.7-svn2
$lng['error']['pathmaynotcontaincolon'] = 'The path you have entered should not contain a colon (":"). Please enter a correct path value.';
$lng['tasks']['aps_task_install'] = 'Installing one or more APS packages';
$lng['tasks']['aps_task_remove'] = 'Removing one or more APS packages';
$lng['tasks']['aps_task_reconfigure'] = 'Reconfigurating one or more APS packages';
$lng['tasks']['aps_task_upgrade'] = 'Upgrading one or more APS packages';
$lng['tasks']['aps_task_sysupdate'] = 'Updating all APS packages';
$lng['tasks']['aps_task_sysdownload'] = 'Downloading new APS packages';
// ADDED IN FROXLOR 0.9.7-svn3
// these stay only in english.lng.php - they are the same
// for all other languages and are used if not found there
$lng['redirect_desc']['rc_default'] = 'default';
$lng['redirect_desc']['rc_movedperm'] = 'moved permanently';
$lng['redirect_desc']['rc_found'] = 'found';
$lng['redirect_desc']['rc_seeother'] = 'see other';
$lng['redirect_desc']['rc_tempred'] = 'temporary redirect';
// ADDED IN FROXLOR 0.9.8
$lng['error']['exception'] = '%s';
// ADDED IN FROXLOR 0.9.9-svn1
$lng['serversettings']['mail_also_with_mxservers'] = 'Create mail-, imap-, pop3- and smtp-"A record" also with MX-Servers set';
// ADDED IN FROXLOR 0.9.10-svn1
$lng['aps']['nocontingent'] = 'Your APS contingent is insufficient. You cannot install any package.';
$lng['aps']['packageneedsdb'] = 'This package needs a database but your contingent is used up';
$lng['aps']['cannoteditordeleteapsdb'] = 'APS databases cannot be edited or removed here';
$lng['admin']['webserver_user'] = 'Webserver user-name';
$lng['admin']['webserver_group'] = 'Webserver group-name';
// ADDED IN FROXLOR 0.9.10
$lng['serversettings']['froxlordirectlyviahostname'] = 'Access Froxlor directly via the hostname';
// ADDED IN FROXLOR 0.9.11-svn1
$lng['serversettings']['panel_password_regex']['title'] = 'Regular expression for passwords';
$lng['serversettings']['panel_password_regex']['description'] = 'Here you can set a regular expression for passwords-complexity.<br />Empty = no specific requirement<br />(<a href="http://wiki.froxlor.org/doc/password-regex-examples">regex help/examples</a>)';
$lng['error']['notrequiredpasswordcomplexity'] = 'The specified password-complexity was not satisfied (regex: %s)';
// ADDED IN FROXLOR 0.9.11-svn2
$lng['extras']['execute_perl'] = 'Execute perl/CGI';
$lng['admin']['perlenabled'] = 'Perl enabled';
// ADDED IN FROXLOR 0.9.11-svn3
$lng['serversettings']['perl_path']['title'] = 'Path to perl';
$lng['serversettings']['perl_path']['description'] = 'Only relevant if you use lighttpd. Default is /usr/bin/perl';
// ADDED IN FROXLOR 0.9.12-svn1
$lng['admin']['fcgid_settings'] = 'FCGID';
$lng['serversettings']['mod_fcgid_ownvhost']['title'] = 'Enable FCGID for the Froxlor vhost';
$lng['serversettings']['mod_fcgid_ownvhost']['description'] = 'If enabled, Froxlor will also be running under a local user<br /><strong>ATTENTION:</strong>This needs manual configuration, see <a href="http://wiki.froxlor.org/contrib/fcgid-handbook">http://wiki.froxlor.org/contrib/fcgid-handbook</a>';
$lng['admin']['mod_fcgid_user'] = 'Local user to use for FCGID (Froxlor vhost)';
$lng['admin']['mod_fcgid_group'] = 'Local group to use for FCGID (Froxlor vhost)';
// ADDED IN FROXLOR 0.9.12-svn2
$lng['admin']['perl_settings'] = 'Perl/CGI';
$lng['serversettings']['perl']['suexecworkaround']['title'] = 'Enable SuExec workaround (Apache only)';
$lng['serversettings']['perl']['suexecworkaround']['description'] = 'Enable only if customer docroots are not within the apache suexec path.<br />If enabled, Froxlor will generate a symlink from the customers perl-enabled directory + /cgi-bin/ to the given path.<br />Note that perl will then only work in the folders subdirectory /cgi-bin/ and not in the folder itself (as it does without this fix!)';
$lng['serversettings']['perl']['suexeccgipath']['title'] = 'Path for customer perl-enabled directory symlinks';
$lng['serversettings']['perl']['suexeccgipath']['description'] = 'You only need to set this if the SuExec-workaround is enabled.<br />ATTENTION: Be sure this path is within the suexec path or else this workaround is uselsess';
$lng['panel']['descriptionerrordocument'] = 'Can be an URL, path to a file or just a string wrapped around " "<br />Leave empty to use server default value.';
$lng['error']['stringerrordocumentnotvalidforlighty'] = 'A string as ErrorDocument does not work in lighttpd, please specify a path to a file';
$lng['error']['urlerrordocumentnotvalidforlighty'] = 'An URL as ErrorDocument does not work in lighttpd, please specify a path to a file';
// ADDED IN FROXLOR 0.9.12-svn3
$lng['question']['remove_subbutmain_domains'] = 'Also remove domains which are added as full domains but which are subdomains of this domain?';
$lng['domains']['issubof'] = 'This domain is a subdomain of another domain';
$lng['domains']['issubofinfo'] = 'You have to set this to the correct domain if you want to add a subdomain as full-domain (e.g. you want to add "www.domain.tld", you have to select "domain.tld" here)';
$lng['domains']['nosubtomaindomain'] = 'No subdomain of a full domain';
$lng['admin']['templates']['new_database_by_customer'] = 'Customer-notification when a database has been created';
$lng['admin']['templates']['new_ftpaccount_by_customer'] = 'Customer-notification when a ftp-user has been created';
$lng['admin']['templates']['newdatabase'] = 'Notification-mails for new databases';
$lng['admin']['templates']['newftpuser'] = 'Notification-mails for new ftp-user';
$lng['admin']['templates']['CUST_NAME'] = 'Customer name';
$lng['admin']['templates']['DB_NAME'] = 'Database name';
$lng['admin']['templates']['DB_PASS'] = 'Database password';
$lng['admin']['templates']['DB_DESC'] = 'Database description';
$lng['admin']['templates']['DB_SRV'] = 'Database server';
$lng['admin']['templates']['PMA_URI'] = 'URL to phpMyAdmin (if given)';
$lng['admin']['notgiven'] = '[not given]';
$lng['admin']['templates']['USR_NAME'] = 'FTP username';
$lng['admin']['templates']['USR_PASS'] = 'FTP password';
$lng['admin']['templates']['USR_PATH'] = 'FTP homedir (relative to customer-docroot)';
// ADDED IN FROXLOR 0.9.12-svn4
$lng['serversettings']['awstats_awstatspath'] = 'Path to AWStats \'awstats.pl\'';
// ADDED IN FROXLOR 0.9.12-svn6
$lng['extras']['htpasswdauthname'] = 'Authentication reason (AuthName)';
$lng['extras']['directoryprotection_edit'] = 'edit directory protection';
$lng['admin']['templates']['forgotpwd'] = 'Notification-mails for password-reset';
$lng['admin']['templates']['password_reset'] = 'Customer-notification for passwort-reset';
?>

View File

@@ -171,10 +171,10 @@ $lng['extras']['error404path'] = '404';
$lng['extras']['error403path'] = '403';
$lng['extras']['error500path'] = '500';
$lng['extras']['error401path'] = '401';
$lng['extras']['errordocument404path'] = 'URL zum Fehlerdokument 404';
$lng['extras']['errordocument403path'] = 'URL zum Fehlerdokument 403';
$lng['extras']['errordocument500path'] = 'URL zum Fehlerdokument 500';
$lng['extras']['errordocument401path'] = 'URL zum Fehlerdokument 401';
$lng['extras']['errordocument404path'] = 'Fehlerdokument 404';
$lng['extras']['errordocument403path'] = 'Fehlerdokument 403';
$lng['extras']['errordocument500path'] = 'Fehlerdokument 500';
$lng['extras']['errordocument401path'] = 'Fehlerdokument 401';
/**
* Errors
@@ -223,7 +223,7 @@ $lng['error']['nosubjectcreate'] = 'Sie m&uuml;ssen einen Betreff angeben.';
$lng['error']['nomailbodycreate'] = 'Sie m&uuml;ssen einen E-Mail-Text eingeben.';
$lng['error']['templatenotfound'] = 'Vorlage wurde nicht gefunden.';
$lng['error']['alltemplatesdefined'] = 'Sie k&ouml;nnen keine weiteren Vorlagen anlegen, da bereits alle Sprachen mit Vorlagen versorgt sind.';
$lng['error']['wwwnotallowed'] = 'Ihre Subdomain darf nicht www heissen.';
$lng['error']['wwwnotallowed'] = 'Ihre Subdomain darf nicht www hei&szlig;en.';
$lng['error']['subdomainiswrong'] = 'Die Subdomain %s enth&auml;lt ung&uuml;ltige Zeichen.';
$lng['error']['domaincantbeempty'] = 'Der Domain-Name darf nicht leer sein.';
$lng['error']['domainexistalready'] = 'Die Domain %s existiert bereits.';
@@ -256,6 +256,8 @@ $lng['question']['ftp_reallydelete'] = 'Wollen Sie das FTP-Benutzerkonto %s wirk
$lng['question']['mysql_reallydelete'] = 'Wollen Sie die Datenbank %s wirklich l&ouml;schen?<br />ACHTUNG! Alle Daten gehen unwiderruflich verloren!';
$lng['question']['admin_configs_reallyrebuild'] = 'Wollen Sie wirklich alle Konfigurationsdateien neu erstellen lassen?';
$lng['question']['admin_customer_alsoremovefiles'] = 'Auch Kunden-Daten l&ouml;schen?';
$lng['question']['admin_customer_alsoremovemail'] = 'E-Mail Daten auf dem Dateisystem l&ouml;schen?';
$lng['question']['admin_customer_alsoremoveftphomedir'] = 'Heimatverzeichnis des FTP-Benutzers l&ouml;schen?';
/**
* Mails
@@ -319,8 +321,10 @@ $lng['admin']['templates']['createcustomer'] = 'Willkommensmail f&uuml;r neue Ku
$lng['admin']['templates']['pop_success'] = 'Willkommensmail f&uuml;r neue E-Mail Konten';
$lng['admin']['wwwserveralias'] = 'www. ServerAlias hinzuf&uuml;gen';
$lng['admin']['templates']['template_replace_vars'] = 'Variablen, die in den Vorlagen ersetzt werden:';
$lng['admin']['templates']['SALUTATION'] = 'Wird mit einer korrekten Anrede des Kunden ersetzt';
$lng['admin']['templates']['FIRSTNAME'] = 'Wird mit dem Vornamen des Kunden ersetzt.';
$lng['admin']['templates']['NAME'] = 'Wird mit dem Namen des Kunden ersetzt.';
$lng['admin']['templates']['COMPANY'] = 'Wird mit dem Firmennamen des Kunden ersetzt.';
$lng['admin']['templates']['USERNAME'] = 'Wird mit dem Benutzernamen des neuen Kundenkontos ersetzt.';
$lng['admin']['templates']['PASSWORD'] = 'Wird mit dem Passwort des neuen Kundenkontos ersetzt.';
$lng['admin']['templates']['EMAIL'] = 'Wird mit der Adresse des neuen POP3/IMAP Kontos ersetzt.';
@@ -346,11 +350,11 @@ $lng['serversettings']['ipaddress']['description'] = 'Welche IP-Adresse hat der
$lng['serversettings']['hostname']['title'] = 'Hostname';
$lng['serversettings']['hostname']['description'] = 'Welchen Hostnamen hat der Server?';
$lng['serversettings']['apachereload_command']['title'] = 'Webserver-Reload-Command';
$lng['serversettings']['apachereload_command']['description'] = 'Wie heisst das Skript zum Neuladen der Webserver-Konfigurationsdateien?';
$lng['serversettings']['apachereload_command']['description'] = 'Wie hei&szlig;t das Skript zum Neuladen der Webserver-Konfigurationsdateien?';
$lng['serversettings']['bindconf_directory']['title'] = 'Bind-Config-Directory';
$lng['serversettings']['bindconf_directory']['description'] = 'Wo liegen die Bind-Konfigurationsdateien?';
$lng['serversettings']['bindreload_command']['title'] = 'Bind-Reload-Command';
$lng['serversettings']['bindreload_command']['description'] = 'Wie heisst das Skript zum Neuladen der Bind-Konfigurationsdateien?';
$lng['serversettings']['bindreload_command']['description'] = 'Wie hei&szlig;t das Skript zum Neuladen der Bind-Konfigurationsdateien?';
$lng['serversettings']['binddefaultzone']['title'] = 'Bind-Default-Zone';
$lng['serversettings']['binddefaultzone']['description'] = 'Wie hei&szlig;t die Default-Zone f&uuml;r alle Domains?';
$lng['serversettings']['vmail_uid']['title'] = 'Mails-Uid';
@@ -492,7 +496,7 @@ $lng['admin']['mailserversettings'] = 'Mailservereinstellungen';
$lng['admin']['nameserversettings'] = 'Nameservereinstellungen';
$lng['admin']['updatecounters'] = 'Ressourcenverbrauch';
$lng['question']['admin_counters_reallyupdate'] = 'Wollen Sie den Ressourcenverbrauch neu berechnen?';
$lng['panel']['pathDescription'] = 'Wenn das Verzeichnis nicht existiert, wird es automatisch erstellt.';
$lng['panel']['pathDescription'] = 'Wenn das Verzeichnis nicht existiert, wird es automatisch erstellt.<br /><br />Sollte eine Weiterleitung auf eine andere Domain gew&uuml;nscht sein, muss der Eintrag mit http:// oder https:// beginnen';
// ADDED IN 1.2.16-svn6
@@ -513,7 +517,7 @@ $lng['changepassword']['also_change_webalizer'] = ' Auch Passwort vom Webalizer
// ADDED IN 1.2.16-svn8
$lng['serversettings']['mailpwcleartext']['title'] = 'Passw&ouml;rter der Mail-Konten auch im Klartext in der Datenbank speichern';
$lng['serversettings']['mailpwcleartext']['description'] = 'Wenn diese Einstellung auf Ja gesetzt wird, werden alle Passw&ouml;rter auch unverschl&uuml;sselt (also im Klartext, f&uuml;r jeden mit Zugriff auf die Froxlor-Datenbank sofort lesbar) in der mail_users-Tabelle gespeichert. Aktivieren Sie diese Option nur dann, wenn Sie sie wirklich gebrauchen!';
$lng['serversettings']['mailpwcleartext']['description'] = 'Wenn diese Einstellung auf Ja gesetzt wird, werden alle Passw&ouml;rter auch unverschl&uuml;sselt (also im Klartext, f&uuml;r jeden mit Zugriff auf die Froxlor-Datenbank sofort lesbar) in der mail_users-Tabelle gespeichert. Aktivieren Sie diese Option nur dann, wenn Sie SASL nutzen!';
$lng['serversettings']['mailpwcleartext']['removelink'] = 'Klicken Sie hier, um alle unverschl&uuml;sselten Passw&ouml;rter aus der Tabelle zu entfernen.';
$lng['question']['admin_cleartextmailpws_reallywipe'] = 'Wollen Sie wirklich alle unverschl&uuml;sselten Passw&ouml;rter aus der Tabelle mail_users entfernen? Dieser Schritt kann nicht r&uuml;ckg&auml;ngig gemacht werden!';
$lng['admin']['configfiles']['overview'] = '&Uuml;bersicht';
@@ -932,7 +936,7 @@ $lng['customer']['email_pop3'] = 'E-Mail POP3';
$lng['customer']['mail_quota'] = 'E-Mail Kontingent';
$lng['panel']['megabyte'] = 'MegaByte';
$lng['emails']['quota_edit'] = 'E-Mail Kontingent &auml;ndern';
$lng['panel']['not_supported'] = 'Nicht &uuml;nterst&uuml;zt in: ';
$lng['panel']['not_supported'] = 'Nicht unterst&uuml;zt in: ';
$lng['error']['allocatetoomuchquota'] = 'Sie versuchen %s MB ' . $lng['emails']['quota'] . ' zu zuweisen, haben aber nicht genug &uuml;brig.';
// Autoresponder module
@@ -1069,7 +1073,7 @@ $lng['aps']['nospecialchars'] = 'Sonderzeichen sind im Suchausdruck nicht erlaub
$lng['aps']['noitemsfound'] = 'Es wurden keine Pakete gefunden!';
$lng['aps']['nopackagesinstalled'] = 'Sie haben noch kein Paket installiert welches angezeigt werden k&ouml;nnte.';
$lng['aps']['instance_install'] = 'Paket wurde zur Installation vorgemerkt';
$lng['aps']['instance_task_active'] = 'Paket wird gerade installiert';
$lng['aps']['instance_task_active'] = 'Paket wird gerade bearbeitet';
$lng['aps']['instance_success'] = 'Paket ist installiert bzw. wurde erfolgreich installiert';
$lng['aps']['instance_error'] = 'Paket ist nicht installiert - bei der Installation traten Fehler auf';
$lng['aps']['instance_uninstall'] = 'Paket wurde zur Deinstallation vorgemerkt';
@@ -1330,10 +1334,9 @@ $lng['serversettings']['stdsubdomainhost']['description'] = 'Welcher Hostname so
// ADDED IN FROXLOR 0.9.4-svn1
$lng['ftp']['account_edit'] = 'FTP Konto bearbeiten';
$lng['ftp']['editpassdescription'] = 'Neues Passwort setzen oder leer f&uuml;r keine &Auml;nderung.';
$lng['mysql']['sendinfomail'] = 'Daten per E-Mail an mich senden';
$lng['customer']['sendinfomail'] = 'Daten per E-Mail an mich senden';
$lng['customer']['mysql_add']['infomail_subject'] = '[Froxlor] Neue Datenbank erstellt';
$lng['customer']['mysql_add']['infomail_body']['pma'] = "\nDie Datenbank kann mit phpMyAdmin via {URI} verwaltet werden.\n";
$lng['customer']['mysql_add']['infomail_body']['main'] = "Hallo {CUST_NAME},\n\ndu hast gerade eine neue Datenbank angelegt. Hier die angegebenen Informationen:\n\nDatenbankname: {DB_NAME}\nPasswort: {DB_PASS}\nBeschreibung: {DB_DESC}\nDatenbank-Server: {DB_SRV}\n{PMA_URI}\nVielen Dank, das Froxlor-Team";
$lng['customer']['mysql_add']['infomail_body']['main'] = "Hallo {CUST_NAME},\n\ndu hast gerade eine neue Datenbank angelegt. Hier die angegebenen Informationen:\n\nDatenbankname: {DB_NAME}\nPasswort: {DB_PASS}\nBeschreibung: {DB_DESC}\nDatenbank-Server: {DB_SRV}\nphpMyAdmin: {PMA_URI}\nVielen Dank, das Froxlor-Team";
$lng['error']['domains_cantdeletedomainwithapsinstances'] = 'Sie k&ouml;nnen keine Domain l&ouml;schen, die noch von APS Paketen verwendet wird. L&ouml;schen Sie zuerst alle installierten APS Pakete dieser Domain.';
$lng['serversettings']['awstats_path'] = 'Pfad zu AWStats \'awstats_buildstaticpages.pl\'';
$lng['serversettings']['awstats_conf'] = 'AWStats Konfigurations-Pfad';
@@ -1387,4 +1390,95 @@ $lng['serversettings']['ftpserver']['desc'] = 'Wenn pureftpd ausgew&auml;hlt ist
// CHANGED IN FROXLOR 0.9.6-svn5
$lng['serversettings']['ftpprefix']['description'] = 'Welchen Prefix sollen die FTP-Benutzerkonten haben?<br/><b>Wenn du das &auml;nderst, musst du auch das Quota SQL Query in der FTP Server Config &auml;ndern, solltest du FTP-Quotas benutzen!</b>';
// ADDED IN FROXLOR 0.9.7-svn1
$lng['customer']['ftp_add']['infomail_subject'] = '[Froxlor] Neuer FTP-Benutzer erstellt';
$lng['customer']['ftp_add']['infomail_body']['main'] = "Hallo {CUST_NAME},\n\ndu hast gerade einen neuen FTP-Benutzer angelegt. Hier die angegebenen Informationen:\n\nBenutzername: {USR_NAME}\nPasswort: {USR_PASS}\nPfad: {USR_PATH}\n\nVielen Dank, das Froxlor-Team";
$lng['domains']['redirectifpathisurl'] = 'Redirect code (Standard: leer)';
$lng['domains']['redirectifpathisurlinfo'] = 'Der Redirect code kann gew&auml;hlt werden, wenn der eingegebene Pfad eine URL ist';
$lng['serversettings']['customredirect_enabled']['title'] = 'Erlaube Kunden-Redirect';
$lng['serversettings']['customredirect_enabled']['description'] = 'Erlaubt es Kunden den HTTP-Status Code f&uuml;r einen Redirect zu w&auml;hlen';
$lng['serversettings']['customredirect_default']['title'] = 'Standard Redirect';
$lng['serversettings']['customredirect_default']['description'] = 'Dieser Redirect wird immer genutzt, sofern der Kunde keinen anderen ausw&auml;hlt.';
// ADDED IN FROXLOR 0.9.7-svn2
$lng['error']['pathmaynotcontaincolon'] = 'Der eingegebene Pfad sollte keinen Doppelpunkt (":") enthalten. Bitte geben Sie einen korrekten Wert f&uuml;r den Pfad ein.';
$lng['tasks']['aps_task_install'] = 'Installation eines oder mehrerer APS Pakete';
$lng['tasks']['aps_task_remove'] = 'Deinstallation eines oder mehrerer APS Pakete';
$lng['tasks']['aps_task_reconfigure'] = 'Rekonfiguration eines oder mehrerer APS Pakete';
$lng['tasks']['aps_task_upgrade'] = 'Upgrade eines oder mehrerer APS Pakete';
$lng['tasks']['aps_task_sysupdate'] = 'Aktualisiere alle APS Pakete';
$lng['tasks']['aps_task_sysdownload'] = 'Herunterladen neuer APS Pakete';
// ADDED IN FROXLOR 0.9.9-svn1
$lng['serversettings']['mail_also_with_mxservers'] = 'Erstelle mail-, imap-, pop3- and smtp-"A Record" auch wenn MX-Server angegeben sind';
// ADDED IN FROXLOR 0.9.10-svn1
$lng['aps']['nocontingent'] = 'Sie haben kein ausreichendes APS-Kontingent und k&ouml;nnen daher keine Pakete installieren.';
$lng['aps']['packageneedsdb'] = 'Dieses Paket ben&ouml;tigt eine Datenbank, Sie haben allerdings keine mehr frei';
$lng['aps']['cannoteditordeleteapsdb'] = 'APS-Datenbanken k&ouml;nnen hier nicht bearbeitet oder gel&ouml;scht werden';
$lng['admin']['webserver_user'] = 'Benutzername Webserver';
$lng['admin']['webserver_group'] = 'Gruppenname Webserver';
// ADDED IN FROXLOR 0.9.10
$lng['serversettings']['froxlordirectlyviahostname'] = 'Froxlor direkt &uuml;ber den Hostnamen erreichbar machen';
// ADDED IN FROXLOR 0.9.11-svn1
$lng['serversettings']['panel_password_regex']['title'] = 'Regul&auml;rer Ausdruck f&uuml;r Passw&ouml;rter';
$lng['serversettings']['panel_password_regex']['description'] = 'Hier k&ouml;nnen Sie einen regul&auml;ren Ausdruck f&uuml;r Passwort-Komplexit&auml;t festlegen.<br />Leer = keine bestimmten Anforderungen<br />(<a href="http://wiki.froxlor.org/doc/password-regex-examples">RegEx Hilfe/Beispiele</a>)';
$lng['error']['notrequiredpasswordcomplexity'] = 'Die vorgegebene Passwort-Komplexit&auml;t wurde nicht erf&uuml;llt (Regex: %s)';
// ADDED IN FROXLOR 0.9.11-svn2
$lng['extras']['execute_perl'] = 'Perl/CGI ausf&uuml;hren';
$lng['admin']['perlenabled'] = 'Perl verf&uuml;gbar';
// ADDED IN FROXLOR 0.9.11-svn3
$lng['serversettings']['perl_path']['title'] = 'Pfad zu Perl';
$lng['serversettings']['perl_path']['description'] = 'Nur n&ouml;tig f&uuml;r lighttpd-Nutzer. Standard ist /usr/bin/perl';
// ADDED IN FROXLOR 0.9.12-svn1
$lng['admin']['fcgid_settings'] = 'FCGID';
$lng['serversettings']['mod_fcgid_ownvhost']['title'] = 'Verwende FCGID im Froxlor Vhost';
$lng['serversettings']['mod_fcgid_ownvhost']['description'] = 'Wenn verwendet, wird Froxlor selbst unter einem lokalem Benutzer ausgef&uuml;hrt<br /><strong>ACHTUNG:</strong>Hierzu m&uuml;ssen noch zus&auml;tzliche Konfigurationen vorgenommen werden, siehe <a href="http://wiki.froxlor.org/contrib/fcgid-handbook">http://wiki.froxlor.org/contrib/fcgid-handbook</a>';
$lng['admin']['mod_fcgid_user'] = 'Lokaler Benutzer f&uuml;r FCGID (Froxlor Vhost)';
$lng['admin']['mod_fcgid_group'] = 'Lokale Gruppe f&uuml;r FCGID (Froxlor Vhost)';
// ADDED IN FROXLOR 0.9.12-svn2
$lng['admin']['perl_settings'] = 'Perl/CGI';
$lng['serversettings']['perl']['suexecworkaround']['title'] = 'Aktiviere SuExec Workaround (nur f&uuml;r Apache)';
$lng['serversettings']['perl']['suexecworkaround']['description'] = 'Aktivieren Sie den Workaround nur, wenn die Kunden-Heimatverzeichnise sich nicht unterhalb des suexec-Pfades liegen.<br />Wenn aktiviert erstellt Froxlor eine Verkn&uuml;pfung des vom Kunden f&uuml;r Perl aktiviertem Pfad + /cgi-bin/ im angegebenen suexec-Pfad.<br />Bitte beachten Sie, dass Perl dann nur im Unterordner /cgi-bin/ des Kunden-Ordners funktioniert und nicht direkt in diesem Ordner (wie es ohne den Workaround w&auml;re!)';
$lng['serversettings']['perl']['suexeccgipath']['title'] = 'Pfad f&uuml;r Verkn&uuml;pfungen zu Kunden-Perl-Verzeichnis';
$lng['serversettings']['perl']['suexeccgipath']['description'] = 'Diese Einstellung wird nur ben&ouml;tigt, wenn der SuExec-Workaround aktiviert ist.<br />ACHTUNG: Stellen Sie sicher, dass sich der angegebene Pfad innerhalb des Suexec-Pfades befindet ansonsten ist der Workaround nutzlos';
$lng['panel']['descriptionerrordocument'] = 'M&ouml;gliche Werte sind: URL, Pfad zu einer Datei oder ein Text umgeben von Anf&uuml;hrungszeichen (" ")<br />Leer f&uuml;r Server-Standardwerd.';
$lng['error']['stringerrordocumentnotvalidforlighty'] = 'Ein Text als Fehlerdokument funktioniert leider in LigHTTPd nicht, bitte geben Sie einen Pfad zu einer Datei an';
$lng['error']['urlerrordocumentnotvalidforlighty'] = 'Eine URL als Fehlerdokument funktioniert leider in LigHTTPd nicht, bitte geben Sie einen Pfad zu einer Datei an';
// ADDED IN FROXLOR 0.9.12-svn3
$lng['question']['remove_subbutmain_domains'] = 'Auch Domains entfernen, welche als volle Domains hinzugef&uuml;gt wurden, aber Subdomains von dieser Domain sind?';
$lng['domains']['issubof'] = 'Diese Domain ist eine Subdomain von der Domain';
$lng['domains']['issubofinfo'] = 'Diese Einstellung muss gesetzt werden, wenn Sie eine Subdomain einer Hauptdomain als Hauptdomain anlegen (z.B. soll "www.domain.tld" hinzugef&uuml;gt werden, somit muss hier "domain.tld" ausgew&auml;hlt werden)';
$lng['domains']['nosubtomaindomain'] = 'Keine Subdomain einer Hauptdomain';
$lng['admin']['templates']['new_database_by_customer'] = 'Kunden-Benachrichtigungs nach Erstellung einer neuen Datenbank';
$lng['admin']['templates']['new_ftpaccount_by_customer'] = 'Kunden-Benachrichtigung nach Erstellung eines neuen FTP-Benutzers';
$lng['admin']['templates']['newdatabase'] = 'Benachrichtigungs-Mails f&uuml;r neue Datenbank';
$lng['admin']['templates']['newftpuser'] = 'Benachrichtigungs-Mails f&uuml;r neuen FTP-Benutzer';
$lng['admin']['templates']['CUST_NAME'] = 'Kundenname';
$lng['admin']['templates']['DB_NAME'] = 'Datenbankname';
$lng['admin']['templates']['DB_PASS'] = 'Datenbankpasswort';
$lng['admin']['templates']['DB_DESC'] = 'Datenbankbeschreibung';
$lng['admin']['templates']['DB_SRV'] = 'Datenbankserver';
$lng['admin']['templates']['PMA_URI'] = 'URL zu phpMyAdmin (wenn angegeben)';
$lng['admin']['notgiven'] = '[nicht angegeben]';
$lng['admin']['templates']['USR_NAME'] = 'FTP Benutzername';
$lng['admin']['templates']['USR_PASS'] = 'FTP Passwort';
$lng['admin']['templates']['USR_PATH'] = 'FTP Heimatverzeichnis (relativ zum Kunden-Heimatverzeichnis)';
// ADDED IN FROXLOR 0.9.12-svn4
$lng['serversettings']['awstats_awstatspath'] = 'Pfad zu AWStats \'awstats.pl\'';
// ADDED IN FROXLOR 0.9.12-svn6
$lng['extras']['htpasswdauthname'] = 'Authentifizierungs-Grund (AuthName)';
$lng['extras']['directoryprotection_edit'] = 'Verzeichnisschutz bearbeiten';
$lng['admin']['templates']['forgotpwd'] = 'Benachrichtigungs-Mails bei Zur&uuml;cksetzen des Passworts';
$lng['admin']['templates']['password_reset'] = 'Kunden-Benachrichtigung nach Zur&uuml;cksetzen des Passworts';
?>

File diff suppressed because it is too large Load Diff

View File

@@ -344,12 +344,12 @@ $lng['serversettings']['ipaddress']['title'] = 'Adres IP';
$lng['serversettings']['ipaddress']['description'] = 'Jaki jest adres IP tego serwera?';
$lng['serversettings']['hostname']['title'] = 'Hostname';
$lng['serversettings']['hostname']['description'] = 'Jaki jest Hostname serwera?';
$lng['serversettings']['apachereload_command']['title'] = 'Apache reload command';
$lng['serversettings']['apachereload_command']['description'] = 'What\'s the apache command to reload apache configfiles?';
$lng['serversettings']['bindconf_directory']['title'] = 'Bind config directory';
$lng['serversettings']['bindconf_directory']['description'] = 'Where should bind configfiles be saved?';
$lng['serversettings']['bindreload_command']['title'] = 'Bind reload command';
$lng['serversettings']['bindreload_command']['description'] = 'What\'s the bind command to reload bind configfiles?';
$lng['serversettings']['apachereload_command']['title'] = 'Komenda prze<7A>adowania Apache';
$lng['serversettings']['apachereload_command']['description'] = 'Jaka jest komenda, do prze<7A>adowania plik<69>w konfiguracyjnych Apacha?';
$lng['serversettings']['bindconf_directory']['title'] = 'Katalog z konfiguracj<63> Bunda';
$lng['serversettings']['bindconf_directory']['description'] = 'Gdzie maja by<62> zapisywane pliki konfiguracyjne dla Binda?';
$lng['serversettings']['bindreload_command']['title'] = 'Komenda prze<7A>adowania Binda';
$lng['serversettings']['bindreload_command']['description'] = 'Jaka jest komenda, do prze<7A>adowania plik<69>w konfiguracyjnych Binda?';
$lng['serversettings']['binddefaultzone']['title'] = 'Bind default zone';
$lng['serversettings']['binddefaultzone']['description'] = 'What\'s the name of the default zone?';
$lng['serversettings']['vmail_uid']['title'] = 'Mails-UID';
@@ -367,7 +367,7 @@ $lng['serversettings']['webmail_url']['description'] = 'Jaki jest adres URL do W
$lng['serversettings']['webftp_url']['title'] = 'URL do WebFTPa';
$lng['serversettings']['webftp_url']['description'] = 'Jaki jest adres URL do WebFTPa? (Musi si&#281 rozpoczyna&#263 do http(s)://)';
$lng['serversettings']['language']['description'] = 'Jaki jest standardowy j&#281zyk serwera?';
$lng['serversettings']['maxloginattempts']['title'] = 'Max Login Attempts';
$lng['serversettings']['maxloginattempts']['title'] = 'Maksymalna ilo<6C><6F> pr<70>b logowania';
$lng['serversettings']['maxloginattempts']['description'] = 'Maximum login attempts after which the account gets deactivated.';
$lng['serversettings']['deactivatetime']['title'] = 'Czas zablokowania';
$lng['serversettings']['deactivatetime']['description'] = 'Czas (sek.) zablokowania dost&#281pu do konta po nieudanym logowaniu.';
@@ -710,7 +710,7 @@ $lng['serversettings']['mod_fcgid']['tmpdir'] = 'Katalog plik
$lng['serversettings']['ticket']['reset_cycle'] = 'Okresowe reset licznika u&#380ycia zg&#322osze&#324 pomocy technicznej';
$lng['serversettings']['ticket']['reset_cycle_desc'] = 'Resetowanie zg&#322osze&#324 pomocy technicznej powoduje ustawienie licznika na warto&#347&#263 0 przy ka&#380dym cyklu';
$lng['admin']['tickets']['daily'] = 'Dziennie';
$lng['admin']['tickets']['weekly'] = 'Wygodniowo';
$lng['admin']['tickets']['weekly'] = 'Tygodniowo';
$lng['admin']['tickets']['monthly'] = 'Miesi&#281cznie';
$lng['admin']['tickets']['yearly'] = 'Rocznie';
$lng['error']['ticketresetcycleiswrong'] = 'The cycle for ticket-resets has to be "daily", "weekly", "monthly" or "yearly".';
@@ -1349,7 +1349,7 @@ $lng['serversettings']['stdsubdomainhost']['description'] = 'What hostname shoul
// ADDED IN FROXLOR 0.9.4-svn1
$lng['ftp']['account_edit'] = 'Edytuj konto ftp';
$lng['ftp']['editpassdescription'] = 'Ustal nowe has&#322o lub zostaw puste by nie zmienia&#263.';
$lng['mysql']['sendinfomail'] = 'Send data via email to me';
$lng['customer']['sendinfomail'] = 'Send data via email to me';
$lng['customer']['mysql_add']['infomail_subject'] = '[Froxlor] Nowa baza danych utworzona';
$lng['customer']['mysql_add']['infomail_body']['pma'] = "\nMasz dost&#281p do Twojej bazy danych uzywaj&#261c phpMyAdmina pod adresem {URI}\n";
$lng['customer']['mysql_add']['infomail_body']['main'] = "Witaj {CUST_NAME},\n\nw&#322a&#347nie doda&#322e&#347 now&#261 baz&#281 danych. Przesy&#322amy dane uruchomieniowe:\n\nBaza danych: {DB_NAME}\nHas&#322o: {DB_PASS}\nOpis: {DB_DESC}\n{PMA_URI}\nZ powa&#380aniem, Froxlor";
@@ -1376,4 +1376,18 @@ $lng['serversettings']['defaultwebsrverrhandler_err404'] = 'Plik/URL dla b&#322&
$lng['serversettings']['defaultwebsrverrhandler_err500']['title'] = 'Plik/URL dla b&#322&#281du 500';
$lng['serversettings']['defaultwebsrverrhandler_err500']['description'] = '<div style="color:red">'.$lng['panel']['not_supported'].'lighttpd</div>';
// ADDED IN FROXLOR 0.9.6-svn4
$lng['serversettings']['ticket']['default_priority'] = 'Standardowy priorytet dla zg<7A>osze<7A> pomocy technicznej';
// ADDED IN FROXLOR 0.9.6-svn5
$lng['serversettings']['mod_fcgid']['defaultini'] = 'Default PHP configuration for new domains';
// ADDED IN FROXLOR 0.9.6-svn6
$lng['admin']['ftpserver'] = 'Serwer FTP';
$lng['admin']['ftpserversettings'] = 'Ustawienia Serwera FTP';
$lng['serversettings']['ftpserver']['desc'] = 'Je<4A>li pureftpd jest zaznaczone, plik .ftpquota z quotami u<>ytkownika b<>dzie tworzony i aktualizowany codziennie';
// CHANGED IN FROXLOR 0.9.6-svn6
$lng['serversettings']['ftpprefix']['description'] = 'Which prefix should ftp accounts have?<br/><b>If you change this you also have to change the Quota SQL Query in your FTP Server config file in case you use it!</b> ';
?>

View File

@@ -21,45 +21,33 @@
* @todo skip mail parsing after x bytes for large mails
*/
$mail = new PHPMailer();
$mail = new PHPMailer(true);
//dont do anything when module is disabled
if((int)$settings['autoresponder']['autoresponder_active'] == 0)
{
return;
}
//only send autoresponder to mails which were delivered since last run
if((int)$settings['autoresponder']['last_autoresponder_run'] == 0)
{
//mails from last 5 minutes, otherwise all mails will be parsed -> mailbomb prevention
$cycle = 300;
}
else
{
// calculate seconds since last check
$cycle = time() - (int)$settings['autoresponder']['last_autoresponder_run'];
//prevent mailbombs when cycle is bigger than two days
if($cycle > (2 * 60 * 60 * 24))$cycle = (60 * 60 * 24);
}
// set last_autoresponder_run
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . (int)time() . "' WHERE `settinggroup` = 'autoresponder' AND `varname` = 'last_autoresponder_run'");
/*
//can be used for later usage if autoresponders should be only active in a defined period
//This query has to disable every autoresponder entry which ended in the past
$db->query("UPDATE `autoresponder` SET `enabled` = 0 WHERE `to` < CURDATE()");
//This query has to activate every autoresponder entry which starts today
$db->query("UPDATE `autoresponder` SET `enabled` = 1 WHERE `from` = CURDATE()");
*/
//getting all mailboxes where autoresponders are active and configured
// get all customer set ip autoresponders
$result = $db->query("SELECT * FROM `" . TABLE_MAIL_AUTORESPONDER . "` INNER JOIN `" . TABLE_MAIL_USERS . "` ON `" . TABLE_MAIL_AUTORESPONDER . "`.`email` = `" . TABLE_MAIL_USERS . "`.`email` WHERE `enabled` = 1");
if($db->num_rows($result) > 0)
@@ -78,31 +66,40 @@ if($db->num_rows($result) > 0)
// already ended
if($ts_end != -1 && $ts_end < $ts_now) continue;
// setup mail-path (e.g. /var/customers/mail/[loginname]/[user@domain.tld]/new
$path = $row['homedir'] . $row['maildir'] . "new/";
if(!is_dir($path) || !is_readable($path))
// if the directory does not exist, inform syslog
if(!is_dir($path))
{
$cronlog->logAction(CRON_ACTION, LOG_WARNING, "Error accessing maildir: " . $path);
continue;
}
$files = scandir($path);
foreach($files as $entry)
// get all files
$its = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($path)
);
$responded_counter = 0;
foreach ($its as $fullFilename => $it )
{
if($entry == '.'
|| $entry == '..')continue;
if($it->getFilename() == '.' || $it->getFilename() == '..')
{
continue;
}
/*
* is the time passed between now and
* the time we received the mail lower/equal
* than our cycle-seconds?
*/
if(time() - filemtime($path . $entry) <= $cycle)
$filemtime = $it->getMTime();
if(time() - $filemtime <= $cycle)
{
$content = file($path . $entry);
//error reading mail contents
$content = file($fullFilename);
// error reading mail contents or just empty
if(count($content) == 0)
{
$cronlog->logAction(CRON_ACTION, LOG_WARNING, "Unable to read mail from maildir: " . $entry);
@@ -117,53 +114,48 @@ if($db->num_rows($result) > 0)
foreach($content as $line)
{
// header ends on first empty line, skip rest of mail
if(strlen(rtrim($line)) == 0)
{
break;
}
//fetching from field
if(!strlen($from)
&& preg_match("/^From:(.+)<(.*)>$/", $line, $match))
{
&& preg_match("/^From:(.+)<(.*)>$/", $line, $match)
) {
$from = $match[2];
}
elseif(!strlen($from)
&& preg_match("/^From:\s+(.*@.*)$/", $line, $match))
{
&& preg_match("/^From:\s+(.*@.*)$/", $line, $match)
) {
$from = $match[1];
}
//fetching to field
if(!strlen($to)
&& preg_match("/^To:(.+)<(.*)>$/", $line, $match))
{
&& preg_match("/^To:(.+)<(.*)>$/", $line, $match)
) {
$to = $match[2];
}
elseif(!strlen($to)
&& preg_match("/To:\s+(.*@.*)$/", $line, $match))
{
&& preg_match("/To:\s+(.*@.*)$/", $line, $match)
) {
$to = $match[1];
}
//fetching sender field
if(!strlen($to)
&& preg_match("/^Sender:(.+)<(.*)>$/", $line, $match))
{
&& preg_match("/^Sender:(.+)<(.*)>$/", $line, $match)
) {
$sender = $match[2];
}
elseif(!strlen($to)
&& preg_match("/Sender:\s+(.*@.*)$/", $line, $match))
{
&& preg_match("/Sender:\s+(.*@.*)$/", $line, $match)
) {
$sender = $match[1];
}
//check for amavis/spamassassin spam headers
if(preg_match("/^X-Spam-Status: (Yes|No)(.*)$/", $line, $match))
{
if($match[1] == 'Yes')$spam = true;
@@ -178,13 +170,13 @@ if($db->num_rows($result) > 0)
}
//skip mail when marked as spam
if($spam == true)continue;
if($spam == true)
{
continue;
}
//error while parsing mail
if($to == ''
|| $from == '')
if($to == '' || $from == '')
{
$cronlog->logAction(CRON_ACTION, LOG_WARNING, "No valid headers found in mail to parse: " . $entry);
continue;
@@ -193,15 +185,15 @@ if($db->num_rows($result) > 0)
//important! prevent mailbombs when mail comes from a maildaemon/mailrobot
//robot/daemon mails must go to Sender: field in envelope header
//refers to "Das Postfix-Buch" / RFC 2822
if($sender != '')$from = $sender;
if($sender != '')
{
$from = $sender;
}
//make message valid to email format
$message = str_replace("\r\n", "\n", $row['message']);
//check if mail is already an answer
$fullcontent = implode("", $content);
if(strstr($fullcontent, $message))
@@ -232,9 +224,9 @@ if($db->num_rows($result) > 0)
}
$mail->ClearAddresses();
$responded_counter++;
}
}
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Responded to '" . $responded_counter . "' mails from '".$path."'");
}
}
?>

View File

@@ -225,6 +225,17 @@ class bind
{
$zonefile.= '@ IN MX ' . trim($mxserver) . "\n";
}
if($this->settings['system']['dns_createmailentry'] == '1')
{
$zonefile.= 'mail IN ' . $ip_a_record . "\n";
if($domain['iswildcarddomain'] != '1')
{
$zonefile.= 'imap IN ' . $ip_a_record . "\n";
$zonefile.= 'smtp IN ' . $ip_a_record . "\n";
$zonefile.= 'pop3 IN ' . $ip_a_record . "\n";
}
}
}
/*

View File

@@ -67,16 +67,23 @@ class apache
*/
private function _createStandardDirectoryEntry()
{
$vhosts_filename = makeCorrectFile($this->settings['system']['apacheconf_vhost'] . '/05_froxlor_dirfix_nofcgid.conf');
$vhosts_folder = '';
if(is_dir($this->settings['system']['apacheconf_vhost']))
{
$vhosts_folder = makeCorrectDir($this->settings['system']['apacheconf_vhost']);
} else {
$vhosts_folder = makeCorrectDir(dirname($this->settings['system']['apacheconf_vhost']));
}
$vhosts_filename = makeCorrectFile($vhosts_folder . '/05_froxlor_dirfix_nofcgid.conf');
if($this->settings['system']['mod_fcgid'] == '1')
{
// if we use fcgid we don't need this file
if(file_exists($vhosts_filename))
{
fwrite($this->debugHandler, ' apache::_createStandardDirectoryEntry: unlinking ' . basename($vhost_filename) . "\n");
$this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'unlinking ' . basename($vhost_filename));
unlink(makeCorrectFile($vhost_filename));
fwrite($this->debugHandler, ' apache::_createStandardDirectoryEntry: unlinking ' . basename($vhosts_filename) . "\n");
$this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'unlinking ' . basename($vhosts_filename));
unlink(makeCorrectFile($vhosts_filename));
}
}
else
@@ -104,7 +111,15 @@ class apache
|| $this->settings['defaultwebsrverrhandler']['err404'] != ''
|| $this->settings['defaultwebsrverrhandler']['err500'] != '')
) {
$vhosts_filename = makeCorrectFile($this->settings['system']['apacheconf_vhost'] . '/05_froxlor_default_errorhandler.conf');
$vhosts_folder = '';
if(is_dir($this->settings['system']['apacheconf_vhost']))
{
$vhosts_folder = makeCorrectDir($this->settings['system']['apacheconf_vhost']);
} else {
$vhosts_folder = makeCorrectDir(dirname($this->settings['system']['apacheconf_vhost']));
}
$vhosts_filename = makeCorrectFile($vhosts_folder . '/05_froxlor_default_errorhandler.conf');
if(!isset($this->virtualhosts_data[$vhosts_filename]))
{
@@ -177,7 +192,14 @@ class apache
/**
* add 'real'-vhost content here, like doc-root :)
*/
if($this->settings['system']['froxlordirectlyviahostname'])
{
$mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__))));
}
else
{
$mypath = makeCorrectDir(dirname(dirname(dirname(dirname(__FILE__)))));
}
$this->virtualhosts_data[$vhosts_filename].= 'DocumentRoot "'.$mypath.'"'."\n";
if($row_ipsandports['vhostcontainer_servername_statement'] == '1')
@@ -185,6 +207,30 @@ class apache
$this->virtualhosts_data[$vhosts_filename].= ' ServerName ' . $this->settings['system']['hostname'] . "\n";
}
// create fcgid <Directory>-Part (starter is created in apache_fcgid)
if($this->settings['system']['mod_fcgid_ownvhost'] == '1')
{
$configdir = makeCorrectDir($this->settings['system']['mod_fcgid_configdir'] . '/froxlor.panel/');
if((int)$this->settings['system']['mod_fcgid_wrapper'] == 0)
{
$this->virtualhosts_data[$vhosts_filename].= ' SuexecUserGroup "' . $this->settings['system']['mod_fcgid_httpuser'] . '" "' . $this->settings['system']['mod_fcgid_httpgroup'] . '"' . "\n";
$this->virtualhosts_data[$vhosts_filename].= ' ScriptAlias /php/ ' . $configdir . "\n";
}
else
{
$starter_filename = makeCorrectFile($configdir . '/php-fcgi-starter');
$this->virtualhosts_data[$vhosts_filename].= ' SuexecUserGroup "' . $this->settings['system']['mod_fcgid_httpuser'] . '" "' . $this->settings['system']['mod_fcgid_httpgroup'] . '"' . "\n";
$this->virtualhosts_data[$vhosts_filename].= ' <Directory "' . $mypath . '">' . "\n";
$this->virtualhosts_data[$vhosts_filename].= ' AddHandler fcgid-script .php' . "\n";
$this->virtualhosts_data[$vhosts_filename].= ' FCGIWrapper ' . $starter_filename . ' .php' . "\n";
$this->virtualhosts_data[$vhosts_filename].= ' Options +ExecCGI' . "\n";
$this->virtualhosts_data[$vhosts_filename].= ' Order allow,deny' . "\n";
$this->virtualhosts_data[$vhosts_filename].= ' allow from all' . "\n";
$this->virtualhosts_data[$vhosts_filename].= ' </Directory>' . "\n";
}
}
/**
* dirprotection, see #72
* @TODO deferred until 0.9.5, needs more testing
@@ -270,23 +316,22 @@ class apache
if($domain['openbasedir'] == '1')
{
if($this->settings['system']['phpappendopenbasedir'] != '')
if($domain['openbasedir_path'] == '1' || strstr($domain['documentroot'], ":") !== false)
{
$_phpappendopenbasedir = ':' . $this->settings['system']['phpappendopenbasedir'];
$_phpappendopenbasedir = appendOpenBasedirPath($domain['customerroot'], true);
}
else
{
$_phpappendopenbasedir = '';
$_phpappendopenbasedir = appendOpenBasedirPath($domain['documentroot'], true);
}
if($domain['openbasedir_path'] == '1')
$_custom_openbasedir = explode(':', $this->settings['system']['phpappendopenbasedir']);
foreach($_custom_openbasedir as $cobd)
{
$php_options_text.= ' php_admin_value open_basedir "' . $domain['customerroot'] . $_phpappendopenbasedir . "\"\n";
}
else
{
$php_options_text.= ' php_admin_value open_basedir "' . $domain['documentroot'] . $_phpappendopenbasedir . "\"\n";
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
}
$php_options_text.= ' php_admin_value open_basedir "' . $_phpappendopenbasedir . '"'."\n";
}
if($domain['safemode'] == '0')
@@ -307,6 +352,10 @@ class apache
return $php_options_text;
}
public function createOwnVhostStarter()
{
}
/*
* We collect all servernames and Aliases
*/
@@ -551,8 +600,15 @@ class apache
protected function getVhostFilename($domain, $ssl_vhost = false)
{
if((int)$domain['parentdomainid'] == 0)
{
if((int)$domain['parentdomainid'] == 0
&& ((int)$domain['ismainbutsubto'] == 0
|| domainMainToSubExists($domain['ismainbutsubto']) == false)
) {
$vhost_no = '22';
}
elseif((int)$domain['parentdomainid'] == 0
&& (int)$domain['ismainbutsubto'] > 0
) {
$vhost_no = '21';
}
else
@@ -622,7 +678,8 @@ class apache
if(preg_match('/^https?\:\/\//', $domain['documentroot']))
{
$vhost_content.= ' Redirect 301 / ' . $this->idnaConvert->encode($domain['documentroot']) . "\n";
$code = getDomainRedirectCode($domain['id']);
$vhost_content.= ' Redirect '.$code.' / ' . $this->idnaConvert->encode($domain['documentroot']) . "\n";
}
else
{
@@ -662,7 +719,7 @@ class apache
}
}
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true);
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true, true);
$vhost_content.= $this->getWebroot($domain);
$vhost_content.= $this->composePhpOptions($domain);
$vhost_content.= $this->getStats($domain);
@@ -781,19 +838,41 @@ class apache
if(is_dir($row_diroptions['path']))
{
$cperlenabled = customerHasPerlEnabled($row_diroptions['customerid']);
$this->diroptions_data[$diroptions_filename].= '<Directory "' . $row_diroptions['path'] . '">' . "\n";
if(isset($row_diroptions['options_indexes'])
&& $row_diroptions['options_indexes'] == '1')
{
$this->diroptions_data[$diroptions_filename].= ' Options +Indexes' . "\n";
$this->diroptions_data[$diroptions_filename].= ' Options +Indexes';
// add perl options if enabled
if($cperlenabled
&& isset($row_diroptions['options_cgi'])
&& $row_diroptions['options_cgi'] == '1')
{
$this->diroptions_data[$diroptions_filename].= ' ExecCGI -MultiViews +SymLinksIfOwnerMatch'."\n";
} else {
$this->diroptions_data[$diroptions_filename].= "\n";
}
fwrite($this->debugHandler, ' cron_tasks: Task3 - Setting Options +Indexes' . "\n");
}
if(isset($row_diroptions['options_indexes'])
&& $row_diroptions['options_indexes'] == '0')
{
$this->diroptions_data[$diroptions_filename].= ' Options -Indexes' . "\n";
$this->diroptions_data[$diroptions_filename].= ' Options -Indexes';
// add perl options if enabled
if($cperlenabled
&& isset($row_diroptions['options_cgi'])
&& $row_diroptions['options_cgi'] == '1')
{
$this->diroptions_data[$diroptions_filename].= ' ExecCGI -MultiViews +SymLinksIfOwnerMatch'."\n";
} else {
$this->diroptions_data[$diroptions_filename].= "\n";
}
fwrite($this->debugHandler, ' cron_tasks: Task3 - Setting Options -Indexes' . "\n");
}
@@ -815,6 +894,62 @@ class apache
$this->diroptions_data[$diroptions_filename].= ' ErrorDocument 500 ' . $row_diroptions['error500path'] . "\n";
}
if($cperlenabled
&& isset($row_diroptions['options_cgi'])
&& $row_diroptions['options_cgi'] == '1')
{
$this->diroptions_data[$diroptions_filename].= ' AllowOverride None' . "\n";
$this->diroptions_data[$diroptions_filename].= ' AddHandler cgi-script .cgi .pl' . "\n";
$this->diroptions_data[$diroptions_filename].= ' Order allow,deny' . "\n";
$this->diroptions_data[$diroptions_filename].= ' Allow from all' . "\n";
fwrite($this->debugHandler, ' cron_tasks: Task3 - Enabling perl execution' . "\n");
// check for suexec-workaround, #319
if((int)$this->settings['perl']['suexecworkaround'] == 1)
{
// symlink this directory to suexec-safe-path
$loginname = getCustomerDetail($row_diroptions['customerid'], 'loginname');
$suexecpath = makeCorrectDir($this->settings['perl']['suexecpath'].'/'.$loginname.'/'.md5($row_diroptions['path']).'/');
if(!file_exists($suexecpath))
{
safe_exec('mkdir -p '.escapeshellarg($suexecpath));
safe_exec('chown -R '.escapeshellarg($row_diroptions['guid']).':'.escapeshellarg($row_diroptions['guid']).' '.escapeshellarg($suexecpath));
}
// symlink to {$givenpath}/cgi-bin
// NOTE: symlinks are FILES, so do not append a / here
$perlsymlink = makeCorrectFile($row_diroptions['path'].'/cgi-bin');
if(!file_exists($perlsymlink))
{
safe_exec('ln -s '.escapeshellarg($suexecpath).' '.escapeshellarg($perlsymlink));
}
safe_exec('chown '.escapeshellarg($row_diroptions['guid']).':'.escapeshellarg($row_diroptions['guid']).' '.escapeshellarg($perlsymlink));
}
}
else
{
// if no perl-execution is enabled but the workaround is,
// we have to remove the symlink and folder in suexecpath
if((int)$this->settings['perl']['suexecworkaround'] == 1)
{
$loginname = getCustomerDetail($row_diroptions['customerid'], 'loginname');
$suexecpath = makeCorrectDir($this->settings['perl']['suexecpath'].'/'.$loginname.'/'.md5($row_diroptions['path']).'/');
$perlsymlink = makeCorrectFile($row_diroptions['path'].'/cgi-bin');
// remove symlink
if(file_exists($perlsymlink))
{
safe_exec('rm -f '.escapeshellarg($perlsymlink));
}
// remove folder in suexec-path
if(file_exists($suexecpath))
{
safe_exec('rm -rf '.escapeshellarg($suexecpath));
}
}
}
if(count($row_diroptions['htpasswds']) > 0)
{
$htpasswd_filename = makeCorrectFile($this->settings['system']['apacheconf_htpasswddir'] . '/' . $row_diroptions['customerid'] . '-' . md5($row_diroptions['path']) . '.htpasswd');
@@ -830,7 +965,7 @@ class apache
}
$this->diroptions_data[$diroptions_filename].= ' AuthType Basic' . "\n";
$this->diroptions_data[$diroptions_filename].= ' AuthName "Restricted Area"' . "\n";
$this->diroptions_data[$diroptions_filename].= ' AuthName "'.$row_htpasswd['authname'].'"' . "\n";
$this->diroptions_data[$diroptions_filename].= ' AuthUserFile ' . $htpasswd_filename . "\n";
$this->diroptions_data[$diroptions_filename].= ' require valid-user' . "\n";
}

View File

@@ -97,6 +97,7 @@ class apache_fcgid extends apache
$starter_file.= "# starter created/changed on " . date("Y.m.d H:i:s") . " for domain '" . $domain['domain'] . "' with id #" . $domain['id'] . " from php template '" . $phpconfig['description'] . "' with id #" . $phpconfig['id'] . "\n";
$starter_file.= "# Do not change anything in this file, it will be overwritten by the Froxlor Cronjob!\n";
$starter_file.= "#\n\n";
$starter_file.= "umask 022\n";
$starter_file.= "PHPRC=" . escapeshellarg($configdir) . "\n";
$starter_file.= "export PHPRC\n";
@@ -148,7 +149,7 @@ class apache_fcgid extends apache
if(file_exists($starter_filename))
{
safe_exec('chattr -i ' . escapeshellarg($starter_filename));
removeImmutable($starter_filename);
}
$starter_file_handler = fopen($starter_filename, 'w');
@@ -156,7 +157,7 @@ class apache_fcgid extends apache
fclose($starter_file_handler);
safe_exec('chmod 750 ' . escapeshellarg($starter_filename));
safe_exec('chown ' . $domain['guid'] . ':' . $domain['guid'] . ' ' . escapeshellarg($starter_filename));
safe_exec('chattr +i ' . escapeshellarg($starter_filename));
setImmutable($starter_filename);
// define the php.ini
@@ -166,22 +167,42 @@ class apache_fcgid extends apache
if($domain['openbasedir'] == '1')
{
$openbasedirc = '';
if($domain['openbasedir_path'] == '0')
$_phpappendopenbasedir = '';
$_custom_openbasedir = explode(':', $this->settings['system']['mod_fcgid_peardir']);
foreach($_custom_openbasedir as $cobd)
{
$openbasedir = $domain['documentroot'] . ':' . $tmpdir . ':' . $this->settings['system']['mod_fcgid_peardir'] . ':' . $this->settings['system']['phpappendopenbasedir'];
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
}
$_custom_openbasedir = explode(':', $this->settings['system']['phpappendopenbasedir']);
foreach($_custom_openbasedir as $cobd)
{
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
}
if($domain['openbasedir_path'] == '0' && strstr($domain['documentroot'], ":") === false)
{
$openbasedir = appendOpenBasedirPath($domain['documentroot'], true);
}
else
{
$openbasedir = $domain['customerroot'] . ':' . $tmpdir . ':' . $this->settings['system']['mod_fcgid_peardir'] . ':' . $this->settings['system']['phpappendopenbasedir'];
$openbasedir = appendOpenBasedirPath($domain['customerroot'], true);
}
$openbasedir .= appendOpenBasedirPath($tmpdir);
$openbasedir .= $_phpappendopenbasedir;
$openbasedir = explode(':', $openbasedir);
$clean_openbasedir = array();
foreach($openbasedir as $number => $path)
{
$openbasedir[$number] = makeCorrectDir($path);
if(trim($path) != '/')
{
$clean_openbasedir[] = makeCorrectDir($path);
}
$openbasedir = implode(':', $openbasedir);
}
$openbasedir = implode(':', $clean_openbasedir);
}
else
{
@@ -257,6 +278,89 @@ class apache_fcgid extends apache
return $this->admin_cache[$adminid];
}
public function createOwnVhostStarter()
{
if ($this->settings['system']['mod_fcgid_ownvhost'] == '1')
{
$mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__)))); // /var/www/froxlor, needed for chown
$configdir = makeCorrectDir($this->settings['system']['mod_fcgid_configdir'] . '/froxlor.panel/');
$starter_filename = makeCorrectFile($configdir . '/php-fcgi-starter');
$tmpdir = makeCorrectDir($this->settings['system']['mod_fcgid_tmpdir'] . '/froxlor.panel/');
$user = $this->settings['system']['mod_fcgid_httpuser'];
$group = $this->settings['system']['mod_fcgid_httpgroup'];
// all the files and folders have to belong to the local user
// now because we also use fcgid for our own vhost
safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($mypath));
// create config dir if necessary
if(!is_dir($configdir))
{
safe_exec('mkdir -p ' . escapeshellarg($configdir));
safe_exec('chown ' . $user . ':' . $group . ' ' . escapeshellarg($configdir));
}
// create tmp dir if necessary
if(!is_dir($tmpdir))
{
safe_exec('mkdir -p ' . escapeshellarg($tmpdir));
safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($tmpdir));
safe_exec('chmod 0750 ' . escapeshellarg($tmpdir));
}
// we only need this for some basic, no special parameters that
// would require to maybe allow selecting a specific php.ini
// because we only need the binary and spawning parameters
$phpconfig = $this->getPhpConfig(0);
// create starter
$starter_file = "#!/bin/sh\n\n";
$starter_file.= "#\n";
$starter_file.= "# starter created/changed on " . date("Y.m.d H:i:s") . " for the Froxlor vhost\n";
$starter_file.= "# Do not change anything in this file, it will be overwritten by the Froxlor Cronjob!\n";
$starter_file.= "#\n\n";
$starter_file.= "umask 022\n";
$starter_file.= "PHPRC=" . escapeshellarg($configdir) . "\n";
$starter_file.= "export PHPRC\n";
if((int)$phpconfig['mod_fcgid_starter'] != - 1)
{
$starter_file.= "PHP_FCGI_CHILDREN=" . (int)$phpconfig['mod_fcgid_starter'] . "\n";
}
else
{
$starter_file.= "PHP_FCGI_CHILDREN=" . (int)$this->settings['system']['mod_fcgid_starter'] . "\n";
}
$starter_file.= "export PHP_FCGI_CHILDREN\n";
if((int)$phpconfig['mod_fcgid_maxrequests'] != - 1)
{
$starter_file.= "PHP_FCGI_MAX_REQUESTS=" . (int)$phpconfig['mod_fcgid_maxrequests'] . "\n";
}
else
{
$starter_file.= "PHP_FCGI_MAX_REQUESTS=" . (int)$this->settings['system']['mod_fcgid_maxrequests'] . "\n";
}
$starter_file.= "export PHP_FCGI_MAX_REQUESTS\n";
// Set Binary
$starter_file.= "exec " . $phpconfig['binary'] . " -c " . escapeshellarg($configdir) . "\n";
//remove +i attibute, so starter can be overwritten
if(file_exists($starter_filename))
{
removeImmutable($starter_filename);
}
$starter_file_handler = fopen($starter_filename, 'w');
fwrite($starter_file_handler, $starter_file);
fclose($starter_file_handler);
safe_exec('chmod 750 ' . escapeshellarg($starter_filename));
safe_exec('chown ' . $user . ':' . $group . ' ' . escapeshellarg($starter_filename));
setImmutable($starter_filename);
}
}
}
?>

View File

@@ -107,7 +107,14 @@ class lighttpd
$this->lighttpd_data[$vhost_filename].= '# Froxlor default vhost' . "\n";
$this->lighttpd_data[$vhost_filename].= '$HTTP["host"] =~ "^(?:www\.|)' . $myhost . '$" {' . "\n";
if($this->settings['system']['froxlordirectlyviahostname'])
{
$mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__))));
}
else
{
$mypath = makeCorrectDir(dirname(dirname(dirname(dirname(__FILE__)))));
}
$this->lighttpd_data[$vhost_filename].= ' server.document-root = "'.$mypath.'"'."\n";
/**
@@ -193,23 +200,6 @@ class lighttpd
if(!in_array($row_htpasswds['path'], $needed_htpasswds))
{
if(empty($needed_htpasswds))
{
$auth_backend_loaded[$domain['ipandport']] = 'yes';
if(!$this->auth_backend_loaded)
{
$htaccess_text.= ' auth.backend = "htpasswd"' . "\n";
}
$htaccess_text.= ' auth.backend.htpasswd.userfile = "' . makeCorrectFile($this->settings['system']['apacheconf_htpasswddir'] . '/' . $filename) . '"' . "\n";
$htaccess_text.= ' auth.require = ( ' . "\n";
}
else
{
$htaccess_text.= ' ,' . "\n";
}
if(!isset($this->needed_htpasswds[$filename])) {
$this->needed_htpasswds[$filename] = '';
}
@@ -219,20 +209,24 @@ class lighttpd
$this->needed_htpasswds[$filename].= $row_htpasswds['username'] . ':' . $row_htpasswds['password'] . "\n";
}
$needed_htpasswds[] = $row_htpasswds['path'];
$htaccess_path = substr($row_htpasswds['path'], strlen($domain['documentroot']) - 1);
$htaccess_text.= ' "' . makeCorrectDir($htaccess_path) . '" =>' . "\n";
$htaccess_path = makeCorrectDir($htaccess_path);
$htaccess_text.= ' $HTTP["url"] =~ "^'.$htaccess_path.'" {' . "\n";
$htaccess_text.= ' auth.backend = "htpasswd"' . "\n";
$htaccess_text.= ' auth.backend.htpasswd.userfile = "' . makeCorrectFile($this->settings['system']['apacheconf_htpasswddir'] . '/' . $filename) . '"' . "\n";
$htaccess_text.= ' auth.require = ( ' . "\n";
$htaccess_text.= ' "' . $htaccess_path . '" =>' . "\n";
$htaccess_text.= ' (' . "\n";
$htaccess_text.= ' "method" => "basic",' . "\n";
$htaccess_text.= ' "realm" => "Restricted Area",' . "\n";
$htaccess_text.= ' "require" => "user=' . $row_htpasswds['username'] . '"' . "\n";
$htaccess_text.= ' "realm" => "'.$row_htpasswds['authname'].'",' . "\n";
$htaccess_text.= ' "require" => "valid-user"' . "\n";
$htaccess_text.= ' )' . "\n";
}
}
$htaccess_text.= ' )' . "\n";
$htaccess_text.= ' }' . "\n";
if(strlen(trim($htaccess_text)) > 0)
{
$htaccess_text.= ' )' . "\n";
$needed_htpasswds[] = $row_htpasswds['path'];
}
}
return $htaccess_text;
@@ -250,6 +244,10 @@ class lighttpd
{
}
public function createOwnVhostStarter()
{
}
protected function createLighttpdHosts($ip, $port, $ssl, $vhost_filename)
{
$query = "SELECT * FROM " . TABLE_PANEL_IPSANDPORTS . " WHERE `ip`='" . $ip . "' AND `port`='" . $port . "'";
@@ -280,13 +278,32 @@ class lighttpd
$_pos = strrpos($_tmp_path, '/');
$_inc_path = substr($_tmp_path, $_pos+1);
if((int)$domain['parentdomainid'] == 0)
if((int)$domain['parentdomainid'] == 0
&& ((int)$domain['ismainbutsubto'] == 0
|| domainMainToSubExists($domain['ismainbutsubto']) == false)
) {
$vhost_no = '52';
if($ssl == '1')
{
$vhost_no = '62';
}
}
elseif((int)$domain['parentdomainid'] == 0
&& (int)$domain['ismainbutsubto'] > 0
) {
$vhost_no = '51';
if($ssl == '1')
{
$vhost_no = '61';
}
}
else
{
$vhost_no = '50';
if($ssl == '1')
{
$vhost_no = '60';
}
}
$vhost_filename = makeCorrectFile($this->settings['system']['apacheconf_vhost'].'/vhosts/'.$vhost_no.'_'.$domain['domain'].'.conf');
@@ -368,15 +385,23 @@ class lighttpd
}
else
{
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true);
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true, true);
$only_webroot = false;
if($ssl_vhost === false && $domain['ssl_redirect'] == '1')
{
$only_webroot = true;
}
$vhost_content.= $this->getWebroot($domain, $ssl_vhost);
if(!$only_webroot)
{
$vhost_content.= $this->create_htaccess($domain);
$vhost_content.= $this->create_pathOptions($domain);
$vhost_content.= $this->composePhpOptions($domain);
$vhost_content.= $this->getStats($domain);
$vhost_content.= $this->getLogFiles($domain);
}
}
if ($domain['specialsettings'] != "") {
$vhost_content.= $domain['specialsettings'] . "\n";
@@ -512,7 +537,9 @@ class lighttpd
mkDirWithCorrectOwnership($domain['documentroot'], $row['path'], $domain['guid'], $domain['guid']);
// We need to remove the last slash, otherwise the regex wouldn't work
if($row['path'] != $domain['documentroot']) {
$path = substr($path, 0, -1);
}
$path_options.= ' $HTTP["url"] =~ "^' . $path . '($|/)" {' . "\n";
$path_options.= "\t" . 'dir-listing.activate = "enable"' . "\n";
$path_options.= ' }' . "\n\n";
@@ -521,6 +548,24 @@ class lighttpd
{
$path_options = $error_string;
}
if(customerHasPerlEnabled($domain['customerid'])
&& $row['options_cgi'] != '0')
{
$path = makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
mkDirWithCorrectOwnership($domain['documentroot'], $row['path'], $domain['guid'], $domain['guid']);
// We need to remove the last slash, otherwise the regex wouldn't work
if($row['path'] != $domain['documentroot']) {
$path = substr($path, 0, -1);
}
$path_options.= ' $HTTP["url"] =~ "^' . $path . '($|/)" {' . "\n";
$path_options.= "\t" . 'cgi.assign = (' . "\n";
$path_options.= "\t\t" . '".pl" => "'.makeCorrectFile($this->settings['system']['perl_path']).'",' . "\n";
$path_options.= "\t\t" . '".cgi" => "'.makeCorrectFile($this->settings['system']['perl_path']).'"' . "\n";
$path_options.= "\t" . ')' . "\n";
$path_options.= ' }' . "\n\n";
}
}
return $path_options;
@@ -561,8 +606,8 @@ class lighttpd
$diroption_text.= '"' . $row_htpasswds['path'] . '" =>' . "\n";
$diroption_text.= '(' . "\n";
$diroption_text.= ' "method" => "basic",' . "\n";
$diroption_text.= ' "realm" => "Restricted Area",' . "\n";
$diroption_text.= ' "require" => "user=' . $row_htpasswds['username'] . '"' . "\n";
$diroption_text.= ' "realm" => "'.$row_htpasswds['authname'].'",' . "\n";
$diroption_text.= ' "require" => "valid-user"' . "\n";
$diroption_text.= ')' . "\n";
if($this->auth_backend_loaded[$domain['ssl_ipandport']] == 'yes')
@@ -582,7 +627,7 @@ class lighttpd
protected function getServerNames($domain)
{
$server_string = array();
$domain_name = ereg_replace('\.', '\.', $domain['domain']);
$domain_name = str_replace('.', '\.', $domain['domain']);
if($domain['iswildcarddomain'] == '1')
{

View File

@@ -121,6 +121,7 @@ class lighttpd_fcgid extends lighttpd
$starter_file.= "# starter created/changed on " . date("Y.m.d H:i:s") . " for domain '" . $domain['domain'] . "' with id #" . $domain['id'] . " from php template '" . $phpconfig['description'] . "' with id #" . $phpconfig['id'] . "\n";
$starter_file.= "# Do not change anything in this file, it will be overwritten by the Froxlor Cronjob!\n";
$starter_file.= "#\n\n";
$starter_file.= "umask 022\n";
$starter_file.= "PHPRC=" . escapeshellarg($configdir) . "\n";
$starter_file.= "export PHPRC\n";
@@ -172,7 +173,7 @@ class lighttpd_fcgid extends lighttpd
if(file_exists($starter_filename))
{
safe_exec('chattr -i ' . escapeshellarg($starter_filename));
removeImmutable($starter_filename);
}
$starter_file_handler = fopen($starter_filename, 'w');
@@ -180,7 +181,7 @@ class lighttpd_fcgid extends lighttpd
fclose($starter_file_handler);
safe_exec('chmod 750 ' . escapeshellarg($starter_filename));
safe_exec('chown ' . $domain['guid'] . ':' . $domain['guid'] . ' ' . escapeshellarg($starter_filename));
safe_exec('chattr +i ' . escapeshellarg($starter_filename));
setImmutable($starter_filename);
// define the php.ini
@@ -190,22 +191,42 @@ class lighttpd_fcgid extends lighttpd
if($domain['openbasedir'] == '1')
{
$openbasedirc = '';
if($domain['openbasedir_path'] == '0')
$_phpappendopenbasedir = '';
$_custom_openbasedir = explode(':', $this->settings['system']['mod_fcgid_peardir']);
foreach($_custom_openbasedir as $cobd)
{
$openbasedir = $domain['documentroot'] . ':' . $tmpdir . ':' . $this->settings['system']['mod_fcgid_peardir'] . ':' . $this->settings['system']['phpappendopenbasedir'];
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
}
$_custom_openbasedir = explode(':', $this->settings['system']['phpappendopenbasedir']);
foreach($_custom_openbasedir as $cobd)
{
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
}
if($domain['openbasedir_path'] == '0' && strstr($domain['documentroot'], ":") === false)
{
$openbasedir = appendOpenBasedirPath($domain['documentroot'], true);
}
else
{
$openbasedir = $domain['customerroot'] . ':' . $tmpdir . ':' . $this->settings['system']['mod_fcgid_peardir'] . ':' . $this->settings['system']['phpappendopenbasedir'];
$openbasedir = appendOpenBasedirPath($domain['customerroot'], true);
}
$openbasedir .= appendOpenBasedirPath($tmpdir);
$openbasedir .= $_phpappendopenbasedir;
$openbasedir = explode(':', $openbasedir);
$clean_openbasedir = array();
foreach($openbasedir as $number => $path)
{
$openbasedir[$number] = makeCorrectDir($path);
if(trim($path) != '/')
{
$clean_openbasedir[] = makeCorrectDir($path);
}
$openbasedir = implode(':', $openbasedir);
}
$openbasedir = implode(':', $clean_openbasedir);
}
else
{

View File

@@ -75,8 +75,7 @@ while($row = $db->fetch_array($result_tasks))
$awstatsclean['fh'] = fopen($awstatsclean['fullentry'], 'r');
$awstatsclean['headerRead'] = fgets($awstatsclean['fh'], strlen($awstatsclean['header'])+1);
fclose($awstatsclean['fh']);
if($awstatsclean['headerRead'] == $awstatsclean['header'] || $awstatsclean['headerRead'] ==
$awstatsclean['headerold']) {
if($awstatsclean['headerRead'] == $awstatsclean['header'] || $awstatsclean['headerRead'] == $awstatsclean['headerold']) {
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Removing awstats configuration ".$awstatsclean['fullentry']." for re-creation");
@unlink($awstatsclean['fullentry']);
}
@@ -91,6 +90,34 @@ $awstatsclean['headerold']) {
}
//end dhr
// clear fcgid - starter files prior to re-creation to keep it clean, #367
if ($settings['system']['mod_fcgid'] == '1')
{
$configdir = makeCorrectDir($settings['system']['mod_fcgid_configdir']);
if (is_dir($configdir))
{
$its = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($configdir)
);
// iterate through all subdirs,
// look for php-fcgi-starter files
// and take immutable-flag away from them
// so we can delete them :)
foreach ($its as $fullFileName => $it )
{
if ($it->isFile() && $it->getFilename() == 'php-fcgi-starter')
{
removeImmutable($its->getPathname());
}
}
// now get rid of old stuff
//(but append /* so we don't delete the directory)
safe_exec('rm -rf '. escapeshellarg(makeCorrectFile($configdir.'/*')));
}
}
if(!isset($webserver))
{
if($settings['system']['webserver'] == "apache2")
@@ -123,6 +150,7 @@ $awstatsclean['headerold']) {
$webserver->createVirtualHosts();
$webserver->createFileDirOptions();
$webserver->writeConfigs();
$webserver->createOwnVhostStarter();
$webserver->reload();
}
else
@@ -213,7 +241,7 @@ $awstatsclean['headerold']) {
/*
* remove homedir
*/
$homedir = makeCorrectDir($settings['system']['documentroot_prefix'] . $row['data']['loginname']);
$homedir = makeCorrectDir($settings['system']['documentroot_prefix'] . '/' . $row['data']['loginname']);
if($homedir != '/'
&& $homedir != $settings['system']['documentroot_prefix']
@@ -226,7 +254,7 @@ $awstatsclean['headerold']) {
/*
* remove maildir
*/
$maildir = makeCorrectDir($settings['system']['vmail_homedir'] . $row['data']['loginname']);
$maildir = makeCorrectDir($settings['system']['vmail_homedir'] . '/' . $row['data']['loginname']);
if($maildir != '/'
&& $maildir != $settings['system']['vmail_homedir']
@@ -235,6 +263,97 @@ $awstatsclean['headerold']) {
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: rm -rf ' . escapeshellarg($maildir));
safe_exec('rm -rf '.escapeshellarg($maildir));
}
/*
* see if we have some php-fcgid leftovers if used
* and remove them, #200
*/
if($settings['system']['mod_fcgid'] == 1)
{
// e.g. /var/www/php-fcgi-starter/web1/
$configdir = makeCorrectDir($settings['system']['mod_fcgid_configdir'] . '/' . $row['data']['loginname'] . '/');
if (is_dir($configdir))
{
$its = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($configdir)
);
// iterate through all subdirs,
// look for php-fcgi-starter files
// and take immutable-flag away from them
// so we can delete them :)
foreach ($its as $fullFileName => $it )
{
if ($it->isFile() && $it->getFilename() == 'php-fcgi-starter')
{
removeImmutable($its->getPathname());
}
}
// now get rid of old stuff
safe_exec('rm -rf '. escapeshellarg($configdir));
}
}
}
}
}
/**
* TYPE=7 Customer deleted an email account and wants the data to be deleted on the filesystem
*/
elseif ($row['type'] == '7')
{
fwrite($debugHandler, ' cron_tasks: Task7 started - deleting customer e-mail data' . "\n");
$cronlog->logAction(CRON_ACTION, LOG_INFO, 'Task7 started - deleting customer e-mail data');
if(is_array($row['data']))
{
if(isset($row['data']['loginname'])
&& isset($row['data']['email'])
) {
/*
* remove specific maildir
*/
$maildir = makeCorrectDir($settings['system']['vmail_homedir'] .'/'. $row['data']['loginname'] .'/'. $row['data']['email']);
if($maildir != '/'
&& $maildir != $settings['system']['vmail_homedir']
&& substr($maildir, 0, strlen($settings['system']['vmail_homedir'])) == $settings['system']['vmail_homedir'])
{
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: rm -rf ' . escapeshellarg($maildir));
safe_exec('rm -rf '.escapeshellarg($maildir));
}
}
}
}
/**
* TYPE=8 Customer deleted a ftp account and wants the homedir to be deleted on the filesystem
* refs #293
*/
elseif ($row['type'] == '8')
{
fwrite($debugHandler, ' cron_tasks: Task8 started - deleting customer ftp homedir' . "\n");
$cronlog->logAction(CRON_ACTION, LOG_INFO, 'Task8 started - deleting customer ftp homedir');
if(is_array($row['data']))
{
if(isset($row['data']['loginname'])
&& isset($row['data']['homedir'])
) {
/*
* remove specific homedir
*/
$ftphomedir = makeCorrectDir($row['data']['homedir']);
$customerdocroot = makeCorrectDir($settings['system']['documentroot_prefix'].'/'.$row['data']['loginname'].'/');
if($ftphomedir != '/'
&& $ftphomedir != $settings['system']['documentroot_prefix']
&& $ftphomedir != $customerdocroot
) {
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: rm -rf ' . escapeshellarg($ftphomedir));
safe_exec('rm -rf '.escapeshellarg($ftphomedir));
}
}
}
}

View File

@@ -35,7 +35,7 @@ while($row_ticket = $db->fetch_array($result_tickets))
if($days >= $settings['ticket']['archiving_days'])
{
fwrite($debugHandler, 'archiving ticket "' . $row_ticket['subject'] . '" (ID #' . $row_ticket['id'] . ')' . "\n");
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$row_ticket['id']);
$mainticket = ticket::getInstanceOf(null, $db, $settings, (int)$row_ticket['id']);
$mainticket->Set('lastchange', $now, true, true);
$mainticket->Set('lastreplier', '1', true, true);
$mainticket->Set('status', '3', true, true);

View File

@@ -17,6 +17,48 @@
* @version $Id$
*/
/**
* chowns either awstats or webalizer folder,
* either with webserver-user or - if fcgid
* is used - the customers name, #258
*
* @param array $row array if panel_customers
*
* @return void
*/
function makeChownWithNewStats($row)
{
global $settings;
// get correct user
if($settings['system']['mod_fcgid'] == 1)
{
$user = $row['loginname'];
$group = $row['loginname'];
}
else
{
$user = $row['guid'];
$group = $row['guid'];
}
// get correct directory
$dir = $row['documentroot'];
if($settings['system']['awstats_enabled'] == '1')
{
$dir .= '/awstats/';
} else {
$dir .= '/webalizer/';
}
// only run chown if directory exists
if (file_exists($dir))
{
// run chown
safe_exec('chown -R '.escapeshellarg($user).':'.escapeshellarg($group).' '.escapeshellarg(makeCorrectDir($dir)));
}
}
function awstatsDoSingleDomain($domain, $outputdir)
{
global $cronlog, $settings;
@@ -36,6 +78,7 @@ function awstatsDoSingleDomain($domain, $outputdir)
* check for correct path of awstats_buildstaticpages.pl
*/
$awbsp = makeCorrectFile($settings['system']['awstats_path'].'/awstats_buildstaticpages.pl');
$awprog = makeCorrectFile($settings['system']['awstats_awstatspath'].'/awstats.pl');
if (!file_exists($awbsp)) {
echo "WANRING: Necessary awstats_buildstaticpages.pl script could not be found, no traffic is being calculated and no stats are generated. Please check your AWStats-Path setting";
@@ -44,7 +87,7 @@ function awstatsDoSingleDomain($domain, $outputdir)
}
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Running awstats_buildstaticpages.pl for domain '".$domain."' (Output: '".$outputdir."')");
safe_exec($awbsp.' -update -config=' . $domain . ' -dir='.escapeshellarg($outputdir));
safe_exec($awbsp.' -awstatsprog='.escapeshellarg($awprog).' -update -config=' . $domain . ' -dir='.escapeshellarg($outputdir));
/**
* index file is saved like 'awstats.[domain].html',

View File

@@ -191,6 +191,9 @@ while($row = $db->fetch_array($result))
{
$httptraffic+= floatval(callWebalizerGetTraffic($row['loginname'], $row['documentroot'] . '/webalizer/', $caption, $domainlist[$row['customerid']]));
}
// make the stuff readable for the customer, #258
makeChownWithNewStats($row);
}
/**

View File

@@ -25,7 +25,7 @@ $yesterday = time() - (60 * 60 * 24);
*/
require (dirname(__FILE__) . '/../lib/class.phpmailer.php');
$mail = new PHPMailer();
$mail = new PHPMailer(true);
$mail->SetFrom($settings['panel']['adminmail'], 'Froxlor Administrator');
// Warn the customers at 90% traffic-usage

View File

@@ -4,7 +4,7 @@ $header
<input type="hidden" name="page" value="$page"/>
<table cellpadding="5" cellspacing="0" border="0" align="center" class="maintable">
<tr>
<td class="maintitle_search_left" colspan="3"><b><img src="images/title.gif" alt="" />&nbsp;{$lng['admin']['admins']}</b></td>
<td class="maintitle_search_left" colspan="3"><b><img src="images/title.gif" alt="" />&nbsp;{$lng['admin']['admins']}</b>&nbsp;({$admincount})</td>
<td class="maintitle_search_right" colspan="<if $settings['ticket']['enabled'] == 1 >7<else>6</if>">{$searchcode}</td>
</tr>
<tr>

View File

@@ -4,7 +4,7 @@ $header
<input type="hidden" name="page" value="$page"/>
<table cellpadding="5" cellspacing="0" border="0" align="center" class="maintable">
<tr>
<td class="maintitle_search_left" colspan="3" ><b><img src="images/title.gif" alt="" />&nbsp;{$lng['admin']['customers']}</b></td>
<td class="maintitle_search_left" colspan="3" ><b><img src="images/title.gif" alt="" />&nbsp;{$lng['admin']['customers']}</b>&nbsp;({$customercount})</td>
<td class="maintitle_search_right" colspan="<if $settings['ticket']['enabled'] == 1 >8<else>7</if>">{$searchcode}</td>
</tr>
<if ($userinfo['customers_used'] < $userinfo['customers'] || $userinfo['customers'] == '-1') && 15 < $userinfo['customers_used']>

View File

@@ -18,7 +18,7 @@ $header
</tr>
<tr>
<td class="main_field_name">{$lng['login']['username']}:</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="loginname" value="" maxlength="10" /></td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="new_loginname" value="" maxlength="10" /></td>
</tr>
<tr>
<td class="main_field_name">{$lng['admin']['stdsubdomain_add']}?</td>
@@ -26,7 +26,7 @@ $header
</tr>
<tr>
<td class="main_field_name">{$lng['login']['password']}:</td>
<td class="main_field_display" nowrap="nowrap"><input type="password" name="customer_password" value="" /></td>
<td class="main_field_display" nowrap="nowrap"><input type="password" name="new_customer_password" value="" /></td>
</tr>
<tr>
<td class="main_field_name">{$lng['admin']['sendpassword']}?</td>
@@ -94,32 +94,32 @@ $header
</tr>
<tr>
<td class="main_field_name">{$lng['customer']['diskspace']}: *</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="diskspace" value="" maxlength="6" />&nbsp;{$diskspace_ul}</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="diskspace" value="0" maxlength="6" />&nbsp;{$diskspace_ul}</td>
</tr>
<tr>
<td class="main_field_name">{$lng['customer']['traffic']}: *</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="traffic" value="" maxlength="4" />&nbsp;{$traffic_ul}</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="traffic" value="0" maxlength="4" />&nbsp;{$traffic_ul}</td>
</tr>
<tr>
<td class="main_field_name">{$lng['customer']['subdomains']}: *</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="subdomains" value="" maxlength="9" />&nbsp;{$subdomains_ul}</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="subdomains" value="0" maxlength="9" />&nbsp;{$subdomains_ul}</td>
</tr>
<tr>
<td class="main_field_name">{$lng['customer']['emails']}: *</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="emails" value="" maxlength="9" />&nbsp;{$emails_ul}</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="emails" value="0" maxlength="9" />&nbsp;{$emails_ul}</td>
</tr>
<tr>
<td class="main_field_name">{$lng['customer']['accounts']}: *</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="email_accounts" value="" maxlength="9" />&nbsp;{$email_accounts_ul}</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="email_accounts" value="0" maxlength="9" />&nbsp;{$email_accounts_ul}</td>
</tr>
<tr>
<td class="main_field_name">{$lng['customer']['forwarders']}: *</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="email_forwarders" value="" maxlength="9" />&nbsp;{$email_forwarders_ul}</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="email_forwarders" value="0" maxlength="9" />&nbsp;{$email_forwarders_ul}</td>
</tr>
<if $settings['system']['mail_quota_enabled'] == 1>
<tr>
<td class="main_field_name">{$lng['customer']['email_quota']}: *</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="email_quota" value="" maxlength="9" />&nbsp;{$email_quota_ul}</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="email_quota" value="0" maxlength="9" />&nbsp;{$email_quota_ul}</td>
</tr>
</if>
<tr>
@@ -132,22 +132,26 @@ $header
</tr>
<tr>
<td class="main_field_name">{$lng['customer']['ftps']}: *</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="ftps" value="" maxlength="9" />&nbsp;{$ftps_ul}</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="ftps" value="0" maxlength="9" />&nbsp;{$ftps_ul}</td>
</tr>
<if $settings['ticket']['enabled'] == 1 >
<tr>
<td class="main_field_name">{$lng['customer']['tickets']}: *</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="tickets" value="" maxlength="9" />&nbsp;{$tickets_ul}</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="tickets" value="0" maxlength="9" />&nbsp;{$tickets_ul}</td>
</tr>
</if>
<tr>
<td class="main_field_name">{$lng['customer']['mysqls']}: *</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="mysqls" value="" maxlength="9" />&nbsp;{$mysqls_ul}</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="textul" name="mysqls" value="0" maxlength="9" />&nbsp;{$mysqls_ul}</td>
</tr>
<tr>
<td class="main_field_name">{$lng['admin']['phpenabled']}?</td>
<td class="main_field_display" nowrap="nowrap">$phpenabled</td>
</tr>
<tr>
<td class="main_field_name">{$lng['admin']['perlenabled']}?</td>
<td class="main_field_display" nowrap="nowrap">$perlenabled</td>
</tr>
<if $settings['aps']['aps_active'] == '1'>
<tr>
<td class="main_field_name">{$lng['aps']['numberofapspackages']}:</td>

View File

@@ -35,7 +35,7 @@ $header
</tr>
<tr>
<td class="main_field_name">{$lng['login']['password']} ({$lng['panel']['emptyfornochanges']}):</td>
<td class="main_field_display" nowrap="nowrap"><input type="password" name="customer_password" value="" /></td>
<td class="main_field_display" nowrap="nowrap"><input type="password" name="new_customer_password" value="" /></td>
</tr>
<tr>
<td class="main_field_name">{$lng['login']['language']}:</td>
@@ -153,6 +153,10 @@ $header
<td class="main_field_name">{$lng['admin']['phpenabled']}?</td>
<td class="main_field_display" nowrap="nowrap">$phpenabled</td>
</tr>
<tr>
<td class="main_field_name">{$lng['admin']['perlenabled']}?</td>
<td class="main_field_display" nowrap="nowrap">$perlenabled</td>
</tr>
<if $settings['aps']['aps_active'] == '1'>
<tr>
<td class="main_field_name">{$lng['aps']['numberofapspackages']}:</td>

View File

@@ -4,7 +4,7 @@ $header
<input type="hidden" name="page" value="$page"/>
<table cellpadding="5" cellspacing="0" border="0" align="center" class="maintable">
<tr>
<td class="maintitle_search_left"><b><img src="images/title.gif" alt="" />&nbsp;{$lng['admin']['domains']}</b></td>
<td class="maintitle_search_left"><b><img src="images/title.gif" alt="" />&nbsp;{$lng['admin']['domains']}</b>&nbsp;({$domainscount})</td>
<td class="maintitle_search_right" colspan="4">{$searchcode}</td>
</tr>
<if ($userinfo['domains_used'] < $userinfo['domains'] || $userinfo['domains'] == '-1') && 15 < $count && 0 < $countcustomers >

View File

@@ -34,6 +34,10 @@ $header
<td class="main_field_name">{$lng['domains']['aliasdomain']}:</td>
<td class="main_field_display" nowrap="nowrap"><select class="dropdown_noborder" name="alias">$domains</select></td>
</tr>
<tr>
<td class="main_field_name">{$lng['domains']['issubof']}:<br /><small>{$lng['domains']['issubofinfo']}</small></td>
<td class="main_field_display" nowrap="nowrap"><select class="dropdown_noborder" name="issubof">$subtodomains</select></td>
</tr>
<tr>
<td class="main_field_name">{$lng['admin']['domain_edit']}:</td>
<td class="main_field_display" nowrap="nowrap">$caneditdomain</td>

View File

@@ -37,6 +37,10 @@ $header
<td class="main_field_display" nowrap="nowrap"><select class="dropdown_noborder" name="alias">$domains</select></td>
</tr>
</if>
<tr>
<td class="main_field_name">{$lng['domains']['issubof']}:<br /><small>{$lng['domains']['issubofinfo']}</small></td>
<td class="main_field_display" nowrap="nowrap"><select class="dropdown_noborder" name="issubof">$subtodomains</select></td>
</tr>
<tr>
<td class="main_field_name">{$lng['domains']['associated_with_domain']}:</td>
<td class="main_field_display" nowrap="nowrap">{$subdomains} {$lng['customer']['subdomains']}, {$alias_check} {$lng['domains']['aliasdomains']}, {$emails} {$lng['customer']['emails']}, {$email_accounts} {$lng['customer']['accounts']}, {$email_forwarders} {$lng['customer']['forwarders']}</td>

View File

@@ -36,6 +36,10 @@ $header
<tr>
<td class="field_display_border_left" colspan="2"><b>{$lng['admin']['templates']['createcustomer']}</b></td>
</tr>
<tr>
<td class="field_name_border_left"><i>{SALUTATION}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{FIRSTNAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['FIRSTNAME']}</td>
@@ -44,6 +48,10 @@ $header
<td class="field_name_border_left"><i>{NAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['NAME']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{COMPANY}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['COMPANY']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{USERNAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['USERNAME']}</td>
@@ -72,6 +80,21 @@ $header
<td class="field_name">{$lng['admin']['templates']['EMAIL_PASSWORD']}</td>
</tr>
</if>
<tr>
<td class="field_display_border_left" colspan="2"><b>{$lng['admin']['templates']['forgotpwd']}</b></td>
</tr>
<tr>
<td class="field_name_border_left"><i>{SALUTATION}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{USERNAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['USERNAME']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{PASSWORD}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['PASSWORD']}</td>
</tr>
<tr>
<td class="field_display_border_left" colspan="2"><b>{$lng['admin']['templates']['trafficninetypercent']}</b></td>
</tr>
@@ -90,6 +113,10 @@ $header
<td class="field_name_border_left"><i>{SUBJECT}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['SUBJECT']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{SALUTATION}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{FIRSTNAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['FIRSTNAME']}</td>
@@ -98,6 +125,56 @@ $header
<td class="field_name_border_left"><i>{NAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['NAME']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{COMPANY}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['COMPANY']}</td>
</tr>
<tr>
<td class="field_display_border_left" colspan="2"><b>{$lng['admin']['templates']['newdatabase']}</b></td>
</tr>
<tr>
<td class="field_name_border_left"><i>{CUST_NAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['CUST_NAME']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{DB_NAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['DB_NAME']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{DB_PASS}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['DB_PASS']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{DB_DESC}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['DB_DESC']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{DB_SRV}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['DB_SRV']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{PMA_URI}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['PMA_URI']}</td>
</tr>
<tr>
<td class="field_display_border_left" colspan="2"><b>{$lng['admin']['templates']['newftpuser']}</b></td>
</tr>
<tr>
<td class="field_name_border_left"><i>{CUST_NAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['CUST_NAME']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{USR_NAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['USR_NAME']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{USR_PASS}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['USR_PASS']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{USR_PATH}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['USR_PATH']}</td>
</tr>
</table>
</form>
<br />

View File

@@ -38,6 +38,10 @@ $header
<tr>
<td class="field_display_border_left" colspan="2"><b>{$lng['admin']['templates']['createcustomer']}</b></td>
</tr>
<tr>
<td class="field_name_border_left"><i>{SALUTATION}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{FIRSTNAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['FIRSTNAME']}</td>
@@ -46,6 +50,10 @@ $header
<td class="field_name_border_left"><i>{NAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['NAME']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{COMPANY}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['COMPANY']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{USERNAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['USERNAME']}</td>
@@ -74,6 +82,21 @@ $header
<td class="field_name">{$lng['admin']['templates']['EMAIL_PASSWORD']}</td>
</tr>
</if>
<tr>
<td class="field_display_border_left" colspan="2"><b>{$lng['admin']['templates']['forgotpwd']}</b></td>
</tr>
<tr>
<td class="field_name_border_left"><i>{SALUTATION}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{USERNAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['USERNAME']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{PASSWORD}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['PASSWORD']}</td>
</tr>
<tr>
<td class="field_display_border_left" colspan="2"><b>{$lng['admin']['templates']['trafficninetypercent']}</b></td>
</tr>
@@ -92,6 +115,10 @@ $header
<td class="field_name_border_left"><i>{SUBJECT}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['SUBJECT']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{SALUTATION}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{FIRSTNAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['FIRSTNAME']}</td>
@@ -100,6 +127,56 @@ $header
<td class="field_name_border_left"><i>{NAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['NAME']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{COMPANY}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['COMPANY']}</td>
</tr>
<tr>
<td class="field_display_border_left" colspan="2"><b>{$lng['admin']['templates']['newdatabase']}</b></td>
</tr>
<tr>
<td class="field_name_border_left"><i>{CUST_NAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['CUST_NAME']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{DB_NAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['DB_NAME']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{DB_PASS}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['DB_PASS']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{DB_DESC}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['DB_DESC']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{DB_SRV}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['DB_SRV']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{PMA_URI}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['PMA_URI']}</td>
</tr>
<tr>
<td class="field_display_border_left" colspan="2"><b>{$lng['admin']['templates']['newftpuser']}</b></td>
</tr>
<tr>
<td class="field_name_border_left"><i>{CUST_NAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['CUST_NAME']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{USR_NAME}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['USR_NAME']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{USR_PASS}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['USR_PASS']}</td>
</tr>
<tr>
<td class="field_name_border_left"><i>{USR_PATH}</i>:</td>
<td class="field_name">{$lng['admin']['templates']['USR_PATH']}</td>
</tr>
</table>
</form>
<br />

View File

@@ -29,7 +29,7 @@
<input class="bottom" type="submit" value="{$lng['aps']['back']}" />
</form>
</if>
<if $action != 'customerstatus' && ( $userinfo['aps_packages'] != $userinfo['aps_packages_used'] )>
<if $action != 'customerstatus' && ( $userinfo['aps_packages'] != $userinfo['aps_packages_used'] ) && $db_info == ''>
<form method="get" action="$filename" style="float:left; padding-left: 5px;">
<input type="hidden" name="s" value="$s" />
<input type="hidden" name="page" value="$page" />
@@ -38,6 +38,9 @@
<input class="bottom" type="submit" value="{$lng['aps']['install']}" />
</form>
</if>
<if $db_info != ''>
<span style="padding-left: 5px;">{$db_info}</span>
</if>
<if ($action == 'customerstatus') && ($Row['Status'] == 2 || $Row['Status'] == 3)>
<form method="get" action="$filename" style="float:left;">
<input type="hidden" name="s" value="$s" />

View File

@@ -4,7 +4,7 @@ $header
<input type="hidden" name="page" value="$page" />
<table cellpadding="5" cellspacing="0" border="0" align="center" class="maintable">
<tr>
<td class="maintitle_search_left"><b><img src="images/title.gif" alt="" />&nbsp;{$lng['domains']['domainsettings']}</b></td>
<td class="maintitle_search_left"><b><img src="images/title.gif" alt="" />&nbsp;{$lng['domains']['domainsettings']}</b>&nbsp;({$domains_count})</td>
<td class="maintitle_search_right" colspan="3">{$searchcode}</td>
</tr>
<if ($userinfo['subdomains_used'] < $userinfo['subdomains'] || $userinfo['subdomains'] == '-1') && 15 < $domains_count && $parentdomains_count != 0 >

View File

@@ -13,23 +13,30 @@ $header
</tr>
<tr>
<td class="main_field_name">{$lng['domains']['aliasdomain']}:</td>
<td class="main_field_display" nowrap="nowrap"><select class="tendina_nobordo" name="alias">$aliasdomains</select></td>
<td class="main_field_display" nowrap="nowrap"><select name="alias">$aliasdomains</select></td>
</tr>
<if $settings['panel']['pathedit'] != 'Dropdown'><tr>
<td class="main_field_name">
{$lng['panel']['pathorurl']}:<br />
<font size="1">{$lng['panel']['pathDescription']}</font>
</td>
<if $settings['panel']['pathedit'] != 'Dropdown'>
<tr>
<td class="main_field_name">{$lng['panel']['pathorurl']}:<br /><font size="1">{$lng['panel']['pathDescription']}</font></td>
<td class="main_field_display" nowrap="nowrap">{$pathSelect}</td>
</tr></if>
<if $settings['panel']['pathedit'] == 'Dropdown'><tr>
</tr>
</if>
<if $settings['panel']['pathedit'] == 'Dropdown'>
<tr>
<td class="main_field_name">{$lng['panel']['path']}:</td>
<td class="main_field_display">{$pathSelect}</td>
</tr>
<tr>
<td class="main_field_name">{$lng['panel']['urloverridespath']}:</td>
<td class="main_field_display"><input type="text" class="text" name="url" value="{$urlvalue}" size="30" /></td>
</tr></if>
</tr>
</if>
<if $settings['system']['webserver'] == 'apache2' && $settings['customredirect']['enabled'] == '1'>
<tr>
<td class="main_field_name">{$lng['domains']['redirectifpathisurl']}:<br /><font size="1">{$lng['domains']['redirectifpathisurlinfo']}</font></td>
<td class="main_field_display" nowrap="nowrap"><select name="redirectcode">$redirectcode</select></td>
</tr>
</if>
<if $settings['system']['use_ssl'] == '1'>
<tr>
<td class="main_field_name">SSL Redirect:</td>

View File

@@ -16,33 +16,46 @@ $header
<td class="main_field_name">{$lng['dns']['destinationip']}:</td>
<td class="main_field_display" nowrap="nowrap">{$domainip}</td>
</tr>
<if $alias_check == '0'><tr>
<if $alias_check == '0'>
<tr>
<td class="main_field_name">{$lng['domains']['aliasdomain']}:</td>
<td class="main_field_display" nowrap="nowrap"><select class="tendina_nobordo" name="alias">$domains</select></td>
</tr></if>
<if $settings['panel']['pathedit'] != 'Dropdown'><tr>
<td class="main_field_name">
{$lng['panel']['pathorurl']}:<br />
<font size="1">{$lng['panel']['pathDescription']}</font>
</td>
</tr>
</if>
<if $settings['panel']['pathedit'] != 'Dropdown'>
<tr>
<td class="main_field_name">{$lng['panel']['pathorurl']}:<br /><font size="1">{$lng['panel']['pathDescription']}</font></td>
<td class="main_field_display" nowrap="nowrap">{$pathSelect}</td>
</tr></if>
<if $settings['panel']['pathedit'] == 'Dropdown'><tr>
</tr>
</if>
<if $settings['panel']['pathedit'] == 'Dropdown'>
<tr>
<td class="main_field_name">{$lng['panel']['path']}:</td>
<td class="main_field_display">{$pathSelect}</td>
</tr>
<tr>
<td class="main_field_name">{$lng['panel']['urloverridespath']}:</td>
<td class="main_field_display"><input type="text" class="text" name="url" value="{$urlvalue}" size="30" /></td>
</tr></if>
<if $result['parentdomainid'] == '0' && $userinfo['subdomains'] != '0' ><tr>
</tr>
</if>
<if $settings['system']['webserver'] == 'apache2' && $settings['customredirect']['enabled'] == '1'>
<tr>
<td class="main_field_name">{$lng['domains']['redirectifpathisurl']}:<br /><font size="1">{$lng['domains']['redirectifpathisurlinfo']}</font></td>
<td class="main_field_display" nowrap="nowrap"><select name="redirectcode">$redirectcode</select></td>
</tr>
</if>
<if $result['parentdomainid'] == '0' && $userinfo['subdomains'] != '0' >
<tr>
<td class="main_field_name">{$lng['domains']['wildcarddomain']}</td>
<td class="main_field_display" nowrap="nowrap">$iswildcarddomain</td>
</tr></if>
<if ( $result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2' ) && $result['parentdomainid'] != '0' ><tr>
</tr>
</if>
<if ( $result['subcanemaildomain'] == '1' || $result['subcanemaildomain'] == '2' ) && $result['parentdomainid'] != '0' >
<tr>
<td class="main_field_name">Emaildomain:</td>
<td class="main_field_display" nowrap="nowrap">$isemaildomain</td>
</tr></if>
</tr>
</if>
<if $settings['system']['use_ssl'] == '1'>
<tr>
<td class="main_field_name">SSL Redirect:</td>

View File

@@ -4,7 +4,7 @@ $header
<input type="hidden" name="page" value="$page" />
<table cellpadding="5" cellspacing="0" border="0" align="center" class="maintable">
<tr>
<td class="maintitle_search_left"><b><img src="images/title.gif" alt="" />&nbsp;{$lng['menue']['email']['emails']}</b></td>
<td class="maintitle_search_left"><b><img src="images/title.gif" alt="" />&nbsp;{$lng['menue']['email']['emails']}</b>&nbsp;({$emailscount})</td>
<td class="maintitle_search_right" colspan="6">{$searchcode}</td>
</tr>
<if ($userinfo['emails_used'] < $userinfo['emails'] || $userinfo['emails'] == '-1') && 15 < $emails_count && $emaildomains_count !=0 >

View File

@@ -19,7 +19,7 @@ $header
<tr>
<td class="main_field_confirm" colspan="2"><input type="hidden" name="send" value="send" /><input type="submit" class="bottom" value="{$lng['emails']['emails_add']}" /></td>
</tr>
<else
<else>
<tr>
<td class="main_field_name" colspan="2">{$lng['emails']['noemaildomainaddedyet']}</td>
</tr>

View File

@@ -5,7 +5,7 @@ $header
<table cellpadding="5" cellspacing="0" border="0" align="center" class="maintable">
<tr>
<td class="maintitle_search_left"><b><img src="images/title.gif" alt="" />&nbsp;{$lng['menue']['extras']['pathoptions']}</b></td>
<td class="maintitle_search_right" colspan="6">{$searchcode}</td>
<td class="maintitle_search_right" colspan="<if $cperlenabled == 1 >7<else>6</if>">{$searchcode}</td>
</tr>
<tr>
<td class="field_display_border_left">{$lng['panel']['path']}&nbsp;&nbsp;{$arrowcode['path']}</td>
@@ -13,16 +13,17 @@ $header
<td class="field_display">{$lng['extras']['error404path']}&nbsp;&nbsp;{$arrowcode['error404path']}</td>
<td class="field_display">{$lng['extras']['error403path']}&nbsp;&nbsp;{$arrowcode['error403path']}</td>
<td class="field_display">{$lng['extras']['error500path']}&nbsp;&nbsp;{$arrowcode['error500path']}</td>
<if $cperlenabled == 1 ><td class="field_display">{$lng['extras']['execute_perl']}&nbsp;&nbsp;{$arrowcode['options_cgi']}</td></if>
<td class="field_display_search" colspan="2">{$sortcode}</td>
</tr>
$htaccess
<if $pagingcode != ''>
<tr>
<td class="field_display_border_left" colspan="7" style=" text-align: center; ">{$pagingcode}</td>
<td class="field_display_border_left" colspan="<if $cperlenabled == 1 >8<else>7</if>" style=" text-align: center; ">{$pagingcode}</td>
</tr>
</if>
<tr>
<td class="field_display_border_left" colspan="7"><a href="$filename?page=htaccess&amp;action=add&amp;s=$s">{$lng['extras']['pathoptions_add']}</a></td>
<td class="field_display_border_left" colspan="<if $cperlenabled == 1 >8<else>7</if>"><a href="$filename?page=htaccess&amp;action=add&amp;s=$s">{$lng['extras']['pathoptions_add']}</a></td>
</tr>
</table>
</form>

View File

@@ -19,21 +19,27 @@ $header
<td class="main_field_display" nowrap="nowrap">$options_indexes</td>
</tr>
<tr>
<td class="main_field_name"><b>{$lng['extras']['errordocument404path']}:</b><br />{$lng['panel']['emptyfordefault']}</td>
<td class="main_field_name"><b>{$lng['extras']['errordocument404path']}:</b><br />{$lng['panel']['descriptionerrordocument']}</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="error404path" value="" size="30" maxlength="255" /></td>
</tr>
<tr>
<td class="main_field_name"><b>{$lng['extras']['errordocument403path']}:</b><br />{$lng['panel']['emptyfordefault']}
<td class="main_field_name"><b>{$lng['extras']['errordocument403path']}:</b><br />{$lng['panel']['descriptionerrordocument']}
<if $settings['system']['webserver'] == 'lighttpd'><div style="color:red">{$lng['panel']['not_supported']}lighttpd</div></if>
</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="error403path" value="" size="30" maxlength="255" /></td>
</tr>
<tr>
<td class="main_field_name"><b>{$lng['extras']['errordocument500path']}:</b><br />{$lng['panel']['emptyfordefault']}
<td class="main_field_name"><b>{$lng['extras']['errordocument500path']}:</b><br />{$lng['panel']['descriptionerrordocument']}
<if $settings['system']['webserver'] == 'lighttpd'><div style="color:red">{$lng['panel']['not_supported']}lighttpd</div></if>
</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="error500path" value="" size="30" maxlength="255" /></td>
</tr>
<if $cperlenabled == 1 >
<tr>
<td class="main_field_name"><b>{$lng['extras']['execute_perl']}:</b></td>
<td class="main_field_display" nowrap="nowrap">$options_cgi</td>
</tr>
</if>
<tr>
<td class="main_field_confirm" colspan="2"><input type="hidden" name="send" value="send" /><input type="submit" class="bottom" value="{$lng['extras']['pathoptions_add']}" /></td>
</tr>

Some files were not shown because too many files have changed in this diff Show More