Compare commits
238 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3ef7cbe0a | ||
|
|
2ce7e9728f | ||
|
|
8c0bef06c6 | ||
|
|
7a493fad80 | ||
|
|
891835d542 | ||
|
|
1876ed1459 | ||
|
|
711f54662c | ||
|
|
f331dee8a1 | ||
|
|
3f0d94c157 | ||
|
|
f5576606e1 | ||
|
|
34de2c03c4 | ||
|
|
225be93610 | ||
|
|
089b03de38 | ||
|
|
785e8f0938 | ||
|
|
ea24918785 | ||
|
|
daa8e45582 | ||
|
|
aa45bf5f70 | ||
|
|
b64bfaeb92 | ||
|
|
659d673ffa | ||
|
|
65e0962111 | ||
|
|
a5cf1a0ac9 | ||
|
|
465f29531e | ||
|
|
88b0c70d0c | ||
|
|
4c1b30a081 | ||
|
|
afdd94ff9e | ||
|
|
0b8c1441ef | ||
|
|
83b1d85730 | ||
|
|
399664c65a | ||
|
|
2830bb722f | ||
|
|
7e733e60ee | ||
|
|
1f6e3c271b | ||
|
|
9c79654cf4 | ||
|
|
7ea04992e3 | ||
|
|
29a949d3d2 | ||
|
|
36ed2b4dc2 | ||
|
|
9d50eca251 | ||
|
|
c28a0291d7 | ||
|
|
e9ba9e089e | ||
|
|
01b58cf247 | ||
|
|
aa532806d0 | ||
|
|
6ddfe7a378 | ||
|
|
01a2690cf1 | ||
|
|
8692a107ab | ||
|
|
d8b0221c91 | ||
|
|
a6408bf398 | ||
|
|
433c8669f4 | ||
|
|
43aebcccff | ||
|
|
1e22b96d9a | ||
|
|
962abd34c7 | ||
|
|
c6a45789bc | ||
|
|
9d48bbf2f3 | ||
|
|
bdc002978a | ||
|
|
7ce1781f57 | ||
|
|
fde4d53f1d | ||
|
|
862265ab60 | ||
|
|
8ac41a28b9 | ||
|
|
fb4b0e3920 | ||
|
|
49297ee5e2 | ||
|
|
046be275a7 | ||
|
|
5054eec852 | ||
|
|
a7041e0399 | ||
|
|
5f5650f53a | ||
|
|
606f8fe557 | ||
|
|
fd6a0597a6 | ||
|
|
62fa764b4c | ||
|
|
9217d9977f | ||
|
|
31231a5f60 | ||
|
|
4cf8e2f2ea | ||
|
|
fd74671760 | ||
|
|
28d626f882 | ||
|
|
09d69945f1 | ||
|
|
b87e4277f2 | ||
|
|
24efe70335 | ||
|
|
a26b37c270 | ||
|
|
3d67143903 | ||
|
|
96219f406d | ||
|
|
4f5cb34f00 | ||
|
|
d4f3093ae3 | ||
|
|
cc89f26982 | ||
|
|
8155484ee9 | ||
|
|
97e3b30415 | ||
|
|
07b2c26bec | ||
|
|
afe431b72f | ||
|
|
f5f796344c | ||
|
|
8ee56d23ba | ||
|
|
f62dba4e1b | ||
|
|
87f84c694a | ||
|
|
f5a0727b8e | ||
|
|
4d5dcb82d6 | ||
|
|
7fa901bebb | ||
|
|
1159bde3eb | ||
|
|
9013062ae9 | ||
|
|
47b2fe7c7c | ||
|
|
cfaae63657 | ||
|
|
98e79d933c | ||
|
|
ae27e06675 | ||
|
|
209ab4dff9 | ||
|
|
cf18590b84 | ||
|
|
6c25cd1c85 | ||
|
|
0d3df6e1fe | ||
|
|
b11d0c5cd9 | ||
|
|
afc3ab8a8b | ||
|
|
1903f34dea | ||
|
|
ee7e50004a | ||
|
|
96d26d0d94 | ||
|
|
7c12ab82c5 | ||
|
|
5c152a9754 | ||
|
|
5a4fffbce6 | ||
|
|
220118f4bc | ||
|
|
5d214e5bd7 | ||
|
|
43fe968ad0 | ||
|
|
7daa7eb0bc | ||
|
|
a0274b083b | ||
|
|
04c7aae433 | ||
|
|
5a99950a8f | ||
|
|
4659d8e24a | ||
|
|
5e3a4fb1ab | ||
|
|
1839264f7a | ||
|
|
5f9d90a293 | ||
|
|
5c825e3206 | ||
|
|
a54a27d6ba | ||
|
|
16135fb92b | ||
|
|
f8d0472274 | ||
|
|
368e6a5c50 | ||
|
|
fb4ade70d2 | ||
|
|
6a0fcc1fd9 | ||
|
|
0eec533647 | ||
|
|
941b887b75 | ||
|
|
43595df977 | ||
|
|
8d652183a0 | ||
|
|
6af37fb40e | ||
|
|
d3ceeb3f14 | ||
|
|
7182b245b3 | ||
|
|
a48d6ae174 | ||
|
|
521d6bbd4d | ||
|
|
e4f0144bbc | ||
|
|
2c50107bea | ||
|
|
043ca2ff5a | ||
|
|
ab1e3c3fc8 | ||
|
|
230c2a1cf3 | ||
|
|
7bea15a7a9 | ||
|
|
2b2d44166d | ||
|
|
70dc03098c | ||
|
|
16b7d7f029 | ||
|
|
81dad796ee | ||
|
|
8a28c6e0ef | ||
|
|
fc5d14d223 | ||
|
|
0ec2238e4b | ||
|
|
8077a2e3b1 | ||
|
|
677cd54e1c | ||
|
|
a3a3dec68c | ||
|
|
bb6860532c | ||
|
|
68b4edd1e1 | ||
|
|
9dff94f1c8 | ||
|
|
f5e2d13c53 | ||
|
|
15e7441ab9 | ||
|
|
12e63a3eea | ||
|
|
4e1405ca39 | ||
|
|
0e1d82db8b | ||
|
|
952edd380f | ||
|
|
9b843a8ad5 | ||
|
|
d4e310d150 | ||
|
|
e0e57da5b8 | ||
|
|
00b881f49b | ||
|
|
080eeb29ec | ||
|
|
db74c99098 | ||
|
|
d3599dc8c0 | ||
|
|
6eba5f5318 | ||
|
|
16bca3c665 | ||
|
|
dcb32c1bb5 | ||
|
|
f76df2252d | ||
|
|
402e8620a9 | ||
|
|
ccf40fc89b | ||
|
|
660bede9c5 | ||
|
|
1db572e010 | ||
|
|
d4c4a0c05f | ||
|
|
6b7a3e73f1 | ||
|
|
55aab4004c | ||
|
|
c1de55f3d5 | ||
|
|
f9d84a09f1 | ||
|
|
e79fe3e510 | ||
|
|
eddb2a2623 | ||
|
|
ae595b0f2f | ||
|
|
423fd7b7df | ||
|
|
7f6a21ceec | ||
|
|
f11c180ea8 | ||
|
|
a7f22a3426 | ||
|
|
2c12c51977 | ||
|
|
ee7f83aede | ||
|
|
6f37aa2209 | ||
|
|
1d03f04e1e | ||
|
|
8ec1b723a2 | ||
|
|
fb75e43511 | ||
|
|
3e4dc2f1d8 | ||
|
|
6c233818f2 | ||
|
|
9a18dbcc36 | ||
|
|
cbfb89f86a | ||
|
|
491e5363a7 | ||
|
|
b5465f602f | ||
|
|
49ff638e20 | ||
|
|
cb2ad2261b | ||
|
|
a6909a8cec | ||
|
|
a0c557c405 | ||
|
|
0cd452de28 | ||
|
|
91d461b122 | ||
|
|
098afe7cf8 | ||
|
|
25b1478261 | ||
|
|
adf79b3b1d | ||
|
|
0461e4cbd9 | ||
|
|
b289a6746a | ||
|
|
1d2193d0e2 | ||
|
|
8fb23fcf62 | ||
|
|
525499b987 | ||
|
|
f8b3da48fc | ||
|
|
dd0aa8e10c | ||
|
|
fea80269ed | ||
|
|
dd9b72e45e | ||
|
|
7aba67af11 | ||
|
|
a1561618e9 | ||
|
|
c549e17795 | ||
|
|
3c59d37dd2 | ||
|
|
d236a5ceda | ||
|
|
66d5ea8f9e | ||
|
|
e8de3d45e5 | ||
|
|
c192d19d7e | ||
|
|
ada8ecf04a | ||
|
|
2d3701c5a3 | ||
|
|
0488a3c2a4 | ||
|
|
74e3ed0a1f | ||
|
|
432f555e37 | ||
|
|
78ae0e2f56 | ||
|
|
2dc14c31c2 | ||
|
|
2a7d6c5d88 | ||
|
|
75f37de29b | ||
|
|
119015f3f0 | ||
|
|
2378d4319c | ||
|
|
8dcade976d | ||
|
|
bf14528d17 |
126
TODO
126
TODO
@@ -1,126 +0,0 @@
|
|||||||
FIXED 0001282 Homedirs von Dovecot identisch
|
|
||||||
FIXED 0001283 SysCP creating broken lighttpd config files
|
|
||||||
FIXED 0001213 APS class_apsinstaller.php on line 510 - error installing different apps
|
|
||||||
FIXED 0001272 Default Config for libnss incomplete (debian/lenny)
|
|
||||||
FIXED 0001281 Wrong open_basedir directive
|
|
||||||
FIXED 0001279 incorrect usage of escapeshellcmd
|
|
||||||
FIXED 0001269 AWStats RewriteRule is wrong
|
|
||||||
FIXED 0001277 Apache Redirect => permanent 301
|
|
||||||
FIXED 0001276 Bind Zones Not Updated on Nameserver Change
|
|
||||||
FIXED 0001275 Setting up Traffic limit is limited to 999 GB
|
|
||||||
FIXED 0001273 APS-Installer
|
|
||||||
FIXED 0001271 cant install the package magento
|
|
||||||
FIXED 0001270 xinet reltime update mistake
|
|
||||||
FIXED 0001268 SysCP Funktion: aktualisierung in Real-Time
|
|
||||||
FIXED 0001267 Domain-Aliases also create a HOST-entry
|
|
||||||
FIXED 0001266 Lighttpd has a internal limit of regex-hits which limits max amount of domain-aliases
|
|
||||||
FIXED 0001263 Cosmettic Change
|
|
||||||
FIXED 0001255 Wrong path to usage statistics under domain settings
|
|
||||||
FIXED 0001236 the cron doesnt delete user directories
|
|
||||||
FIXED 0001254 Installation no next button
|
|
||||||
FIXED 0001253 admin_customers.php line 803 / 804 contain the same
|
|
||||||
FIXED 0001250 Apache redirect to Umlautdomains does not work
|
|
||||||
FIXED 0001249 SysCP SVN(!) settings loader doesn't load some settings
|
|
||||||
FIXED 0001247 tab order problems at email forward mask
|
|
||||||
FIXED 0001246 wrong variable assigned in /templates/admin/customers/customers_add.tpl
|
|
||||||
FIXED 0001239 awstats configs get cluttered up after domain deletion
|
|
||||||
FIXED 0001228 Domain deletion fails
|
|
||||||
FIXED 0001233 Display errors when amount of FTP or Mail Traffic is larger than HTTP traffic
|
|
||||||
FIXED 0001122 Field members of table ftp_groups not updated correctly when customer deletes ftp user
|
|
||||||
FIXED 0001215 php.ini: open_basedir error
|
|
||||||
FIXED 0001223 Postfix proposed SQL-query in mysql-virtual_alias_maps.cf: use TRIM()
|
|
||||||
FIXED 0001221 syscp xinet.d - no need to edit /etc/services
|
|
||||||
FIXED 0001217 SysCP Realtime Support
|
|
||||||
FIXED 0001209 APS crashs when installing magento
|
|
||||||
FIXED 0001210 Add start- and endtime to autoresponder
|
|
||||||
FIXED 0001185 Autoreponder - send mails via sendmail to set correct Return-Path header
|
|
||||||
FIXED 0001201 Virtualusers conflict with local users when using libnss-mysql
|
|
||||||
FIXED 0001203 Add check for PHP version and required PHP modules in install script
|
|
||||||
FIXED 0001013 lighttpd - every customer should have his own php.ini
|
|
||||||
FIXED 0001113 realtime functionality broken
|
|
||||||
FIXED 0001080 host of third level gets overridden by second-level when wwwserveralias is not set on lighttpd
|
|
||||||
FIXED 0001159 serveral errors for lighttpd
|
|
||||||
FIXED 0001181 lighttpd cronjob config for subdomains is empty
|
|
||||||
FIXED 0001176 libnss-mysql and conflicting usernames/groups
|
|
||||||
FIXED 0001154 Wrong configuration set with AWstats an fcgi
|
|
||||||
FIXED 0001149 Create a Configuration-Option for SPF Records in Zonefiles
|
|
||||||
FIXED 0001095 lighttpd - redirection - "/" slash is added to end of url
|
|
||||||
FIXED 0001148 Show info for inactive modifications
|
|
||||||
FIXED 0001051 include_shell issue in lighttpd 1.4.20
|
|
||||||
--------------------------------------------------------------------------------------------------------------
|
|
||||||
WONFIX 0001278 Customer and domain directories are not created
|
|
||||||
WONTFIX 0001056 Need extra payment methods
|
|
||||||
WONTFIX 0001262 Currency type modification.
|
|
||||||
WONTFIX 0001257 Fee is recalculated with current contract data although interval is over
|
|
||||||
WONTFIX 0001260 2x F5 causes bigger fonts
|
|
||||||
WONTFIX 0001259 contract-changes optional with cron to the end of the interval
|
|
||||||
WONTFIX 0001258 Make invoices immediately
|
|
||||||
WONTFIX 0001252 Backup Cronjob for Customers
|
|
||||||
WONTFIX 0001248 blog.syscp.org
|
|
||||||
WONTFIX 0001243 Wrong uid and gid for php-fcgi-starter
|
|
||||||
WONTIFX 0001241 Patch for facilate customizing syscp
|
|
||||||
WONTFIX 0001227 Error on fixing invoices with credit notes
|
|
||||||
WONTFIX 0001039 Additional text field for infos in customers "Contact Data"
|
|
||||||
WONTFIX 0001187 additional Invoices
|
|
||||||
WONTFIX 0001059 Billing - Create contract - Filename should contain customername
|
|
||||||
WONTFIX 0001112 customers should be able to create custom cronjobs
|
|
||||||
WONTFIX 0001136 Configuration of "dead" mail adresses
|
|
||||||
WONTFIX 0001134 Allow selection of a default apache page / provide access to syscp
|
|
||||||
WONTFIX 0001104 Listen Configuration should contain a warning for debian
|
|
||||||
WONTFIX 0001098 Possibillity to dissable "Catchall" for mails
|
|
||||||
WONTFIX 0001033 Cron-Tasks: creating of php.ini
|
|
||||||
--------------------------------------------------------------------------------------------------------------
|
|
||||||
0001274 Option to mark a Domain as Subdomain possible or not
|
|
||||||
0001280 deb packet 1.4.2.1-2 fu*ked
|
|
||||||
0001041 Customer should have access to his webserver logs.
|
|
||||||
0001261 No e-mail on 90% traffic
|
|
||||||
0001120 Missing function to calculate the mail traffic
|
|
||||||
0001244 customer view too wide for 1024x768 resolutions
|
|
||||||
0001229 subdomains and Own vHost-Settings
|
|
||||||
0001251 possibility to manage WebDAV config in SysCP
|
|
||||||
0001042 Webalizer dir should not be deletable
|
|
||||||
0001245 Password Protect /awstats/ when using awstats and fcgid
|
|
||||||
0001156 Repairing use of awstats and awstats-icons with fcgi
|
|
||||||
0001242 When email qouta is enabled, you cannot add more resources to a client.
|
|
||||||
0001240 Wrong php.ini for subdomains with fastCGI
|
|
||||||
0001224 APS installer not installing the aps applications properly, such as WordPress and WebCalender
|
|
||||||
0001017 Proftpd - Quota should be added
|
|
||||||
0001016 Pureftpd - quota should be added
|
|
||||||
0001206 crontabs not terminating
|
|
||||||
0001212 retain form input
|
|
||||||
0001211 Generated MySQL username too long
|
|
||||||
0001208 HTML Tags in Support Tickets
|
|
||||||
0001207 FTP Passw<73>rter mit Umlauten
|
|
||||||
0001204 php5-suhosin
|
|
||||||
0001198 More online help wanted
|
|
||||||
0001189 Autoresponder: support for multiline "From:" headers
|
|
||||||
0001186 subdomains and php configuration
|
|
||||||
0001079 Protected dir only works only after a force-reload on lighttpd
|
|
||||||
0001034 Cron-Tasks: apache-logfiles directory
|
|
||||||
0001150 Wrong configuration of awstats
|
|
||||||
0001083 awstats.model.conf.syscp should include awstats.conf
|
|
||||||
0001152 apache certificate is not generated
|
|
||||||
0001151 When cronjob generates new dkim files a mail is sent to root
|
|
||||||
0001005 Force user to add POP3 Account before he can add e-mail adresses
|
|
||||||
0001142 Default index.html should be placed in a sub-directory of a domain.
|
|
||||||
0001140 Replace variables in defaut_vhost config
|
|
||||||
0001138 old db-data is lost when mysqldump is not within open_basedir
|
|
||||||
0001135 dkim refers to non-existing domainkey entry in DNS zone file.
|
|
||||||
0001133 Default Configuration doesn't allow Exim4 to forward Mails to the outside world
|
|
||||||
0001128 More targets for "Write a message" tool
|
|
||||||
0001131 Add FreeBSD configuration files to the base tarball.
|
|
||||||
0001130 Wrong number format in e.g. traffic display.
|
|
||||||
0001129 Allow selection of automatic creation of a webmail.<domain>.<tld>, phpmyadmin. ..., webftp. ...
|
|
||||||
0001127 Versioning of configuration templates.
|
|
||||||
0001116 Please add tooltips to adminCP
|
|
||||||
0001114 Password query for Awstats statistics
|
|
||||||
0001111 add login for e-mail and ftp users to let them change their own settings
|
|
||||||
0001109 no mail traffic is shown and calculated without third party module
|
|
||||||
0001101 Default mail qouta - possibillity to set new accounts to amount of webspace
|
|
||||||
0001084 Add select box to change special logfile setting on domain edit
|
|
||||||
0001058 Add id/class attributs in <img> tag (left navigation)
|
|
||||||
0001043 When creating customer it should also be possible to add domains (merge customer & domain menu)
|
|
||||||
0001035 PHP-Error-Log | Adminpanel & CronTask
|
|
||||||
0001010 Send info mail to customer if webspace is exceeded
|
|
||||||
0001004 Ressources / Domains - Standard subdomains should be separrated from normal Domains
|
|
||||||
9999999 Write a complete statement about what froxlor is and why we do this (atari)
|
|
||||||
@@ -77,6 +77,24 @@ return array(
|
|||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
|
'panel_adminmail_defname' => array(
|
||||||
|
'label' => $lng['serversettings']['adminmail_defname'],
|
||||||
|
'settinggroup' => 'panel',
|
||||||
|
'varname' => 'adminmail_defname',
|
||||||
|
'type' => 'string',
|
||||||
|
'default' => 'Froxlor Administrator',
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
|
'panel_adminmail_return' => array(
|
||||||
|
'label' => $lng['serversettings']['adminmail_return'],
|
||||||
|
'settinggroup' => 'panel',
|
||||||
|
'varname' => 'adminmail_return',
|
||||||
|
'type' => 'string',
|
||||||
|
'string_type' => 'mail',
|
||||||
|
'string_emptyallowed' => true,
|
||||||
|
'default' => '',
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
'panel_decimal_places' => array(
|
'panel_decimal_places' => array(
|
||||||
'label' => $lng['serversettings']['decimal_places'],
|
'label' => $lng['serversettings']['decimal_places'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
|
|||||||
@@ -54,6 +54,14 @@ return array(
|
|||||||
'default' => 900,
|
'default' => 900,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
|
'panel_password_min_length' => array(
|
||||||
|
'label' => $lng['serversettings']['panel_password_min_length'],
|
||||||
|
'settinggroup' => 'panel',
|
||||||
|
'varname' => 'password_min_length',
|
||||||
|
'type' => 'int',
|
||||||
|
'default' => 0,
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
'customer_accountprefix' => array(
|
'customer_accountprefix' => array(
|
||||||
'label' => $lng['serversettings']['accountprefix'],
|
'label' => $lng['serversettings']['accountprefix'],
|
||||||
'settinggroup' => 'customer',
|
'settinggroup' => 'customer',
|
||||||
@@ -95,6 +103,14 @@ return array(
|
|||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
|
'dependency' => array(
|
||||||
|
'fieldname' => 'panel_allow_preset_admin',
|
||||||
|
'fielddata' => array(
|
||||||
|
'settinggroup' => 'panel',
|
||||||
|
'varname' => 'allow_preset_admin',
|
||||||
|
),
|
||||||
|
'onlyif' => 0
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'panel_allow_preset_admin' => array(
|
'panel_allow_preset_admin' => array(
|
||||||
'label' => $lng['serversettings']['allow_password_reset_admin'],
|
'label' => $lng['serversettings']['allow_password_reset_admin'],
|
||||||
@@ -103,6 +119,14 @@ return array(
|
|||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
|
'dependency' => array(
|
||||||
|
'fieldname' => 'panel_allow_preset',
|
||||||
|
'fielddata' => array(
|
||||||
|
'settinggroup' => 'panel',
|
||||||
|
'varname' => 'allow_preset',
|
||||||
|
),
|
||||||
|
'onlyif' => 1
|
||||||
|
)
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -58,6 +58,14 @@ return array(
|
|||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingHostname',
|
'save_method' => 'storeSettingHostname',
|
||||||
),
|
),
|
||||||
|
'system_stdsubdomain' => array(
|
||||||
|
'label' => $lng['serversettings']['stdsubdomainhost'],
|
||||||
|
'settinggroup' => 'system',
|
||||||
|
'varname' => 'stdsubdomain',
|
||||||
|
'type' => 'string',
|
||||||
|
'default' => '',
|
||||||
|
'save_method' => 'storeSettingHostname',
|
||||||
|
),
|
||||||
'system_mysql_access_host' => array(
|
'system_mysql_access_host' => array(
|
||||||
'label' => $lng['serversettings']['mysql_access_host'],
|
'label' => $lng['serversettings']['mysql_access_host'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
@@ -71,7 +79,7 @@ return array(
|
|||||||
'label' => $lng['serversettings']['system_realtime_port'],
|
'label' => $lng['serversettings']['system_realtime_port'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'realtime_port',
|
'varname' => 'realtime_port',
|
||||||
'type' => 'int',
|
'type' => (function_exists('socket_create') ? 'int' : 'hidden'),
|
||||||
'int_max' => 65535,
|
'int_max' => 65535,
|
||||||
'default' => 0,
|
'default' => 0,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
@@ -85,6 +93,14 @@ return array(
|
|||||||
'default' => 'html',
|
'default' => 'html',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
|
'system_store_index_file_subs' => array(
|
||||||
|
'label' => $lng['serversettings']['system_store_index_file_subs'],
|
||||||
|
'settinggroup' => 'system',
|
||||||
|
'varname' => 'store_index_file_subs',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => true,
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
'system_httpuser' => array(
|
'system_httpuser' => array(
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'httpuser',
|
'varname' => 'httpuser',
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ return array(
|
|||||||
'option_mode' => 'one',
|
'option_mode' => 'one',
|
||||||
'option_options' => array('apache2' => 'Apache 2', 'lighttpd' => 'ligHTTPd'),
|
'option_options' => array('apache2' => 'Apache 2', 'lighttpd' => 'ligHTTPd'),
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
|
'overview_option' => true
|
||||||
),
|
),
|
||||||
'system_apacheconf_vhost' => array(
|
'system_apacheconf_vhost' => array(
|
||||||
'label' => $lng['serversettings']['apacheconf_vhost'],
|
'label' => $lng['serversettings']['apacheconf_vhost'],
|
||||||
@@ -111,6 +112,64 @@ return array(
|
|||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
|
'defaultwebsrverrhandler_enabled' => array(
|
||||||
|
'label' => $lng['serversettings']['defaultwebsrverrhandler_enabled'],
|
||||||
|
'settinggroup' => 'defaultwebsrverrhandler',
|
||||||
|
'varname' => 'enabled',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => false,
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
|
'defaultwebsrverrhandler_err401' => array(
|
||||||
|
'label' => $lng['serversettings']['defaultwebsrverrhandler_err401'],
|
||||||
|
'settinggroup' => 'defaultwebsrverrhandler',
|
||||||
|
'varname' => 'err401',
|
||||||
|
'type' => 'string',
|
||||||
|
'default' => '',
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
|
'defaultwebsrverrhandler_err403' => array(
|
||||||
|
'label' => $lng['serversettings']['defaultwebsrverrhandler_err403'],
|
||||||
|
'settinggroup' => 'defaultwebsrverrhandler',
|
||||||
|
'varname' => 'err403',
|
||||||
|
'type' => 'string',
|
||||||
|
'default' => '',
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
|
'defaultwebsrverrhandler_err404' => array(
|
||||||
|
'label' => $lng['serversettings']['defaultwebsrverrhandler_err404'],
|
||||||
|
'settinggroup' => 'defaultwebsrverrhandler',
|
||||||
|
'varname' => 'err404',
|
||||||
|
'type' => 'string',
|
||||||
|
'default' => '',
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
|
'defaultwebsrverrhandler_err500' => array(
|
||||||
|
'label' => $lng['serversettings']['defaultwebsrverrhandler_err500'],
|
||||||
|
'settinggroup' => 'defaultwebsrverrhandler',
|
||||||
|
'varname' => 'err500',
|
||||||
|
'type' => 'string',
|
||||||
|
'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(
|
'ssl' => array(
|
||||||
|
|||||||
@@ -40,45 +40,27 @@ return array(
|
|||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_awstats_domain_file' => array(
|
|
||||||
'label' => $lng['serversettings']['awstats_domain_file'],
|
|
||||||
'settinggroup' => 'system',
|
|
||||||
'varname' => 'awstats_domain_file',
|
|
||||||
'type' => 'string',
|
|
||||||
'string_type' => 'dir',
|
|
||||||
'default' => '/etc/awstats/',
|
|
||||||
'save_method' => 'storeSettingField',
|
|
||||||
),
|
|
||||||
'system_awstats_model_file' => array(
|
|
||||||
'label' => $lng['serversettings']['awstats_model_file'],
|
|
||||||
'settinggroup' => 'system',
|
|
||||||
'varname' => 'awstats_model_file',
|
|
||||||
'type' => 'string',
|
|
||||||
'string_type' => 'file',
|
|
||||||
'default' => '/etc/awstats/awstats.model.conf.syscp',
|
|
||||||
'save_method' => 'storeSettingField',
|
|
||||||
),
|
|
||||||
'system_awstats_path' => array(
|
'system_awstats_path' => array(
|
||||||
'label' => $lng['serversettings']['awstats_path'],
|
'label' => $lng['serversettings']['awstats_path'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'awstats_path',
|
'varname' => 'awstats_path',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'default' => '/usr/share/awstats/VERSION/webroot/cgi-bin/',
|
'default' => '/usr/bin/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_awstats_updateall_command' => array(
|
'system_awstats_conf' => array(
|
||||||
'label' => $lng['serversettings']['awstats_updateall_command'],
|
'label' => $lng['serversettings']['awstats_conf'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'awstats_updateall_command',
|
'varname' => 'awstats_conf',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'file',
|
'string_type' => 'dir',
|
||||||
'default' => '/usr/bin/awstats_updateall.pl',
|
'default' => '/etc/awstats/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
)
|
||||||
),
|
)
|
||||||
),
|
)
|
||||||
),
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -75,7 +75,7 @@ return array(
|
|||||||
'default' => 100,
|
'default' => 100,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'systen_autoresponder_enabled' => array(
|
'system_autoresponder_enabled' => array(
|
||||||
'label' => $lng['serversettings']['autoresponder_active'],
|
'label' => $lng['serversettings']['autoresponder_active'],
|
||||||
'settinggroup' => 'autoresponder',
|
'settinggroup' => 'autoresponder',
|
||||||
'varname' => 'autoresponder_active',
|
'varname' => 'autoresponder_active',
|
||||||
@@ -84,7 +84,7 @@ return array(
|
|||||||
'cronmodule' => 'froxlor/autoresponder',
|
'cronmodule' => 'froxlor/autoresponder',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'systen_last_autoresponder_run' => array(
|
'system_last_autoresponder_run' => array(
|
||||||
'settinggroup' => 'autoresponder',
|
'settinggroup' => 'autoresponder',
|
||||||
'varname' => 'last_autoresponder_run',
|
'varname' => 'last_autoresponder_run',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
|
|||||||
40
actions/admin/settings/155.ftpserver.php
Normal file
40
actions/admin/settings/155.ftpserver.php
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?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 Settings
|
||||||
|
* @version $Id: 220.ftpserver.php 1 2010-04-07 10:00:00Z monotek $
|
||||||
|
*/
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'groups' => array(
|
||||||
|
'ftpserver' => array(
|
||||||
|
'title' => $lng['admin']['ftpserversettings'],
|
||||||
|
'fields' => array(
|
||||||
|
'ftpserver' => array(
|
||||||
|
'label' => $lng['admin']['ftpserver'],
|
||||||
|
'settinggroup' => 'system',
|
||||||
|
'varname' => 'ftpserver',
|
||||||
|
'type' => 'option',
|
||||||
|
'default' => 'proftpd',
|
||||||
|
'option_mode' => 'one',
|
||||||
|
'option_options' => array('proftpd' => 'Proftpd', 'pureftpd' => 'Pureftpd'),
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -59,6 +59,16 @@ return array(
|
|||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'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_max' => 2147483647, /* integer max */
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ return array(
|
|||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
|
'overview_option' => true
|
||||||
),
|
),
|
||||||
'logger_severity' => array(
|
'logger_severity' => array(
|
||||||
'label' => $lng['serversettings']['logger']['severity'],
|
'label' => $lng['serversettings']['logger']['severity'],
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ return array(
|
|||||||
'varname' => 'use_dkim',
|
'varname' => 'use_dkim',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||||
|
'overview_option' => true
|
||||||
),
|
),
|
||||||
'dkim_prefix' => array(
|
'dkim_prefix' => array(
|
||||||
'label' => $lng['dkim']['dkim_prefix'],
|
'label' => $lng['dkim']['dkim_prefix'],
|
||||||
@@ -56,6 +57,63 @@ return array(
|
|||||||
'default' => 'dkim-keys.conf',
|
'default' => 'dkim-keys.conf',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
|
'dkim_algorithm' => array(
|
||||||
|
'label' => $lng['dkim']['dkim_algorithm'],
|
||||||
|
'settinggroup' => 'dkim',
|
||||||
|
'varname' => 'dkim_algorithm',
|
||||||
|
'type' => 'option',
|
||||||
|
'default' => 'all',
|
||||||
|
'option_mode' => 'multiple',
|
||||||
|
'option_options' => array('all' => 'All', 'sha1' => 'SHA1', 'sha256' => 'SHA256'),
|
||||||
|
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||||
|
),
|
||||||
|
'dkim_servicetype' => array(
|
||||||
|
'label' => $lng['dkim']['dkim_servicetype'],
|
||||||
|
'settinggroup' => 'dkim',
|
||||||
|
'varname' => 'dkim_servicetype',
|
||||||
|
'type' => 'option',
|
||||||
|
'default' => '0',
|
||||||
|
'option_mode' => 'one',
|
||||||
|
'option_options' => array('0' => 'All', '1' => 'E-Mail'),
|
||||||
|
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||||
|
),
|
||||||
|
'dkim_keylength' => array(
|
||||||
|
'label' => $lng['dkim']['dkim_keylength'],
|
||||||
|
'settinggroup' => 'dkim',
|
||||||
|
'varname' => 'dkim_keylength',
|
||||||
|
'type' => 'option',
|
||||||
|
'default' => '1024',
|
||||||
|
'option_mode' => 'one',
|
||||||
|
'option_options' => array('1024' => '1024 Bit', '2048' => '2048 Bit'),
|
||||||
|
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||||
|
),
|
||||||
|
'dkim_notes' => array(
|
||||||
|
'label' => $lng['dkim']['dkim_notes'],
|
||||||
|
'settinggroup' => 'dkim',
|
||||||
|
'varname' => 'dkim_notes',
|
||||||
|
'type' => 'string',
|
||||||
|
'string_regexp' => '/^[a-z0-9\._]+$/i',
|
||||||
|
'default' => '',
|
||||||
|
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||||
|
),
|
||||||
|
'dkim_add_adsp' => array(
|
||||||
|
'label' => $lng['dkim']['dkim_add_adsp'],
|
||||||
|
'settinggroup' => 'dkim',
|
||||||
|
'varname' => 'dkim_add_adsp',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => true,
|
||||||
|
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||||
|
),
|
||||||
|
'dkim_add_adsppolicy' => array(
|
||||||
|
'label' => $lng['dkim']['dkim_add_adsppolicy'],
|
||||||
|
'settinggroup' => 'dkim',
|
||||||
|
'varname' => 'dkim_add_adsppolicy',
|
||||||
|
'type' => 'option',
|
||||||
|
'default' => '1',
|
||||||
|
'option_mode' => 'one',
|
||||||
|
'option_options' => array('0' => 'Unknown', '1' => 'All', '2' => 'Discardable'),
|
||||||
|
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||||
|
),
|
||||||
'dkimrestart_command' => array(
|
'dkimrestart_command' => array(
|
||||||
'label' => $lng['dkim']['dkimrestart_command'],
|
'label' => $lng['dkim']['dkimrestart_command'],
|
||||||
'settinggroup' => 'dkim',
|
'settinggroup' => 'dkim',
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ return array(
|
|||||||
'varname' => 'use_spf',
|
'varname' => 'use_spf',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField',
|
||||||
|
'overview_option' => true
|
||||||
),
|
),
|
||||||
'spf_entry' => array(
|
'spf_entry' => array(
|
||||||
'label' => $lng['spf']['spf_entry'],
|
'label' => $lng['spf']['spf_entry'],
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ return array(
|
|||||||
'default' => false,
|
'default' => false,
|
||||||
'cronmodule' => 'froxlor/ticket',
|
'cronmodule' => 'froxlor/ticket',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
|
'overview_option' => true
|
||||||
),
|
),
|
||||||
'ticket_noreply_email' => array(
|
'ticket_noreply_email' => array(
|
||||||
'label' => $lng['serversettings']['ticket']['noreply_email'],
|
'label' => $lng['serversettings']['ticket']['noreply_email'],
|
||||||
@@ -124,6 +125,16 @@ return array(
|
|||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
),
|
),
|
||||||
|
'ticket_default_priority' => array(
|
||||||
|
'label' => $lng['serversettings']['ticket']['default_priority'],
|
||||||
|
'settinggroup' => 'ticket',
|
||||||
|
'varname' => 'default_priority',
|
||||||
|
'type' => 'option',
|
||||||
|
'default' => 2,
|
||||||
|
'option_mode' => 'one',
|
||||||
|
'option_options' => array(1 => $lng['ticket']['unf_high'], 2 => $lng['ticket']['unf_normal'], 3 => $lng['ticket']['unf_low']),
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ return array(
|
|||||||
'default' => false,
|
'default' => false,
|
||||||
'cronmodule' => 'froxlor/aps',
|
'cronmodule' => 'froxlor/aps',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
|
'overview_option' => true
|
||||||
),
|
),
|
||||||
'aps_items_per_page' => array(
|
'aps_items_per_page' => array(
|
||||||
'label' => $lng['aps']['packages_per_page'],
|
'label' => $lng['aps']['packages_per_page'],
|
||||||
|
|||||||
@@ -100,6 +100,16 @@ return array(
|
|||||||
'default' => 250,
|
'default' => 250,
|
||||||
'save_method' => 'storeSettingField',
|
'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',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ if($page == 'admins'
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$admincount = $db->num_rows($result);
|
||||||
eval("echo \"" . getTemplate("admins/admins") . "\";");
|
eval("echo \"" . getTemplate("admins/admins") . "\";");
|
||||||
}
|
}
|
||||||
elseif($action == 'su')
|
elseif($action == 'su')
|
||||||
@@ -154,6 +155,7 @@ if($page == 'admins'
|
|||||||
|
|
||||||
$loginname = validate($_POST['loginname'], 'loginname');
|
$loginname = validate($_POST['loginname'], 'loginname');
|
||||||
$password = validate($_POST['admin_password'], 'password');
|
$password = validate($_POST['admin_password'], 'password');
|
||||||
|
$password = validatePassword($password);
|
||||||
$def_language = validate($_POST['def_language'], 'default language');
|
$def_language = validate($_POST['def_language'], 'default language');
|
||||||
$customers = intval_ressource($_POST['customers']);
|
$customers = intval_ressource($_POST['customers']);
|
||||||
|
|
||||||
@@ -560,6 +562,7 @@ if($page == 'admins'
|
|||||||
{
|
{
|
||||||
if($password != '')
|
if($password != '')
|
||||||
{
|
{
|
||||||
|
$password = validatePassword($password);
|
||||||
$password = md5($password);
|
$password = md5($password);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
define('AREA', 'admin');
|
define('AREA', 'admin');
|
||||||
require ("./lib/init.php");
|
require ("./lib/init.php");
|
||||||
require ("./lib/class_apsparser.php");
|
|
||||||
$Id = 0;
|
$Id = 0;
|
||||||
|
|
||||||
if(isset($_GET['id']))$Id = (int)$_GET['id'];
|
if(isset($_GET['id']))$Id = (int)$_GET['id'];
|
||||||
|
|||||||
@@ -95,9 +95,9 @@ if($userinfo['change_serversettings'] == '1')
|
|||||||
'<VIRTUAL_MAILBOX_BASE>' => $settings['system']['vmail_homedir'],
|
'<VIRTUAL_MAILBOX_BASE>' => $settings['system']['vmail_homedir'],
|
||||||
'<VIRTUAL_UID_MAPS>' => $settings['system']['vmail_uid'],
|
'<VIRTUAL_UID_MAPS>' => $settings['system']['vmail_uid'],
|
||||||
'<VIRTUAL_GID_MAPS>' => $settings['system']['vmail_gid'],
|
'<VIRTUAL_GID_MAPS>' => $settings['system']['vmail_gid'],
|
||||||
'<AWSTATS_PATH>' => $settings['system']['awstats_path'],
|
|
||||||
'<SSLPROTOCOLS>' => ($settings['system']['use_ssl'] == '1') ? 'imaps pop3s' : '',
|
'<SSLPROTOCOLS>' => ($settings['system']['use_ssl'] == '1') ? 'imaps pop3s' : '',
|
||||||
'<REALTIME_PORT>' => $settings['system']['realtime_port']
|
'<REALTIME_PORT>' => $settings['system']['realtime_port'],
|
||||||
|
'<CUSTOMER_TMP>' => ($settings['system']['mod_fcgid_tmpdir'] != '') ? makeCorrectDir($settings['system']['mod_fcgid_tmpdir']) : '/tmp/'
|
||||||
);
|
);
|
||||||
$files = '';
|
$files = '';
|
||||||
$configpage = '';
|
$configpage = '';
|
||||||
@@ -110,6 +110,7 @@ if($userinfo['change_serversettings'] == '1')
|
|||||||
if(is_array($value))
|
if(is_array($value))
|
||||||
{
|
{
|
||||||
$commands = implode("\n", $value);
|
$commands = implode("\n", $value);
|
||||||
|
$commands = str_replace("\n\n", "\n", $commands);
|
||||||
|
|
||||||
if($commands != '')
|
if($commands != '')
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -75,12 +75,6 @@ if($page == 'cronjobs'
|
|||||||
|
|
||||||
$description = $lng['crondesc'][$row['desc_lng_key']];
|
$description = $lng['crondesc'][$row['desc_lng_key']];
|
||||||
|
|
||||||
/*
|
|
||||||
* don't allow deletion of 'froxlor' cronjobs
|
|
||||||
*/
|
|
||||||
$vendor_a = explode('/', $row['module']);
|
|
||||||
$vendor = $vendor_a[0];
|
|
||||||
|
|
||||||
eval("\$crons.=\"" . getTemplate("cronjobs/cronjobs_cronjob") . "\";");
|
eval("\$crons.=\"" . getTemplate("cronjobs/cronjobs_cronjob") . "\";");
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
@@ -94,21 +88,68 @@ if($page == 'cronjobs'
|
|||||||
elseif($action == 'new')
|
elseif($action == 'new')
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* @TODO Finish me
|
* @TODO later
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
elseif($action == 'edit'
|
elseif($action == 'edit'
|
||||||
&& $id != 0)
|
&& $id != 0)
|
||||||
{
|
{
|
||||||
/*
|
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_CRONRUNS . "` WHERE `id`='" . (int)$id . "'");
|
||||||
* @TODO Finish me
|
|
||||||
*/
|
if ($result['cronfile'] != '')
|
||||||
|
{
|
||||||
|
if(isset($_POST['send'])
|
||||||
|
&& $_POST['send'] == 'send')
|
||||||
|
{
|
||||||
|
$isactive = intval($_POST['isactive']);
|
||||||
|
$interval_value = validate($_POST['interval_value'], 'interval_value', '/^([0-9]+)$/Di', 'stringisempty');
|
||||||
|
$interval_interval = validate($_POST['interval_interval'], 'interval_interval');
|
||||||
|
|
||||||
|
if($isactive != 1)
|
||||||
|
{
|
||||||
|
$isactive = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$interval = $interval_value.' '.strtoupper($interval_interval);
|
||||||
|
|
||||||
|
$db->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "`
|
||||||
|
SET `isactive` = '".(int)$isactive."',
|
||||||
|
`interval` = '".$interval."'
|
||||||
|
WHERE `id` = '" . (int)$id . "'");
|
||||||
|
|
||||||
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$isactive = makeyesno('isactive', '1', '0', $result['isactive']);
|
||||||
|
// interval
|
||||||
|
$interval_nfo = explode(' ', $result['interval']);
|
||||||
|
$interval_value = $interval_nfo[0];
|
||||||
|
|
||||||
|
$interval_interval = '';
|
||||||
|
$interval_interval.= makeoption($lng['cronmgmt']['seconds'], 'SECOND', $interval_nfo[1]);
|
||||||
|
$interval_interval.= makeoption($lng['cronmgmt']['minutes'], 'MINUTE', $interval_nfo[1]);
|
||||||
|
$interval_interval.= makeoption($lng['cronmgmt']['hours'], 'HOUR', $interval_nfo[1]);
|
||||||
|
$interval_interval.= makeoption($lng['cronmgmt']['days'], 'DAY', $interval_nfo[1]);
|
||||||
|
$interval_interval.= makeoption($lng['cronmgmt']['weeks'], 'WEEK', $interval_nfo[1]);
|
||||||
|
$interval_interval.= makeoption($lng['cronmgmt']['months'], 'MONTH', $interval_nfo[1]);
|
||||||
|
// end of interval
|
||||||
|
|
||||||
|
$change_cronfile = false;
|
||||||
|
if (substr($result['module'], 0, strpos($result['module'], '/')) != 'froxlor')
|
||||||
|
{
|
||||||
|
$change_cronfile = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
eval("echo \"" . getTemplate("cronjobs/cronjob_edit") . "\";");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif($action == 'delete'
|
elseif($action == 'delete'
|
||||||
&& $id != 0)
|
&& $id != 0)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* @TODO Finish me
|
* @TODO later
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ if($page == 'customers'
|
|||||||
'c.email_quota' => $lng['customer']['email_quota'],
|
'c.email_quota' => $lng['customer']['email_quota'],
|
||||||
'c.email_quota_used' => $lng['customer']['email_quota'] . ' (' . $lng['panel']['used'] . ')',
|
'c.email_quota_used' => $lng['customer']['email_quota'] . ' (' . $lng['panel']['used'] . ')',
|
||||||
'c.deactivated' => $lng['admin']['deactivated'],
|
'c.deactivated' => $lng['admin']['deactivated'],
|
||||||
|
'c.lastlogin_succ' => $lng['admin']['lastlogin_succ'],
|
||||||
'c.phpenabled' => $lng['admin']['phpenabled']
|
'c.phpenabled' => $lng['admin']['phpenabled']
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -96,6 +97,15 @@ if($page == 'customers'
|
|||||||
$row['traffic'] = round($row['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
$row['traffic'] = round($row['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||||
$row['diskspace_used'] = round($row['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
|
$row['diskspace_used'] = round($row['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
|
||||||
$row['diskspace'] = round($row['diskspace'] / 1024, $settings['panel']['decimal_places']);
|
$row['diskspace'] = round($row['diskspace'] / 1024, $settings['panel']['decimal_places']);
|
||||||
|
$last_login = ((int)$row['lastlogin_succ'] == 0) ? $lng['panel']['neverloggedin'] : date('d.m.Y', $row['lastlogin_succ']);
|
||||||
|
|
||||||
|
$column_style = '';
|
||||||
|
if($row['loginfail_count'] >= $settings['login']['maxloginattempts']
|
||||||
|
&& $row['lastlogin_fail'] > (time() - $settings['login']['deactivatetime'])
|
||||||
|
) {
|
||||||
|
$column_style = ' style="background-color: #f99122;"';
|
||||||
|
}
|
||||||
|
|
||||||
$row = str_replace_array('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps tickets subdomains');
|
$row = str_replace_array('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps tickets subdomains');
|
||||||
$row = htmlentities_array($row);
|
$row = htmlentities_array($row);
|
||||||
eval("\$customers.=\"" . getTemplate("customers/customers_customer") . "\";");
|
eval("\$customers.=\"" . getTemplate("customers/customers_customer") . "\";");
|
||||||
@@ -105,6 +115,7 @@ if($page == 'customers'
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$customercount = $db->num_rows($result);
|
||||||
eval("echo \"" . getTemplate("customers/customers") . "\";");
|
eval("echo \"" . getTemplate("customers/customers") . "\";");
|
||||||
}
|
}
|
||||||
elseif($action == 'su'
|
elseif($action == 'su'
|
||||||
@@ -174,9 +185,30 @@ if($page == 'customers'
|
|||||||
$db->query("DELETE FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `customerid`='" . (int)$id . "'");
|
$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_USERS . "` WHERE `customerid`='" . (int)$id . "'");
|
||||||
$db->query("DELETE FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`='" . (int)$id . "'");
|
$db->query("DELETE FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`='" . (int)$id . "'");
|
||||||
|
$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_GROUPS . "` WHERE `customerid`='" . (int)$id . "'");
|
||||||
$db->query("DELETE FROM `" . TABLE_FTP_USERS . "` 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 . "'");
|
$db->query("DELETE FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid`='" . (int)$id . "'");
|
||||||
|
|
||||||
|
// 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 = "UPDATE `" . TABLE_PANEL_ADMINS . "` SET `customers_used` = `customers_used` - 1 ";
|
||||||
$admin_update_query.= ", `domains_used` = `domains_used` - 0" . (int)($domains_deleted - $result['subdomains_used']);
|
$admin_update_query.= ", `domains_used` = `domains_used` - 0" . (int)($domains_deleted - $result['subdomains_used']);
|
||||||
|
|
||||||
@@ -220,6 +252,11 @@ if($page == 'customers'
|
|||||||
$admin_update_query.= ", `tickets_used` = `tickets_used` - 0" . (int)$result['tickets'];
|
$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')
|
if(($result['diskspace'] / 1024) != '-1')
|
||||||
{
|
{
|
||||||
$admin_update_query.= ", `diskspace_used` = `diskspace_used` - 0" . (int)$result['diskspace'];
|
$admin_update_query.= ", `diskspace_used` = `diskspace_used` - 0" . (int)$result['diskspace'];
|
||||||
@@ -378,7 +415,8 @@ if($page == 'customers'
|
|||||||
}
|
}
|
||||||
|
|
||||||
$createstdsubdomain = intval($_POST['createstdsubdomain']);
|
$createstdsubdomain = intval($_POST['createstdsubdomain']);
|
||||||
$password = validate($_POST['customer_password'], 'password');
|
$password = validate($_POST['new_customer_password'], 'password');
|
||||||
|
$password = validatePassword($password);
|
||||||
$sendpassword = intval($_POST['sendpassword']);
|
$sendpassword = intval($_POST['sendpassword']);
|
||||||
$phpenabled = intval($_POST['phpenabled']);
|
$phpenabled = intval($_POST['phpenabled']);
|
||||||
$diskspace = $diskspace * 1024;
|
$diskspace = $diskspace * 1024;
|
||||||
@@ -431,11 +469,11 @@ if($page == 'customers'
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(isset($_POST['loginname'])
|
if(isset($_POST['new_loginname'])
|
||||||
&& $_POST['loginname'] != '')
|
&& $_POST['new_loginname'] != '')
|
||||||
{
|
{
|
||||||
$accountnumber = intval($settings['system']['lastaccountnumber']);
|
$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
|
// Accounts which match systemaccounts are not allowed, filtering them
|
||||||
|
|
||||||
@@ -567,24 +605,37 @@ if($page == 'customers'
|
|||||||
$htpasswdPassword = crypt($password);
|
$htpasswdPassword = crypt($password);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` " . "(`customerid`, `username`, `password`, `path`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($htpasswdPassword) . "', '" . $db->escape(makeCorrectDir($documentroot . '/webalizer/')) . "')");
|
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added webalizer htpasswd for user '" . $loginname . "'");
|
|
||||||
|
|
||||||
if($settings['system']['awstats_enabled'] == '1')
|
if($settings['system']['awstats_enabled'] == '1')
|
||||||
{
|
{
|
||||||
$db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` " . "(`customerid`, `username`, `password`, `path`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($htpasswdPassword) . "', '" . $db->escape(makeCorrectDir($documentroot . '/awstats/')) . "')");
|
$db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` " . "(`customerid`, `username`, `password`, `path`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($htpasswdPassword) . "', '" . $db->escape(makeCorrectDir($documentroot . '/awstats/')) . "')");
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added awstats htpasswd for user '" . $loginname . "'");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added awstats htpasswd for user '" . $loginname . "'");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` " . "(`customerid`, `username`, `password`, `path`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($htpasswdPassword) . "', '" . $db->escape(makeCorrectDir($documentroot . '/webalizer/')) . "')");
|
||||||
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added webalizer htpasswd for user '" . $loginname . "'");
|
||||||
|
}
|
||||||
|
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
$result = $db->query("INSERT INTO `" . TABLE_FTP_USERS . "` " . "(`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($documentroot) . "', 'y', '" . (int)$guid . "', '" . (int)$guid . "')");
|
$result = $db->query("INSERT INTO `" . TABLE_FTP_USERS . "` " . "(`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($documentroot) . "', 'y', '" . (int)$guid . "', '" . (int)$guid . "')");
|
||||||
$result = $db->query("INSERT INTO `" . TABLE_FTP_GROUPS . "` " . "(`customerid`, `groupname`, `gid`, `members`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($guid) . "', '" . $db->escape($loginname) . "')");
|
$result = $db->query("INSERT INTO `" . TABLE_FTP_GROUPS . "` " . "(`customerid`, `groupname`, `gid`, `members`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($guid) . "', '" . $db->escape($loginname) . "')");
|
||||||
|
$result = $db->query("INSERT INTO `" . TABLE_FTP_QUOTATALLIES . "` (`name`, `quota_type`, `bytes_in_used`, `bytes_out_used`, `bytes_xfer_used`, `files_in_used`, `files_out_used`, `files_xfer_used`) VALUES ('" . $db->escape($loginname) . "', 'user', '0', '0', '0', '0', '0', '0')");
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added ftp-account for user '" . $loginname . "'");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added ftp-account for user '" . $loginname . "'");
|
||||||
|
|
||||||
if($createstdsubdomain == '1')
|
if($createstdsubdomain == '1')
|
||||||
{
|
{
|
||||||
|
if (isset($settings['system']['stdsubdomain'])
|
||||||
|
&& $settings['system']['stdsubdomain'] != ''
|
||||||
|
) {
|
||||||
|
$_stdsubdomain = $loginname . '.' . $settings['system']['stdsubdomain'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$_stdsubdomain = $loginname . '.' . $settings['system']['hostname'];
|
||||||
|
}
|
||||||
|
|
||||||
$db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET " .
|
$db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET " .
|
||||||
"`domain` = '". $db->escape($loginname . '.' . $settings['system']['hostname']) . "', " .
|
"`domain` = '". $db->escape($_stdsubdomain) . "', " .
|
||||||
"`customerid` = '" . (int)$customerid . "', " .
|
"`customerid` = '" . (int)$customerid . "', " .
|
||||||
"`adminid` = '" . (int)$userinfo['adminid'] . "', " .
|
"`adminid` = '" . (int)$userinfo['adminid'] . "', " .
|
||||||
"`parentdomainid` = '-1', " .
|
"`parentdomainid` = '-1', " .
|
||||||
@@ -622,23 +673,22 @@ if($page == 'customers'
|
|||||||
$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`=\'createcustomer_mailbody\'');
|
$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`=\'createcustomer_mailbody\'');
|
||||||
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['createcustomer']['mailbody']), $replace_arr));
|
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['createcustomer']['mailbody']), $replace_arr));
|
||||||
|
|
||||||
$mail->From = $userinfo['email'];
|
$_mailerror = false;
|
||||||
$mail->FromName = $userinfo['name'];
|
try {
|
||||||
$mail->Subject = $mail_subject;
|
$mail->Subject = $mail_subject;
|
||||||
$mail->Body = $mail_body;
|
$mail->AltBody = $mail_body;
|
||||||
|
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
||||||
$mail->AddAddress($email, getCorrectUserSalutation(array('firstname' => $firstname, 'name' => $name, 'company' => $company)));
|
$mail->AddAddress($email, getCorrectUserSalutation(array('firstname' => $firstname, 'name' => $name, 'company' => $company)));
|
||||||
|
$mail->Send();
|
||||||
if(!$mail->Send())
|
} catch(phpmailerException $e) {
|
||||||
{
|
$mailerr_msg = $e->errorMessage();
|
||||||
if($mail->ErrorInfo != '')
|
$_mailerror = true;
|
||||||
{
|
} catch (Exception $e) {
|
||||||
$mailerr_msg = $mail->ErrorInfo;
|
$mailerr_msg = $e->getMessage();
|
||||||
}
|
$_mailerror = true;
|
||||||
else
|
|
||||||
{
|
|
||||||
$mailerr_msg = $email;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($_mailerror) {
|
||||||
$log->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
$log->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
||||||
standard_error('errorsendingmail', $email);
|
standard_error('errorsendingmail', $email);
|
||||||
}
|
}
|
||||||
@@ -700,7 +750,7 @@ if($page == 'customers'
|
|||||||
$email = $idna_convert->encode(validate($_POST['email'], 'email'));
|
$email = $idna_convert->encode(validate($_POST['email'], 'email'));
|
||||||
$customernumber = validate($_POST['customernumber'], 'customer number', '/^[A-Za-z0-9 \-]*$/Di');
|
$customernumber = validate($_POST['customernumber'], 'customer number', '/^[A-Za-z0-9 \-]*$/Di');
|
||||||
$def_language = validate($_POST['def_language'], 'default language');
|
$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']);
|
$diskspace = intval_ressource($_POST['diskspace']);
|
||||||
|
|
||||||
if(isset($_POST['diskspace_ul']))
|
if(isset($_POST['diskspace_ul']))
|
||||||
@@ -781,12 +831,19 @@ if($page == 'customers'
|
|||||||
$mysqls = - 1;
|
$mysqls = - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($settings['aps']['aps_active'] == '1')
|
||||||
|
{
|
||||||
$number_of_aps_packages = intval_ressource($_POST['number_of_aps_packages']);
|
$number_of_aps_packages = intval_ressource($_POST['number_of_aps_packages']);
|
||||||
|
|
||||||
if(isset($_POST['number_of_aps_packages_ul']))
|
if(isset($_POST['number_of_aps_packages_ul']))
|
||||||
{
|
{
|
||||||
$number_of_aps_packages = - 1;
|
$number_of_aps_packages = - 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$number_of_aps_packages = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$createstdsubdomain = intval($_POST['createstdsubdomain']);
|
$createstdsubdomain = intval($_POST['createstdsubdomain']);
|
||||||
$deactivated = intval($_POST['deactivated']);
|
$deactivated = intval($_POST['deactivated']);
|
||||||
@@ -843,6 +900,7 @@ if($page == 'customers'
|
|||||||
{
|
{
|
||||||
if($password != '')
|
if($password != '')
|
||||||
{
|
{
|
||||||
|
$password = validatePassword($password);
|
||||||
$password = md5($password);
|
$password = md5($password);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -858,7 +916,17 @@ if($page == 'customers'
|
|||||||
if($createstdsubdomain == '1'
|
if($createstdsubdomain == '1'
|
||||||
&& $result['standardsubdomain'] == '0')
|
&& $result['standardsubdomain'] == '0')
|
||||||
{
|
{
|
||||||
$db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` " . "(`domain`, `customerid`, `adminid`, `parentdomainid`, `ipandport`, `documentroot`, `zonefile`, `isemaildomain`, `caneditdomain`, `openbasedir`, `safemode`, `speciallogfile`, `specialsettings`) " . "VALUES ('" . $db->escape($result['loginname'] . '.' . $settings['system']['hostname']) . "', '" . (int)$result['customerid'] . "', '" . (int)$userinfo['adminid'] . "', '-1', '" . $db->escape($settings['system']['defaultip']) . "', '" . $db->escape($result['documentroot']) . "', '', '0', '0', '1', '1', '0', '')");
|
if (isset($settings['system']['stdsubdomain'])
|
||||||
|
&& $settings['system']['stdsubdomain'] != ''
|
||||||
|
) {
|
||||||
|
$_stdsubdomain = $result['loginname'] . '.' . $settings['system']['stdsubdomain'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$_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', '')");
|
||||||
$domainid = $db->insert_id();
|
$domainid = $db->insert_id();
|
||||||
$db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `standardsubdomain`=\'' . (int)$domainid . '\' WHERE `customerid`=\'' . (int)$result['customerid'] . '\'');
|
$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'] . "'");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added standardsubdomain for user '" . $result['loginname'] . "'");
|
||||||
|
|||||||
@@ -130,6 +130,8 @@ if($page == 'domains'
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$domainscount = $db->num_rows($result);
|
||||||
|
|
||||||
// Display the list
|
// Display the list
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("domains/domains") . "\";");
|
eval("echo \"" . getTemplate("domains/domains") . "\";");
|
||||||
@@ -147,6 +149,14 @@ if($page == 'domains'
|
|||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* check for APS packages used with this domain, #110
|
||||||
|
*/
|
||||||
|
if(domainHasApsInstances($id))
|
||||||
|
{
|
||||||
|
standard_error('domains_cantdeletedomainwithapsinstances');
|
||||||
|
}
|
||||||
|
|
||||||
$query = 'SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` WHERE (`id`="' . (int)$id . '" OR `parentdomainid`="' . (int)$id . '") AND `isemaildomain`="1"';
|
$query = 'SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` WHERE (`id`="' . (int)$id . '" OR `parentdomainid`="' . (int)$id . '") AND `isemaildomain`="1"';
|
||||||
$subResult = $db->query($query);
|
$subResult = $db->query($query);
|
||||||
$idString = array();
|
$idString = array();
|
||||||
@@ -298,7 +308,7 @@ if($page == 'domains'
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$phpsettingid = '1';
|
$phpsettingid = $settings['system']['mod_fcgid_defaultini'];
|
||||||
$mod_fcgid_starter = '-1';
|
$mod_fcgid_starter = '-1';
|
||||||
$mod_fcgid_maxrequests = '-1';
|
$mod_fcgid_maxrequests = '-1';
|
||||||
}
|
}
|
||||||
@@ -307,7 +317,7 @@ if($page == 'domains'
|
|||||||
{
|
{
|
||||||
$openbasedir = '1';
|
$openbasedir = '1';
|
||||||
$safemode = '1';
|
$safemode = '1';
|
||||||
$phpsettingid = '1';
|
$phpsettingid = $settings['system']['mod_fcgid_defaultini'];
|
||||||
$mod_fcgid_starter = '-1';
|
$mod_fcgid_starter = '-1';
|
||||||
$mod_fcgid_maxrequests = '-1';
|
$mod_fcgid_maxrequests = '-1';
|
||||||
}
|
}
|
||||||
@@ -369,7 +379,8 @@ if($page == 'domains'
|
|||||||
|
|
||||||
if($aliasdomain != 0)
|
if($aliasdomain != 0)
|
||||||
{
|
{
|
||||||
$aliasdomain_check = $db->query_first('SELECT `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 . '\'');
|
// 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.'\'');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($openbasedir != '1')
|
if($openbasedir != '1')
|
||||||
@@ -440,6 +451,10 @@ if($page == 'domains'
|
|||||||
{
|
{
|
||||||
standard_error(array('stringisempty', 'mydocumentroot'));
|
standard_error(array('stringisempty', 'mydocumentroot'));
|
||||||
}
|
}
|
||||||
|
elseif(strstr($documentroot, ":") !== FALSE)
|
||||||
|
{
|
||||||
|
standard_error('pathmaynotcontaincolon');
|
||||||
|
}
|
||||||
elseif($customerid == 0)
|
elseif($customerid == 0)
|
||||||
{
|
{
|
||||||
standard_error('adduserfirst');
|
standard_error('adduserfirst');
|
||||||
@@ -555,7 +570,7 @@ if($page == 'domains'
|
|||||||
$row_ipandport['ip'] = '[' . $row_ipandport['ip'] . ']';
|
$row_ipandport['ip'] = '[' . $row_ipandport['ip'] . ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
$ipsandports.= makeoption($row_ipandport['ip'] . ':' . $row_ipandport['port'], $row_ipandport['id']);
|
$ipsandports.= makeoption($row_ipandport['ip'] . ':' . $row_ipandport['port'], $row_ipandport['id'], $settings['system']['defaultip']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ssl_ipsandports = '';
|
$ssl_ipsandports = '';
|
||||||
@@ -570,8 +585,6 @@ if($page == 'domains'
|
|||||||
$ssl_ipsandports.= makeoption($row_ssl_ipandport['ip'] . ':' . $row_ssl_ipandport['port'], $row_ssl_ipandport['id'], $settings['system']['defaultip']);
|
$ssl_ipsandports.= makeoption($row_ssl_ipandport['ip'] . ':' . $row_ssl_ipandport['port'], $row_ssl_ipandport['id'], $settings['system']['defaultip']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ssl = makeyesno('ssl', '1', '0', $result['ssl']);
|
|
||||||
$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']);
|
|
||||||
$standardsubdomains = array();
|
$standardsubdomains = array();
|
||||||
$result_standardsubdomains = $db->query('SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` `d`, `' . TABLE_PANEL_CUSTOMERS . '` `c` WHERE `d`.`id`=`c`.`standardsubdomain`');
|
$result_standardsubdomains = $db->query('SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` `d`, `' . TABLE_PANEL_CUSTOMERS . '` `c` WHERE `d`.`id`=`c`.`standardsubdomain`');
|
||||||
|
|
||||||
@@ -602,7 +615,7 @@ if($page == 'domains'
|
|||||||
|
|
||||||
while($row = $db->fetch_array($configs))
|
while($row = $db->fetch_array($configs))
|
||||||
{
|
{
|
||||||
$phpconfigs.= makeoption($row['description'], $row['id'], '1', true, true);
|
$phpconfigs.= makeoption($row['description'], $row['id'], $settings['system']['mod_fcgid_defaultini'], true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$isbinddomain = makeyesno('isbinddomain', '1', '0', '1');
|
$isbinddomain = makeyesno('isbinddomain', '1', '0', '1');
|
||||||
@@ -615,6 +628,8 @@ if($page == 'domains'
|
|||||||
$openbasedir = makeyesno('openbasedir', '1', '0', '1');
|
$openbasedir = makeyesno('openbasedir', '1', '0', '1');
|
||||||
$safemode = makeyesno('safemode', '1', '0', '1');
|
$safemode = makeyesno('safemode', '1', '0', '1');
|
||||||
$speciallogfile = makeyesno('speciallogfile', '1', '0', '0');
|
$speciallogfile = makeyesno('speciallogfile', '1', '0', '0');
|
||||||
|
$ssl = makeyesno('ssl', '1', '0', '0');
|
||||||
|
$ssl_redirect = makeyesno('ssl_redirect', '1', '0', '0');
|
||||||
$add_date = date('Y-m-d');
|
$add_date = date('Y-m-d');
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("domains/domains_add") . "\";");
|
eval("echo \"" . getTemplate("domains/domains_add") . "\";");
|
||||||
@@ -624,7 +639,11 @@ if($page == 'domains'
|
|||||||
elseif($action == 'edit'
|
elseif($action == 'edit'
|
||||||
&& $id != 0)
|
&& $id != 0)
|
||||||
{
|
{
|
||||||
$result = $db->query_first("SELECT `d`.`id`, `d`.`domain`, `d`.`customerid`, `d`.`adminid`, `d`.`email_only`, `d`.`documentroot`, `d`.`ssl`, `d`.`ssl_redirect`, `d`.`ssl_ipandport`,`d`.`ipandport`, `d`.`aliasdomain`, `d`.`isbinddomain`, `d`.`isemaildomain`, `d`.`subcanemaildomain`, `d`.`dkim`, `d`.`caneditdomain`, `d`.`zonefile`, `d`.`wwwserveralias`, `d`.`openbasedir`, `d`.`safemode`, `d`.`speciallogfile`, `d`.`specialsettings`, `d`.`add_date`, `d`.`registration_date`, `c`.`loginname`, `c`.`name`, `c`.`firstname`, `c`.`company`, `d`.`phpsettingid`, `d`.`mod_fcgid_starter`, `d`.`mod_fcgid_maxrequests` " . "FROM `" . TABLE_PANEL_DOMAINS . "` `d` " . "LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`) " . "WHERE `d`.`parentdomainid`='0' AND `d`.`id`='" . (int)$id . "'" . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = '" . (int)$userinfo['adminid'] . "' "));
|
$result = $db->query_first("SELECT `d`.*, `c`.`customerid` FROM `" . TABLE_PANEL_DOMAINS . "` `d`
|
||||||
|
LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`)
|
||||||
|
WHERE `d`.`parentdomainid`='0'
|
||||||
|
AND `d`.`id`='" . (int)$id . "'"
|
||||||
|
. ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = '" . (int)$userinfo['adminid'] . "' "));
|
||||||
|
|
||||||
if($result['domain'] != '')
|
if($result['domain'] != '')
|
||||||
{
|
{
|
||||||
@@ -729,6 +748,11 @@ if($page == 'domains'
|
|||||||
{
|
{
|
||||||
$documentroot = $customer['documentroot'];
|
$documentroot = $customer['documentroot'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(strstr($documentroot, ":") !== FALSE)
|
||||||
|
{
|
||||||
|
standard_error('pathmaynotcontaincolon');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -878,7 +902,8 @@ if($page == 'domains'
|
|||||||
|
|
||||||
if($aliasdomain != 0)
|
if($aliasdomain != 0)
|
||||||
{
|
{
|
||||||
$aliasdomain_check = $db->query_first('SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` `d`,`' . TABLE_PANEL_CUSTOMERS . '` `c` WHERE `d`.`customerid`=\'' . (int)$result['customerid'] . '\' AND `d`.`aliasdomain` IS NULL AND `d`.`id`<>`c`.`standardsubdomain` AND `c`.`customerid`=\'' . (int)$result['customerid'] . '\' AND `d`.`id`=\'' . (int)$aliasdomain . '\'');
|
// 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)$result['customerid'] . '\' AND `d`.`aliasdomain` IS NULL AND `d`.`id`<>`c`.`standardsubdomain` AND `c`.`customerid`=\'' . (int)$result['customerid'] . '\' AND `d`.`id`=\'' . (int)$aliasdomain . '\' AND `d`.`ipandport` = \''.(int)$ipandport.'\'');
|
||||||
}
|
}
|
||||||
|
|
||||||
if($aliasdomain_check['id'] != $aliasdomain)
|
if($aliasdomain_check['id'] != $aliasdomain)
|
||||||
|
|||||||
@@ -88,22 +88,34 @@ if($page == 'overview')
|
|||||||
{
|
{
|
||||||
$update_check_uri = 'http://version.froxlor.org/Froxlor/legacy/' . $version;
|
$update_check_uri = 'http://version.froxlor.org/Froxlor/legacy/' . $version;
|
||||||
|
|
||||||
if(strtolower(ini_get('allow_url_fopen')) == 'on')
|
if(ini_get('allow_url_fopen'))
|
||||||
{
|
{
|
||||||
$latestversion = @file($update_check_uri);
|
$latestversion = @file($update_check_uri);
|
||||||
|
|
||||||
$latestversion = explode(':', $latestversion);
|
if (isset($latestversion[0]))
|
||||||
|
{
|
||||||
|
$latestversion = explode('|', $latestversion[0]);
|
||||||
|
|
||||||
if(is_array($latestversion)
|
if(is_array($latestversion)
|
||||||
&& count($latestversion) >= 2)
|
&& count($latestversion) >= 1)
|
||||||
{
|
{
|
||||||
$lookfornewversion_lable = $latestversion[0];
|
$_version = $latestversion[0];
|
||||||
$lookfornewversion_link = $latestversion[1];
|
$_message = isset($latestversion[1]) ? $latestversion[1] : '';
|
||||||
$lookfornewversion_addinfo = '';
|
$_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
|
||||||
|
|
||||||
if(count($latestversion) >= 3)
|
$lookfornewversion_lable = $_version;
|
||||||
|
$lookfornewversion_link = $_link;
|
||||||
|
$lookfornewversion_addinfo = $_message;
|
||||||
|
|
||||||
|
if (version_compare($version, $_version) == -1) {
|
||||||
|
$isnewerversion = 1;
|
||||||
|
} else {
|
||||||
|
$isnewerversion = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$lookfornewversion_addinfo = $latestversion[2];
|
redirectTo($update_check_uri.'/pretty', NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -121,6 +133,7 @@ if($page == 'overview')
|
|||||||
$lookfornewversion_lable = $lng['admin']['lookfornewversion']['clickhere'];
|
$lookfornewversion_lable = $lng['admin']['lookfornewversion']['clickhere'];
|
||||||
$lookfornewversion_link = htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
|
$lookfornewversion_link = htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
|
||||||
$lookfornewversion_addinfo = '';
|
$lookfornewversion_addinfo = '';
|
||||||
|
$isnewerversion = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, $settings['panel']['decimal_places']);
|
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, $settings['panel']['decimal_places']);
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ if($page == 'message')
|
|||||||
&& $userinfo['customers_see_all'] == '1')
|
&& $userinfo['customers_see_all'] == '1')
|
||||||
{
|
{
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "sending messages to admins");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "sending messages to admins");
|
||||||
$result = $db->query('SELECT `firstname`, `name`, `email` FROM `' . TABLE_PANEL_ADMINS . "`");
|
$result = $db->query('SELECT `name`, `email` FROM `' . TABLE_PANEL_ADMINS . "`");
|
||||||
}
|
}
|
||||||
elseif($_POST['receipient'] == 1)
|
elseif($_POST['receipient'] == 1)
|
||||||
{
|
{
|
||||||
@@ -78,9 +78,9 @@ if($page == 'message')
|
|||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
$mail->AddAddress($row['email'], $row['firstname'] . ' ' . $row['name']);
|
$mail->AddAddress($row['email'], (isset($row['firstname']) ? $row['firstname'] . ' ' : '') . $row['name']);
|
||||||
$mail->From = $userinfo['email'];
|
$mail->From = $userinfo['email'];
|
||||||
$mail->FromName = $userinfo['firstname'] . ' ' . $userinfo['name'];
|
$mail->FromName = (isset($userinfo['firstname']) ? $userinfo['firstname'] . ' ' : '') . $userinfo['name'];
|
||||||
|
|
||||||
if(!$mail->Send())
|
if(!$mail->Send())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ if($page == 'overview')
|
|||||||
|
|
||||||
$db->query("INSERT INTO `" . TABLE_PANEL_PHPCONFIGS . "` SET `description` = '" . $db->escape($description) . "', `binary` = '" . $db->escape($binary) . "', `file_extensions` = '" . $db->escape($file_extensions) . "', `mod_fcgid_starter` = '" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests` = '" . $db->escape($mod_fcgid_maxrequests) . "', `phpsettings` = '" . $db->escape($phpsettings) . "'");
|
$db->query("INSERT INTO `" . TABLE_PANEL_PHPCONFIGS . "` SET `description` = '" . $db->escape($description) . "', `binary` = '" . $db->escape($binary) . "', `file_extensions` = '" . $db->escape($file_extensions) . "', `mod_fcgid_starter` = '" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests` = '" . $db->escape($mod_fcgid_maxrequests) . "', `phpsettings` = '" . $db->escape($phpsettings) . "'");
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $value . "' has been created by '" . $userinfo['loginname'] . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $description . "' has been created by '" . $userinfo['loginname'] . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -31,20 +31,78 @@ if(($page == 'settings' || $page == 'overview')
|
|||||||
&& $userinfo['change_serversettings'] == '1')
|
&& $userinfo['change_serversettings'] == '1')
|
||||||
{
|
{
|
||||||
$settings_data = loadConfigArrayDir('./actions/admin/settings/');
|
$settings_data = loadConfigArrayDir('./actions/admin/settings/');
|
||||||
$settings = loadSettings(&$settings_data, &$db);
|
$settings = loadSettings($settings_data, $db);
|
||||||
|
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
if(processForm(&$settings_data, &$_POST, array('filename' => $filename, 'action' => $action, 'page' => $page)))
|
$_part = isset($_GET['part']) ? $_GET['part'] : '';
|
||||||
|
|
||||||
|
if($_part == '')
|
||||||
{
|
{
|
||||||
|
$_part = isset($_POST['part']) ? $_POST['part'] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if($_part != '')
|
||||||
|
{
|
||||||
|
if($_part == 'all')
|
||||||
|
{
|
||||||
|
$settings_all = true;
|
||||||
|
$settings_part = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$settings_all = false;
|
||||||
|
$settings_part = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$only_enabledisable = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$settings_all = false;
|
||||||
|
$settings_part = false;
|
||||||
|
$only_enabledisable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(processFormEx(
|
||||||
|
$settings_data,
|
||||||
|
$_POST,
|
||||||
|
array('filename' => $filename, 'action' => $action, 'page' => $page),
|
||||||
|
$_part,
|
||||||
|
$settings_all,
|
||||||
|
$settings_part,
|
||||||
|
$only_enabledisable
|
||||||
|
)
|
||||||
|
) {
|
||||||
standard_success('settingssaved', '', array('filename' => $filename, 'action' => $action, 'page' => $page));
|
standard_success('settingssaved', '', array('filename' => $filename, 'action' => $action, 'page' => $page));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$fields = buildForm(&$settings_data);
|
$_part = isset($_GET['part']) ? $_GET['part'] : '';
|
||||||
eval("echo \"" . getTemplate("settings/settings") . "\";");
|
|
||||||
|
if($_part == '')
|
||||||
|
{
|
||||||
|
$_part = isset($_POST['part']) ? $_POST['part'] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$fields = buildFormEx($settings_data, $_part);
|
||||||
|
|
||||||
|
$settings_page = '';
|
||||||
|
if($_part == '')
|
||||||
|
{
|
||||||
|
eval("\$settings_page .= \"" . getTemplate("settings/settings_overview") . "\";");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
eval("\$settings_page .= \"" . getTemplate("settings/settings") . "\";");
|
||||||
|
}
|
||||||
|
|
||||||
|
eval("echo \"" . getTemplate("settings/settings_form_begin") . "\";");
|
||||||
|
eval("echo \$settings_page;");
|
||||||
|
eval("echo \"" . getTemplate("settings/settings_form_end") . "\";");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($page == 'rebuildconfigs'
|
elseif($page == 'rebuildconfigs'
|
||||||
|
|||||||
@@ -102,11 +102,12 @@ if($page == 'tickets'
|
|||||||
if($_cid != $row['customerid'])
|
if($_cid != $row['customerid'])
|
||||||
{
|
{
|
||||||
$cid = $row['customerid'];
|
$cid = $row['customerid'];
|
||||||
$usr = $db->query_first('SELECT `firstname`, `name`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
$usr = $db->query_first('SELECT `firstname`, `name`, `company`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||||
WHERE `customerid` = "' . (int)$cid . '"');
|
WHERE `customerid` = "' . (int)$cid . '"');
|
||||||
|
|
||||||
if(isset($usr['loginname'])) {
|
if(isset($usr['loginname'])) {
|
||||||
$customer = $usr['firstname'] . " " . $usr['name'] . " (" . $usr['loginname'] . ")";
|
$customer = getCorrectFullUserDetails($usr) . ' (' . $usr['loginname'] . ')';
|
||||||
|
//$customer = $usr['firstname'] . " " . $usr['name'] . " (" . $usr['loginname'] . ")";
|
||||||
} else {
|
} else {
|
||||||
$customer = $lng['ticket']['nonexistingcustomer'];
|
$customer = $lng['ticket']['nonexistingcustomer'];
|
||||||
}
|
}
|
||||||
@@ -197,12 +198,12 @@ if($page == 'tickets'
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$categories = '';
|
$categories = '';
|
||||||
$result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `adminid` = "' . $userinfo['adminid'] . '" ORDER BY `name` ASC');
|
$result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `adminid` = "' . $userinfo['adminid'] . '" ORDER BY `logicalorder`, `name` ASC');
|
||||||
|
|
||||||
if(isset($result['name'])
|
if(isset($result['name'])
|
||||||
&& $result['name'] != '')
|
&& $result['name'] != '')
|
||||||
{
|
{
|
||||||
$result2 = $db->query('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `adminid` = "' . $userinfo['adminid'] . '" ORDER BY `name` ASC');
|
$result2 = $db->query('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `adminid` = "' . $userinfo['adminid'] . '" ORDER BY `logicalorder`, `name` ASC');
|
||||||
|
|
||||||
while($row = $db->fetch_array($result2))
|
while($row = $db->fetch_array($result2))
|
||||||
{
|
{
|
||||||
@@ -219,27 +220,12 @@ if($page == 'tickets'
|
|||||||
|
|
||||||
while($row_customer = $db->fetch_array($result_customers))
|
while($row_customer = $db->fetch_array($result_customers))
|
||||||
{
|
{
|
||||||
if($row_customer['company'] == '')
|
$customers.= makeoption(getCorrectFullUserDetails($row_customer) . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
|
||||||
{
|
|
||||||
$customers.= makeoption($row_customer['name'] . ', ' . $row_customer['firstname'] . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if($row_customer['name'] != ''
|
|
||||||
&& $row_customer['firstname'] != '')
|
|
||||||
{
|
|
||||||
$customers.= makeoption($row_customer['name'] . ', ' . $row_customer['firstname'] . ' | ' . $row_customer['company'] . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$customers.= makeoption($row_customer['company'] . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$priorities = makeoption($lng['ticket']['unf_high'], '1');
|
$priorities = makeoption($lng['ticket']['unf_high'], '1', $settings['ticket']['default_priority']);
|
||||||
$priorities.= makeoption($lng['ticket']['unf_normal'], '2');
|
$priorities.= makeoption($lng['ticket']['unf_normal'], '2', $settings['ticket']['default_priority']);
|
||||||
$priorities.= makeoption($lng['ticket']['unf_low'], '3');
|
$priorities.= makeoption($lng['ticket']['unf_low'], '3', $settings['ticket']['default_priority']);
|
||||||
eval("echo \"" . getTemplate("ticket/tickets_new") . "\";");
|
eval("echo \"" . getTemplate("ticket/tickets_new") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -435,10 +421,11 @@ elseif($page == 'categories'
|
|||||||
{
|
{
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_tickets::categories");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_tickets::categories");
|
||||||
$fields = array(
|
$fields = array(
|
||||||
'name' => $lng['ticket']['category']
|
'name' => $lng['ticket']['category'],
|
||||||
|
'logicalorder' => $lng['ticket']['logicalorder']
|
||||||
);
|
);
|
||||||
$paging = new paging($userinfo, $db, TABLE_PANEL_TICKET_CATS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
$paging = new paging($userinfo, $db, TABLE_PANEL_TICKET_CATS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||||
$result = $db->query("SELECT `main`.`id`, `main`.`name`, (
|
$result = $db->query("SELECT `main`.`id`, `main`.`name`, `main`.`logicalorder`, (
|
||||||
SELECT COUNT(`sub`.`id`) FROM `" . TABLE_PANEL_TICKETS . "` `sub`
|
SELECT COUNT(`sub`.`id`) FROM `" . TABLE_PANEL_TICKETS . "` `sub`
|
||||||
WHERE `sub`.`category` = `main`.`id`
|
WHERE `sub`.`category` = `main`.`id`
|
||||||
AND `sub`.`answerto` = '0' AND `sub`.`adminid` = '" . $userinfo['adminid'] . "')
|
AND `sub`.`answerto` = '0' AND `sub`.`adminid` = '" . $userinfo['adminid'] . "')
|
||||||
@@ -481,6 +468,12 @@ elseif($page == 'categories'
|
|||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$category = validate($_POST['category'], 'category');
|
$category = validate($_POST['category'], 'category');
|
||||||
|
$order = validate($_POST['logicalorder'], 'logicalorder');
|
||||||
|
|
||||||
|
if($order < 1 || $order >= 1000)
|
||||||
|
{
|
||||||
|
$order = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if($category == '')
|
if($category == '')
|
||||||
{
|
{
|
||||||
@@ -488,7 +481,7 @@ elseif($page == 'categories'
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ticket::addCategory($db, $category, $userinfo['adminid']);
|
ticket::addCategory($db, $category, $userinfo['adminid'], $order);
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "added ticket-category '" . $category . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "added ticket-category '" . $category . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
@@ -505,6 +498,12 @@ elseif($page == 'categories'
|
|||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$category = validate($_POST['category'], 'category');
|
$category = validate($_POST['category'], 'category');
|
||||||
|
$order = validate($_POST['logicalorder'], 'logicalorder');
|
||||||
|
|
||||||
|
if($order < 1 || $order >= 1000)
|
||||||
|
{
|
||||||
|
$order = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if($category == '')
|
if($category == '')
|
||||||
{
|
{
|
||||||
@@ -512,7 +511,7 @@ elseif($page == 'categories'
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ticket::editCategory($db, $category, $id);
|
ticket::editCategory($db, $category, $id, $order);
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "edited ticket-category '" . $category . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "edited ticket-category '" . $category . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
@@ -634,14 +633,15 @@ elseif($page == 'archive'
|
|||||||
if($_cid != $ticket['customerid'])
|
if($_cid != $ticket['customerid'])
|
||||||
{
|
{
|
||||||
$cid = $ticket['customerid'];
|
$cid = $ticket['customerid'];
|
||||||
$usr = $db->query_first('SELECT `firstname`, `name`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
$usr = $db->query_first('SELECT `firstname`, `name`, `company`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||||
WHERE `customerid` = "' . (int)$cid . '"');
|
WHERE `customerid` = "' . (int)$cid . '"');
|
||||||
|
|
||||||
if(isset($usr['loginname'])) {
|
if(isset($usr['loginname'])) {
|
||||||
$customer = $usr['firstname'] . " " . $usr['name'] . " (" . $usr['loginname'] . ")";
|
$customer = getCorrectFullUserDetails($usr) . ' (' . $usr['loginname'] . ')';
|
||||||
} else {
|
} else {
|
||||||
$customer = $lng['ticket']['nonexistingcustomer'];
|
$customer = $lng['ticket']['nonexistingcustomer'];
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("\$tickets.=\"" . getTemplate("ticket/tickets_customer") . "\";");
|
eval("\$tickets.=\"" . getTemplate("ticket/tickets_customer") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -718,18 +718,11 @@ elseif($page == 'archive'
|
|||||||
}
|
}
|
||||||
|
|
||||||
$customers = makeoption($lng['ticket']['nocustomer'], '-1', '-1');
|
$customers = makeoption($lng['ticket']['nocustomer'], '-1', '-1');
|
||||||
$result = $db->query_first('SELECT `customerid` FROM `' . TABLE_PANEL_CUSTOMERS . '` ' . ($userinfo['customers_see_all'] ? '' : ' WHERE `adminid` = "' . (int)$userinfo['adminid'] . '" ') . 'ORDER BY `name` ASC');
|
$result_customers = $db->query("SELECT `customerid`, `loginname`, `name`, `firstname`, `company` FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int)$userinfo['adminid'] . "' ") . " ORDER BY `name` ASC");
|
||||||
|
|
||||||
if(isset($result['customerid'])
|
while($row_customer = $db->fetch_array($result_customers))
|
||||||
&& $result['customerid'] != '')
|
|
||||||
{
|
{
|
||||||
$result2 = $db->query('SELECT `customerid`, `loginname`, `firstname`, `name`
|
$customers.= makeoption(getCorrectFullUserDetails($row_customer) . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
|
||||||
FROM `' . TABLE_PANEL_CUSTOMERS . '` ' . ($userinfo['customers_see_all'] ? '' : ' WHERE `adminid` = "' . (int)$userinfo['adminid'] . '" ') . ' ORDER BY `name` ASC');
|
|
||||||
|
|
||||||
while($row = $db->fetch_array($result2))
|
|
||||||
{
|
|
||||||
$customers.= makeoption($row['name'] . ', ' . $row['firstname'] . ' (' . $row['loginname'] . ')', $row['customerid']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("ticket/archive") . "\";");
|
eval("echo \"" . getTemplate("ticket/archive") . "\";");
|
||||||
@@ -742,6 +735,7 @@ elseif($page == 'archive'
|
|||||||
$ticket_replies = '';
|
$ticket_replies = '';
|
||||||
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
||||||
$lastchange = date("d.m.Y H:i\h", $mainticket->Get('lastchange'));
|
$lastchange = date("d.m.Y H:i\h", $mainticket->Get('lastchange'));
|
||||||
|
$dt = date("d.m.Y H:i\h", $mainticket->Get('dt'));
|
||||||
$status = ticket::getStatusText($lng, $mainticket->Get('status'));
|
$status = ticket::getStatusText($lng, $mainticket->Get('status'));
|
||||||
$isclosed = 1;
|
$isclosed = 1;
|
||||||
|
|
||||||
|
|||||||
@@ -22,33 +22,90 @@ if($page == 'overview')
|
|||||||
{
|
{
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_updates");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_updates");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* this is a dirty hack but syscp 1.4.2.1 does not
|
||||||
|
* has any version/dbversion in the database (don't know why)
|
||||||
|
* so we have to set them both to run a correct upgrade
|
||||||
|
*/
|
||||||
|
if (!isFroxlor()) {
|
||||||
|
if (!isset($settings['panel']['version'])
|
||||||
|
|| $settings['panel']['version'] == ''
|
||||||
|
) {
|
||||||
|
$settings['panel']['version'] = '1.4.2.1';
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('panel','version','".$settings['panel']['version']."')");
|
||||||
|
}
|
||||||
|
if (!isset($settings['system']['dbversion'])
|
||||||
|
|| $settings['system']['dbversion'] == ''
|
||||||
|
) {
|
||||||
|
/**
|
||||||
|
* for syscp-stable (1.4.2.1) this value has to be 0
|
||||||
|
* so the required table-fields are added correctly
|
||||||
|
* and the svn-version has its value in the database
|
||||||
|
* -> bug #54
|
||||||
|
*/
|
||||||
|
|
||||||
|
$result = $db->query_first("SELECT `value` FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `varname` = 'dbversion'");
|
||||||
|
|
||||||
|
if(isset($result['value']))
|
||||||
|
{
|
||||||
|
$settings['system']['dbversion'] = (int)$result['value'];
|
||||||
|
} else {
|
||||||
|
$settings['system']['dbversion'] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(hasUpdates($version))
|
if(hasUpdates($version))
|
||||||
{
|
{
|
||||||
|
$successful_update = false;
|
||||||
|
$message = '';
|
||||||
|
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
|
if((isset($_POST['update_preconfig'])
|
||||||
|
&& isset($_POST['update_changesagreed'])
|
||||||
|
&& intval($_POST['update_changesagreed']) != 0)
|
||||||
|
|| !isset($_POST['update_preconfig'])
|
||||||
|
) {
|
||||||
eval("echo \"" . getTemplate("update/update_start") . "\";");
|
eval("echo \"" . getTemplate("update/update_start") . "\";");
|
||||||
|
|
||||||
include_once('./install/updatesql.php');
|
include_once './install/updatesql.php';
|
||||||
|
|
||||||
$redirect_url = 'admin_index.php';
|
$redirect_url = 'admin_index.php?s=' . $s;
|
||||||
eval("echo \"" . getTemplate("update/update_end") . "\";");
|
eval("echo \"" . getTemplate("update/update_end") . "\";");
|
||||||
|
|
||||||
updateCounters();
|
updateCounters();
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
@chmod('./lib/userdata.inc.php', 0440);
|
@chmod('./lib/userdata.inc.php', 0440);
|
||||||
|
|
||||||
|
$successful_update = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
$message = '<br /><strong style="color:#ff0000;">You have to agree that you have read the update notifications.</strong>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$successful_update)
|
||||||
{
|
{
|
||||||
$current_version = $settings['panel']['version'];
|
$current_version = $settings['panel']['version'];
|
||||||
$new_version = $version;
|
$new_version = $version;
|
||||||
|
|
||||||
$ui_text = $lng['update']['update_information'];
|
$ui_text = $lng['update']['update_information']['part_a'];
|
||||||
$ui_text = str_replace('%curversion', $current_version, $ui_text);
|
$ui_text = str_replace('%curversion', $current_version, $ui_text);
|
||||||
$ui_text = str_replace('%newversion', $new_version, $ui_text);
|
$ui_text = str_replace('%newversion', $new_version, $ui_text);
|
||||||
$update_information = $ui_text;
|
$update_information = $ui_text;
|
||||||
|
|
||||||
|
include_once './install/updates/preconfig.php';
|
||||||
|
$preconfig = getPreConfig($current_version);
|
||||||
|
if($preconfig != '')
|
||||||
|
{
|
||||||
|
$update_information .= '<br />'.$preconfig.$message;
|
||||||
|
}
|
||||||
|
|
||||||
|
$update_information .= $lng['update']['update_information']['part_b'];
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("update/index") . "\";");
|
eval("echo \"" . getTemplate("update/index") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,7 +116,7 @@ if($page == 'overview')
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$success_message = $lng['update']['noupdatesavail'];
|
$success_message = $lng['update']['noupdatesavail'];
|
||||||
$redirect_url = 'admin_index.php';
|
$redirect_url = 'admin_index.php?s=' . $s;
|
||||||
eval("echo \"" . getTemplate("update/noupdatesavail") . "\";");
|
eval("echo \"" . getTemplate("update/noupdatesavail") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
define('AREA', 'customer');
|
define('AREA', 'customer');
|
||||||
require ("./lib/init.php");
|
require ("./lib/init.php");
|
||||||
require ("./lib/class_apsparser.php");
|
|
||||||
$Id = 0;
|
$Id = 0;
|
||||||
|
|
||||||
if(isset($_GET['id']))$Id = (int)$_GET['id'];
|
if(isset($_GET['id']))$Id = (int)$_GET['id'];
|
||||||
|
|||||||
@@ -68,13 +68,13 @@ elseif($page == 'domains')
|
|||||||
$row['domainalias'] = $idna_convert->decode($row['domainalias']);
|
$row['domainalias'] = $idna_convert->decode($row['domainalias']);
|
||||||
|
|
||||||
if($row['parentdomainid'] == '0'
|
if($row['parentdomainid'] == '0'
|
||||||
&& $row['iswildcarddomain'] != '1'
|
|
||||||
&& $row['caneditdomain'] == '1')
|
&& $row['caneditdomain'] == '1')
|
||||||
{
|
{
|
||||||
$parentdomains_count++;
|
$parentdomains_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$domains_count++;
|
$domains_count++;
|
||||||
|
/*
|
||||||
$domainparts = explode('.', $row['domain']);
|
$domainparts = explode('.', $row['domain']);
|
||||||
$domainparts = array_reverse($domainparts);
|
$domainparts = array_reverse($domainparts);
|
||||||
$sortkey = '';
|
$sortkey = '';
|
||||||
@@ -82,8 +82,9 @@ elseif($page == 'domains')
|
|||||||
{
|
{
|
||||||
$sortkey.= $part . '.';
|
$sortkey.= $part . '.';
|
||||||
}
|
}
|
||||||
|
|
||||||
$domain_array[$sortkey] = $row;
|
$domain_array[$sortkey] = $row;
|
||||||
|
*/
|
||||||
|
$domain_array[$row['domain']] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
ksort($domain_array);
|
ksort($domain_array);
|
||||||
@@ -125,6 +126,11 @@ elseif($page == 'domains')
|
|||||||
if($paging->checkDisplay($i))
|
if($paging->checkDisplay($i))
|
||||||
{
|
{
|
||||||
$row = htmlentities_array($domain_array[$sortkey]);
|
$row = htmlentities_array($domain_array[$sortkey]);
|
||||||
|
if($settings['system']['awstats_enabled'] == '1') {
|
||||||
|
$statsapp = 'awstats';
|
||||||
|
} else {
|
||||||
|
$statsapp = 'webalizer';
|
||||||
|
}
|
||||||
eval("\$domains.=\"" . getTemplate("domains/domains_delimiter") . "\";");
|
eval("\$domains.=\"" . getTemplate("domains/domains_delimiter") . "\";");
|
||||||
|
|
||||||
if($paging->sortfield == 'd.domain'
|
if($paging->sortfield == 'd.domain'
|
||||||
@@ -178,6 +184,14 @@ elseif($page == 'domains')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* check for APS packages used with this domain, #110
|
||||||
|
*/
|
||||||
|
if(domainHasApsInstances($id))
|
||||||
|
{
|
||||||
|
standard_error('domains_cantdeletedomainwithapsinstances');
|
||||||
|
}
|
||||||
|
|
||||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted subdomain '" . $idna_convert->decode($result['domain']) . "'");
|
$log->logAction(USR_ACTION, LOG_INFO, "deleted subdomain '" . $idna_convert->decode($result['domain']) . "'");
|
||||||
$result = $db->query("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
$result = $db->query("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||||
$result = $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `subdomains_used`=`subdomains_used`-1 WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
$result = $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `subdomains_used`=`subdomains_used`-1 WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||||
@@ -205,17 +219,19 @@ elseif($page == 'domains')
|
|||||||
{
|
{
|
||||||
$subdomain = $idna_convert->encode(preg_replace(Array('/\:(\d)+$/', '/^https?\:\/\//'), '', validate($_POST['subdomain'], 'subdomain', '', 'subdomainiswrong')));
|
$subdomain = $idna_convert->encode(preg_replace(Array('/\:(\d)+$/', '/^https?\:\/\//'), '', validate($_POST['subdomain'], 'subdomain', '', 'subdomainiswrong')));
|
||||||
$domain = $idna_convert->encode($_POST['domain']);
|
$domain = $idna_convert->encode($_POST['domain']);
|
||||||
$domain_check = $db->query_first("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain`='" . $db->escape($domain) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "' AND `parentdomainid`='0' AND `email_only`='0' AND `iswildcarddomain`='0' AND `caneditdomain`='1' ");
|
$domain_check = $db->query_first("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain`='" . $db->escape($domain) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "' AND `parentdomainid`='0' AND `email_only`='0' AND `caneditdomain`='1' ");
|
||||||
$completedomain = $subdomain . '.' . $domain;
|
$completedomain = $subdomain . '.' . $domain;
|
||||||
$completedomain_check = $db->query_first("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain`='" . $db->escape($completedomain) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "' AND `email_only`='0' AND `caneditdomain` = '1'");
|
$completedomain_check = $db->query_first("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain`='" . $db->escape($completedomain) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "' AND `email_only`='0' AND `caneditdomain` = '1'");
|
||||||
$aliasdomain = intval($_POST['alias']);
|
$aliasdomain = intval($_POST['alias']);
|
||||||
$aliasdomain_check = array(
|
$aliasdomain_check = array(
|
||||||
'id' => 0
|
'id' => 0
|
||||||
);
|
);
|
||||||
|
$_doredirect = false;
|
||||||
|
|
||||||
if($aliasdomain != 0)
|
if($aliasdomain != 0)
|
||||||
{
|
{
|
||||||
$aliasdomain_check = $db->query_first('SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` `d`,`' . TABLE_PANEL_CUSTOMERS . '` `c` WHERE `d`.`customerid`=\'' . (int)$userinfo['customerid'] . '\' AND `d`.`aliasdomain` IS NULL AND `d`.`id`<>`c`.`standardsubdomain` AND `c`.`customerid`=\'' . (int)$userinfo['customerid'] . '\' AND `d`.`id`=\'' . (int)$aliasdomain . '\'');
|
// also check ip/port combination to be the same, #176
|
||||||
|
$aliasdomain_check = $db->query_first('SELECT `id` FROM `' . TABLE_PANEL_DOMAINS . '` `d`,`' . TABLE_PANEL_CUSTOMERS . '` `c` WHERE `d`.`customerid`=\'' . (int)$userinfo['customerid'] . '\' AND `d`.`aliasdomain` IS NULL AND `d`.`id`<>`c`.`standardsubdomain` AND `c`.`customerid`=\'' . (int)$userinfo['customerid'] . '\' AND `d`.`id`=\'' . (int)$aliasdomain . '\' AND `d`.`ipandport` = \''.(int)$domain_check['ipandport'].'\'');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['url'])
|
if(isset($_POST['url'])
|
||||||
@@ -223,6 +239,7 @@ elseif($page == 'domains')
|
|||||||
&& validateUrl($idna_convert->encode($_POST['url'])))
|
&& validateUrl($idna_convert->encode($_POST['url'])))
|
||||||
{
|
{
|
||||||
$path = $_POST['url'];
|
$path = $_POST['url'];
|
||||||
|
$_doredirect = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -234,6 +251,14 @@ elseif($page == 'domains')
|
|||||||
{
|
{
|
||||||
$path = $userinfo['documentroot'] . '/' . $path;
|
$path = $userinfo['documentroot'] . '/' . $path;
|
||||||
$path = makeCorrectDir($path);
|
$path = makeCorrectDir($path);
|
||||||
|
if (strstr($path, ":") !== FALSE)
|
||||||
|
{
|
||||||
|
standard_error('pathmaynotcontaincolon');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$_doredirect = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['openbasedir_path'])
|
if(isset($_POST['openbasedir_path'])
|
||||||
@@ -286,7 +311,38 @@ elseif($page == 'domains')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result = $db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` (`customerid`, `domain`, `documentroot`, `ipandport`, `aliasdomain`, `parentdomainid`, `isemaildomain`, `openbasedir`, `openbasedir_path`, `safemode`, `speciallogfile`, `specialsettings`, `ssl_redirect`) VALUES ('" . (int)$userinfo['customerid'] . "', '" . $db->escape($completedomain) . "', '" . $db->escape($path) . "', '" . $db->escape($domain_check['ipandport']) . "', " . (($aliasdomain != 0) ? "'" . $db->escape($aliasdomain) . "'" : "NULL") . ", '" . (int)$domain_check['id'] . "', '" . ($domain_check['subcanemaildomain'] == '3' ? '1' : '0') . "', '" . $db->escape($domain_check['openbasedir']) . "', '" . $db->escape($openbasedir_path) . "', '" . $db->escape($domain_check['safemode']) . "', '" . $db->escape($domain_check['speciallogfile']) . "', '" . $db->escape($domain_check['specialsettings']) . "', '" . $ssl_redirect . "')");
|
// get the phpsettingid from parentdomain, #107
|
||||||
|
$phpsid_result = $db->query_first("SELECT `phpsettingid` FROM `".TABLE_PANEL_DOMAINS."` WHERE `id` = '".(int)$domain_check['id']."'");
|
||||||
|
if(!isset($phpsid_result['phpsettingid'])
|
||||||
|
|| (int)$phpsid_result['phpsettingid'] <= 0
|
||||||
|
) {
|
||||||
|
// assign default config
|
||||||
|
$phpsid_result['phpsettingid'] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
|
||||||
|
`customerid` = '" . (int)$userinfo['customerid'] . "',
|
||||||
|
`domain` = '" . $db->escape($completedomain) . "',
|
||||||
|
`documentroot` = '" . $db->escape($path) . "',
|
||||||
|
`ipandport` = '" . $db->escape($domain_check['ipandport']) . "',
|
||||||
|
`aliasdomain` = ".(($aliasdomain != 0) ? "'" . $db->escape($aliasdomain) . "'" : "NULL") .",
|
||||||
|
`parentdomainid` = '" . (int)$domain_check['id'] . "',
|
||||||
|
`isemaildomain` = '" . ($domain_check['subcanemaildomain'] == '3' ? '1' : '0') . "',
|
||||||
|
`openbasedir` = '" . $db->escape($domain_check['openbasedir']) . "',
|
||||||
|
`openbasedir_path` = '" . $db->escape($openbasedir_path) . "',
|
||||||
|
`safemode` = '" . $db->escape($domain_check['safemode']) . "',
|
||||||
|
`speciallogfile` = '" . $db->escape($domain_check['speciallogfile']) . "',
|
||||||
|
`specialsettings` = '" . $db->escape($domain_check['specialsettings']) . "',
|
||||||
|
`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'] . "'");
|
$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 . "'");
|
$log->logAction(USR_ACTION, LOG_INFO, "added subdomain '" . $completedomain . "'");
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
@@ -296,7 +352,7 @@ elseif($page == 'domains')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result = $db->query("SELECT `id`, `domain`, `documentroot`, `ssl_redirect`,`isemaildomain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `parentdomainid`='0' AND `email_only`='0' AND `iswildcarddomain`='0' AND `caneditdomain`='1' ORDER BY `domain` ASC");
|
$result = $db->query("SELECT `id`, `domain`, `documentroot`, `ssl_redirect`,`isemaildomain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `parentdomainid`='0' AND `email_only`='0' AND `caneditdomain`='1' ORDER BY `domain` ASC");
|
||||||
$domains = '';
|
$domains = '';
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
@@ -312,6 +368,16 @@ elseif($page == 'domains')
|
|||||||
$aliasdomains.= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['id']);
|
$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'], $rc['id'], $settings['customredirect']['default']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']);
|
$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);
|
$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']);
|
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
|
||||||
@@ -322,9 +388,10 @@ elseif($page == 'domains')
|
|||||||
elseif($action == 'edit'
|
elseif($action == 'edit'
|
||||||
&& $id != 0)
|
&& $id != 0)
|
||||||
{
|
{
|
||||||
$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` ,`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'");
|
$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 = $db->query_first('SELECT COUNT(`id`) AS count FROM `' . TABLE_PANEL_DOMAINS . '` WHERE `aliasdomain`=\'' . (int)$result['id'] . '\'');
|
||||||
$alias_check = $alias_check['count'];
|
$alias_check = $alias_check['count'];
|
||||||
|
$_doredirect = false;
|
||||||
|
|
||||||
if(isset($result['customerid'])
|
if(isset($result['customerid'])
|
||||||
&& $result['customerid'] == $userinfo['customerid'])
|
&& $result['customerid'] == $userinfo['customerid'])
|
||||||
@@ -337,6 +404,7 @@ elseif($page == 'domains')
|
|||||||
&& validateUrl($idna_convert->encode($_POST['url'])))
|
&& validateUrl($idna_convert->encode($_POST['url'])))
|
||||||
{
|
{
|
||||||
$path = $_POST['url'];
|
$path = $_POST['url'];
|
||||||
|
$_doredirect = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -348,6 +416,14 @@ elseif($page == 'domains')
|
|||||||
{
|
{
|
||||||
$path = $userinfo['documentroot'] . '/' . $path;
|
$path = $userinfo['documentroot'] . '/' . $path;
|
||||||
$path = makeCorrectDir($path);
|
$path = makeCorrectDir($path);
|
||||||
|
if (strstr($path, ":") !== FALSE)
|
||||||
|
{
|
||||||
|
standard_error('pathmaynotcontaincolon');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$_doredirect = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$aliasdomain = intval($_POST['alias']);
|
$aliasdomain = intval($_POST['alias']);
|
||||||
@@ -355,16 +431,7 @@ elseif($page == 'domains')
|
|||||||
if(isset($_POST['iswildcarddomain'])
|
if(isset($_POST['iswildcarddomain'])
|
||||||
&& $_POST['iswildcarddomain'] == '1'
|
&& $_POST['iswildcarddomain'] == '1'
|
||||||
&& $result['parentdomainid'] == '0'
|
&& $result['parentdomainid'] == '0'
|
||||||
&& $userinfo['subdomains'] != '0')
|
){
|
||||||
{
|
|
||||||
$wildcarddomaincheck = $db->query("SELECT `id` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `parentdomainid` = '" . (int)$result['id'] . "'");
|
|
||||||
|
|
||||||
if($db->num_rows($wildcarddomaincheck) != '0')
|
|
||||||
{
|
|
||||||
standard_error('firstdeleteallsubdomains');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$iswildcarddomain = '1';
|
$iswildcarddomain = '1';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -431,6 +498,12 @@ elseif($page == 'domains')
|
|||||||
$log->logAction(USR_ACTION, LOG_NOTICE, "automatically deleted mail-table entries for '" . $idna_convert->decode($result['domain']) . "'");
|
$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']
|
if($path != $result['documentroot']
|
||||||
|| $isemaildomain != $result['isemaildomain']
|
|| $isemaildomain != $result['isemaildomain']
|
||||||
|| $iswildcarddomain != $result['iswildcarddomain']
|
|| $iswildcarddomain != $result['iswildcarddomain']
|
||||||
@@ -439,9 +512,9 @@ elseif($page == 'domains')
|
|||||||
|| $ssl_redirect != $result['ssl_redirect'])
|
|| $ssl_redirect != $result['ssl_redirect'])
|
||||||
{
|
{
|
||||||
$log->logAction(USR_ACTION, LOG_INFO, "edited domain '" . $idna_convert->decode($result['domain']) . "'");
|
$log->logAction(USR_ACTION, LOG_INFO, "edited domain '" . $idna_convert->decode($result['domain']) . "'");
|
||||||
|
$result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `documentroot`='" . $db->escape($path) . "', `isemaildomain`='" . (int)$isemaildomain . "', `iswildcarddomain`='" . (int)$iswildcarddomain . "', `aliasdomain`=" . (($aliasdomain != 0 && $alias_check == 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ",`openbasedir_path`='" . $db->escape($openbasedir_path) . "', `ssl_redirect`='" . $ssl_redirect . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
inserttask('4');
|
inserttask('4');
|
||||||
$result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `documentroot`='" . $db->escape($path) . "', `isemaildomain`='" . (int)$isemaildomain . "', `iswildcarddomain`='" . (int)$iswildcarddomain . "', `aliasdomain`=" . (($aliasdomain != 0 && $alias_check == 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ",`openbasedir_path`='" . $db->escape($openbasedir_path) . "', `ssl_redirect`='" . $ssl_redirect . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
@@ -451,7 +524,8 @@ elseif($page == 'domains')
|
|||||||
{
|
{
|
||||||
$result['domain'] = $idna_convert->decode($result['domain']);
|
$result['domain'] = $idna_convert->decode($result['domain']);
|
||||||
$domains = makeoption($lng['domains']['noaliasdomain'], 0, $result['aliasdomain'], true);
|
$domains = makeoption($lng['domains']['noaliasdomain'], 0, $result['aliasdomain'], 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`.`id`<>'" . (int)$result['id'] . "' AND `c`.`standardsubdomain`<>`d`.`id` AND `d`.`customerid`='" . (int)$userinfo['customerid'] . "' AND `c`.`customerid`=`d`.`customerid` ORDER BY `d`.`domain` ASC");
|
// also check ip/port combination to be the same, #176
|
||||||
|
$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`.`id`<>'" . (int)$result['id'] . "' AND `c`.`standardsubdomain`<>`d`.`id` AND `d`.`customerid`='" . (int)$userinfo['customerid'] . "' AND `c`.`customerid`=`d`.`customerid` AND `d`.`ipandport` = '".(int)$result['ipandport']."' ORDER BY `d`.`domain` ASC");
|
||||||
|
|
||||||
while($row_domain = $db->fetch_array($result_domains))
|
while($row_domain = $db->fetch_array($result_domains))
|
||||||
{
|
{
|
||||||
@@ -471,15 +545,29 @@ elseif($page == 'domains')
|
|||||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], $result['documentroot']);
|
$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'], $rc['id'], $def_code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']);
|
$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']);
|
||||||
$iswildcarddomain = makeyesno('iswildcarddomain', '1', '0', $result['iswildcarddomain']);
|
$iswildcarddomain = makeyesno('iswildcarddomain', '1', '0', $result['iswildcarddomain']);
|
||||||
$isemaildomain = makeyesno('isemaildomain', '1', '0', $result['isemaildomain']);
|
$isemaildomain = makeyesno('isemaildomain', '1', '0', $result['isemaildomain']);
|
||||||
$openbasedir = makeoption($lng['domain']['docroot'], 0, $result['openbasedir_path'], true) . makeoption($lng['domain']['homedir'], 1, $result['openbasedir_path'], true);
|
$openbasedir = makeoption($lng['domain']['docroot'], 0, $result['openbasedir_path'], true) . makeoption($lng['domain']['homedir'], 1, $result['openbasedir_path'], true);
|
||||||
$result = htmlentities_array($result);
|
|
||||||
|
|
||||||
if($settings['system']['use_ssl'] == "1")
|
$result_ipandport = $db->query_first("SELECT `ip` FROM `".TABLE_PANEL_IPSANDPORTS."` WHERE `id`='".(int)$result['ipandport']."'");
|
||||||
|
if(filter_var($result_ipandport['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
|
||||||
{
|
{
|
||||||
|
$result_ipandport['ip'] = '[' . $result_ipandport['ip'] . ']';
|
||||||
}
|
}
|
||||||
|
$domainip = $result_ipandport['ip'];
|
||||||
|
$result = htmlentities_array($result);
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("domains/domains_edit") . "\";");
|
eval("echo \"" . getTemplate("domains/domains_edit") . "\";");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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'];
|
$emaildomains_count = $emaildomains_count['count'];
|
||||||
|
|
||||||
|
$emailscount = $db->num_rows($result);
|
||||||
eval("echo \"" . getTemplate("email/emails") . "\";");
|
eval("echo \"" . getTemplate("email/emails") . "\";");
|
||||||
}
|
}
|
||||||
elseif($action == 'delete'
|
elseif($action == 'delete'
|
||||||
@@ -372,6 +374,7 @@ elseif($page == 'accounts')
|
|||||||
$email_full = $result['email_full'];
|
$email_full = $result['email_full'];
|
||||||
$username = $idna_convert->decode($email_full);
|
$username = $idna_convert->decode($email_full);
|
||||||
$password = validate($_POST['email_password'], 'password');
|
$password = validate($_POST['email_password'], 'password');
|
||||||
|
$password = validatePassword($password);
|
||||||
|
|
||||||
if($settings['panel']['sendalternativemail'] == 1)
|
if($settings['panel']['sendalternativemail'] == 1)
|
||||||
{
|
{
|
||||||
@@ -427,25 +430,26 @@ elseif($page == 'accounts')
|
|||||||
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['pop_success']['subject']), $replace_arr));
|
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['pop_success']['subject']), $replace_arr));
|
||||||
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($userinfo['def_language']) . '\' AND `templategroup`=\'mails\' AND `varname`=\'pop_success_mailbody\'');
|
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($userinfo['def_language']) . '\' AND `templategroup`=\'mails\' AND `varname`=\'pop_success_mailbody\'');
|
||||||
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['pop_success']['mailbody']), $replace_arr));
|
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['pop_success']['mailbody']), $replace_arr));
|
||||||
$mail->From = $admin['email'];
|
|
||||||
$mail->FromName = getCorrectUserSalutation($admin);
|
$_mailerror = false;
|
||||||
|
try {
|
||||||
|
$mail->SetFrom($admin['email'], getCorrectUserSalutation($admin));
|
||||||
$mail->Subject = $mail_subject;
|
$mail->Subject = $mail_subject;
|
||||||
$mail->Body = $mail_body;
|
$mail->AltBody = $mail_body;
|
||||||
|
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
||||||
$mail->AddAddress($email_full, getCorrectUserSalutation($userinfo));
|
$mail->AddAddress($email_full, getCorrectUserSalutation($userinfo));
|
||||||
|
$mail->Send();
|
||||||
if(!$mail->Send())
|
} catch(phpmailerException $e) {
|
||||||
{
|
$mailerr_msg = $e->errorMessage();
|
||||||
if($mail->ErrorInfo != '')
|
$_mailerror = true;
|
||||||
{
|
} catch (Exception $e) {
|
||||||
$mailerr_msg = $mail->ErrorInfo;
|
$mailerr_msg = $e->getMessage();
|
||||||
}
|
$_mailerror = true;
|
||||||
else
|
|
||||||
{
|
|
||||||
$mailerr_msg = $email;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($_mailerror) {
|
||||||
$log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
$log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
||||||
standard_error('errorsendingmail', $email);
|
standard_error('errorsendingmail', $email_full);
|
||||||
}
|
}
|
||||||
|
|
||||||
$mail->ClearAddresses();
|
$mail->ClearAddresses();
|
||||||
@@ -457,23 +461,24 @@ elseif($page == 'accounts')
|
|||||||
$mail_subject = replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['pop_success_alternative']['subject']), $replace_arr);
|
$mail_subject = replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['pop_success_alternative']['subject']), $replace_arr);
|
||||||
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($userinfo['def_language']) . '\' AND `templategroup`=\'mails\' AND `varname`=\'pop_success_alternative_mailbody\'');
|
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($userinfo['def_language']) . '\' AND `templategroup`=\'mails\' AND `varname`=\'pop_success_alternative_mailbody\'');
|
||||||
$mail_body = replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['pop_success_alternative']['mailbody']), $replace_arr);
|
$mail_body = replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['pop_success_alternative']['mailbody']), $replace_arr);
|
||||||
$mail->From = $admin['email'];
|
|
||||||
$mail->FromName = getCorrectUserSalutation($admin);
|
$_mailerror = false;
|
||||||
|
try {
|
||||||
|
$mail->SetFrom($admin['email'], getCorrectUserSalutation($admin));
|
||||||
$mail->Subject = $mail_subject;
|
$mail->Subject = $mail_subject;
|
||||||
$mail->Body = $mail_body;
|
$mail->AltBody = $mail_body;
|
||||||
|
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
||||||
$mail->AddAddress($idna_convert->encode($alternative_email), getCorrectUserSalutation($userinfo));
|
$mail->AddAddress($idna_convert->encode($alternative_email), getCorrectUserSalutation($userinfo));
|
||||||
|
$mail->Send();
|
||||||
if(!$mail->Send())
|
} catch(phpmailerException $e) {
|
||||||
{
|
$mailerr_msg = $e->errorMessage();
|
||||||
if($mail->ErrorInfo != '')
|
$_mailerror = true;
|
||||||
{
|
} catch (Exception $e) {
|
||||||
$mailerr_msg = $mail->ErrorInfo;
|
$mailerr_msg = $e->getMessage();
|
||||||
}
|
$_mailerror = true;
|
||||||
else
|
|
||||||
{
|
|
||||||
$mailerr_msg = $alternative_email;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($_mailerror) {
|
||||||
$log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
$log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
||||||
standard_error(array('errorsendingmail', $alternative_email));
|
standard_error(array('errorsendingmail', $alternative_email));
|
||||||
}
|
}
|
||||||
@@ -516,13 +521,13 @@ elseif($page == 'accounts')
|
|||||||
standard_error(array('stringisempty', 'mypassword'));
|
standard_error(array('stringisempty', 'mypassword'));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
$password = validatePassword($password);
|
||||||
|
|
||||||
$log->logAction(USR_ACTION, LOG_NOTICE, "changed email password for '" . $result['email_full'] . "'");
|
$log->logAction(USR_ACTION, LOG_NOTICE, "changed email password for '" . $result['email_full'] . "'");
|
||||||
$result = $db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET " . ($settings['system']['mailpwcleartext'] == '1' ? "`password` = '" . $db->escape($password) . "', " : '') . " `password_enc`=ENCRYPT('" . $db->escape($password) . "') WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$result['popaccountid'] . "'");
|
$result = $db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET " . ($settings['system']['mailpwcleartext'] == '1' ? "`password` = '" . $db->escape($password) . "', " : '') . " `password_enc`=ENCRYPT('" . $db->escape($password) . "') WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$result['popaccountid'] . "'");
|
||||||
redirectTo($filename, Array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s));
|
redirectTo($filename, Array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result['email_full'] = $idna_convert->decode($result['email_full']);
|
$result['email_full'] = $idna_convert->decode($result['email_full']);
|
||||||
|
|||||||
120
customer_ftp.php
120
customer_ftp.php
@@ -97,6 +97,11 @@ elseif($page == 'accounts')
|
|||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `up_count`=`up_count`+'" . (int)$result['up_count'] . "', `up_bytes`=`up_bytes`+'" . (int)$result['up_bytes'] . "', `down_count`=`down_count`+'" . (int)$result['down_count'] . "', `down_bytes`=`down_bytes`+'" . (int)$result['down_bytes'] . "' WHERE `username`='" . $db->escape($userinfo['loginname']) . "'");
|
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `up_count`=`up_count`+'" . (int)$result['up_count'] . "', `up_bytes`=`up_bytes`+'" . (int)$result['up_bytes'] . "', `down_count`=`down_count`+'" . (int)$result['down_count'] . "', `down_bytes`=`down_bytes`+'" . (int)$result['down_bytes'] . "' WHERE `username`='" . $db->escape($userinfo['loginname']) . "'");
|
||||||
|
$result = $db->query("SELECT `username` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||||
|
while($row = $db->fetch_array($result))
|
||||||
|
{
|
||||||
|
$db->query("DELETE FROM `" . TABLE_FTP_QUOTATALLIES . "` WHERE `name` = '" . $db->escape($row['username']) . "'");
|
||||||
|
}
|
||||||
$db->query("DELETE FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
$db->query("DELETE FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted ftp-account '" . $result['username'] . "'");
|
$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("UPDATE `" . TABLE_FTP_GROUPS . "` SET `members`=REPLACE(`members`,'," . $db->escape($result['username']) . "','') WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||||
@@ -135,6 +140,13 @@ elseif($page == 'accounts')
|
|||||||
{
|
{
|
||||||
$path = validate($_POST['path'], 'path');
|
$path = validate($_POST['path'], 'path');
|
||||||
$password = validate($_POST['ftp_password'], 'password');
|
$password = validate($_POST['ftp_password'], 'password');
|
||||||
|
$password = validatePassword($password);
|
||||||
|
|
||||||
|
$sendinfomail = intval($_POST['sendinfomail']);
|
||||||
|
if($sendinfomail != 1)
|
||||||
|
{
|
||||||
|
$sendinfomail = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if($settings['customer']['ftpatdomain'] == '1')
|
if($settings['customer']['ftpatdomain'] == '1')
|
||||||
{
|
{
|
||||||
@@ -172,20 +184,54 @@ elseif($page == 'accounts')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$userpath = makeCorrectDir($path);
|
|
||||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||||
|
|
||||||
$db->query("INSERT INTO `" . TABLE_FTP_USERS . "` (`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) VALUES ('" . (int)$userinfo['customerid'] . "', '" . $db->escape($username) . "', ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($path) . "', 'y', '" . (int)$userinfo['guid'] . "', '" . (int)$userinfo['guid'] . "')");
|
$db->query("INSERT INTO `" . TABLE_FTP_USERS . "` (`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) VALUES ('" . (int)$userinfo['customerid'] . "', '" . $db->escape($username) . "', ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($path) . "', 'y', '" . (int)$userinfo['guid'] . "', '" . (int)$userinfo['guid'] . "')");
|
||||||
|
$result = $db->query("SELECT `bytes_in_used` FROM `" . TABLE_FTP_QUOTATALLIES . "` WHERE `name` = '" . $userinfo['loginname'] . "'");
|
||||||
|
while($row = $db->fetch_array($result))
|
||||||
|
{
|
||||||
|
$db->query("INSERT INTO `" . TABLE_FTP_QUOTATALLIES . "` (`name`, `quota_type`, `bytes_in_used`, `bytes_out_used`, `bytes_xfer_used`, `files_in_used`, `files_out_used`, `files_xfer_used`) VALUES ('" . $db->escape($username) . "', 'user', '" . $db->escape($row[bytes_in_used]) . "', '0', '0', '0', '0', '0')");
|
||||||
|
}
|
||||||
$db->query("UPDATE `" . TABLE_FTP_GROUPS . "` SET `members`=CONCAT_WS(',',`members`,'" . $db->escape($username) . "') WHERE `customerid`='" . $userinfo['customerid'] . "' AND `gid`='" . (int)$userinfo['guid'] . "'");
|
$db->query("UPDATE `" . TABLE_FTP_GROUPS . "` SET `members`=CONCAT_WS(',',`members`,'" . $db->escape($username) . "') WHERE `customerid`='" . $userinfo['customerid'] . "' AND `gid`='" . (int)$userinfo['guid'] . "'");
|
||||||
|
|
||||||
// $db->query("INSERT INTO `".TABLE_FTP_GROUPS."` (`customerid`, `groupname`, `gid`, `members`) VALUES ('".$userinfo['customerid']."', '$username', '$uid', '$username')");
|
|
||||||
|
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `ftps_used`=`ftps_used`+1, `ftp_lastaccountnumber`=`ftp_lastaccountnumber`+1 WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `ftps_used`=`ftps_used`+1, `ftp_lastaccountnumber`=`ftp_lastaccountnumber`+1 WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||||
|
|
||||||
// $db->query("UPDATE `".TABLE_PANEL_SETTINGS."` SET `value`='$uid' WHERE settinggroup='ftp' AND varname='lastguid'");
|
|
||||||
|
|
||||||
$log->logAction(USR_ACTION, LOG_INFO, "added ftp-account '" . $username . " (" . $path . ")'");
|
$log->logAction(USR_ACTION, LOG_INFO, "added ftp-account '" . $username . " (" . $path . ")'");
|
||||||
inserttask(5);
|
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'])))
|
||||||
|
);
|
||||||
|
|
||||||
|
$mail_body = replace_variables($lng['customer']['ftp_add']['infomail_body']['main'], $replace_arr);
|
||||||
|
|
||||||
|
$_mailerror = false;
|
||||||
|
try {
|
||||||
|
$mail->Subject = $lng['customer']['ftp_add']['infomail_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));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -205,6 +251,8 @@ elseif($page == 'accounts')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("ftp/accounts_add") . "\";");
|
eval("echo \"" . getTemplate("ftp/accounts_add") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -212,7 +260,7 @@ elseif($page == 'accounts')
|
|||||||
elseif($action == 'edit'
|
elseif($action == 'edit'
|
||||||
&& $id != 0)
|
&& $id != 0)
|
||||||
{
|
{
|
||||||
$result = $db->query_first("SELECT `id`, `username`, `homedir` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
$result = $db->query_first("SELECT `id`, `username`, `homedir`, `uid`, `gid` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||||
|
|
||||||
if(isset($result['username'])
|
if(isset($result['username'])
|
||||||
&& $result['username'] != '')
|
&& $result['username'] != '')
|
||||||
@@ -220,8 +268,18 @@ elseif($page == 'accounts')
|
|||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$password = validate($_POST['ftp_password'], 'password');
|
$path = validate($_POST['path'], 'path');
|
||||||
|
|
||||||
|
$_setnewpass = false;
|
||||||
|
if(isset($_POST['ftp_password']) && $_POST['ftp_password'] != '')
|
||||||
|
{
|
||||||
|
$password = validate($_POST['ftp_password'], 'password');
|
||||||
|
$password = validatePassword($password);
|
||||||
|
$_setnewpass = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($_setnewpass)
|
||||||
|
{
|
||||||
if($password == '')
|
if($password == '')
|
||||||
{
|
{
|
||||||
standard_error(array('stringisempty', 'mypassword'));
|
standard_error(array('stringisempty', 'mypassword'));
|
||||||
@@ -229,13 +287,55 @@ elseif($page == 'accounts')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$log->logAction(USR_ACTION, LOG_INFO, "updated ftp-account password for '" . $result['username'] . "'");
|
||||||
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `password`=ENCRYPT('" . $db->escape($password) . "') WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `password`=ENCRYPT('" . $db->escape($password) . "') WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||||
$log->logAction(USR_ACTION, LOG_INFO, "edited ftp-account '" . $result['username'] . "'");
|
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($path != '')
|
||||||
|
{
|
||||||
|
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||||
|
|
||||||
|
if($path != $result['homedir'])
|
||||||
|
{
|
||||||
|
if(!file_exists($path))
|
||||||
|
{
|
||||||
|
mkDirWithCorrectOwnership($userinfo['documentroot'], $path, $result['uid'], $result['gid']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$log->logAction(USR_ACTION, LOG_INFO, "updated ftp-account homdir for '" . $result['username'] . "'");
|
||||||
|
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `homedir`= '" . $db->escape($path) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if(strpos($result['homedir'], $userinfo['documentroot']) === 0)
|
||||||
|
{
|
||||||
|
$homedir = substr($result['homedir'], strlen($userinfo['documentroot']));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$homedir = $result['homedir'];
|
||||||
|
}
|
||||||
|
$homedir = makeCorrectDir($homedir);
|
||||||
|
|
||||||
|
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], $homedir);
|
||||||
|
|
||||||
|
if($settings['customer']['ftpatdomain'] == '1')
|
||||||
|
{
|
||||||
|
$domains = '';
|
||||||
|
|
||||||
|
$result_domains = $db->query("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||||
|
|
||||||
|
while($row_domain = $db->fetch_array($result_domains))
|
||||||
|
{
|
||||||
|
$domains.= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['domain']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("ftp/accounts_edit") . "\";");
|
eval("echo \"" . getTemplate("ftp/accounts_edit") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ define('AREA', 'customer');
|
|||||||
* Include our init.php, which manages Sessions, Language etc.
|
* Include our init.php, which manages Sessions, Language etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$need_db_sql_data = true;
|
||||||
$need_root_db_sql_data = true;
|
$need_root_db_sql_data = true;
|
||||||
require ("./lib/init.php");
|
require ("./lib/init.php");
|
||||||
|
|
||||||
@@ -138,6 +139,13 @@ elseif($page == 'mysqls')
|
|||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$password = validate($_POST['mysql_password'], 'password');
|
$password = validate($_POST['mysql_password'], 'password');
|
||||||
|
$password = validatePassword($password);
|
||||||
|
|
||||||
|
$sendinfomail = intval($_POST['sendinfomail']);
|
||||||
|
if($sendinfomail != 1)
|
||||||
|
{
|
||||||
|
$sendinfomail = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if($password == '')
|
if($password == '')
|
||||||
{
|
{
|
||||||
@@ -183,6 +191,50 @@ elseif($page == 'mysqls')
|
|||||||
$databasedescription = validate($_POST['description'], 'description');
|
$databasedescription = validate($_POST['description'], 'description');
|
||||||
$result = $db->query('INSERT INTO `' . TABLE_PANEL_DATABASES . '` (`customerid`, `databasename`, `description`, `dbserver`) VALUES ("' . (int)$userinfo['customerid'] . '", "' . $db->escape($username) . '", "' . $db->escape($databasedescription) . '", "' . $db->escape($dbserver) . '")');
|
$result = $db->query('INSERT INTO `' . TABLE_PANEL_DATABASES . '` (`customerid`, `databasename`, `description`, `dbserver`) VALUES ("' . (int)$userinfo['customerid'] . '", "' . $db->escape($username) . '", "' . $db->escape($databasedescription) . '", "' . $db->escape($dbserver) . '")');
|
||||||
$result = $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`+1, `mysql_lastaccountnumber`=`mysql_lastaccountnumber`+1 WHERE `customerid`="' . (int)$userinfo['customerid'] . '"');
|
$result = $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`+1, `mysql_lastaccountnumber`=`mysql_lastaccountnumber`+1 WHERE `customerid`="' . (int)$userinfo['customerid'] . '"');
|
||||||
|
|
||||||
|
if($sendinfomail == 1)
|
||||||
|
{
|
||||||
|
$pma = '';
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
$replace_arr = array(
|
||||||
|
'CUST_NAME' => getCorrectUserSalutation($userinfo),
|
||||||
|
'DB_NAME' => $username,
|
||||||
|
'DB_PASS' => $password,
|
||||||
|
'DB_DESC' => $databasedescription,
|
||||||
|
'DB_SRV' => $sql_root[$dbserver]['host'],
|
||||||
|
'PMA_URI' => $pma
|
||||||
|
);
|
||||||
|
|
||||||
|
$mail_body = replace_variables($lng['customer']['mysql_add']['infomail_body']['main'], $replace_arr);
|
||||||
|
|
||||||
|
$_mailerror = false;
|
||||||
|
try {
|
||||||
|
$mail->Subject = $lng['customer']['mysql_add']['infomail_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));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -195,6 +247,8 @@ elseif($page == 'mysqls')
|
|||||||
$mysql_servers .= makeoption($mysql_server_details['caption'], $mysql_server);
|
$mysql_servers .= makeoption($mysql_server_details['caption'], $mysql_server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("mysql/mysqls_add") . "\";");
|
eval("echo \"" . getTemplate("mysql/mysqls_add") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -218,6 +272,7 @@ elseif($page == 'mysqls')
|
|||||||
// Only change Password if it is set, do nothing if it is empty! -- PH 2004-11-29
|
// Only change Password if it is set, do nothing if it is empty! -- PH 2004-11-29
|
||||||
|
|
||||||
$password = validate($_POST['mysql_password'], 'password');
|
$password = validate($_POST['mysql_password'], 'password');
|
||||||
|
$password = validatePassword($password);
|
||||||
|
|
||||||
if($password != '')
|
if($password != '')
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -209,12 +209,12 @@ elseif($page == 'tickets')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$categories = '';
|
$categories = '';
|
||||||
$result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `name` ASC');
|
$result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `logicalorder`, `name` ASC');
|
||||||
|
|
||||||
if(isset($result['name'])
|
if(isset($result['name'])
|
||||||
&& $result['name'] != '')
|
&& $result['name'] != '')
|
||||||
{
|
{
|
||||||
$result2 = $db->query('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `name` ASC');
|
$result2 = $db->query('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `logicalorder`, `name` ASC');
|
||||||
|
|
||||||
while($row = $db->fetch_array($result2))
|
while($row = $db->fetch_array($result2))
|
||||||
{
|
{
|
||||||
@@ -226,9 +226,9 @@ elseif($page == 'tickets')
|
|||||||
$categories = makeoption($lng['ticket']['no_cat'], '0');
|
$categories = makeoption($lng['ticket']['no_cat'], '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
$priorities = makeoption($lng['ticket']['unf_high'], '1');
|
$priorities = makeoption($lng['ticket']['unf_high'], '1', $settings['ticket']['default_priority']);
|
||||||
$priorities.= makeoption($lng['ticket']['unf_normal'], '2');
|
$priorities.= makeoption($lng['ticket']['unf_normal'], '2', $settings['ticket']['default_priority']);
|
||||||
$priorities.= makeoption($lng['ticket']['unf_low'], '3');
|
$priorities.= makeoption($lng['ticket']['unf_low'], '3', $settings['ticket']['default_priority']);
|
||||||
$ticketsopen = 0;
|
$ticketsopen = 0;
|
||||||
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||||
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ if(!is_null($month)
|
|||||||
WHERE `customerid`='" . $userinfo['customerid'] . "'
|
WHERE `customerid`='" . $userinfo['customerid'] . "'
|
||||||
AND `month` = '" . $month . "'
|
AND `month` = '" . $month . "'
|
||||||
AND `year` = '" . $year . "'");
|
AND `year` = '" . $year . "'");
|
||||||
rsort($row = mysql_fetch_row($result));
|
$row = mysql_fetch_row($result);
|
||||||
|
rsort($row);
|
||||||
$traf['max'] = ($row[0] > $row[1] ? ($row[0] > $row[2] ? $row[0] : $row[2]) : ($row[1] > $row[2] ? $row[1] : $row[2]));;
|
$traf['max'] = ($row[0] > $row[1] ? ($row[0] > $row[2] ? $row[0] : $row[2]) : ($row[1] > $row[2] ? $row[1] : $row[2]));;
|
||||||
$result = $db->query("SELECT
|
$result = $db->query("SELECT
|
||||||
SUM(`http`) as 'http', SUM(`ftp_up`) AS 'ftp_up', SUM(`ftp_down`) as 'ftp_down', SUM(`mail`) as 'mail',
|
SUM(`http`) as 'http', SUM(`ftp_up`) AS 'ftp_up', SUM(`ftp_down`) as 'ftp_down', SUM(`mail`) as 'mail',
|
||||||
@@ -173,17 +174,22 @@ if(!is_null($month)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result = $db->query("(SELECT SUM(`http`) as sum FROM `" . TABLE_PANEL_TRAFFIC . "`
|
$result = $db->query("SELECT MAX(`http`), MAX(`ftp_up`+`ftp_down`), MAX(`mail`)
|
||||||
|
FROM `" . TABLE_PANEL_TRAFFIC . "`
|
||||||
WHERE `customerid`='" . $userinfo['customerid'] . "'
|
WHERE `customerid`='" . $userinfo['customerid'] . "'
|
||||||
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12) UNION
|
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12");
|
||||||
(SELECT SUM(`ftp_up`+`ftp_down`) FROM `" . TABLE_PANEL_TRAFFIC . "`
|
|
||||||
WHERE `customerid` = '" . $userinfo['customerid'] . "'
|
$nums = mysql_num_rows($result);
|
||||||
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12) UNION
|
if($nums > 0)
|
||||||
(SELECT SUM(`mail`) FROM `" . TABLE_PANEL_TRAFFIC . "`
|
{
|
||||||
WHERE `customerid` = '" . $userinfo['customerid'] . "'
|
$row = mysql_fetch_row($result);
|
||||||
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12) ORDER BY sum DESC LIMIT 1");
|
rsort($row);
|
||||||
$row = $db->fetch_array($result);
|
$traf['max'] = ($row[0] > $row[1] ? ($row[0] > $row[2] ? $row[0] : $row[2]) : ($row[1] > $row[2] ? $row[1] : $row[2]));
|
||||||
$traf['max'] = ($row[0] > $row[1] ? ($row[0] > $row[2] ? $row[0] : $row[2]) : ($row[1] > $row[2] ? $row[1] : $row[2]));;
|
} else {
|
||||||
|
// no records yet
|
||||||
|
$traf['max'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$result = $db->query("SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail
|
$result = $db->query("SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail
|
||||||
FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `customerid` = '" . $userinfo['customerid'] . "'
|
FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `customerid` = '" . $userinfo['customerid'] . "'
|
||||||
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12");
|
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12");
|
||||||
|
|||||||
74
index.php
74
index.php
@@ -213,10 +213,12 @@ if($action == 'login')
|
|||||||
|
|
||||||
if($action == 'forgotpwd')
|
if($action == 'forgotpwd')
|
||||||
{
|
{
|
||||||
|
$adminchecked = false;
|
||||||
|
$message = '';
|
||||||
|
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$adminchecked = false;
|
|
||||||
$loginname = validate($_POST['loginname'], 'loginname');
|
$loginname = validate($_POST['loginname'], 'loginname');
|
||||||
$email = validateEmail($_POST['loginemail'], 'email');
|
$email = validateEmail($_POST['loginemail'], 'email');
|
||||||
$sql = "SELECT `customerid`, `firstname`, `name`, `email`, `loginname` FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
$sql = "SELECT `customerid`, `firstname`, `name`, `email`, `loginname` FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
||||||
@@ -226,13 +228,23 @@ if($action == 'forgotpwd')
|
|||||||
|
|
||||||
if($db->num_rows() == 0)
|
if($db->num_rows() == 0)
|
||||||
{
|
{
|
||||||
$sql = "SELECT `adminid`, `firstname`, `name`, `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "`
|
$sql = "SELECT `adminid`, `name`, `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "`
|
||||||
WHERE `loginname`='" . $db->escape($loginname) . "'
|
WHERE `loginname`='" . $db->escape($loginname) . "'
|
||||||
AND `email`='" . $db->escape($email) . "'";
|
AND `email`='" . $db->escape($email) . "'";
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
|
if($db->num_rows() > 0)
|
||||||
|
{
|
||||||
$adminchecked = true;
|
$adminchecked = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$result = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($result !== null)
|
||||||
|
{
|
||||||
$user = $db->fetch_array($result);
|
$user = $db->fetch_array($result);
|
||||||
|
|
||||||
if(($adminchecked && $settings['panel']['allow_preset_admin'] == '1')
|
if(($adminchecked && $settings['panel']['allow_preset_admin'] == '1')
|
||||||
@@ -240,7 +252,18 @@ if($action == 'forgotpwd')
|
|||||||
{
|
{
|
||||||
if($user !== false)
|
if($user !== false)
|
||||||
{
|
{
|
||||||
|
if ($settings['panel']['password_min_length'] <= 6) {
|
||||||
$password = substr(md5(uniqid(microtime(), 1)), 12, 6);
|
$password = substr(md5(uniqid(microtime(), 1)), 12, 6);
|
||||||
|
} else {
|
||||||
|
// make it two times larger than password_min_length
|
||||||
|
$rnd = '';
|
||||||
|
$minlength = $settings['panel']['password_min_length'];
|
||||||
|
while (strlen($rnd) < ($minlength * 2))
|
||||||
|
{
|
||||||
|
$rnd .= md5(uniqid(microtime(), 1));
|
||||||
|
}
|
||||||
|
$password = substr($rnd, (int)($minlength / 2), $minlength);
|
||||||
|
}
|
||||||
|
|
||||||
if($adminchecked)
|
if($adminchecked)
|
||||||
{
|
{
|
||||||
@@ -258,23 +281,23 @@ if($action == 'forgotpwd')
|
|||||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
|
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
|
||||||
$rstlog->logAction(USR_ACTION, LOG_WARNING, "Password for user '" . $user['loginname'] . "' has been reset!");
|
$rstlog->logAction(USR_ACTION, LOG_WARNING, "Password for user '" . $user['loginname'] . "' has been reset!");
|
||||||
$body = strtr($lng['pwdreminder']['body'], array('%s' => $user['firstname'] . ' ' . $user['name'], '%p' => $password));
|
$body = strtr($lng['pwdreminder']['body'], array('%s' => $user['firstname'] . ' ' . $user['name'], '%p' => $password));
|
||||||
$mail->From = $settings['panel']['adminmail'];
|
|
||||||
$mail->FromName = 'Froxlor';
|
$_mailerror = false;
|
||||||
|
try {
|
||||||
$mail->Subject = $lng['pwdreminder']['subject'];
|
$mail->Subject = $lng['pwdreminder']['subject'];
|
||||||
$mail->Body = $body;
|
$mail->AltBody = $body;
|
||||||
|
$mail->MsgHTML(str_replace("\\n", "<br />", $body));
|
||||||
$mail->AddAddress($user['email'], $user['firstname'] . ' ' . $user['name']);
|
$mail->AddAddress($user['email'], $user['firstname'] . ' ' . $user['name']);
|
||||||
|
$mail->Send();
|
||||||
if(!$mail->Send())
|
} catch(phpmailerException $e) {
|
||||||
{
|
$mailerr_msg = $e->errorMessage();
|
||||||
if($mail->ErrorInfo != '')
|
$_mailerror = true;
|
||||||
{
|
} catch (Exception $e) {
|
||||||
$mailerr_msg = $mail->ErrorInfo;
|
$mailerr_msg = $e->getMessage();
|
||||||
}
|
$_mailerror = true;
|
||||||
else
|
|
||||||
{
|
|
||||||
$mailerr_msg = $email;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($_mailerror) {
|
||||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
|
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
|
||||||
$rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
$rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
||||||
redirectTo('index.php', Array('showmessage' => '4'), true);
|
redirectTo('index.php', Array('showmessage' => '4'), true);
|
||||||
@@ -292,22 +315,27 @@ if($action == 'forgotpwd')
|
|||||||
$message = $lng['login']['usernotfound'];
|
$message = $lng['login']['usernotfound'];
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($user, $adminchecked);
|
unset($user);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$message = '';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$message = '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if($adminchecked)
|
||||||
|
{
|
||||||
|
if($settings['panel']['allow_preset_admin'] != '1')
|
||||||
|
{
|
||||||
|
$message = $lng['pwdreminder']['notallowed'];
|
||||||
|
unset ($adminchecked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if($settings['panel']['allow_preset'] != '1')
|
if($settings['panel']['allow_preset'] != '1')
|
||||||
{
|
{
|
||||||
$message = $lng['pwdreminder']['notallowed'];
|
$message = $lng['pwdreminder']['notallowed'];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("fpwd") . "\";");
|
eval("echo \"" . getTemplate("fpwd") . "\";");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ CREATE TABLE `panel_domains` (
|
|||||||
`isbinddomain` tinyint(1) NOT NULL default '0',
|
`isbinddomain` tinyint(1) NOT NULL default '0',
|
||||||
`isemaildomain` tinyint(1) NOT NULL default '0',
|
`isemaildomain` tinyint(1) NOT NULL default '0',
|
||||||
`email_only` tinyint(1) NOT NULL default '0',
|
`email_only` tinyint(1) NOT NULL default '0',
|
||||||
`iswildcarddomain` tinyint(1) NOT NULL default '0',
|
`iswildcarddomain` tinyint(1) NOT NULL default '1',
|
||||||
`subcanemaildomain` tinyint(1) NOT NULL default '0',
|
`subcanemaildomain` tinyint(1) NOT NULL default '0',
|
||||||
`caneditdomain` tinyint(1) NOT NULL default '1',
|
`caneditdomain` tinyint(1) NOT NULL default '1',
|
||||||
`zonefile` varchar(255) NOT NULL default '',
|
`zonefile` varchar(255) NOT NULL default '',
|
||||||
@@ -451,7 +451,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 (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 (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 (20, 'system', 'bindreload_command', '/etc/init.d/bind9 reload');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9.7');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (23, 'system', 'hostname', 'SERVERNAME');
|
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 (24, 'login', 'maxloginattempts', '3');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (25, 'login', 'deactivatetime', '900');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (25, 'login', 'deactivatetime', '900');
|
||||||
@@ -508,48 +508,69 @@ INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) V
|
|||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (77, 'dkim', 'use_dkim', '0');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (77, 'dkim', 'use_dkim', '0');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (78, 'system', 'webalizer_enabled', '1');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (78, 'system', 'webalizer_enabled', '1');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (79, 'system', 'awstats_enabled', '0');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (79, 'system', 'awstats_enabled', '0');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (80, 'system', 'awstats_domain_file', '/etc/awstats/');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (80, 'dkim', 'dkim_prefix', '/etc/postfix/dkim/');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (81, 'system', 'awstats_model_file', '/etc/awstats/awstats.model.conf.froxlor');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (81, 'dkim', 'dkim_domains', 'domains');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (82, 'dkim', 'dkim_prefix', '/etc/postfix/dkim/');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (82, 'dkim', 'dkim_dkimkeys', 'dkim-keys.conf');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (83, 'dkim', 'dkim_domains', 'domains');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (83, 'dkim', 'dkimrestart_command', '/etc/init.d/dkim-filter restart');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (84, 'dkim', 'dkim_dkimkeys', 'dkim-keys.conf');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (84, 'panel', 'unix_names', '1');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (85, 'dkim', 'dkimrestart_command', '/etc/init.d/dkim-filter restart');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (85, 'panel', 'allow_preset', '1');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (86, 'panel', 'unix_names', '1');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (86, 'panel', 'allow_preset_admin', '0');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (87, 'panel', 'allow_preset', '1');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (87, 'system', 'httpuser', 'www-data');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (88, 'system', 'awstats_path', '/usr/share/awstats/VERSION/webroot/cgi-bin/');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (88, 'system', 'httpgroup', 'www-data');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (89, 'system', 'awstats_updateall_command', '/usr/bin/awstats_updateall.pl');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (89, 'system', 'webserver', 'apache2');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (90, 'panel', 'allow_preset_admin', '0');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (90, 'autoresponder', 'autoresponder_active', '0');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (91, 'system', 'httpuser', 'www-data');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (91, 'autoresponder', 'last_autoresponder_run', '0');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (92, 'system', 'httpgroup', 'www-data');
|
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, 'system', 'webserver', 'apache2');
|
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, 'autoresponder', 'autoresponder_active', '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, 'autoresponder', 'last_autoresponder_run', '0');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (95, 'system', 'mod_fcgid_wrapper', '0');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (96, 'admin', 'show_version_login', '0');
|
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, 'admin', 'show_version_footer', '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, 'admin', 'froxlor_graphic', 'images/header.png');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (98, 'system', 'index_file_extension', 'html');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (99, 'system', 'mod_fcgid_wrapper', '0');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (99, 'aps', 'items_per_page', '20');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (100, 'system', 'mod_fcgid_starter', '0');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (100, 'aps', 'upload_fields', '5');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (101, 'system', 'mod_fcgid_peardir', '/usr/share/php/:/usr/share/php5/');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (101, 'aps', 'aps_active', '0');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (102, 'system', 'index_file_extension', 'html');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (102, 'aps', 'php-extension', '');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (103, 'aps', 'items_per_page', '20');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (103, 'aps', 'php-configuration', '');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (104, 'aps', 'upload_fields', '5');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (104, 'aps', 'webserver-htaccess', '');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (105, 'aps', 'aps_active', '0');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (105, 'aps', 'php-function', '');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (1069, 'aps', 'php-extension', '');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (106, 'aps', 'webserver-module', '');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (107, 'aps', 'php-configuration', '');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (107, 'system', 'realtime_port', '0');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (108, 'aps', 'webserver-htaccess', '');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (108, 'session', 'allow_multiple_login', '0');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (109, 'aps', 'php-function', '');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (109, 'panel', 'allow_domain_change_admin', '0');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (110, 'aps', 'webserver-module', '');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (110, 'panel', 'allow_domain_change_customer', '0');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (111, 'system', 'realtime_port', '0');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (111, 'system', 'mod_fcgid_maxrequests', '250');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (112, 'session', 'allow_multiple_login', '0');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (112, 'system','ssl_key_file','/etc/apache2/apache2.key');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (113, 'panel', 'allow_domain_change_admin', '0');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (113, 'system','ssl_ca_file','');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (114, 'panel', 'allow_domain_change_customer', '0');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (114, 'panel', 'frontend', 'froxlor');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (115, 'system', 'mod_fcgid_maxrequests', '250');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (115, 'spf', 'use_spf', '0');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (116, 'system','ssl_key_file','/etc/apache2/apache2.key');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (116, 'spf', 'spf_entry', '@ IN TXT "v=spf1 a mx -all"');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (117, 'system','ssl_ca_file','');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (117, 'system', 'debug_cron', '0');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (118, 'panel', 'frontend', 'froxlor');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (118, 'panel', 'password_min_length', '0');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (119, 'spf', 'use_spf', '0');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (119, 'system', 'store_index_file_subs', '1');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (120, 'spf', 'spf_entry', '@ IN TXT "v=spf1 a mx -all"');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (120, 'panel', 'adminmail_defname', 'Froxlor Administrator');
|
||||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (121, 'system', 'debug_cron', '0');
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (121, 'panel', 'adminmail_return', '');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (122, 'dkim', 'dkim_algorithm', 'all');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (123, 'dkim', 'dkim_add_adsp', '1');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (124, 'dkim', 'dkim_keylength', '1024');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (125, 'dkim', 'dkim_servicetype', '0');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (126, 'dkim', 'dkim_add_adsppolicy', '1');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (127, 'dkim', 'dkim_notes', '');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (128, 'system', 'stdsubdomain', '');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (129, 'system', 'awstats_path', '/usr/bin/');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (130, 'system', 'awstats_conf', '/etc/awstats/');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (131, 'system', 'defaultttl', '604800');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (132, 'defaultwebsrverrhandler', 'enabled', '0');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (133, 'defaultwebsrverrhandler', 'err401', '');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (134, 'defaultwebsrverrhandler', 'err403', '');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (135, 'defaultwebsrverrhandler', 'err404', '');
|
||||||
|
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (136, 'defaultwebsrverrhandler', 'err500', '');
|
||||||
|
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');
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
|
|
||||||
@@ -731,6 +752,7 @@ INSERT INTO `panel_languages` VALUES (13, 'Dutch', 'lng/dutch.lng.php');
|
|||||||
INSERT INTO `panel_languages` VALUES (14, 'Hungarian', 'lng/hungarian.lng.php');
|
INSERT INTO `panel_languages` VALUES (14, 'Hungarian', 'lng/hungarian.lng.php');
|
||||||
INSERT INTO `panel_languages` VALUES (15, 'Swedish', 'lng/swedish.lng.php');
|
INSERT INTO `panel_languages` VALUES (15, 'Swedish', 'lng/swedish.lng.php');
|
||||||
INSERT INTO `panel_languages` VALUES (16, 'Czech', 'lng/czech.lng.php');
|
INSERT INTO `panel_languages` VALUES (16, 'Czech', 'lng/czech.lng.php');
|
||||||
|
INSERT INTO `panel_languages` VALUES (17, 'Polski', 'lng/polish.lng.php');
|
||||||
|
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
|
|
||||||
@@ -771,6 +793,7 @@ CREATE TABLE `panel_ticket_categories` (
|
|||||||
`id` smallint(5) unsigned NOT NULL auto_increment,
|
`id` smallint(5) unsigned NOT NULL auto_increment,
|
||||||
`name` varchar(60) NOT NULL,
|
`name` varchar(60) NOT NULL,
|
||||||
`adminid` int(11) NOT NULL,
|
`adminid` int(11) NOT NULL,
|
||||||
|
`logicalorder` int(3) NOT NULL default '1',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=MyISAM;
|
) ENGINE=MyISAM;
|
||||||
|
|
||||||
@@ -807,6 +830,7 @@ CREATE TABLE IF NOT EXISTS `panel_syslog` (
|
|||||||
# Table structure for table `mail_autoresponder`
|
# Table structure for table `mail_autoresponder`
|
||||||
#
|
#
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `mail_autoresponder`;
|
||||||
CREATE TABLE `mail_autoresponder` (
|
CREATE TABLE `mail_autoresponder` (
|
||||||
`email` varchar(255) NOT NULL default '',
|
`email` varchar(255) NOT NULL default '',
|
||||||
`message` text NOT NULL,
|
`message` text NOT NULL,
|
||||||
@@ -831,6 +855,7 @@ CREATE TABLE `mail_autoresponder` (
|
|||||||
# Table structure for table `panel_phpconfigs`
|
# Table structure for table `panel_phpconfigs`
|
||||||
#
|
#
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `panel_phpconfigs`;
|
||||||
CREATE TABLE `panel_phpconfigs` (
|
CREATE TABLE `panel_phpconfigs` (
|
||||||
`id` int(11) unsigned NOT NULL auto_increment,
|
`id` int(11) unsigned NOT NULL auto_increment,
|
||||||
`description` varchar(50) NOT NULL,
|
`description` varchar(50) NOT NULL,
|
||||||
@@ -854,6 +879,7 @@ INSERT INTO `panel_phpconfigs` (`id`, `description`, `binary`, `file_extensions`
|
|||||||
# Tabellenstruktur fuer Tabelle `aps_instances`
|
# Tabellenstruktur fuer Tabelle `aps_instances`
|
||||||
#
|
#
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `aps_instances`;
|
||||||
CREATE TABLE IF NOT EXISTS `aps_instances` (
|
CREATE TABLE IF NOT EXISTS `aps_instances` (
|
||||||
`ID` int(4) NOT NULL auto_increment,
|
`ID` int(4) NOT NULL auto_increment,
|
||||||
`CustomerID` int(4) NOT NULL,
|
`CustomerID` int(4) NOT NULL,
|
||||||
@@ -868,6 +894,7 @@ CREATE TABLE IF NOT EXISTS `aps_instances` (
|
|||||||
# Tabellenstruktur fuer Tabelle `aps_packages`
|
# Tabellenstruktur fuer Tabelle `aps_packages`
|
||||||
#
|
#
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `aps_packages`;
|
||||||
CREATE TABLE IF NOT EXISTS `aps_packages` (
|
CREATE TABLE IF NOT EXISTS `aps_packages` (
|
||||||
`ID` int(4) NOT NULL auto_increment,
|
`ID` int(4) NOT NULL auto_increment,
|
||||||
`Path` varchar(500) NOT NULL,
|
`Path` varchar(500) NOT NULL,
|
||||||
@@ -884,6 +911,7 @@ CREATE TABLE IF NOT EXISTS `aps_packages` (
|
|||||||
# Tabellenstruktur fuer Tabelle `aps_settings`
|
# Tabellenstruktur fuer Tabelle `aps_settings`
|
||||||
#
|
#
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `aps_settings`;
|
||||||
CREATE TABLE IF NOT EXISTS `aps_settings` (
|
CREATE TABLE IF NOT EXISTS `aps_settings` (
|
||||||
`ID` int(4) NOT NULL auto_increment,
|
`ID` int(4) NOT NULL auto_increment,
|
||||||
`InstanceID` int(4) NOT NULL,
|
`InstanceID` int(4) NOT NULL,
|
||||||
@@ -898,6 +926,7 @@ CREATE TABLE IF NOT EXISTS `aps_settings` (
|
|||||||
# Tabellenstruktur fuer Tabelle `aps_tasks`
|
# Tabellenstruktur fuer Tabelle `aps_tasks`
|
||||||
#
|
#
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `aps_tasks`;
|
||||||
CREATE TABLE IF NOT EXISTS `aps_tasks` (
|
CREATE TABLE IF NOT EXISTS `aps_tasks` (
|
||||||
`ID` int(4) NOT NULL auto_increment,
|
`ID` int(4) NOT NULL auto_increment,
|
||||||
`InstanceID` int(4) NOT NULL,
|
`InstanceID` int(4) NOT NULL,
|
||||||
@@ -911,6 +940,7 @@ CREATE TABLE IF NOT EXISTS `aps_tasks` (
|
|||||||
# Tabellenstruktur fuer Tabelle `aps_temp_settings`
|
# Tabellenstruktur fuer Tabelle `aps_temp_settings`
|
||||||
#
|
#
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `aps_temp_settings`;
|
||||||
CREATE TABLE IF NOT EXISTS `aps_temp_settings` (
|
CREATE TABLE IF NOT EXISTS `aps_temp_settings` (
|
||||||
`ID` int(4) NOT NULL auto_increment,
|
`ID` int(4) NOT NULL auto_increment,
|
||||||
`PackageID` int(4) NOT NULL,
|
`PackageID` int(4) NOT NULL,
|
||||||
@@ -926,6 +956,7 @@ CREATE TABLE IF NOT EXISTS `aps_temp_settings` (
|
|||||||
# Tabellenstruktur fuer Tabelle `cronjobs_run`
|
# Tabellenstruktur fuer Tabelle `cronjobs_run`
|
||||||
#
|
#
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `cronjobs_run`;
|
||||||
CREATE TABLE IF NOT EXISTS `cronjobs_run` (
|
CREATE TABLE IF NOT EXISTS `cronjobs_run` (
|
||||||
`id` bigint(20) NOT NULL auto_increment,
|
`id` bigint(20) NOT NULL auto_increment,
|
||||||
`module` varchar(250) NOT NULL,
|
`module` varchar(250) NOT NULL,
|
||||||
@@ -949,3 +980,85 @@ INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`,
|
|||||||
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 (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 MONTH', '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');
|
INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (8, 'froxlor/ticket', 'cron_ticketarchive.php', '1 MONTH', '1', 'cron_ticketarchive');
|
||||||
|
|
||||||
|
# --------------------------------------------------------
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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',
|
||||||
|
`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;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Dumping data for table `ftp_quotalimits`
|
||||||
|
#
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
# --------------------------------------------------------
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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,
|
||||||
|
`bytes_in_used` float NOT NULL,
|
||||||
|
`bytes_out_used` float NOT NULL,
|
||||||
|
`bytes_xfer_used` float NOT NULL,
|
||||||
|
`files_in_used` int(10) unsigned NOT NULL,
|
||||||
|
`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;
|
||||||
|
|||||||
@@ -156,6 +156,121 @@ function status_message($case, $text)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function requirement_checks()
|
||||||
|
{
|
||||||
|
global $lng;
|
||||||
|
page_header();
|
||||||
|
|
||||||
|
?>
|
||||||
|
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable">
|
||||||
|
<tr>
|
||||||
|
<td class="maintitle"><b><img src="../images/title.gif" alt="" /> Froxlor Installation</b></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
$_die = false;
|
||||||
|
|
||||||
|
// check for correct php version
|
||||||
|
status_message('begin', $lng['install']['phpversion']);
|
||||||
|
|
||||||
|
if(version_compare("5.2.0", PHP_VERSION, ">="))
|
||||||
|
{
|
||||||
|
status_message('red', $lng['install']['notinstalled']);
|
||||||
|
$_die = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
status_message('green', 'OK');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_message('begin', $lng['install']['phpmysql']);
|
||||||
|
|
||||||
|
if(!extension_loaded('mysql'))
|
||||||
|
{
|
||||||
|
status_message('red', $lng['install']['notinstalled']);
|
||||||
|
$_die = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
status_message('green', 'OK');
|
||||||
|
}
|
||||||
|
|
||||||
|
status_message('begin', $lng['install']['phpfilter']);
|
||||||
|
|
||||||
|
if(!extension_loaded('filter'))
|
||||||
|
{
|
||||||
|
status_message('red', $lng['install']['notinstalled']);
|
||||||
|
$_die = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
status_message('green', 'OK');
|
||||||
|
}
|
||||||
|
|
||||||
|
status_message('begin', $lng['install']['phpposix']);
|
||||||
|
|
||||||
|
if(!extension_loaded('posix'))
|
||||||
|
{
|
||||||
|
status_message('red', $lng['install']['notinstalled']);
|
||||||
|
$_die = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
status_message('green', 'OK');
|
||||||
|
}
|
||||||
|
|
||||||
|
status_message('begin', $lng['install']['phpbcmath']);
|
||||||
|
|
||||||
|
if(!extension_loaded('bcmath'))
|
||||||
|
{
|
||||||
|
status_message('orange', $lng['install']['notinstalled'] . '<br />' . $lng['install']['bcmathdescription']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
status_message('green', 'OK');
|
||||||
|
}
|
||||||
|
|
||||||
|
status_message('begin', $lng['install']['openbasedir']);
|
||||||
|
$php_ob = @ini_get("open_basedir");
|
||||||
|
|
||||||
|
if(!empty($php_ob)
|
||||||
|
&& $php_ob != '')
|
||||||
|
{
|
||||||
|
status_message('orange', $lng['install']['openbasedirenabled']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
status_message('green', 'OK');
|
||||||
|
}
|
||||||
|
|
||||||
|
if($_die)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td class="main_field_display" align="center">
|
||||||
|
<?php echo $lng['install']['diedbecauseofrequirements']; ?><br />
|
||||||
|
<a href="install.php"><?php echo $lng['install']['click_here_to_refresh']; ?></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td class="main_field_display" align="center">
|
||||||
|
<?php echo $lng['install']['froxlor_succ_checks']; ?><br />
|
||||||
|
<a href="install.php?check=1"><?php echo $lng['install']['click_here_to_continue']; ?></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</table>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<?php
|
||||||
|
page_footer();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* END FUNCTIONS ---------------------------------------------------
|
* END FUNCTIONS ---------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@@ -174,7 +289,7 @@ else
|
|||||||
{
|
{
|
||||||
if(!empty($_SERVER['SERVER_NAME']))
|
if(!empty($_SERVER['SERVER_NAME']))
|
||||||
{
|
{
|
||||||
if(validate_ip($_SERVER['SERVER_NAME'], true) == false)
|
if(preg_match('/^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$/', $_SERVER['SERVER_NAME']) == false)
|
||||||
{
|
{
|
||||||
$servername = $_SERVER['SERVER_NAME'];
|
$servername = $_SERVER['SERVER_NAME'];
|
||||||
}
|
}
|
||||||
@@ -307,12 +422,12 @@ if(!empty($_POST['webserver']))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(strtoupper(@php_sapi_name()) == "APACHE2HANDLER"
|
if(strtoupper(@php_sapi_name()) == "APACHE2HANDLER"
|
||||||
|| stristr($_SERVER[SERVER_SOFTWARE], "apache/2"))
|
|| stristr($_SERVER['SERVER_SOFTWARE'], "apache/2"))
|
||||||
{
|
{
|
||||||
$webserver = 'apache2';
|
$webserver = 'apache2';
|
||||||
}
|
}
|
||||||
elseif(substr(strtoupper(@php_sapi_name()), 0, 8) == "LIGHTTPD"
|
elseif(substr(strtoupper(@php_sapi_name()), 0, 8) == "LIGHTTPD"
|
||||||
|| stristr($_SERVER[SERVER_SOFTWARE], "lighttpd"))
|
|| stristr($_SERVER['SERVER_SOFTWARE'], "lighttpd"))
|
||||||
{
|
{
|
||||||
$webserver = 'lighttpd';
|
$webserver = 'lighttpd';
|
||||||
}
|
}
|
||||||
@@ -371,89 +486,6 @@ if(isset($_POST['installstep'])
|
|||||||
<td class="maintitle"><b><img src="../images/title.gif" alt="" /> Froxlor Installation</b></td>
|
<td class="maintitle"><b><img src="../images/title.gif" alt="" /> Froxlor Installation</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
$_die = false;
|
|
||||||
|
|
||||||
// check for correct php version
|
|
||||||
status_message('begin', $lng['install']['phpversion']);
|
|
||||||
|
|
||||||
if(version_compare("5.2.0", PHP_VERSION, ">="))
|
|
||||||
{
|
|
||||||
status_message('red', $lng['install']['notinstalled']);
|
|
||||||
$_die = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
status_message('green', 'OK');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_message('begin', $lng['install']['phpmysql']);
|
|
||||||
|
|
||||||
if(!extension_loaded('mysql'))
|
|
||||||
{
|
|
||||||
status_message('red', $lng['install']['notinstalled']);
|
|
||||||
$_die = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
status_message('green', 'OK');
|
|
||||||
}
|
|
||||||
|
|
||||||
status_message('begin', $lng['install']['phpfilter']);
|
|
||||||
|
|
||||||
if(!extension_loaded('filter'))
|
|
||||||
{
|
|
||||||
status_message('red', $lng['install']['notinstalled']);
|
|
||||||
$_die = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
status_message('green', 'OK');
|
|
||||||
}
|
|
||||||
|
|
||||||
status_message('begin', $lng['install']['phpposix']);
|
|
||||||
|
|
||||||
if(!extension_loaded('posix'))
|
|
||||||
{
|
|
||||||
status_message('red', $lng['install']['notinstalled']);
|
|
||||||
$_die = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
status_message('green', 'OK');
|
|
||||||
}
|
|
||||||
|
|
||||||
status_message('begin', $lng['install']['phpbcmath']);
|
|
||||||
|
|
||||||
if(!extension_loaded('bcmath'))
|
|
||||||
{
|
|
||||||
status_message('orange', $lng['install']['notinstalled'] . '<br />' . $lng['install']['bcmathdescription']);
|
|
||||||
$_die = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
status_message('green', 'OK');
|
|
||||||
}
|
|
||||||
|
|
||||||
status_message('begin', $lng['install']['openbasedir']);
|
|
||||||
$php_ob = @ini_get("open_basedir");
|
|
||||||
|
|
||||||
if(!empty($php_ob)
|
|
||||||
&& $php_ob != '')
|
|
||||||
{
|
|
||||||
status_message('orange', $lng['install']['openbasedirenabled']);
|
|
||||||
$_die = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
status_message('green', 'OK');
|
|
||||||
}
|
|
||||||
|
|
||||||
if($_die)
|
|
||||||
{
|
|
||||||
status_message('begin', $lng['install']['diedbecauseofrequirements']);
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
|
|
||||||
//first test if we can access the database server with the given root user and password
|
//first test if we can access the database server with the given root user and password
|
||||||
|
|
||||||
@@ -471,11 +503,27 @@ if(isset($_POST['installstep'])
|
|||||||
|
|
||||||
if($result)
|
if($result)
|
||||||
{
|
{
|
||||||
$filename = "/tmp/froxlor_backup_" . date(YmdHi) . ".sql";
|
$filename = "/tmp/froxlor_backup_" . date('YmdHi') . ".sql";
|
||||||
|
|
||||||
if(is_file("/usr/bin/mysqldump"))
|
if(is_file("/usr/bin/mysqldump"))
|
||||||
{
|
{
|
||||||
$command = "/usr/bin/mysqldump " . $mysql_database . " -u " . $mysql_root_user . " --password='" . $mysql_root_pass . "' --result-file=" . $filename;
|
$do_backup = true;
|
||||||
|
$mysql_dump = '/usr/bin/mysqldump';
|
||||||
|
}
|
||||||
|
elseif(is_file("/usr/local/bin/mysqldump"))
|
||||||
|
{
|
||||||
|
$do_backup = true;
|
||||||
|
$mysql_dump = '/usr/local/bin/mysqldump';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$do_backup = false;
|
||||||
|
status_message('red', $lng['install']['backing_up_binary_missing']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($do_backup) {
|
||||||
|
|
||||||
|
$command = $mysql_dump . " " . $mysql_database . " -u " . $mysql_root_user . " --password='" . $mysql_root_pass . "' --result-file=" . $filename;
|
||||||
$output = exec($command);
|
$output = exec($command);
|
||||||
|
|
||||||
if(stristr($output, "error"))
|
if(stristr($output, "error"))
|
||||||
@@ -486,10 +534,7 @@ if(isset($_POST['installstep'])
|
|||||||
{
|
{
|
||||||
status_message('green', 'OK');
|
status_message('green', 'OK');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
status_message('red', $lng['install']['backing_up_binary_missing']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -575,8 +620,6 @@ if(isset($_POST['installstep'])
|
|||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($webserver) . "' WHERE `settinggroup` = 'system' AND `varname` = 'webserver'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($webserver) . "' WHERE `settinggroup` = 'system' AND `varname` = 'webserver'");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($webserver) . "' WHERE `settinggroup` = 'system' AND `varname` = 'webserver'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($webserver) . "' WHERE `settinggroup` = 'system' AND `varname` = 'webserver'");
|
||||||
|
|
||||||
//FIXME
|
|
||||||
|
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($httpuser) . "' WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($httpuser) . "' WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($httpgroup) . "' WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($httpgroup) . "' WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'");
|
||||||
|
|
||||||
@@ -602,10 +645,22 @@ if(isset($_POST['installstep'])
|
|||||||
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
|
|
||||||
|
// set specific times for some crons (traffic only at night, etc.)
|
||||||
|
$ts = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
|
||||||
|
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_traffic.php';");
|
||||||
|
$ts = mktime(1, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
|
||||||
|
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_used_tickets_reset.php';");
|
||||||
|
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_ticketarchive.php';");
|
||||||
|
|
||||||
// and lets insert the default ip and port
|
// and lets insert the default ip and port
|
||||||
|
|
||||||
$query = 'INSERT INTO `%s` SET `ip` = \'%s\', `port` = \'80\' ';
|
$query = "INSERT INTO `".TABLE_PANEL_IPSANDPORTS."`
|
||||||
$query = sprintf($query, TABLE_PANEL_IPSANDPORTS, $db->escape($serverip));
|
SET `ip`= '".$db->escape($serverip)."',
|
||||||
|
`port` = '80',
|
||||||
|
`namevirtualhost_statement` = '1',
|
||||||
|
`vhostcontainer` = '1',
|
||||||
|
`vhostcontainer_servername_statement` = '1',
|
||||||
|
`specialsettings` = 'DocumentRoot \"".$db->escape(dirname(dirname(__FILE__))) . "\"'";
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
$defaultip = $db->insert_id();
|
$defaultip = $db->insert_id();
|
||||||
|
|
||||||
@@ -708,10 +763,17 @@ if(isset($_POST['installstep'])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if((isset($_GET['check'])
|
||||||
|
&& $_GET['check'] == '1')
|
||||||
|
|| (isset($_POST['installstep'])
|
||||||
|
&& $_POST['installstep'] == '1')
|
||||||
|
) {
|
||||||
page_header();
|
page_header();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="get">
|
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="get">
|
||||||
|
<input type="hidden" name="check" value="1" />
|
||||||
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_40">
|
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_40">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="maintitle" colspan="2"><b><img src="../images/title.gif" alt="" /> <?php echo $lng['install']['welcome']; ?></b></td>
|
<td class="maintitle" colspan="2"><b><img src="../images/title.gif" alt="" /> <?php echo $lng['install']['welcome']; ?></b></td>
|
||||||
@@ -746,6 +808,7 @@ else
|
|||||||
</form>
|
</form>
|
||||||
<br />
|
<br />
|
||||||
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="post">
|
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="post">
|
||||||
|
<input type="hidden" name="check" value="1" />
|
||||||
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_40">
|
<table cellpadding="5" cellspacing="4" border="0" align="center" class="maintable_40">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="maintitle" colspan="2"><b><img src="../images/title.gif" alt="" /> <?php echo $lng['install']['database']; ?></b></td>
|
<td class="maintitle" colspan="2"><b><img src="../images/title.gif" alt="" /> <?php echo $lng['install']['database']; ?></b></td>
|
||||||
@@ -822,6 +885,11 @@ else
|
|||||||
<?php
|
<?php
|
||||||
page_footer();
|
page_footer();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
requirement_checks();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* END INSTALL ---------------------------------------------------
|
* END INSTALL ---------------------------------------------------
|
||||||
|
|||||||
@@ -84,4 +84,11 @@ $lng['install']['webserver'] = 'Webserver';
|
|||||||
$lng['install']['phpversion'] = 'Checking for PHP version >= 5.2';
|
$lng['install']['phpversion'] = 'Checking for PHP version >= 5.2';
|
||||||
$lng['install']['phpposix'] = 'Testing if PHP posix-extension is installed...';
|
$lng['install']['phpposix'] = 'Testing if PHP posix-extension is installed...';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Added in Froxlor 0.9.4
|
||||||
|
*/
|
||||||
|
$lng['install']['click_here_to_refresh'] = 'Re-check';
|
||||||
|
$lng['install']['click_here_to_continue'] = 'Continue installation';
|
||||||
|
$lng['install']['froxlor_succ_checks'] = 'All requirements are satisfied';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ $lng['install']['next'] = 'Fortfahren';
|
|||||||
|
|
||||||
$lng['install']['testing_mysql'] = 'Teste, ob die MySQL-Root-Benutzerdaten richtig sind...';
|
$lng['install']['testing_mysql'] = 'Teste, ob die MySQL-Root-Benutzerdaten richtig sind...';
|
||||||
$lng['install']['erasing_old_db'] = 'Entferne alte Datenbank...';
|
$lng['install']['erasing_old_db'] = 'Entferne alte Datenbank...';
|
||||||
|
$lng['install']['backup_old_db'] = 'Sichere bisherige Datenbank...';
|
||||||
|
$lng['install']['backing_up'] = 'Sicherung läft';
|
||||||
|
$lng['install']['backing_up_binary_missing'] = '/usr/bin/mysqldump nicht vorhanden';
|
||||||
$lng['install']['create_mysqluser_and_db'] = 'Erstelle Datenbank und Benutzer...';
|
$lng['install']['create_mysqluser_and_db'] = 'Erstelle Datenbank und Benutzer...';
|
||||||
$lng['install']['testing_new_db'] = 'Teste, ob die Datenbank und Passwort korrekt angelegt wurden...';
|
$lng['install']['testing_new_db'] = 'Teste, ob die Datenbank und Passwort korrekt angelegt wurden...';
|
||||||
$lng['install']['importing_data'] = 'Importiere Daten in die MySQL-Datenbank...';
|
$lng['install']['importing_data'] = 'Importiere Daten in die MySQL-Datenbank...';
|
||||||
@@ -81,4 +84,11 @@ $lng['install']['webserver'] = 'Webserver';
|
|||||||
$lng['install']['phpversion'] = 'Prüfe PHP Version >= 5.2';
|
$lng['install']['phpversion'] = 'Prüfe PHP Version >= 5.2';
|
||||||
$lng['install']['phpposix'] = 'Teste, ob die PHP Posix-Erweiterung installiert ist...';
|
$lng['install']['phpposix'] = 'Teste, ob die PHP Posix-Erweiterung installiert ist...';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Added in Froxlor 0.9.4
|
||||||
|
*/
|
||||||
|
$lng['install']['click_here_to_refresh'] = 'Erneut prüfen';
|
||||||
|
$lng['install']['click_here_to_continue'] = 'Installation fortführen';
|
||||||
|
$lng['install']['froxlor_succ_checks'] = 'Alle Vorraussetzungen sind erfüllt';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -21,9 +21,7 @@ $baseLanguage = 'english.lng.php';
|
|||||||
|
|
||||||
// Check if we're in the CLI
|
// Check if we're in the CLI
|
||||||
|
|
||||||
if(@php_sapi_name() != 'cli'
|
if(@php_sapi_name() != 'cli')
|
||||||
&& @php_sapi_name() != 'cgi'
|
|
||||||
&& @php_sapi_name() != 'cgi-fcgi')
|
|
||||||
{
|
{
|
||||||
die('This script will only work in the shell.');
|
die('This script will only work in the shell.');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ if(isFroxlorVersion('0.9-r0'))
|
|||||||
showUpdateStep("Updating from 0.9-r0 to 0.9-r1", false);
|
showUpdateStep("Updating from 0.9-r0 to 0.9-r1", false);
|
||||||
showUpdateStep("Performing database updates");
|
showUpdateStep("Performing database updates");
|
||||||
/*
|
/*
|
||||||
* add missing database-updates if necessary (old: update/update_database.php
|
* add missing database-updates if necessary (old: update/update_database.php)
|
||||||
*/
|
*/
|
||||||
if(!isset($settings['system']['dbversion']) || $settings['system']['dbversion'] < '1')
|
if(isset($settings['system']['dbversion']) && (int)$settings['system']['dbversion'] < 1)
|
||||||
{
|
{
|
||||||
$db->query("ALTER TABLE `panel_databases` ADD `dbserver` INT( 11 ) UNSIGNED NOT NULL default '0';");
|
$db->query("ALTER TABLE `panel_databases` ADD `dbserver` INT( 11 ) UNSIGNED NOT NULL default '0';");
|
||||||
}
|
}
|
||||||
if(!isset($settings['system']['dbversion']) || $settings['system']['dbversion'] < '2')
|
if(isset($settings['system']['dbversion']) && (int)$settings['system']['dbversion'] < 2)
|
||||||
{
|
{
|
||||||
$db->query("ALTER TABLE `panel_ipsandports` CHANGE `ssl_cert` `ssl_cert_file` VARCHAR( 255 ) NOT NULL,
|
$db->query("ALTER TABLE `panel_ipsandports` CHANGE `ssl_cert` `ssl_cert_file` VARCHAR( 255 ) NOT NULL,
|
||||||
ADD `ssl_key_file` VARCHAR( 255 ) NOT NULL,
|
ADD `ssl_key_file` VARCHAR( 255 ) NOT NULL,
|
||||||
@@ -191,7 +191,15 @@ if(isFroxlorVersion('0.9-r1'))
|
|||||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('spf', 'use_spf', '0');");
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('spf', 'use_spf', '0');");
|
||||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('spf', 'spf_entry', '@ IN TXT \"v=spf1 a mx -all\"');");
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('spf', 'spf_entry', '@ IN TXT \"v=spf1 a mx -all\"');");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname` = 'froxlor_graphic' WHERE `varname` = 'syscp_graphic'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname` = 'froxlor_graphic' WHERE `varname` = 'syscp_graphic'");
|
||||||
|
if(isset($settings['admin']['syscp_graphic'])
|
||||||
|
&& $settings['admin']['syscp_graphic'] != ''
|
||||||
|
){
|
||||||
$settings['admin']['froxlor_graphic'] = $settings['admin']['syscp_graphic'];
|
$settings['admin']['froxlor_graphic'] = $settings['admin']['syscp_graphic'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$settings['admin']['froxlor_graphic'] = 'images/header.gif';
|
||||||
|
}
|
||||||
|
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
|
|
||||||
@@ -272,8 +280,492 @@ if(isFroxlorVersion('0.9-r3'))
|
|||||||
|
|
||||||
if(isFroxlorVersion('0.9-r4'))
|
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');
|
updateToVersion('0.9');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9 to 0.9.1", false);
|
||||||
|
|
||||||
|
showUpdateStep("Updating settings values");
|
||||||
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = 'images/header.gif' WHERE `varname` = 'froxlor_graphic' AND `value` = 'images/header.png'");
|
||||||
|
|
||||||
|
lastStepStatus(0);
|
||||||
|
updateToVersion('0.9.1');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.1'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.1 to 0.9.2", false);
|
||||||
|
|
||||||
|
showUpdateStep("Checking whether last-system-guid is sane");
|
||||||
|
|
||||||
|
$result = $db->query_first("SELECT MAX(`guid`) as `latestguid` FROM `".TABLE_PANEL_CUSTOMERS."`");
|
||||||
|
|
||||||
|
if (isset($result['latestguid'])
|
||||||
|
&& (int)$result['latestguid'] > 0
|
||||||
|
&& $result['latestguid'] != $settings['system']['lastguid']
|
||||||
|
) {
|
||||||
|
checkLastGuid();
|
||||||
|
lastStepStatus(1, 'fixed');
|
||||||
|
} else {
|
||||||
|
lastStepStatus(0);
|
||||||
|
}
|
||||||
|
updateToVersion('0.9.2');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.2'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.2 to 0.9.3");
|
||||||
|
lastStepStatus(0);
|
||||||
|
updateToVersion('0.9.3');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.3'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.3 to 0.9.3-svn1", false);
|
||||||
|
|
||||||
|
showUpdateStep("Updating tables");
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'password_min_length', '0');");
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'store_index_file_subs', '1');");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.3-svn1');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.3-svn1'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.3-svn1 to 0.9.3-svn2", false);
|
||||||
|
|
||||||
|
showUpdateStep("Updating tables");
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'adminmail_defname', 'Froxlor Administrator');");
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'adminmail_return', '');");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.3-svn2');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.3-svn2'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.3-svn2 to 0.9.3-svn3", false);
|
||||||
|
|
||||||
|
showUpdateStep("Correcting cron start-times");
|
||||||
|
// set specific times for some crons (traffic only at night, etc.)
|
||||||
|
$ts = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
|
||||||
|
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_traffic.php';");
|
||||||
|
$ts = mktime(1, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
|
||||||
|
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_used_tickets_reset.php';");
|
||||||
|
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_ticketarchive.php';");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
showUpdateStep("Adding new language: Polish");
|
||||||
|
$db->query("INSERT INTO `".TABLE_PANEL_LANGUAGE."` SET `language` = 'Polski', `file` = 'lng/polish.lng.php'");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.3-svn3');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.3-svn3'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.3-svn3 to 0.9.3-svn4", false);
|
||||||
|
|
||||||
|
showUpdateStep("Adding new DKIM settings");
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('dkim', 'dkim_algorithm', 'all');");
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('dkim', 'dkim_add_adsp', '1');");
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('dkim', 'dkim_keylength', '1024');");
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('dkim', 'dkim_servicetype', '0');");
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('dkim', 'dkim_add_adsppolicy', '1');");
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('dkim', 'dkim_notes', '');");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.3-svn4');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.3-svn4'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.3-svn4 to 0.9.3-svn5", false);
|
||||||
|
|
||||||
|
showUpdateStep("Adding new settings");
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'stdsubdomain', '');");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.3-svn5');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.3-svn5'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.3-svn5 to 0.9.4 final");
|
||||||
|
lastStepStatus(0);
|
||||||
|
updateToVersion('0.9.4');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.4'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.4 to 0.9.4-svn1", false);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* some users might still have the setting in their database
|
||||||
|
* because we already had this back in older versions.
|
||||||
|
* To not confuse Froxlor, we just update old settings.
|
||||||
|
*/
|
||||||
|
if(isset($settings['system']['awstats_path'])
|
||||||
|
&& $settings['system']['awstats_path'] != ''
|
||||||
|
) {
|
||||||
|
showUpdateStep("Updating awstats path setting");
|
||||||
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/usr/bin/' WHERE `settinggroup` = 'system' AND `varname` = 'awstats_path';");
|
||||||
|
lastStepStatus(0);
|
||||||
|
}
|
||||||
|
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'] != ''
|
||||||
|
) {
|
||||||
|
showUpdateStep("Updating awstats configuration path setting");
|
||||||
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname` = 'awstats_conf' WHERE `varname` = 'awstats_domain_file';");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
showUpdateStep("Adding awstats configuration path settings");
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'awstats_conf', '/etc/awstats/');");
|
||||||
|
}
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.4-svn1');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.4-svn1'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.4-svn1 to 0.9.4-svn2", false);
|
||||||
|
|
||||||
|
$update_domains = isset($_POST['update_domainwildcardentry']) ? intval($_POST['update_domainwildcardentry']) : 0;
|
||||||
|
|
||||||
|
if($update_domains != 1)
|
||||||
|
{
|
||||||
|
$update_domains = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($update_domains == 1)
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating domains with iswildcarddomain=yes");
|
||||||
|
$query = "SELECT `d`.`id` FROM `".TABLE_PANEL_DOMAINS."` `d`, `".TABLE_PANEL_CUSTOMERS."` `c` ";
|
||||||
|
$query.= "WHERE `parentdomainid`='0' AND `email_only` = '0' AND `d`.`customerid` = `c`.`customerid` AND `d`.`id` <> `c`.`standardsubdomain`";
|
||||||
|
$result = $db->query($query);
|
||||||
|
$updated_domains = 0;
|
||||||
|
while($domain = $db->fetch_array($result))
|
||||||
|
{
|
||||||
|
$db->query("UPDATE `".TABLE_PANEL_DOMAINS."` SET `iswildcarddomain` = '1' WHERE `id` ='".(int)$domain['id']."'");
|
||||||
|
$updated_domains++;
|
||||||
|
}
|
||||||
|
lastStepStatus(0, 'Updated '.$updated_domains.' domain(s)');
|
||||||
|
} else {
|
||||||
|
showUpdateStep("Won't update domains with iswildcarddomain=yes as requested");
|
||||||
|
lastStepStatus(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
showUpdateStep("Updating database table definition for panel_domains");
|
||||||
|
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` MODIFY `iswildcarddomain` tinyint(1) NOT NULL default '1';");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.4-svn2');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.4-svn2'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.4-svn2 to 0.9.5 final");
|
||||||
|
lastStepStatus(0);
|
||||||
|
updateToVersion('0.9.5');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.5'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.5 to 0.9.6-svn1", false);
|
||||||
|
|
||||||
|
showUpdateStep("Adding time-to-live configuration setting");
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'defaultttl', '604800');");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
showUpdateStep("Updating database table structure for panel_ticket_categories");
|
||||||
|
$db->query("ALTER TABLE `" . TABLE_PANEL_TICKET_CATS . "` ADD `logicalorder` int(3) NOT NULL default '1' AFTER `adminid`;");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.6-svn1');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.6-svn1'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.6-svn1 to 0.9.6-svn2", false);
|
||||||
|
|
||||||
|
$update_adminmail = isset($_POST['update_adminmail']) ? validate($_POST['update_adminmail'], 'update_adminmail') : false;
|
||||||
|
$do_update = true;
|
||||||
|
|
||||||
|
if($update_adminmail !== false)
|
||||||
|
{
|
||||||
|
showUpdateStep("Checking newly entered admin-mail");
|
||||||
|
if(!PHPMailer::ValidateAddress($update_adminmail))
|
||||||
|
{
|
||||||
|
$do_update = false;
|
||||||
|
lastStepStatus(2, 'E-Mail still not valid, go back and try again');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '".$db->escape($update_adminmail)."' WHERE `settinggroup` = 'panel' AND `varname` = 'adminmail';");
|
||||||
|
lastStepStatus(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($do_update)
|
||||||
|
{
|
||||||
|
updateToVersion('0.9.6-svn2');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.6-svn2'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.6-svn2 to 0.9.6-svn3", false);
|
||||||
|
|
||||||
|
$update_deferr_enable = isset($_POST['update_deferr_enable']) ? true : false;
|
||||||
|
|
||||||
|
$err500 = false;
|
||||||
|
$err401 = false;
|
||||||
|
$err403 = false;
|
||||||
|
$err404 = false;
|
||||||
|
|
||||||
|
showUpdateStep("Adding new webserver configurations to database");
|
||||||
|
if($update_deferr_enable == true)
|
||||||
|
{
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'enabled', '1');");
|
||||||
|
|
||||||
|
if(isset($_POST['update_deferr_500'])
|
||||||
|
&& trim($_POST['update_deferr_500']) != ''
|
||||||
|
) {
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err500', '".$db->escape($_POST['update_deferr_500'])."');");
|
||||||
|
$err500 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($_POST['update_deferr_401'])
|
||||||
|
&& trim($_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', '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', 'err404', '".$db->escape($_POST['update_deferr_404'])."');");
|
||||||
|
$err404 = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$update_deferr_enable) {
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'enabled', '0');");
|
||||||
|
}
|
||||||
|
if(!$err401) {
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err401', '');");
|
||||||
|
}
|
||||||
|
if(!$err403) {
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err403', '');");
|
||||||
|
}
|
||||||
|
if(!$err404) {
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err404', '');");
|
||||||
|
}
|
||||||
|
if(!$err500) {
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err500', '');");
|
||||||
|
}
|
||||||
|
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.6-svn3');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.6-svn3'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.6-svn3 to 0.9.6-svn4", false);
|
||||||
|
|
||||||
|
$update_deftic_priority = isset($_POST['update_deftic_priority']) ? intval($_POST['update_deftic_priority']) : 2;
|
||||||
|
|
||||||
|
showUpdateStep("Setting default support-ticket priority");
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('ticket', 'default_priority', '".(int)$update_deftic_priority."');");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.6-svn4');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.6-svn4'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.6-svn4 to 0.9.6-svn5", false);
|
||||||
|
|
||||||
|
$update_defsys_phpconfig = isset($_POST['update_defsys_phpconfig']) ? intval($_POST['update_defsys_phpconfig']) : 1;
|
||||||
|
|
||||||
|
if($update_defsys_phpconfig != 1) {
|
||||||
|
showUpdateStep("Setting default php-configuration to user defined config #".$update_defsys_phpconfig);
|
||||||
|
} else {
|
||||||
|
showUpdateStep("Adding default php-configuration setting to the database");
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'mod_fcgid_defaultini', '".(int)$update_defsys_phpconfig."');");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.6-svn5');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.6-svn5'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.6-svn5 to 0.9.6-svn6", false);
|
||||||
|
|
||||||
|
showUpdateStep("Adding new FTP-quota settings");
|
||||||
|
|
||||||
|
$update_defsys_ftpserver = isset($_POST['update_defsys_ftpserver']) ? intval($_POST['update_defsys_ftpserver']) : 'proftpd';
|
||||||
|
|
||||||
|
// add ftp server setting
|
||||||
|
$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("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);");
|
||||||
|
|
||||||
|
$db->query("CREATE TABLE `ftp_quotatallies` (`name` varchar(30) NOT NULL, `quota_type` enum('user','group','class','all') NOT NULL, `bytes_in_used` float NOT NULL, `bytes_out_used` float NOT NULL, `bytes_xfer_used` float NOT NULL, `files_in_used` int(10) unsigned NOT NULL, `files_out_used` int(10) unsigned NOT NULL, `files_xfer_used` int(10) unsigned NOT NULL ) ENGINE=MyISAM;");
|
||||||
|
|
||||||
|
// fill quota tallies
|
||||||
|
$result_ftp_users = $db->query("SELECT username FROM `" . TABLE_FTP_USERS . "` WHERE 1;");
|
||||||
|
|
||||||
|
while($row_ftp_users = $db->fetch_array($result_ftp_users))
|
||||||
|
{
|
||||||
|
$result_ftp_quota = $db->query("SELECT diskspace_used FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE loginname = SUBSTRING_INDEX('" . $row_ftp_users['username'] . "', '" . $settings['customer']['ftpprefix'] . "', 1);");
|
||||||
|
$row_ftp_quota = mysql_fetch_row($result_ftp_quota);
|
||||||
|
$db->query("INSERT INTO `ftp_quotatallies` (`name`, `quota_type`, `bytes_in_used`, `bytes_out_used`, `bytes_xfer_used`, `files_in_used`, `files_out_used`, `files_xfer_used`) VALUES ('" . $row_ftp_users['username'] . "', 'user', '" . $row_ftp_quota[0] . "'*1024, '0', '0', '0', '0', '0');");
|
||||||
|
}
|
||||||
|
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToVersion('0.9.6-svn6');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isFroxlorVersion('0.9.6-svn6'))
|
||||||
|
{
|
||||||
|
showUpdateStep("Updating from 0.9.6-svn6 to 0.9.6 final");
|
||||||
|
lastStepStatus(0);
|
||||||
|
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');
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
62
install/updates/preconfig.php
Normal file
62
install/updates/preconfig.php
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<?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 Language
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function getPreConfig
|
||||||
|
*
|
||||||
|
* outputs various content before the update process
|
||||||
|
* can be continued (askes for agreement whatever is being asked)
|
||||||
|
*
|
||||||
|
* @param string version
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getPreConfig($current_version)
|
||||||
|
{
|
||||||
|
$has_preconfig = false;
|
||||||
|
$return = '<div class="preconfig"><h3 style="color:#ff0000;">PLEASE NOTE - Important update notifications</h3>';
|
||||||
|
|
||||||
|
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 .= '</div>';
|
||||||
|
$return .= '<input type="hidden" name="update_preconfig" value="1" />';
|
||||||
|
|
||||||
|
if($has_preconfig) {
|
||||||
|
return $return;
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function versionInUpdate($current_version, $version_to_check)
|
||||||
|
{
|
||||||
|
if (!isFroxlor()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
$pos_a = strpos($current_version, '-svn');
|
||||||
|
$pos_b = strpos($version_to_check, '-svn');
|
||||||
|
// if we compare svn-versions, we have to add -svn0 to the version
|
||||||
|
// to compare it correctly
|
||||||
|
if($pos_a === false && $pos_b !== false)
|
||||||
|
{
|
||||||
|
$current_version.= '-svn9999';
|
||||||
|
}
|
||||||
|
|
||||||
|
return version_compare($current_version, $version_to_check, '<');
|
||||||
|
}
|
||||||
152
install/updates/preconfig/0.9/preconfig_0.9.inc.php
Normal file
152
install/updates/preconfig/0.9/preconfig_0.9.inc.php
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
<?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 Language
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* checks if the new-version has some updating to do
|
||||||
|
*
|
||||||
|
* @param boolean $has_preconfig pointer to check if any preconfig has to be output
|
||||||
|
* @param string $return pointer to output string
|
||||||
|
* @param string $current_version current froxlor version
|
||||||
|
*
|
||||||
|
* @return null
|
||||||
|
*/
|
||||||
|
function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||||
|
{
|
||||||
|
global $settings, $lng, $db;
|
||||||
|
|
||||||
|
if(versionInUpdate($current_version, '0.9.4-svn2'))
|
||||||
|
{
|
||||||
|
$has_preconfig = true;
|
||||||
|
$description = 'Froxlor now enables the usage of a domain-wildcard entry and subdomains for this domain at the same time (subdomains are parsed before the main-domain vhost container).';
|
||||||
|
$description.= 'This makes it possible to catch all non-existing subdomains with the main vhost but also have the ability to use subdomains for that domain.<br />';
|
||||||
|
$description.= 'If you would like Froxlor to do so with your domains, the update script can set the correct values for existing domains for you. Note: future domains will have wildcard-entries enabled by default no matter how you decide here.';
|
||||||
|
$question = '<strong>Do you want to use wildcard-entries for existing domains?:</strong> ';
|
||||||
|
$question.= makeyesno('update_domainwildcardentry', '1', '0', '1');
|
||||||
|
|
||||||
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(versionInUpdate($current_version, '0.9.6-svn2'))
|
||||||
|
{
|
||||||
|
if(!PHPMailer::ValidateAddress($settings['panel']['adminmail']))
|
||||||
|
{
|
||||||
|
$has_preconfig = true;
|
||||||
|
$description = 'Froxlor uses a newer version of the phpMailerClass and determined that your current admin-mail address is invalid.';
|
||||||
|
$question = '<strong>Please specify a new admin-email address:</strong> <input type="text" class="text" name="update_adminmail" value="'.$settings['panel']['adminmail'].'" />';
|
||||||
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(versionInUpdate($current_version, '0.9.6-svn3'))
|
||||||
|
{
|
||||||
|
$has_preconfig = true;
|
||||||
|
$description = 'You now have the possibility to define default error-documents for your webserver which replace the default webserver error-messages.';
|
||||||
|
$question = '<strong>Do you want to enable default error-documents?:</strong> ';
|
||||||
|
$question .= makeyesno('update_deferr_enable', '1', '0', '0').'<br /><br />';
|
||||||
|
if($settings['system']['webserver'] == 'apache2')
|
||||||
|
{
|
||||||
|
$question .= 'Path/URL for error 500: <input type="text" class="text" name="update_deferr_500" /><br /><br />';
|
||||||
|
$question .= 'Path/URL for error 401: <input type="text" class="text" name="update_deferr_401" /><br /><br />';
|
||||||
|
$question .= 'Path/URL for error 403: <input type="text" class="text" name="update_deferr_403" /><br /><br />';
|
||||||
|
}
|
||||||
|
$question .= 'Path/URL for error 404: <input type="text" class="text" name="update_deferr_404" />';
|
||||||
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(versionInUpdate($current_version, '0.9.6-svn4'))
|
||||||
|
{
|
||||||
|
$has_preconfig = true;
|
||||||
|
$description = 'You can define a default support-ticket priority level which is pre-selected for new support-tickets.';
|
||||||
|
$question = '<strong>Which should be the default ticket-priority?:</strong> ';
|
||||||
|
$question .= '<select name="update_deftic_priority">';
|
||||||
|
$priorities = makeoption($lng['ticket']['unf_high'], '1', '2');
|
||||||
|
$priorities.= makeoption($lng['ticket']['unf_normal'], '2', '2');
|
||||||
|
$priorities.= makeoption($lng['ticket']['unf_low'], '3', '2');
|
||||||
|
$question .= $priorities.'</select>';
|
||||||
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
|
}
|
||||||
|
|
||||||
|
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> ';
|
||||||
|
$question .= '<select name="update_defsys_phpconfig">';
|
||||||
|
$configs_array = getPhpConfigs();
|
||||||
|
$configs = '';
|
||||||
|
foreach($configs_array as $idx => $desc)
|
||||||
|
{
|
||||||
|
$configs .= makeoption($desc, $idx, '1');
|
||||||
|
}
|
||||||
|
$question .= $configs.'</select>';
|
||||||
|
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(versionInUpdate($current_version, '0.9.6-svn6'))
|
||||||
|
{
|
||||||
|
$has_preconfig = true;
|
||||||
|
$description = 'For the new FTP-quota feature, you can now chose the currently used ftpd-software.';
|
||||||
|
$question = '<strong>Used FTPd-software:</strong> ';
|
||||||
|
$question .= '<select name="update_defsys_ftpserver">';
|
||||||
|
$question .= makeoption('ProFTPd', 'proftpd', 'proftpd');
|
||||||
|
$question .= makeoption('PureFTPd', 'pureftpd', 'proftpd');
|
||||||
|
$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> ';
|
||||||
|
$question.= makeyesno('update_customredirect_enable', '1', '0', '1').'<br /><br />';
|
||||||
|
$question.= '<strong>Select default redirect code (default: empty):</strong> ';
|
||||||
|
$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 /> ';
|
||||||
|
$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") . "\";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,6 +19,11 @@
|
|||||||
|
|
||||||
$updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'), $db, $settings);
|
$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);
|
||||||
|
$filelog->logAction(ADM_ACTION, LOG_WARNING, '-------------- START LOG --------------');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* since froxlor, we have to check if there's still someone
|
* since froxlor, we have to check if there's still someone
|
||||||
* out there using syscp and needs to upgrade
|
* out there using syscp and needs to upgrade
|
||||||
@@ -90,6 +95,8 @@ if(!isFroxlor())
|
|||||||
if(isFroxlor())
|
if(isFroxlor())
|
||||||
{
|
{
|
||||||
include_once (makeCorrectFile(dirname(__FILE__).'/updates/froxlor/0.9/update_0.9.inc.php'));
|
include_once (makeCorrectFile(dirname(__FILE__).'/updates/froxlor/0.9/update_0.9.inc.php'));
|
||||||
|
$filelog->logAction(ADM_ACTION, LOG_WARNING, '--------------- END LOG ---------------');
|
||||||
|
unset($filelog);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class ApsInstaller extends ApsParser
|
|||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->db_root = $db_root;
|
$this->db_root = $db_root;
|
||||||
$this->RootDir = dirname(dirname(__FILE__)) . '/';
|
$this->RootDir = dirname(dirname(dirname(dirname(__FILE__)))) . '/';
|
||||||
$this->Hosts = $settings['system']['mysql_access_host'];
|
$this->Hosts = $settings['system']['mysql_access_host'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,10 +135,20 @@ class ApsInstaller extends ApsParser
|
|||||||
{
|
{
|
||||||
//setup right path and run installation script
|
//setup right path and run installation script
|
||||||
|
|
||||||
|
if(!is_dir($this->RealPath . $this->DomainPath . '/install_scripts/'))
|
||||||
|
{
|
||||||
|
echo 'Directory: '. $this->RealPath . $this->DomainPath . '/install_scripts/ does not exist';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
chdir($this->RealPath . $this->DomainPath . '/install_scripts/');
|
chdir($this->RealPath . $this->DomainPath . '/install_scripts/');
|
||||||
$Return = array();
|
$Return = array();
|
||||||
$ReturnStatus = 0;
|
$ReturnStatus = 0;
|
||||||
$Return = safe_exec('php ' . escapeshellarg($this->RealPath . $this->DomainPath . '/install_scripts/configure install'), $ReturnStatus);
|
|
||||||
|
// make configure-script executable
|
||||||
|
chmod($this->RealPath . $this->DomainPath . '/install_scripts/configure', 0755);
|
||||||
|
|
||||||
|
$Return = safe_exec('php ' . escapeshellarg($this->RealPath . $this->DomainPath . '/install_scripts/configure') . ' install', $ReturnStatus);
|
||||||
|
|
||||||
if($ReturnStatus != 0)
|
if($ReturnStatus != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class ApsParser
|
|||||||
private $userinfo = array();
|
private $userinfo = array();
|
||||||
private $settings = array();
|
private $settings = array();
|
||||||
private $db = false;
|
private $db = false;
|
||||||
|
private $RootDir = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor of class, setup basic variables needed by the class
|
* Constructor of class, setup basic variables needed by the class
|
||||||
@@ -51,6 +52,7 @@ class ApsParser
|
|||||||
$this->settings = $settings;
|
$this->settings = $settings;
|
||||||
$this->userinfo = $userinfo;
|
$this->userinfo = $userinfo;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
$this->RootDir = dirname(dirname(dirname(dirname(__FILE__)))) . '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -793,7 +795,8 @@ class ApsParser
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$Errors[] = $lng['aps']['moveproblem'];
|
$moveproblem = str_replace('{$path}', $this->RootDir, $lng['aps']['moveproblem']);
|
||||||
|
$Errors[] = $moveproblem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -840,7 +843,7 @@ class ApsParser
|
|||||||
{
|
{
|
||||||
//split all keywords
|
//split all keywords
|
||||||
|
|
||||||
$Elements = split('[ ,;]', trim($_GET['keyword']));
|
$Elements = preg_split('/[ ,;]/', trim($_GET['keyword']));
|
||||||
|
|
||||||
if(count($Elements) == 1
|
if(count($Elements) == 1
|
||||||
&& strlen($Elements[0]) == 0)
|
&& strlen($Elements[0]) == 0)
|
||||||
@@ -1688,10 +1691,11 @@ class ApsParser
|
|||||||
$Error.= '<li>' . $lng['aps']['class_zip_missing'] . '</li>';
|
$Error.= '<li>' . $lng['aps']['class_zip_missing'] . '</li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_writable('./temp/')
|
if(!is_writable($this->RootDir.'temp/')
|
||||||
|| !is_writable('./packages/'))
|
|| !is_writable($this->RootDir.'packages/'))
|
||||||
{
|
{
|
||||||
$Error.= '<li>' . $lng['aps']['dir_permissions'] . '</li>';
|
$dirpermission = str_replace('{$path}', $this->RootDir, $lng['aps']['dir_permissions']);
|
||||||
|
$Error.= '<li>' . $dirpermission . '</li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($Error != '')
|
if($Error != '')
|
||||||
@@ -1710,7 +1714,14 @@ class ApsParser
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($this->userinfo['customerid']))
|
||||||
|
{
|
||||||
$CustomerId = $this->userinfo['customerid'];
|
$CustomerId = $this->userinfo['customerid'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$CustomerId = -1;
|
||||||
|
}
|
||||||
$AdminId = $this->userinfo['adminid'];
|
$AdminId = $this->userinfo['adminid'];
|
||||||
$PackagesPerSite = $this->settings['aps']['items_per_page'];
|
$PackagesPerSite = $this->settings['aps']['items_per_page'];
|
||||||
|
|
||||||
@@ -2404,7 +2415,8 @@ class ApsParser
|
|||||||
{
|
{
|
||||||
if(isset($_POST[$FieldId]))
|
if(isset($_POST[$FieldId]))
|
||||||
{
|
{
|
||||||
if(!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/", $_POST[$FieldId]))
|
$email = strtolower($_POST[$FieldId]);
|
||||||
|
if(filter_var($email, FILTER_VALIDATE_EMAIL) === false)
|
||||||
{
|
{
|
||||||
if(!in_array($FieldId, $Error))$Error[] = $FieldId;
|
if(!in_array($FieldId, $Error))$Error[] = $FieldId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,18 +32,26 @@ class ApsUpdater extends ApsParser
|
|||||||
private $RootUrl = '';
|
private $RootUrl = '';
|
||||||
private $RootDir = '';
|
private $RootDir = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FroxlorLogger
|
||||||
|
* @var FroxlorLogger
|
||||||
|
*/
|
||||||
|
private $_cronlog = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor of class. setup some basic variables needed by class
|
* constructor of class. setup some basic variables needed by class
|
||||||
*
|
*
|
||||||
* @param db instance of the database class from syscp
|
* @param db instance of the database class
|
||||||
|
* @param cronlog instance of the froxlor logger
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function __construct($db)
|
public function __construct($db, $cronlog)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->RequestDomain = 'apscatalog.com';
|
$this->RequestDomain = 'apscatalog.com';
|
||||||
$this->RootUrl = '/1/';
|
$this->RootUrl = '/1/';
|
||||||
$this->RootDir = dirname(dirname(__FILE__)) . '/';
|
$this->RootDir = dirname(dirname(dirname(dirname(__FILE__)))) . '/';
|
||||||
|
$this->_cronlog = $cronlog;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,13 +60,15 @@ class ApsUpdater extends ApsParser
|
|||||||
|
|
||||||
public function UpdateHandler()
|
public function UpdateHandler()
|
||||||
{
|
{
|
||||||
|
$this->_cronlog->logAction(CRON_ACTION, LOG_NOTICE, "Changing directory to '" . $this->RootDir . "'");
|
||||||
chdir($this->RootDir);
|
chdir($this->RootDir);
|
||||||
|
|
||||||
//return if allow_url_fopen is disabled
|
//return if allow_url_fopen is disabled
|
||||||
|
|
||||||
if(ini_get('allow_url_fopen') == '0')
|
if(!ini_get('allow_url_fopen'))
|
||||||
{
|
{
|
||||||
echo ("The APS updater cronjob requires that allow_url_fopen is enabled for the PHP CLI binary!\n");
|
$this->_cronlog->logAction(CRON_ACTION, LOG_ERROR, "The APS updater cronjob requires that allow_url_fopen is enabled for the PHP CLI binary!");
|
||||||
|
echo "The APS updater cronjob requires that allow_url_fopen is enabled for the PHP CLI binary!\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,6 +78,7 @@ class ApsUpdater extends ApsParser
|
|||||||
|
|
||||||
if($this->db->num_rows($Result) == 0)
|
if($this->db->num_rows($Result) == 0)
|
||||||
{
|
{
|
||||||
|
$this->_cronlog->logAction(CRON_ACTION, LOG_NOTICE, "No tasks for ApsUpdater");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,16 +88,21 @@ class ApsUpdater extends ApsParser
|
|||||||
$this->db->query('DELETE FROM `' . TABLE_APS_TASKS . '` WHERE `Task` = ' . $Task['Task']);
|
$this->db->query('DELETE FROM `' . TABLE_APS_TASKS . '` WHERE `Task` = ' . $Task['Task']);
|
||||||
|
|
||||||
//fetch all vendors
|
//fetch all vendors
|
||||||
|
$this->_cronlog->logAction(CRON_ACTION, LOG_NOTICE, "Fetching all Vendors from '" . $this->RootUrl . "'");
|
||||||
$Vendors = self::FetchSubUrls($this->RootUrl);
|
$Vendors = self::FetchSubUrls($this->RootUrl);
|
||||||
|
if($Vendors !== false)
|
||||||
|
{
|
||||||
foreach($Vendors as $Vendor)
|
foreach($Vendors as $Vendor)
|
||||||
{
|
{
|
||||||
//fetch all applications from vendors
|
//fetch all applications from vendors
|
||||||
|
$this->_cronlog->logAction(CRON_ACTION, LOG_NOTICE, "Fetching all from Vendor '" . $Vendor. "'");
|
||||||
$Applications = self::FetchSubUrls($this->RootUrl . $Vendor);
|
$Applications = self::FetchSubUrls($this->RootUrl . $Vendor);
|
||||||
|
if($Applications !== false)
|
||||||
|
{
|
||||||
foreach($Applications as $Application)
|
foreach($Applications as $Application)
|
||||||
{
|
{
|
||||||
//get newest version of package which is already installed
|
//get newest version of package which is already installed
|
||||||
|
$this->_cronlog->logAction(CRON_ACTION, LOG_NOTICE, "Checking application '" . substr($Application, 0, -1) . "'");
|
||||||
|
|
||||||
$CurrentVersion = '';
|
$CurrentVersion = '';
|
||||||
$Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '` WHERE `Name` = "' . $this->db->escape(substr($Application, 0, -1)) . '"');
|
$Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '` WHERE `Name` = "' . $this->db->escape(substr($Application, 0, -1)) . '"');
|
||||||
@@ -109,6 +125,8 @@ class ApsUpdater extends ApsParser
|
|||||||
|
|
||||||
$NewerVersion = '';
|
$NewerVersion = '';
|
||||||
$Versions = self::FetchSubUrls($this->RootUrl . $Vendor . $Application);
|
$Versions = self::FetchSubUrls($this->RootUrl . $Vendor . $Application);
|
||||||
|
if($Versions !== false)
|
||||||
|
{
|
||||||
foreach($Versions as $Version)
|
foreach($Versions as $Version)
|
||||||
{
|
{
|
||||||
$OnlineVersion = substr($Version, 0, -1);
|
$OnlineVersion = substr($Version, 0, -1);
|
||||||
@@ -134,6 +152,7 @@ class ApsUpdater extends ApsParser
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if($Task['Task'] != TASK_SYSTEM_DOWNLOAD)continue;
|
if($Task['Task'] != TASK_SYSTEM_DOWNLOAD)continue;
|
||||||
@@ -165,6 +184,8 @@ class ApsUpdater extends ApsParser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* download a package from the distribution server and move the downloaded file in the temporary directory
|
* download a package from the distribution server and move the downloaded file in the temporary directory
|
||||||
@@ -181,11 +202,13 @@ class ApsUpdater extends ApsParser
|
|||||||
|
|
||||||
//make url valid
|
//make url valid
|
||||||
|
|
||||||
$Url = str_replace(' ', '%20', $Url);
|
$path = dirname($Url);
|
||||||
|
$file = urlencode(basename($Url));
|
||||||
|
$file_url = 'http://' . $this->RequestDomain . $path . '/' . $file . '.aps' . $Downloads[0];
|
||||||
|
|
||||||
//get content from website url
|
//get content from website url
|
||||||
|
$this->_cronlog->logAction(CRON_ACTION, LOG_NOTICE, "Downloading '" . $file_url . "'");
|
||||||
$Content = @file_get_contents('http://' . $this->RequestDomain . $Url . '.aps' . $Downloads[0]);
|
$Content = @file_get_contents($file_url);
|
||||||
|
|
||||||
if($Content != false)
|
if($Content != false)
|
||||||
{
|
{
|
||||||
@@ -231,12 +254,13 @@ class ApsUpdater extends ApsParser
|
|||||||
//make url valid
|
//make url valid
|
||||||
|
|
||||||
$Url = str_replace(' ', '%20', $Url);
|
$Url = str_replace(' ', '%20', $Url);
|
||||||
|
$file_url = 'http://' . $this->RequestDomain . $Url;
|
||||||
|
|
||||||
//get content from website url
|
//get content from website url
|
||||||
|
|
||||||
$Content = @file('http://' . $this->RequestDomain . $Url);
|
$Content = @file($file_url);
|
||||||
|
|
||||||
if($Content != false)
|
if($Content !== false)
|
||||||
{
|
{
|
||||||
foreach($Content as $Temp)
|
foreach($Content as $Temp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -134,8 +134,11 @@ class db
|
|||||||
$this->showerror('Trying to use database ' . $this->database . ' failed, exiting');
|
$this->showerror('Trying to use database ' . $this->database . ' failed, exiting');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mysql_query("SET NAMES utf8", $this->link_id);
|
/*
|
||||||
mysql_query("SET CHARACTER SET utf8", $this->link_id);
|
* this is not for 0.9.x
|
||||||
|
*/
|
||||||
|
//mysql_query("SET NAMES utf8", $this->link_id);
|
||||||
|
//mysql_query("SET CHARACTER SET utf8", $this->link_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ class idna_convert_wrapper
|
|||||||
* @var object
|
* @var object
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var $idna_converter;
|
private $idna_converter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class constructor. Creates a new idna converter
|
* Class constructor. Creates a new idna converter
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function idna_convert_wrapper()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->idna_converter = new idna_convert();
|
$this->idna_converter = new idna_convert();
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ class idna_convert_wrapper
|
|||||||
* both seperated by the same string as the input.
|
* both seperated by the same string as the input.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function encode($to_encode)
|
public function encode($to_encode)
|
||||||
{
|
{
|
||||||
return $this->_do_action('encode', $to_encode);
|
return $this->_do_action('encode', $to_encode);
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ class idna_convert_wrapper
|
|||||||
* both seperated by the same string as the input.
|
* both seperated by the same string as the input.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function decode($to_decode)
|
public function decode($to_decode)
|
||||||
{
|
{
|
||||||
return $this->_do_action('decode', $to_decode);
|
return $this->_do_action('decode', $to_decode);
|
||||||
}
|
}
|
||||||
@@ -80,7 +80,7 @@ class idna_convert_wrapper
|
|||||||
* @return string The input string after being processed.
|
* @return string The input string after being processed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function _do_action($action, $string)
|
private function _do_action($action, $string)
|
||||||
{
|
{
|
||||||
$string = trim($string);
|
$string = trim($string);
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ class FileLogger extends AbstractLogger
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function setLogFile($filename = null)
|
public function setLogFile($filename = null)
|
||||||
{
|
{
|
||||||
if($filename != null
|
if($filename != null
|
||||||
&& $filename != ''
|
&& $filename != ''
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -286,14 +286,25 @@ class ticket
|
|||||||
|
|
||||||
if($customerid != - 1)
|
if($customerid != - 1)
|
||||||
{
|
{
|
||||||
$mail->From = $this->settings['ticket']['noreply_email'];
|
$_mailerror = false;
|
||||||
$mail->FromName = $this->settings['ticket']['noreply_name'];
|
try {
|
||||||
|
$mail->SetFrom($this->settings['ticket']['noreply_email'], $this->settings['ticket']['noreply_name']);
|
||||||
$mail->Subject = $mail_subject;
|
$mail->Subject = $mail_subject;
|
||||||
$mail->Body = $mail_body;
|
$mail->AltBody = $mail_body;
|
||||||
|
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
||||||
$mail->AddAddress($usr['email'], $usr['firstname'] . ' ' . $usr['name']);
|
$mail->AddAddress($usr['email'], $usr['firstname'] . ' ' . $usr['name']);
|
||||||
|
$mail->Send();
|
||||||
|
} catch(phpmailerException $e) {
|
||||||
|
$mailerr_msg = $e->errorMessage();
|
||||||
|
$_mailerror = true;
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$mailerr_msg = $e->getMessage();
|
||||||
|
$_mailerror = true;
|
||||||
|
}
|
||||||
|
|
||||||
if(!$mail->Send())
|
if ($_mailerror) {
|
||||||
{
|
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'ticket_class'), $this->db, $this->settings);
|
||||||
|
$rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
||||||
standard_error(array('errorsendingmail', $usr['email']));
|
standard_error(array('errorsendingmail', $usr['email']));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,15 +312,27 @@ class ticket
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$admin = $this->db->query_first("SELECT `email` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid`='" . (int)$this->userinfo['adminid'] . "'");
|
$admin = $this->db->query_first("SELECT `name`, `email` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid`='" . (int)$this->userinfo['adminid'] . "'");
|
||||||
$mail->From = $this->settings['ticket']['noreply_email'];
|
|
||||||
$mail->FromName = $this->settings['ticket']['noreply_name'];
|
|
||||||
$mail->Subject = $mail_subject;
|
|
||||||
$mail->Body = $mail_body;
|
|
||||||
$mail->AddAddress($admin['email'], $admin['firstname'] . ' ' . $admin['name']);
|
|
||||||
|
|
||||||
if(!$mail->Send())
|
$_mailerror = false;
|
||||||
{
|
try {
|
||||||
|
$mail->SetFrom($this->settings['ticket']['noreply_email'], $this->settings['ticket']['noreply_name']);
|
||||||
|
$mail->Subject = $mail_subject;
|
||||||
|
$mail->AltBody = $mail_body;
|
||||||
|
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
||||||
|
$mail->AddAddress($admin['email'], $admin['name']);
|
||||||
|
$mail->Send();
|
||||||
|
} catch(phpmailerException $e) {
|
||||||
|
$mailerr_msg = $e->errorMessage();
|
||||||
|
$_mailerror = true;
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$mailerr_msg = $e->getMessage();
|
||||||
|
$_mailerror = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_mailerror) {
|
||||||
|
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'ticket_class'), $this->db, $this->settings);
|
||||||
|
$rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
||||||
standard_error(array('errorsendingmail', $admin['email']));
|
standard_error(array('errorsendingmail', $admin['email']));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -321,12 +344,19 @@ class ticket
|
|||||||
* Add a support-categories
|
* Add a support-categories
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function addCategory($_db, $_category = null, $_admin = 1)
|
static public function addCategory($_db, $_category = null, $_admin = 1, $_order = 1)
|
||||||
{
|
{
|
||||||
if($_category != null
|
if($_category != null
|
||||||
&& $_category != '')
|
&& $_category != '')
|
||||||
{
|
{
|
||||||
$_db->query('INSERT INTO `' . TABLE_PANEL_TICKET_CATS . '` (`name`, `adminid`) VALUES ("' . $_db->escape($_category) . '", "' . (int)$_admin . '")');
|
if($_order < 1) {
|
||||||
|
$_order = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$_db->query('INSERT INTO `' . TABLE_PANEL_TICKET_CATS . '` SET
|
||||||
|
`name` = "' . $_db->escape($_category) . '",
|
||||||
|
`adminid` = "' . (int)$_admin . '",
|
||||||
|
`logicalorder` = "' . (int)$_order . '"');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,13 +367,19 @@ class ticket
|
|||||||
* Edit a support-categories
|
* Edit a support-categories
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function editCategory($_db, $_category = null, $_id = 0)
|
static public function editCategory($_db, $_category = null, $_id = 0, $_order = 1)
|
||||||
{
|
{
|
||||||
if($_category != null
|
if($_category != null
|
||||||
&& $_category != ''
|
&& $_category != ''
|
||||||
&& $_id != 0)
|
&& $_id != 0)
|
||||||
{
|
{
|
||||||
$_db->query('UPDATE `' . TABLE_PANEL_TICKET_CATS . '` SET `name` = "' . $_db->escape($_category) . '"
|
if($_order < 1) {
|
||||||
|
$_order = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$_db->query('UPDATE `' . TABLE_PANEL_TICKET_CATS . '` SET
|
||||||
|
`name` = "' . $_db->escape($_category) . '",
|
||||||
|
`logicalorder` = "' . (int)$_order . '"
|
||||||
WHERE `id` = "' . (int)$_id . '"');
|
WHERE `id` = "' . (int)$_id . '"');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -637,7 +673,7 @@ class ticket
|
|||||||
{
|
{
|
||||||
if($_cid != 0)
|
if($_cid != 0)
|
||||||
{
|
{
|
||||||
$result = $_db->query('SELECT `id` FROM `' . TABLE_PANEL_TICKETS . '` WHERE `customer` ="'.(int)$_cid.'"');
|
$result = $_db->query('SELECT `id` FROM `' . TABLE_PANEL_TICKETS . '` WHERE `customerid` ="'.(int)$_cid.'"');
|
||||||
|
|
||||||
$tickets = array();
|
$tickets = array();
|
||||||
while($row = $_db->fetch_array($result))
|
while($row = $_db->fetch_array($result))
|
||||||
@@ -668,7 +704,11 @@ class ticket
|
|||||||
{
|
{
|
||||||
if(strtolower($_var) == 'message')
|
if(strtolower($_var) == 'message')
|
||||||
{
|
{
|
||||||
return htmlspecialchars_decode(nl2br($this->t_data[$_var]));
|
return str_replace('script>', 'pre>', htmlspecialchars_decode(nl2br($this->t_data[$_var])));
|
||||||
|
}
|
||||||
|
elseif(strtolower($_var) == 'subject')
|
||||||
|
{
|
||||||
|
return str_replace('script>', 'pre>', htmlspecialchars_decode(nl2br($this->t_data[$_var])));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ return Array(
|
|||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
|
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '',
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'a2dismod userdir',
|
'a2dismod userdir',
|
||||||
@@ -50,8 +51,11 @@ return Array(
|
|||||||
$configcommand['diroptions'],
|
$configcommand['diroptions'],
|
||||||
$configcommand['v_inclighty'],
|
$configcommand['v_inclighty'],
|
||||||
$configcommand['d_inclighty'],
|
$configcommand['d_inclighty'],
|
||||||
|
'lighty-disable-mod cgi',
|
||||||
|
'lighty-disable-mod fastcgi',
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
|
'mkdir -p ' . $settings['system']['deactivateddocroot'],
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
),
|
),
|
||||||
@@ -68,8 +72,10 @@ return Array(
|
|||||||
'label' => 'Bind9',
|
'label' => 'Bind9',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install bind9',
|
'apt-get install bind9',
|
||||||
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/bind/named.conf',
|
'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf',
|
||||||
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.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(
|
'restart' => Array(
|
||||||
'/etc/init.d/bind9 restart'
|
'/etc/init.d/bind9 restart'
|
||||||
@@ -93,7 +99,7 @@ return Array(
|
|||||||
'postfix' => Array(
|
'postfix' => Array(
|
||||||
'label' => 'Postfix',
|
'label' => 'Postfix',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install postfix postfix-mysql libsasl2 libsasl2-modules libsasl2-modules-sql',
|
'apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql',
|
||||||
'mkdir -p /etc/postfix/sasl',
|
'mkdir -p /etc/postfix/sasl',
|
||||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||||
@@ -131,6 +137,19 @@ return Array(
|
|||||||
'newaliases'
|
'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(
|
'exim4' => Array(
|
||||||
'label' => 'Exim4',
|
'label' => 'Exim4',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
@@ -191,6 +210,9 @@ return Array(
|
|||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'proftpd' => Array(
|
'proftpd' => Array(
|
||||||
'label' => 'ProFTPd',
|
'label' => 'ProFTPd',
|
||||||
|
'commands' => Array(
|
||||||
|
'apt-get install proftpd-basic proftpd-mod-mysql'
|
||||||
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
||||||
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
||||||
@@ -248,17 +270,14 @@ return Array(
|
|||||||
),
|
),
|
||||||
'awstats' => Array(
|
'awstats' => Array(
|
||||||
'label' => 'Awstats',
|
'label' => 'Awstats',
|
||||||
'files' => Array(
|
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
|
||||||
),
|
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
'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')
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
'libnss' => Array(
|
'libnss' => Array(
|
||||||
'label' => 'libnss (system login with mysql)',
|
'label' => 'libnss (system login with mysql)',
|
||||||
|
|||||||
232
lib/configfiles/freebsd.inc.php
Normal file
232
lib/configfiles/freebsd.inc.php
Normal file
@@ -0,0 +1,232 @@
|
|||||||
|
<?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 Configfiles
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
return Array(
|
||||||
|
'freebsd' => Array(
|
||||||
|
'label' => 'FreeBSD',
|
||||||
|
'services' => Array(
|
||||||
|
'http' => Array(
|
||||||
|
'label' => $lng['admin']['configfiles']['http'],
|
||||||
|
'daemons' => Array(
|
||||||
|
'apache2' => Array(
|
||||||
|
'label' => 'Apache2 Webserver',
|
||||||
|
'commands' => Array(
|
||||||
|
'cd /usr/ports/www/apache22',
|
||||||
|
'make config',
|
||||||
|
'make install',
|
||||||
|
'touch ' . $settings['system']['apacheconf_vhost'],
|
||||||
|
'chown root:0 ' . $settings['system']['apacheconf_vhost'],
|
||||||
|
'chmod 0600 ' . $settings['system']['apacheconf_vhost'],
|
||||||
|
'touch ' . $settings['system']['apacheconf_diroptions'],
|
||||||
|
'chown root:0 ' . $settings['system']['apacheconf_diroptions'],
|
||||||
|
'chmod 0600 ' . $settings['system']['apacheconf_diroptions'],
|
||||||
|
'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'],
|
||||||
|
'echo "accf_http_load=\"YES\"" >> /boot/loader.conf',
|
||||||
|
'echo "accf_data_load=\"YES\"" >> /boot/loader.conf',
|
||||||
|
'echo "apache22_enable=\"YES\"" >> /etc/rc.conf',
|
||||||
|
),
|
||||||
|
'restart' => Array(
|
||||||
|
'sh /usr/local/etc/rc.d/apache22 restart'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'dns' => Array(
|
||||||
|
'label' => $lng['admin']['configfiles']['dns'],
|
||||||
|
'daemons' => Array(
|
||||||
|
'powerdns' => Array(
|
||||||
|
'label' => 'PowerDNS',
|
||||||
|
'commands_1' => Array(
|
||||||
|
'cd /usr/ports/dns/powerdns',
|
||||||
|
'make config',
|
||||||
|
'make install',
|
||||||
|
'echo "pdns_enable=\"YES\"" >> /etc/rc.conf',
|
||||||
|
),
|
||||||
|
'files' => Array(
|
||||||
|
'usr_local_etc_pdns_pdns.conf' => '/usr/local/etc/pdns/pdns.conf'
|
||||||
|
),
|
||||||
|
'commands' => Array(
|
||||||
|
'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
|
||||||
|
'chown root:0 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
|
||||||
|
'chmod 0600 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
|
||||||
|
),
|
||||||
|
'restart' => Array(
|
||||||
|
'sh /usr/local/etc/rc.d/pdns restart'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'smtp' => Array(
|
||||||
|
'label' => $lng['admin']['configfiles']['smtp'],
|
||||||
|
'daemons' => Array(
|
||||||
|
'postfix' => Array(
|
||||||
|
'label' => 'Postfix',
|
||||||
|
'commands_1' => Array(
|
||||||
|
'cd /usr/ports/mail/postfix',
|
||||||
|
'make config',
|
||||||
|
'set Dovecot SASL authentication method',
|
||||||
|
'set Enable SSL and TLS support',
|
||||||
|
'set MySQL maps (choose version with WITH_MYSQL_VER)',
|
||||||
|
'make install'
|
||||||
|
),
|
||||||
|
'commands_2' => Array(
|
||||||
|
'pw groupadd vmail -g 5001 ',
|
||||||
|
'pw useradd vmail -u 5001 -g 5001 -s/sbin/nologin -d/dev/null',
|
||||||
|
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||||
|
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||||
|
'chmod 0750 ' . $settings['system']['vmail_homedir']
|
||||||
|
),
|
||||||
|
'commands_3' => Array(
|
||||||
|
'echo "sendmail_enable=\"NO\"" >> /etc/rc.conf',
|
||||||
|
'echo "sendmail_submit_enable=\"NO\"" >> /etc/rc.conf',
|
||||||
|
'echo "sendmail_outbound_enable=\"NO\"" >> /etc/rc.conf',
|
||||||
|
'echo "sendmail_msp_queue_enable=\"NO\"" >> /etc/rc.conf',
|
||||||
|
'echo "postfix_enable=\"YES\"" >> /etc/rc.conf'
|
||||||
|
),
|
||||||
|
'files' => Array(
|
||||||
|
'etc_periodic.conf' => '/etc/periodic.conf',
|
||||||
|
'usr_local_etc_postfix_main.cf' => '/usr/local/etc/postfix/main.cf',
|
||||||
|
'usr_local_etc_postfix_mysql-virtual_alias_maps.cf' => '/usr/local/etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
|
'usr_local_etc_postfix_mysql-virtual_mailbox_domains.cf' => '/usr/local/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
|
'usr_local_etc_postfix_mysql-virtual_mailbox_maps.cf' => '/usr/local/etc/postfix/mysql-virtual_mailbox_maps.cf'
|
||||||
|
),
|
||||||
|
'restart' => Array(
|
||||||
|
'sh /usr/local/etc/rc.d/postfix restart'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'postfix_mxaccess' => Array(
|
||||||
|
'label' => 'Postfix MX-Access (anti spam)',
|
||||||
|
'files' => Array(
|
||||||
|
'etc_postfix_mx_access' => '/usr/local/etc/postfix/mx_access',
|
||||||
|
'etc_postfix_main.cf' => '/usr/local/etc/postfix/main.cf'
|
||||||
|
),
|
||||||
|
'commands_1' => Array(
|
||||||
|
'postmap /etc/postfix/mx_access'
|
||||||
|
),
|
||||||
|
'restart' => Array(
|
||||||
|
'/etc/init.d/postfix restart'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'dkim' => Array(
|
||||||
|
'label' => 'DomainKey filter',
|
||||||
|
'commands' => Array(
|
||||||
|
'cd /usr/ports/mail/dkim-milter/',
|
||||||
|
'make install clean',
|
||||||
|
'touch /usr/local/etc/mail/dkim-filter.conf'
|
||||||
|
),
|
||||||
|
'files' => Array(
|
||||||
|
'dkim-filter.conf' => '/usr/local/etc/mail/dkim-filter.conf',
|
||||||
|
'postfix_dkim_addition.cf' => '/usr/local/etc/postfix/main.cf'
|
||||||
|
),
|
||||||
|
'restart' => Array(
|
||||||
|
'/usr/local/etc/rc.d/milter-dkim restart '
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'mail' => Array(
|
||||||
|
'label' => $lng['admin']['configfiles']['mail'],
|
||||||
|
'daemons' => Array(
|
||||||
|
'dovecot' => Array(
|
||||||
|
'label' => 'Dovecot',
|
||||||
|
'commands_1' => Array(
|
||||||
|
'cd /usr/ports/mail/dovecot',
|
||||||
|
'make config',
|
||||||
|
'set kqueue(2) support ',
|
||||||
|
'set SSL support ',
|
||||||
|
'set ManageSieve support (optional)',
|
||||||
|
'set MySQL support ',
|
||||||
|
'make install',
|
||||||
|
'echo "dovecot_enable=\"YES\"" >> /etc/rc.conf'
|
||||||
|
),
|
||||||
|
'files' => Array(
|
||||||
|
'usr_local_etc_dovecot.conf' => '/usr/local/etc/dovecot.conf',
|
||||||
|
'usr_local_etc_dovecot-sql.conf' => '/usr/local/etc/dovecot-sql.conf'
|
||||||
|
),
|
||||||
|
'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'
|
||||||
|
),
|
||||||
|
'restart' => Array(
|
||||||
|
'sh /usr/local/etc/rc.d/dovecot restart'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'ftp' => Array(
|
||||||
|
'label' => $lng['admin']['configfiles']['ftp'],
|
||||||
|
'daemons' => Array(
|
||||||
|
'proftpd' => Array(
|
||||||
|
'label' => 'ProFTPd',
|
||||||
|
'files' => Array(
|
||||||
|
'etc_proftpd_proftpd.conf' => '/usr/local/etc/proftpd.conf'
|
||||||
|
),
|
||||||
|
'commands' => Array(
|
||||||
|
'touch /usr/local/etc/proftpd.conf',
|
||||||
|
'chown root:0 /usr/local/etc/proftpd.conf',
|
||||||
|
'chmod 0600 /usr/local/etc/proftpd.conf'
|
||||||
|
),
|
||||||
|
'restart' => Array(
|
||||||
|
'/usr/local/etc/rc.d/proftpd restart'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'etc' => Array(
|
||||||
|
'label' => $lng['admin']['configfiles']['etc'],
|
||||||
|
'daemons' => Array(
|
||||||
|
'awstats' => Array(
|
||||||
|
'label' => 'Awstats',
|
||||||
|
'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'])
|
||||||
|
),
|
||||||
|
'files' => Array(
|
||||||
|
'etc_awstats.model.conf' => makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.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(
|
||||||
|
'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'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -34,9 +34,10 @@ return Array(
|
|||||||
'chown root:0 ' . $settings['system']['apacheconf_diroptions'],
|
'chown root:0 ' . $settings['system']['apacheconf_diroptions'],
|
||||||
'chmod 0600 ' . $settings['system']['apacheconf_diroptions'],
|
'chmod 0600 ' . $settings['system']['apacheconf_diroptions'],
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
|
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '',
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir']
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'rc-update add apache2 default',
|
'rc-update add apache2 default',
|
||||||
@@ -54,7 +55,8 @@ return Array(
|
|||||||
$configcommand['v_inclighty'],
|
$configcommand['v_inclighty'],
|
||||||
$configcommand['d_inclighty'],
|
$configcommand['d_inclighty'],
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory']
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
|
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : ''
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'rc-update add lighttpd default',
|
'rc-update add lighttpd default',
|
||||||
@@ -72,10 +74,10 @@ return Array(
|
|||||||
'etc_bind_default.zone' => '/etc/bind/default.zone'
|
'etc_bind_default.zone' => '/etc/bind/default.zone'
|
||||||
),
|
),
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/bind/named.conf',
|
'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf',
|
||||||
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf',
|
'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
|
||||||
'chown root:0 ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf',
|
'chown named:0 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
|
||||||
'chmod 0600 ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf'
|
'chmod 0600 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'rc-update add named default',
|
'rc-update add named default',
|
||||||
@@ -87,27 +89,26 @@ return Array(
|
|||||||
'smtp' => Array(
|
'smtp' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['smtp'],
|
'label' => $lng['admin']['configfiles']['smtp'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'postfix' => Array(
|
'postfix_courier' => Array(
|
||||||
'label' => 'Postfix',
|
'label' => 'Postfix/Courier',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
|
'echo "mail-mta/postfix -dovecot-sasl sasl" >> /etc/portage/package.use',
|
||||||
|
'emerge -av postfix',
|
||||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||||
'chmod 0750 ' . $settings['system']['vmail_homedir'],
|
'chmod 0750 ' . $settings['system']['vmail_homedir'],
|
||||||
'mv /etc/postfix/main.cf /etc/postfix/main.cf.gentoo',
|
'mv /etc/postfix/main.cf /etc/postfix/main.cf.gentoo',
|
||||||
'touch /etc/postfix/main.cf',
|
'touch /etc/postfix/main.cf',
|
||||||
'touch /etc/postfix/master.cf',
|
|
||||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'touch /etc/sasl2/smtpd.conf',
|
'touch /etc/sasl2/smtpd.conf',
|
||||||
'chown root:root /etc/postfix/main.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_alias_maps.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'chown root:root /etc/sasl2/smtpd.conf',
|
'chown root:root /etc/sasl2/smtpd.conf',
|
||||||
'chmod 0644 /etc/postfix/main.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_alias_maps.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
@@ -115,7 +116,6 @@ return Array(
|
|||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
'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_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_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_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
@@ -126,22 +126,74 @@ return Array(
|
|||||||
'/etc/init.d/postfix restart'
|
'/etc/init.d/postfix restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
'postfix_dovecot' => Array(
|
||||||
|
'label' => 'Postfix/Dovecot',
|
||||||
|
'commands_1' => Array(
|
||||||
|
'echo "mail-mta/postfix dovecot-sasl -sasl" >> /etc/portage/package.use',
|
||||||
|
'emerge -av postfix',
|
||||||
|
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||||
|
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||||
|
'chmod 0750 ' . $settings['system']['vmail_homedir'],
|
||||||
|
'mv /etc/postfix/main.cf /etc/postfix/main.cf.gentoo',
|
||||||
|
'touch /etc/postfix/main.cf',
|
||||||
|
'touch /etc/postfix/master.cf',
|
||||||
|
'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(
|
||||||
|
'rc-update add postfix default',
|
||||||
|
'/etc/init.d/postfix restart'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'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'
|
||||||
|
)
|
||||||
|
),
|
||||||
'dkim' => Array(
|
'dkim' => Array(
|
||||||
'label' => 'DomainKey filter',
|
'label' => 'DomainKey filter',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
|
'emerge dkim-milter',
|
||||||
|
'emerge --config mail-filter/dkim-milter',
|
||||||
'mkdir -p /etc/postfix/dkim'
|
'mkdir -p /etc/postfix/dkim'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'dkim-filter.conf' => '/etc/postfix/dkim/dkim-filter.conf'
|
'dkim-filter.conf' => '/etc/mail/dkim-filter/dkim-filter.conf'
|
||||||
),
|
),
|
||||||
'commands_2' => Array(
|
'commands_2' => Array(
|
||||||
'chgrp postfix /etc/postfix/dkim/dkim-filter.conf',
|
'echo "smtpd_milters = inet:localhost:8891
|
||||||
'echo "smtpd_milters = inet:localhost:8891\n
|
milter_macro_daemon_name = SIGNING
|
||||||
milter_macro_daemon_name = SIGNING\n
|
milter_default_action = accept" >> /etc/postfix/main.cf'
|
||||||
milter_default_action = accept\n" >> /etc/postfix/main.cf'
|
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/dkim-filter restart'
|
'rc-update add dkim-filter default',
|
||||||
|
'/etc/init.d/postfix restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -266,17 +318,13 @@ milter_default_action = accept\n" >> /etc/postfix/main.cf'
|
|||||||
),
|
),
|
||||||
'awstats' => Array(
|
'awstats' => Array(
|
||||||
'label' => 'Awstats',
|
'label' => 'Awstats',
|
||||||
'files' => Array(
|
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
|
||||||
),
|
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
'emerge awstats',
|
||||||
|
'awstats_configure.pl'
|
||||||
|
),
|
||||||
|
'files' => Array(
|
||||||
|
'etc_awstats.model.conf' => makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
'libnss' => Array(
|
'libnss' => Array(
|
||||||
'label' => 'libnss (system login with mysql)',
|
'label' => 'libnss (system login with mysql)',
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ return Array(
|
|||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
|
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '',
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'a2dismod userdir',
|
'a2dismod userdir'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/apache2 restart'
|
'/etc/init.d/apache2 restart'
|
||||||
@@ -50,10 +51,13 @@ return Array(
|
|||||||
$configcommand['diroptions'],
|
$configcommand['diroptions'],
|
||||||
$configcommand['v_inclighty'],
|
$configcommand['v_inclighty'],
|
||||||
$configcommand['d_inclighty'],
|
$configcommand['d_inclighty'],
|
||||||
|
'lighty-disable-mod cgi',
|
||||||
|
'lighty-disable-mod fastcgi',
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
|
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '',
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir']
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/lighttpd restart'
|
'/etc/init.d/lighttpd restart'
|
||||||
@@ -67,8 +71,10 @@ return Array(
|
|||||||
'bind' => Array(
|
'bind' => Array(
|
||||||
'label' => 'Bind9',
|
'label' => 'Bind9',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/bind/named.conf',
|
'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf',
|
||||||
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.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(
|
'restart' => Array(
|
||||||
'/etc/init.d/bind9 restart'
|
'/etc/init.d/bind9 restart'
|
||||||
@@ -89,30 +95,26 @@ return Array(
|
|||||||
'smtp' => Array(
|
'smtp' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['smtp'],
|
'label' => $lng['admin']['configfiles']['smtp'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'postfix' => Array(
|
'postfix_courier' => Array(
|
||||||
'label' => 'Postfix',
|
'label' => 'Postfix/Courier',
|
||||||
'commands_1' => Array(
|
'commands' => Array(
|
||||||
'mkdir -p /etc/postfix/sasl',
|
'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/etc/pam.d',
|
||||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||||
'mv /etc/postfix/main.cf /etc/postfix/main.cf.ubuntu',
|
|
||||||
'touch /etc/postfix/main.cf',
|
|
||||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'touch /etc/postfix/sasl/smtpd.conf',
|
'touch /etc/postfix/sasl/smtpd.conf',
|
||||||
'chown root:root /etc/postfix/main.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_alias_maps.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'chown root:root /etc/postfix/sasl/smtpd.conf',
|
'chown root:root /etc/postfix/sasl/smtpd.conf',
|
||||||
'chmod 0644 /etc/postfix/main.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_alias_maps.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
@@ -120,7 +122,6 @@ return Array(
|
|||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
'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_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_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_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
@@ -131,6 +132,55 @@ return Array(
|
|||||||
'newaliases'
|
'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(
|
'exim4' => Array(
|
||||||
'label' => 'Exim4',
|
'label' => 'Exim4',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
@@ -188,6 +238,9 @@ return Array(
|
|||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'proftpd' => Array(
|
'proftpd' => Array(
|
||||||
'label' => 'ProFTPd',
|
'label' => 'ProFTPd',
|
||||||
|
'commands' => Array(
|
||||||
|
'apt-get install proftpd-basic proftpd-mod-mysql'
|
||||||
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
||||||
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
||||||
@@ -242,17 +295,14 @@ return Array(
|
|||||||
),
|
),
|
||||||
'awstats' => Array(
|
'awstats' => Array(
|
||||||
'label' => 'Awstats',
|
'label' => 'Awstats',
|
||||||
'files' => Array(
|
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
|
||||||
),
|
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
'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')
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
'libnss' => Array(
|
'libnss' => Array(
|
||||||
'label' => 'libnss (system login with mysql)',
|
'label' => 'libnss (system login with mysql)',
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ return Array(
|
|||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
|
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '',
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'a2dismod userdir',
|
'a2dismod userdir'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/apache2 restart'
|
'/etc/init.d/apache2 restart'
|
||||||
@@ -50,10 +51,13 @@ return Array(
|
|||||||
$configcommand['diroptions'],
|
$configcommand['diroptions'],
|
||||||
$configcommand['v_inclighty'],
|
$configcommand['v_inclighty'],
|
||||||
$configcommand['d_inclighty'],
|
$configcommand['d_inclighty'],
|
||||||
|
'lighty-disable-mod cgi',
|
||||||
|
'lighty-disable-mod fastcgi',
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
|
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : '',
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir']
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/lighttpd restart'
|
'/etc/init.d/lighttpd restart'
|
||||||
@@ -68,8 +72,10 @@ return Array(
|
|||||||
'label' => 'Bind9',
|
'label' => 'Bind9',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install bind9',
|
'apt-get install bind9',
|
||||||
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/bind/named.conf',
|
'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf',
|
||||||
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.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(
|
'restart' => Array(
|
||||||
'/etc/init.d/bind9 restart'
|
'/etc/init.d/bind9 restart'
|
||||||
@@ -90,11 +96,10 @@ return Array(
|
|||||||
'smtp' => Array(
|
'smtp' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['smtp'],
|
'label' => $lng['admin']['configfiles']['smtp'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'postfix' => Array(
|
'postfix_courier' => Array(
|
||||||
'label' => 'Postfix',
|
'label' => 'Postfix/Courier',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install postfix postfix-mysql libsasl2 libsasl2-modules libsasl2-modules-sql',
|
'apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql',
|
||||||
'mkdir -p /etc/postfix/sasl',
|
|
||||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||||
@@ -106,13 +111,11 @@ return Array(
|
|||||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'touch /etc/postfix/sasl/smtpd.conf',
|
'touch /etc/postfix/sasl/smtpd.conf',
|
||||||
'chown root:root /etc/postfix/main.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_alias_maps.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'chown root:root /etc/postfix/sasl/smtpd.conf',
|
'chown root:root /etc/postfix/sasl/smtpd.conf',
|
||||||
'chmod 0644 /etc/postfix/main.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_alias_maps.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
@@ -120,7 +123,6 @@ return Array(
|
|||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
'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_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_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_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
@@ -131,6 +133,55 @@ return Array(
|
|||||||
'newaliases'
|
'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(
|
'exim4' => Array(
|
||||||
'label' => 'Exim4',
|
'label' => 'Exim4',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
@@ -191,6 +242,9 @@ return Array(
|
|||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'proftpd' => Array(
|
'proftpd' => Array(
|
||||||
'label' => 'ProFTPd',
|
'label' => 'ProFTPd',
|
||||||
|
'commands' => Array(
|
||||||
|
'apt-get install proftpd-basic proftpd-mod-mysql'
|
||||||
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_proftpd_sql.conf' => '/etc/proftpd/sql.conf',
|
'etc_proftpd_sql.conf' => '/etc/proftpd/sql.conf',
|
||||||
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
||||||
@@ -249,17 +303,14 @@ return Array(
|
|||||||
),
|
),
|
||||||
'awstats' => Array(
|
'awstats' => Array(
|
||||||
'label' => 'Awstats',
|
'label' => 'Awstats',
|
||||||
'files' => Array(
|
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
|
||||||
),
|
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
'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')
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
'libnss' => Array(
|
'libnss' => Array(
|
||||||
'label' => 'libnss (system login with mysql)',
|
'label' => 'libnss (system login with mysql)',
|
||||||
|
|||||||
337
lib/configfiles/lucid.inc.php
Normal file
337
lib/configfiles/lucid.inc.php
Normal file
@@ -0,0 +1,337 @@
|
|||||||
|
<?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' => 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_conf.d_02-dovecot-sql.conf' => '/etc/dovecot/conf.d/02-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' => 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'
|
||||||
|
),
|
||||||
|
'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_xinet.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 /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')
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'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'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -31,7 +31,8 @@ return Array(
|
|||||||
$configcommand['diroptions'],
|
$configcommand['diroptions'],
|
||||||
$configcommand['include'],
|
$configcommand['include'],
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory']
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
|
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p ' . $settings['system']['deactivateddocroot'] : ''
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/apache2 restart'
|
'/etc/init.d/apache2 restart'
|
||||||
@@ -45,8 +46,10 @@ return Array(
|
|||||||
'bind' => Array(
|
'bind' => Array(
|
||||||
'label' => 'Bind9',
|
'label' => 'Bind9',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/named.conf',
|
'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/named.conf',
|
||||||
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf'
|
'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
|
||||||
|
'chown named:0 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
|
||||||
|
'chmod 0600 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/named restart'
|
'/etc/init.d/named restart'
|
||||||
@@ -88,6 +91,19 @@ return Array(
|
|||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/postfix restart'
|
'/etc/init.d/postfix restart'
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
'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'
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
@@ -136,16 +152,12 @@ return Array(
|
|||||||
),
|
),
|
||||||
'awstats' => Array(
|
'awstats' => Array(
|
||||||
'label' => 'Awstats',
|
'label' => 'Awstats',
|
||||||
'files' => Array(
|
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
|
||||||
),
|
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
'awstats_configure.pl',
|
||||||
|
makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'files' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
'etc_awstats.model.conf' => makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -45,6 +45,6 @@ else
|
|||||||
|
|
||||||
$cfgPath = 'lib/configfiles/';
|
$cfgPath = 'lib/configfiles/';
|
||||||
$configfiles = Array();
|
$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');
|
$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');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -24,6 +24,12 @@ if(@php_sapi_name() != 'cli'
|
|||||||
die('This script will only work in the shell.');
|
die('This script will only work in the shell.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ensure that default timezone is set
|
||||||
|
if(function_exists("date_default_timezone_set") && function_exists("date_default_timezone_get"))
|
||||||
|
{
|
||||||
|
@date_default_timezone_set(@date_default_timezone_get());
|
||||||
|
}
|
||||||
|
|
||||||
$lockdir = '/var/run/';
|
$lockdir = '/var/run/';
|
||||||
$lockFilename = 'froxlor_' . basename($_SERVER['PHP_SELF'], '.php') . '.lock-';
|
$lockFilename = 'froxlor_' . basename($_SERVER['PHP_SELF'], '.php') . '.lock-';
|
||||||
$lockfName = $lockFilename . getmypid();
|
$lockfName = $lockFilename . getmypid();
|
||||||
@@ -69,7 +75,7 @@ while($fName = readdir($lockDirHandle))
|
|||||||
// Check if cron is running or has died.
|
// Check if cron is running or has died.
|
||||||
|
|
||||||
$check_pid = substr(strstr($fName, "-"), 1);
|
$check_pid = substr(strstr($fName, "-"), 1);
|
||||||
system("kill -CHLD " . $check_pid . " 1> /dev/null 2> /dev/null", $check_pid_return);
|
system("kill -CHLD " . (int)$check_pid . " 1> /dev/null 2> /dev/null", $check_pid_return);
|
||||||
|
|
||||||
if($check_pid_return == 1)
|
if($check_pid_return == 1)
|
||||||
{
|
{
|
||||||
|
|||||||
45
lib/functions/aps/function.domainHasApsInstances.php
Normal file
45
lib/functions/aps/function.domainHasApsInstances.php
Normal 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 Language
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function domainHasApsInstances
|
||||||
|
*
|
||||||
|
* Checks if a given domain id
|
||||||
|
* is used for APS instances
|
||||||
|
* (if APS enabled, else always false)
|
||||||
|
*
|
||||||
|
* @param int domain-id
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
function domainHasApsInstances($domainid = 0)
|
||||||
|
{
|
||||||
|
global $db, $settings;
|
||||||
|
|
||||||
|
if($settings['aps']['aps_active'] == '1')
|
||||||
|
{
|
||||||
|
if($domainid > 0)
|
||||||
|
{
|
||||||
|
$instances = $db->query_first("SELECT COUNT(`ID`) AS `count` FROM `" . TABLE_APS_SETTINGS . "` WHERE `Name`='main_domain' AND `Value`='" . (int)$domainid . "'");
|
||||||
|
if((int)$instances['count'] != 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
* @author Florian Lippert <flo@syscp.org>
|
* @author Florian Lippert <flo@syscp.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function isConfigDir($dir)
|
function isConfigDir($dir, $ifexists = false)
|
||||||
{
|
{
|
||||||
if(file_exists($dir))
|
if(file_exists($dir))
|
||||||
{
|
{
|
||||||
@@ -41,6 +41,8 @@ function isConfigDir($dir)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if(!$ifexists)
|
||||||
{
|
{
|
||||||
if(substr($dir, -1) == '/')
|
if(substr($dir, -1) == '/')
|
||||||
{
|
{
|
||||||
@@ -51,6 +53,11 @@ function isConfigDir($dir)
|
|||||||
$returnval = false;
|
$returnval = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$returnval = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $returnval;
|
return $returnval;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
* @param integer uid The uid which must match the found directories
|
* @param integer uid The uid which must match the found directories
|
||||||
* @param integer gid The gid which must match the found direcotries
|
* @param integer gid The gid which must match the found direcotries
|
||||||
* @param string fieldType Either "Manual" or "Dropdown"
|
* @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
|
* @return string The html tag for the choosen $fieldType
|
||||||
*
|
*
|
||||||
* @author Martin Burchert <martin.burchert@syscp.de>
|
* @author Martin Burchert <martin.burchert@syscp.de>
|
||||||
@@ -38,17 +40,23 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '')
|
|||||||
|
|
||||||
if($fieldType == 'Manual')
|
if($fieldType == 'Manual')
|
||||||
{
|
{
|
||||||
$field = '<input type="text" name="path" value="' . htmlspecialchars($value) . '" size="30" />';
|
$field = '<input type="text" name="path" value="' . htmlspecialchars($value) . '" />';
|
||||||
}
|
}
|
||||||
elseif($fieldType == 'Dropdown')
|
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);
|
$dirList = findDirs($path, $uid, $gid);
|
||||||
|
|
||||||
natcasesort($dirList);
|
natcasesort($dirList);
|
||||||
|
|
||||||
if(sizeof($dirList) > 0)
|
if(sizeof($dirList) > 0)
|
||||||
{
|
{
|
||||||
if(sizeof(dirList) <= 100)
|
if(sizeof($dirList) <= 100)
|
||||||
{
|
{
|
||||||
$field = '<select name="path">';
|
$field = '<select name="path">';
|
||||||
foreach($dirList as $key => $dir)
|
foreach($dirList as $key => $dir)
|
||||||
@@ -64,8 +72,11 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// remove starting slash we added
|
||||||
|
// for the Dropdown, #225
|
||||||
|
$value = substr($value, 1);
|
||||||
$field = $lng['panel']['toomanydirs'];
|
$field = $lng['panel']['toomanydirs'];
|
||||||
$field.= '<input type="text" name="path" value="' . htmlspecialchars($value) . '" size="30" />';
|
$field.= '<input type="text" name="path" value="' . htmlspecialchars($value) . '" />';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -26,13 +26,15 @@
|
|||||||
* @param string The dir which should be created
|
* @param string The dir which should be created
|
||||||
* @param int The uid of the user
|
* @param int The uid of the user
|
||||||
* @param int The gid of the user
|
* @param int The gid of the user
|
||||||
|
* @param bool Place standard-index.html into the new folder
|
||||||
|
*
|
||||||
* @return bool true if everything went okay, false if something went wrong
|
* @return bool true if everything went okay, false if something went wrong
|
||||||
*
|
*
|
||||||
* @author Florian Lippert <flo@syscp.org>
|
* @author Florian Lippert <flo@syscp.org>
|
||||||
* @author Martin Burchert <martin.burchert@syscp.org>
|
* @author Martin Burchert <martin.burchert@syscp.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function mkDirWithCorrectOwnership($homeDir, $dirToCreate, $uid, $gid)
|
function mkDirWithCorrectOwnership($homeDir, $dirToCreate, $uid, $gid, $placeindex = false)
|
||||||
{
|
{
|
||||||
$returncode = true;
|
$returncode = true;
|
||||||
|
|
||||||
@@ -73,6 +75,17 @@ function mkDirWithCorrectOwnership($homeDir, $dirToCreate, $uid, $gid)
|
|||||||
{
|
{
|
||||||
$sdir = makeCorrectDir($sdir);
|
$sdir = makeCorrectDir($sdir);
|
||||||
safe_exec('mkdir -p ' . escapeshellarg($sdir));
|
safe_exec('mkdir -p ' . escapeshellarg($sdir));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* #68
|
||||||
|
*/
|
||||||
|
if ($placeindex) {
|
||||||
|
$loginname = getLoginNameByUid($uid);
|
||||||
|
if ($loginname !== false) {
|
||||||
|
storeDefaultIndex($loginname, $sdir, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
safe_exec('chown -R ' . (int)$uid . ':' . (int)$gid . ' ' . escapeshellarg($sdir));
|
safe_exec('chown -R ' . (int)$uid . ':' . (int)$gid . ' ' . escapeshellarg($sdir));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,11 +51,12 @@ function safe_exec($exec_string, &$return_value = false)
|
|||||||
$settings['system']['apachereload_command'],
|
$settings['system']['apachereload_command'],
|
||||||
$settings['system']['bindreload_command'],
|
$settings['system']['bindreload_command'],
|
||||||
$settings['dkim']['dkimrestart_command'],
|
$settings['dkim']['dkimrestart_command'],
|
||||||
$settings['system']['awstats_updateall_command'],
|
|
||||||
'openssl',
|
'openssl',
|
||||||
'unzip',
|
'unzip',
|
||||||
'php',
|
'php',
|
||||||
'rm'
|
'rm',
|
||||||
|
'awstats_buildstaticpages.pl',
|
||||||
|
'ln'
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -75,6 +76,8 @@ function safe_exec($exec_string, &$return_value = false)
|
|||||||
die('SECURITY CHECK FAILED!' . "\n" . 'The execute string "' . htmlspecialchars($exec_string) . '" is a possible security risk!' . "\n" . 'Please check your whole server for security problems by hand!' . "\n");
|
die('SECURITY CHECK FAILED!' . "\n" . 'The execute string "' . htmlspecialchars($exec_string) . '" is a possible security risk!' . "\n" . 'Please check your whole server for security problems by hand!' . "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is not needed anymore, we allow all commands and just check for pipes and stuff
|
||||||
//
|
//
|
||||||
// check if command is allowed here
|
// check if command is allowed here
|
||||||
//
|
//
|
||||||
@@ -82,7 +85,7 @@ function safe_exec($exec_string, &$return_value = false)
|
|||||||
$ok = false;
|
$ok = false;
|
||||||
foreach($allowed_commands as $allowed_command)
|
foreach($allowed_commands as $allowed_command)
|
||||||
{
|
{
|
||||||
if(strpos($exec_string, $allowed_command) == 0
|
if(strpos($exec_string, $allowed_command) === 0
|
||||||
&& (strlen($exec_string) === ($allowed_command_pos = strlen($allowed_command)) || substr($exec_string, $allowed_command_pos, 1) === ' '))
|
&& (strlen($exec_string) === ($allowed_command_pos = strlen($allowed_command)) || substr($exec_string, $allowed_command_pos, 1) === ' '))
|
||||||
{
|
{
|
||||||
$ok = true;
|
$ok = true;
|
||||||
@@ -93,6 +96,7 @@ function safe_exec($exec_string, &$return_value = false)
|
|||||||
{
|
{
|
||||||
die('SECURITY CHECK FAILED!' . "\n" . 'Your command "' . htmlspecialchars($exec_string) . '" is not allowed!' . "\n" . 'Please check your whole server for security problems by hand!' . "\n");
|
die('SECURITY CHECK FAILED!' . "\n" . 'Your command "' . htmlspecialchars($exec_string) . '" is not allowed!' . "\n" . 'Please check your whole server for security problems by hand!' . "\n");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//
|
//
|
||||||
// execute the command and return output
|
// execute the command and return output
|
||||||
|
|||||||
50
lib/functions/filedir/function.storeDefaultIndex.php
Normal file
50
lib/functions/filedir/function.storeDefaultIndex.php
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* store the default index-file in a given destination folder
|
||||||
|
*
|
||||||
|
* @param string $loginname customers loginname
|
||||||
|
* @param string $destination path where to create the file
|
||||||
|
* @param object $logger FroxlorLogger object
|
||||||
|
* @param boolean $force force creation whatever the settings say (needed for task #2, create new user)
|
||||||
|
*
|
||||||
|
* @return null
|
||||||
|
*/
|
||||||
|
function storeDefaultIndex($loginname = null, $destination = null, $logger = null, $force = false)
|
||||||
|
{
|
||||||
|
global $db, $settings, $pathtophpfiles;
|
||||||
|
|
||||||
|
if ($force
|
||||||
|
|| (int)$settings['system']['store_index_file_subs'] == 1
|
||||||
|
) {
|
||||||
|
$result = $db->query("SELECT `t`.`value`, `c`.`email` AS `customer_email`, `a`.`email` AS `admin_email`, `c`.`loginname` AS `customer_login`, `a`.`loginname` AS `admin_login` FROM `" . TABLE_PANEL_CUSTOMERS . "` AS `c` INNER JOIN `" . TABLE_PANEL_ADMINS . "` AS `a` ON `c`.`adminid` = `a`.`adminid` INNER JOIN `" . TABLE_PANEL_TEMPLATES . "` AS `t` ON `a`.`adminid` = `t`.`adminid` WHERE `varname` = 'index_html' AND `c`.`loginname` = '" . $db->escape($loginname) . "'");
|
||||||
|
|
||||||
|
if($db->num_rows($result) > 0)
|
||||||
|
{
|
||||||
|
$template = $db->fetch_array($result);
|
||||||
|
$replace_arr = array(
|
||||||
|
'SERVERNAME' => $settings['system']['hostname'],
|
||||||
|
'CUSTOMER' => $template['customer_login'],
|
||||||
|
'ADMIN' => $template['admin_login'],
|
||||||
|
'CUSTOMER_EMAIL' => $template['customer_email'],
|
||||||
|
'ADMIN_EMAIL' => $template['admin_email']
|
||||||
|
);
|
||||||
|
$htmlcontent = replace_variables($template['value'], $replace_arr);
|
||||||
|
$indexhtmlpath = makeCorrectFile($destination . '/index.' . $settings['system']['index_file_extension']);
|
||||||
|
$index_html_handler = fopen($indexhtmlpath, 'w');
|
||||||
|
fwrite($index_html_handler, $htmlcontent);
|
||||||
|
fclose($index_html_handler);
|
||||||
|
if ($logger !== null) {
|
||||||
|
$logger->logAction(CRON_ACTION, LOG_NOTICE, 'Creating \'index.' . $settings['system']['index_file_extension'] . '\' for Customer \'' . $template['customer_login'] . '\' based on template in directory ' . escapeshellarg($indexhtmlpath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($logger !== null) {
|
||||||
|
$logger->logAction(CRON_ACTION, LOG_NOTICE, 'Running: cp -a ' . $pathtophpfiles . '/templates/misc/standardcustomer/* ' . escapeshellarg($destination));
|
||||||
|
}
|
||||||
|
safe_exec('cp -a ' . $pathtophpfiles . '/templates/misc/standardcustomer/* ' . escapeshellarg($destination));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getFormFieldDataBool($fieldname, $fielddata, $input)
|
function getFormFieldDataBool($fieldname, $fielddata, &$input)
|
||||||
{
|
{
|
||||||
if(isset($input[$fieldname]) && ($input[$fieldname] === '1' || $input[$fieldname] === 1 || $input[$fieldname] === true || strtolower($input[$fieldname]) === 'yes' || strtolower($input[$fieldname]) === 'ja'))
|
if(isset($input[$fieldname]) && ($input[$fieldname] === '1' || $input[$fieldname] === 1 || $input[$fieldname] === true || strtolower($input[$fieldname]) === 'yes' || strtolower($input[$fieldname]) === 'ja'))
|
||||||
{
|
{
|
||||||
|
|||||||
62
lib/functions/formfields/function.buildFormEx.php
Normal file
62
lib/functions/formfields/function.buildFormEx.php
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<?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 $
|
||||||
|
*/
|
||||||
|
|
||||||
|
function buildFormEx($form, $part = '')
|
||||||
|
{
|
||||||
|
$fields = '';
|
||||||
|
|
||||||
|
if(validateFormDefinition($form))
|
||||||
|
{
|
||||||
|
foreach($form['groups'] as $groupname => $groupdetails)
|
||||||
|
{
|
||||||
|
// show overview
|
||||||
|
if($part == '')
|
||||||
|
{
|
||||||
|
if(isset($groupdetails['title']) && $groupdetails['title'] != '')
|
||||||
|
{
|
||||||
|
$fields .= getFormOverviewGroupOutput($groupname, $groupdetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// only show one section
|
||||||
|
elseif($part != '' && ($groupname == $part || $part == 'all'))
|
||||||
|
{
|
||||||
|
if(isset($groupdetails['title']) && $groupdetails['title'] != '')
|
||||||
|
{
|
||||||
|
$fields .= getFormGroupOutput($groupname, $groupdetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(validateFieldDefinition($groupdetails))
|
||||||
|
{
|
||||||
|
// Prefetch form fields
|
||||||
|
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||||
|
{
|
||||||
|
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
|
||||||
|
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Collect form field output
|
||||||
|
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||||
|
{
|
||||||
|
$fields .= getFormFieldOutput($fieldname, $fielddetails);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $fields;
|
||||||
|
}
|
||||||
@@ -17,11 +17,11 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getFormFieldData($fieldname, $fielddata, $input)
|
function getFormFieldData($fieldname, $fielddata, &$input)
|
||||||
{
|
{
|
||||||
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldData' . ucfirst($fielddata['type'])))
|
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldData' . ucfirst($fielddata['type'])))
|
||||||
{
|
{
|
||||||
$newfieldvalue = call_user_func('getFormFieldData' . ucfirst($fielddata['type']), $fieldname, $fielddata, &$input);
|
$newfieldvalue = call_user_func('getFormFieldData' . ucfirst($fielddata['type']), $fieldname, $fielddata, $input);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,3 +23,54 @@ function getFormGroupOutput($groupname, $groupdetails)
|
|||||||
eval("\$group = \"" . getTemplate("settings/settings_group") . "\";");
|
eval("\$group = \"" . getTemplate("settings/settings_group") . "\";");
|
||||||
return $group;
|
return $group;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getFormOverviewGroupOutput($groupname, $groupdetails)
|
||||||
|
{
|
||||||
|
global $lng, $settings, $filename, $s;
|
||||||
|
|
||||||
|
$group = '';
|
||||||
|
$title = $groupdetails['title'];
|
||||||
|
$part = $groupname;
|
||||||
|
|
||||||
|
$activated = true;
|
||||||
|
$option = '';
|
||||||
|
if(isset($groupdetails['fields']))
|
||||||
|
{
|
||||||
|
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||||
|
{
|
||||||
|
if(isset($fielddetails['overview_option'])
|
||||||
|
&& $fielddetails['overview_option'] == true
|
||||||
|
) {
|
||||||
|
if($fielddetails['type'] != 'option'
|
||||||
|
&& $fielddetails['type'] != 'bool')
|
||||||
|
{
|
||||||
|
standard_error('overviewsettingoptionisnotavalidfield');
|
||||||
|
}
|
||||||
|
|
||||||
|
if($fielddetails['type'] == 'option')
|
||||||
|
{
|
||||||
|
$options_array = $fielddetails['option_options'];
|
||||||
|
$options = '';
|
||||||
|
foreach($options_array as $value => $vtitle)
|
||||||
|
{
|
||||||
|
$options .= makeoption($vtitle, $value, $settings[$fielddetails['settinggroup']][$fielddetails['varname']]);
|
||||||
|
}
|
||||||
|
$option.= $fielddetails['label'].': ';
|
||||||
|
$option.= '<select class="dropdown_noborder" name="'.$fieldname.'">';
|
||||||
|
$option.= $options;
|
||||||
|
$option.= '</select>';
|
||||||
|
$activated = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$option.= $lng['admin']['activated'].': ';
|
||||||
|
$option.= makeyesno($fieldname, '1', '0', $settings[$fielddetails['settinggroup']][$fielddetails['varname']]);
|
||||||
|
$activated = (int)$settings[$fielddetails['settinggroup']][$fielddetails['varname']];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
eval("\$group = \"" . getTemplate("settings/settings_overviewgroup") . "\";");
|
||||||
|
return $group;
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function processForm($form, $input, $url_params = array())
|
function processForm(&$form, &$input, $url_params = array())
|
||||||
{
|
{
|
||||||
if(validateFormDefinition($form))
|
if(validateFormDefinition($form))
|
||||||
{
|
{
|
||||||
@@ -45,7 +45,7 @@ function processForm($form, $input, $url_params = array())
|
|||||||
// Validate fields
|
// Validate fields
|
||||||
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||||
{
|
{
|
||||||
$newfieldvalue = getFormFieldData($fieldname, $fielddetails, &$input);
|
$newfieldvalue = getFormFieldData($fieldname, $fielddetails, $input);
|
||||||
|
|
||||||
if($newfieldvalue != $fielddetails['value'])
|
if($newfieldvalue != $fielddetails['value'])
|
||||||
{
|
{
|
||||||
@@ -143,3 +143,166 @@ function processForm($form, $input, $url_params = array())
|
|||||||
return saveForm($form, $saved_fields);
|
return saveForm($form, $saved_fields);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function processFormEx(&$form, &$input, $url_params = array(), $part, $settings_all, $settings_part, $only_enabledisable)
|
||||||
|
{
|
||||||
|
if(validateFormDefinition($form))
|
||||||
|
{
|
||||||
|
$submitted_fields = array();
|
||||||
|
$changed_fields = array();
|
||||||
|
$saved_fields = array();
|
||||||
|
|
||||||
|
foreach($form['groups'] as $groupname => $groupdetails)
|
||||||
|
{
|
||||||
|
if(($settings_part && $part == $groupname)
|
||||||
|
|| $settings_all
|
||||||
|
|| $only_enabledisable
|
||||||
|
){
|
||||||
|
if(validateFieldDefinition($groupdetails))
|
||||||
|
{
|
||||||
|
// Prefetch form fields
|
||||||
|
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||||
|
{
|
||||||
|
if(!$only_enabledisable
|
||||||
|
|| ($only_enabledisable && isset($fielddetails['overview_option']))
|
||||||
|
) {
|
||||||
|
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
|
||||||
|
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($form['groups'] as $groupname => $groupdetails)
|
||||||
|
{
|
||||||
|
if(($settings_part && $part == $groupname)
|
||||||
|
|| $settings_all
|
||||||
|
|| $only_enabledisable
|
||||||
|
){
|
||||||
|
if(validateFieldDefinition($groupdetails))
|
||||||
|
{
|
||||||
|
// Validate fields
|
||||||
|
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||||
|
{
|
||||||
|
if(!$only_enabledisable
|
||||||
|
|| ($only_enabledisable && isset($fielddetails['overview_option']))
|
||||||
|
) {
|
||||||
|
$newfieldvalue = getFormFieldData($fieldname, $fielddetails, $input);
|
||||||
|
|
||||||
|
if($newfieldvalue != $fielddetails['value'])
|
||||||
|
{
|
||||||
|
if(($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true)
|
||||||
|
{
|
||||||
|
standard_error($error, $fieldname);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$changed_fields[$fieldname] = $newfieldvalue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$submitted_fields[$fieldname] = $newfieldvalue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($form['groups'] as $groupname => $groupdetails)
|
||||||
|
{
|
||||||
|
if(($settings_part && $part == $groupname)
|
||||||
|
|| $settings_all
|
||||||
|
|| $only_enabledisable
|
||||||
|
){
|
||||||
|
if(validateFieldDefinition($groupdetails))
|
||||||
|
{
|
||||||
|
// Check fields for plausibility
|
||||||
|
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||||
|
{
|
||||||
|
if(!$only_enabledisable
|
||||||
|
|| ($only_enabledisable && isset($fielddetails['overview_option']))
|
||||||
|
) {
|
||||||
|
if(($plausibility_check = checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false)
|
||||||
|
{
|
||||||
|
if(is_array($plausibility_check) && isset($plausibility_check[0]))
|
||||||
|
{
|
||||||
|
if($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_OK)
|
||||||
|
{
|
||||||
|
// Nothing to do here, everything's okay
|
||||||
|
}
|
||||||
|
elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_ERROR)
|
||||||
|
{
|
||||||
|
unset($plausibility_check[0]);
|
||||||
|
$error = $plausibility_check[1];
|
||||||
|
unset($plausibility_check[1]);
|
||||||
|
$targetname = implode(' ', $plausibility_check);
|
||||||
|
standard_error($error, $targetname);
|
||||||
|
}
|
||||||
|
elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION)
|
||||||
|
{
|
||||||
|
unset($plausibility_check[0]);
|
||||||
|
$question = $plausibility_check[1];
|
||||||
|
unset($plausibility_check[1]);
|
||||||
|
$targetname = implode(' ', $plausibility_check);
|
||||||
|
if(!isset($input[$question]))
|
||||||
|
{
|
||||||
|
if(is_array($url_params) && isset($url_params['filename']))
|
||||||
|
{
|
||||||
|
$filename = $url_params['filename'];
|
||||||
|
unset($url_params['filename']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$filename = '';
|
||||||
|
}
|
||||||
|
ask_yesno($question, $filename, array_merge($url_params, $submitted_fields, array($question => $question)), $targetname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
standard_error('plausibilitychecknotunderstood');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($form['groups'] as $groupname => $groupdetails)
|
||||||
|
{
|
||||||
|
if(($settings_part && $part == $groupname)
|
||||||
|
|| $settings_all
|
||||||
|
|| $only_enabledisable
|
||||||
|
){
|
||||||
|
if(validateFieldDefinition($groupdetails))
|
||||||
|
{
|
||||||
|
// Save fields
|
||||||
|
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||||
|
{
|
||||||
|
if(!$only_enabledisable
|
||||||
|
|| ($only_enabledisable && isset($fielddetails['overview_option']))
|
||||||
|
) {
|
||||||
|
if(isset($changed_fields[$fieldname]))
|
||||||
|
{
|
||||||
|
if(($saved_field = saveFormField($fieldname, $fielddetails, manipulateFormFieldData($fieldname, $fielddetails, $changed_fields[$fieldname]))) !== false)
|
||||||
|
{
|
||||||
|
$saved_fields = array_merge($saved_fields, $saved_field);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
standard_error('errorwhensaving', $fieldname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save form
|
||||||
|
return saveForm($form, $saved_fields);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,13 +19,20 @@
|
|||||||
|
|
||||||
function validateFormFieldHidden($fieldname, $fielddata, $newfieldvalue)
|
function validateFormFieldHidden($fieldname, $fielddata, $newfieldvalue)
|
||||||
{
|
{
|
||||||
if($newfieldvalue === $fielddata['value'])
|
/**
|
||||||
{
|
* don't show error on cronjob-timestamps changing
|
||||||
|
* because it might be possible that the cronjob ran
|
||||||
|
* while settings have been edited (bug #52)
|
||||||
|
*/
|
||||||
|
if($newfieldvalue === $fielddata['value']
|
||||||
|
|| $fieldname == 'system_last_tasks_run'
|
||||||
|
|| $fieldname == 'system_last_traffic_run'
|
||||||
|
|| $fieldname == 'system_lastcronrun'
|
||||||
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// TODO: Throw some error that actually makes sense - false would just throw unknown error
|
return 'hiddenfieldvaluechanged';
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getFormFieldDataInt($fieldname, $fielddata, $input)
|
function getFormFieldDataInt($fieldname, $fielddata, &$input)
|
||||||
{
|
{
|
||||||
if(isset($input[$fieldname]))
|
if(isset($input[$fieldname]))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getFormFieldDataOption($fieldname, $fielddata, $input)
|
function getFormFieldDataOption($fieldname, $fielddata, &$input)
|
||||||
{
|
{
|
||||||
if(isset($input[$fieldname]))
|
if(isset($input[$fieldname]))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ function validateFormFieldString($fieldname, $fielddata, $newfieldvalue)
|
|||||||
$returnvalue = true;
|
$returnvalue = true;
|
||||||
foreach($newfieldvalues as $single_newfieldvalue)
|
foreach($newfieldvalues as $single_newfieldvalue)
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* don't use tabs in value-fields, #81
|
||||||
|
*/
|
||||||
|
$single_newfieldvalue = str_replace("\t", " ", $single_newfieldvalue);
|
||||||
$single_returnvalue = validateFormFieldString($fieldname, $fielddata, $single_newfieldvalue);
|
$single_returnvalue = validateFormFieldString($fieldname, $fielddata, $single_newfieldvalue);
|
||||||
if($single_returnvalue !== true)
|
if($single_returnvalue !== true)
|
||||||
{
|
{
|
||||||
@@ -39,6 +43,11 @@ function validateFormFieldString($fieldname, $fielddata, $newfieldvalue)
|
|||||||
{
|
{
|
||||||
$returnvalue = false;
|
$returnvalue = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* don't use tabs in value-fields, #81
|
||||||
|
*/
|
||||||
|
$newfieldvalue = str_replace("\t", " ", $newfieldvalue);
|
||||||
|
|
||||||
if(isset($fielddata['string_type']) && $fielddata['string_type'] == 'mail')
|
if(isset($fielddata['string_type']) && $fielddata['string_type'] == 'mail')
|
||||||
{
|
{
|
||||||
$returnvalue = (filter_var($newfieldvalue, FILTER_VALIDATE_EMAIL) == $newfieldvalue);
|
$returnvalue = (filter_var($newfieldvalue, FILTER_VALIDATE_EMAIL) == $newfieldvalue);
|
||||||
|
|||||||
@@ -60,16 +60,17 @@ function getNextCronjobs()
|
|||||||
|
|
||||||
function includeCronjobs($debugHandler, $pathtophpfiles)
|
function includeCronjobs($debugHandler, $pathtophpfiles)
|
||||||
{
|
{
|
||||||
|
global $settings;
|
||||||
|
|
||||||
$cronjobs = getNextCronjobs();
|
$cronjobs = getNextCronjobs();
|
||||||
|
|
||||||
$jobs_to_run = array();
|
$jobs_to_run = array();
|
||||||
|
$cron_path = makeCorrectDir($pathtophpfiles.'/scripts/jobs/');
|
||||||
|
|
||||||
if($cronjobs !== false
|
if($cronjobs !== false
|
||||||
&& is_array($cronjobs)
|
&& is_array($cronjobs)
|
||||||
&& isset($cronjobs[0]))
|
&& isset($cronjobs[0]))
|
||||||
{
|
{
|
||||||
$cron_path = makeCorrectDir($pathtophpfiles.'/scripts/jobs/');
|
|
||||||
|
|
||||||
foreach($cronjobs as $cronjob)
|
foreach($cronjobs as $cronjob)
|
||||||
{
|
{
|
||||||
$cron_file = makeCorrectFile($cron_path.$cronjob);
|
$cron_file = makeCorrectFile($cron_path.$cronjob);
|
||||||
@@ -77,6 +78,17 @@ function includeCronjobs($debugHandler, $pathtophpfiles)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* if we're on realtime and cron_tasks is not one
|
||||||
|
* of the jobs to run, we add it so the changes are being applied
|
||||||
|
*/
|
||||||
|
if ($settings['system']['realtime_port'] !== 0) {
|
||||||
|
$cron_file = makeCorrectFile($cron_path.'/cron_tasks.php');
|
||||||
|
if (!in_array($cron_file, $jobs_to_run)) {
|
||||||
|
$jobs_to_run[] = $cron_file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $jobs_to_run;
|
return $jobs_to_run;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,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) == '') {
|
if(trim($tasks) == '') {
|
||||||
$outstanding_tasks .= '<li>'.$lng['tasks']['noneoutstanding'].'</li>';
|
$outstanding_tasks .= '<li>'.$lng['tasks']['noneoutstanding'].'</li>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -24,37 +24,61 @@
|
|||||||
* @param logFile
|
* @param logFile
|
||||||
* @param siteDomain
|
* @param siteDomain
|
||||||
* @param hostAliases
|
* @param hostAliases
|
||||||
* @return
|
* @return null
|
||||||
* @author Michael Duergner
|
|
||||||
* @author Berend Dekens
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function createAWStatsConf($logFile, $siteDomain, $hostAliases)
|
function createAWStatsConf($logFile, $siteDomain, $hostAliases, $customerDocroot)
|
||||||
{
|
{
|
||||||
global $pathtophpfiles;
|
global $pathtophpfiles, $settings;
|
||||||
|
|
||||||
// Generation header
|
// Generation header
|
||||||
|
|
||||||
$header = "## GENERATED BY SYSCP\n";
|
$header = "## GENERATED BY FROXLOR\n";
|
||||||
$header2 = "## Do not remove the line above! This tells Froxlor to update this configuration\n## If you wish to manually change this configuration file, remove the first line to make sure Froxlor won't rebuild this file\n## Generated for domain {SITE_DOMAIN} on " . date('l dS \of F Y h:i:s A') . "\n";
|
$header2 = "## Do not remove the line above! This tells Froxlor to update this configuration\n## If you wish to manually change this configuration file, remove the first line to make sure Froxlor won't rebuild this file\n## Generated for domain {SITE_DOMAIN} on " . date('l dS \of F Y h:i:s A') . "\n";
|
||||||
|
|
||||||
|
$awstats_dir = makeCorrectDir($customerDocroot.'/awstats/'.$siteDomain.'/');
|
||||||
|
if(!is_dir($awstats_dir))
|
||||||
|
{
|
||||||
|
safe_exec('mkdir -p '.escapeshellarg($awstats_dir));
|
||||||
|
}
|
||||||
|
|
||||||
|
// weird but could happen...
|
||||||
|
if(!is_dir($settings['system']['awstats_conf']))
|
||||||
|
{
|
||||||
|
safe_exec('mkdir -p '.escapeshellarg($settings['system']['awstats_conf']));
|
||||||
|
}
|
||||||
|
|
||||||
// These are the variables we will replace
|
// These are the variables we will replace
|
||||||
|
|
||||||
$regex = array(
|
$regex = array(
|
||||||
'/\{LOG_FILE\}/',
|
'/\{LOG_FILE\}/',
|
||||||
'/\{SITE_DOMAIN\}/',
|
'/\{SITE_DOMAIN\}/',
|
||||||
'/\{HOST_ALIASES\}/'
|
'/\{HOST_ALIASES\}/',
|
||||||
|
'/\{CUSTOMER_DOCROOT\}/',
|
||||||
|
'/\{AWSTATS_CONF\}/'
|
||||||
);
|
);
|
||||||
$replace = array(
|
$replace = array(
|
||||||
$logFile,
|
makeCorrectFile($logFile),
|
||||||
$siteDomain,
|
$siteDomain,
|
||||||
$hostAliases
|
$hostAliases,
|
||||||
|
$awstats_dir,
|
||||||
|
makeCorrectDir($settings['system']['awstats_conf'])
|
||||||
);
|
);
|
||||||
|
|
||||||
// File names
|
// File names
|
||||||
|
|
||||||
$domain_file = '/etc/awstats/awstats.' . $siteDomain . '.conf';
|
$domain_file = makeCorrectFile($settings['system']['awstats_conf'].'/awstats.' . $siteDomain . '.conf');
|
||||||
$model_file = '/etc/awstats/awstats.model.conf.froxlor';
|
$model_file = dirname(dirname(dirname(dirname(__FILE__))));
|
||||||
|
$model_file.= '/templates/misc/awstatsmodel/';
|
||||||
|
|
||||||
|
if($settings['system']['mod_log_sql'] == '1')
|
||||||
|
{
|
||||||
|
$model_file.= 'awstats.froxlor.model_log_sql.conf';
|
||||||
|
} else {
|
||||||
|
$model_file.= 'awstats.froxlor.model.conf';
|
||||||
|
}
|
||||||
|
|
||||||
|
$model_file = makeCorrectFile($model_file);
|
||||||
|
|
||||||
// Test if the file exists
|
// Test if the file exists
|
||||||
|
|
||||||
|
|||||||
21
lib/functions/froxlor/function.getCustomerIdByDomain.php
Normal file
21
lib/functions/froxlor/function.getCustomerIdByDomain.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns the customer-id of a customer by given domain
|
||||||
|
*
|
||||||
|
* @param string $domain users domain
|
||||||
|
*
|
||||||
|
* @return int customers id
|
||||||
|
*/
|
||||||
|
function getCustomerIdByDomain($domain = null)
|
||||||
|
{
|
||||||
|
global $db;
|
||||||
|
|
||||||
|
$result = $db->query_first("SELECT `customerid` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain` = '".$domain."'");
|
||||||
|
if(is_array($result)
|
||||||
|
&& isset($result['customerid'])
|
||||||
|
) {
|
||||||
|
return $result['customerid'];
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
21
lib/functions/froxlor/function.getLoginNameByUid.php
Normal file
21
lib/functions/froxlor/function.getLoginNameByUid.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns the loginname of a customer by given uid
|
||||||
|
*
|
||||||
|
* @param int $uid uid of customer
|
||||||
|
*
|
||||||
|
* @return string customers loginname
|
||||||
|
*/
|
||||||
|
function getLoginNameByUid($uid = null)
|
||||||
|
{
|
||||||
|
global $db;
|
||||||
|
|
||||||
|
$result = $db->query_first("SELECT `loginname` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `guid` = '".(int)$uid."'");
|
||||||
|
if(is_array($result)
|
||||||
|
&& isset($result['loginname'])
|
||||||
|
) {
|
||||||
|
return $result['loginname'];
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
41
lib/functions/froxlor/function.getPhpConfigs.php
Normal file
41
lib/functions/froxlor/function.getPhpConfigs.php
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<?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$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns an array for the settings-array
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function getPhpConfigs()
|
||||||
|
{
|
||||||
|
global $db;
|
||||||
|
|
||||||
|
$query = 'SELECT * FROM `' . TABLE_PANEL_PHPCONFIGS . '` ';
|
||||||
|
$result = $db->query($query);
|
||||||
|
$configs_array = array();
|
||||||
|
|
||||||
|
while($row = $db->fetch_array($result))
|
||||||
|
{
|
||||||
|
if(!isset($configs_array[$row['id']])
|
||||||
|
&& !in_array($row['id'], $configs_array))
|
||||||
|
{
|
||||||
|
$configs_array[$row['id']] = html_entity_decode($row['description']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $configs_array;
|
||||||
|
}
|
||||||
@@ -64,21 +64,23 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '')
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($doupdate === true
|
if($doupdate === true
|
||||||
&& (int)$settings['system']['realtime_port'] !== 0)
|
&& (int)$settings['system']['realtime_port'] !== 0
|
||||||
|
&& function_exists('socket_create'))
|
||||||
{
|
{
|
||||||
$timeout = 15;
|
$timeout = 15;
|
||||||
$socket = @socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
|
//$socket = @socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
|
||||||
|
$socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||||
|
|
||||||
if($socket !== false)
|
if($socket !== false)
|
||||||
{
|
{
|
||||||
// create the request packet
|
// create the request packet
|
||||||
$packet = chr(0) . chr(1) . 'RUN' . chr(0);
|
$packet = chr(0) . chr(1) . 'RUN' . chr(0);
|
||||||
// UDP is connectionless, so we just send on it.
|
// UDP is connectionless, so we just send on it.
|
||||||
@socket_sendto($socket, $packet, strlen($packet), 0x100, '127.0.0.1', (int)$settings['system']['realtime_port']);
|
//@socket_sendto($socket, $packet, strlen($packet), 0x100, '127.0.0.1', (int)$settings['system']['realtime_port']);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* this is for TCP-Connections
|
* this is for TCP-Connections
|
||||||
*
|
*/
|
||||||
$time = time();
|
$time = time();
|
||||||
|
|
||||||
while(!@socket_connect($socket, '127.0.0.1', (int)$settings['system']['realtime_port']))
|
while(!@socket_connect($socket, '127.0.0.1', (int)$settings['system']['realtime_port']))
|
||||||
@@ -97,6 +99,8 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '')
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* close socket
|
||||||
*/
|
*/
|
||||||
@socket_close($socket);
|
@socket_close($socket);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,10 +30,16 @@ function openRootDB($debugHandler, $lockfile)
|
|||||||
{
|
{
|
||||||
global $db_root;
|
global $db_root;
|
||||||
|
|
||||||
// If one cronscript needs root, it should say $needrootdb = true before the include
|
require dirname(dirname(dirname(__FILE__))).'/userdata.inc.php';
|
||||||
if(isset($needrootdb)
|
|
||||||
&& $needrootdb === true)
|
// Legacy sql-root-information
|
||||||
|
if(isset($sql['root_user']) && isset($sql['root_password']) && (!isset($sql_root) || !is_array($sql_root)))
|
||||||
{
|
{
|
||||||
|
$sql_root = array(0 => array('caption' => 'Default', 'host' => $sql['host'], 'user' => $sql['root_user'], 'password' => $sql['root_password']));
|
||||||
|
unset($sql['root_user']);
|
||||||
|
unset($sql['root_password']);
|
||||||
|
}
|
||||||
|
|
||||||
$db_root = new db($sql_root[0]['host'], $sql_root[0]['user'], $sql_root[0]['password'], '');
|
$db_root = new db($sql_root[0]['host'], $sql_root[0]['user'], $sql_root[0]['password'], '');
|
||||||
|
|
||||||
if($db_root->link_id == 0)
|
if($db_root->link_id == 0)
|
||||||
@@ -49,7 +55,8 @@ function openRootDB($debugHandler, $lockfile)
|
|||||||
|
|
||||||
unset($db_root->password);
|
unset($db_root->password);
|
||||||
fwrite($debugHandler, 'Database-rootconnection established' . "\n");
|
fwrite($debugHandler, 'Database-rootconnection established' . "\n");
|
||||||
}
|
|
||||||
|
unset($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeRootDB()
|
function closeRootDB()
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ function hasUpdates($to_check = null)
|
|||||||
*/
|
*/
|
||||||
function showUpdateStep($task = null, $needs_status = true)
|
function showUpdateStep($task = null, $needs_status = true)
|
||||||
{
|
{
|
||||||
global $updatelog;
|
global $updatelog, $filelog;
|
||||||
|
|
||||||
// output
|
// output
|
||||||
echo $task;
|
echo $task;
|
||||||
@@ -126,6 +126,7 @@ function showUpdateStep($task = null, $needs_status = true)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, $task);
|
$updatelog->logAction(ADM_ACTION, LOG_WARNING, $task);
|
||||||
|
$filelog->logAction(ADM_ACTION, LOG_WARNING, $task);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -134,26 +135,26 @@ function showUpdateStep($task = null, $needs_status = true)
|
|||||||
* outputs [OK] (success), [??] (warning) or [!!] (failure)
|
* outputs [OK] (success), [??] (warning) or [!!] (failure)
|
||||||
* of the last update-step
|
* of the last update-step
|
||||||
*
|
*
|
||||||
* @param int status (0 = success, 1 = warning, -1 = failure)
|
* @param int status (0 = success, 1 = warning, 2 = failure)
|
||||||
*
|
*
|
||||||
* @return string formatted output and log-entry
|
* @return string formatted output and log-entry
|
||||||
*/
|
*/
|
||||||
function lastStepStatus($status = -1)
|
function lastStepStatus($status = -1, $message = '')
|
||||||
{
|
{
|
||||||
global $updatelog;
|
global $updatelog, $filelog;
|
||||||
|
|
||||||
switch($status)
|
switch($status)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
$status_sign = '[OK]';
|
$status_sign = ($message != '') ? '['.$message.']' : '[OK]';
|
||||||
$status_color = '1dcd00';
|
$status_color = '1dcd00';
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
$status_sign = '[??]';
|
$status_sign = ($message != '') ? '['.$message.']' : '[??]';
|
||||||
$status_color = 'db7100';
|
$status_color = 'db7100';
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$status_sign = '[!!]';
|
$status_sign = ($message != '') ? '['.$message.']' : '[!!]';
|
||||||
$status_color = 'ff0000';
|
$status_color = 'ff0000';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -164,8 +165,35 @@ function lastStepStatus($status = -1)
|
|||||||
// output
|
// output
|
||||||
echo "<span style=\"margin-left: 5em; font-weight: bold; color: #".$status_color."\">".$status_sign."</span><br />";
|
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!!!');
|
$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';
|
||||||
|
}
|
||||||
|
|||||||
163
lib/functions/output/function.RedirectCode.php
Normal file
163
lib/functions/output/function.RedirectCode.php
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
<?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;
|
||||||
|
|
||||||
|
$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("UPDATE `".TABLE_PANEL_DOMAINREDIRECTS."`
|
||||||
|
SET `rid` = '".(int)$redirect."'
|
||||||
|
WHERE `did` = '".(int)$domainid."'");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function loadSettings($settings_data, $db)
|
function loadSettings(&$settings_data, $db)
|
||||||
{
|
{
|
||||||
$settings = array();
|
$settings = array();
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,17 @@ function storeSettingField($fieldname, $fielddata, $newfieldvalue)
|
|||||||
toggleCronStatus($fielddata['cronmodule'], $newfieldvalue);
|
toggleCronStatus($fielddata['cronmodule'], $newfieldvalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* satisfy dependencies
|
||||||
|
*/
|
||||||
|
if(isset($fielddata['dependency']) && is_array($fielddata['dependency']))
|
||||||
|
{
|
||||||
|
if((int)$fielddata['dependency']['onlyif'] == (int)$newfieldvalue)
|
||||||
|
{
|
||||||
|
storeSettingField($fielddata['dependency']['fieldname'], $fielddata['dependency']['fielddata'], $newfieldvalue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return array($fielddata['settinggroup'] . '.' . $fielddata['varname'] => $newfieldvalue);
|
return array($fielddata['settinggroup'] . '.' . $fielddata['varname'] => $newfieldvalue);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Language
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -29,14 +29,25 @@
|
|||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function checkLastGuid($froxlor_guid = 0)
|
function checkLastGuid()
|
||||||
{
|
{
|
||||||
global $cronlog;
|
global $log, $cronlog, $db, $settings;
|
||||||
|
|
||||||
|
$mylog = null;
|
||||||
|
if (isset($cronlog) && $cronlog instanceof FroxlorLogger) {
|
||||||
|
$mylog = $cronlog;
|
||||||
|
} else {
|
||||||
|
$mylog = $log;
|
||||||
|
}
|
||||||
|
|
||||||
$group_lines = array();
|
$group_lines = array();
|
||||||
$group_guids = array();
|
$group_guids = array();
|
||||||
$update_to_guid = 0;
|
$update_to_guid = 0;
|
||||||
|
|
||||||
|
$froxlor_guid = 0;
|
||||||
|
$result = $db->query_first("SELECT MAX(`guid`) as `fguid` FROM `".TABLE_PANEL_CUSTOMERS."`");
|
||||||
|
$froxlor_guid = $result['fguid'];
|
||||||
|
|
||||||
$g_file = '/etc/group';
|
$g_file = '/etc/group';
|
||||||
|
|
||||||
if(file_exists($g_file))
|
if(file_exists($g_file))
|
||||||
@@ -54,28 +65,44 @@ function checkLastGuid($froxlor_guid = 0)
|
|||||||
|
|
||||||
foreach($group_guids as $idx => $group)
|
foreach($group_guids as $idx => $group)
|
||||||
{
|
{
|
||||||
$guid = $group[2];
|
/**
|
||||||
|
* nogroup | nobody have very high guids
|
||||||
|
* ignore them
|
||||||
|
*/
|
||||||
|
if($group[0] == 'nogroup'
|
||||||
|
|| $group[0] == 'nobody'
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if($guid > $froxlor_guid)
|
$guid = isset($group[2]) ? (int)$group[2] : 0;
|
||||||
|
|
||||||
|
if($guid > $update_to_guid)
|
||||||
{
|
{
|
||||||
$update_to_guid = $guid;
|
$update_to_guid = $guid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($update_to_guid > $froxlor_guid)
|
if($update_to_guid < $froxlor_guid)
|
||||||
{
|
{
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Updating froxlor last guid to '.$update_to_guid);
|
$update_to_guid = $froxlor_guid;
|
||||||
|
|
||||||
|
if ($update_to_guid != $settings['system']['lastguid'])
|
||||||
|
{
|
||||||
|
$mylog->logAction(CRON_ACTION, LOG_NOTICE, 'Updating froxlor last guid to '.$update_to_guid);
|
||||||
saveSetting('system', 'lastguid', $update_to_guid);
|
saveSetting('system', 'lastguid', $update_to_guid);
|
||||||
|
$settings['system']['lastguid'] = $update_to_guid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
|
$mylog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
|
$mylog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
45
lib/functions/validate/function.appendOpenbasedirPath.php
Normal file
45
lib/functions/validate/function.appendOpenbasedirPath.php
Normal 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 '';
|
||||||
|
}
|
||||||
@@ -25,6 +25,7 @@ function checkMysqlAccessHost($fieldname, $fielddata, $newfieldvalue, $allnewfie
|
|||||||
{
|
{
|
||||||
if(validate_ip($host_entry, true) == false
|
if(validate_ip($host_entry, true) == false
|
||||||
&& validateDomain($host_entry) == false
|
&& validateDomain($host_entry) == false
|
||||||
|
&& validateLocalHostname($host_entry) == false
|
||||||
&& $host_entry != '%')
|
&& $host_entry != '%')
|
||||||
{
|
{
|
||||||
return array(FORMFIELDS_PLAUSIBILITY_CHECK_ERROR, 'invalidmysqlhost', $host_entry);
|
return array(FORMFIELDS_PLAUSIBILITY_CHECK_ERROR, 'invalidmysqlhost', $host_entry);
|
||||||
|
|||||||
@@ -37,12 +37,25 @@ function validateDomain($domainname)
|
|||||||
// If FILTER_VALIDATE_URL is good, but FILTER_VALIDATE_URL with FILTER_FLAG_PATH_REQUIRED or FILTER_FLAG_QUERY_REQUIRED is also good, it isn't just a domain.
|
// If FILTER_VALIDATE_URL is good, but FILTER_VALIDATE_URL with FILTER_FLAG_PATH_REQUIRED or FILTER_FLAG_QUERY_REQUIRED is also good, it isn't just a domain.
|
||||||
// This is a ugly hack, maybe a good regex would be better?
|
// This is a ugly hack, maybe a good regex would be better?
|
||||||
|
|
||||||
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)
|
// 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. 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;
|
return $domainname;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function validateLocalHostname($hostname)
|
||||||
|
{
|
||||||
|
$pattern = '/^([a-zA-Z0-9\-])+$/i';
|
||||||
|
if(preg_match($pattern, $hostname))
|
||||||
|
{
|
||||||
|
return $hostname;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
43
lib/functions/validate/function.validatePassword.php
Normal file
43
lib/functions/validate/function.validatePassword.php
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?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 validatePassword
|
||||||
|
*
|
||||||
|
* if password-min-length is set in settings
|
||||||
|
* we check against the length, if not matched
|
||||||
|
* an error message will be output and 'exit' is called
|
||||||
|
*
|
||||||
|
* @param string $password the password to validate
|
||||||
|
*
|
||||||
|
* @return string either the password or an errormessage+exit
|
||||||
|
*/
|
||||||
|
function validatePassword($password = null)
|
||||||
|
{
|
||||||
|
global $settings;
|
||||||
|
|
||||||
|
if ($settings['panel']['password_min_length'] > 0) {
|
||||||
|
$password = validate(
|
||||||
|
$password,
|
||||||
|
$settings['panel']['password_min_length'], /* replacer needs to be password length, not the fieldname */
|
||||||
|
'/^.{'.(int)$settings['panel']['password_min_length'].',}$/D',
|
||||||
|
'notrequiredpasswordlength'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $password;
|
||||||
|
}
|
||||||
@@ -28,18 +28,24 @@
|
|||||||
|
|
||||||
function validateUrl($url)
|
function validateUrl($url)
|
||||||
{
|
{
|
||||||
|
global $idna_convert;
|
||||||
|
|
||||||
if(strtolower(substr($url, 0, 7)) != "http://"
|
if(strtolower(substr($url, 0, 7)) != "http://"
|
||||||
&& strtolower(substr($url, 0, 8)) != "https://")
|
&& strtolower(substr($url, 0, 8)) != "https://")
|
||||||
{
|
{
|
||||||
$url = 'http://' . $url;
|
$url = 'http://' . $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) !== false)
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
// not an fqdn
|
||||||
if(strtolower(substr($url, 0, 7)) == "http://"
|
if(strtolower(substr($url, 0, 7)) == "http://"
|
||||||
|| strtolower(substr($url, 0, 8)) == "https://")
|
|| strtolower(substr($url, 0, 8)) == "https://")
|
||||||
{
|
{
|
||||||
@@ -69,4 +75,4 @@ function validateUrl($url)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
29
lib/init.php
29
lib/init.php
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
header("Cache-Control: no-cache, must-revalidate");
|
header("Cache-Control: no-cache, must-revalidate");
|
||||||
header("Pragma: no-cache");
|
header("Pragma: no-cache");
|
||||||
header("Content-type: text/html; charset=utf-8");
|
header("Content-type: text/html; charset=iso-8859-1");
|
||||||
|
|
||||||
// ensure that default timezone is set
|
// ensure that default timezone is set
|
||||||
if(function_exists("date_default_timezone_set") && function_exists("date_default_timezone_get"))
|
if(function_exists("date_default_timezone_set") && function_exists("date_default_timezone_get"))
|
||||||
@@ -49,7 +49,8 @@ $filename = basename($_SERVER['PHP_SELF']);
|
|||||||
|
|
||||||
if(!file_exists('./lib/userdata.inc.php'))
|
if(!file_exists('./lib/userdata.inc.php'))
|
||||||
{
|
{
|
||||||
die('You have to <a href="./install/install.php">configure</a> Froxlor first!');
|
$config_hint = file_get_contents('./templates/misc/configurehint.tpl');
|
||||||
|
die($config_hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_readable('./lib/userdata.inc.php'))
|
if(!is_readable('./lib/userdata.inc.php'))
|
||||||
@@ -149,14 +150,24 @@ if(get_magic_quotes_gpc())
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$settings_data = loadConfigArrayDir('./actions/admin/settings/');
|
$settings_data = loadConfigArrayDir('./actions/admin/settings/');
|
||||||
$settings = loadSettings(&$settings_data, &$db);
|
$settings = loadSettings($settings_data, $db);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* when upgrading from syscp, the header-graphic gets lost
|
* when upgrading from syscp, the header-graphic gets lost
|
||||||
*/
|
*/
|
||||||
if(!isset($settings['admin']['froxlor_graphic'])) {
|
if(!isset($settings['admin']['froxlor_graphic'])
|
||||||
|
|| $settings['admin']['froxlor_graphic'] == ''
|
||||||
|
) {
|
||||||
|
if(isset($settings['admin']['syscp_graphic'])
|
||||||
|
&& $settings['admin']['syscp_graphic'] != ''
|
||||||
|
){
|
||||||
$settings['admin']['froxlor_graphic'] = $settings['admin']['syscp_graphic'];
|
$settings['admin']['froxlor_graphic'] = $settings['admin']['syscp_graphic'];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$settings['admin']['froxlor_graphic'] = 'images/header.gif';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SESSION MANAGEMENT
|
* SESSION MANAGEMENT
|
||||||
@@ -411,8 +422,14 @@ if($page == '')
|
|||||||
/**
|
/**
|
||||||
* Initialize the mailingsystem
|
* Initialize the mailingsystem
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$mail = new PHPMailer();
|
$mail = new PHPMailer();
|
||||||
$mail->From = $settings['panel']['adminmail'];
|
if(PHPMailer::ValidateAddress($settings['panel']['adminmail']) !== false)
|
||||||
|
{
|
||||||
|
// set return-to address and custom sender-name, see #76
|
||||||
|
$mail->SetFrom($settings['panel']['adminmail'], $settings['panel']['adminmail_defname']);
|
||||||
|
if ($settings['panel']['adminmail_return'] != '') {
|
||||||
|
$mail->AddReplyTo($settings['panel']['adminmail_return'], $settings['panel']['adminmail_defname']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -200,15 +200,11 @@ return array (
|
|||||||
'label' => $lng['admin']['ipsandports']['ipsandports'],
|
'label' => $lng['admin']['ipsandports']['ipsandports'],
|
||||||
'required_resources' => 'change_serversettings',
|
'required_resources' => 'change_serversettings',
|
||||||
),
|
),
|
||||||
/*
|
|
||||||
* @TODO this is for Froxlor-1.0
|
|
||||||
*
|
|
||||||
array (
|
array (
|
||||||
'url' => 'admin_cronjobs.php?page=overview',
|
'url' => 'admin_cronjobs.php?page=overview',
|
||||||
'label' => $lng['admin']['cron']['cronsettings'],
|
'label' => $lng['admin']['cron']['cronsettings'],
|
||||||
'required_resources' => 'change_serversettings',
|
'required_resources' => 'change_serversettings',
|
||||||
),
|
),
|
||||||
*/
|
|
||||||
array (
|
array (
|
||||||
'url' => 'admin_settings.php?page=rebuildconfigs',
|
'url' => 'admin_settings.php?page=rebuildconfigs',
|
||||||
'label' => $lng['admin']['rebuildconf'],
|
'label' => $lng['admin']['rebuildconf'],
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
define('TABLE_FTP_GROUPS', 'ftp_groups');
|
define('TABLE_FTP_GROUPS', 'ftp_groups');
|
||||||
define('TABLE_FTP_USERS', 'ftp_users');
|
define('TABLE_FTP_USERS', 'ftp_users');
|
||||||
|
define('TABLE_FTP_QUOTALIMITS', 'ftp_quotalimits');
|
||||||
|
define('TABLE_FTP_QUOTATALLIES', 'ftp_quotatallies');
|
||||||
define('TABLE_MAIL_USERS', 'mail_users');
|
define('TABLE_MAIL_USERS', 'mail_users');
|
||||||
define('TABLE_MAIL_VIRTUAL', 'mail_virtual');
|
define('TABLE_MAIL_VIRTUAL', 'mail_virtual');
|
||||||
define('TABLE_PANEL_ADMINS', 'panel_admins');
|
define('TABLE_PANEL_ADMINS', 'panel_admins');
|
||||||
@@ -49,6 +51,8 @@ define('TABLE_APS_SETTINGS', 'aps_settings');
|
|||||||
define('TABLE_APS_TASKS', 'aps_tasks');
|
define('TABLE_APS_TASKS', 'aps_tasks');
|
||||||
define('TABLE_APS_TEMP_SETTINGS', 'aps_temp_settings');
|
define('TABLE_APS_TEMP_SETTINGS', 'aps_temp_settings');
|
||||||
define('TABLE_PANEL_CRONRUNS', 'cronjobs_run');
|
define('TABLE_PANEL_CRONRUNS', 'cronjobs_run');
|
||||||
|
define('TABLE_PANEL_REDIRECTCODES', 'redirect_codes');
|
||||||
|
define('TABLE_PANEL_DOMAINREDIRECTS', 'domain_redirect_codes');
|
||||||
|
|
||||||
// APS constants
|
// APS constants
|
||||||
|
|
||||||
@@ -68,7 +72,8 @@ define('PACKAGE_ENABLED', 2);
|
|||||||
|
|
||||||
// VERSION INFO
|
// VERSION INFO
|
||||||
|
|
||||||
$version = '0.9';
|
$version = '0.9.7';
|
||||||
$dbversion = '2';
|
$dbversion = '2';
|
||||||
|
$branding = '';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -369,7 +369,6 @@ $lng['admin']['templates']['USERNAME'] = 'Ще бъде заменено с по
|
|||||||
$lng['admin']['templates']['PASSWORD'] = 'Ще бъде заменено с паролата за сметката на клиента.';
|
$lng['admin']['templates']['PASSWORD'] = 'Ще бъде заменено с паролата за сметката на клиента.';
|
||||||
$lng['admin']['templates']['EMAIL'] = 'Ще бъде заменено със сметка за POP3/IMAP.';
|
$lng['admin']['templates']['EMAIL'] = 'Ще бъде заменено със сметка за POP3/IMAP.';
|
||||||
$lng['admin']['rebuildconf'] = 'Възстановяване на конфигурационни файлове';
|
$lng['admin']['rebuildconf'] = 'Възстановяване на конфигурационни файлове';
|
||||||
$lng['admin']['cronlastrun'] = 'Последен cron';
|
|
||||||
$lng['admin']['ipsandports']['ipsandports'] = 'IP адреси и портове';
|
$lng['admin']['ipsandports']['ipsandports'] = 'IP адреси и портове';
|
||||||
$lng['admin']['ipsandports']['add'] = 'Добавяне на IP/порт';
|
$lng['admin']['ipsandports']['add'] = 'Добавяне на IP/порт';
|
||||||
$lng['admin']['ipsandports']['edit'] = 'Редакция на на IP/порт';
|
$lng['admin']['ipsandports']['edit'] = 'Редакция на на IP/порт';
|
||||||
|
|||||||
@@ -375,7 +375,6 @@ $lng['serversettings']['pathedit']['description'] = 'Vols que la ruta sigui escr
|
|||||||
* ADDED BETWEEN 1.2.12 and 1.2.13
|
* ADDED BETWEEN 1.2.12 and 1.2.13
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$lng['admin']['cronlastrun'] = 'Última volta';
|
|
||||||
$lng['serversettings']['paging']['title'] = 'Entrades per pàgina';
|
$lng['serversettings']['paging']['title'] = 'Entrades per pàgina';
|
||||||
$lng['serversettings']['paging']['description'] = 'Entrades per pàgina? (0 = sense paginar)';
|
$lng['serversettings']['paging']['description'] = 'Entrades per pàgina? (0 = sense paginar)';
|
||||||
$lng['error']['ipstillhasdomains'] = 'La combinació IP/Port que vols esborrar té dominis assignats. Si us plau, reassigna els dominis a una altra IP/Port abans d\'esborrar.';
|
$lng['error']['ipstillhasdomains'] = 'La combinació IP/Port que vols esborrar té dominis assignats. Si us plau, reassigna els dominis a una altra IP/Port abans d\'esborrar.';
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user