Compare commits

..

74 Commits

Author SHA1 Message Date
Florian Aders (EleRas)
11af896411 Tagging 0.9.11 2010-07-26 07:58:37 +00:00
Michael Kaufmann (d00p)
f7f1907546 - set version to 0.9.11 2010-07-26 07:43:12 +00:00
Michael Kaufmann (d00p)
ced78ac6f7 - use correct table-field for email deletion, refs #245 2010-07-24 19:42:03 +00:00
Michael Kaufmann (d00p)
fe3728d522 - fix wrong variable in e-mail data deletion, it actually does work now :P (thx to acidfreeze), fixes #245 2010-07-24 18:55:48 +00:00
Michael Kaufmann (d00p)
f858f045d6 - add task to remove ftp-user data on filesystem correctly 2010-07-24 17:59:05 +00:00
Michael Kaufmann (d00p)
51673f3569 - only show checkbox for e-mail file deletion if there really is some data on the filesystem 2010-07-24 17:26:24 +00:00
Michael Kaufmann (d00p)
e430092eda - fixed lang-variable in getRedirectCodes() 2010-07-22 07:01:47 +00:00
Michael Kaufmann (d00p)
eaf70765d5 - possibility to specify perl path (only necessary on lighttpd) 2010-07-22 06:56:17 +00:00
Michael Kaufmann (d00p)
9191bc6c08 - don't cut single slash if diroptions path is equal to the docroot 2010-07-22 06:36:24 +00:00
Michael Kaufmann (d00p)
d1d772f790 - added possibility to run perl-scripts (if allowed by admin) via directory-options
- for use in lighttpd you have to add "mod_cgi" to the modules-list (and maybe patch lighttpd-cron if perl is not installed in /usr/bin)
2010-07-22 06:02:38 +00:00
Michael Kaufmann (d00p)
edc7a91519 - tell PHPMailer to throw Exceptions so we can catch them, fixes #298 2010-07-22 05:28:21 +00:00
Michael Kaufmann (d00p)
4eb177e65f - set umask in php-starter files (fcgid), fixes #299 2010-07-19 09:48:54 +00:00
Michael Kaufmann (d00p)
5f34dfa968 - add possibility to define password-complexity, fixes #292 2010-07-19 08:06:18 +00:00
Michael Kaufmann (d00p)
c43574a714 - possibility to remove email data also if only account is being removed but not the address itself, refs #245
- possibility to remove ftp-homedir on deletion of a ftp-user, fixes #293
2010-07-19 06:03:49 +00:00
Michael Kaufmann (d00p)
525b6ee98d - keep consistence in filenames, fixes #290
refs #290
2010-07-19 05:35:32 +00:00
Michael Kaufmann (d00p)
e5814b14d9 - fix correct insert of domain-redirect code, fixes #296 2010-07-14 06:37:08 +00:00
Michael Kaufmann (d00p)
e5cd9ad727 - fix accessibility of Froxlor
- added option to decide how Froxlor is being reached
- set version to 0.9.10
2010-06-28 08:53:41 +00:00
Michael Kaufmann (d00p)
cc5c30cc69 - check for defined variable in makeCorrectFile as an undefined may return unwanted values 2010-06-28 08:23:11 +00:00
Michael Kaufmann (d00p)
cf2104e989 - fix wrong variable name 2010-06-28 08:18:12 +00:00
Michael Kaufmann (d00p)
14b7be0a4f - fix undefined (and also unneeded) variable in cron-job 2010-06-25 05:27:09 +00:00
Michael Kaufmann (d00p)
e6c385da10 - fix maildir checking (returned error even if the path exists and is readable) 2010-06-24 20:10:47 +00:00
Michael Kaufmann (d00p)
57124d040d - don't delete everything if the path is the domains document-root (protect basedir, awstats|webalizer-dir and place default index), fixes #273
refs #273
2010-06-24 08:11:43 +00:00
Michael Kaufmann (d00p)
67c55c5a25 - remove installed files when APS packages has been removed, fixes #273
refs #273
2010-06-24 07:26:49 +00:00
Michael Kaufmann (d00p)
f86e4f39d3 - add missing label-string for httpuser and httpgroup settings 2010-06-21 08:38:13 +00:00
Michael Kaufmann (d00p)
5e162b018d - nicer and safer way of determine the customer-id out of the aps-database name 2010-06-17 11:32:14 +00:00
Michael Kaufmann (d00p)
9851ac53cc - show aps-databases also customer-mysql overview, fixes #272
- aps-databases are now increasing the customers mysql-contingent, refs #278
- customers viewing the aps-list are now notified if a package requires a database but the contingent is used up
- the update will add all web[X]aps[Y] databases to the according customer regardless of contingent
- fix tiny issue in preconfig
- setting version to 0.9.10-svn2


refs #272,278
2010-06-17 09:21:14 +00:00
Michael Kaufmann (d00p)
794c4d3b55 - show message-box if customer has no/insufficient aps-contingent, fixed #278
refs #278
2010-06-17 06:30:59 +00:00
Michael Kaufmann (d00p)
530b6da6e8 - fix htpasswd stuff in lighty, fixes #281 2010-06-17 05:56:36 +00:00
Florian Aders (EleRas)
6986ffefbe Fixed bug in languageselect 2010-06-16 20:13:12 +00:00
Florian Aders (EleRas)
e6eefc9913 Fixed typo, fixes #279 2010-06-16 20:02:28 +00:00
Florian Aders (EleRas)
3cd66a9fc4 Now the same for trunk, if someone only checks out trunk ;) 2010-06-16 18:16:37 +00:00
Florian Aders (EleRas)
a1c98e4012 Fixing login - languageselector, fixes #277 2010-06-16 16:26:31 +00:00
Florian Aders (EleRas)
cc7610d436 I hate stupid bugs, still fixing #276 2010-06-16 12:38:53 +00:00
Florian Aders (EleRas)
36efb04f86 Stupid bug-- 2010-06-16 12:34:22 +00:00
Florian Aders (EleRas)
dcc5859eb8 remove waiting createuser - tasks while removing a customer, fixes #276 2010-06-16 12:28:32 +00:00
Michael Kaufmann (d00p)
1557e5b7a3 - only ask for httpgroup/httpuser if not set before
- version decrease back to 0.9.10-svn1 (the two update-procedures have to be executed at the same update-level)
2010-06-16 12:18:14 +00:00
Michael Kaufmann (d00p)
9a41d35f98 - forgot a dot xD 2010-06-16 12:07:36 +00:00
Michael Kaufmann (d00p)
65a7983edc - don't make httpuser/httpgroup-setting hidden
- setting version to 0.9.10-svn2
2010-06-16 12:04:28 +00:00
Michael Kaufmann (d00p)
7b4a34ee69 - use system-settings of awstats-path for configuration-commands, fixes #275 2010-06-16 11:34:48 +00:00
Michael Kaufmann (d00p)
fb63dac2d1 - sorry, wrong checking, corrected now 2010-06-16 10:11:29 +00:00
Michael Kaufmann (d00p)
f9b014f640 - check for missing settings due to forgotten updates in syscp-installs (years ago)
- setting version to 0.9.10-svn1
2010-06-16 10:02:17 +00:00
Michael Kaufmann (d00p)
fe15ff4913 - determine correct path of Froxlor in webserver-cron, fixes #270 2010-06-15 05:40:08 +00:00
Michael Kaufmann (d00p)
cb128e5020 - implemented APS-1.2 standard 2010-06-14 08:09:17 +00:00
Florian Aders (EleRas)
2c3a11cff9 Preparing tagging of 0.9.9 2010-06-14 07:58:38 +00:00
Robert Foerster (Dessa)
7dbb715f04 partly revert r547 2010-06-09 11:42:36 +00:00
Robert Foerster (Dessa)
cdc2c8b1e4 gentoo apparently ships mod_cgi.conf by default unconditionally (but does not enable it), so lets just indicate that in the config as well 2010-06-09 10:55:29 +00:00
Michael Kaufmann (d00p)
ba33268596 - use username or guid depending on fcgid settings for chowning awstats/webalizer files 2010-06-08 20:39:21 +00:00
Michael Kaufmann (d00p)
fd96e4b42e - give ssl-vhost files another name that non-ssl vhost files, now really fixes #254 2010-06-08 11:13:22 +00:00
Michael Kaufmann (d00p)
950c9d7373 - on ssl-redirect, only create webroot for vhost, fixes #254 2010-06-08 06:16:48 +00:00
Michael Kaufmann (d00p)
470fb9a02a - found a better place to run the chowning, refs #258 2010-06-08 05:53:07 +00:00
Michael Kaufmann (d00p)
f2a4c52110 - chown awstats/webalizer directory after traffic-cron, fixes #258 2010-06-08 05:51:23 +00:00
Michael Kaufmann (d00p)
10cfdb137a - fix sed-command in config-templates, fixes #263 2010-06-07 11:14:49 +00:00
Michael Kaufmann (d00p)
323e2210c3 - don't create absolut paths additionally as relative paths in customers docroot, fixes #259 2010-06-04 05:50:23 +00:00
Michael Kaufmann (d00p)
d256ddfcbc - added possibility to let the cron create mail-specific A-records (mail, imap, pop3, smtp) even when MX-servers are given, fixes #242 2010-06-02 10:08:01 +00:00
Michael Kaufmann (d00p)
de250df0cb - added possiblility for customer to get its e-mail account data deleted from the filesystem when removing an account from the panel, fixes #245 2010-06-02 05:57:44 +00:00
Michael Kaufmann (d00p)
e7c9b4d402 - variable name corrections, fixes #256 2010-06-01 05:17:53 +00:00
Michael Kaufmann (d00p)
f3719d339e - set version to 0.9.8 2010-05-31 09:01:29 +00:00
Michael Kaufmann (d00p)
efc353256d - only check for colon if document-root is not a domain-name (redirect), fixes #253 2010-05-31 08:28:12 +00:00
Michael Kaufmann (d00p)
f4026c1df5 - catch exception if update.log can't be opened in /tmp/ (which should never happen) 2010-05-31 06:04:51 +00:00
Michael Kaufmann (d00p)
eed7776e86 - use better english 2010-05-30 09:31:11 +00:00
Robert Foerster (Dessa)
aface6b425 fix some typos in preconfig, thanks to tomreyn 2010-05-29 22:03:26 +00:00
Florian Aders (EleRas)
b0fb3a31f7 correczing functionname makeCorrectPath to makeCorrectDir, fixes #252 2010-05-29 18:53:16 +00:00
Florian Aders (EleRas)
b01d37d085 Updated italian languagefile, thx to Emilien :) 2010-05-27 21:10:40 +00:00
Michael Kaufmann (d00p)
72e6e2af24 - change minimum value for dns-TTL to 1 hour instead of 1 day, refs #166 2010-05-27 20:34:49 +00:00
Michael Kaufmann (d00p)
0db11bf0f8 - same with 05_froxlor_default_errorhandler.conf 2010-05-27 10:20:37 +00:00
Michael Kaufmann (d00p)
07e388c554 - secure path to 05_froxlor_dirfix_nofcgid.conf apache config file 2010-05-27 10:18:57 +00:00
Robert Foerster (Dessa)
84c9ac7e82 tweak dovecot configuration for lucid to work, fixes 248 2010-05-25 22:19:29 +00:00
Michael Kaufmann (d00p)
e572c072a9 - corrected 'last password change' calculation in libnss-configurations, fixes #244 2010-05-21 05:24:18 +00:00
Florian Aders (EleRas)
f6f7b2e4be Fixing it on the right place, d00p was correct, i apologize -.- 2010-05-19 12:29:32 +00:00
Michael Kaufmann (d00p)
5a0973dfa3 - respect lighttpd user and don't put "DocumentRoot" into the ip-specialsettings 2010-05-19 10:59:01 +00:00
Michael Kaufmann (d00p)
268f3b0a24 bugfix template 2010-05-19 10:46:42 +00:00
Michael Kaufmann (d00p)
348de6da35 - simplify awstats configuration, fixes #241 2010-05-19 06:07:02 +00:00
Michael Kaufmann (d00p)
82958cd8c2 - check for disabled accounts in libnss-configurations, fixes #237 2010-05-19 05:54:13 +00:00
Michael Kaufmann (d00p)
264bc50451 - respect admins open_basedir path settings (if more than one path), fixes #238 2010-05-18 11:48:58 +00:00
93 changed files with 2643 additions and 412 deletions

View File

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

View File

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

View File

@@ -33,6 +33,22 @@ return array(
'save_method' => 'storeSettingField',
'overview_option' => true
),
'system_httpuser' => array(
'label' => $lng['admin']['webserver_user'],
'settinggroup' => 'system',
'varname' => 'httpuser',
'type' => 'string',
'default' => 'www-data',
'save_method' => 'storeSettingField',
),
'system_httpgroup' => array(
'label' => $lng['admin']['webserver_group'],
'settinggroup' => 'system',
'varname' => 'httpgroup',
'type' => 'string',
'default' => 'www-data',
'save_method' => 'storeSettingField',
),
'system_apacheconf_vhost' => array(
'label' => $lng['serversettings']['apacheconf_vhost'],
'settinggroup' => 'system',
@@ -169,7 +185,15 @@ return array(
'option_mode' => 'one',
'option_options_method' => 'getRedirectCodes',
'save_method' => 'storeSettingField',
),
),
'perl_path' => array(
'label' => $lng['serversettings']['perl_path'],
'settinggroup' => 'system',
'varname' => 'perl_path',
'type' => 'string',
'default' => '/usr/bin/perl',
'save_method' => 'storeSettingField',
),
),
),
'ssl' => array(

View File

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

View File

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

View File

@@ -67,7 +67,8 @@ if($page == 'customers'
'c.email_quota_used' => $lng['customer']['email_quota'] . ' (' . $lng['panel']['used'] . ')',
'c.deactivated' => $lng['admin']['deactivated'],
'c.lastlogin_succ' => $lng['admin']['lastlogin_succ'],
'c.phpenabled' => $lng['admin']['phpenabled']
'c.phpenabled' => $lng['admin']['phpenabled'],
'c.perlenabled' => $lng['admin']['perlenabled']
);
if($settings['ticket']['enabled'] == 1)
@@ -194,6 +195,10 @@ if($page == 'customers'
$db->query("DELETE FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$id . "'");
$db->query("DELETE FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid`='" . (int)$id . "'");
// Delete all waiting "create user" -tasks for this user, #276
// Note: the WHERE selects part of a serialized array, but it should be safe this way
$db->query("DELETE FROM `" . TABLE_PANEL_TASKS . "` WHERE `type` = '2' AND `data` LIKE '%:\"" . $db->escape($result['loginname']) . "\";%';");
// remove everything APS-related, #216
$apsresult = $db->query("SELECT `ID` FROM `".TABLE_APS_INSTANCES."` WHERE `CustomerID`='".(int)$id."'");
while($apsrow = $db->fetch_array($apsresult))
@@ -419,6 +424,7 @@ if($page == 'customers'
$password = validatePassword($password);
$sendpassword = intval($_POST['sendpassword']);
$phpenabled = intval($_POST['phpenabled']);
$perlenabled = intval($_POST['perlenabled']);
$diskspace = $diskspace * 1024;
$traffic = $traffic * 1024 * 1024;
@@ -521,12 +527,17 @@ if($page == 'customers'
$phpenabled = '1';
}
if($perlenabled != '0')
{
$perlenabled = '1';
}
if($password == '')
{
$password = substr(md5(uniqid(microtime(), 1)), 12, 6);
}
$result = $db->query("INSERT INTO `" . TABLE_PANEL_CUSTOMERS . "` (`adminid`, `loginname`, `password`, `name`, `firstname`, `company`, `street`, `zipcode`, `city`, `phone`, `fax`, `email`, `customernumber`, `def_language`, `documentroot`, `guid`, `diskspace`, `traffic`, `subdomains`, `emails`, `email_accounts`, `email_forwarders`, `email_quota`, `ftps`, `tickets`, `mysqls`, `standardsubdomain`, `phpenabled`, `imap`, `pop3`, `aps_packages`) VALUES ('" . (int)$userinfo['adminid'] . "', '" . $db->escape($loginname) . "', '" . md5($password) . "', '" . $db->escape($name) . "', '" . $db->escape($firstname) . "', '" . $db->escape($company) . "', '" . $db->escape($street) . "', '" . $db->escape($zipcode) . "', '" . $db->escape($city) . "', '" . $db->escape($phone) . "', '" . $db->escape($fax) . "', '" . $db->escape($email) . "', '" . $db->escape($customernumber) . "','" . $db->escape($def_language) . "', '" . $db->escape($documentroot) . "', '" . $db->escape($guid) . "', '" . $db->escape($diskspace) . "', '" . $db->escape($traffic) . "', '" . $db->escape($subdomains) . "', '" . $db->escape($emails) . "', '" . $db->escape($email_accounts) . "', '" . $db->escape($email_forwarders) . "', '" . $db->escape($email_quota) . "', '" . $db->escape($ftps) . "', '" . $db->escape($tickets) . "', '" . $db->escape($mysqls) . "', '0', '" . $db->escape($phpenabled) . "', '" . $db->escape($email_imap) . "', '" . $db->escape($email_pop3) . "', '" . (int)$number_of_aps_packages . "')");
$result = $db->query("INSERT INTO `" . TABLE_PANEL_CUSTOMERS . "` (`adminid`, `loginname`, `password`, `name`, `firstname`, `company`, `street`, `zipcode`, `city`, `phone`, `fax`, `email`, `customernumber`, `def_language`, `documentroot`, `guid`, `diskspace`, `traffic`, `subdomains`, `emails`, `email_accounts`, `email_forwarders`, `email_quota`, `ftps`, `tickets`, `mysqls`, `standardsubdomain`, `phpenabled`, `imap`, `pop3`, `aps_packages`, `perlenabled`) VALUES ('" . (int)$userinfo['adminid'] . "', '" . $db->escape($loginname) . "', '" . md5($password) . "', '" . $db->escape($name) . "', '" . $db->escape($firstname) . "', '" . $db->escape($company) . "', '" . $db->escape($street) . "', '" . $db->escape($zipcode) . "', '" . $db->escape($city) . "', '" . $db->escape($phone) . "', '" . $db->escape($fax) . "', '" . $db->escape($email) . "', '" . $db->escape($customernumber) . "','" . $db->escape($def_language) . "', '" . $db->escape($documentroot) . "', '" . $db->escape($guid) . "', '" . $db->escape($diskspace) . "', '" . $db->escape($traffic) . "', '" . $db->escape($subdomains) . "', '" . $db->escape($emails) . "', '" . $db->escape($email_accounts) . "', '" . $db->escape($email_forwarders) . "', '" . $db->escape($email_quota) . "', '" . $db->escape($ftps) . "', '" . $db->escape($tickets) . "', '" . $db->escape($mysqls) . "', '0', '" . $db->escape($phpenabled) . "', '" . $db->escape($email_imap) . "', '" . $db->escape($email_pop3) . "', '" . (int)$number_of_aps_packages . "', '" . $db->escape($perlenabled) . "')");
$customerid = $db->insert_id();
$admin_update_query = "UPDATE `" . TABLE_PANEL_ADMINS . "` SET `customers_used` = `customers_used` + 1";
@@ -725,6 +736,7 @@ if($page == 'customers'
$email_pop3 = makeyesno('email_pop3', '1', '0', '1');
$sendpassword = makeyesno('sendpassword', '1', '0', '1');
$phpenabled = makeyesno('phpenabled', '1', '0', '1');
$perlenabled = makeyesno('perlenabled', '1', '0', '0');
eval("echo \"" . getTemplate("customers/customers_add") . "\";");
}
}
@@ -848,6 +860,7 @@ if($page == 'customers'
$createstdsubdomain = intval($_POST['createstdsubdomain']);
$deactivated = intval($_POST['deactivated']);
$phpenabled = intval($_POST['phpenabled']);
$perlenabled = intval($_POST['perlenabled']);
$diskspace = $diskspace * 1024;
$traffic = $traffic * 1024 * 1024;
@@ -952,7 +965,13 @@ if($page == 'customers'
$phpenabled = '1';
}
if($phpenabled != $result['phpenabled'])
if($perlenabled != '0')
{
$perlenabled = '1';
}
if($phpenabled != $result['phpenabled']
|| $perlenabled != $result['perlenabled'])
{
inserttask('1');
}
@@ -980,7 +999,7 @@ if($page == 'customers'
$db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET `imap`='" . (int)$email_imap . "' WHERE `customerid`='" . (int)$id . "'");
}
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `name`='" . $db->escape($name) . "', `firstname`='" . $db->escape($firstname) . "', `company`='" . $db->escape($company) . "', `street`='" . $db->escape($street) . "', `zipcode`='" . $db->escape($zipcode) . "', `city`='" . $db->escape($city) . "', `phone`='" . $db->escape($phone) . "', `fax`='" . $db->escape($fax) . "', `email`='" . $db->escape($email) . "', `customernumber`='" . $db->escape($customernumber) . "', `def_language`='" . $db->escape($def_language) . "', `password` = '" . $password . "', `diskspace`='" . $db->escape($diskspace) . "', `traffic`='" . $db->escape($traffic) . "', `subdomains`='" . $db->escape($subdomains) . "', `emails`='" . $db->escape($emails) . "', `email_accounts` = '" . $db->escape($email_accounts) . "', `email_forwarders`='" . $db->escape($email_forwarders) . "', `ftps`='" . $db->escape($ftps) . "', `tickets`='" . $db->escape($tickets) . "', `mysqls`='" . $db->escape($mysqls) . "', `deactivated`='" . $db->escape($deactivated) . "', `phpenabled`='" . $db->escape($phpenabled) . "', `email_quota`='" . $db->escape($email_quota) . "', `imap`='" . $db->escape($email_imap) . "', `pop3`='" . $db->escape($email_pop3) . "', `aps_packages`='" . (int)$number_of_aps_packages . "' WHERE `customerid`='" . (int)$id . "'");
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `name`='" . $db->escape($name) . "', `firstname`='" . $db->escape($firstname) . "', `company`='" . $db->escape($company) . "', `street`='" . $db->escape($street) . "', `zipcode`='" . $db->escape($zipcode) . "', `city`='" . $db->escape($city) . "', `phone`='" . $db->escape($phone) . "', `fax`='" . $db->escape($fax) . "', `email`='" . $db->escape($email) . "', `customernumber`='" . $db->escape($customernumber) . "', `def_language`='" . $db->escape($def_language) . "', `password` = '" . $password . "', `diskspace`='" . $db->escape($diskspace) . "', `traffic`='" . $db->escape($traffic) . "', `subdomains`='" . $db->escape($subdomains) . "', `emails`='" . $db->escape($emails) . "', `email_accounts` = '" . $db->escape($email_accounts) . "', `email_forwarders`='" . $db->escape($email_forwarders) . "', `ftps`='" . $db->escape($ftps) . "', `tickets`='" . $db->escape($tickets) . "', `mysqls`='" . $db->escape($mysqls) . "', `deactivated`='" . $db->escape($deactivated) . "', `phpenabled`='" . $db->escape($phpenabled) . "', `email_quota`='" . $db->escape($email_quota) . "', `imap`='" . $db->escape($email_imap) . "', `pop3`='" . $db->escape($email_pop3) . "', `aps_packages`='" . (int)$number_of_aps_packages . "', `perlenabled`='" . $db->escape($perlenabled) . "' WHERE `customerid`='" . (int)$id . "'");
$admin_update_query = "UPDATE `" . TABLE_PANEL_ADMINS . "` SET `customers_used` = `customers_used` ";
if($mysqls != '-1'
@@ -1245,6 +1264,7 @@ if($page == 'customers'
$createstdsubdomain = makeyesno('createstdsubdomain', '1', '0', (($result['standardsubdomain'] != '0') ? '1' : '0'));
$phpenabled = makeyesno('phpenabled', '1', '0', $result['phpenabled']);
$perlenabled = makeyesno('perlenabled', '1', '0', $result['perlenabled']);
$deactivated = makeyesno('deactivated', '1', '0', $result['deactivated']);
$email_imap = makeyesno('email_imap', '1', '0', $result['imap']);
$email_pop3 = makeyesno('email_pop3', '1', '0', $result['pop3']);

View File

@@ -182,6 +182,7 @@ if($page == 'domains'
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `subdomains_used` = `subdomains_used` - " . (int)($deleted_domains - 1) . " WHERE `customerid` = '" . (int)$result['customerid'] . "'");
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `domains_used` = `domains_used` - 1 WHERE `adminid` = '" . (int)$userinfo['adminid'] . "'");
$db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `standardsubdomain`=\'0\' WHERE `standardsubdomain`=\'' . (int)$result['id'] . '\' AND `customerid`=\'' . (int)$result['customerid'] . '\'');
$db->query("DELETE FROM `" . TABLE_PANEL_DOMAINREDIRECTS . "` WHERE `did` = '".(int)$id."'");
$log->logAction(ADM_ACTION, LOG_INFO, "deleted domain/subdomains (#" . $result['id'] . ")");
updateCounters();
inserttask('1');
@@ -369,7 +370,14 @@ if($page == 'domains'
if(!preg_match('/^https?\:\/\//', $documentroot))
{
$documentroot = makeCorrectDir($documentroot);
if(strstr($documentroot, ":") !== FALSE)
{
standard_error('pathmaynotcontaincolon');
}
else
{
$documentroot = makeCorrectDir($documentroot);
}
}
$domain_check = $db->query_first("SELECT `id`, `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain` = '" . $db->escape(strtolower($domain)) . "'");
@@ -451,10 +459,6 @@ if($page == 'domains'
{
standard_error(array('stringisempty', 'mydocumentroot'));
}
elseif(strstr($documentroot, ":") !== FALSE)
{
standard_error('pathmaynotcontaincolon');
}
elseif($customerid == 0)
{
standard_error('adduserfirst');
@@ -749,8 +753,9 @@ if($page == 'domains'
$documentroot = $customer['documentroot'];
}
if(strstr($documentroot, ":") !== FALSE)
{
if(!preg_match('/^https?\:\/\//', $documentroot)
&& strstr($documentroot, ":") !== FALSE
) {
standard_error('pathmaynotcontaincolon');
}
}

View File

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

View File

@@ -184,6 +184,12 @@ elseif($page == 'emails')
$number_forwarders = 0;
}
if(isset($_POST['delete_userfiles'])
&& (int)$_POST['delete_userfiles'] == 1)
{
inserttask('7', $userinfo['loginname'], $result['email_full']);
}
$db->query("DELETE FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `emails_used`=`emails_used` - 1 , `email_forwarders_used` = `email_forwarders_used` - " . (int)$number_forwarders . " $update_users_query_addon WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
$log->logAction(USR_ACTION, LOG_INFO, "deleted email address '" . $result['email'] . "'");
@@ -191,7 +197,12 @@ elseif($page == 'emails')
}
else
{
ask_yesno('email_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full']));
if(maildirExists($result)) {
$show_checkbox = true;
} else {
$show_checkbox = false;
}
ask_yesno_withcheckbox('email_reallydelete', 'admin_customer_alsoremovemail', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full']), $show_checkbox);
}
}
}
@@ -602,13 +613,19 @@ elseif($page == 'accounts')
$quota = 0;
}
if(isset($_POST['delete_userfiles'])
&& (int)$_POST['delete_userfiles'] == 1)
{
inserttask('7', $userinfo['loginname'], $result['email_full']);
}
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_accounts_used` = `email_accounts_used` - 1, `email_quota_used` = `email_quota_used` - " . (int)$quota . " WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
$log->logAction(USR_ACTION, LOG_INFO, "deleted email account for '" . $result['email_full'] . "'");
redirectTo($filename, Array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s));
}
else
{
ask_yesno('email_reallydelete_account', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full']));
ask_yesno_withcheckbox('email_reallydelete_account', 'admin_customer_alsoremovemail', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full']));
}
}
}

View File

@@ -221,10 +221,11 @@ elseif($page == 'htaccess')
'options_indexes' => $lng['extras']['view_directory'],
'error404path' => $lng['extras']['error404path'],
'error403path' => $lng['extras']['error403path'],
'error500path' => $lng['extras']['error500path']
'error500path' => $lng['extras']['error500path'],
'options_cgi' => $lng['extras']['execute_perl']
);
$paging = new paging($userinfo, $db, TABLE_PANEL_HTACCESS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
$result = $db->query("SELECT `id`, `path`, `options_indexes`, `error404path`, `error403path`, `error500path` FROM `" . TABLE_PANEL_HTACCESS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_HTACCESS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
$paging->setEntries($db->num_rows($result));
$sortcode = $paging->getHtmlSortCode($lng);
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
@@ -234,6 +235,8 @@ elseif($page == 'htaccess')
$count = 0;
$htaccess = '';
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
while($row = $db->fetch_array($result))
{
if($paging->checkDisplay($i))
@@ -241,10 +244,14 @@ elseif($page == 'htaccess')
if(strpos($row['path'], $userinfo['documentroot']) === 0)
{
$row['path'] = substr($row['path'], strlen($userinfo['documentroot']));
// don't show nothing wehn it's the docroot, show slash
if ($row['path'] == '') { $row['path'] = '/'; }
}
$row['options_indexes'] = str_replace('1', $lng['panel']['yes'], $row['options_indexes']);
$row['options_indexes'] = str_replace('0', $lng['panel']['no'], $row['options_indexes']);
$row['options_cgi'] = str_replace('1', $lng['panel']['yes'], $row['options_cgi']);
$row['options_cgi'] = str_replace('0', $lng['panel']['no'], $row['options_cgi']);
$row = htmlentities_array($row);
eval("\$htaccess.=\"" . getTemplate("extras/htaccess_htaccess") . "\";");
$count++;
@@ -293,6 +300,15 @@ elseif($page == 'htaccess')
standard_error('invalidpath');
}
if(isset($_POST['options_cgi']))
{
$options_cgi = intval($_POST['options_cgi']);
}
else
{
$options_cgi = '0';
}
if(($_POST['error404path'] === '')
|| (validateUrl($idna_convert->encode($_POST['error404path']))))
{
@@ -333,7 +349,15 @@ elseif($page == 'htaccess')
}
else
{
$db->query('INSERT INTO `' . TABLE_PANEL_HTACCESS . '` (`customerid`, `path`, `options_indexes`, `error404path`, `error403path`, `error500path` ) VALUES ("' . (int)$userinfo['customerid'] . '", "' . $db->escape($path) . '", "' . $db->escape($_POST['options_indexes'] == '1' ? '1' : '0') . '", "' . $db->escape($error404path) . '", "' . $db->escape($error403path) . '", "' . $db->escape($error500path) . '" )');
$db->query('INSERT INTO `' . TABLE_PANEL_HTACCESS . '` SET
`customerid` = "'.(int)$userinfo['customerid'].'",
`path` = "'.$db->escape($path).'",
`options_indexes` = "'.$db->escape($_POST['options_indexes'] == '1' ? '1' : '0').'",
`error404path` = "'.$db->escape($error404path).'",
`error403path` = "'.$db->escape($error403path).'",
`error500path` = "'.$db->escape($error500path).'",
`options_cgi` = "'.$db->escape($options_cgi).'"');
$log->logAction(USR_ACTION, LOG_INFO, "added htaccess for '" . $path . "'");
inserttask('1');
redirectTo($filename, Array('page' => $page, 's' => $s));
@@ -342,7 +366,9 @@ elseif($page == 'htaccess')
else
{
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
$options_indexes = makeyesno('options_indexes', '1', '0', '1');
$options_indexes = makeyesno('options_indexes', '1', '0', '0');
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
$options_cgi = makeyesno('options_cgi', '1', '0', '0');
eval("echo \"" . getTemplate("extras/htaccess_add") . "\";");
}
}
@@ -359,12 +385,18 @@ elseif($page == 'htaccess')
&& $_POST['send'] == 'send')
{
$option_indexes = intval($_POST['options_indexes']);
$options_cgi = isset($_POST['options_cgi']) ? intval($_POST['options_cgi']) : 0;
if($option_indexes != '1')
{
$option_indexes = '0';
}
if($options_cgi != '1')
{
$options_cgi = '0';
}
if(($_POST['error404path'] === '')
|| (validateUrl($idna_convert->encode($_POST['error404path']))))
{
@@ -398,10 +430,11 @@ elseif($page == 'htaccess')
if(($option_indexes != $result['options_indexes'])
|| ($error404path != $result['error404path'])
|| ($error403path != $result['error403path'])
|| ($error500path != $result['error500path']))
|| ($error500path != $result['error500path'])
|| ($options_cgi != $result['options_cgi']))
{
inserttask('1');
$db->query('UPDATE `' . TABLE_PANEL_HTACCESS . '` SET `options_indexes` = "' . $db->escape($option_indexes) . '", `error404path` = "' . $db->escape($error404path) . '", `error403path` = "' . $db->escape($error403path) . '", `error500path` = "' . $db->escape($error500path) . '" WHERE `customerid` = "' . (int)$userinfo['customerid'] . '" AND `id` = "' . (int)$id . '"');
$db->query('UPDATE `' . TABLE_PANEL_HTACCESS . '` SET `options_indexes` = "' . $db->escape($option_indexes) . '", `error404path` = "' . $db->escape($error404path) . '", `error403path` = "' . $db->escape($error403path) . '", `error500path` = "' . $db->escape($error500path) . '", `options_cgi` = "' . $db->escape($options_cgi) . '" WHERE `customerid` = "' . (int)$userinfo['customerid'] . '" AND `id` = "' . (int)$id . '"');
$log->logAction(USR_ACTION, LOG_INFO, "edited htaccess for '" . str_replace($userinfo['documentroot'], '', $result['path']) . "'");
}
@@ -412,12 +445,16 @@ elseif($page == 'htaccess')
if(strpos($result['path'], $userinfo['documentroot']) === 0)
{
$result['path'] = substr($result['path'], strlen($userinfo['documentroot']));
// don't show nothing wehn it's the docroot, show slash
if ($result['path'] == '') { $result['path'] = '/'; }
}
$result['error404path'] = $result['error404path'];
$result['error403path'] = $result['error403path'];
$result['error500path'] = $result['error500path'];
$options_indexes = makeyesno('options_indexes', '1', '0', $result['options_indexes']);
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
$options_cgi = makeyesno('options_cgi', '1', '0', $result['options_cgi']);
$result = htmlentities_array($result);
eval("echo \"" . getTemplate("extras/htaccess_edit") . "\";");
}

View File

@@ -106,8 +106,6 @@ elseif($page == 'accounts')
$log->logAction(USR_ACTION, LOG_INFO, "deleted ftp-account '" . $result['username'] . "'");
$db->query("UPDATE `" . TABLE_FTP_GROUPS . "` SET `members`=REPLACE(`members`,'," . $db->escape($result['username']) . "','') WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
// $db->query("DELETE FROM `".TABLE_FTP_GROUPS."` WHERE `customerid`='".$userinfo['customerid']."' AND `id`='$id'");
if($userinfo['ftps_used'] == '1')
{
$resetaccnumber = " , `ftp_lastaccountnumber`='0'";
@@ -117,12 +115,19 @@ elseif($page == 'accounts')
$resetaccnumber = '';
}
// refs #293
if(isset($_POST['delete_userfiles'])
&& (int)$_POST['delete_userfiles'] == 1)
{
inserttask('8', $userinfo['loginname'], $result['homedir']);
}
$result = $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `ftps_used`=`ftps_used`-1 $resetaccnumber WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
redirectTo($filename, Array('page' => $page, 's' => $s));
}
else
{
ask_yesno('ftp_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['username']);
ask_yesno_withcheckbox('ftp_reallydelete', 'admin_customer_alsoremoveftphomedir', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['username']);
}
}
else

View File

@@ -52,7 +52,7 @@ elseif($page == 'mysqls')
'description' => $lng['mysql']['databasedescription']
);
$paging = new paging($userinfo, $db, TABLE_PANEL_DATABASES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
$result = $db->query("SELECT `id`, `databasename`, `description`, `dbserver` FROM `" . TABLE_PANEL_DATABASES . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_DATABASES . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
$paging->setEntries($db->num_rows($result));
$sortcode = $paging->getHtmlSortCode($lng);
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);

View File

@@ -227,6 +227,7 @@ CREATE TABLE `panel_customers` (
`imap` tinyint(1) NOT NULL default '1',
`aps_packages` int(5) NOT NULL default '0',
`aps_packages_used` int(5) NOT NULL default '0',
`perlenabled` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`customerid`),
UNIQUE KEY `loginname` (`loginname`)
) TYPE=MyISAM ;
@@ -248,6 +249,7 @@ CREATE TABLE `panel_databases` (
`databasename` varchar(255) NOT NULL default '',
`description` varchar(255) NOT NULL default '',
`dbserver` int(11) unsigned NOT NULL default '0',
`apsdb` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `customerid` (`customerid`)
) TYPE=MyISAM ;
@@ -355,6 +357,7 @@ CREATE TABLE `panel_htaccess` (
`error403path` varchar(255) NOT NULL default '',
`error500path` varchar(255) NOT NULL default '',
`error401path` varchar(255) NOT NULL default '',
`options_cgi` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
@@ -451,7 +454,7 @@ INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) V
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (18, 'system', 'vmail_homedir', '/var/customers/mail/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (19, 'system', 'bindconf_directory', '/etc/bind/');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (20, 'system', 'bindreload_command', '/etc/init.d/bind9 reload');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9.7');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9.11');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (23, 'system', 'hostname', 'SERVERNAME');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (24, 'login', 'maxloginattempts', '3');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (25, 'login', 'deactivatetime', '900');
@@ -570,7 +573,10 @@ INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) V
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (139, 'system', 'ftpserver', 'proftpd');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (140, 'customredirect', 'enabled', '1');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (141, 'customredirect', 'default', '1');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (142, 'system', 'dns_createmailentry', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (143, 'system', 'froxlordirectlyviahostname', '0');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (144, 'panel', 'password_regex', '');
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (145, 'system', 'perl_path', '/usr/bin/perl');
# --------------------------------------------------------

View File

@@ -637,6 +637,7 @@ if(isset($_POST['installstep'])
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/lighttpd/froxlor-htpasswd/' WHERE `settinggroup` = 'system' AND `varname` = 'apacheconf_htpasswddir'");
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/init.d/lighttpd reload' WHERE `settinggroup` = 'system' AND `varname` = 'apachereload_command'");
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/lighttpd/lighttpd.pem' WHERE `settinggroup` = 'system' AND `varname` = 'ssl_cert_file'");
$ssettings = '';
}
// insert the lastcronrun to be the installation date
@@ -659,8 +660,7 @@ if(isset($_POST['installstep'])
`port` = '80',
`namevirtualhost_statement` = '1',
`vhostcontainer` = '1',
`vhostcontainer_servername_statement` = '1',
`specialsettings` = 'DocumentRoot \"".$db->escape(dirname(dirname(__FILE__))) . "\"'";
`vhostcontainer_servername_statement` = '1'";
$db->query($query);
$defaultip = $db->insert_id();

View File

@@ -768,4 +768,165 @@ if(isFroxlorVersion('0.9.7-svn3'))
updateToVersion('0.9.7');
}
?>
if(isFroxlorVersion('0.9.7'))
{
showUpdateStep("Updating from 0.9.7 to 0.9.8 final");
lastStepStatus(0);
updateToVersion('0.9.8');
}
if(isFroxlorVersion('0.9.8'))
{
showUpdateStep("Updating from 0.9.8 to 0.9.9-svn1", false);
$update_defdns_mailentry = isset($_POST['update_defdns_mailentry']) ? '1' : '0';
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'dns_createmailentry', '".(int)$update_defdns_mailentry."');");
lastStepStatus(0);
updateToVersion('0.9.9-svn1');
}
if(isFroxlorVersion('0.9.9-svn1'))
{
showUpdateStep("Updating from 0.9.9-svn1 to 0.9.9 final");
lastStepStatus(0);
updateToVersion('0.9.9');
}
if(isFroxlorVersion('0.9.9'))
{
showUpdateStep("Updating from 0.9.9 to 0.9.10-svn1", false);
showUpdateStep("Checking whether you are missing any settings", false);
$nonefound = true;
$update_httpuser = isset($_POST['update_httpuser']) ? $_POST['update_httpuser'] : false;
$update_httpgroup = isset($_POST['update_httpgroup']) ? $_POST['update_httpgroup'] : false;
if($update_httpuser !== false)
{
$nonefound = false;
showUpdateStep("Adding missing setting 'httpuser'");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'httpuser', '".$update_httpuser."');");
lastStepStatus(0);
}
if($update_httpgroup !== false)
{
$nonefound = false;
showUpdateStep("Adding missing setting 'httpgroup'");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'httpgroup', '".$update_httpgroup."');");
lastStepStatus(0);
}
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'debug_cron'");
if(!isset($result) || !isset($result['value']))
{
$nonefound = false;
showUpdateStep("Adding missing setting 'debug_cron'");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'debug_cron', '0');");
lastStepStatus(0);
}
if($nonefound) {
showUpdateStep("No missing settings found");
lastStepStatus(0);
}
updateToVersion('0.9.10-svn1');
}
if(isFroxlorVersion('0.9.10-svn1'))
{
showUpdateStep("Updating from 0.9.10-svn1 to 0.9.10-svn2", false);
showUpdateStep("Updating database table definition for panel_databases");
$db->query("ALTER TABLE `" . TABLE_PANEL_DATABASES . "` ADD `apsdb` tinyint(1) NOT NULL default '0' AFTER `dbserver`;");
lastStepStatus(0);
showUpdateStep("Adding APS databases to customers overview");
$count_dbupdates = 0;
$db_root = null;
openRootDB();
$result = $db_root->query("SHOW DATABASES;");
while($row = $db_root->fetch_array($result))
{
if(preg_match('/^web([0-9]+)aps([0-9]+)$/', $row['Database'], $matches))
{
$cid = $matches[1];
$databasedescription = 'APS DB';
$result = $db->query('INSERT INTO `' . TABLE_PANEL_DATABASES . '` (`customerid`, `databasename`, `description`, `dbserver`, `apsdb`) VALUES ("' . (int)$cid . '", "' . $db->escape($row['Database']) . '", "' . $db->escape($databasedescription) . '", "0", "1")');
$result = $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`+1 WHERE `customerid`="' . (int)$cid . '"');
$count_dbupdates++;
}
}
closeRootDB();
if($count_dbupdates > 0) {
lastStepStatus(0, "Found ".$count_dbupdates." customer APS databases");
} else {
lastStepStatus(0, "None found");
}
updateToVersion('0.9.10-svn2');
}
if(isFroxlorVersion('0.9.10-svn2'))
{
showUpdateStep("Updating from 0.9.10-svn2 to 0.9.10", false);
$update_directlyviahostname = isset($_POST['update_directlyviahostname']) ? '1' : '0';
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'froxlordirectlyviahostname', '".(int)$update_directlyviahostname."');");
lastStepStatus(0);
updateToVersion('0.9.10');
}
if(isFroxlorVersion('0.9.10'))
{
showUpdateStep("Updating from 0.9.10 to 0.9.11-svn1", false);
$update_pwdregex = isset($_POST['update_pwdregex']) ? $_POST['update_pwdregex'] : '';
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'password_regex', '".$db->escape($update_pwdregex)."');");
lastStepStatus(0);
updateToVersion('0.9.11-svn1');
}
if(isFroxlorVersion('0.9.11-svn1'))
{
showUpdateStep("Updating from 0.9.11-svn1 to 0.9.11-svn2", false);
showUpdateStep("Adding perl/CGI directory fields");
$db->query("ALTER TABLE `".TABLE_PANEL_HTACCESS."` ADD `options_cgi` tinyint(1) NOT NULL default '0' AFTER `error401path`;");
$db->query("ALTER TABLE `".TABLE_PANEL_CUSTOMERS."` ADD `perlenabled` tinyint(1) NOT NULL default '0' AFTER `aps_packages_used`;");
lastStepStatus(0);
updateToVersion('0.9.11-svn2');
}
if(isFroxlorVersion('0.9.11-svn2'))
{
showUpdateStep("Updating from 0.9.11-svn2 to 0.9.11-svn3", false);
$update_perlpath = isset($_POST['update_perlpath']) ? $_POST['update_perlpath'] : '/usr/bin/perl';
showUpdateStep("Adding new settings");
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'perl_path', '".$db->escape($update_perlpath)."');");
lastStepStatus(0);
updateToVersion('0.9.11-svn3');
}
if(isFroxlorVersion('0.9.11-svn3'))
{
showUpdateStep("Updating from 0.9.11-svn3 to 0.9.11 final", false);
lastStepStatus(0);
updateToVersion('0.9.11');
}

View File

@@ -33,7 +33,7 @@ function getPreConfig($current_version)
include_once makeCorrectFile(dirname(__FILE__).'/preconfig/0.9/preconfig_0.9.inc.php');
parseAndOutputPreconfig($has_preconfig, $return, $current_version);
$return .= '<br /><br />'.makecheckbox('update_changesagreed', '<strong>I have read the update notifications and I am aware of the changes made to my system.</strong>', '1', true, '0', true);
$return .= '<br /><br />'.makecheckbox('update_changesagreed', '<strong>I have read the update notifications above and I am aware of the changes made to my system.</strong>', '1', true, '0', true);
$return .= '</div>';
$return .= '<input type="hidden" name="update_preconfig" value="1" />';

View File

@@ -83,8 +83,8 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
if(versionInUpdate($current_version, '0.9.6-svn5'))
{
$has_preconfig = true;
$description = 'If you have more than one PHP-configurations defined in Froxlor you can know set a default one which will be used for every domain.';
$question = '<strong>Select default PHP-configuration:</strong>&nbsp;';
$description = 'If you have more than one PHP configurations defined in Froxlor you can now set a default one which will be used for every domain.';
$question = '<strong>Select default PHP configuration:</strong>&nbsp;';
$question .= '<select name="update_defsys_phpconfig">';
$configs_array = getPhpConfigs();
$configs = '';
@@ -149,4 +149,93 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}
if(versionInUpdate($current_version, '0.9.9-svn1'))
{
$has_preconfig = true;
$description = 'When entering MX servers to Froxlor there was no mail-, imap-, pop3- and smtp-"A record" created. You can now chose whether this should be done or not.';
$question = '<strong>Do you want these A-records to be created even with MX servers given?:</strong>&nbsp;';
$question.= makeyesno('update_defdns_mailentry', '1', '0', '0');
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.10-svn1'))
{
$has_nouser = false;
$has_nogroup = false;
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'");
if(!isset($result) || !isset($result['value']))
{
$has_preconfig = true;
$has_nouser = true;
$guessed_user = 'www-data';
if(function_exists('posix_getuid')
&& function_exists('posix_getpwuid')
) {
$_httpuser = posix_getpwuid(posix_getuid());
$guessed_user = $_httpuser['name'];
}
}
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'");
if(!isset($result) || !isset($result['value']))
{
$has_preconfig = true;
$has_nogroup = true;
$guessed_group = 'www-data';
if(function_exists('posix_getgid')
&& function_exists('posix_getgrgid')
) {
$_httpgroup = posix_getgrgid(posix_getgid());
$guessed_group = $_httpgroup['name'];
}
}
if($has_nouser || $has_nogroup)
{
$description = 'Please enter the correct username/groupname of the webserver on your system We\'re guessing the user but it might not be correct, so please check.';
if($has_nouser)
{
$question = '<strong>Please enter the webservers username:</strong>&nbsp;<input type="text" class="text" name="update_httpuser" value="'.$guessed_user.'" />';
}
elseif($has_nogroup)
{
$question2 = '<strong>Please enter the webservers groupname:</strong>&nbsp;<input type="text" class="text" name="update_httpgroup" value="'.$guessed_group.'" />';
if($has_nouser) {
$question .= '<br /><br />'.$question2;
} else {
$question = $question2;
}
}
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}
if(versionInUpdate($current_version, '0.9.10'))
{
$has_preconfig = true;
$description = 'you can now decide whether Froxlor should be reached via hostname/froxlor or directly via the hostname.';
$question = '<strong>Do you want Froxlor to be reached directly via the hostname?:</strong>&nbsp;';
$question.= makeyesno('update_directlyviahostname', '1', '0', '0');
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.11-svn1'))
{
$has_preconfig = true;
$description = 'It is possible to enhance security with setting a regular expression to force your customers to enter more complex passwords.';
$question = '<strong>Enter a regular expression to force a higher password complexity (leave empty for none):</strong>&nbsp;';
$question.= '<input type="text" class="text" name="update_pwdregex" value="" />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
if(versionInUpdate($current_version, '0.9.11-svn3'))
{
$has_preconfig = true;
$description = 'As Froxlor can now handle perl, you have to specify where the perl executable is (only if you\'re running lighttpd, else just leave empty).';
$question = '<strong>Path to perl (default \'/usr/bin/perl\'):</strong>&nbsp;';
$question.= '<input type="text" class="text" name="update_perlpath" value="/usr/bin/perl" />';
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}

View File

@@ -22,7 +22,14 @@ $updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'), $db,
$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 --------------');
// if first writing does not work we'll stop, tell the user to fix it
// and then let him try again.
try {
$filelog->logAction(ADM_ACTION, LOG_WARNING, '-------------- START LOG --------------');
} catch(Exception $e) {
standard_error('exception', $e->getMessage());
}
/*
* since froxlor, we have to check if there's still someone

View File

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

View File

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

View File

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

View File

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

View File

@@ -198,10 +198,13 @@ return Array(
'commands' => Array(
'cd /usr/ports/www/awstats/',
'make install clean',
'cp /usr/local/www/awstats/cgi-bin/awstats.model.conf '.makeCorrectDir($settings['system']['awstats_conf'])
),
'files' => Array(
'etc_awstats.model.conf' => makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
'cp /usr/local/www/awstats/cgi-bin/awstats.model.conf '.makeCorrectDir($settings['system']['awstats_conf']),
'sed -i.bak \'s/^LogFile/# LogFile/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^LogType/# LogType/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^LogFormat/# LogFormat/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^LogSeparator/# LogSeparator/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^SiteDomain/# SiteDomain/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf'),
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf')
)
),
'libnss' => Array(

View File

@@ -310,7 +310,7 @@ milter_default_action = accept" >> /etc/postfix/main.cf'
'emerge -av xinetd'
),
'files' => Array(
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
'etc_xinetd.d_froxlor' => '/etc/xinetd.d/froxlor'
),
'restart' => Array(
'/etc/init.d/xinetd restart'
@@ -320,10 +320,8 @@ milter_default_action = accept" >> /etc/postfix/main.cf'
'label' => 'Awstats',
'commands' => Array(
'emerge awstats',
'awstats_configure.pl'
),
'files' => Array(
'etc_awstats.model.conf' => makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
'awstats_configure.pl',
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
),
),
'libnss' => Array(

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -44,7 +44,7 @@ function getRedirectCodesArray()
*/
function getRedirectCodes()
{
global $db;
global $db, $lng;
$sql = "SELECT * FROM `".TABLE_PANEL_REDIRECTCODES."` WHERE `enabled` = '1' ORDER BY `id` ASC";
$result = $db->query($sql);
@@ -156,8 +156,9 @@ function updateRedirectOfDomain($domainid = 0, $redirect = false)
if($domainid > 0)
{
$db->query("UPDATE `".TABLE_PANEL_DOMAINREDIRECTS."`
SET `rid` = '".(int)$redirect."'
$db->query("DELETE FROM `".TABLE_PANEL_DOMAINREDIRECTS."`
WHERE `did` = '".(int)$domainid."'");
$db->query("INSERT INTO `".TABLE_PANEL_DOMAINREDIRECTS."`
SET `rid` = '".(int)$redirect."', `did` = '".(int)$domainid."'");
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -72,7 +72,7 @@ define('PACKAGE_ENABLED', 2);
// VERSION INFO
$version = '0.9.7';
$version = '0.9.11';
$dbversion = '2';
$branding = '';

View File

@@ -256,6 +256,8 @@ $lng['question']['ftp_reallydelete'] = 'Do you really want to delete the FTP acc
$lng['question']['mysql_reallydelete'] = 'Do you really want to delete the database %s? This cannot be undone!';
$lng['question']['admin_configs_reallyrebuild'] = 'Do you really want to rebuild all config files?';
$lng['question']['admin_customer_alsoremovefiles'] = 'Remove user files too?';
$lng['question']['admin_customer_alsoremovemail'] = 'Completely remove email data from filesystem?';
$lng['question']['admin_customer_alsoremoveftphomedir'] = 'Also remove FTP-user homedir?';
/**
* Mails
@@ -1064,7 +1066,7 @@ $lng['aps']['nospecialchars'] = 'Special characters are not allowed in the searc
$lng['aps']['noitemsfound'] = 'No Packages were found!';
$lng['aps']['nopackagesinstalled'] = 'You haven\'t installed any package yet which could be shown.';
$lng['aps']['instance_install'] = 'Package Installation pending';
$lng['aps']['instance_task_active'] = 'Installation running at this moment';
$lng['aps']['instance_task_active'] = 'Package is currently being processed';
$lng['aps']['instance_success'] = 'Package is installed/was installed successfully';
$lng['aps']['instance_error'] = 'Package isn\'t installed - there occured some errors on the Installation';
$lng['aps']['instance_uninstall'] = 'Package Uninstallation pending';
@@ -1420,4 +1422,33 @@ $lng['redirect_desc']['rc_found'] = 'found';
$lng['redirect_desc']['rc_seeother'] = 'see other';
$lng['redirect_desc']['rc_tempred'] = 'temporary redirect';
// ADDED IN FROXLOR 0.9.8
$lng['error']['exception'] = '%s';
// ADDED IN FROXLOR 0.9.9-svn1
$lng['serversettings']['mail_also_with_mxservers'] = 'Create mail-, imap-, pop3- and smtp-"A record" also with MX-Servers set';
// ADDED IN FROXLOR 0.9.10-svn1
$lng['aps']['nocontingent'] = 'Your APS contingent is insufficient. You cannot install any package.';
$lng['aps']['packageneedsdb'] = 'This package needs a database but your contingent is used up';
$lng['aps']['cannoteditordeleteapsdb'] = 'APS databases cannot be edited or removed here';
$lng['admin']['webserver_user'] = 'Webserver user-name';
$lng['admin']['webserver_group'] = 'Webserver group-name';
// ADDED IN FROXLOR 0.9.10
$lng['serversettings']['froxlordirectlyviahostname'] = 'Access Froxlor directly via the hostname';
// ADDED IN FROXLOR 0.9.11-svn1
$lng['serversettings']['panel_password_regex']['title'] = 'Regular expression for passwords';
$lng['serversettings']['panel_password_regex']['description'] = 'Here you can set a regular expression for passwords-complexity.<br />Empty = no specific requirement<br />(<a href="http://wiki.froxlor.org/doc/password-regex-examples">regex help/examples</a>)';
$lng['error']['notrequiredpasswordcomplexity'] = 'The specified password-complexity was not satisfied (regex: %s)';
// ADDED IN FROXLOR 0.9.11-svn2
$lng['extras']['execute_perl'] = 'Execute perl/CGI';
$lng['admin']['perlenabled'] = 'Perl enabled';
// ADDED IN FROXLOR 0.9.11-svn3
$lng['serversettings']['perl_path']['title'] = 'Path zu perl';
$lng['serversettings']['perl_path']['description'] = 'Only relevant if you use lighttpd. Default is /usr/bin/perl';
?>

View File

@@ -256,6 +256,8 @@ $lng['question']['ftp_reallydelete'] = 'Wollen Sie das FTP-Benutzerkonto %s wirk
$lng['question']['mysql_reallydelete'] = 'Wollen Sie die Datenbank %s wirklich l&ouml;schen?<br />ACHTUNG! Alle Daten gehen unwiderruflich verloren!';
$lng['question']['admin_configs_reallyrebuild'] = 'Wollen Sie wirklich alle Konfigurationsdateien neu erstellen lassen?';
$lng['question']['admin_customer_alsoremovefiles'] = 'Auch Kunden-Daten l&ouml;schen?';
$lng['question']['admin_customer_alsoremovemail'] = 'E-Mail Daten auf dem Dateisystem l&ouml;schen?';
$lng['question']['admin_customer_alsoremoveftphomedir'] = 'Heimatverzeichnis des FTP-Benutzers l&ouml;schen?';
/**
* Mails
@@ -932,7 +934,7 @@ $lng['customer']['email_pop3'] = 'E-Mail POP3';
$lng['customer']['mail_quota'] = 'E-Mail Kontingent';
$lng['panel']['megabyte'] = 'MegaByte';
$lng['emails']['quota_edit'] = 'E-Mail Kontingent &auml;ndern';
$lng['panel']['not_supported'] = 'Nicht &uuml;nterst&uuml;zt in: ';
$lng['panel']['not_supported'] = 'Nicht unterst&uuml;zt in: ';
$lng['error']['allocatetoomuchquota'] = 'Sie versuchen %s MB ' . $lng['emails']['quota'] . ' zu zuweisen, haben aber nicht genug &uuml;brig.';
// Autoresponder module
@@ -1069,7 +1071,7 @@ $lng['aps']['nospecialchars'] = 'Sonderzeichen sind im Suchausdruck nicht erlaub
$lng['aps']['noitemsfound'] = 'Es wurden keine Pakete gefunden!';
$lng['aps']['nopackagesinstalled'] = 'Sie haben noch kein Paket installiert welches angezeigt werden k&ouml;nnte.';
$lng['aps']['instance_install'] = 'Paket wurde zur Installation vorgemerkt';
$lng['aps']['instance_task_active'] = 'Paket wird gerade installiert';
$lng['aps']['instance_task_active'] = 'Paket wird gerade bearbeitet';
$lng['aps']['instance_success'] = 'Paket ist installiert bzw. wurde erfolgreich installiert';
$lng['aps']['instance_error'] = 'Paket ist nicht installiert - bei der Installation traten Fehler auf';
$lng['aps']['instance_uninstall'] = 'Paket wurde zur Deinstallation vorgemerkt';
@@ -1406,4 +1408,30 @@ $lng['tasks']['aps_task_upgrade'] = 'Upgrade eines oder mehrerer APS Pakete';
$lng['tasks']['aps_task_sysupdate'] = 'Aktualisiere alle APS Pakete';
$lng['tasks']['aps_task_sysdownload'] = 'Herunterladen neuer APS Pakete';
// ADDED IN FROXLOR 0.9.9-svn1
$lng['serversettings']['mail_also_with_mxservers'] = 'Erstelle mail-, imap-, pop3- and smtp-"A Record" auch wenn MX-Server angegeben sind';
// ADDED IN FROXLOR 0.9.10-svn1
$lng['aps']['nocontingent'] = 'Sie haben kein ausreichendes APS-Kontingent und k&ouml;nnen daher keine Pakete installieren.';
$lng['aps']['packageneedsdb'] = 'Dieses Paket ben&ouml;tigt eine Datenbank, Sie haben allerdings keine mehr frei';
$lng['aps']['cannoteditordeleteapsdb'] = 'APS-Datenbanken k&ouml;nnen hier nicht bearbeitet oder gel&ouml;scht werden';
$lng['admin']['webserver_user'] = 'Benutzername Webserver';
$lng['admin']['webserver_group'] = 'Gruppenname Webserver';
// ADDED IN FROXLOR 0.9.10
$lng['serversettings']['froxlordirectlyviahostname'] = 'Froxlor direkt &uuml;ber den Hostnamen erreichbar machen';
// ADDED IN FROXLOR 0.9.11-svn1
$lng['serversettings']['panel_password_regex']['title'] = 'Regul&auml;rer Ausdruck f&uuml;r Passw&ouml;rter';
$lng['serversettings']['panel_password_regex']['description'] = 'Hier k&ouml;nnen Sie einen regul&auml;ren Ausdruck f&uuml;r Passwort-Komplexit&auml;t festlegen.<br />Leer = keine bestimmten Anforderungen<br />(<a href="http://wiki.froxlor.org/doc/password-regex-examples">RegEx Hilfe/Beispiele</a>)';
$lng['error']['notrequiredpasswordcomplexity'] = 'Die vorgegebene Passwort-Komplexit&auml;t wurde nicht erf&uuml;llt (Regex: %s)';
// ADDED IN FROXLOR 0.9.11-svn2
$lng['extras']['execute_perl'] = 'Perl/CGI ausf&uuml;hren';
$lng['admin']['perlenabled'] = 'Perl verf&uuml;gbar';
// ADDED IN FROXLOR 0.9.11-svn3
$lng['serversettings']['perl_path']['title'] = 'Pfad zu Perl';
$lng['serversettings']['perl_path']['description'] = 'Nur n&ouml;tig f&uuml;r lighttpd-Nutzer. Standard ist /usr/bin/perl';
?>

File diff suppressed because it is too large Load Diff

View File

@@ -80,7 +80,7 @@ if($db->num_rows($result) > 0)
$path = $row['homedir'] . $row['maildir'] . "new/";
if(!is_dir($path) || !is_readable($path))
if(!is_dir($path))
{
$cronlog->logAction(CRON_ACTION, LOG_WARNING, "Error accessing maildir: " . $path);
continue;

View File

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

View File

@@ -67,16 +67,23 @@ class apache
*/
private function _createStandardDirectoryEntry()
{
$vhosts_filename = makeCorrectFile($this->settings['system']['apacheconf_vhost'] . '/05_froxlor_dirfix_nofcgid.conf');
$vhosts_folder = '';
if(is_dir($this->settings['system']['apacheconf_vhost']))
{
$vhosts_folder = makeCorrectDir($this->settings['system']['apacheconf_vhost']);
} else {
$vhosts_folder = makeCorrectDir(dirname($this->settings['system']['apacheconf_vhost']));
}
$vhosts_filename = makeCorrectFile($vhosts_folder . '/05_froxlor_dirfix_nofcgid.conf');
if($this->settings['system']['mod_fcgid'] == '1')
{
// if we use fcgid we don't need this file
if(file_exists($vhosts_filename))
{
fwrite($this->debugHandler, ' apache::_createStandardDirectoryEntry: unlinking ' . basename($vhost_filename) . "\n");
$this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'unlinking ' . basename($vhost_filename));
unlink(makeCorrectFile($vhost_filename));
fwrite($this->debugHandler, ' apache::_createStandardDirectoryEntry: unlinking ' . basename($vhosts_filename) . "\n");
$this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'unlinking ' . basename($vhosts_filename));
unlink(makeCorrectFile($vhosts_filename));
}
}
else
@@ -104,7 +111,15 @@ class apache
|| $this->settings['defaultwebsrverrhandler']['err404'] != ''
|| $this->settings['defaultwebsrverrhandler']['err500'] != '')
) {
$vhosts_filename = makeCorrectFile($this->settings['system']['apacheconf_vhost'] . '/05_froxlor_default_errorhandler.conf');
$vhosts_folder = '';
if(is_dir($this->settings['system']['apacheconf_vhost']))
{
$vhosts_folder = makeCorrectDir($this->settings['system']['apacheconf_vhost']);
} else {
$vhosts_folder = makeCorrectDir(dirname($this->settings['system']['apacheconf_vhost']));
}
$vhosts_filename = makeCorrectFile($vhosts_folder . '/05_froxlor_default_errorhandler.conf');
if(!isset($this->virtualhosts_data[$vhosts_filename]))
{
@@ -177,7 +192,14 @@ class apache
/**
* add 'real'-vhost content here, like doc-root :)
*/
$mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__))));
if($this->settings['system']['froxlordirectlyviahostname'])
{
$mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__))));
}
else
{
$mypath = makeCorrectDir(dirname(dirname(dirname(dirname(__FILE__)))));
}
$this->virtualhosts_data[$vhosts_filename].= 'DocumentRoot "'.$mypath.'"'."\n";
if($row_ipsandports['vhostcontainer_servername_statement'] == '1')
@@ -278,8 +300,13 @@ class apache
{
$_phpappendopenbasedir = appendOpenBasedirPath($domain['documentroot'], true);
}
$_phpappendopenbasedir .= appendOpenBasedirPath($this->settings['system']['phpappendopenbasedir']);
$_custom_openbasedir = explode(':', $this->settings['system']['phpappendopenbasedir']);
foreach($_custom_openbasedir as $cobd)
{
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
}
$php_options_text.= ' php_admin_value open_basedir "' . $_phpappendopenbasedir . '"'."\n";
}
@@ -657,7 +684,7 @@ class apache
}
}
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true);
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true, true);
$vhost_content.= $this->getWebroot($domain);
$vhost_content.= $this->composePhpOptions($domain);
$vhost_content.= $this->getStats($domain);
@@ -776,19 +803,41 @@ class apache
if(is_dir($row_diroptions['path']))
{
$cperlenabled = customerHasPerlEnabled($row_diroptions['customerid']);
$this->diroptions_data[$diroptions_filename].= '<Directory "' . $row_diroptions['path'] . '">' . "\n";
if(isset($row_diroptions['options_indexes'])
&& $row_diroptions['options_indexes'] == '1')
{
$this->diroptions_data[$diroptions_filename].= ' Options +Indexes' . "\n";
$this->diroptions_data[$diroptions_filename].= ' Options +Indexes';
// add perl options if enabled
if($cperlenabled
&& isset($row_diroptions['options_cgi'])
&& $row_diroptions['options_cgi'] == '1')
{
$this->diroptions_data[$diroptions_filename].= ' ExecCGI -MultiViews +SymLinksIfOwnerMatch'."\n";
} else {
$this->diroptions_data[$diroptions_filename].= "\n";
}
fwrite($this->debugHandler, ' cron_tasks: Task3 - Setting Options +Indexes' . "\n");
}
if(isset($row_diroptions['options_indexes'])
&& $row_diroptions['options_indexes'] == '0')
{
$this->diroptions_data[$diroptions_filename].= ' Options -Indexes' . "\n";
$this->diroptions_data[$diroptions_filename].= ' Options -Indexes';
// add perl options if enabled
if($cperlenabled
&& isset($row_diroptions['options_cgi'])
&& $row_diroptions['options_cgi'] == '1')
{
$this->diroptions_data[$diroptions_filename].= ' ExecCGI -MultiViews +SymLinksIfOwnerMatch'."\n";
} else {
$this->diroptions_data[$diroptions_filename].= "\n";
}
fwrite($this->debugHandler, ' cron_tasks: Task3 - Setting Options -Indexes' . "\n");
}
@@ -810,6 +859,17 @@ class apache
$this->diroptions_data[$diroptions_filename].= ' ErrorDocument 500 ' . $row_diroptions['error500path'] . "\n";
}
if($cperlenabled
&& isset($row_diroptions['options_cgi'])
&& $row_diroptions['options_cgi'] == '1')
{
$this->diroptions_data[$diroptions_filename].= ' AllowOverride None' . "\n";
$this->diroptions_data[$diroptions_filename].= ' AddHandler cgi-script .cgi .pl' . "\n";
$this->diroptions_data[$diroptions_filename].= ' Order allow,deny' . "\n";
$this->diroptions_data[$diroptions_filename].= ' Allow from all' . "\n";
fwrite($this->debugHandler, ' cron_tasks: Task3 - Enabling perl execution' . "\n");
}
if(count($row_diroptions['htpasswds']) > 0)
{
$htpasswd_filename = makeCorrectFile($this->settings['system']['apacheconf_htpasswddir'] . '/' . $row_diroptions['customerid'] . '-' . md5($row_diroptions['path']) . '.htpasswd');

View File

@@ -97,6 +97,7 @@ class apache_fcgid extends apache
$starter_file.= "# starter created/changed on " . date("Y.m.d H:i:s") . " for domain '" . $domain['domain'] . "' with id #" . $domain['id'] . " from php template '" . $phpconfig['description'] . "' with id #" . $phpconfig['id'] . "\n";
$starter_file.= "# Do not change anything in this file, it will be overwritten by the Froxlor Cronjob!\n";
$starter_file.= "#\n\n";
$starter_file.= "umask 022\n";
$starter_file.= "PHPRC=" . escapeshellarg($configdir) . "\n";
$starter_file.= "export PHPRC\n";
@@ -166,9 +167,20 @@ class apache_fcgid extends apache
if($domain['openbasedir'] == '1')
{
$openbasedirc = '';
$_phpappendopenbasedir = appendOpenBasedirPath($this->settings['system']['mod_fcgid_peardir']);
$_phpappendopenbasedir .= appendOpenBasedirPath($this->settings['system']['phpappendopenbasedir']);
$_phpappendopenbasedir = '';
$_custom_openbasedir = explode(':', $this->settings['system']['mod_fcgid_peardir']);
foreach($_custom_openbasedir as $cobd)
{
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
}
$_custom_openbasedir = explode(':', $this->settings['system']['phpappendopenbasedir']);
foreach($_custom_openbasedir as $cobd)
{
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
}
if($domain['openbasedir_path'] == '0' && strstr($domain['documentroot'], ":") === false)
{
$openbasedir = appendOpenBasedirPath($domain['documentroot'], true);

View File

@@ -107,7 +107,14 @@ class lighttpd
$this->lighttpd_data[$vhost_filename].= '# Froxlor default vhost' . "\n";
$this->lighttpd_data[$vhost_filename].= '$HTTP["host"] =~ "^(?:www\.|)' . $myhost . '$" {' . "\n";
$mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__))));
if($this->settings['system']['froxlordirectlyviahostname'])
{
$mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__))));
}
else
{
$mypath = makeCorrectDir(dirname(dirname(dirname(dirname(__FILE__)))));
}
$this->lighttpd_data[$vhost_filename].= ' server.document-root = "'.$mypath.'"'."\n";
/**
@@ -193,23 +200,6 @@ class lighttpd
if(!in_array($row_htpasswds['path'], $needed_htpasswds))
{
if(empty($needed_htpasswds))
{
$auth_backend_loaded[$domain['ipandport']] = 'yes';
if(!$this->auth_backend_loaded)
{
$htaccess_text.= ' auth.backend = "htpasswd"' . "\n";
}
$htaccess_text.= ' auth.backend.htpasswd.userfile = "' . makeCorrectFile($this->settings['system']['apacheconf_htpasswddir'] . '/' . $filename) . '"' . "\n";
$htaccess_text.= ' auth.require = ( ' . "\n";
}
else
{
$htaccess_text.= ' ,' . "\n";
}
if(!isset($this->needed_htpasswds[$filename])) {
$this->needed_htpasswds[$filename] = '';
}
@@ -219,20 +209,24 @@ class lighttpd
$this->needed_htpasswds[$filename].= $row_htpasswds['username'] . ':' . $row_htpasswds['password'] . "\n";
}
$needed_htpasswds[] = $row_htpasswds['path'];
$htaccess_path = substr($row_htpasswds['path'], strlen($domain['documentroot']) - 1);
$htaccess_text.= ' "' . makeCorrectDir($htaccess_path) . '" =>' . "\n";
$htaccess_text.= ' (' . "\n";
$htaccess_text.= ' "method" => "basic",' . "\n";
$htaccess_text.= ' "realm" => "Restricted Area",' . "\n";
$htaccess_text.= ' "require" => "user=' . $row_htpasswds['username'] . '"' . "\n";
$htaccess_text.= ' )' . "\n";
}
}
$htaccess_path = makeCorrectDir($htaccess_path);
if(strlen(trim($htaccess_text)) > 0)
{
$htaccess_text.= ' )' . "\n";
$htaccess_text.= ' $HTTP["url"] =~ "^'.$htaccess_path.'" {' . "\n";
$htaccess_text.= ' auth.backend = "htpasswd"' . "\n";
$htaccess_text.= ' auth.backend.htpasswd.userfile = "' . makeCorrectFile($this->settings['system']['apacheconf_htpasswddir'] . '/' . $filename) . '"' . "\n";
$htaccess_text.= ' auth.require = ( ' . "\n";
$htaccess_text.= ' "' . $htaccess_path . '" =>' . "\n";
$htaccess_text.= ' (' . "\n";
$htaccess_text.= ' "method" => "basic",' . "\n";
$htaccess_text.= ' "realm" => "Restricted Area",' . "\n";
$htaccess_text.= ' "require" => "valid-user"' . "\n";
$htaccess_text.= ' )' . "\n";
$htaccess_text.= ' )' . "\n";
$htaccess_text.= ' }' . "\n";
$needed_htpasswds[] = $row_htpasswds['path'];
}
}
return $htaccess_text;
@@ -283,10 +277,18 @@ class lighttpd
if((int)$domain['parentdomainid'] == 0)
{
$vhost_no = '51';
if($ssl == '1')
{
$vhost_no = '61';
}
}
else
{
$vhost_no = '50';
if($ssl == '1')
{
$vhost_no = '60';
}
}
$vhost_filename = makeCorrectFile($this->settings['system']['apacheconf_vhost'].'/vhosts/'.$vhost_no.'_'.$domain['domain'].'.conf');
@@ -368,14 +370,22 @@ class lighttpd
}
else
{
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true);
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true, true);
$only_webroot = false;
if($ssl_vhost === false && $domain['ssl_redirect'] == '1')
{
$only_webroot = true;
}
$vhost_content.= $this->getWebroot($domain, $ssl_vhost);
$vhost_content.= $this->create_htaccess($domain);
$vhost_content.= $this->create_pathOptions($domain);
$vhost_content.= $this->composePhpOptions($domain);
$vhost_content.= $this->getStats($domain);
$vhost_content.= $this->getLogFiles($domain);
if(!$only_webroot)
{
$vhost_content.= $this->create_htaccess($domain);
$vhost_content.= $this->create_pathOptions($domain);
$vhost_content.= $this->composePhpOptions($domain);
$vhost_content.= $this->getStats($domain);
$vhost_content.= $this->getLogFiles($domain);
}
}
if ($domain['specialsettings'] != "") {
@@ -512,7 +522,9 @@ class lighttpd
mkDirWithCorrectOwnership($domain['documentroot'], $row['path'], $domain['guid'], $domain['guid']);
// We need to remove the last slash, otherwise the regex wouldn't work
$path = substr($path, 0, -1);
if($row['path'] != $domain['documentroot']) {
$path = substr($path, 0, -1);
}
$path_options.= ' $HTTP["url"] =~ "^' . $path . '($|/)" {' . "\n";
$path_options.= "\t" . 'dir-listing.activate = "enable"' . "\n";
$path_options.= ' }' . "\n\n";
@@ -521,6 +533,24 @@ class lighttpd
{
$path_options = $error_string;
}
if(customerHasPerlEnabled($domain['customerid'])
&& $row['options_cgi'] != '0')
{
$path = makeCorrectDir(substr($row['path'], strlen($domain['documentroot']) - 1));
mkDirWithCorrectOwnership($domain['documentroot'], $row['path'], $domain['guid'], $domain['guid']);
// We need to remove the last slash, otherwise the regex wouldn't work
if($row['path'] != $domain['documentroot']) {
$path = substr($path, 0, -1);
}
$path_options.= ' $HTTP["url"] =~ "^' . $path . '($|/)" {' . "\n";
$path_options.= "\t" . 'cgi.assign = (' . "\n";
$path_options.= "\t\t" . '".pl" => "'.makeCorrectFile($this->settings['system']['perl_path']).'",' . "\n";
$path_options.= "\t\t" . '".cgi" => "'.makeCorrectFile($this->settings['system']['perl_path']).'"' . "\n";
$path_options.= "\t" . ')' . "\n";
$path_options.= ' }' . "\n\n";
}
}
return $path_options;
@@ -562,7 +592,7 @@ class lighttpd
$diroption_text.= '(' . "\n";
$diroption_text.= ' "method" => "basic",' . "\n";
$diroption_text.= ' "realm" => "Restricted Area",' . "\n";
$diroption_text.= ' "require" => "user=' . $row_htpasswds['username'] . '"' . "\n";
$diroption_text.= ' "require" => "valid-user"' . "\n";
$diroption_text.= ')' . "\n";
if($this->auth_backend_loaded[$domain['ssl_ipandport']] == 'yes')

View File

@@ -121,6 +121,7 @@ class lighttpd_fcgid extends lighttpd
$starter_file.= "# starter created/changed on " . date("Y.m.d H:i:s") . " for domain '" . $domain['domain'] . "' with id #" . $domain['id'] . " from php template '" . $phpconfig['description'] . "' with id #" . $phpconfig['id'] . "\n";
$starter_file.= "# Do not change anything in this file, it will be overwritten by the Froxlor Cronjob!\n";
$starter_file.= "#\n\n";
$starter_file.= "umask 022\n";
$starter_file.= "PHPRC=" . escapeshellarg($configdir) . "\n";
$starter_file.= "export PHPRC\n";
@@ -190,8 +191,19 @@ class lighttpd_fcgid extends lighttpd
if($domain['openbasedir'] == '1')
{
$openbasedirc = '';
$_phpappendopenbasedir = appendOpenBasedirPath($this->settings['system']['mod_fcgid_peardir']);
$_phpappendopenbasedir .= appendOpenBasedirPath($this->settings['system']['phpappendopenbasedir']);
$_phpappendopenbasedir = '';
$_custom_openbasedir = explode(':', $this->settings['system']['mod_fcgid_peardir']);
foreach($_custom_openbasedir as $cobd)
{
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
}
$_custom_openbasedir = explode(':', $this->settings['system']['phpappendopenbasedir']);
foreach($_custom_openbasedir as $cobd)
{
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
}
if($domain['openbasedir_path'] == '0' && strstr($domain['documentroot'], ":") === false)
{

View File

@@ -213,7 +213,7 @@ $awstatsclean['headerold']) {
/*
* remove homedir
*/
$homedir = makeCorrectDir($settings['system']['documentroot_prefix'] . $row['data']['loginname']);
$homedir = makeCorrectDir($settings['system']['documentroot_prefix'] . '/' . $row['data']['loginname']);
if($homedir != '/'
&& $homedir != $settings['system']['documentroot_prefix']
@@ -226,7 +226,7 @@ $awstatsclean['headerold']) {
/*
* remove maildir
*/
$maildir = makeCorrectDir($settings['system']['vmail_homedir'] . $row['data']['loginname']);
$maildir = makeCorrectDir($settings['system']['vmail_homedir'] . '/' . $row['data']['loginname']);
if($maildir != '/'
&& $maildir != $settings['system']['vmail_homedir']
@@ -269,6 +269,66 @@ $awstatsclean['headerold']) {
}
}
}
/**
* TYPE=7 Customer deleted an email account and wants the data to be deleted on the filesystem
*/
elseif ($row['type'] == '7')
{
fwrite($debugHandler, ' cron_tasks: Task7 started - deleting customer e-mail data' . "\n");
$cronlog->logAction(CRON_ACTION, LOG_INFO, 'Task7 started - deleting customer e-mail data');
if(is_array($row['data']))
{
if(isset($row['data']['loginname'])
&& isset($row['data']['email'])
) {
/*
* remove specific maildir
*/
$maildir = makeCorrectDir($settings['system']['vmail_homedir'] .'/'. $row['data']['loginname'] .'/'. $row['data']['email']);
if($maildir != '/'
&& $maildir != $settings['system']['vmail_homedir']
&& substr($maildir, 0, strlen($settings['system']['vmail_homedir'])) == $settings['system']['vmail_homedir'])
{
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: rm -rf ' . escapeshellarg($maildir));
safe_exec('rm -rf '.escapeshellarg($maildir));
}
}
}
}
/**
* TYPE=8 Customer deleted a ftp account and wants the homedir to be deleted on the filesystem
* refs #293
*/
elseif ($row['type'] == '8')
{
fwrite($debugHandler, ' cron_tasks: Task8 started - deleting customer ftp homedir' . "\n");
$cronlog->logAction(CRON_ACTION, LOG_INFO, 'Task8 started - deleting customer ftp homedir');
if(is_array($row['data']))
{
if(isset($row['data']['loginname'])
&& isset($row['data']['homedir'])
) {
/*
* remove specific homedir
*/
$ftphomedir = makeCorrectDir($row['data']['homedir']);
$customerdocroot = makeCorrectDir($settings['system']['documentroot_prefix'].'/'.$row['data']['loginname'].'/');
if($ftphomedir != '/'
&& $ftphomedir != $settings['system']['documentroot_prefix']
&& $ftphomedir != $customerdocroot
) {
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: rm -rf ' . escapeshellarg($ftphomedir));
safe_exec('rm -rf '.escapeshellarg($ftphomedir));
}
}
}
}
}
if($db->num_rows($result_tasks) != 0)

View File

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

View File

@@ -17,6 +17,48 @@
* @version $Id$
*/
/**
* chowns either awstats or webalizer folder,
* either with webserver-user or - if fcgid
* is used - the customers name, #258
*
* @param array $row array if panel_customers
*
* @return void
*/
function makeChownWithNewStats($row)
{
global $settings;
// get correct user
if($settings['system']['mod_fcgid'] == 1)
{
$user = $row['loginname'];
$group = $row['loginname'];
}
else
{
$user = $row['guid'];
$group = $row['guid'];
}
// get correct directory
$dir = $row['documentroot'];
if($settings['system']['awstats_enabled'] == '1')
{
$dir .= '/awstats/';
} else {
$dir .= '/webalizer/';
}
// only run chown if directory exists
if (file_exists($dir))
{
// run chown
safe_exec('chown -R '.escapeshellarg($user).':'.escapeshellarg($group).' '.escapeshellarg(makeCorrectDir($dir)));
}
}
function awstatsDoSingleDomain($domain, $outputdir)
{
global $cronlog, $settings;

View File

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

View File

@@ -148,6 +148,10 @@ $header
<td class="main_field_name">{$lng['admin']['phpenabled']}?</td>
<td class="main_field_display" nowrap="nowrap">$phpenabled</td>
</tr>
<tr>
<td class="main_field_name">{$lng['admin']['perlenabled']}?</td>
<td class="main_field_display" nowrap="nowrap">$perlenabled</td>
</tr>
<if $settings['aps']['aps_active'] == '1'>
<tr>
<td class="main_field_name">{$lng['aps']['numberofapspackages']}:</td>

View File

@@ -153,6 +153,10 @@ $header
<td class="main_field_name">{$lng['admin']['phpenabled']}?</td>
<td class="main_field_display" nowrap="nowrap">$phpenabled</td>
</tr>
<tr>
<td class="main_field_name">{$lng['admin']['perlenabled']}?</td>
<td class="main_field_display" nowrap="nowrap">$perlenabled</td>
</tr>
<if $settings['aps']['aps_active'] == '1'>
<tr>
<td class="main_field_name">{$lng['aps']['numberofapspackages']}:</td>

View File

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

View File

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

View File

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

View File

@@ -34,6 +34,12 @@ $header
</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="error500path" value="" size="30" maxlength="255" /></td>
</tr>
<if $cperlenabled == 1 >
<tr>
<td class="main_field_name"><b>{$lng['extras']['execute_perl']}:</b></td>
<td class="main_field_display" nowrap="nowrap">$options_cgi</td>
</tr>
</if>
<tr>
<td class="main_field_confirm" colspan="2"><input type="hidden" name="send" value="send" /><input type="submit" class="bottom" value="{$lng['extras']['pathoptions_add']}" /></td>
</tr>

View File

@@ -32,6 +32,12 @@ $header
</td>
<td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="error500path" value="{$result['error500path']}" size="30" maxlength="255" /></td>
</tr>
<if $cperlenabled == 1 >
<tr>
<td class="main_field_name"><b>{$lng['extras']['execute_perl']}:</b></td>
<td class="main_field_display" nowrap="nowrap">$options_cgi</td>
</tr>
</if>
<tr>
<td class="main_field_confirm" colspan="2"><input type="hidden" name="send" value="send" /><input type="submit" class="bottom" value="{$lng['extras']['pathoptions_edit']}" /></td>
</tr>

View File

@@ -4,6 +4,7 @@
<td class="field_name">{$row['error404path']}</td>
<td class="field_name">{$row['error403path']}</td>
<td class="field_name">{$row['error500path']}</td>
<if $cperlenabled == 1 ><td class="field_name">{$row['options_cgi']}</td></if>
<td class="field_name"><a href="$filename?page=htaccess&amp;action=edit&amp;id={$row['id']}&amp;s=$s">{$lng['panel']['edit']}</a></td>
<td class="field_name"><a href="$filename?page=htaccess&amp;action=delete&amp;id={$row['id']}&amp;s=$s">{$lng['panel']['delete']}</a></td>
</tr>

View File

@@ -2,6 +2,10 @@
<td class="field_name_border_left">{$row['databasename']}</td>
<td class="field_name">{$row['description']}</td>
<if 1 < count($sql_root)><td class="field_name">{$sql_root[$row['dbserver']]['caption']}</td></if>
<td class="field_name"><a href="$filename?page=mysqls&amp;action=edit&amp;id={$row['id']}&amp;s=$s">{$lng['panel']['edit']}</a></td>
<td class="field_name"><a href="$filename?page=mysqls&amp;action=delete&amp;id={$row['id']}&amp;s=$s">{$lng['panel']['delete']}</a></td>
<if $row['apsdb'] != '1'>
<td class="field_name"><a href="$filename?page=mysqls&amp;action=edit&amp;id={$row['id']}&amp;s=$s">{$lng['panel']['edit']}</a></td>
<td class="field_name"><a href="$filename?page=mysqls&amp;action=delete&amp;id={$row['id']}&amp;s=$s">{$lng['panel']['delete']}</a></td>
<else>
<td class="field_name" colspan="2">{$lng['aps']['cannoteditordeleteapsdb']}</td>
</if>
</tr>

View File

@@ -1,8 +0,0 @@
# for Froxlor and AWStats to work together
# you have to change the following line
# look for
DirData="/some/folder/"
# and comment this out with a hash (#)
#DirData="/some/folder/"

View File

@@ -8,9 +8,9 @@ shadow.where_clause = ;
shadow.userid_column = u.id;
shadow.user_column = u.username;
shadow.password_column = u.password;
shadow.lastchange_column = UNIX_TIMESTAMP()-10;
shadow.min_column = 1;
shadow.max_column = 2;
shadow.lastchange_column = FLOOR(UNIX_TIMESTAMP()/86400-1);
shadow.min_column = 0;
shadow.max_column = 99999;
shadow.warn_column = 7;
shadow.inact_column = -1;
shadow.expire_column = -1;

View File

@@ -4,7 +4,7 @@ users.database = <SQL_DB>;
users.db_user = <SQL_UNPRIVILEGED_USER>;
users.db_password = <SQL_UNPRIVILEGED_PASSWORD>;
users.table = ftp_users u;
users.where_clause =;
users.where_clause = u.login_enabled = 'Y';
users.user_column = u.username;
users.password_column = u.password;
users.userid_column = u.id;

View File

@@ -12,6 +12,7 @@ server.modules = (
"mod_access",
"mod_auth",
"mod_fastcgi",
"mod_cgi",
"mod_accesslog"
)
@@ -33,7 +34,7 @@ url.access-deny = ("~", ".inc")
fastcgi.server = (
".php" => (
"localhost" => (
"socket" => "<CUSTOMER_TMP>lighttpd-fcgi-sock-lighttpd",
"socket" => "/tmp/lighttpd-fcgi-sock-lighttpd",
"broken-scriptfilename" => "enable",
"bin-path" => "/usr/bin/php5-cgi",
"min-procs" => 1,

View File

@@ -1,8 +0,0 @@
# for Froxlor and AWStats to work together
# you have to change the following line
# look for
DirData="/some/folder/"
# and comment this out with a hash (#)
#DirData="/some/folder/"

View File

@@ -8,9 +8,9 @@ shadow.where_clause = ;
shadow.userid_column = u.id;
shadow.user_column = u.username;
shadow.password_column = u.password;
shadow.lastchange_column = UNIX_TIMESTAMP()-10;
shadow.min_column = 1;
shadow.max_column = 2;
shadow.lastchange_column = FLOOR(UNIX_TIMESTAMP()/86400-1);
shadow.min_column = 0;
shadow.max_column = 99999;
shadow.warn_column = 7;
shadow.inact_column = -1;
shadow.expire_column = -1;

View File

@@ -4,7 +4,7 @@ users.database = <SQL_DB>;
users.db_user = <SQL_UNPRIVILEGED_USER>;
users.db_password = <SQL_UNPRIVILEGED_PASSWORD>;
users.table = ftp_users u;
users.where_clause =;
users.where_clause = u.login_enabled = 'Y';
users.user_column = u.username;
users.password_column = u.password;
users.userid_column = u.id;

View File

@@ -12,6 +12,7 @@ server.modules = (
"mod_access",
"mod_auth",
"mod_fastcgi",
"mod_cgi",
"mod_accesslog"
)
@@ -33,7 +34,7 @@ url.access-deny = ("~", ".inc")
fastcgi.server = (
".php" => (
"localhost" => (
"socket" => "<CUSTOMER_TMP>lighttpd-fcgi-sock-lighttpd",
"socket" => "/tmp/lighttpd-fcgi-sock-lighttpd",
"broken-scriptfilename" => "enable",
"bin-path" => "/usr/bin/php5-cgi",
"min-procs" => 1,

View File

@@ -1,19 +0,0 @@
# for Froxlor and AWStats to work together
# you have to comment out the following
# variables
# look for
LogFile=""
LogType=""
LogFormat=""
LogSeparator=""
SiteDomain=""
DirData="/some/folder/"
# and comment this out with a hash (#)
#LogFile=""
#LogType=""
#LogFormat=""
#LogSeparator=""
#SiteDomain=""
#DirData="/some/folder/"

View File

@@ -1,6 +1,6 @@
getpwnam SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users WHERE username='%1$s' LIMIT 1
getpwuid SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users WHERE uid='%1$u' LIMIT 1
getpwent SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users
getpwnam SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users WHERE username='%1$s' AND login_enabled = 'Y' LIMIT 1
getpwuid SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users WHERE uid='%1$u' AND login_enabled = 'Y' LIMIT 1
getpwent SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users
getspnam SELECT username, password, '12345', '0', '99999', '7', '', '', '' FROM ftp_users WHERE username='%1$s' LIMIT 1
getspent SELECT username, password, '12345', '0', '99999', '7', '', '', '' FROM ftp_users
getgrnam SELECT groupname, '', gid FROM ftp_groups WHERE groupname='%1$s' LIMIT 1

View File

@@ -1,8 +0,0 @@
# for Froxlor and AWStats to work together
# you have to change the following line
# look for
DirData="/some/folder/"
# and comment this out with a hash (#)
#DirData="/some/folder/"

View File

@@ -1,18 +1,21 @@
getpwnam SELECT username,'x',uid,gid,'MySQL User',homedir,shell \
FROM ftp_users \
WHERE username='%1$s' \
AND login_enabled = 'Y' \
LIMIT 1
getpwuid SELECT username,'x',uid,gid,'MySQL User',homedir,shell \
FROM ftp_users \
WHERE uid='%1$u' \
AND login_enabled = 'Y' \
LIMIT 1
getspnam SELECT username,password,UNIX_TIMESTAMP()-10,'1','2','7','-1','-1','0' \
getspnam SELECT username,password,FLOOR(UNIX_TIMESTAMP()/86400-1),'1','99999','7','-1','-1','0' \
FROM ftp_users \
WHERE username='%1$s' \
AND login_enabled = 'Y' \
LIMIT 1
getpwent SELECT username,'x',uid,gid,'MySQL User',homedir,shell \
FROM ftp_users
getspent SELECT username,password,UNIX_TIMESTAMP()-10,'1','2','7','-1','-1','0' \
getspent SELECT username,password,FLOOR(UNIX_TIMESTAMP()/86400-1),'1','99999','7','-1','-1','0' \
FROM ftp_users
getgrnam SELECT groupname,'x',gid \
FROM ftp_groups \

View File

@@ -12,6 +12,7 @@ server.modules = (
"mod_access",
"mod_auth",
"mod_fastcgi",
"mod_cgi",
"mod_accesslog"
)
@@ -31,11 +32,12 @@ server.bind = "<SERVERIP>"
url.access-deny = ("~", ".inc")
include "mime-types.conf"
#include "mod_cgi.conf"
fastcgi.server = (
".php" => (
"localhost" => (
"socket" => "<CUSTOMER_TMP>lighttpd-fcgi-sock-lighttpd",
"socket" => "/tmp/lighttpd-fcgi-sock-lighttpd",
"broken-scriptfilename" => "enable",
"bin-path" => "/usr/bin/php-cgi",
"min-procs" => 1,

View File

@@ -1,8 +0,0 @@
# for Froxlor and AWStats to work together
# you have to change the following line
# look for
DirData="/some/folder/"
# and comment this out with a hash (#)
#DirData="/some/folder/"

View File

@@ -1,8 +0,0 @@
# for Froxlor and AWStats to work together
# you have to change the following line
# look for
DirData="/some/folder/"
# and comment this out with a hash (#)
#DirData="/some/folder/"

View File

@@ -8,9 +8,9 @@ shadow.where_clause = ;
shadow.userid_column = u.id;
shadow.user_column = u.username;
shadow.password_column = u.password;
shadow.lastchange_column = UNIX_TIMESTAMP()-10;
shadow.min_column = 1;
shadow.max_column = 2;
shadow.lastchange_column = FLOOR(UNIX_TIMESTAMP()/86400-1);
shadow.min_column = 0;
shadow.max_column = 99999;
shadow.warn_column = 7;
shadow.inact_column = -1;
shadow.expire_column = -1;

View File

@@ -4,7 +4,7 @@ users.database = <SQL_DB>;
users.db_user = <SQL_UNPRIVILEGED_USER>;
users.db_password = <SQL_UNPRIVILEGED_PASSWORD>;
users.table = ftp_users u;
users.where_clause =;
users.where_clause = u.login_enabled = 'Y';
users.user_column = u.username;
users.password_column = u.password;
users.userid_column = u.id;

View File

@@ -12,6 +12,7 @@ server.modules = (
"mod_access",
"mod_auth",
"mod_fastcgi",
"mod_cgi",
"mod_accesslog"
)
@@ -33,7 +34,7 @@ url.access-deny = ("~", ".inc")
fastcgi.server = (
".php" => (
"localhost" => (
"socket" => "<CUSTOMER_TMP>lighttpd-fcgi-sock-lighttpd",
"socket" => "/tmp/lighttpd-fcgi-sock-lighttpd",
"broken-scriptfilename" => "enable",
"bin-path" => "/usr/bin/php5-cgi",
"min-procs" => 1,

View File

@@ -1,8 +0,0 @@
# for Froxlor and AWStats to work together
# you have to change the following line
# look for
DirData="/some/folder/"
# and comment this out with a hash (#)
#DirData="/some/folder/"

View File

@@ -13,3 +13,16 @@ socket listen {
group = vmail
}
}
passdb sql {
args = /etc/dovecot/dovecot-sql.conf
}
userdb prefetch {
}
userdb sql {
args = /etc/dovecot/dovecot-sql.conf
}
user = vmail

View File

@@ -35,21 +35,6 @@ protocol lda {
rejection_reason = Your message to <%t> was automatically rejected:%n%r
}
auth default {
passdb sql {
args = /etc/dovecot/dovecot-sql.conf
}
userdb prefetch {
}
userdb sql {
args = /etc/dovecot/dovecot-sql.conf
}
user = vmail
}
# Plugins configuration
plugin {
quota = maildir

View File

@@ -8,9 +8,9 @@ shadow.where_clause = ;
shadow.userid_column = u.id;
shadow.user_column = u.username;
shadow.password_column = u.password;
shadow.lastchange_column = UNIX_TIMESTAMP()-10;
shadow.min_column = 1;
shadow.max_column = 2;
shadow.lastchange_column = FLOOR(UNIX_TIMESTAMP()/86400-1);
shadow.min_column = 0;
shadow.max_column = 99999;
shadow.warn_column = 7;
shadow.inact_column = -1;
shadow.expire_column = -1;

View File

@@ -4,7 +4,7 @@ users.database = <SQL_DB>;
users.db_user = <SQL_UNPRIVILEGED_USER>;
users.db_password = <SQL_UNPRIVILEGED_PASSWORD>;
users.table = ftp_users u;
users.where_clause =;
users.where_clause = u.login_enabled = 'Y';
users.user_column = u.username;
users.password_column = u.password;
users.userid_column = u.id;

View File

@@ -12,6 +12,7 @@ server.modules = (
"mod_access",
"mod_auth",
"mod_fastcgi",
"mod_cgi",
"mod_accesslog"
)
@@ -33,7 +34,7 @@ url.access-deny = ("~", ".inc")
fastcgi.server = (
".php" => (
"localhost" => (
"socket" => "<CUSTOMER_TMP>lighttpd-fcgi-sock-lighttpd",
"socket" => "/tmp/lighttpd-fcgi-sock-lighttpd",
"broken-scriptfilename" => "enable",
"bin-path" => "/usr/bin/php5-cgi",
"min-procs" => 1,