- 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)
This commit is contained in:
@@ -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)
|
||||
@@ -423,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;
|
||||
|
||||
@@ -525,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";
|
||||
|
||||
@@ -729,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") . "\";");
|
||||
}
|
||||
}
|
||||
@@ -852,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;
|
||||
|
||||
@@ -956,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');
|
||||
}
|
||||
@@ -984,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'
|
||||
@@ -1249,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']);
|
||||
|
||||
@@ -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));
|
||||
@@ -343,6 +367,8 @@ elseif($page == 'htaccess')
|
||||
{
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
|
||||
$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") . "\";");
|
||||
}
|
||||
|
||||
@@ -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 ;
|
||||
@@ -356,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 ;
|
||||
|
||||
@@ -452,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.11-svn1');
|
||||
INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9.11-svn2');
|
||||
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');
|
||||
|
||||
@@ -897,3 +897,15 @@ if(isFroxlorVersion('0.9.10'))
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
42
lib/functions/froxlor/function.customerHasPerlEnabled.php
Normal file
42
lib/functions/froxlor/function.customerHasPerlEnabled.php
Normal 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;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ define('PACKAGE_ENABLED', 2);
|
||||
|
||||
// VERSION INFO
|
||||
|
||||
$version = '0.9.11-svn1';
|
||||
$version = '0.9.11-svn2';
|
||||
$dbversion = '2';
|
||||
$branding = '';
|
||||
|
||||
|
||||
@@ -1443,4 +1443,8 @@ $lng['serversettings']['panel_password_regex']['title'] = 'Regular expression fo
|
||||
$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';
|
||||
|
||||
?>
|
||||
|
||||
@@ -1426,4 +1426,8 @@ $lng['serversettings']['panel_password_regex']['title'] = 'Regulärer Ausdru
|
||||
$lng['serversettings']['panel_password_regex']['description'] = 'Hier können Sie einen regulären Ausdruck für Passwort-Komplexitä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ät wurde nicht erfüllt (Regex: %s)';
|
||||
|
||||
// ADDED IN FROXLOR 0.9.11-svn2
|
||||
$lng['extras']['execute_perl'] = 'Perl/CGI ausführen';
|
||||
$lng['admin']['perlenabled'] = 'Perl verfügbar';
|
||||
|
||||
?>
|
||||
|
||||
@@ -803,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");
|
||||
}
|
||||
|
||||
@@ -837,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');
|
||||
|
||||
@@ -531,6 +531,22 @@ 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
|
||||
$path = substr($path, 0, -1);
|
||||
$path_options.= ' $HTTP["url"] =~ "^' . $path . '($|/)" {' . "\n";
|
||||
$path_options.= "\t" . 'cgi.assign = (' . "\n";
|
||||
$path_options.= "\t\t" . '".pl" => "/usr/bin/perl",' . "\n";
|
||||
$path_options.= "\t\t" . '".cgi" => "/usr/bin/perl"' . "\n";
|
||||
$path_options.= "\t" . ')' . "\n";
|
||||
$path_options.= ' }' . "\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
return $path_options;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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="" /> {$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']} {$arrowcode['path']}</td>
|
||||
@@ -13,16 +13,17 @@ $header
|
||||
<td class="field_display">{$lng['extras']['error404path']} {$arrowcode['error404path']}</td>
|
||||
<td class="field_display">{$lng['extras']['error403path']} {$arrowcode['error403path']}</td>
|
||||
<td class="field_display">{$lng['extras']['error500path']} {$arrowcode['error500path']}</td>
|
||||
<if $cperlenabled == 1 ><td class="field_display">{$lng['extras']['execute_perl']} {$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&action=add&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&action=add&s=$s">{$lng['extras']['pathoptions_add']}</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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&action=edit&id={$row['id']}&s=$s">{$lng['panel']['edit']}</a></td>
|
||||
<td class="field_name"><a href="$filename?page=htaccess&action=delete&id={$row['id']}&s=$s">{$lng['panel']['delete']}</a></td>
|
||||
</tr>
|
||||
|
||||
@@ -12,6 +12,7 @@ server.modules = (
|
||||
"mod_access",
|
||||
"mod_auth",
|
||||
"mod_fastcgi",
|
||||
"mod_cgi",
|
||||
"mod_accesslog"
|
||||
)
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ server.modules = (
|
||||
"mod_access",
|
||||
"mod_auth",
|
||||
"mod_fastcgi",
|
||||
"mod_cgi",
|
||||
"mod_accesslog"
|
||||
)
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ server.modules = (
|
||||
"mod_access",
|
||||
"mod_auth",
|
||||
"mod_fastcgi",
|
||||
"mod_cgi",
|
||||
"mod_accesslog"
|
||||
)
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ server.modules = (
|
||||
"mod_access",
|
||||
"mod_auth",
|
||||
"mod_fastcgi",
|
||||
"mod_cgi",
|
||||
"mod_accesslog"
|
||||
)
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ server.modules = (
|
||||
"mod_access",
|
||||
"mod_auth",
|
||||
"mod_fastcgi",
|
||||
"mod_cgi",
|
||||
"mod_accesslog"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user