svn:eol-style got murdered on some files for whatever reason so it gets resurrected now, also set some svn:keywords
This commit is contained in:
@@ -1,72 +1,72 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Settings
|
* @package Settings
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'version' => array(
|
'version' => array(
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'panel_version' => array(
|
'panel_version' => array(
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'version',
|
'varname' => 'version',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
),
|
),
|
||||||
'panel_frontend' => array(
|
'panel_frontend' => array(
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'frontend',
|
'varname' => 'frontend',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
),
|
),
|
||||||
'system_last_tasks_run' => array(
|
'system_last_tasks_run' => array(
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'last_tasks_run',
|
'varname' => 'last_tasks_run',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_last_traffic_run' => array(
|
'system_last_traffic_run' => array(
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'last_traffic_run',
|
'varname' => 'last_traffic_run',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
),
|
),
|
||||||
'system_lastcronrun' => array(
|
'system_lastcronrun' => array(
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'lastcronrun',
|
'varname' => 'lastcronrun',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
),
|
),
|
||||||
'system_lastguid' => array(
|
'system_lastguid' => array(
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'lastguid',
|
'varname' => 'lastguid',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'default' => 9999,
|
'default' => 9999,
|
||||||
),
|
),
|
||||||
'system_lastaccountnumber' => array(
|
'system_lastaccountnumber' => array(
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'lastaccountnumber',
|
'varname' => 'lastaccountnumber',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'default' => 0,
|
'default' => 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,165 +1,165 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Language
|
* @package Language
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'panel' => array(
|
'panel' => array(
|
||||||
'title' => $lng['admin']['panelsettings'],
|
'title' => $lng['admin']['panelsettings'],
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'panel_standardlanguage' => array(
|
'panel_standardlanguage' => array(
|
||||||
'label' => array('title' => $lng['login']['language'], 'description' => $lng['serversettings']['language']['description']),
|
'label' => array('title' => $lng['login']['language'], 'description' => $lng['serversettings']['language']['description']),
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'standardlanguage',
|
'varname' => 'standardlanguage',
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'default' => 'English',
|
'default' => 'English',
|
||||||
'option_mode' => 'one',
|
'option_mode' => 'one',
|
||||||
'option_options_method' => 'getLanguages',
|
'option_options_method' => 'getLanguages',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'panel_natsorting' => array(
|
'panel_natsorting' => array(
|
||||||
'label' => $lng['serversettings']['natsorting'],
|
'label' => $lng['serversettings']['natsorting'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'natsorting',
|
'varname' => 'natsorting',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'panel_no_robots' => array(
|
'panel_no_robots' => array(
|
||||||
'label' => $lng['serversettings']['no_robots'],
|
'label' => $lng['serversettings']['no_robots'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'no_robots',
|
'varname' => 'no_robots',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'panel_paging' => array(
|
'panel_paging' => array(
|
||||||
'label' => $lng['serversettings']['paging'],
|
'label' => $lng['serversettings']['paging'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'paging',
|
'varname' => 'paging',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'int_min' => 0,
|
'int_min' => 0,
|
||||||
'default' => 0,
|
'default' => 0,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'panel_pathedit' => array(
|
'panel_pathedit' => array(
|
||||||
'label' => $lng['serversettings']['pathedit'],
|
'label' => $lng['serversettings']['pathedit'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'pathedit',
|
'varname' => 'pathedit',
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'default' => 'Manual',
|
'default' => 'Manual',
|
||||||
'option_mode' => 'one',
|
'option_mode' => 'one',
|
||||||
'option_options' => array('Manual' => 'Manual', 'Dropdown' => 'Dropdown'),
|
'option_options' => array('Manual' => 'Manual', 'Dropdown' => 'Dropdown'),
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'panel_adminmail' => array(
|
'panel_adminmail' => array(
|
||||||
'label' => $lng['serversettings']['adminmail'],
|
'label' => $lng['serversettings']['adminmail'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'adminmail',
|
'varname' => 'adminmail',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'mail',
|
'string_type' => 'mail',
|
||||||
'string_emptyallowed' => false,
|
'string_emptyallowed' => false,
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'panel_decimal_places' => array(
|
'panel_decimal_places' => array(
|
||||||
'label' => $lng['serversettings']['decimal_places'],
|
'label' => $lng['serversettings']['decimal_places'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'decimal_places',
|
'varname' => 'decimal_places',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'int_min' => 0,
|
'int_min' => 0,
|
||||||
'int_max' => 15,
|
'int_max' => 15,
|
||||||
'default' => 4,
|
'default' => 4,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'panel_phpmyadmin_url' => array(
|
'panel_phpmyadmin_url' => array(
|
||||||
'label' => $lng['serversettings']['phpmyadmin_url'],
|
'label' => $lng['serversettings']['phpmyadmin_url'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'phpmyadmin_url',
|
'varname' => 'phpmyadmin_url',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'url',
|
'string_type' => 'url',
|
||||||
'string_emptyallowed' => true,
|
'string_emptyallowed' => true,
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'panel_webmail_url' => array(
|
'panel_webmail_url' => array(
|
||||||
'label' => $lng['serversettings']['webmail_url'],
|
'label' => $lng['serversettings']['webmail_url'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'webmail_url',
|
'varname' => 'webmail_url',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'url',
|
'string_type' => 'url',
|
||||||
'string_emptyallowed' => true,
|
'string_emptyallowed' => true,
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'panel_webftp_url' => array(
|
'panel_webftp_url' => array(
|
||||||
'label' => $lng['serversettings']['webftp_url'],
|
'label' => $lng['serversettings']['webftp_url'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'webftp_url',
|
'varname' => 'webftp_url',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'url',
|
'string_type' => 'url',
|
||||||
'string_emptyallowed' => true,
|
'string_emptyallowed' => true,
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'admin_show_version_login' => array(
|
'admin_show_version_login' => array(
|
||||||
'label' => $lng['admin']['show_version_login'],
|
'label' => $lng['admin']['show_version_login'],
|
||||||
'settinggroup' => 'admin',
|
'settinggroup' => 'admin',
|
||||||
'varname' => 'show_version_login',
|
'varname' => 'show_version_login',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'admin_show_version_footer' => array(
|
'admin_show_version_footer' => array(
|
||||||
'label' => $lng['admin']['show_version_footer'],
|
'label' => $lng['admin']['show_version_footer'],
|
||||||
'settinggroup' => 'admin',
|
'settinggroup' => 'admin',
|
||||||
'varname' => 'show_version_footer',
|
'varname' => 'show_version_footer',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'admin_froxlor_graphic' => array(
|
'admin_froxlor_graphic' => array(
|
||||||
'label' => $lng['admin']['froxlor_graphic'],
|
'label' => $lng['admin']['froxlor_graphic'],
|
||||||
'settinggroup' => 'admin',
|
'settinggroup' => 'admin',
|
||||||
'varname' => 'froxlor_graphic',
|
'varname' => 'froxlor_graphic',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'panel_allow_domain_change_admin' => array(
|
'panel_allow_domain_change_admin' => array(
|
||||||
'label' => $lng['serversettings']['panel_allow_domain_change_admin'],
|
'label' => $lng['serversettings']['panel_allow_domain_change_admin'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'allow_domain_change_admin',
|
'varname' => 'allow_domain_change_admin',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'panel_allow_domain_change_customer' => array(
|
'panel_allow_domain_change_customer' => array(
|
||||||
'label' => $lng['serversettings']['panel_allow_domain_change_customer'],
|
'label' => $lng['serversettings']['panel_allow_domain_change_customer'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'allow_domain_change_customer',
|
'varname' => 'allow_domain_change_customer',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,112 +1,112 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Settings
|
* @package Settings
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'accounts' => array(
|
'accounts' => array(
|
||||||
'title' => $lng['admin']['accountsettings'],
|
'title' => $lng['admin']['accountsettings'],
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'session_sessiontimeout' => array(
|
'session_sessiontimeout' => array(
|
||||||
'label' => $lng['serversettings']['session_timeout'],
|
'label' => $lng['serversettings']['session_timeout'],
|
||||||
'settinggroup' => 'session',
|
'settinggroup' => 'session',
|
||||||
'varname' => 'sessiontimeout',
|
'varname' => 'sessiontimeout',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'default' => 600,
|
'default' => 600,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'session_allow_multiple_login' => array(
|
'session_allow_multiple_login' => array(
|
||||||
'label' => $lng['serversettings']['session_allow_multiple_login'],
|
'label' => $lng['serversettings']['session_allow_multiple_login'],
|
||||||
'settinggroup' => 'session',
|
'settinggroup' => 'session',
|
||||||
'varname' => 'allow_multiple_login',
|
'varname' => 'allow_multiple_login',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'login_maxloginattempts' => array(
|
'login_maxloginattempts' => array(
|
||||||
'label' => $lng['serversettings']['maxloginattempts'],
|
'label' => $lng['serversettings']['maxloginattempts'],
|
||||||
'settinggroup' => 'login',
|
'settinggroup' => 'login',
|
||||||
'varname' => 'maxloginattempts',
|
'varname' => 'maxloginattempts',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'default' => 3,
|
'default' => 3,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'login_deactivatetime' => array(
|
'login_deactivatetime' => array(
|
||||||
'label' => $lng['serversettings']['deactivatetime'],
|
'label' => $lng['serversettings']['deactivatetime'],
|
||||||
'settinggroup' => 'login',
|
'settinggroup' => 'login',
|
||||||
'varname' => 'deactivatetime',
|
'varname' => 'deactivatetime',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'default' => 900,
|
'default' => 900,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'customer_accountprefix' => array(
|
'customer_accountprefix' => array(
|
||||||
'label' => $lng['serversettings']['accountprefix'],
|
'label' => $lng['serversettings']['accountprefix'],
|
||||||
'settinggroup' => 'customer',
|
'settinggroup' => 'customer',
|
||||||
'varname' => 'accountprefix',
|
'varname' => 'accountprefix',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'plausibility_check_method' => 'checkUsername',
|
'plausibility_check_method' => 'checkUsername',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'customer_mysqlprefix' => array(
|
'customer_mysqlprefix' => array(
|
||||||
'label' => $lng['serversettings']['mysqlprefix'],
|
'label' => $lng['serversettings']['mysqlprefix'],
|
||||||
'settinggroup' => 'customer',
|
'settinggroup' => 'customer',
|
||||||
'varname' => 'mysqlprefix',
|
'varname' => 'mysqlprefix',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'plausibility_check_method' => 'checkUsername',
|
'plausibility_check_method' => 'checkUsername',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'customer_ftpprefix' => array(
|
'customer_ftpprefix' => array(
|
||||||
'label' => $lng['serversettings']['ftpprefix'],
|
'label' => $lng['serversettings']['ftpprefix'],
|
||||||
'settinggroup' => 'customer',
|
'settinggroup' => 'customer',
|
||||||
'varname' => 'ftpprefix',
|
'varname' => 'ftpprefix',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'customer_ftpatdomain' => array(
|
'customer_ftpatdomain' => array(
|
||||||
'label' => $lng['serversettings']['ftpdomain'],
|
'label' => $lng['serversettings']['ftpdomain'],
|
||||||
'settinggroup' => 'customer',
|
'settinggroup' => 'customer',
|
||||||
'varname' => 'ftpatdomain',
|
'varname' => 'ftpatdomain',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'panel_allow_preset' => array(
|
'panel_allow_preset' => array(
|
||||||
'label' => $lng['serversettings']['allow_password_reset'],
|
'label' => $lng['serversettings']['allow_password_reset'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'allow_preset',
|
'varname' => 'allow_preset',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'panel_allow_preset_admin' => array(
|
'panel_allow_preset_admin' => array(
|
||||||
'label' => $lng['serversettings']['allow_password_reset_admin'],
|
'label' => $lng['serversettings']['allow_password_reset_admin'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'allow_preset_admin',
|
'varname' => 'allow_preset_admin',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,113 +1,113 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Settings
|
* @package Settings
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'system' => array(
|
'system' => array(
|
||||||
'title' => $lng['admin']['systemsettings'],
|
'title' => $lng['admin']['systemsettings'],
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'system_documentroot_prefix' => array(
|
'system_documentroot_prefix' => array(
|
||||||
'label' => $lng['serversettings']['documentroot_prefix'],
|
'label' => $lng['serversettings']['documentroot_prefix'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'documentroot_prefix',
|
'varname' => 'documentroot_prefix',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => '/var/customers/webs/',
|
'default' => '/var/customers/webs/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_ipaddress' => array(
|
'system_ipaddress' => array(
|
||||||
'label' => $lng['serversettings']['ipaddress'],
|
'label' => $lng['serversettings']['ipaddress'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'ipaddress',
|
'varname' => 'ipaddress',
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'option_mode' => 'one',
|
'option_mode' => 'one',
|
||||||
'option_options_method' => 'getIpAddresses',
|
'option_options_method' => 'getIpAddresses',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingIpAddress',
|
'save_method' => 'storeSettingIpAddress',
|
||||||
),
|
),
|
||||||
'system_defaultip' => array(
|
'system_defaultip' => array(
|
||||||
'label' => $lng['serversettings']['defaultip'],
|
'label' => $lng['serversettings']['defaultip'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'defaultip',
|
'varname' => 'defaultip',
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'option_mode' => 'one',
|
'option_mode' => 'one',
|
||||||
'option_options_method' => 'getIpPortCombinations',
|
'option_options_method' => 'getIpPortCombinations',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingDefaultIp',
|
'save_method' => 'storeSettingDefaultIp',
|
||||||
),
|
),
|
||||||
'system_hostname' => array(
|
'system_hostname' => array(
|
||||||
'label' => $lng['serversettings']['hostname'],
|
'label' => $lng['serversettings']['hostname'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'hostname',
|
'varname' => 'hostname',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingHostname',
|
'save_method' => 'storeSettingHostname',
|
||||||
),
|
),
|
||||||
'system_mysql_access_host' => array(
|
'system_mysql_access_host' => array(
|
||||||
'label' => $lng['serversettings']['mysql_access_host'],
|
'label' => $lng['serversettings']['mysql_access_host'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'mysql_access_host',
|
'varname' => 'mysql_access_host',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => '127.0.0.1,localhost',
|
'default' => '127.0.0.1,localhost',
|
||||||
'plausibility_check_method' => 'checkMysqlAccessHost',
|
'plausibility_check_method' => 'checkMysqlAccessHost',
|
||||||
'save_method' => 'storeSettingMysqlAccessHost',
|
'save_method' => 'storeSettingMysqlAccessHost',
|
||||||
),
|
),
|
||||||
'system_realtime_port' => array(
|
'system_realtime_port' => array(
|
||||||
'label' => $lng['serversettings']['system_realtime_port'],
|
'label' => $lng['serversettings']['system_realtime_port'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'realtime_port',
|
'varname' => 'realtime_port',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'int_max' => 65535,
|
'int_max' => 65535,
|
||||||
'default' => 0,
|
'default' => 0,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_index_file_extension' => array(
|
'system_index_file_extension' => array(
|
||||||
'label' => $lng['serversettings']['index_file_extension'],
|
'label' => $lng['serversettings']['index_file_extension'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'index_file_extension',
|
'varname' => 'index_file_extension',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_regexp' => '/^[a-zA-Z0-9]{1,6}$/',
|
'string_regexp' => '/^[a-zA-Z0-9]{1,6}$/',
|
||||||
'default' => 'html',
|
'default' => 'html',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_httpuser' => array(
|
'system_httpuser' => array(
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'httpuser',
|
'varname' => 'httpuser',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'default' => 'www-data',
|
'default' => 'www-data',
|
||||||
),
|
),
|
||||||
'system_httpgroup' => array(
|
'system_httpgroup' => array(
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'httpgroup',
|
'varname' => 'httpgroup',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'default' => 'www-data',
|
'default' => 'www-data',
|
||||||
),
|
),
|
||||||
'system_debug_cron' => array(
|
'system_debug_cron' => array(
|
||||||
'label' => $lng['serversettings']['cron']['debug'],
|
'label' => $lng['serversettings']['cron']['debug'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'debug_cron',
|
'varname' => 'debug_cron',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,170 +1,170 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Settings
|
* @package Settings
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'webserver' => array(
|
'webserver' => array(
|
||||||
'title' => $lng['admin']['webserversettings'],
|
'title' => $lng['admin']['webserversettings'],
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'system_webserver' => array(
|
'system_webserver' => array(
|
||||||
'label' => $lng['admin']['webserver'],
|
'label' => $lng['admin']['webserver'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'webserver',
|
'varname' => 'webserver',
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'default' => 'Apache2',
|
'default' => 'Apache2',
|
||||||
'option_mode' => 'one',
|
'option_mode' => 'one',
|
||||||
'option_options' => array('apache2' => 'Apache 2', 'lighttpd' => 'ligHTTPd'),
|
'option_options' => array('apache2' => 'Apache 2', 'lighttpd' => 'ligHTTPd'),
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_apacheconf_vhost' => array(
|
'system_apacheconf_vhost' => array(
|
||||||
'label' => $lng['serversettings']['apacheconf_vhost'],
|
'label' => $lng['serversettings']['apacheconf_vhost'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'apacheconf_vhost',
|
'varname' => 'apacheconf_vhost',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'filedir',
|
'string_type' => 'filedir',
|
||||||
'default' => '/etc/apache2/sites-enabled/',
|
'default' => '/etc/apache2/sites-enabled/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_apacheconf_diroptions' => array(
|
'system_apacheconf_diroptions' => array(
|
||||||
'label' => $lng['serversettings']['apacheconf_diroptions'],
|
'label' => $lng['serversettings']['apacheconf_diroptions'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'apacheconf_diroptions',
|
'varname' => 'apacheconf_diroptions',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'filedir',
|
'string_type' => 'filedir',
|
||||||
'default' => '/etc/apache2/sites-enabled/',
|
'default' => '/etc/apache2/sites-enabled/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_apacheconf_htpasswddir' => array(
|
'system_apacheconf_htpasswddir' => array(
|
||||||
'label' => $lng['serversettings']['apacheconf_htpasswddir'],
|
'label' => $lng['serversettings']['apacheconf_htpasswddir'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'apacheconf_htpasswddir',
|
'varname' => 'apacheconf_htpasswddir',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'default' => '/etc/apache2/htpasswd/',
|
'default' => '/etc/apache2/htpasswd/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_apachereload_command' => array(
|
'system_apachereload_command' => array(
|
||||||
'label' => $lng['serversettings']['apachereload_command'],
|
'label' => $lng['serversettings']['apachereload_command'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'apachereload_command',
|
'varname' => 'apachereload_command',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => '/etc/init.d/apache2 reload',
|
'default' => '/etc/init.d/apache2 reload',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_mod_log_sql' => array(
|
'system_mod_log_sql' => array(
|
||||||
'label' => $lng['serversettings']['mod_log_sql'],
|
'label' => $lng['serversettings']['mod_log_sql'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'mod_log_sql',
|
'varname' => 'mod_log_sql',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_logfiles_directory' => array(
|
'system_logfiles_directory' => array(
|
||||||
'label' => $lng['serversettings']['logfiles_directory'],
|
'label' => $lng['serversettings']['logfiles_directory'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'logfiles_directory',
|
'varname' => 'logfiles_directory',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'default' => '/var/customers/logs/',
|
'default' => '/var/customers/logs/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_phpappendopenbasedir' => array(
|
'system_phpappendopenbasedir' => array(
|
||||||
'label' => $lng['serversettings']['phpappendopenbasedir'],
|
'label' => $lng['serversettings']['phpappendopenbasedir'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'phpappendopenbasedir',
|
'varname' => 'phpappendopenbasedir',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_emptyallowed' => true,
|
'string_emptyallowed' => true,
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_deactivateddocroot' => array(
|
'system_deactivateddocroot' => array(
|
||||||
'label' => $lng['serversettings']['deactivateddocroot'],
|
'label' => $lng['serversettings']['deactivateddocroot'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'deactivateddocroot',
|
'varname' => 'deactivateddocroot',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'string_emptyallowed' => true,
|
'string_emptyallowed' => true,
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_default_vhostconf' => array(
|
'system_default_vhostconf' => array(
|
||||||
'label' => $lng['serversettings']['default_vhostconf'],
|
'label' => $lng['serversettings']['default_vhostconf'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'default_vhostconf',
|
'varname' => 'default_vhostconf',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'ssl' => array(
|
'ssl' => array(
|
||||||
'title' => $lng['admin']['sslsettings'],
|
'title' => $lng['admin']['sslsettings'],
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'system_ssl_enabled' => array(
|
'system_ssl_enabled' => array(
|
||||||
'label' => $lng['serversettings']['ssl']['use_ssl'],
|
'label' => $lng['serversettings']['ssl']['use_ssl'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'use_ssl',
|
'varname' => 'use_ssl',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_ssl_cert_file' => array(
|
'system_ssl_cert_file' => array(
|
||||||
'label' => $lng['serversettings']['ssl']['ssl_cert_file'],
|
'label' => $lng['serversettings']['ssl']['ssl_cert_file'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'ssl_cert_file',
|
'varname' => 'ssl_cert_file',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'file',
|
'string_type' => 'file',
|
||||||
'string_emptyallowed' => true,
|
'string_emptyallowed' => true,
|
||||||
'default' => '/etc/apache2/apache2.pem',
|
'default' => '/etc/apache2/apache2.pem',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_ssl_key_file' => array(
|
'system_ssl_key_file' => array(
|
||||||
'label' => $lng['serversettings']['ssl']['ssl_key_file'],
|
'label' => $lng['serversettings']['ssl']['ssl_key_file'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'ssl_key_file',
|
'varname' => 'ssl_key_file',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'file',
|
'string_type' => 'file',
|
||||||
'string_emptyallowed' => true,
|
'string_emptyallowed' => true,
|
||||||
'default' => '/etc/apache2/apache2.key',
|
'default' => '/etc/apache2/apache2.key',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_ssl_ca_file' => array(
|
'system_ssl_ca_file' => array(
|
||||||
'label' => $lng['serversettings']['ssl']['ssl_ca_file'],
|
'label' => $lng['serversettings']['ssl']['ssl_ca_file'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'ssl_ca_file',
|
'varname' => 'ssl_ca_file',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'file',
|
'string_type' => 'file',
|
||||||
'string_emptyallowed' => true,
|
'string_emptyallowed' => true,
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_ssl_openssl_cnf' => array(
|
'system_ssl_openssl_cnf' => array(
|
||||||
'label' => $lng['serversettings']['ssl']['openssl_cnf'],
|
'label' => $lng['serversettings']['ssl']['openssl_cnf'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'openssl_cnf',
|
'varname' => 'openssl_cnf',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,84 +1,84 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Settings
|
* @package Settings
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'statistics' => array(
|
'statistics' => array(
|
||||||
'title' => $lng['admin']['statisticsettings'],
|
'title' => $lng['admin']['statisticsettings'],
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'system_webalizer_quiet' => array(
|
'system_webalizer_quiet' => array(
|
||||||
'label' => $lng['serversettings']['webalizer_quiet'],
|
'label' => $lng['serversettings']['webalizer_quiet'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'webalizer_quiet',
|
'varname' => 'webalizer_quiet',
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'default' => 2,
|
'default' => 2,
|
||||||
'option_mode' => 'one',
|
'option_mode' => 'one',
|
||||||
'option_options' => array(0 => $lng['admin']['webalizer']['normal'], 1 => $lng['admin']['webalizer']['quiet'], 2 => $lng['admin']['webalizer']['veryquiet']),
|
'option_options' => array(0 => $lng['admin']['webalizer']['normal'], 1 => $lng['admin']['webalizer']['quiet'], 2 => $lng['admin']['webalizer']['veryquiet']),
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_awstats_enabled' => array(
|
'system_awstats_enabled' => array(
|
||||||
'label' => $lng['serversettings']['awstats_enabled'],
|
'label' => $lng['serversettings']['awstats_enabled'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'awstats_enabled',
|
'varname' => 'awstats_enabled',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_awstats_domain_file' => array(
|
'system_awstats_domain_file' => array(
|
||||||
'label' => $lng['serversettings']['awstats_domain_file'],
|
'label' => $lng['serversettings']['awstats_domain_file'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'awstats_domain_file',
|
'varname' => 'awstats_domain_file',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'default' => '/etc/awstats/',
|
'default' => '/etc/awstats/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_awstats_model_file' => array(
|
'system_awstats_model_file' => array(
|
||||||
'label' => $lng['serversettings']['awstats_model_file'],
|
'label' => $lng['serversettings']['awstats_model_file'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'awstats_model_file',
|
'varname' => 'awstats_model_file',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'file',
|
'string_type' => 'file',
|
||||||
'default' => '/etc/awstats/awstats.model.conf.syscp',
|
'default' => '/etc/awstats/awstats.model.conf.syscp',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_awstats_path' => array(
|
'system_awstats_path' => array(
|
||||||
'label' => $lng['serversettings']['awstats_path'],
|
'label' => $lng['serversettings']['awstats_path'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'awstats_path',
|
'varname' => 'awstats_path',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'default' => '/usr/share/awstats/VERSION/webroot/cgi-bin/',
|
'default' => '/usr/share/awstats/VERSION/webroot/cgi-bin/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_awstats_updateall_command' => array(
|
'system_awstats_updateall_command' => array(
|
||||||
'label' => $lng['serversettings']['awstats_updateall_command'],
|
'label' => $lng['serversettings']['awstats_updateall_command'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'awstats_updateall_command',
|
'varname' => 'awstats_updateall_command',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'file',
|
'string_type' => 'file',
|
||||||
'default' => '/usr/bin/awstats_updateall.pl',
|
'default' => '/usr/bin/awstats_updateall.pl',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,97 +1,97 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Settings
|
* @package Settings
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'mail' => array(
|
'mail' => array(
|
||||||
'title' => $lng['admin']['mailserversettings'],
|
'title' => $lng['admin']['mailserversettings'],
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'system_vmail_uid' => array(
|
'system_vmail_uid' => array(
|
||||||
'label' => $lng['serversettings']['vmail_uid'],
|
'label' => $lng['serversettings']['vmail_uid'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'vmail_uid',
|
'varname' => 'vmail_uid',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'default' => 2000,
|
'default' => 2000,
|
||||||
'int_min' => 1,
|
'int_min' => 1,
|
||||||
'int_max' => 65535,
|
'int_max' => 65535,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_vmail_gid' => array(
|
'system_vmail_gid' => array(
|
||||||
'label' => $lng['serversettings']['vmail_gid'],
|
'label' => $lng['serversettings']['vmail_gid'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'vmail_gid',
|
'varname' => 'vmail_gid',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'default' => 2000,
|
'default' => 2000,
|
||||||
'int_min' => 1,
|
'int_min' => 1,
|
||||||
'int_max' => 65535,
|
'int_max' => 65535,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_vmail_homedir' => array(
|
'system_vmail_homedir' => array(
|
||||||
'label' => $lng['serversettings']['vmail_homedir'],
|
'label' => $lng['serversettings']['vmail_homedir'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'vmail_homedir',
|
'varname' => 'vmail_homedir',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'default' => '/var/customers/mail/',
|
'default' => '/var/customers/mail/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'panel_sendalternativemail' => array(
|
'panel_sendalternativemail' => array(
|
||||||
'label' => $lng['serversettings']['sendalternativemail'],
|
'label' => $lng['serversettings']['sendalternativemail'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'sendalternativemail',
|
'varname' => 'sendalternativemail',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_mail_quota_enabled' => array(
|
'system_mail_quota_enabled' => array(
|
||||||
'label' => $lng['serversettings']['mail_quota_enabled'],
|
'label' => $lng['serversettings']['mail_quota_enabled'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'mail_quota_enabled',
|
'varname' => 'mail_quota_enabled',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_mail_quota' => array(
|
'system_mail_quota' => array(
|
||||||
'label' => $lng['serversettings']['mail_quota'],
|
'label' => $lng['serversettings']['mail_quota'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'mail_quota',
|
'varname' => 'mail_quota',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'default' => 100,
|
'default' => 100,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'systen_autoresponder_enabled' => array(
|
'systen_autoresponder_enabled' => array(
|
||||||
'label' => $lng['serversettings']['autoresponder_active'],
|
'label' => $lng['serversettings']['autoresponder_active'],
|
||||||
'settinggroup' => 'autoresponder',
|
'settinggroup' => 'autoresponder',
|
||||||
'varname' => 'autoresponder_active',
|
'varname' => 'autoresponder_active',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'systen_last_autoresponder_run' => array(
|
'systen_last_autoresponder_run' => array(
|
||||||
'settinggroup' => 'autoresponder',
|
'settinggroup' => 'autoresponder',
|
||||||
'varname' => 'last_autoresponder_run',
|
'varname' => 'last_autoresponder_run',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'default' => 0,
|
'default' => 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,67 +1,67 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Settings
|
* @package Settings
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'nameserver' => array(
|
'nameserver' => array(
|
||||||
'title' => $lng['admin']['nameserversettings'],
|
'title' => $lng['admin']['nameserversettings'],
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'system_bindconf_directory' => array(
|
'system_bindconf_directory' => array(
|
||||||
'label' => $lng['serversettings']['bindconf_directory'],
|
'label' => $lng['serversettings']['bindconf_directory'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'bindconf_directory',
|
'varname' => 'bindconf_directory',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'default' => '/etc/bind/',
|
'default' => '/etc/bind/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_bindreload_command' => array(
|
'system_bindreload_command' => array(
|
||||||
'label' => $lng['serversettings']['bindreload_command'],
|
'label' => $lng['serversettings']['bindreload_command'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'bindreload_command',
|
'varname' => 'bindreload_command',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => '/etc/init.d/bind9 reload',
|
'default' => '/etc/init.d/bind9 reload',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_nameservers' => array(
|
'system_nameservers' => array(
|
||||||
'label' => $lng['serversettings']['nameservers'],
|
'label' => $lng['serversettings']['nameservers'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'nameservers',
|
'varname' => 'nameservers',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_regexp' => '/^(([a-z0-9\-\._]+, ?)*[a-z0-9\-\._]+)?$/i',
|
'string_regexp' => '/^(([a-z0-9\-\._]+, ?)*[a-z0-9\-\._]+)?$/i',
|
||||||
'string_emptyallowed' => true,
|
'string_emptyallowed' => true,
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingFieldInsertBindTask',
|
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||||
),
|
),
|
||||||
'system_mxservers' => array(
|
'system_mxservers' => array(
|
||||||
'label' => $lng['serversettings']['mxservers'],
|
'label' => $lng['serversettings']['mxservers'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'mxservers',
|
'varname' => 'mxservers',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_regexp' => '/^(([0-9]+ [a-z0-9\-\._]+, ?)*[0-9]+ [a-z0-9\-\._]+)?$/i',
|
'string_regexp' => '/^(([0-9]+ [a-z0-9\-\._]+, ?)*[0-9]+ [a-z0-9\-\._]+)?$/i',
|
||||||
'string_emptyallowed' => true,
|
'string_emptyallowed' => true,
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,76 +1,76 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Settings
|
* @package Settings
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'logging' => array(
|
'logging' => array(
|
||||||
'title' => $lng['admin']['loggersettings'],
|
'title' => $lng['admin']['loggersettings'],
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'logger_enabled' => array(
|
'logger_enabled' => array(
|
||||||
'label' => $lng['serversettings']['logger']['enable'],
|
'label' => $lng['serversettings']['logger']['enable'],
|
||||||
'settinggroup' => 'logger',
|
'settinggroup' => 'logger',
|
||||||
'varname' => 'enabled',
|
'varname' => 'enabled',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'logger_severity' => array(
|
'logger_severity' => array(
|
||||||
'label' => $lng['serversettings']['logger']['severity'],
|
'label' => $lng['serversettings']['logger']['severity'],
|
||||||
'settinggroup' => 'logger',
|
'settinggroup' => 'logger',
|
||||||
'varname' => 'severity',
|
'varname' => 'severity',
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
'option_mode' => 'one',
|
'option_mode' => 'one',
|
||||||
'option_options' => array(1 => $lng['admin']['logger']['normal'], 2 => $lng['admin']['logger']['paranoid']),
|
'option_options' => array(1 => $lng['admin']['logger']['normal'], 2 => $lng['admin']['logger']['paranoid']),
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'logger_logtypes' => array(
|
'logger_logtypes' => array(
|
||||||
'label' => $lng['serversettings']['logger']['types'],
|
'label' => $lng['serversettings']['logger']['types'],
|
||||||
'settinggroup' => 'logger',
|
'settinggroup' => 'logger',
|
||||||
'varname' => 'logtypes',
|
'varname' => 'logtypes',
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'default' => 'syslog,mysql',
|
'default' => 'syslog,mysql',
|
||||||
'option_mode' => 'multiple',
|
'option_mode' => 'multiple',
|
||||||
'option_options' => array('syslog' => 'syslog', 'file' => 'file', 'mysql' => 'mysql'),
|
'option_options' => array('syslog' => 'syslog', 'file' => 'file', 'mysql' => 'mysql'),
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'logger_logfile' => array(
|
'logger_logfile' => array(
|
||||||
'label' => $lng['serversettings']['logger']['logfile'],
|
'label' => $lng['serversettings']['logger']['logfile'],
|
||||||
'settinggroup' => 'logger',
|
'settinggroup' => 'logger',
|
||||||
'varname' => 'logfile',
|
'varname' => 'logfile',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'file',
|
'string_type' => 'file',
|
||||||
'string_emptyallowed' => true,
|
'string_emptyallowed' => true,
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'logger_log_cron' => array(
|
'logger_log_cron' => array(
|
||||||
'label' => $lng['serversettings']['logger']['logcron'],
|
'label' => $lng['serversettings']['logger']['logcron'],
|
||||||
'settinggroup' => 'logger',
|
'settinggroup' => 'logger',
|
||||||
'varname' => 'log_cron',
|
'varname' => 'log_cron',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,72 +1,72 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Settings
|
* @package Settings
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'dkim' => array(
|
'dkim' => array(
|
||||||
'title' => $lng['admin']['dkimsettings'],
|
'title' => $lng['admin']['dkimsettings'],
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'dkim_enabled' => array(
|
'dkim_enabled' => array(
|
||||||
'label' => $lng['dkim']['use_dkim'],
|
'label' => $lng['dkim']['use_dkim'],
|
||||||
'settinggroup' => 'dkim',
|
'settinggroup' => 'dkim',
|
||||||
'varname' => 'use_dkim',
|
'varname' => 'use_dkim',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'dkim_prefix' => array(
|
'dkim_prefix' => array(
|
||||||
'label' => $lng['dkim']['dkim_prefix'],
|
'label' => $lng['dkim']['dkim_prefix'],
|
||||||
'settinggroup' => 'dkim',
|
'settinggroup' => 'dkim',
|
||||||
'varname' => 'dkim_prefix',
|
'varname' => 'dkim_prefix',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => '/etc/postfix/dkim/',
|
'default' => '/etc/postfix/dkim/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'dkim_domains' => array(
|
'dkim_domains' => array(
|
||||||
'label' => $lng['dkim']['dkim_domains'],
|
'label' => $lng['dkim']['dkim_domains'],
|
||||||
'settinggroup' => 'dkim',
|
'settinggroup' => 'dkim',
|
||||||
'varname' => 'dkim_domains',
|
'varname' => 'dkim_domains',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_regexp' => '/^[a-z0-9\._]+$/i',
|
'string_regexp' => '/^[a-z0-9\._]+$/i',
|
||||||
'default' => 'domains',
|
'default' => 'domains',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'dkim_dkimkeys' => array(
|
'dkim_dkimkeys' => array(
|
||||||
'label' => $lng['dkim']['dkim_dkimkeys'],
|
'label' => $lng['dkim']['dkim_dkimkeys'],
|
||||||
'settinggroup' => 'dkim',
|
'settinggroup' => 'dkim',
|
||||||
'varname' => 'dkim_dkimkeys',
|
'varname' => 'dkim_dkimkeys',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_regexp' => '/^[a-z0-9\._]+$/i',
|
'string_regexp' => '/^[a-z0-9\._]+$/i',
|
||||||
'default' => 'dkim-keys.conf',
|
'default' => 'dkim-keys.conf',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'dkimrestart_command' => array(
|
'dkimrestart_command' => array(
|
||||||
'label' => $lng['dkim']['dkimrestart_command'],
|
'label' => $lng['dkim']['dkimrestart_command'],
|
||||||
'settinggroup' => 'dkim',
|
'settinggroup' => 'dkim',
|
||||||
'varname' => 'dkimrestart_command',
|
'varname' => 'dkimrestart_command',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => '/etc/init.d/dkim-filter restart',
|
'default' => '/etc/init.d/dkim-filter restart',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,131 +1,131 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Settings
|
* @package Settings
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'ticket' => array(
|
'ticket' => array(
|
||||||
'title' => $lng['admin']['ticketsettings'],
|
'title' => $lng['admin']['ticketsettings'],
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'ticket_enabled' => array(
|
'ticket_enabled' => array(
|
||||||
'label' => $lng['serversettings']['ticket']['enable'],
|
'label' => $lng['serversettings']['ticket']['enable'],
|
||||||
'settinggroup' => 'ticket',
|
'settinggroup' => 'ticket',
|
||||||
'varname' => 'enabled',
|
'varname' => 'enabled',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'ticket_noreply_email' => array(
|
'ticket_noreply_email' => array(
|
||||||
'label' => $lng['serversettings']['ticket']['noreply_email'],
|
'label' => $lng['serversettings']['ticket']['noreply_email'],
|
||||||
'settinggroup' => 'ticket',
|
'settinggroup' => 'ticket',
|
||||||
'varname' => 'noreply_email',
|
'varname' => 'noreply_email',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'mail',
|
'string_type' => 'mail',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'ticket_noreply_name' => array(
|
'ticket_noreply_name' => array(
|
||||||
'label' => $lng['serversettings']['ticket']['noreply_name'],
|
'label' => $lng['serversettings']['ticket']['noreply_name'],
|
||||||
'settinggroup' => 'ticket',
|
'settinggroup' => 'ticket',
|
||||||
'varname' => 'noreply_name',
|
'varname' => 'noreply_name',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'ticket_reset_cycle' => array(
|
'ticket_reset_cycle' => array(
|
||||||
'label' => $lng['serversettings']['ticket']['reset_cycle'],
|
'label' => $lng['serversettings']['ticket']['reset_cycle'],
|
||||||
'settinggroup' => 'ticket',
|
'settinggroup' => 'ticket',
|
||||||
'varname' => 'reset_cycle',
|
'varname' => 'reset_cycle',
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
'option_mode' => 'one',
|
'option_mode' => 'one',
|
||||||
'option_options' => array(0 => html_entity_decode($lng['admin']['tickets']['daily']), 1 => html_entity_decode($lng['admin']['tickets']['weekly']), 2 => html_entity_decode($lng['admin']['tickets']['monthly']), 3 => html_entity_decode($lng['admin']['tickets']['yearly'])),
|
'option_options' => array(0 => html_entity_decode($lng['admin']['tickets']['daily']), 1 => html_entity_decode($lng['admin']['tickets']['weekly']), 2 => html_entity_decode($lng['admin']['tickets']['monthly']), 3 => html_entity_decode($lng['admin']['tickets']['yearly'])),
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'ticket_concurrently_open' => array(
|
'ticket_concurrently_open' => array(
|
||||||
'label' => $lng['serversettings']['ticket']['concurrentlyopen'],
|
'label' => $lng['serversettings']['ticket']['concurrentlyopen'],
|
||||||
'settinggroup' => 'ticket',
|
'settinggroup' => 'ticket',
|
||||||
'varname' => 'concurrently_open',
|
'varname' => 'concurrently_open',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'default' => 5,
|
'default' => 5,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'ticket_archiving_days' => array(
|
'ticket_archiving_days' => array(
|
||||||
'label' => $lng['serversettings']['ticket']['archiving_days'],
|
'label' => $lng['serversettings']['ticket']['archiving_days'],
|
||||||
'settinggroup' => 'ticket',
|
'settinggroup' => 'ticket',
|
||||||
'varname' => 'archiving_days',
|
'varname' => 'archiving_days',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'int_min' => 1,
|
'int_min' => 1,
|
||||||
'int_max' => 99,
|
'int_max' => 99,
|
||||||
'default' => 5,
|
'default' => 5,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'ticket_worktime_all' => array(
|
'ticket_worktime_all' => array(
|
||||||
'label' => $lng['serversettings']['ticket']['worktime_all'],
|
'label' => $lng['serversettings']['ticket']['worktime_all'],
|
||||||
'settinggroup' => 'ticket',
|
'settinggroup' => 'ticket',
|
||||||
'varname' => 'worktime_all',
|
'varname' => 'worktime_all',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'ticket_worktime_begin' => array(
|
'ticket_worktime_begin' => array(
|
||||||
'label' => $lng['serversettings']['ticket']['worktime_begin'],
|
'label' => $lng['serversettings']['ticket']['worktime_begin'],
|
||||||
'settinggroup' => 'ticket',
|
'settinggroup' => 'ticket',
|
||||||
'varname' => 'worktime_begin',
|
'varname' => 'worktime_begin',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_regexp' => '/^[012][0-9]:[0-6][0-9]$/',
|
'string_regexp' => '/^[012][0-9]:[0-6][0-9]$/',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'ticket_worktime_end' => array(
|
'ticket_worktime_end' => array(
|
||||||
'label' => $lng['serversettings']['ticket']['worktime_end'],
|
'label' => $lng['serversettings']['ticket']['worktime_end'],
|
||||||
'settinggroup' => 'ticket',
|
'settinggroup' => 'ticket',
|
||||||
'varname' => 'worktime_end',
|
'varname' => 'worktime_end',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_regexp' => '/^[012][0-9]:[0-6][0-9]$/',
|
'string_regexp' => '/^[012][0-9]:[0-6][0-9]$/',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'ticket_worktime_sat' => array(
|
'ticket_worktime_sat' => array(
|
||||||
'label' => $lng['serversettings']['ticket']['worktime_sat'],
|
'label' => $lng['serversettings']['ticket']['worktime_sat'],
|
||||||
'settinggroup' => 'ticket',
|
'settinggroup' => 'ticket',
|
||||||
'varname' => 'worktime_sat',
|
'varname' => 'worktime_sat',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'ticket_worktime_sun' => array(
|
'ticket_worktime_sun' => array(
|
||||||
'label' => $lng['serversettings']['ticket']['worktime_sun'],
|
'label' => $lng['serversettings']['ticket']['worktime_sun'],
|
||||||
'settinggroup' => 'ticket',
|
'settinggroup' => 'ticket',
|
||||||
'varname' => 'worktime_sun',
|
'varname' => 'worktime_sun',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_last_archive_run' => array(
|
'system_last_archive_run' => array(
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'last_archive_run',
|
'varname' => 'last_archive_run',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,100 +1,100 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Settings
|
* @package Settings
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'aps' => array(
|
'aps' => array(
|
||||||
'title' => $lng['admin']['aps'],
|
'title' => $lng['admin']['aps'],
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'aps_enable' => array(
|
'aps_enable' => array(
|
||||||
'label' => $lng['aps']['activate_aps'],
|
'label' => $lng['aps']['activate_aps'],
|
||||||
'settinggroup' => 'aps',
|
'settinggroup' => 'aps',
|
||||||
'varname' => 'aps_active',
|
'varname' => 'aps_active',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'aps_items_per_page' => array(
|
'aps_items_per_page' => array(
|
||||||
'label' => $lng['aps']['packages_per_page'],
|
'label' => $lng['aps']['packages_per_page'],
|
||||||
'settinggroup' => 'aps',
|
'settinggroup' => 'aps',
|
||||||
'varname' => 'items_per_page',
|
'varname' => 'items_per_page',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'default' => 20,
|
'default' => 20,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'aps_upload_fields' => array(
|
'aps_upload_fields' => array(
|
||||||
'label' => $lng['aps']['upload_fields'],
|
'label' => $lng['aps']['upload_fields'],
|
||||||
'settinggroup' => 'aps',
|
'settinggroup' => 'aps',
|
||||||
'varname' => 'upload_fields',
|
'varname' => 'upload_fields',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'default' => 5,
|
'default' => 5,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'aps_exceptions' => array(
|
'aps_exceptions' => array(
|
||||||
'label' => $lng['aps']['exceptions'],
|
'label' => $lng['aps']['exceptions'],
|
||||||
'type' => 'label',
|
'type' => 'label',
|
||||||
),
|
),
|
||||||
'aps_php-extension' => array(
|
'aps_php-extension' => array(
|
||||||
'label' => $lng['aps']['settings_php_extensions'],
|
'label' => $lng['aps']['settings_php_extensions'],
|
||||||
'settinggroup' => 'aps',
|
'settinggroup' => 'aps',
|
||||||
'varname' => 'php-extension',
|
'varname' => 'php-extension',
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'option_mode' => 'multiple',
|
'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'),
|
||||||
'save_method' => 'storeSettingApsPhpExtensions',
|
'save_method' => 'storeSettingApsPhpExtensions',
|
||||||
),
|
),
|
||||||
'aps_php-function' => array(
|
'aps_php-function' => array(
|
||||||
'settinggroup' => 'aps',
|
'settinggroup' => 'aps',
|
||||||
'varname' => 'php-function',
|
'varname' => 'php-function',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
),
|
),
|
||||||
'aps_php-configuration' => array(
|
'aps_php-configuration' => array(
|
||||||
'label' => $lng['aps']['settings_php_configuration'],
|
'label' => $lng['aps']['settings_php_configuration'],
|
||||||
'settinggroup' => 'aps',
|
'settinggroup' => 'aps',
|
||||||
'varname' => 'php-configuration',
|
'varname' => 'php-configuration',
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'option_mode' => 'multiple',
|
'option_mode' => 'multiple',
|
||||||
'option_options' => array('short_open_tag' => 'short_open_tag', 'file_uploads' => 'file_uploads', 'magic_quotes_gpc' => 'magic_quotes_gpc', 'register_globals' => 'register_globals', 'allow_url_fopen' => 'allow_url_fopen', 'safe_mode' => 'safe_mode', 'post_max_size' => 'post_max_size', 'memory_limit' => 'memory_limit', 'max_execution_time' => 'max_execution_time'),
|
'option_options' => array('short_open_tag' => 'short_open_tag', 'file_uploads' => 'file_uploads', 'magic_quotes_gpc' => 'magic_quotes_gpc', 'register_globals' => 'register_globals', 'allow_url_fopen' => 'allow_url_fopen', 'safe_mode' => 'safe_mode', 'post_max_size' => 'post_max_size', 'memory_limit' => 'memory_limit', 'max_execution_time' => 'max_execution_time'),
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'aps_webserver-module' => array(
|
'aps_webserver-module' => array(
|
||||||
'label' => $lng['aps']['settings_webserver_modules'],
|
'label' => $lng['aps']['settings_webserver_modules'],
|
||||||
'settinggroup' => 'aps',
|
'settinggroup' => 'aps',
|
||||||
'varname' => 'webserver-module',
|
'varname' => 'webserver-module',
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'option_mode' => 'multiple',
|
'option_mode' => 'multiple',
|
||||||
'option_options' => array('mod_perl' => 'mod_perl', 'mod_rewrite' => 'mod_rewrite', 'mod_access' => 'mod_access', 'fcgid-any' => 'FastCGI/mod_fcgid', 'htaccess' => '.htaccess'),
|
'option_options' => array('mod_perl' => 'mod_perl', 'mod_rewrite' => 'mod_rewrite', 'mod_access' => 'mod_access', 'fcgid-any' => 'FastCGI/mod_fcgid', 'htaccess' => '.htaccess'),
|
||||||
'save_method' => 'storeSettingApsWebserverModules',
|
'save_method' => 'storeSettingApsWebserverModules',
|
||||||
),
|
),
|
||||||
'aps_webserver-htaccess' => array(
|
'aps_webserver-htaccess' => array(
|
||||||
'settinggroup' => 'aps',
|
'settinggroup' => 'aps',
|
||||||
'varname' => 'webserver-htaccess',
|
'varname' => 'webserver-htaccess',
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,108 +1,108 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Settings
|
* @package Settings
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'groups' => array(
|
'groups' => array(
|
||||||
'security' => array(
|
'security' => array(
|
||||||
'title' => $lng['admin']['security_settings'],
|
'title' => $lng['admin']['security_settings'],
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'panel_unix_names' => array(
|
'panel_unix_names' => array(
|
||||||
'label' => $lng['serversettings']['unix_names'],
|
'label' => $lng['serversettings']['unix_names'],
|
||||||
'settinggroup' => 'panel',
|
'settinggroup' => 'panel',
|
||||||
'varname' => 'unix_names',
|
'varname' => 'unix_names',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => true,
|
'default' => true,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_mailpwcleartext' => array(
|
'system_mailpwcleartext' => array(
|
||||||
'label' => $lng['serversettings']['mailpwcleartext'],
|
'label' => $lng['serversettings']['mailpwcleartext'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'mailpwcleartext',
|
'varname' => 'mailpwcleartext',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => true,
|
'default' => true,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_mod_fcgid_enabled' => array(
|
'system_mod_fcgid_enabled' => array(
|
||||||
'label' => $lng['serversettings']['mod_fcgid'],
|
'label' => $lng['serversettings']['mod_fcgid'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'mod_fcgid',
|
'varname' => 'mod_fcgid',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_mod_fcgid_configdir' => array(
|
'system_mod_fcgid_configdir' => array(
|
||||||
'label' => $lng['serversettings']['mod_fcgid']['configdir'],
|
'label' => $lng['serversettings']['mod_fcgid']['configdir'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'mod_fcgid_configdir',
|
'varname' => 'mod_fcgid_configdir',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'default' => '/var/www/php-fcgi-scripts/',
|
'default' => '/var/www/php-fcgi-scripts/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_mod_fcgid_tmpdir' => array(
|
'system_mod_fcgid_tmpdir' => array(
|
||||||
'label' => $lng['serversettings']['mod_fcgid']['tmpdir'],
|
'label' => $lng['serversettings']['mod_fcgid']['tmpdir'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'mod_fcgid_tmpdir',
|
'varname' => 'mod_fcgid_tmpdir',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'default' => '/var/customers/tmp/',
|
'default' => '/var/customers/tmp/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_mod_fcgid_peardir' => array(
|
'system_mod_fcgid_peardir' => array(
|
||||||
'label' => $lng['serversettings']['mod_fcgid']['peardir'],
|
'label' => $lng['serversettings']['mod_fcgid']['peardir'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'mod_fcgid_peardir',
|
'varname' => 'mod_fcgid_peardir',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
'string_delimiter' => ':',
|
'string_delimiter' => ':',
|
||||||
'string_emptyallowed' => true,
|
'string_emptyallowed' => true,
|
||||||
'default' => '/usr/share/php/:/usr/share/php5/',
|
'default' => '/usr/share/php/:/usr/share/php5/',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_mod_fcgid_wrapper' => array(
|
'system_mod_fcgid_wrapper' => array(
|
||||||
'label' => $lng['serversettings']['mod_fcgid']['wrapper'],
|
'label' => $lng['serversettings']['mod_fcgid']['wrapper'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'mod_fcgid_wrapper',
|
'varname' => 'mod_fcgid_wrapper',
|
||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'option_options' => array(0 => 'ScriptAlias', 1=> 'FCGIWrapper'),
|
'option_options' => array(0 => 'ScriptAlias', 1=> 'FCGIWrapper'),
|
||||||
'default' => 0,
|
'default' => 0,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_mod_fcgid_starter' => array(
|
'system_mod_fcgid_starter' => array(
|
||||||
'label' => $lng['serversettings']['mod_fcgid']['starter'],
|
'label' => $lng['serversettings']['mod_fcgid']['starter'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'mod_fcgid_starter',
|
'varname' => 'mod_fcgid_starter',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'default' => 0,
|
'default' => 0,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
'system_mod_fcgid_maxrequests' => array(
|
'system_mod_fcgid_maxrequests' => array(
|
||||||
'label' => $lng['serversettings']['mod_fcgid']['maxrequests'],
|
'label' => $lng['serversettings']['mod_fcgid']['maxrequests'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'mod_fcgid_maxrequests',
|
'varname' => 'mod_fcgid_maxrequests',
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'default' => 250,
|
'default' => 250,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
1480
admin_admins.php
1480
admin_admins.php
File diff suppressed because it is too large
Load Diff
@@ -1,181 +1,181 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Panel
|
* @package Panel
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('AREA', 'admin');
|
define('AREA', 'admin');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include our init.php, which manages Sessions, Language etc.
|
* Include our init.php, which manages Sessions, Language etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$need_db_sql_data = true;
|
$need_db_sql_data = true;
|
||||||
require ("./lib/init.php");
|
require ("./lib/init.php");
|
||||||
require ("./lib/configfiles_index.inc.php");
|
require ("./lib/configfiles_index.inc.php");
|
||||||
$distribution = '';
|
$distribution = '';
|
||||||
$distributions_select = '';
|
$distributions_select = '';
|
||||||
$service = '';
|
$service = '';
|
||||||
$services_select = '';
|
$services_select = '';
|
||||||
$daemon = '';
|
$daemon = '';
|
||||||
$daemons_select = '';
|
$daemons_select = '';
|
||||||
|
|
||||||
if($userinfo['change_serversettings'] == '1')
|
if($userinfo['change_serversettings'] == '1')
|
||||||
{
|
{
|
||||||
if(isset($_GET['distribution'])
|
if(isset($_GET['distribution'])
|
||||||
&& $_GET['distribution'] != ''
|
&& $_GET['distribution'] != ''
|
||||||
&& isset($configfiles[$_GET['distribution']])
|
&& isset($configfiles[$_GET['distribution']])
|
||||||
&& is_array($configfiles[$_GET['distribution']]))
|
&& is_array($configfiles[$_GET['distribution']]))
|
||||||
{
|
{
|
||||||
$distribution = $_GET['distribution'];
|
$distribution = $_GET['distribution'];
|
||||||
|
|
||||||
if(isset($_GET['service'])
|
if(isset($_GET['service'])
|
||||||
&& $_GET['service'] != ''
|
&& $_GET['service'] != ''
|
||||||
&& isset($configfiles[$distribution]['services'][$_GET['service']])
|
&& isset($configfiles[$distribution]['services'][$_GET['service']])
|
||||||
&& is_array($configfiles[$distribution]['services'][$_GET['service']]))
|
&& is_array($configfiles[$distribution]['services'][$_GET['service']]))
|
||||||
{
|
{
|
||||||
$service = $_GET['service'];
|
$service = $_GET['service'];
|
||||||
|
|
||||||
if(isset($_GET['daemon'])
|
if(isset($_GET['daemon'])
|
||||||
&& $_GET['daemon'] != ''
|
&& $_GET['daemon'] != ''
|
||||||
&& isset($configfiles[$distribution]['services'][$service]['daemons'][$_GET['daemon']])
|
&& isset($configfiles[$distribution]['services'][$service]['daemons'][$_GET['daemon']])
|
||||||
&& is_array($configfiles[$distribution]['services'][$service]['daemons'][$_GET['daemon']]))
|
&& is_array($configfiles[$distribution]['services'][$service]['daemons'][$_GET['daemon']]))
|
||||||
{
|
{
|
||||||
$daemon = $_GET['daemon'];
|
$daemon = $_GET['daemon'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach($configfiles[$distribution]['services'][$service]['daemons'] as $daemon_name => $daemon_details)
|
foreach($configfiles[$distribution]['services'][$service]['daemons'] as $daemon_name => $daemon_details)
|
||||||
{
|
{
|
||||||
$daemons_select.= makeoption($daemon_details['label'], $daemon_name);
|
$daemons_select.= makeoption($daemon_details['label'], $daemon_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach($configfiles[$distribution]['services'] as $service_name => $service_details)
|
foreach($configfiles[$distribution]['services'] as $service_name => $service_details)
|
||||||
{
|
{
|
||||||
$services_select.= makeoption($service_details['label'], $service_name);
|
$services_select.= makeoption($service_details['label'], $service_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach($configfiles as $distribution_name => $distribution_details)
|
foreach($configfiles as $distribution_name => $distribution_details)
|
||||||
{
|
{
|
||||||
$distributions_select.= makeoption($distribution_details['label'], $distribution_name);
|
$distributions_select.= makeoption($distribution_details['label'], $distribution_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($distribution != ''
|
if($distribution != ''
|
||||||
&& $service != ''
|
&& $service != ''
|
||||||
&& $daemon != '')
|
&& $daemon != '')
|
||||||
{
|
{
|
||||||
$replace_arr = Array(
|
$replace_arr = Array(
|
||||||
'<SQL_UNPRIVILEGED_USER>' => $sql['user'],
|
'<SQL_UNPRIVILEGED_USER>' => $sql['user'],
|
||||||
'<SQL_UNPRIVILEGED_PASSWORD>' => 'MYSQL_PASSWORD',
|
'<SQL_UNPRIVILEGED_PASSWORD>' => 'MYSQL_PASSWORD',
|
||||||
'<SQL_DB>' => $sql['db'],
|
'<SQL_DB>' => $sql['db'],
|
||||||
'<SQL_HOST>' => $sql['host'],
|
'<SQL_HOST>' => $sql['host'],
|
||||||
'<SERVERNAME>' => $settings['system']['hostname'],
|
'<SERVERNAME>' => $settings['system']['hostname'],
|
||||||
'<SERVERIP>' => $settings['system']['ipaddress'],
|
'<SERVERIP>' => $settings['system']['ipaddress'],
|
||||||
'<NAMESERVERS>' => $settings['system']['nameservers'],
|
'<NAMESERVERS>' => $settings['system']['nameservers'],
|
||||||
'<VIRTUAL_MAILBOX_BASE>' => $settings['system']['vmail_homedir'],
|
'<VIRTUAL_MAILBOX_BASE>' => $settings['system']['vmail_homedir'],
|
||||||
'<VIRTUAL_UID_MAPS>' => $settings['system']['vmail_uid'],
|
'<VIRTUAL_UID_MAPS>' => $settings['system']['vmail_uid'],
|
||||||
'<VIRTUAL_GID_MAPS>' => $settings['system']['vmail_gid'],
|
'<VIRTUAL_GID_MAPS>' => $settings['system']['vmail_gid'],
|
||||||
'<AWSTATS_PATH>' => $settings['system']['awstats_path'],
|
'<AWSTATS_PATH>' => $settings['system']['awstats_path'],
|
||||||
'<SSLPROTOCOLS>' => ($settings['system']['use_ssl'] == '1') ? 'imaps pop3s' : '',
|
'<SSLPROTOCOLS>' => ($settings['system']['use_ssl'] == '1') ? 'imaps pop3s' : '',
|
||||||
'<REALTIME_PORT>' => $settings['system']['realtime_port']
|
'<REALTIME_PORT>' => $settings['system']['realtime_port']
|
||||||
);
|
);
|
||||||
$files = '';
|
$files = '';
|
||||||
$configpage = '';
|
$configpage = '';
|
||||||
foreach($configfiles[$distribution]['services'][$service]['daemons'][$daemon] as $action => $value)
|
foreach($configfiles[$distribution]['services'][$service]['daemons'][$daemon] as $action => $value)
|
||||||
{
|
{
|
||||||
if(substr($action, 0, 8) == 'commands')
|
if(substr($action, 0, 8) == 'commands')
|
||||||
{
|
{
|
||||||
$commands = '';
|
$commands = '';
|
||||||
|
|
||||||
if(is_array($value))
|
if(is_array($value))
|
||||||
{
|
{
|
||||||
$commands = implode("\n", $value);
|
$commands = implode("\n", $value);
|
||||||
|
|
||||||
if($commands != '')
|
if($commands != '')
|
||||||
{
|
{
|
||||||
eval("\$configpage.=\"" . getTemplate("configfiles/configfiles_commands") . "\";");
|
eval("\$configpage.=\"" . getTemplate("configfiles/configfiles_commands") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif(substr($action, 0, 5) == 'files')
|
elseif(substr($action, 0, 5) == 'files')
|
||||||
{
|
{
|
||||||
$files = '';
|
$files = '';
|
||||||
|
|
||||||
if(is_array($value))
|
if(is_array($value))
|
||||||
{
|
{
|
||||||
while(list($filename, $realname) = each($value))
|
while(list($filename, $realname) = each($value))
|
||||||
{
|
{
|
||||||
$file_content = file_get_contents('./templates/misc/configfiles/' . $distribution . '/' . $daemon . '/' . $filename);
|
$file_content = file_get_contents('./templates/misc/configfiles/' . $distribution . '/' . $daemon . '/' . $filename);
|
||||||
$file_content = strtr($file_content, $replace_arr);
|
$file_content = strtr($file_content, $replace_arr);
|
||||||
$file_content = htmlspecialchars($file_content);
|
$file_content = htmlspecialchars($file_content);
|
||||||
$numbrows = count(explode("\n", $file_content));
|
$numbrows = count(explode("\n", $file_content));
|
||||||
eval("\$files.=\"" . getTemplate("configfiles/configfiles_file") . "\";");
|
eval("\$files.=\"" . getTemplate("configfiles/configfiles_file") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("\$configpage.=\"" . getTemplate("configfiles/configfiles_files") . "\";");
|
eval("\$configpage.=\"" . getTemplate("configfiles/configfiles_files") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($configfiles[$distribution]['services'][$service]['daemons'][$daemon]['restart'])
|
if(isset($configfiles[$distribution]['services'][$service]['daemons'][$daemon]['restart'])
|
||||||
&& is_array($configfiles[$distribution]['services'][$service]['daemons'][$daemon]['restart']))
|
&& is_array($configfiles[$distribution]['services'][$service]['daemons'][$daemon]['restart']))
|
||||||
{
|
{
|
||||||
$restart = implode("\n", $configfiles[$distribution]['services'][$service]['daemons'][$daemon]['restart']);
|
$restart = implode("\n", $configfiles[$distribution]['services'][$service]['daemons'][$daemon]['restart']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$restart = '';
|
$restart = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("configfiles/configfiles") . "\";");
|
eval("echo \"" . getTemplate("configfiles/configfiles") . "\";");
|
||||||
}
|
}
|
||||||
elseif($page == 'overview')
|
elseif($page == 'overview')
|
||||||
{
|
{
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_configfiles");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_configfiles");
|
||||||
$distributions = '';
|
$distributions = '';
|
||||||
foreach($configfiles as $distribution_name => $distribution_details)
|
foreach($configfiles as $distribution_name => $distribution_details)
|
||||||
{
|
{
|
||||||
$services = '';
|
$services = '';
|
||||||
foreach($distribution_details['services'] as $service_name => $service_details)
|
foreach($distribution_details['services'] as $service_name => $service_details)
|
||||||
{
|
{
|
||||||
$daemons = '';
|
$daemons = '';
|
||||||
foreach($service_details['daemons'] as $daemon_name => $daemon_details)
|
foreach($service_details['daemons'] as $daemon_name => $daemon_details)
|
||||||
{
|
{
|
||||||
eval("\$daemons.=\"" . getTemplate("configfiles/choose_daemon") . "\";");
|
eval("\$daemons.=\"" . getTemplate("configfiles/choose_daemon") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("\$services.=\"" . getTemplate("configfiles/choose_service") . "\";");
|
eval("\$services.=\"" . getTemplate("configfiles/choose_service") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("\$distributions.=\"" . getTemplate("configfiles/choose_distribution") . "\";");
|
eval("\$distributions.=\"" . getTemplate("configfiles/choose_distribution") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("configfiles/choose") . "\";");
|
eval("echo \"" . getTemplate("configfiles/choose") . "\";");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
eval("echo \"" . getTemplate("configfiles/wizard") . "\";");
|
eval("echo \"" . getTemplate("configfiles/wizard") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Panel
|
* @package Panel
|
||||||
* @version $Id: $
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('AREA', 'admin');
|
define('AREA', 'admin');
|
||||||
|
|||||||
2248
admin_domains.php
2248
admin_domains.php
File diff suppressed because it is too large
Load Diff
592
admin_index.php
592
admin_index.php
@@ -1,296 +1,296 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Panel
|
* @package Panel
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('AREA', 'admin');
|
define('AREA', 'admin');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include our init.php, which manages Sessions, Language etc.
|
* Include our init.php, which manages Sessions, Language etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ("./lib/init.php");
|
require ("./lib/init.php");
|
||||||
|
|
||||||
if($action == 'logout')
|
if($action == 'logout')
|
||||||
{
|
{
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "logged out");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "logged out");
|
||||||
|
|
||||||
if($settings['session']['allow_multiple_login'] == '1')
|
if($settings['session']['allow_multiple_login'] == '1')
|
||||||
{
|
{
|
||||||
$db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['adminid'] . "' AND `adminsession` = '1' AND `hash` = '" . $s . "'");
|
$db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['adminid'] . "' AND `adminsession` = '1' AND `hash` = '" . $s . "'");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['adminid'] . "' AND `adminsession` = '1'");
|
$db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['adminid'] . "' AND `adminsession` = '1'");
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectTo('index.php');
|
redirectTo('index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['id']))
|
if(isset($_POST['id']))
|
||||||
{
|
{
|
||||||
$id = intval($_POST['id']);
|
$id = intval($_POST['id']);
|
||||||
}
|
}
|
||||||
elseif(isset($_GET['id']))
|
elseif(isset($_GET['id']))
|
||||||
{
|
{
|
||||||
$id = intval($_GET['id']);
|
$id = intval($_GET['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($page == 'overview')
|
if($page == 'overview')
|
||||||
{
|
{
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_index");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_index");
|
||||||
$overview = $db->query_first("SELECT COUNT(*) AS `number_customers`,
|
$overview = $db->query_first("SELECT COUNT(*) AS `number_customers`,
|
||||||
SUM(`diskspace_used`) AS `diskspace_used`,
|
SUM(`diskspace_used`) AS `diskspace_used`,
|
||||||
SUM(`mysqls_used`) AS `mysqls_used`,
|
SUM(`mysqls_used`) AS `mysqls_used`,
|
||||||
SUM(`emails_used`) AS `emails_used`,
|
SUM(`emails_used`) AS `emails_used`,
|
||||||
SUM(`email_accounts_used`) AS `email_accounts_used`,
|
SUM(`email_accounts_used`) AS `email_accounts_used`,
|
||||||
SUM(`email_forwarders_used`) AS `email_forwarders_used`,
|
SUM(`email_forwarders_used`) AS `email_forwarders_used`,
|
||||||
SUM(`email_quota_used`) AS `email_quota_used`,
|
SUM(`email_quota_used`) AS `email_quota_used`,
|
||||||
SUM(`ftps_used`) AS `ftps_used`,
|
SUM(`ftps_used`) AS `ftps_used`,
|
||||||
SUM(`tickets_used`) AS `tickets_used`,
|
SUM(`tickets_used`) AS `tickets_used`,
|
||||||
SUM(`subdomains_used`) AS `subdomains_used`,
|
SUM(`subdomains_used`) AS `subdomains_used`,
|
||||||
SUM(`traffic_used`) AS `traffic_used`,
|
SUM(`traffic_used`) AS `traffic_used`,
|
||||||
SUM(`aps_packages_used`) AS `aps_packages_used`
|
SUM(`aps_packages_used`) AS `aps_packages_used`
|
||||||
FROM `" . TABLE_PANEL_CUSTOMERS . "`" . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int)$userinfo['adminid'] . "' "));
|
FROM `" . TABLE_PANEL_CUSTOMERS . "`" . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int)$userinfo['adminid'] . "' "));
|
||||||
$overview['traffic_used'] = round($overview['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
$overview['traffic_used'] = round($overview['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||||
$overview['diskspace_used'] = round($overview['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
|
$overview['diskspace_used'] = round($overview['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
|
||||||
$number_domains = $db->query_first("SELECT COUNT(*) AS `number_domains` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `parentdomainid`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = '" . (int)$userinfo['adminid'] . "' "));
|
$number_domains = $db->query_first("SELECT COUNT(*) AS `number_domains` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `parentdomainid`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = '" . (int)$userinfo['adminid'] . "' "));
|
||||||
$overview['number_domains'] = $number_domains['number_domains'];
|
$overview['number_domains'] = $number_domains['number_domains'];
|
||||||
$phpversion = phpversion();
|
$phpversion = phpversion();
|
||||||
$phpmemorylimit = @ini_get("memory_limit");
|
$phpmemorylimit = @ini_get("memory_limit");
|
||||||
|
|
||||||
if($phpmemorylimit == "")
|
if($phpmemorylimit == "")
|
||||||
{
|
{
|
||||||
$phpmemorylimit = $lng['admin']['memorylimitdisabled'];
|
$phpmemorylimit = $lng['admin']['memorylimitdisabled'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$mysqlserverversion = mysql_get_server_info();
|
$mysqlserverversion = mysql_get_server_info();
|
||||||
$mysqlclientversion = mysql_get_client_info();
|
$mysqlclientversion = mysql_get_client_info();
|
||||||
$webserverinterface = strtoupper(@php_sapi_name());
|
$webserverinterface = strtoupper(@php_sapi_name());
|
||||||
|
|
||||||
if((isset($_GET['lookfornewversion']) && $_GET['lookfornewversion'] == 'yes')
|
if((isset($_GET['lookfornewversion']) && $_GET['lookfornewversion'] == 'yes')
|
||||||
|| (isset($lookfornewversion) && $lookfornewversion == 'yes'))
|
|| (isset($lookfornewversion) && $lookfornewversion == 'yes'))
|
||||||
{
|
{
|
||||||
$latestversion = @file('http://version.froxlor.org/legacy/' . $version);
|
$latestversion = @file('http://version.froxlor.org/legacy/' . $version);
|
||||||
|
|
||||||
if(is_array($latestversion)
|
if(is_array($latestversion)
|
||||||
&& count($latestversion) >= 2)
|
&& count($latestversion) >= 2)
|
||||||
{
|
{
|
||||||
$lookfornewversion_lable = $latestversion[0];
|
$lookfornewversion_lable = $latestversion[0];
|
||||||
$lookfornewversion_link = $latestversion[1];
|
$lookfornewversion_link = $latestversion[1];
|
||||||
$lookfornewversion_addinfo = '';
|
$lookfornewversion_addinfo = '';
|
||||||
|
|
||||||
if(count($latestversion) >= 3)
|
if(count($latestversion) >= 3)
|
||||||
{
|
{
|
||||||
$addinfo = $latestversion;
|
$addinfo = $latestversion;
|
||||||
unset($addinfo[0]);
|
unset($addinfo[0]);
|
||||||
unset($addinfo[1]);
|
unset($addinfo[1]);
|
||||||
$lookfornewversion_addinfo = implode("\n", $addinfo);
|
$lookfornewversion_addinfo = implode("\n", $addinfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
redirectTo('http://version.froxlor.org/legacy/' . $version . '/pretty', NULL);
|
redirectTo('http://version.froxlor.org/legacy/' . $version . '/pretty', NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$lookfornewversion_lable = $lng['admin']['lookfornewversion']['clickhere'];
|
$lookfornewversion_lable = $lng['admin']['lookfornewversion']['clickhere'];
|
||||||
$lookfornewversion_link = htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
|
$lookfornewversion_link = htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
|
||||||
$lookfornewversion_addinfo = '';
|
$lookfornewversion_addinfo = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, $settings['panel']['decimal_places']);
|
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, $settings['panel']['decimal_places']);
|
||||||
$userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
|
$userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
|
||||||
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||||
$userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps tickets subdomains aps_packages');
|
$userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps tickets subdomains aps_packages');
|
||||||
|
|
||||||
if($settings['system']['last_tasks_run'] == 0)
|
if($settings['system']['last_tasks_run'] == 0)
|
||||||
{
|
{
|
||||||
$cronlastrun = $lng['cronjobs']['notyetrun'];
|
$cronlastrun = $lng['cronjobs']['notyetrun'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$cronlastrun = date("d.m.Y H:i:s", $settings['system']['last_tasks_run']);
|
$cronlastrun = date("d.m.Y H:i:s", $settings['system']['last_tasks_run']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['system']['last_traffic_run'] == 0)
|
if($settings['system']['last_traffic_run'] == 0)
|
||||||
{
|
{
|
||||||
$trafficlastrun = $lng['cronjobs']['notyetrun'];
|
$trafficlastrun = $lng['cronjobs']['notyetrun'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$trafficlastrun = date("d.m.Y H:i:s", $settings['system']['last_traffic_run']);
|
$trafficlastrun = date("d.m.Y H:i:s", $settings['system']['last_traffic_run']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['system']['last_archive_run'] == 0)
|
if($settings['system']['last_archive_run'] == 0)
|
||||||
{
|
{
|
||||||
$archivelastrun = $lng['cronjobs']['notyetrun'];
|
$archivelastrun = $lng['cronjobs']['notyetrun'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$archivelastrun = date("d.m.Y H:i:s", $settings['system']['last_archive_run']);
|
$archivelastrun = date("d.m.Y H:i:s", $settings['system']['last_archive_run']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$opentickets = 0;
|
$opentickets = 0;
|
||||||
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||||
WHERE `answerto` = "0" AND (`status` = "0" OR `status` = "1")
|
WHERE `answerto` = "0" AND (`status` = "0" OR `status` = "1")
|
||||||
AND `lastreplier`="0" AND `adminid` = "' . $userinfo['adminid'] . '"');
|
AND `lastreplier`="0" AND `adminid` = "' . $userinfo['adminid'] . '"');
|
||||||
$awaitingtickets = $opentickets['count'];
|
$awaitingtickets = $opentickets['count'];
|
||||||
$awaitingtickets_text = '';
|
$awaitingtickets_text = '';
|
||||||
|
|
||||||
if($opentickets > 0)
|
if($opentickets > 0)
|
||||||
{
|
{
|
||||||
$awaitingtickets_text = strtr($lng['ticket']['awaitingticketreply'], array('%s' => '<a href="admin_tickets.php?page=tickets&s=' . $s . '">' . $opentickets['count'] . '</a>'));
|
$awaitingtickets_text = strtr($lng['ticket']['awaitingticketreply'], array('%s' => '<a href="admin_tickets.php?page=tickets&s=' . $s . '">' . $opentickets['count'] . '</a>'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(function_exists('sys_getloadavg'))
|
if(function_exists('sys_getloadavg'))
|
||||||
{
|
{
|
||||||
$loadArray = sys_getloadavg();
|
$loadArray = sys_getloadavg();
|
||||||
$load = number_format($loadArray[0], 2, '.', '') . " / " . number_format($loadArray[1], 2, '.', '') . " / " . number_format($loadArray[2], 2, '.', '');
|
$load = number_format($loadArray[0], 2, '.', '') . " / " . number_format($loadArray[1], 2, '.', '') . " / " . number_format($loadArray[2], 2, '.', '');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$load = @file_get_contents('/proc/loadavg');
|
$load = @file_get_contents('/proc/loadavg');
|
||||||
|
|
||||||
if(!$load)
|
if(!$load)
|
||||||
{
|
{
|
||||||
$load = $lng['admin']['noloadavailable'];
|
$load = $lng['admin']['noloadavailable'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(function_exists('posix_uname'))
|
if(function_exists('posix_uname'))
|
||||||
{
|
{
|
||||||
$showkernel = 1;
|
$showkernel = 1;
|
||||||
$kernel_nfo = posix_uname();
|
$kernel_nfo = posix_uname();
|
||||||
$kernel = $kernel_nfo['release'] . ' (' . $kernel_nfo['machine'] . ')';
|
$kernel = $kernel_nfo['release'] . ' (' . $kernel_nfo['machine'] . ')';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$showkernel = 0;
|
$showkernel = 0;
|
||||||
$kernel = '';
|
$kernel = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to get the uptime
|
// Try to get the uptime
|
||||||
// First: With exec (let's hope it's enabled for the SysCP - vHost)
|
// First: With exec (let's hope it's enabled for the SysCP - vHost)
|
||||||
|
|
||||||
$uptime_array = explode(" ", @file_get_contents("/proc/uptime"));
|
$uptime_array = explode(" ", @file_get_contents("/proc/uptime"));
|
||||||
|
|
||||||
if(is_array($uptime_array)
|
if(is_array($uptime_array)
|
||||||
&& isset($uptime_array[0])
|
&& isset($uptime_array[0])
|
||||||
&& is_numeric($uptime_array[0]))
|
&& is_numeric($uptime_array[0]))
|
||||||
{
|
{
|
||||||
// Some calculatioon to get a nicly formatted display
|
// Some calculatioon to get a nicly formatted display
|
||||||
|
|
||||||
$seconds = round($uptime_array[0], 0);
|
$seconds = round($uptime_array[0], 0);
|
||||||
$minutes = $seconds / 60;
|
$minutes = $seconds / 60;
|
||||||
$hours = $minutes / 60;
|
$hours = $minutes / 60;
|
||||||
$days = floor($hours / 24);
|
$days = floor($hours / 24);
|
||||||
$hours = floor($hours - ($days * 24));
|
$hours = floor($hours - ($days * 24));
|
||||||
$minutes = floor($minutes - ($days * 24 * 60) - ($hours * 60));
|
$minutes = floor($minutes - ($days * 24 * 60) - ($hours * 60));
|
||||||
$seconds = floor($seconds - ($days * 24 * 60 * 60) - ($hours * 60 * 60) - ($minutes * 60));
|
$seconds = floor($seconds - ($days * 24 * 60 * 60) - ($hours * 60 * 60) - ($minutes * 60));
|
||||||
$uptime = "{$days}d, {$hours}h, {$minutes}m, {$seconds}s";
|
$uptime = "{$days}d, {$hours}h, {$minutes}m, {$seconds}s";
|
||||||
|
|
||||||
// Just cleanup
|
// Just cleanup
|
||||||
|
|
||||||
unset($uptime_array, $seconds, $minutes, $hours, $days);
|
unset($uptime_array, $seconds, $minutes, $hours, $days);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Nothing of the above worked, show an error :/
|
// Nothing of the above worked, show an error :/
|
||||||
|
|
||||||
$uptime = '';
|
$uptime = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("index/index") . "\";");
|
eval("echo \"" . getTemplate("index/index") . "\";");
|
||||||
}
|
}
|
||||||
elseif($page == 'change_password')
|
elseif($page == 'change_password')
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$old_password = validate($_POST['old_password'], 'old password');
|
$old_password = validate($_POST['old_password'], 'old password');
|
||||||
|
|
||||||
if(md5($old_password) != $userinfo['password'])
|
if(md5($old_password) != $userinfo['password'])
|
||||||
{
|
{
|
||||||
standard_error('oldpasswordnotcorrect');
|
standard_error('oldpasswordnotcorrect');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$new_password = validate($_POST['new_password'], 'new password');
|
$new_password = validate($_POST['new_password'], 'new password');
|
||||||
$new_password_confirm = validate($_POST['new_password_confirm'], 'new password confirm');
|
$new_password_confirm = validate($_POST['new_password_confirm'], 'new password confirm');
|
||||||
|
|
||||||
if($old_password == '')
|
if($old_password == '')
|
||||||
{
|
{
|
||||||
standard_error(array('stringisempty', 'oldpassword'));
|
standard_error(array('stringisempty', 'oldpassword'));
|
||||||
}
|
}
|
||||||
elseif($new_password == '')
|
elseif($new_password == '')
|
||||||
{
|
{
|
||||||
standard_error(array('stringisempty', 'newpassword'));
|
standard_error(array('stringisempty', 'newpassword'));
|
||||||
}
|
}
|
||||||
elseif($new_password_confirm == '')
|
elseif($new_password_confirm == '')
|
||||||
{
|
{
|
||||||
standard_error(array('stringisempty', 'newpasswordconfirm'));
|
standard_error(array('stringisempty', 'newpasswordconfirm'));
|
||||||
}
|
}
|
||||||
elseif($new_password != $new_password_confirm)
|
elseif($new_password != $new_password_confirm)
|
||||||
{
|
{
|
||||||
standard_error('newpasswordconfirmerror');
|
standard_error('newpasswordconfirmerror');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `password`='" . md5($new_password) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `password`='" . md5($old_password) . "'");
|
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `password`='" . md5($new_password) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `password`='" . md5($old_password) . "'");
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, 'changed password');
|
$log->logAction(ADM_ACTION, LOG_NOTICE, 'changed password');
|
||||||
redirectTo($filename, Array('s' => $s));
|
redirectTo($filename, Array('s' => $s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
eval("echo \"" . getTemplate("index/change_password") . "\";");
|
eval("echo \"" . getTemplate("index/change_password") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($page == 'change_language')
|
elseif($page == 'change_language')
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$def_language = validate($_POST['def_language'], 'default language');
|
$def_language = validate($_POST['def_language'], 'default language');
|
||||||
|
|
||||||
if(isset($languages[$def_language]))
|
if(isset($languages[$def_language]))
|
||||||
{
|
{
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `def_language`='" . $db->escape($def_language) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "'");
|
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `def_language`='" . $db->escape($def_language) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "'");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SESSIONS . "` SET `language`='" . $db->escape($def_language) . "' WHERE `hash`='" . $db->escape($s) . "'");
|
$db->query("UPDATE `" . TABLE_PANEL_SESSIONS . "` SET `language`='" . $db->escape($def_language) . "' WHERE `hash`='" . $db->escape($s) . "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "changed his/her default language to '" . $def_language . "'");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "changed his/her default language to '" . $def_language . "'");
|
||||||
redirectTo($filename, Array('s' => $s));
|
redirectTo($filename, Array('s' => $s));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$language_options = '';
|
$language_options = '';
|
||||||
|
|
||||||
while(list($language_file, $language_name) = each($languages))
|
while(list($language_file, $language_name) = each($languages))
|
||||||
{
|
{
|
||||||
$language_options.= makeoption($language_name, $language_file, $userinfo['def_language'], true);
|
$language_options.= makeoption($language_name, $language_file, $userinfo['def_language'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("index/change_language") . "\";");
|
eval("echo \"" . getTemplate("index/change_language") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,148 +1,148 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Panel
|
* @package Panel
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('AREA', 'admin');
|
define('AREA', 'admin');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include our init.php, which manages Sessions, Language etc.
|
* Include our init.php, which manages Sessions, Language etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ("./lib/init.php");
|
require ("./lib/init.php");
|
||||||
|
|
||||||
if(isset($_POST['id']))
|
if(isset($_POST['id']))
|
||||||
{
|
{
|
||||||
$id = intval($_POST['id']);
|
$id = intval($_POST['id']);
|
||||||
}
|
}
|
||||||
elseif(isset($_GET['id']))
|
elseif(isset($_GET['id']))
|
||||||
{
|
{
|
||||||
$id = intval($_GET['id']);
|
$id = intval($_GET['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($page == 'message')
|
if($page == 'message')
|
||||||
{
|
{
|
||||||
if($action == '')
|
if($action == '')
|
||||||
{
|
{
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed panel_message");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed panel_message");
|
||||||
|
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
if($_POST['receipient'] == 0
|
if($_POST['receipient'] == 0
|
||||||
&& $userinfo['customers_see_all'] == '1')
|
&& $userinfo['customers_see_all'] == '1')
|
||||||
{
|
{
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "sending messages to admins");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "sending messages to admins");
|
||||||
$result = $db->query('SELECT `firstname`, `name`, `email` FROM `' . TABLE_PANEL_ADMINS . "`");
|
$result = $db->query('SELECT `firstname`, `name`, `email` FROM `' . TABLE_PANEL_ADMINS . "`");
|
||||||
}
|
}
|
||||||
elseif($_POST['receipient'] == 1)
|
elseif($_POST['receipient'] == 1)
|
||||||
{
|
{
|
||||||
if($userinfo['customers_see_all'] == "1")
|
if($userinfo['customers_see_all'] == "1")
|
||||||
{
|
{
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "sending messages to ALL customers");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "sending messages to ALL customers");
|
||||||
$result = $db->query('SELECT `firstname`, `name`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "`");
|
$result = $db->query('SELECT `firstname`, `name`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "`");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "sending messages to customers");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "sending messages to customers");
|
||||||
$result = $db->query('SELECT `firstname`, `name`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "` WHERE `adminid`='" . $userinfo['adminid'] . "'");
|
$result = $db->query('SELECT `firstname`, `name`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "` WHERE `adminid`='" . $userinfo['adminid'] . "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
standard_error('noreceipientsgiven');
|
standard_error('noreceipientsgiven');
|
||||||
}
|
}
|
||||||
|
|
||||||
$subject = $_POST['subject'];
|
$subject = $_POST['subject'];
|
||||||
$message = wordwrap($_POST['message'], 70);
|
$message = wordwrap($_POST['message'], 70);
|
||||||
|
|
||||||
if(!empty($message))
|
if(!empty($message))
|
||||||
{
|
{
|
||||||
$mailcounter = 0;
|
$mailcounter = 0;
|
||||||
$mail->Body = $message;
|
$mail->Body = $message;
|
||||||
$mail->Subject = $subject;
|
$mail->Subject = $subject;
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
$mail->AddAddress($row['email'], $row['firstname'] . ' ' . $row['name']);
|
$mail->AddAddress($row['email'], $row['firstname'] . ' ' . $row['name']);
|
||||||
$mail->From = $userinfo['email'];
|
$mail->From = $userinfo['email'];
|
||||||
$mail->FromName = $userinfo['firstname'] . ' ' . $userinfo['name'];
|
$mail->FromName = $userinfo['firstname'] . ' ' . $userinfo['name'];
|
||||||
|
|
||||||
if(!$mail->Send())
|
if(!$mail->Send())
|
||||||
{
|
{
|
||||||
if($mail->ErrorInfo != '')
|
if($mail->ErrorInfo != '')
|
||||||
{
|
{
|
||||||
$mailerr_msg = $mail->ErrorInfo;
|
$mailerr_msg = $mail->ErrorInfo;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mailerr_msg = $row["email"];
|
$mailerr_msg = $row["email"];
|
||||||
}
|
}
|
||||||
|
|
||||||
$log->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
$log->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
||||||
standard_error('errorsendingmail', $row["email"]);
|
standard_error('errorsendingmail', $row["email"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$mailcounter++;
|
$mailcounter++;
|
||||||
$mail->ClearAddresses();
|
$mail->ClearAddresses();
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s, 'action' => 'showsuccess', 'sentitems' => $mailcounter));
|
redirectTo($filename, Array('page' => $page, 's' => $s, 'action' => 'showsuccess', 'sentitems' => $mailcounter));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
standard_error('nomessagetosend');
|
standard_error('nomessagetosend');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($action == 'showsuccess')
|
if($action == 'showsuccess')
|
||||||
{
|
{
|
||||||
$success = 1;
|
$success = 1;
|
||||||
$sentitems = isset($_GET['sentitems']) ? (int)$_GET['sentitems'] : 0;
|
$sentitems = isset($_GET['sentitems']) ? (int)$_GET['sentitems'] : 0;
|
||||||
|
|
||||||
if($sentitems == 0)
|
if($sentitems == 0)
|
||||||
{
|
{
|
||||||
$successmessage = $lng['message']['noreceipients'];
|
$successmessage = $lng['message']['noreceipients'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$successmessage = str_replace('%s', $sentitems, $lng['message']['success']);
|
$successmessage = str_replace('%s', $sentitems, $lng['message']['success']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$success = 0;
|
$success = 0;
|
||||||
$sentitems = 0;
|
$sentitems = 0;
|
||||||
$successmessage = '';
|
$successmessage = '';
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$receipients = '';
|
$receipients = '';
|
||||||
|
|
||||||
if($userinfo['customers_see_all'] == "1")
|
if($userinfo['customers_see_all'] == "1")
|
||||||
{
|
{
|
||||||
$receipients.= makeoption($lng['panel']['reseller'], 0);
|
$receipients.= makeoption($lng['panel']['reseller'], 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$receipients.= makeoption($lng['panel']['customer'], 1);
|
$receipients.= makeoption($lng['panel']['customer'], 1);
|
||||||
eval("echo \"" . getTemplate("message/message") . "\";");
|
eval("echo \"" . getTemplate("message/message") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,185 +1,185 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Panel
|
* @package Panel
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('AREA', 'admin');
|
define('AREA', 'admin');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include our init.php, which manages Sessions, Language etc.
|
* Include our init.php, which manages Sessions, Language etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ("./lib/init.php");
|
require ("./lib/init.php");
|
||||||
|
|
||||||
if(isset($_POST['id']))
|
if(isset($_POST['id']))
|
||||||
{
|
{
|
||||||
$id = intval($_POST['id']);
|
$id = intval($_POST['id']);
|
||||||
}
|
}
|
||||||
elseif(isset($_GET['id']))
|
elseif(isset($_GET['id']))
|
||||||
{
|
{
|
||||||
$id = intval($_GET['id']);
|
$id = intval($_GET['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($page == 'overview')
|
if($page == 'overview')
|
||||||
{
|
{
|
||||||
if($action == '')
|
if($action == '')
|
||||||
{
|
{
|
||||||
$tablecontent = '';
|
$tablecontent = '';
|
||||||
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`");
|
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`");
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
$domainresult = false;
|
$domainresult = false;
|
||||||
|
|
||||||
if((int)$userinfo['domains_see_all'] == 0)
|
if((int)$userinfo['domains_see_all'] == 0)
|
||||||
{
|
{
|
||||||
$domainresult = $db->query("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `adminid` = " . (int)$userinfo['userid'] . " AND `phpsettingid` = " . (int)$row['id']);
|
$domainresult = $db->query("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `adminid` = " . (int)$userinfo['userid'] . " AND `phpsettingid` = " . (int)$row['id']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$domainresult = $db->query("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `phpsettingid` = " . (int)$row['id']);
|
$domainresult = $db->query("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `phpsettingid` = " . (int)$row['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$domains = '';
|
$domains = '';
|
||||||
|
|
||||||
if($db->num_rows($domainresult) > 0)
|
if($db->num_rows($domainresult) > 0)
|
||||||
{
|
{
|
||||||
while($row2 = $db->fetch_array($domainresult))
|
while($row2 = $db->fetch_array($domainresult))
|
||||||
{
|
{
|
||||||
$domains.= $row2['domain'] . '<br/>';
|
$domains.= $row2['domain'] . '<br/>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$domains = $lng['admin']['phpsettings']['notused'];
|
$domains = $lng['admin']['phpsettings']['notused'];
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("\$tablecontent.=\"" . getTemplate("phpconfig/overview_overview") . "\";");
|
eval("\$tablecontent.=\"" . getTemplate("phpconfig/overview_overview") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting overview has been viewed by '" . $userinfo['loginname'] . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting overview has been viewed by '" . $userinfo['loginname'] . "'");
|
||||||
eval("echo \"" . getTemplate("phpconfig/overview") . "\";");
|
eval("echo \"" . getTemplate("phpconfig/overview") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
if($action == 'add')
|
if($action == 'add')
|
||||||
{
|
{
|
||||||
if((int)$userinfo['change_serversettings'] == 1)
|
if((int)$userinfo['change_serversettings'] == 1)
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$description = validate($_POST['description'], 'description');
|
$description = validate($_POST['description'], 'description');
|
||||||
$binary = makeCorrectFile(validate($_POST['binary'], 'binary'));
|
$binary = makeCorrectFile(validate($_POST['binary'], 'binary'));
|
||||||
$file_extensions = validate($_POST['file_extensions'], 'file_extensions', '/^[a-zA-Z0-9\s]*$/');
|
$file_extensions = validate($_POST['file_extensions'], 'file_extensions', '/^[a-zA-Z0-9\s]*$/');
|
||||||
$phpsettings = validate(str_replace("\r\n", "\n", $_POST['phpsettings']), 'phpsettings', '/^[^\0]*$/');
|
$phpsettings = validate(str_replace("\r\n", "\n", $_POST['phpsettings']), 'phpsettings', '/^[^\0]*$/');
|
||||||
$mod_fcgid_starter = validate($_POST['mod_fcgid_starter'], 'mod_fcgid_starter', '/^[0-9]*$/', '', array('-1', ''));
|
$mod_fcgid_starter = validate($_POST['mod_fcgid_starter'], 'mod_fcgid_starter', '/^[0-9]*$/', '', array('-1', ''));
|
||||||
$mod_fcgid_maxrequests = validate($_POST['mod_fcgid_maxrequests'], 'mod_fcgid_maxrequests', '/^[0-9]*$/', '', array('-1', ''));
|
$mod_fcgid_maxrequests = validate($_POST['mod_fcgid_maxrequests'], 'mod_fcgid_maxrequests', '/^[0-9]*$/', '', array('-1', ''));
|
||||||
|
|
||||||
if(strlen($description) == 0
|
if(strlen($description) == 0
|
||||||
|| strlen($description) > 50)
|
|| strlen($description) > 50)
|
||||||
{
|
{
|
||||||
standard_error('descriptioninvalid');
|
standard_error('descriptioninvalid');
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->query("INSERT INTO `" . TABLE_PANEL_PHPCONFIGS . "` SET `description` = '" . $db->escape($description) . "', `binary` = '" . $db->escape($binary) . "', `file_extensions` = '" . $db->escape($file_extensions) . "', `mod_fcgid_starter` = '" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests` = '" . $db->escape($mod_fcgid_maxrequests) . "', `phpsettings` = '" . $db->escape($phpsettings) . "'");
|
$db->query("INSERT INTO `" . TABLE_PANEL_PHPCONFIGS . "` SET `description` = '" . $db->escape($description) . "', `binary` = '" . $db->escape($binary) . "', `file_extensions` = '" . $db->escape($file_extensions) . "', `mod_fcgid_starter` = '" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests` = '" . $db->escape($mod_fcgid_maxrequests) . "', `phpsettings` = '" . $db->escape($phpsettings) . "'");
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $value . "' has been created by '" . $userinfo['loginname'] . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $value . "' has been created by '" . $userinfo['loginname'] . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
|
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
|
||||||
eval("echo \"" . getTemplate("phpconfig/overview_add") . "\";");
|
eval("echo \"" . getTemplate("phpconfig/overview_add") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
standard_error('nopermissionsorinvalidid');
|
standard_error('nopermissionsorinvalidid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($action == 'delete')
|
if($action == 'delete')
|
||||||
{
|
{
|
||||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$id);
|
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$id);
|
||||||
|
|
||||||
if($result['id'] != 0
|
if($result['id'] != 0
|
||||||
&& $result['id'] == $id
|
&& $result['id'] == $id
|
||||||
&& (int)$userinfo['change_serversettings'] == 1
|
&& (int)$userinfo['change_serversettings'] == 1
|
||||||
&& $id != 1)
|
&& $id != 1)
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `phpsettingid` = 1 WHERE `phpsettingid` = " . (int)$id);
|
$db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `phpsettingid` = 1 WHERE `phpsettingid` = " . (int)$id);
|
||||||
$db->query("DELETE FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$id);
|
$db->query("DELETE FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$id);
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with id #" . (int)$id . " has been deleted by '" . $userinfo['loginname'] . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with id #" . (int)$id . " has been deleted by '" . $userinfo['loginname'] . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ask_yesno('phpsetting_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['description']);
|
ask_yesno('phpsetting_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['description']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
standard_error('nopermissionsorinvalidid');
|
standard_error('nopermissionsorinvalidid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($action == 'edit')
|
if($action == 'edit')
|
||||||
{
|
{
|
||||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$id);
|
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$id);
|
||||||
|
|
||||||
if($result['id'] != 0
|
if($result['id'] != 0
|
||||||
&& $result['id'] == $id
|
&& $result['id'] == $id
|
||||||
&& (int)$userinfo['change_serversettings'] == 1)
|
&& (int)$userinfo['change_serversettings'] == 1)
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$description = validate($_POST['description'], 'description');
|
$description = validate($_POST['description'], 'description');
|
||||||
$binary = makeCorrectFile(validate($_POST['binary'], 'binary'));
|
$binary = makeCorrectFile(validate($_POST['binary'], 'binary'));
|
||||||
$file_extensions = validate($_POST['file_extensions'], 'file_extensions', '/^[a-zA-Z0-9\s]*$/');
|
$file_extensions = validate($_POST['file_extensions'], 'file_extensions', '/^[a-zA-Z0-9\s]*$/');
|
||||||
$phpsettings = validate(str_replace("\r\n", "\n", $_POST['phpsettings']), 'phpsettings', '/^[^\0]*$/');
|
$phpsettings = validate(str_replace("\r\n", "\n", $_POST['phpsettings']), 'phpsettings', '/^[^\0]*$/');
|
||||||
$mod_fcgid_starter = validate($_POST['mod_fcgid_starter'], 'mod_fcgid_starter', '/^[0-9]*$/', '', array('-1', ''));
|
$mod_fcgid_starter = validate($_POST['mod_fcgid_starter'], 'mod_fcgid_starter', '/^[0-9]*$/', '', array('-1', ''));
|
||||||
$mod_fcgid_maxrequests = validate($_POST['mod_fcgid_maxrequests'], 'mod_fcgid_maxrequests', '/^[0-9]*$/', '', array('-1', ''));
|
$mod_fcgid_maxrequests = validate($_POST['mod_fcgid_maxrequests'], 'mod_fcgid_maxrequests', '/^[0-9]*$/', '', array('-1', ''));
|
||||||
|
|
||||||
if(strlen($description) == 0
|
if(strlen($description) == 0
|
||||||
|| strlen($description) > 50)
|
|| strlen($description) > 50)
|
||||||
{
|
{
|
||||||
standard_error('descriptioninvalid');
|
standard_error('descriptioninvalid');
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET `description` = '" . $db->escape($description) . "', `binary` = '" . $db->escape($binary) . "', `file_extensions` = '" . $db->escape($file_extensions) . "', `mod_fcgid_starter` = '" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests` = '" . $db->escape($mod_fcgid_maxrequests) . "', `phpsettings` = '" . $db->escape($phpsettings) . "' WHERE `id` = " . (int)$id);
|
$db->query("UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET `description` = '" . $db->escape($description) . "', `binary` = '" . $db->escape($binary) . "', `file_extensions` = '" . $db->escape($file_extensions) . "', `mod_fcgid_starter` = '" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests` = '" . $db->escape($mod_fcgid_maxrequests) . "', `phpsettings` = '" . $db->escape($phpsettings) . "' WHERE `id` = " . (int)$id);
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $description . "' has been changed by '" . $userinfo['loginname'] . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $description . "' has been changed by '" . $userinfo['loginname'] . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
eval("echo \"" . getTemplate("phpconfig/overview_edit") . "\";");
|
eval("echo \"" . getTemplate("phpconfig/overview_edit") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
standard_error('nopermissionsorinvalidid');
|
standard_error('nopermissionsorinvalidid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,380 +1,380 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Panel
|
* @package Panel
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('AREA', 'admin');
|
define('AREA', 'admin');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include our init.php, which manages Sessions, Language etc.
|
* Include our init.php, which manages Sessions, Language etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ("./lib/init.php");
|
require ("./lib/init.php");
|
||||||
|
|
||||||
if(isset($_POST['subjectid']))
|
if(isset($_POST['subjectid']))
|
||||||
{
|
{
|
||||||
$subjectid = intval($_POST['subjectid']);
|
$subjectid = intval($_POST['subjectid']);
|
||||||
$mailbodyid = intval($_POST['mailbodyid']);
|
$mailbodyid = intval($_POST['mailbodyid']);
|
||||||
}
|
}
|
||||||
elseif(isset($_GET['subjectid']))
|
elseif(isset($_GET['subjectid']))
|
||||||
{
|
{
|
||||||
$subjectid = intval($_GET['subjectid']);
|
$subjectid = intval($_GET['subjectid']);
|
||||||
$mailbodyid = intval($_GET['mailbodyid']);
|
$mailbodyid = intval($_GET['mailbodyid']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['id']))
|
if(isset($_POST['id']))
|
||||||
{
|
{
|
||||||
$id = intval($_POST['id']);
|
$id = intval($_POST['id']);
|
||||||
}
|
}
|
||||||
elseif(isset($_GET['id']))
|
elseif(isset($_GET['id']))
|
||||||
{
|
{
|
||||||
$id = intval($_GET['id']);
|
$id = intval($_GET['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$available_templates = array(
|
$available_templates = array(
|
||||||
'createcustomer',
|
'createcustomer',
|
||||||
'pop_success',
|
'pop_success',
|
||||||
'trafficninetypercent',
|
'trafficninetypercent',
|
||||||
'new_ticket_by_customer',
|
'new_ticket_by_customer',
|
||||||
'new_ticket_for_customer',
|
'new_ticket_for_customer',
|
||||||
'new_ticket_by_staff',
|
'new_ticket_by_staff',
|
||||||
'new_reply_ticket_by_customer',
|
'new_reply_ticket_by_customer',
|
||||||
'new_reply_ticket_by_staff'
|
'new_reply_ticket_by_staff'
|
||||||
);
|
);
|
||||||
$file_templates = array(
|
$file_templates = array(
|
||||||
'index_html'
|
'index_html'
|
||||||
);
|
);
|
||||||
|
|
||||||
if($action == '')
|
if($action == '')
|
||||||
{
|
{
|
||||||
//email templates
|
//email templates
|
||||||
|
|
||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_templates");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_templates");
|
||||||
|
|
||||||
if($settings['panel']['sendalternativemail'] == 1)
|
if($settings['panel']['sendalternativemail'] == 1)
|
||||||
{
|
{
|
||||||
$available_templates[] = 'pop_success_alternative';
|
$available_templates[] = 'pop_success_alternative';
|
||||||
}
|
}
|
||||||
|
|
||||||
$templates_array = array();
|
$templates_array = array();
|
||||||
$result = $db->query("SELECT `id`, `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `templategroup`='mails' ORDER BY `language`, `varname`");
|
$result = $db->query("SELECT `id`, `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `templategroup`='mails' ORDER BY `language`, `varname`");
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
$parts = array();
|
$parts = array();
|
||||||
preg_match('/^([a-z]([a-z_]+[a-z])*)_(mailbody|subject)$/', $row['varname'], $parts);
|
preg_match('/^([a-z]([a-z_]+[a-z])*)_(mailbody|subject)$/', $row['varname'], $parts);
|
||||||
$templates_array[$row['language']][$parts[1]][$parts[3]] = $row['id'];
|
$templates_array[$row['language']][$parts[1]][$parts[3]] = $row['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$templates = '';
|
$templates = '';
|
||||||
foreach($templates_array as $language => $template_defs)
|
foreach($templates_array as $language => $template_defs)
|
||||||
{
|
{
|
||||||
foreach($template_defs as $action => $email)
|
foreach($template_defs as $action => $email)
|
||||||
{
|
{
|
||||||
$subjectid = $email['subject'];
|
$subjectid = $email['subject'];
|
||||||
$mailbodyid = $email['mailbody'];
|
$mailbodyid = $email['mailbody'];
|
||||||
$template = $lng['admin']['templates'][$action];
|
$template = $lng['admin']['templates'][$action];
|
||||||
eval("\$templates.=\"" . getTemplate("templates/templates_template") . "\";");
|
eval("\$templates.=\"" . getTemplate("templates/templates_template") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$add = false;
|
$add = false;
|
||||||
|
|
||||||
while(list($language_file, $language_name) = each($languages))
|
while(list($language_file, $language_name) = each($languages))
|
||||||
{
|
{
|
||||||
$templates_done = array();
|
$templates_done = array();
|
||||||
$result = $db->query('SELECT `varname` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($language_name) . '\' AND `templategroup`=\'mails\' AND `varname` LIKE \'%_subject\'');
|
$result = $db->query('SELECT `varname` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($language_name) . '\' AND `templategroup`=\'mails\' AND `varname` LIKE \'%_subject\'');
|
||||||
|
|
||||||
while(($row = $db->fetch_array($result)) != false)
|
while(($row = $db->fetch_array($result)) != false)
|
||||||
{
|
{
|
||||||
$templates_done[] = str_replace('_subject', '', $row['varname']);
|
$templates_done[] = str_replace('_subject', '', $row['varname']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count(array_diff($available_templates, $templates_done)) > 0)
|
if(count(array_diff($available_templates, $templates_done)) > 0)
|
||||||
{
|
{
|
||||||
$add = true;
|
$add = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//filetemplates
|
//filetemplates
|
||||||
|
|
||||||
$filetemplates = '';
|
$filetemplates = '';
|
||||||
$filetemplateadd = false;
|
$filetemplateadd = false;
|
||||||
$result = $db->query("SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `templategroup`='files'");
|
$result = $db->query("SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `templategroup`='files'");
|
||||||
|
|
||||||
if($db->num_rows($result) != count($file_templates))$filetemplateadd = true;
|
if($db->num_rows($result) != count($file_templates))$filetemplateadd = true;
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
eval("\$filetemplates.=\"" . getTemplate("templates/templates_filetemplate") . "\";");
|
eval("\$filetemplates.=\"" . getTemplate("templates/templates_filetemplate") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("templates/templates") . "\";");
|
eval("echo \"" . getTemplate("templates/templates") . "\";");
|
||||||
}
|
}
|
||||||
elseif($action == 'delete'
|
elseif($action == 'delete'
|
||||||
&& $subjectid != 0
|
&& $subjectid != 0
|
||||||
&& $mailbodyid != 0)
|
&& $mailbodyid != 0)
|
||||||
{
|
{
|
||||||
//email templates
|
//email templates
|
||||||
|
|
||||||
$result = $db->query_first("SELECT `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$subjectid . "'");
|
$result = $db->query_first("SELECT `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$subjectid . "'");
|
||||||
|
|
||||||
if($result['varname'] != '')
|
if($result['varname'] != '')
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$db->query("DELETE FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND (`id`='" . (int)$subjectid . "' OR `id`='" . (int)$mailbodyid . "')");
|
$db->query("DELETE FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND (`id`='" . (int)$subjectid . "' OR `id`='" . (int)$mailbodyid . "')");
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "deleted template '" . $result['language'] . ' - ' . $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])] . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "deleted template '" . $result['language'] . ' - ' . $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])] . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ask_yesno('admin_template_reallydelete', $filename, array('subjectid' => $subjectid, 'mailbodyid' => $mailbodyid, 'page' => $page, 'action' => $action), $result['language'] . ' - ' . $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])]);
|
ask_yesno('admin_template_reallydelete', $filename, array('subjectid' => $subjectid, 'mailbodyid' => $mailbodyid, 'page' => $page, 'action' => $action), $result['language'] . ' - ' . $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($action == 'delete'
|
elseif($action == 'delete'
|
||||||
&& $id != 0)
|
&& $id != 0)
|
||||||
{
|
{
|
||||||
//file templates
|
//file templates
|
||||||
|
|
||||||
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$id . "'");
|
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$id . "'");
|
||||||
|
|
||||||
if($db->num_rows($result) > 0)
|
if($db->num_rows($result) > 0)
|
||||||
{
|
{
|
||||||
$row = $db->fetch_array($result);
|
$row = $db->fetch_array($result);
|
||||||
|
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$db->query("DELETE FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`=" . (int)$userinfo['adminid'] . " AND `id`=" . (int)$id . "");
|
$db->query("DELETE FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`=" . (int)$userinfo['adminid'] . " AND `id`=" . (int)$id . "");
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "deleted template '" . $lng['admin']['templates'][$row['varname']] . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "deleted template '" . $lng['admin']['templates'][$row['varname']] . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ask_yesno('admin_template_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $lng['admin']['templates'][$row['varname']]);
|
ask_yesno('admin_template_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $lng['admin']['templates'][$row['varname']]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
standard_error('templatenotfound');
|
standard_error('templatenotfound');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($action == 'add')
|
elseif($action == 'add')
|
||||||
{
|
{
|
||||||
if($settings['panel']['sendalternativemail'] == 1)
|
if($settings['panel']['sendalternativemail'] == 1)
|
||||||
{
|
{
|
||||||
$available_templates[] = 'pop_success_alternative';
|
$available_templates[] = 'pop_success_alternative';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['prepare'])
|
if(isset($_POST['prepare'])
|
||||||
&& $_POST['prepare'] == 'prepare')
|
&& $_POST['prepare'] == 'prepare')
|
||||||
{
|
{
|
||||||
//email templates
|
//email templates
|
||||||
|
|
||||||
$language = validate($_POST['language'], 'language');
|
$language = validate($_POST['language'], 'language');
|
||||||
$templates = array();
|
$templates = array();
|
||||||
$result = $db->query('SELECT `varname` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($language) . '\' AND `templategroup`=\'mails\' AND `varname` LIKE \'%_subject\'');
|
$result = $db->query('SELECT `varname` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($language) . '\' AND `templategroup`=\'mails\' AND `varname` LIKE \'%_subject\'');
|
||||||
|
|
||||||
while(($row = $db->fetch_array($result)) != false)
|
while(($row = $db->fetch_array($result)) != false)
|
||||||
{
|
{
|
||||||
$templates[] = str_replace('_subject', '', $row['varname']);
|
$templates[] = str_replace('_subject', '', $row['varname']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$templates = array_diff($available_templates, $templates);
|
$templates = array_diff($available_templates, $templates);
|
||||||
$template_options = '';
|
$template_options = '';
|
||||||
foreach($templates as $template)
|
foreach($templates as $template)
|
||||||
{
|
{
|
||||||
$template_options.= makeoption($lng['admin']['templates'][$template], $template, NULL, true);
|
$template_options.= makeoption($lng['admin']['templates'][$template], $template, NULL, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("templates/templates_add_2") . "\";");
|
eval("echo \"" . getTemplate("templates/templates_add_2") . "\";");
|
||||||
}
|
}
|
||||||
elseif(isset($_POST['send'])
|
elseif(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
//email templates
|
//email templates
|
||||||
|
|
||||||
$language = validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect');
|
$language = validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect');
|
||||||
$template = validate($_POST['template'], 'template');
|
$template = validate($_POST['template'], 'template');
|
||||||
$subject = validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate');
|
$subject = validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate');
|
||||||
$mailbody = validate($_POST['mailbody'], 'mailbody', '/^[^\0]+$/', 'nomailbodycreate');
|
$mailbody = validate($_POST['mailbody'], 'mailbody', '/^[^\0]+$/', 'nomailbodycreate');
|
||||||
$templates = array();
|
$templates = array();
|
||||||
$result = $db->query('SELECT `varname` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($language) . '\' AND `templategroup`=\'mails\' AND `varname` LIKE \'%_subject\'');
|
$result = $db->query('SELECT `varname` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($language) . '\' AND `templategroup`=\'mails\' AND `varname` LIKE \'%_subject\'');
|
||||||
|
|
||||||
while(($row = $db->fetch_array($result)) != false)
|
while(($row = $db->fetch_array($result)) != false)
|
||||||
{
|
{
|
||||||
$templates[] = str_replace('_subject', '', $row['varname']);
|
$templates[] = str_replace('_subject', '', $row['varname']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$templates = array_diff($available_templates, $templates);
|
$templates = array_diff($available_templates, $templates);
|
||||||
|
|
||||||
if(array_search($template, $templates) === false)
|
if(array_search($template, $templates) === false)
|
||||||
{
|
{
|
||||||
standard_error('templatenotfound');
|
standard_error('templatenotfound');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result = $db->query("INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` (`adminid`, `language`, `templategroup`, `varname`, `value`)
|
$result = $db->query("INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` (`adminid`, `language`, `templategroup`, `varname`, `value`)
|
||||||
VALUES ('" . (int)$userinfo['adminid'] . "', '" . $db->escape($language) . "', 'mails', '" . $db->escape($template) . "_subject','" . $db->escape($subject) . "')");
|
VALUES ('" . (int)$userinfo['adminid'] . "', '" . $db->escape($language) . "', 'mails', '" . $db->escape($template) . "_subject','" . $db->escape($subject) . "')");
|
||||||
$result = $db->query("INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` (`adminid`, `language`, `templategroup`, `varname`, `value`)
|
$result = $db->query("INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` (`adminid`, `language`, `templategroup`, `varname`, `value`)
|
||||||
VALUES ('" . (int)$userinfo['adminid'] . "', '" . $db->escape($language) . "', 'mails', '" . $db->escape($template) . "_mailbody','" . $db->escape($mailbody) . "')");
|
VALUES ('" . (int)$userinfo['adminid'] . "', '" . $db->escape($language) . "', 'mails', '" . $db->escape($template) . "_mailbody','" . $db->escape($mailbody) . "')");
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "added template '" . $language . ' - ' . $template . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "added template '" . $language . ' - ' . $template . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif(isset($_POST['filesend'])
|
elseif(isset($_POST['filesend'])
|
||||||
&& $_POST['filesend'] == 'filesend')
|
&& $_POST['filesend'] == 'filesend')
|
||||||
{
|
{
|
||||||
//file templates
|
//file templates
|
||||||
|
|
||||||
$template = validate($_POST['template'], 'template');
|
$template = validate($_POST['template'], 'template');
|
||||||
$filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset');
|
$filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset');
|
||||||
$db->query("INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` (`adminid`, `language`, `templategroup`, `varname`, `value`)
|
$db->query("INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` (`adminid`, `language`, `templategroup`, `varname`, `value`)
|
||||||
VALUES ('" . (int)$userinfo['adminid'] . "', '', 'files', '" . $db->escape($template) . "','" . $db->escape($filecontent) . "')");
|
VALUES ('" . (int)$userinfo['adminid'] . "', '', 'files', '" . $db->escape($template) . "','" . $db->escape($filecontent) . "')");
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "added template '" . $template . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "added template '" . $template . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
elseif(!isset($_GET['files']))
|
elseif(!isset($_GET['files']))
|
||||||
{
|
{
|
||||||
//email templates
|
//email templates
|
||||||
|
|
||||||
$add = false;
|
$add = false;
|
||||||
$language_options = '';
|
$language_options = '';
|
||||||
|
|
||||||
while(list($language_file, $language_name) = each($languages))
|
while(list($language_file, $language_name) = each($languages))
|
||||||
{
|
{
|
||||||
$templates = array();
|
$templates = array();
|
||||||
$result = $db->query('SELECT `varname` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($language_name) . '\' AND `templategroup`=\'mails\' AND `varname` LIKE \'%_subject\'');
|
$result = $db->query('SELECT `varname` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($language_name) . '\' AND `templategroup`=\'mails\' AND `varname` LIKE \'%_subject\'');
|
||||||
|
|
||||||
while(($row = $db->fetch_array($result)) != false)
|
while(($row = $db->fetch_array($result)) != false)
|
||||||
{
|
{
|
||||||
$templates[] = str_replace('_subject', '', $row['varname']);
|
$templates[] = str_replace('_subject', '', $row['varname']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count(array_diff($available_templates, $templates)) > 0)
|
if(count(array_diff($available_templates, $templates)) > 0)
|
||||||
{
|
{
|
||||||
$add = true;
|
$add = true;
|
||||||
$language_options.= makeoption($language_name, $language_file, $userinfo['language'], true);
|
$language_options.= makeoption($language_name, $language_file, $userinfo['language'], true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($add)
|
if($add)
|
||||||
{
|
{
|
||||||
eval("echo \"" . getTemplate("templates/templates_add_1") . "\";");
|
eval("echo \"" . getTemplate("templates/templates_add_1") . "\";");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
standard_error('alltemplatesdefined');
|
standard_error('alltemplatesdefined');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//filetemplates
|
//filetemplates
|
||||||
|
|
||||||
$result = $db->query("SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `templategroup`='files'");
|
$result = $db->query("SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `templategroup`='files'");
|
||||||
|
|
||||||
if($db->num_rows($result) == count($file_templates))
|
if($db->num_rows($result) == count($file_templates))
|
||||||
{
|
{
|
||||||
standard_error('alltemplatesdefined');
|
standard_error('alltemplatesdefined');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$templatesdefined = array();
|
$templatesdefined = array();
|
||||||
$free_templates = '';
|
$free_templates = '';
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))$templatesdefined[] = $row['varname'];
|
while($row = $db->fetch_array($result))$templatesdefined[] = $row['varname'];
|
||||||
foreach(array_diff($file_templates, $templatesdefined) as $template)
|
foreach(array_diff($file_templates, $templatesdefined) as $template)
|
||||||
{
|
{
|
||||||
$free_templates.= makeoption($lng['admin']['templates'][$template], $template, '', true);
|
$free_templates.= makeoption($lng['admin']['templates'][$template], $template, '', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("templates/filetemplates_add") . "\";");
|
eval("echo \"" . getTemplate("templates/filetemplates_add") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($action == 'edit'
|
elseif($action == 'edit'
|
||||||
&& $subjectid != 0
|
&& $subjectid != 0
|
||||||
&& $mailbodyid != 0)
|
&& $mailbodyid != 0)
|
||||||
{
|
{
|
||||||
//email templates
|
//email templates
|
||||||
|
|
||||||
$result = $db->query_first("SELECT `language`, `varname`, `value` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$subjectid . "'");
|
$result = $db->query_first("SELECT `language`, `varname`, `value` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$subjectid . "'");
|
||||||
|
|
||||||
if($result['varname'] != '')
|
if($result['varname'] != '')
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$subject = validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate');
|
$subject = validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate');
|
||||||
$mailbody = validate($_POST['mailbody'], 'mailbody', '/^[^\0]+$/', 'nomailbodycreate');
|
$mailbody = validate($_POST['mailbody'], 'mailbody', '/^[^\0]+$/', 'nomailbodycreate');
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET `value`='" . $db->escape($subject) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$subjectid . "'");
|
$db->query("UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET `value`='" . $db->escape($subject) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$subjectid . "'");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET `value`='" . $db->escape($mailbody) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$mailbodyid . "'");
|
$db->query("UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET `value`='" . $db->escape($mailbody) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$mailbodyid . "'");
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "edited template '" . $result['varname'] . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "edited template '" . $result['varname'] . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result = htmlentities_array($result);
|
$result = htmlentities_array($result);
|
||||||
$template = $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])];
|
$template = $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])];
|
||||||
$subject = $result['value'];
|
$subject = $result['value'];
|
||||||
$result = $db->query_first("SELECT `language`, `varname`, `value` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `id`='$mailbodyid'");
|
$result = $db->query_first("SELECT `language`, `varname`, `value` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `id`='$mailbodyid'");
|
||||||
$result = htmlentities_array($result);
|
$result = htmlentities_array($result);
|
||||||
$mailbody = $result['value'];
|
$mailbody = $result['value'];
|
||||||
eval("echo \"" . getTemplate("templates/templates_edit") . "\";");
|
eval("echo \"" . getTemplate("templates/templates_edit") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($action == 'edit'
|
elseif($action == 'edit'
|
||||||
&& $id != 0)
|
&& $id != 0)
|
||||||
{
|
{
|
||||||
//file templates
|
//file templates
|
||||||
|
|
||||||
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$id . "'");
|
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$id . "'");
|
||||||
|
|
||||||
if($db->num_rows($result) > 0)
|
if($db->num_rows($result) > 0)
|
||||||
{
|
{
|
||||||
$row = $db->fetch_array($result);
|
$row = $db->fetch_array($result);
|
||||||
|
|
||||||
//filetemplates
|
//filetemplates
|
||||||
|
|
||||||
if(isset($_POST['filesend'])
|
if(isset($_POST['filesend'])
|
||||||
&& $_POST['filesend'] == 'filesend')
|
&& $_POST['filesend'] == 'filesend')
|
||||||
{
|
{
|
||||||
$filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset');
|
$filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset');
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET `value`='" . $db->escape($filecontent) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$id . "'");
|
$db->query("UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET `value`='" . $db->escape($filecontent) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$id . "'");
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "edited template '" . $row['varname'] . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "edited template '" . $row['varname'] . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
eval("echo \"" . getTemplate("templates/filetemplates_edit") . "\";");
|
eval("echo \"" . getTemplate("templates/filetemplates_edit") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
standard_error('templatenotfound');
|
standard_error('templatenotfound');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Panel
|
* @package Panel
|
||||||
* @version $Id: $
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('AREA', 'admin');
|
define('AREA', 'admin');
|
||||||
|
|||||||
@@ -1,35 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Panel
|
* @package Panel
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Required code
|
// Required code
|
||||||
|
|
||||||
define('AREA', 'customer');
|
define('AREA', 'customer');
|
||||||
require ("./lib/init.php");
|
require ("./lib/init.php");
|
||||||
require ("./lib/class_apsparser.php");
|
require ("./lib/class_apsparser.php");
|
||||||
$Id = 0;
|
$Id = 0;
|
||||||
|
|
||||||
if(isset($_GET['id']))$Id = (int)$_GET['id'];
|
if(isset($_GET['id']))$Id = (int)$_GET['id'];
|
||||||
|
|
||||||
if(isset($_POST['id']))$Id = (int)$_POST['id'];
|
if(isset($_POST['id']))$Id = (int)$_POST['id'];
|
||||||
eval("echo \"" . getTemplate("aps/header") . "\";");
|
eval("echo \"" . getTemplate("aps/header") . "\";");
|
||||||
$Aps = new ApsParser($userinfo, $settings, $db);
|
$Aps = new ApsParser($userinfo, $settings, $db);
|
||||||
$Aps->MainHandler($action);
|
$Aps->MainHandler($action);
|
||||||
eval("echo \"" . getTemplate("aps/footer") . "\";");
|
eval("echo \"" . getTemplate("aps/footer") . "\";");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,306 +1,306 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Panel
|
* @package Panel
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Required code
|
// Required code
|
||||||
|
|
||||||
define('AREA', 'customer');
|
define('AREA', 'customer');
|
||||||
require ("./lib/init.php");
|
require ("./lib/init.php");
|
||||||
|
|
||||||
// Create new autoresponder
|
// Create new autoresponder
|
||||||
|
|
||||||
if($action == "add")
|
if($action == "add")
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$account = trim($_POST['account']);
|
$account = trim($_POST['account']);
|
||||||
$subject = trim($_POST['subject']);
|
$subject = trim($_POST['subject']);
|
||||||
$message = trim($_POST['message']);
|
$message = trim($_POST['message']);
|
||||||
|
|
||||||
$date_from_off = isset($_POST['date_from_off']) ? -1 : 0;
|
$date_from_off = isset($_POST['date_from_off']) ? -1 : 0;
|
||||||
$date_until_off = isset($_POST['date_from_off']) ? -1 : 0;
|
$date_until_off = isset($_POST['date_from_off']) ? -1 : 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @TODO validate date (DD-MM-YYYY)
|
* @TODO validate date (DD-MM-YYYY)
|
||||||
*/
|
*/
|
||||||
$ts_from = -1;
|
$ts_from = -1;
|
||||||
$ts_until = -1;
|
$ts_until = -1;
|
||||||
|
|
||||||
if($date_from_off > -1)
|
if($date_from_off > -1)
|
||||||
{
|
{
|
||||||
$date_from = $_POST['date_from'];
|
$date_from = $_POST['date_from'];
|
||||||
$ts_from = mktime(0, 0, 0, substr($date_from, 3, 2), substr($date_from, 0, 2), substr($date_from, 6, 4));
|
$ts_from = mktime(0, 0, 0, substr($date_from, 3, 2), substr($date_from, 0, 2), substr($date_from, 6, 4));
|
||||||
}
|
}
|
||||||
if($date_until_off > -1)
|
if($date_until_off > -1)
|
||||||
{
|
{
|
||||||
$date_until = $_POST['date_until'];
|
$date_until = $_POST['date_until'];
|
||||||
$ts_until = mktime(0, 0, 0, substr($date_until, 3, 2), substr($date_until, 0, 2), substr($date_until, 6, 4));
|
$ts_until = mktime(0, 0, 0, substr($date_until, 3, 2), substr($date_until, 0, 2), substr($date_until, 6, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($account)
|
if(empty($account)
|
||||||
|| empty($subject)
|
|| empty($subject)
|
||||||
|| empty($message))
|
|| empty($message))
|
||||||
{
|
{
|
||||||
standard_error('missingfields');
|
standard_error('missingfields');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Does account exist?
|
// Does account exist?
|
||||||
|
|
||||||
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_USERS . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_USERS . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
||||||
|
|
||||||
if($db->num_rows($result) == 0)
|
if($db->num_rows($result) == 0)
|
||||||
{
|
{
|
||||||
standard_error('accountnotexisting');
|
standard_error('accountnotexisting');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Does autoresponder exist?
|
// Does autoresponder exist?
|
||||||
|
|
||||||
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
||||||
|
|
||||||
if($db->num_rows($result) == 1)
|
if($db->num_rows($result) == 1)
|
||||||
{
|
{
|
||||||
standard_error('autoresponderalreadyexists');
|
standard_error('autoresponderalreadyexists');
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->query("INSERT INTO `" . TABLE_MAIL_AUTORESPONDER . "`
|
$db->query("INSERT INTO `" . TABLE_MAIL_AUTORESPONDER . "`
|
||||||
SET `email` = '" . $db->escape($account) . "',
|
SET `email` = '" . $db->escape($account) . "',
|
||||||
`message` = '" . $db->escape($message) . "',
|
`message` = '" . $db->escape($message) . "',
|
||||||
`enabled` = '" . (int)$_POST['active'] . "',
|
`enabled` = '" . (int)$_POST['active'] . "',
|
||||||
`ts_from` = '" . (int)$ts_from . "',
|
`ts_from` = '" . (int)$ts_from . "',
|
||||||
`ts_until` = '" . (int)$ts_until . "',
|
`ts_until` = '" . (int)$ts_until . "',
|
||||||
`subject` = '" . $db->escape($subject) . "',
|
`subject` = '" . $db->escape($subject) . "',
|
||||||
`customerid` = '" . $db->escape((int)$userinfo['customerid']) . "'
|
`customerid` = '" . $db->escape((int)$userinfo['customerid']) . "'
|
||||||
");
|
");
|
||||||
redirectTo($filename, Array('s' => $s));
|
redirectTo($filename, Array('s' => $s));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get accounts
|
// Get accounts
|
||||||
|
|
||||||
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_USERS . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` NOT IN (SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "`) ORDER BY email ASC");
|
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_USERS . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` NOT IN (SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "`) ORDER BY email ASC");
|
||||||
|
|
||||||
if($db->num_rows($result) == 0)
|
if($db->num_rows($result) == 0)
|
||||||
{
|
{
|
||||||
standard_error('noemailaccount');
|
standard_error('noemailaccount');
|
||||||
}
|
}
|
||||||
|
|
||||||
$accounts = '';
|
$accounts = '';
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
$accounts.= "<option value=\"" . $row['email'] . "\">" . $row['email'] . "</option>";
|
$accounts.= "<option value=\"" . $row['email'] . "\">" . $row['email'] . "</option>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$date_from_off = makecheckbox('date_from_off', $lng['panel']['not_activated'], '-1', false, '-1', true, true);
|
$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_from_off', $lng['panel']['not_activated'], '-1', false, '-1', true, true);
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("email/autoresponder_add") . "\";");
|
eval("echo \"" . getTemplate("email/autoresponder_add") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Edit autoresponder
|
// Edit autoresponder
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
if($action == "edit")
|
if($action == "edit")
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$account = trim($_POST['account']);
|
$account = trim($_POST['account']);
|
||||||
$subject = trim($_POST['subject']);
|
$subject = trim($_POST['subject']);
|
||||||
$message = trim($_POST['message']);
|
$message = trim($_POST['message']);
|
||||||
|
|
||||||
$date_from_off = isset($_POST['date_from_off']) ? -1 : 0;
|
$date_from_off = isset($_POST['date_from_off']) ? -1 : 0;
|
||||||
$date_until_off = isset($_POST['date_from_off']) ? -1 : 0;
|
$date_until_off = isset($_POST['date_from_off']) ? -1 : 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @TODO validate date (DD-MM-YYYY)
|
* @TODO validate date (DD-MM-YYYY)
|
||||||
*/
|
*/
|
||||||
$ts_from = -1;
|
$ts_from = -1;
|
||||||
$ts_until = -1;
|
$ts_until = -1;
|
||||||
|
|
||||||
if($date_from_off > -1)
|
if($date_from_off > -1)
|
||||||
{
|
{
|
||||||
$date_from = $_POST['date_from'];
|
$date_from = $_POST['date_from'];
|
||||||
$ts_from = mktime(0, 0, 0, substr($date_from, 3, 2), substr($date_from, 0, 2), substr($date_from, 6, 4));
|
$ts_from = mktime(0, 0, 0, substr($date_from, 3, 2), substr($date_from, 0, 2), substr($date_from, 6, 4));
|
||||||
}
|
}
|
||||||
if($date_until_off > -1)
|
if($date_until_off > -1)
|
||||||
{
|
{
|
||||||
$date_until = $_POST['date_until'];
|
$date_until = $_POST['date_until'];
|
||||||
$ts_until = mktime(0, 0, 0, substr($date_until, 3, 2), substr($date_until, 0, 2), substr($date_until, 6, 4));
|
$ts_until = mktime(0, 0, 0, substr($date_until, 3, 2), substr($date_until, 0, 2), substr($date_until, 6, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($account)
|
if(empty($account)
|
||||||
|| empty($subject)
|
|| empty($subject)
|
||||||
|| empty($message))
|
|| empty($message))
|
||||||
{
|
{
|
||||||
standard_error('missingfields');
|
standard_error('missingfields');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Does account exist?
|
// Does account exist?
|
||||||
|
|
||||||
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_USERS . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_USERS . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
||||||
|
|
||||||
if($db->num_rows($result) == 0)
|
if($db->num_rows($result) == 0)
|
||||||
{
|
{
|
||||||
standard_error('accountnotexisting');
|
standard_error('accountnotexisting');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Does autoresponder exist?
|
// Does autoresponder exist?
|
||||||
|
|
||||||
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
||||||
|
|
||||||
if($db->num_rows($result) == 0)
|
if($db->num_rows($result) == 0)
|
||||||
{
|
{
|
||||||
standard_error('invalidautoresponder');
|
standard_error('invalidautoresponder');
|
||||||
}
|
}
|
||||||
|
|
||||||
$ResponderActive = 0;
|
$ResponderActive = 0;
|
||||||
|
|
||||||
if(isset($_POST['active'])
|
if(isset($_POST['active'])
|
||||||
&& $_POST['active'] == '1')
|
&& $_POST['active'] == '1')
|
||||||
{
|
{
|
||||||
$ResponderActive = 1;
|
$ResponderActive = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->query("UPDATE `" . TABLE_MAIL_AUTORESPONDER . "`
|
$db->query("UPDATE `" . TABLE_MAIL_AUTORESPONDER . "`
|
||||||
SET `message` = '" . $db->escape($message) . "',
|
SET `message` = '" . $db->escape($message) . "',
|
||||||
`enabled` = '" . (int)$ResponderActive . "',
|
`enabled` = '" . (int)$ResponderActive . "',
|
||||||
`ts_from` = '" . (int)$ts_from . "',
|
`ts_from` = '" . (int)$ts_from . "',
|
||||||
`ts_until` = '" . (int)$ts_until . "',
|
`ts_until` = '" . (int)$ts_until . "',
|
||||||
`subject` = '" . $db->escape($subject) . "'
|
`subject` = '" . $db->escape($subject) . "'
|
||||||
WHERE `email` = '" . $db->escape($account) . "'
|
WHERE `email` = '" . $db->escape($account) . "'
|
||||||
AND `customerid` = '" . $db->escape((int)$userinfo['customerid']) . "'
|
AND `customerid` = '" . $db->escape((int)$userinfo['customerid']) . "'
|
||||||
");
|
");
|
||||||
redirectTo($filename, Array('s' => $s));
|
redirectTo($filename, Array('s' => $s));
|
||||||
}
|
}
|
||||||
|
|
||||||
$email = trim(htmlspecialchars($_GET['email']));
|
$email = trim(htmlspecialchars($_GET['email']));
|
||||||
|
|
||||||
// Get account data
|
// Get account data
|
||||||
|
|
||||||
$result = $db->query("SELECT * FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($email) . "' LIMIT 0,1");
|
$result = $db->query("SELECT * FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($email) . "' LIMIT 0,1");
|
||||||
|
|
||||||
if($db->num_rows($result) == 0)
|
if($db->num_rows($result) == 0)
|
||||||
{
|
{
|
||||||
standard_error('invalidautoresponder');
|
standard_error('invalidautoresponder');
|
||||||
}
|
}
|
||||||
|
|
||||||
$row = $db->fetch_array($result);
|
$row = $db->fetch_array($result);
|
||||||
$subject = htmlspecialchars($row['subject']);
|
$subject = htmlspecialchars($row['subject']);
|
||||||
$message = htmlspecialchars($row['message']);
|
$message = htmlspecialchars($row['message']);
|
||||||
|
|
||||||
$date_from = (int)$row['date_from'];
|
$date_from = (int)$row['date_from'];
|
||||||
$date_until = (int)$row['date_until'];
|
$date_until = (int)$row['date_until'];
|
||||||
|
|
||||||
if($date_from == -1)
|
if($date_from == -1)
|
||||||
{
|
{
|
||||||
$deactivated = '-1';
|
$deactivated = '-1';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$deactivated = '0';
|
$deactivated = '0';
|
||||||
$date_from = date('d-m-Y', $date_from);
|
$date_from = date('d-m-Y', $date_from);
|
||||||
}
|
}
|
||||||
$date_from_off = makecheckbox('date_from_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true);
|
$date_from_off = makecheckbox('date_from_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true);
|
||||||
|
|
||||||
if($date_until == -1)
|
if($date_until == -1)
|
||||||
{
|
{
|
||||||
$deactivated = '-1';
|
$deactivated = '-1';
|
||||||
$date_until = '-1';
|
$date_until = '-1';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$deactivated = '0';
|
$deactivated = '0';
|
||||||
$date_until = date('d-m-Y', $date_until);
|
$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_from_off = makecheckbox('date_until_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true);
|
||||||
|
|
||||||
$checked = '';
|
$checked = '';
|
||||||
|
|
||||||
if($row['enabled'] == 1)
|
if($row['enabled'] == 1)
|
||||||
{
|
{
|
||||||
$checked = "checked=\"checked\"";
|
$checked = "checked=\"checked\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("email/autoresponder_edit") . "\";");
|
eval("echo \"" . getTemplate("email/autoresponder_edit") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete autoresponder
|
// Delete autoresponder
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
if($action == "delete")
|
if($action == "delete")
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$account = trim($_POST['account']);
|
$account = trim($_POST['account']);
|
||||||
|
|
||||||
// Does autoresponder exist?
|
// Does autoresponder exist?
|
||||||
|
|
||||||
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
||||||
|
|
||||||
if($db->num_rows($result) == 0)
|
if($db->num_rows($result) == 0)
|
||||||
{
|
{
|
||||||
standard_error('invalidautoresponder');
|
standard_error('invalidautoresponder');
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->query("DELETE FROM `" . TABLE_MAIL_AUTORESPONDER . "`
|
$db->query("DELETE FROM `" . TABLE_MAIL_AUTORESPONDER . "`
|
||||||
WHERE `email` = '" . $db->escape($account) . "'
|
WHERE `email` = '" . $db->escape($account) . "'
|
||||||
AND `customerid` = '" . $db->escape((int)$userinfo['customerid']) . "'
|
AND `customerid` = '" . $db->escape((int)$userinfo['customerid']) . "'
|
||||||
");
|
");
|
||||||
redirectTo($filename, Array('s' => $s));
|
redirectTo($filename, Array('s' => $s));
|
||||||
}
|
}
|
||||||
|
|
||||||
$email = trim(htmlspecialchars($_GET['email']));
|
$email = trim(htmlspecialchars($_GET['email']));
|
||||||
ask_yesno('autoresponderdelete', $filename, array('action' => $action, 'account' => $email));
|
ask_yesno('autoresponderdelete', $filename, array('action' => $action, 'account' => $email));
|
||||||
}
|
}
|
||||||
|
|
||||||
// List existing autoresponders
|
// List existing autoresponders
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$autoresponder = '';
|
$autoresponder = '';
|
||||||
$result = $db->query("SELECT * FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' ORDER BY email ASC");
|
$result = $db->query("SELECT * FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' ORDER BY email ASC");
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
if($result['date_from'] == -1 && $result['date_until'] == -1)
|
if($result['date_from'] == -1 && $result['date_until'] == -1)
|
||||||
{
|
{
|
||||||
$activated_date = $lng['panel']['not_activated'];
|
$activated_date = $lng['panel']['not_activated'];
|
||||||
}
|
}
|
||||||
elseif($result['date_from'] == -1 && $result['date_until'] != -1)
|
elseif($result['date_from'] == -1 && $result['date_until'] != -1)
|
||||||
{
|
{
|
||||||
$activated_date = $lng['autoresponder']['date_until'].': '.date('d-m-Y', $result['date_until']);
|
$activated_date = $lng['autoresponder']['date_until'].': '.date('d-m-Y', $result['date_until']);
|
||||||
}
|
}
|
||||||
elseif($result['date_from'] != -1 && $result['date_until'] == -1)
|
elseif($result['date_from'] != -1 && $result['date_until'] == -1)
|
||||||
{
|
{
|
||||||
$activated_date = $lng['autoresponder']['date_from'].': '.date('d-m-Y', $result['date_from']);
|
$activated_date = $lng['autoresponder']['date_from'].': '.date('d-m-Y', $result['date_from']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$activated_date = $date('d-m-Y', $result['date_from']) . ' - ' . date('d-m-Y', $result['date_until']);
|
$activated_date = $date('d-m-Y', $result['date_from']) . ' - ' . date('d-m-Y', $result['date_until']);
|
||||||
}
|
}
|
||||||
eval("\$autoresponder.=\"" . getTemplate("email/autoresponder_autoresponder") . "\";");
|
eval("\$autoresponder.=\"" . getTemplate("email/autoresponder_autoresponder") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("email/autoresponder") . "\";");
|
eval("echo \"" . getTemplate("email/autoresponder") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,184 +1,184 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Panel
|
* @package Panel
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('AREA', 'customer');
|
define('AREA', 'customer');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include our init.php, which manages Sessions, Language etc.
|
* Include our init.php, which manages Sessions, Language etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ("./lib/init.php");
|
require ("./lib/init.php");
|
||||||
|
|
||||||
if($action == 'logout')
|
if($action == 'logout')
|
||||||
{
|
{
|
||||||
$log->logAction(USR_ACTION, LOG_NOTICE, "logged out");
|
$log->logAction(USR_ACTION, LOG_NOTICE, "logged out");
|
||||||
|
|
||||||
if($settings['session']['allow_multiple_login'] == '1')
|
if($settings['session']['allow_multiple_login'] == '1')
|
||||||
{
|
{
|
||||||
$db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['customerid'] . "' AND `adminsession` = '0' AND `hash` = '" . $s . "'");
|
$db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['customerid'] . "' AND `adminsession` = '0' AND `hash` = '" . $s . "'");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['customerid'] . "' AND `adminsession` = '0'");
|
$db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['customerid'] . "' AND `adminsession` = '0'");
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectTo('index.php');
|
redirectTo('index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($page == 'overview')
|
if($page == 'overview')
|
||||||
{
|
{
|
||||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_index");
|
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_index");
|
||||||
$domains = '';
|
$domains = '';
|
||||||
$result = $db->query("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `parentdomainid`='0' AND `id` <> '" . (int)$userinfo['standardsubdomain'] . "' ");
|
$result = $db->query("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `parentdomainid`='0' AND `id` <> '" . (int)$userinfo['standardsubdomain'] . "' ");
|
||||||
$domainArray = array();
|
$domainArray = array();
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
$domainArray[] = $idna_convert->decode($row['domain']);
|
$domainArray[] = $idna_convert->decode($row['domain']);
|
||||||
}
|
}
|
||||||
|
|
||||||
natsort($domainArray);
|
natsort($domainArray);
|
||||||
$domains = implode(', ', $domainArray);
|
$domains = implode(', ', $domainArray);
|
||||||
$userinfo['email'] = $idna_convert->decode($userinfo['email']);
|
$userinfo['email'] = $idna_convert->decode($userinfo['email']);
|
||||||
$yesterday = time() - (60 * 60 * 24);
|
$yesterday = time() - (60 * 60 * 24);
|
||||||
$month = date('M Y', $yesterday);
|
$month = date('M Y', $yesterday);
|
||||||
|
|
||||||
/* $traffic=$db->query_first("SELECT SUM(http) AS http_sum, SUM(ftp_up) AS ftp_up_sum, SUM(ftp_down) AS ftp_down_sum, SUM(mail) AS mail_sum FROM ".TABLE_PANEL_TRAFFIC." WHERE year='".date('Y')."' AND month='".date('m')."' AND day<='".date('d')."' AND customerid='".$userinfo['customerid']."'");
|
/* $traffic=$db->query_first("SELECT SUM(http) AS http_sum, SUM(ftp_up) AS ftp_up_sum, SUM(ftp_down) AS ftp_down_sum, SUM(mail) AS mail_sum FROM ".TABLE_PANEL_TRAFFIC." WHERE year='".date('Y')."' AND month='".date('m')."' AND day<='".date('d')."' AND customerid='".$userinfo['customerid']."'");
|
||||||
$userinfo['traffic_used']=$traffic['http_sum']+$traffic['ftp_up_sum']+$traffic['ftp_down_sum']+$traffic['mail_sum'];*/
|
$userinfo['traffic_used']=$traffic['http_sum']+$traffic['ftp_up_sum']+$traffic['ftp_down_sum']+$traffic['mail_sum'];*/
|
||||||
|
|
||||||
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, $settings['panel']['decimal_places']);
|
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, $settings['panel']['decimal_places']);
|
||||||
$userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
|
$userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
|
||||||
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||||
$userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps tickets subdomains aps_packages');
|
$userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps tickets subdomains aps_packages');
|
||||||
$opentickets = 0;
|
$opentickets = 0;
|
||||||
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||||
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
||||||
AND `answerto` = "0"
|
AND `answerto` = "0"
|
||||||
AND (`status` = "0" OR `status` = "2")
|
AND (`status` = "0" OR `status` = "2")
|
||||||
AND `lastreplier`="1"');
|
AND `lastreplier`="1"');
|
||||||
$awaitingtickets = $opentickets['count'];
|
$awaitingtickets = $opentickets['count'];
|
||||||
$awaitingtickets_text = '';
|
$awaitingtickets_text = '';
|
||||||
|
|
||||||
if($opentickets > 0)
|
if($opentickets > 0)
|
||||||
{
|
{
|
||||||
$awaitingtickets_text = strtr($lng['ticket']['awaitingticketreply'], array('%s' => '<a href="customer_tickets.php?page=tickets&s=' . $s . '">' . $opentickets['count'] . '</a>'));
|
$awaitingtickets_text = strtr($lng['ticket']['awaitingticketreply'], array('%s' => '<a href="customer_tickets.php?page=tickets&s=' . $s . '">' . $opentickets['count'] . '</a>'));
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("index/index") . "\";");
|
eval("echo \"" . getTemplate("index/index") . "\";");
|
||||||
}
|
}
|
||||||
elseif($page == 'change_password')
|
elseif($page == 'change_password')
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$old_password = validate($_POST['old_password'], 'old password');
|
$old_password = validate($_POST['old_password'], 'old password');
|
||||||
|
|
||||||
if(md5($old_password) != $userinfo['password'])
|
if(md5($old_password) != $userinfo['password'])
|
||||||
{
|
{
|
||||||
standard_error('oldpasswordnotcorrect');
|
standard_error('oldpasswordnotcorrect');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$new_password = validate($_POST['new_password'], 'new password');
|
$new_password = validate($_POST['new_password'], 'new password');
|
||||||
$new_password_confirm = validate($_POST['new_password_confirm'], 'new password confirm');
|
$new_password_confirm = validate($_POST['new_password_confirm'], 'new password confirm');
|
||||||
|
|
||||||
if($old_password == '')
|
if($old_password == '')
|
||||||
{
|
{
|
||||||
standard_error(array('stringisempty', 'oldpassword'));
|
standard_error(array('stringisempty', 'oldpassword'));
|
||||||
}
|
}
|
||||||
elseif($new_password == '')
|
elseif($new_password == '')
|
||||||
{
|
{
|
||||||
standard_error(array('stringisempty', 'newpassword'));
|
standard_error(array('stringisempty', 'newpassword'));
|
||||||
}
|
}
|
||||||
elseif($new_password_confirm == '')
|
elseif($new_password_confirm == '')
|
||||||
{
|
{
|
||||||
standard_error(array('stringisempty', 'newpasswordconfirm'));
|
standard_error(array('stringisempty', 'newpasswordconfirm'));
|
||||||
}
|
}
|
||||||
elseif($new_password != $new_password_confirm)
|
elseif($new_password != $new_password_confirm)
|
||||||
{
|
{
|
||||||
standard_error('newpasswordconfirmerror');
|
standard_error('newpasswordconfirmerror');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `password`='" . md5($new_password) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `password`='" . md5($old_password) . "'");
|
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `password`='" . md5($new_password) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `password`='" . md5($old_password) . "'");
|
||||||
$log->logAction(USR_ACTION, LOG_NOTICE, 'changed password');
|
$log->logAction(USR_ACTION, LOG_NOTICE, 'changed password');
|
||||||
|
|
||||||
if(isset($_POST['change_main_ftp'])
|
if(isset($_POST['change_main_ftp'])
|
||||||
&& $_POST['change_main_ftp'] == 'true')
|
&& $_POST['change_main_ftp'] == 'true')
|
||||||
{
|
{
|
||||||
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `password`=ENCRYPT('" . $db->escape($new_password) . "') WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `username`='" . $db->escape($userinfo['loginname']) . "'");
|
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `password`=ENCRYPT('" . $db->escape($new_password) . "') WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `username`='" . $db->escape($userinfo['loginname']) . "'");
|
||||||
$log->logAction(USR_ACTION, LOG_NOTICE, 'changed main ftp password');
|
$log->logAction(USR_ACTION, LOG_NOTICE, 'changed main ftp password');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['change_webalizer'])
|
if(isset($_POST['change_webalizer'])
|
||||||
&& $_POST['change_webalizer'] == 'true')
|
&& $_POST['change_webalizer'] == 'true')
|
||||||
{
|
{
|
||||||
if(CRYPT_STD_DES == 1)
|
if(CRYPT_STD_DES == 1)
|
||||||
{
|
{
|
||||||
$saltfordescrypt = substr(md5(uniqid(microtime(), 1)), 4, 2);
|
$saltfordescrypt = substr(md5(uniqid(microtime(), 1)), 4, 2);
|
||||||
$new_webalizer_password = crypt($new_password, $saltfordescrypt);
|
$new_webalizer_password = crypt($new_password, $saltfordescrypt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$new_webalizer_password = crypt($new_password);
|
$new_webalizer_password = crypt($new_password);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_HTPASSWDS . "` SET `password`='" . $db->escape($new_webalizer_password) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `username`='" . $db->escape($userinfo['loginname']) . "'");
|
$db->query("UPDATE `" . TABLE_PANEL_HTPASSWDS . "` SET `password`='" . $db->escape($new_webalizer_password) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `username`='" . $db->escape($userinfo['loginname']) . "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectTo($filename, Array('s' => $s));
|
redirectTo($filename, Array('s' => $s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
eval("echo \"" . getTemplate("index/change_password") . "\";");
|
eval("echo \"" . getTemplate("index/change_password") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($page == 'change_language')
|
elseif($page == 'change_language')
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$def_language = validate($_POST['def_language'], 'default language');
|
$def_language = validate($_POST['def_language'], 'default language');
|
||||||
|
|
||||||
if(isset($languages[$def_language]))
|
if(isset($languages[$def_language]))
|
||||||
{
|
{
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `def_language`='" . $db->escape($def_language) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `def_language`='" . $db->escape($def_language) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SESSIONS . "` SET `language`='" . $db->escape($def_language) . "' WHERE `hash`='" . $db->escape($s) . "'");
|
$db->query("UPDATE `" . TABLE_PANEL_SESSIONS . "` SET `language`='" . $db->escape($def_language) . "' WHERE `hash`='" . $db->escape($s) . "'");
|
||||||
$log->logAction(USR_ACTION, LOG_NOTICE, "changed default language to '" . $def_language . "'");
|
$log->logAction(USR_ACTION, LOG_NOTICE, "changed default language to '" . $def_language . "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectTo($filename, Array('s' => $s));
|
redirectTo($filename, Array('s' => $s));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$language_options = '';
|
$language_options = '';
|
||||||
|
|
||||||
while(list($language_file, $language_name) = each($languages))
|
while(list($language_file, $language_name) = each($languages))
|
||||||
{
|
{
|
||||||
$language_options.= makeoption($language_name, $language_file, $userinfo['def_language'], true);
|
$language_options.= makeoption($language_name, $language_file, $userinfo['def_language'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("index/change_language") . "\";");
|
eval("echo \"" . getTemplate("index/change_language") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,414 +1,414 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Panel
|
* @package Panel
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('AREA', 'customer');
|
define('AREA', 'customer');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include our init.php, which manages Sessions, Language etc.
|
* Include our init.php, which manages Sessions, Language etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ("./lib/init.php");
|
require ("./lib/init.php");
|
||||||
|
|
||||||
if(isset($_POST['id']))
|
if(isset($_POST['id']))
|
||||||
{
|
{
|
||||||
$id = intval($_POST['id']);
|
$id = intval($_POST['id']);
|
||||||
}
|
}
|
||||||
elseif(isset($_GET['id']))
|
elseif(isset($_GET['id']))
|
||||||
{
|
{
|
||||||
$id = intval($_GET['id']);
|
$id = intval($_GET['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($page == 'overview')
|
if($page == 'overview')
|
||||||
{
|
{
|
||||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_tickets");
|
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_tickets");
|
||||||
eval("echo \"" . getTemplate("ticket/ticket") . "\";");
|
eval("echo \"" . getTemplate("ticket/ticket") . "\";");
|
||||||
}
|
}
|
||||||
elseif($page == 'tickets')
|
elseif($page == 'tickets')
|
||||||
{
|
{
|
||||||
if($action == '')
|
if($action == '')
|
||||||
{
|
{
|
||||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_tickets::tickets");
|
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_tickets::tickets");
|
||||||
$fields = array(
|
$fields = array(
|
||||||
'status' => $lng['ticket']['status'],
|
'status' => $lng['ticket']['status'],
|
||||||
'priority' => $lng['ticket']['priority'],
|
'priority' => $lng['ticket']['priority'],
|
||||||
'lastchange' => $lng['ticket']['lastchange'],
|
'lastchange' => $lng['ticket']['lastchange'],
|
||||||
'ticket_answers' => $lng['ticket']['ticket_answers'],
|
'ticket_answers' => $lng['ticket']['ticket_answers'],
|
||||||
'subject' => $lng['ticket']['subject'],
|
'subject' => $lng['ticket']['subject'],
|
||||||
'lastreplier' => $lng['ticket']['lastreplier']
|
'lastreplier' => $lng['ticket']['lastreplier']
|
||||||
);
|
);
|
||||||
$paging = new paging($userinfo, $db, TABLE_PANEL_TICKETS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
$paging = new paging($userinfo, $db, TABLE_PANEL_TICKETS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||||
$paging->sortfield = 'lastchange';
|
$paging->sortfield = 'lastchange';
|
||||||
$paging->sortorder = 'desc';
|
$paging->sortorder = 'desc';
|
||||||
$result = $db->query('SELECT `main`.`id`, (SELECT COUNT(`sub`.`id`) FROM `' . TABLE_PANEL_TICKETS . '` `sub` WHERE `sub`.`answerto` = `main`.`id`) as `ticket_answers`, `main`.`lastchange`, `main`.`subject`, `main`.`status`, `main`.`lastreplier`, `main`.`priority` FROM `' . TABLE_PANEL_TICKETS . '` as `main` WHERE `main`.`answerto` = "0" AND `archived` = "0" AND `customerid`="' . (int)$userinfo['customerid'] . '" AND `adminid`="' . (int)$userinfo['adminid'] . '" ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
$result = $db->query('SELECT `main`.`id`, (SELECT COUNT(`sub`.`id`) FROM `' . TABLE_PANEL_TICKETS . '` `sub` WHERE `sub`.`answerto` = `main`.`id`) as `ticket_answers`, `main`.`lastchange`, `main`.`subject`, `main`.`status`, `main`.`lastreplier`, `main`.`priority` FROM `' . TABLE_PANEL_TICKETS . '` as `main` WHERE `main`.`answerto` = "0" AND `archived` = "0" AND `customerid`="' . (int)$userinfo['customerid'] . '" AND `adminid`="' . (int)$userinfo['adminid'] . '" ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||||
$paging->setEntries($db->num_rows($result));
|
$paging->setEntries($db->num_rows($result));
|
||||||
$sortcode = $paging->getHtmlSortCode($lng);
|
$sortcode = $paging->getHtmlSortCode($lng);
|
||||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$tickets = '';
|
$tickets = '';
|
||||||
$tickets_count = 0;
|
$tickets_count = 0;
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
if($paging->checkDisplay($i))
|
if($paging->checkDisplay($i))
|
||||||
{
|
{
|
||||||
$tickets_count++;
|
$tickets_count++;
|
||||||
$row = htmlentities_array($row);
|
$row = htmlentities_array($row);
|
||||||
$row['lastchange'] = date("d.m.y H:i", $row['lastchange']);
|
$row['lastchange'] = date("d.m.y H:i", $row['lastchange']);
|
||||||
|
|
||||||
if($row['status'] >= 0
|
if($row['status'] >= 0
|
||||||
&& $row['status'] <= 2)
|
&& $row['status'] <= 2)
|
||||||
{
|
{
|
||||||
$reopen = 0;
|
$reopen = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$reopen = 1;
|
$reopen = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$row['status'] = ticket::getStatusText($lng, $row['status']);
|
$row['status'] = ticket::getStatusText($lng, $row['status']);
|
||||||
$row['priority'] = ticket::getPriorityText($lng, $row['priority']);
|
$row['priority'] = ticket::getPriorityText($lng, $row['priority']);
|
||||||
|
|
||||||
if($row['lastreplier'] == '1')
|
if($row['lastreplier'] == '1')
|
||||||
{
|
{
|
||||||
$row['lastreplier'] = $lng['ticket']['staff'];
|
$row['lastreplier'] = $lng['ticket']['staff'];
|
||||||
$cananswer = 1;
|
$cananswer = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$row['lastreplier'] = $lng['ticket']['customer'];
|
$row['lastreplier'] = $lng['ticket']['customer'];
|
||||||
$cananswer = 0;
|
$cananswer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strlen($row['subject']) > 20)
|
if(strlen($row['subject']) > 20)
|
||||||
{
|
{
|
||||||
$row['subject'] = substr($row['subject'], 0, 17) . '...';
|
$row['subject'] = substr($row['subject'], 0, 17) . '...';
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("\$tickets.=\"" . getTemplate("ticket/tickets_tickets") . "\";");
|
eval("\$tickets.=\"" . getTemplate("ticket/tickets_tickets") . "\";");
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$supportavailable = 0;
|
$supportavailable = 0;
|
||||||
$time = date("Hi", time());
|
$time = date("Hi", time());
|
||||||
$day = date("w", time());
|
$day = date("w", time());
|
||||||
$start = substr($settings['ticket']['worktime_begin'], 0, 2) . substr($settings['ticket']['worktime_begin'], 3, 2);
|
$start = substr($settings['ticket']['worktime_begin'], 0, 2) . substr($settings['ticket']['worktime_begin'], 3, 2);
|
||||||
$end = substr($settings['ticket']['worktime_end'], 0, 2) . substr($settings['ticket']['worktime_end'], 3, 2);
|
$end = substr($settings['ticket']['worktime_end'], 0, 2) . substr($settings['ticket']['worktime_end'], 3, 2);
|
||||||
|
|
||||||
if($time >= $start
|
if($time >= $start
|
||||||
&& $time <= $end)
|
&& $time <= $end)
|
||||||
{
|
{
|
||||||
$supportavailable = 1;
|
$supportavailable = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['ticket']['worktime_sat'] == "0"
|
if($settings['ticket']['worktime_sat'] == "0"
|
||||||
&& $day == "6")
|
&& $day == "6")
|
||||||
{
|
{
|
||||||
$supportavailable = 0;
|
$supportavailable = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['ticket']['worktime_sun'] == "0"
|
if($settings['ticket']['worktime_sun'] == "0"
|
||||||
&& $day == "0")
|
&& $day == "0")
|
||||||
{
|
{
|
||||||
$supportavailable = 0;
|
$supportavailable = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['ticket']['worktime_all'] == "1")
|
if($settings['ticket']['worktime_all'] == "1")
|
||||||
{
|
{
|
||||||
$supportavailable = 1;
|
$supportavailable = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ticketsopen = 0;
|
$ticketsopen = 0;
|
||||||
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||||
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
||||||
AND `answerto` = "0"
|
AND `answerto` = "0"
|
||||||
AND (`status` = "0" OR `status` = "1" OR `status` = "2")');
|
AND (`status` = "0" OR `status` = "1" OR `status` = "2")');
|
||||||
|
|
||||||
if($settings['ticket']['concurrently_open'] != - 1
|
if($settings['ticket']['concurrently_open'] != - 1
|
||||||
&& $settings['ticket']['concurrently_open'] != '')
|
&& $settings['ticket']['concurrently_open'] != '')
|
||||||
{
|
{
|
||||||
$notmorethanxopentickets = strtr($lng['ticket']['notmorethanxopentickets'], array('%s' => $settings['ticket']['concurrently_open']));
|
$notmorethanxopentickets = strtr($lng['ticket']['notmorethanxopentickets'], array('%s' => $settings['ticket']['concurrently_open']));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$notmorethanxopentickets = '';
|
$notmorethanxopentickets = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$ticketsopen = (int)$opentickets['count'];
|
$ticketsopen = (int)$opentickets['count'];
|
||||||
eval("echo \"" . getTemplate("ticket/tickets") . "\";");
|
eval("echo \"" . getTemplate("ticket/tickets") . "\";");
|
||||||
}
|
}
|
||||||
elseif($action == 'new')
|
elseif($action == 'new')
|
||||||
{
|
{
|
||||||
if($userinfo['tickets_used'] < $userinfo['tickets']
|
if($userinfo['tickets_used'] < $userinfo['tickets']
|
||||||
|| $userinfo['tickets'] == '-1')
|
|| $userinfo['tickets'] == '-1')
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$newticket = ticket::getInstanceOf($userinfo, $db, $settings, -1);
|
$newticket = ticket::getInstanceOf($userinfo, $db, $settings, -1);
|
||||||
$newticket->Set('subject', validate($_POST['subject'], 'subject'), true, false);
|
$newticket->Set('subject', validate($_POST['subject'], 'subject'), true, false);
|
||||||
$newticket->Set('priority', validate($_POST['priority'], 'priority'), true, false);
|
$newticket->Set('priority', validate($_POST['priority'], 'priority'), true, false);
|
||||||
$newticket->Set('category', validate($_POST['category'], 'category'), true, false);
|
$newticket->Set('category', validate($_POST['category'], 'category'), true, false);
|
||||||
$newticket->Set('customer', (int)$userinfo['customerid'], true, false);
|
$newticket->Set('customer', (int)$userinfo['customerid'], true, false);
|
||||||
$newticket->Set('admin', (int)$userinfo['adminid'], true, false);
|
$newticket->Set('admin', (int)$userinfo['adminid'], true, false);
|
||||||
$newticket->Set('message', validate(str_replace("\r\n", "\n", $_POST['message']), 'message', '/^[^\0]*$/'), true, false);
|
$newticket->Set('message', validate(str_replace("\r\n", "\n", $_POST['message']), 'message', '/^[^\0]*$/'), true, false);
|
||||||
|
|
||||||
if($newticket->Get('subject') == null)
|
if($newticket->Get('subject') == null)
|
||||||
{
|
{
|
||||||
standard_error(array('stringisempty', 'mysubject'));
|
standard_error(array('stringisempty', 'mysubject'));
|
||||||
}
|
}
|
||||||
elseif($newticket->Get('message') == null)
|
elseif($newticket->Get('message') == null)
|
||||||
{
|
{
|
||||||
standard_error(array('stringisempty', 'mymessage'));
|
standard_error(array('stringisempty', 'mymessage'));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$now = time();
|
$now = time();
|
||||||
$newticket->Set('dt', $now, true, true);
|
$newticket->Set('dt', $now, true, true);
|
||||||
$newticket->Set('lastchange', $now, true, true);
|
$newticket->Set('lastchange', $now, true, true);
|
||||||
$newticket->Set('ip', $_SERVER['REMOTE_ADDR'], true, true);
|
$newticket->Set('ip', $_SERVER['REMOTE_ADDR'], true, true);
|
||||||
$newticket->Set('status', '0', true, true);
|
$newticket->Set('status', '0', true, true);
|
||||||
$newticket->Set('lastreplier', '0', true, true);
|
$newticket->Set('lastreplier', '0', true, true);
|
||||||
$newticket->Set('by', '0', true, true);
|
$newticket->Set('by', '0', true, true);
|
||||||
$newticket->Insert();
|
$newticket->Insert();
|
||||||
$log->logAction(USR_ACTION, LOG_NOTICE, "opened support-ticket '" . $newticket->Get('subject') . "'");
|
$log->logAction(USR_ACTION, LOG_NOTICE, "opened support-ticket '" . $newticket->Get('subject') . "'");
|
||||||
$db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '`
|
$db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '`
|
||||||
SET `tickets_used`=`tickets_used`+1 WHERE `customerid`="' . (int)$userinfo['customerid'] . '"');
|
SET `tickets_used`=`tickets_used`+1 WHERE `customerid`="' . (int)$userinfo['customerid'] . '"');
|
||||||
|
|
||||||
// Customer mail
|
// Customer mail
|
||||||
|
|
||||||
$newticket->sendMail((int)$userinfo['customerid'], 'new_ticket_for_customer_subject', $lng['mails']['new_ticket_for_customer']['subject'], 'new_ticket_for_customer_mailbody', $lng['mails']['new_ticket_for_customer']['mailbody']);
|
$newticket->sendMail((int)$userinfo['customerid'], 'new_ticket_for_customer_subject', $lng['mails']['new_ticket_for_customer']['subject'], 'new_ticket_for_customer_mailbody', $lng['mails']['new_ticket_for_customer']['mailbody']);
|
||||||
|
|
||||||
// Admin mail
|
// Admin mail
|
||||||
|
|
||||||
$newticket->sendMail(-1, 'new_ticket_by_customer_subject', $lng['mails']['new_ticket_by_customer']['subject'], 'new_ticket_by_customer_mailbody', $lng['mails']['new_ticket_by_customer']['mailbody']);
|
$newticket->sendMail(-1, 'new_ticket_by_customer_subject', $lng['mails']['new_ticket_by_customer']['subject'], 'new_ticket_by_customer_mailbody', $lng['mails']['new_ticket_by_customer']['mailbody']);
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$categories = '';
|
$categories = '';
|
||||||
$result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `name` ASC');
|
$result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `name` ASC');
|
||||||
|
|
||||||
if(isset($result['name'])
|
if(isset($result['name'])
|
||||||
&& $result['name'] != '')
|
&& $result['name'] != '')
|
||||||
{
|
{
|
||||||
$result2 = $db->query('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `name` ASC');
|
$result2 = $db->query('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `name` ASC');
|
||||||
|
|
||||||
while($row = $db->fetch_array($result2))
|
while($row = $db->fetch_array($result2))
|
||||||
{
|
{
|
||||||
$categories.= makeoption($row['name'], $row['id']);
|
$categories.= makeoption($row['name'], $row['id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$categories = makeoption($lng['ticket']['no_cat'], '0');
|
$categories = makeoption($lng['ticket']['no_cat'], '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
$priorities = makeoption($lng['ticket']['unf_high'], '1');
|
$priorities = makeoption($lng['ticket']['unf_high'], '1');
|
||||||
$priorities.= makeoption($lng['ticket']['unf_normal'], '2');
|
$priorities.= makeoption($lng['ticket']['unf_normal'], '2');
|
||||||
$priorities.= makeoption($lng['ticket']['unf_low'], '3');
|
$priorities.= makeoption($lng['ticket']['unf_low'], '3');
|
||||||
$ticketsopen = 0;
|
$ticketsopen = 0;
|
||||||
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||||
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
||||||
AND `answerto` = "0"
|
AND `answerto` = "0"
|
||||||
AND (`status` = "0" OR `status` = "1" OR `status` = "2")');
|
AND (`status` = "0" OR `status` = "1" OR `status` = "2")');
|
||||||
|
|
||||||
if($settings['ticket']['concurrently_open'] != - 1
|
if($settings['ticket']['concurrently_open'] != - 1
|
||||||
&& $settings['ticket']['concurrently_open'] != '')
|
&& $settings['ticket']['concurrently_open'] != '')
|
||||||
{
|
{
|
||||||
$notmorethanxopentickets = strtr($lng['ticket']['notmorethanxopentickets'], array('%s' => $settings['ticket']['concurrently_open']));
|
$notmorethanxopentickets = strtr($lng['ticket']['notmorethanxopentickets'], array('%s' => $settings['ticket']['concurrently_open']));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$notmorethanxopentickets = '';
|
$notmorethanxopentickets = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$ticketsopen = (int)$opentickets['count'];
|
$ticketsopen = (int)$opentickets['count'];
|
||||||
eval("echo \"" . getTemplate("ticket/tickets_new") . "\";");
|
eval("echo \"" . getTemplate("ticket/tickets_new") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
standard_error('nomoreticketsavailable');
|
standard_error('nomoreticketsavailable');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($action == 'answer'
|
elseif($action == 'answer'
|
||||||
&& $id != 0)
|
&& $id != 0)
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$replyticket = ticket::getInstanceOf($userinfo, $db, $settings, -1);
|
$replyticket = ticket::getInstanceOf($userinfo, $db, $settings, -1);
|
||||||
$replyticket->Set('subject', validate($_POST['subject'], 'subject'), true, false);
|
$replyticket->Set('subject', validate($_POST['subject'], 'subject'), true, false);
|
||||||
$replyticket->Set('priority', validate($_POST['priority'], 'priority'), true, false);
|
$replyticket->Set('priority', validate($_POST['priority'], 'priority'), true, false);
|
||||||
$replyticket->Set('message', validate(str_replace("\r\n", "\n", $_POST['message']), 'message', '/^[^\0]*$/'), true, false);
|
$replyticket->Set('message', validate(str_replace("\r\n", "\n", $_POST['message']), 'message', '/^[^\0]*$/'), true, false);
|
||||||
|
|
||||||
if($replyticket->Get('message') == null)
|
if($replyticket->Get('message') == null)
|
||||||
{
|
{
|
||||||
standard_error(array('stringisempty', 'mymessage'));
|
standard_error(array('stringisempty', 'mymessage'));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$now = time();
|
$now = time();
|
||||||
$replyticket->Set('customerid', (int)$userinfo['customerid'], true, true);
|
$replyticket->Set('customerid', (int)$userinfo['customerid'], true, true);
|
||||||
$replyticket->Set('lastchange', $now, true, true);
|
$replyticket->Set('lastchange', $now, true, true);
|
||||||
$replyticket->Set('ip', $_SERVER['REMOTE_ADDR'], true, true);
|
$replyticket->Set('ip', $_SERVER['REMOTE_ADDR'], true, true);
|
||||||
$replyticket->Set('status', '1', true, true);
|
$replyticket->Set('status', '1', true, true);
|
||||||
$replyticket->Set('answerto', (int)$id, true, false);
|
$replyticket->Set('answerto', (int)$id, true, false);
|
||||||
$replyticket->Set('by', '0', true, true);
|
$replyticket->Set('by', '0', true, true);
|
||||||
$replyticket->Insert();
|
$replyticket->Insert();
|
||||||
|
|
||||||
// Update priority if changed
|
// Update priority if changed
|
||||||
|
|
||||||
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
||||||
|
|
||||||
if($replyticket->Get('priority') != $mainticket->Get('priority'))
|
if($replyticket->Get('priority') != $mainticket->Get('priority'))
|
||||||
{
|
{
|
||||||
$mainticket->Set('priority', $replyticket->Get('priority'), true);
|
$mainticket->Set('priority', $replyticket->Get('priority'), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$mainticket->Set('lastchange', $now);
|
$mainticket->Set('lastchange', $now);
|
||||||
$mainticket->Set('lastreplier', '0');
|
$mainticket->Set('lastreplier', '0');
|
||||||
$mainticket->Set('status', '1');
|
$mainticket->Set('status', '1');
|
||||||
$mainticket->Update();
|
$mainticket->Update();
|
||||||
$log->logAction(USR_ACTION, LOG_NOTICE, "answered support-ticket '" . $mainticket->Get('subject') . "'");
|
$log->logAction(USR_ACTION, LOG_NOTICE, "answered support-ticket '" . $mainticket->Get('subject') . "'");
|
||||||
$mainticket->sendMail(-1, 'new_reply_ticket_by_customer_subject', $lng['mails']['new_reply_ticket_by_customer']['subject'], 'new_reply_ticket_by_customer_mailbody', $lng['mails']['new_reply_ticket_by_customer']['mailbody']);
|
$mainticket->sendMail(-1, 'new_reply_ticket_by_customer_subject', $lng['mails']['new_reply_ticket_by_customer']['subject'], 'new_reply_ticket_by_customer_mailbody', $lng['mails']['new_reply_ticket_by_customer']['mailbody']);
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ticket_replies = '';
|
$ticket_replies = '';
|
||||||
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
||||||
$dt = date("d.m.Y H:i\h", $mainticket->Get('dt'));
|
$dt = date("d.m.Y H:i\h", $mainticket->Get('dt'));
|
||||||
$status = ticket::getStatusText($lng, $mainticket->Get('status'));
|
$status = ticket::getStatusText($lng, $mainticket->Get('status'));
|
||||||
|
|
||||||
if($mainticket->Get('status') >= 0
|
if($mainticket->Get('status') >= 0
|
||||||
&& $mainticket->Get('status') <= 2)
|
&& $mainticket->Get('status') <= 2)
|
||||||
{
|
{
|
||||||
$isclosed = 0;
|
$isclosed = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$isclosed = 1;
|
$isclosed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($mainticket->Get('by') == '1')
|
if($mainticket->Get('by') == '1')
|
||||||
{
|
{
|
||||||
$by = $lng['ticket']['staff'];
|
$by = $lng['ticket']['staff'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$by = $lng['ticket']['customer'];
|
$by = $lng['ticket']['customer'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$subject = $mainticket->Get('subject');
|
$subject = $mainticket->Get('subject');
|
||||||
$message = $mainticket->Get('message');
|
$message = $mainticket->Get('message');
|
||||||
eval("\$ticket_replies.=\"" . getTemplate("ticket/tickets_tickets_main") . "\";");
|
eval("\$ticket_replies.=\"" . getTemplate("ticket/tickets_tickets_main") . "\";");
|
||||||
$result = $db->query('SELECT `name` FROM `' . TABLE_PANEL_TICKET_CATS . '`
|
$result = $db->query('SELECT `name` FROM `' . TABLE_PANEL_TICKET_CATS . '`
|
||||||
WHERE `id`="' . (int)$mainticket->Get('category') . '"');
|
WHERE `id`="' . (int)$mainticket->Get('category') . '"');
|
||||||
$row = $db->fetch_array($result);
|
$row = $db->fetch_array($result);
|
||||||
$andere = $db->query('SELECT * FROM `' . TABLE_PANEL_TICKETS . '` WHERE `answerto`="' . (int)$id . '" ORDER BY `lastchange` ASC');
|
$andere = $db->query('SELECT * FROM `' . TABLE_PANEL_TICKETS . '` WHERE `answerto`="' . (int)$id . '" ORDER BY `lastchange` ASC');
|
||||||
|
|
||||||
while($row2 = $db->fetch_array($andere))
|
while($row2 = $db->fetch_array($andere))
|
||||||
{
|
{
|
||||||
$subticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$row2['id']);
|
$subticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$row2['id']);
|
||||||
$lastchange = date("d.m.Y H:i\h", $subticket->Get('lastchange'));
|
$lastchange = date("d.m.Y H:i\h", $subticket->Get('lastchange'));
|
||||||
|
|
||||||
if($subticket->Get('by') == '1')
|
if($subticket->Get('by') == '1')
|
||||||
{
|
{
|
||||||
$by = $lng['ticket']['staff'];
|
$by = $lng['ticket']['staff'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$by = $lng['ticket']['customer'];
|
$by = $lng['ticket']['customer'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$subject = $subticket->Get('subject');
|
$subject = $subticket->Get('subject');
|
||||||
$message = $subticket->Get('message');
|
$message = $subticket->Get('message');
|
||||||
eval("\$ticket_replies.=\"" . getTemplate("ticket/tickets_tickets_list") . "\";");
|
eval("\$ticket_replies.=\"" . getTemplate("ticket/tickets_tickets_list") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
$priorities = makeoption($lng['ticket']['high'], '1', $mainticket->Get('priority'), true, true);
|
$priorities = makeoption($lng['ticket']['high'], '1', $mainticket->Get('priority'), true, true);
|
||||||
$priorities.= makeoption($lng['ticket']['normal'], '2', $mainticket->Get('priority'), true, true);
|
$priorities.= makeoption($lng['ticket']['normal'], '2', $mainticket->Get('priority'), true, true);
|
||||||
$priorities.= makeoption($lng['ticket']['low'], '3', $mainticket->Get('priority'), true, true);
|
$priorities.= makeoption($lng['ticket']['low'], '3', $mainticket->Get('priority'), true, true);
|
||||||
$subject = $mainticket->Get('subject');
|
$subject = $mainticket->Get('subject');
|
||||||
$ticket_replies_count = $db->num_rows($andere) + 1;
|
$ticket_replies_count = $db->num_rows($andere) + 1;
|
||||||
|
|
||||||
// don't forget the main-ticket!
|
// don't forget the main-ticket!
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("ticket/tickets_reply") . "\";");
|
eval("echo \"" . getTemplate("ticket/tickets_reply") . "\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($action == 'close'
|
elseif($action == 'close'
|
||||||
&& $id != 0)
|
&& $id != 0)
|
||||||
{
|
{
|
||||||
if(isset($_POST['send'])
|
if(isset($_POST['send'])
|
||||||
&& $_POST['send'] == 'send')
|
&& $_POST['send'] == 'send')
|
||||||
{
|
{
|
||||||
$now = time();
|
$now = time();
|
||||||
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
||||||
$mainticket->Set('lastchange', $now, true, true);
|
$mainticket->Set('lastchange', $now, true, true);
|
||||||
$mainticket->Set('lastreplier', '0', true, true);
|
$mainticket->Set('lastreplier', '0', true, true);
|
||||||
$mainticket->Set('status', '3', true, true);
|
$mainticket->Set('status', '3', true, true);
|
||||||
$mainticket->Update();
|
$mainticket->Update();
|
||||||
$log->logAction(USR_ACTION, LOG_NOTICE, "closed support-ticket '" . $mainticket->Get('subject') . "'");
|
$log->logAction(USR_ACTION, LOG_NOTICE, "closed support-ticket '" . $mainticket->Get('subject') . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
||||||
ask_yesno('ticket_reallyclose', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $mainticket->Get('subject'));
|
ask_yesno('ticket_reallyclose', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $mainticket->Get('subject'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($action == 'reopen'
|
elseif($action == 'reopen'
|
||||||
&& $id != 0)
|
&& $id != 0)
|
||||||
{
|
{
|
||||||
$ticketsopen = 0;
|
$ticketsopen = 0;
|
||||||
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||||
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
||||||
AND `answerto` = "0"
|
AND `answerto` = "0"
|
||||||
AND (`status` = "0" OR `status` = "1" OR `status` = "2")');
|
AND (`status` = "0" OR `status` = "1" OR `status` = "2")');
|
||||||
$ticketsopen = (int)$opentickets['count'];
|
$ticketsopen = (int)$opentickets['count'];
|
||||||
|
|
||||||
if($ticketsopen > $settings['ticket']['concurrently_open']
|
if($ticketsopen > $settings['ticket']['concurrently_open']
|
||||||
&& $settings['ticket']['concurrently_open'] != - 1
|
&& $settings['ticket']['concurrently_open'] != - 1
|
||||||
&& $settings['ticket']['concurrently_open'] != '')
|
&& $settings['ticket']['concurrently_open'] != '')
|
||||||
{
|
{
|
||||||
standard_error('notmorethanxopentickets', $settings['ticket']['concurrently_open']);
|
standard_error('notmorethanxopentickets', $settings['ticket']['concurrently_open']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$now = time();
|
$now = time();
|
||||||
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
||||||
$mainticket->Set('lastchange', $now, true, true);
|
$mainticket->Set('lastchange', $now, true, true);
|
||||||
$mainticket->Set('lastreplier', '0', true, true);
|
$mainticket->Set('lastreplier', '0', true, true);
|
||||||
$mainticket->Set('status', '0', true, true);
|
$mainticket->Set('status', '0', true, true);
|
||||||
$mainticket->Update();
|
$mainticket->Update();
|
||||||
$log->logAction(USR_ACTION, LOG_NOTICE, "reopened support-ticket '" . $mainticket->Get('subject') . "'");
|
$log->logAction(USR_ACTION, LOG_NOTICE, "reopened support-ticket '" . $mainticket->Get('subject') . "'");
|
||||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,278 +1,278 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Panel
|
* @package Panel
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('AREA', 'customer');
|
define('AREA', 'customer');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include our init.php, which manages Sessions, Language etc.
|
* Include our init.php, which manages Sessions, Language etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ("./lib/init.php");
|
require ("./lib/init.php");
|
||||||
$traffic = '';
|
$traffic = '';
|
||||||
$month = null;
|
$month = null;
|
||||||
$year = null;
|
$year = null;
|
||||||
|
|
||||||
if(isset($_POST['month'])
|
if(isset($_POST['month'])
|
||||||
&& isset($_POST['year']))
|
&& isset($_POST['year']))
|
||||||
{
|
{
|
||||||
$month = intval($_POST['month']);
|
$month = intval($_POST['month']);
|
||||||
$year = intval($_POST['year']);
|
$year = intval($_POST['year']);
|
||||||
}
|
}
|
||||||
elseif(isset($_GET['month'])
|
elseif(isset($_GET['month'])
|
||||||
&& isset($_GET['year']))
|
&& isset($_GET['year']))
|
||||||
{
|
{
|
||||||
$month = intval($_GET['month']);
|
$month = intval($_GET['month']);
|
||||||
$year = intval($_GET['year']);
|
$year = intval($_GET['year']);
|
||||||
}
|
}
|
||||||
|
|
||||||
//BAM! $_GET???
|
//BAM! $_GET???
|
||||||
|
|
||||||
elseif (isset($_GET['page'])
|
elseif (isset($_GET['page'])
|
||||||
&& $_GET['page'] == "current")
|
&& $_GET['page'] == "current")
|
||||||
{
|
{
|
||||||
if(date('d') != '01')
|
if(date('d') != '01')
|
||||||
{
|
{
|
||||||
$month = date('m');
|
$month = date('m');
|
||||||
$year = date('Y');
|
$year = date('Y');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(date('m') == '01')
|
if(date('m') == '01')
|
||||||
{
|
{
|
||||||
$month = 12;
|
$month = 12;
|
||||||
$year = date('Y') - 1;
|
$year = date('Y') - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$month = date('m') - 1;
|
$month = date('m') - 1;
|
||||||
$year = date('Y');
|
$year = date('Y');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_null($month)
|
if(!is_null($month)
|
||||||
&& !is_null($year))
|
&& !is_null($year))
|
||||||
{
|
{
|
||||||
$traf['byte'] = 0;
|
$traf['byte'] = 0;
|
||||||
$result = $db->query("SELECT MAX(`http`), MAX(`ftp_up`+`ftp_down`), MAX(`mail`)
|
$result = $db->query("SELECT MAX(`http`), MAX(`ftp_up`+`ftp_down`), MAX(`mail`)
|
||||||
FROM `" . TABLE_PANEL_TRAFFIC . "`
|
FROM `" . TABLE_PANEL_TRAFFIC . "`
|
||||||
WHERE `customerid`='" . $userinfo['customerid'] . "'
|
WHERE `customerid`='" . $userinfo['customerid'] . "'
|
||||||
AND `month` = '" . $month . "'
|
AND `month` = '" . $month . "'
|
||||||
AND `year` = '" . $year . "'");
|
AND `year` = '" . $year . "'");
|
||||||
rsort($row = mysql_fetch_row($result));
|
rsort($row = mysql_fetch_row($result));
|
||||||
$traf['max'] = ($row[0] > $row[1] ? ($row[0] > $row[2] ? $row[0] : $row[2]) : ($row[1] > $row[2] ? $row[1] : $row[2]));;
|
$traf['max'] = ($row[0] > $row[1] ? ($row[0] > $row[2] ? $row[0] : $row[2]) : ($row[1] > $row[2] ? $row[1] : $row[2]));;
|
||||||
$result = $db->query("SELECT
|
$result = $db->query("SELECT
|
||||||
SUM(`http`) as 'http', SUM(`ftp_up`) AS 'ftp_up', SUM(`ftp_down`) as 'ftp_down', SUM(`mail`) as 'mail',
|
SUM(`http`) as 'http', SUM(`ftp_up`) AS 'ftp_up', SUM(`ftp_down`) as 'ftp_down', SUM(`mail`) as 'mail',
|
||||||
`day`, `month`, `year`
|
`day`, `month`, `year`
|
||||||
FROM `" . TABLE_PANEL_TRAFFIC . "`
|
FROM `" . TABLE_PANEL_TRAFFIC . "`
|
||||||
WHERE `customerid`='" . $userinfo['customerid'] . "'
|
WHERE `customerid`='" . $userinfo['customerid'] . "'
|
||||||
AND `month` = '" . $month . "' AND `year` = '" . $year . "'
|
AND `month` = '" . $month . "' AND `year` = '" . $year . "'
|
||||||
GROUP BY `day` ORDER BY `day` ASC");
|
GROUP BY `day` ORDER BY `day` ASC");
|
||||||
$traffic_complete['http'] = 0;
|
$traffic_complete['http'] = 0;
|
||||||
$traffic_complete['ftp'] = 0;
|
$traffic_complete['ftp'] = 0;
|
||||||
$traffic_complete['mail'] = 0;
|
$traffic_complete['mail'] = 0;
|
||||||
$show = '';
|
$show = '';
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
$http = $row['http'];
|
$http = $row['http'];
|
||||||
$ftp = $row['ftp_up'] + $row['ftp_down'];
|
$ftp = $row['ftp_up'] + $row['ftp_down'];
|
||||||
$mail = $row['mail'];
|
$mail = $row['mail'];
|
||||||
$traf['byte'] = $http + $ftp + $mail;
|
$traf['byte'] = $http + $ftp + $mail;
|
||||||
$traffic_complete['http']+= $http;
|
$traffic_complete['http']+= $http;
|
||||||
$traffic_complete['ftp']+= $ftp;
|
$traffic_complete['ftp']+= $ftp;
|
||||||
$traffic_complete['mail']+= $mail;
|
$traffic_complete['mail']+= $mail;
|
||||||
$traf['day'] = $row['day'];
|
$traf['day'] = $row['day'];
|
||||||
|
|
||||||
if(extension_loaded('bcmath'))
|
if(extension_loaded('bcmath'))
|
||||||
{
|
{
|
||||||
$traf['ftptext'] = bcdiv($row['ftp_up'], 1024, $settings['panel']['decimal_places']) . " MB up/ " . bcdiv($row['ftp_down'], 1024, $settings['panel']['decimal_places']) . " MB down (FTP)";
|
$traf['ftptext'] = bcdiv($row['ftp_up'], 1024, $settings['panel']['decimal_places']) . " MB up/ " . bcdiv($row['ftp_down'], 1024, $settings['panel']['decimal_places']) . " MB down (FTP)";
|
||||||
$traf['httptext'] = bcdiv($http, 1024, $settings['panel']['decimal_places']) . " MB (HTTP)";
|
$traf['httptext'] = bcdiv($http, 1024, $settings['panel']['decimal_places']) . " MB (HTTP)";
|
||||||
$traf['mailtext'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']) . " MB (Mail)";
|
$traf['mailtext'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']) . " MB (Mail)";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$traf['ftptext'] = round($row['ftp_up'] / 1024, $settings['panel']['decimal_places']) . " MB up/ " . round($row['ftp_down'] / 1024, $settings['panel']['decimal_places']) . " MB down (FTP)";
|
$traf['ftptext'] = round($row['ftp_up'] / 1024, $settings['panel']['decimal_places']) . " MB up/ " . round($row['ftp_down'] / 1024, $settings['panel']['decimal_places']) . " MB down (FTP)";
|
||||||
$traf['httptext'] = round($http / 1024, $settings['panel']['decimal_places']) . " MB (HTTP)";
|
$traf['httptext'] = round($http / 1024, $settings['panel']['decimal_places']) . " MB (HTTP)";
|
||||||
$traf['mailtext'] = round($mail / 1024, $settings['panel']['decimal_places']) . " MB (Mail)";
|
$traf['mailtext'] = round($mail / 1024, $settings['panel']['decimal_places']) . " MB (Mail)";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($traf['byte'] != 0
|
if($traf['byte'] != 0
|
||||||
&& $traf['max'] != 0)
|
&& $traf['max'] != 0)
|
||||||
{
|
{
|
||||||
$proz = $traf['max'] / 100;
|
$proz = $traf['max'] / 100;
|
||||||
$traf['http'] = round($http / $proz, 0);
|
$traf['http'] = round($http / $proz, 0);
|
||||||
$traf['ftp'] = round($ftp / $proz, 0);
|
$traf['ftp'] = round($ftp / $proz, 0);
|
||||||
$traf['mail'] = round($mail / $proz, 0);
|
$traf['mail'] = round($mail / $proz, 0);
|
||||||
|
|
||||||
if($traf['http'] == 0)
|
if($traf['http'] == 0)
|
||||||
{
|
{
|
||||||
$traf['http'] = 1;
|
$traf['http'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($traf['ftp'] == 0)
|
if($traf['ftp'] == 0)
|
||||||
{
|
{
|
||||||
$traf['ftp'] = 1;
|
$traf['ftp'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($traf['mail'] == 0)
|
if($traf['mail'] == 0)
|
||||||
{
|
{
|
||||||
$traf['mail'] = 1;
|
$traf['mail'] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$traf['http'] = 0;
|
$traf['http'] = 0;
|
||||||
$traf['ftp'] = 0;
|
$traf['ftp'] = 0;
|
||||||
$traf['mail'] = 0;
|
$traf['mail'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(extension_loaded('bcmath'))
|
if(extension_loaded('bcmath'))
|
||||||
{
|
{
|
||||||
$traf['byte'] = bcdiv($traf['byte'], 1024, $settings['panel']['decimal_places']);
|
$traf['byte'] = bcdiv($traf['byte'], 1024, $settings['panel']['decimal_places']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$traf['byte'] = round($traf['byte'] / 1024, $settings['panel']['decimal_places']);
|
$traf['byte'] = round($traf['byte'] / 1024, $settings['panel']['decimal_places']);
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("\$traffic.=\"" . getTemplate("traffic/traffic_month") . "\";");
|
eval("\$traffic.=\"" . getTemplate("traffic/traffic_month") . "\";");
|
||||||
$show = $lng['traffic']['months'][intval($row['month'])] . " " . $row['year'];
|
$show = $lng['traffic']['months'][intval($row['month'])] . " " . $row['year'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(extension_loaded('bcmath'))
|
if(extension_loaded('bcmath'))
|
||||||
{
|
{
|
||||||
$traffic_complete['http'] = bcdiv($traffic_complete['http'], 1024, $settings['panel']['decimal_places']);
|
$traffic_complete['http'] = bcdiv($traffic_complete['http'], 1024, $settings['panel']['decimal_places']);
|
||||||
$traffic_complete['ftp'] = bcdiv($traffic_complete['ftp'], 1024, $settings['panel']['decimal_places']);
|
$traffic_complete['ftp'] = bcdiv($traffic_complete['ftp'], 1024, $settings['panel']['decimal_places']);
|
||||||
$traffic_complete['mail'] = bcdiv($traffic_complete['mail'], 1024, $settings['panel']['decimal_places']);
|
$traffic_complete['mail'] = bcdiv($traffic_complete['mail'], 1024, $settings['panel']['decimal_places']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$traffic_complete['http'] = round($traffic_complete['http'] / 1024, $settings['panel']['decimal_places']);
|
$traffic_complete['http'] = round($traffic_complete['http'] / 1024, $settings['panel']['decimal_places']);
|
||||||
$traffic_complete['ftp'] = round($traffic_complete['ftp'] / 1024, $settings['panel']['decimal_places']);
|
$traffic_complete['ftp'] = round($traffic_complete['ftp'] / 1024, $settings['panel']['decimal_places']);
|
||||||
$traffic_complete['mail'] = round($traffic_complete['mail'] / 1024, $settings['panel']['decimal_places']);
|
$traffic_complete['mail'] = round($traffic_complete['mail'] / 1024, $settings['panel']['decimal_places']);
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("traffic/traffic_details") . "\";");
|
eval("echo \"" . getTemplate("traffic/traffic_details") . "\";");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result = $db->query("(SELECT SUM(`http`) as sum FROM `" . TABLE_PANEL_TRAFFIC . "`
|
$result = $db->query("(SELECT SUM(`http`) as sum FROM `" . TABLE_PANEL_TRAFFIC . "`
|
||||||
WHERE `customerid` = '" . $userinfo['customerid'] . "'
|
WHERE `customerid` = '" . $userinfo['customerid'] . "'
|
||||||
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12) UNION
|
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12) UNION
|
||||||
(SELECT SUM(`ftp_up`+`ftp_down`) FROM `" . TABLE_PANEL_TRAFFIC . "`
|
(SELECT SUM(`ftp_up`+`ftp_down`) FROM `" . TABLE_PANEL_TRAFFIC . "`
|
||||||
WHERE `customerid` = '" . $userinfo['customerid'] . "'
|
WHERE `customerid` = '" . $userinfo['customerid'] . "'
|
||||||
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12) UNION
|
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12) UNION
|
||||||
(SELECT SUM(`mail`) FROM `" . TABLE_PANEL_TRAFFIC . "`
|
(SELECT SUM(`mail`) FROM `" . TABLE_PANEL_TRAFFIC . "`
|
||||||
WHERE `customerid` = '" . $userinfo['customerid'] . "'
|
WHERE `customerid` = '" . $userinfo['customerid'] . "'
|
||||||
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12) ORDER BY sum DESC LIMIT 1");
|
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12) ORDER BY sum DESC LIMIT 1");
|
||||||
$row = $db->fetch_array($result);
|
$row = $db->fetch_array($result);
|
||||||
$traf['max'] = ($row[0] > $row[1] ? ($row[0] > $row[2] ? $row[0] : $row[2]) : ($row[1] > $row[2] ? $row[1] : $row[2]));;
|
$traf['max'] = ($row[0] > $row[1] ? ($row[0] > $row[2] ? $row[0] : $row[2]) : ($row[1] > $row[2] ? $row[1] : $row[2]));;
|
||||||
$result = $db->query("SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail
|
$result = $db->query("SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail
|
||||||
FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `customerid` = '" . $userinfo['customerid'] . "'
|
FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `customerid` = '" . $userinfo['customerid'] . "'
|
||||||
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12");
|
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12");
|
||||||
$traffic_complete['http'] = 0;
|
$traffic_complete['http'] = 0;
|
||||||
$traffic_complete['ftp'] = 0;
|
$traffic_complete['ftp'] = 0;
|
||||||
$traffic_complete['mail'] = 0;
|
$traffic_complete['mail'] = 0;
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
$http = $row['http'];
|
$http = $row['http'];
|
||||||
$ftp_up = $row['ftp_up'];
|
$ftp_up = $row['ftp_up'];
|
||||||
$ftp_down = $row['ftp_down'];
|
$ftp_down = $row['ftp_down'];
|
||||||
$mail = $row['mail'];
|
$mail = $row['mail'];
|
||||||
$traffic_complete['http']+= $http;
|
$traffic_complete['http']+= $http;
|
||||||
$traffic_complete['ftp']+= $ftp_up + $ftp_down;
|
$traffic_complete['ftp']+= $ftp_up + $ftp_down;
|
||||||
$traffic_complete['mail']+= $mail;
|
$traffic_complete['mail']+= $mail;
|
||||||
$traf['month'] = $row['month'];
|
$traf['month'] = $row['month'];
|
||||||
$traf['year'] = $row['year'];
|
$traf['year'] = $row['year'];
|
||||||
$traf['monthname'] = $lng['traffic']['months'][intval($row['month'])] . " " . $row['year'];
|
$traf['monthname'] = $lng['traffic']['months'][intval($row['month'])] . " " . $row['year'];
|
||||||
$traf['byte'] = $http + $ftp_up + $ftp_down + $mail;
|
$traf['byte'] = $http + $ftp_up + $ftp_down + $mail;
|
||||||
|
|
||||||
if(extension_loaded('bcmath'))
|
if(extension_loaded('bcmath'))
|
||||||
{
|
{
|
||||||
$traf['ftptext'] = bcdiv($ftp_up, 1024 * 1024, $settings['panel']['decimal_places']) . " GB up/ " . bcdiv($ftp_down, 1024 * 1024, $settings['panel']['decimal_places']) . " GB down (FTP)";
|
$traf['ftptext'] = bcdiv($ftp_up, 1024 * 1024, $settings['panel']['decimal_places']) . " GB up/ " . bcdiv($ftp_down, 1024 * 1024, $settings['panel']['decimal_places']) . " GB down (FTP)";
|
||||||
$traf['httptext'] = bcdiv($http, 1024 * 1024, $settings['panel']['decimal_places']) . " GB (HTTP)";
|
$traf['httptext'] = bcdiv($http, 1024 * 1024, $settings['panel']['decimal_places']) . " GB (HTTP)";
|
||||||
$traf['mailtext'] = bcdiv($mail, 1024 * 1024, $settings['panel']['decimal_places']) . " GB (Mail)";
|
$traf['mailtext'] = bcdiv($mail, 1024 * 1024, $settings['panel']['decimal_places']) . " GB (Mail)";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$traf['ftptext'] = round($ftp_up / 1024 * 1024, $settings['panel']['decimal_places']) . " GB up/ " . round($ftp_down / 1024 * 1024, $settings['panel']['decimal_places']) . " GB down (FTP)";
|
$traf['ftptext'] = round($ftp_up / 1024 * 1024, $settings['panel']['decimal_places']) . " GB up/ " . round($ftp_down / 1024 * 1024, $settings['panel']['decimal_places']) . " GB down (FTP)";
|
||||||
$traf['httptext'] = round($http / 1024 * 1024, $settings['panel']['decimal_places']) . " GB (HTTP)";
|
$traf['httptext'] = round($http / 1024 * 1024, $settings['panel']['decimal_places']) . " GB (HTTP)";
|
||||||
$traf['mailtext'] = round($mail / 1024 * 1024, $settings['panel']['decimal_places']) . " GB (Mail)";
|
$traf['mailtext'] = round($mail / 1024 * 1024, $settings['panel']['decimal_places']) . " GB (Mail)";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($traf['max'] != 0)
|
if($traf['max'] != 0)
|
||||||
{
|
{
|
||||||
$proz = $traf['max'] / 100;
|
$proz = $traf['max'] / 100;
|
||||||
$traf['ftp'] = round(($ftp_up + $ftp_down) / $proz, 0);
|
$traf['ftp'] = round(($ftp_up + $ftp_down) / $proz, 0);
|
||||||
$traf['http'] = round($http / $proz, 0);
|
$traf['http'] = round($http / $proz, 0);
|
||||||
$traf['mail'] = round($mail / $proz, 0);
|
$traf['mail'] = round($mail / $proz, 0);
|
||||||
|
|
||||||
if($traf['http'] == 0)
|
if($traf['http'] == 0)
|
||||||
{
|
{
|
||||||
$traf['http'] = 1;
|
$traf['http'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($traf['ftp'] == 0)
|
if($traf['ftp'] == 0)
|
||||||
{
|
{
|
||||||
$traf['ftp'] = 1;
|
$traf['ftp'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($traf['mail'] == 0)
|
if($traf['mail'] == 0)
|
||||||
{
|
{
|
||||||
$traf['mail'] = 1;
|
$traf['mail'] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$traf['ftp'] = 0;
|
$traf['ftp'] = 0;
|
||||||
$traf['http'] = 0;
|
$traf['http'] = 0;
|
||||||
$traf['mail'] = 0;
|
$traf['mail'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(extension_loaded('bcmath'))
|
if(extension_loaded('bcmath'))
|
||||||
{
|
{
|
||||||
$traf['byte'] = bcadd($traf['byte'] / (1024 * 1024), 0.0000, 4);
|
$traf['byte'] = bcadd($traf['byte'] / (1024 * 1024), 0.0000, 4);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$traf['byte'] = round($traf['byte'] + (1024 * 1024), 4);
|
$traf['byte'] = round($traf['byte'] + (1024 * 1024), 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("\$traffic.=\"" . getTemplate("traffic/traffic_traffic") . "\";");
|
eval("\$traffic.=\"" . getTemplate("traffic/traffic_traffic") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(extension_loaded('bcmath'))
|
if(extension_loaded('bcmath'))
|
||||||
{
|
{
|
||||||
$traffic_complete['http'] = bcdiv($traffic_complete['http'], 1024 * 1024, $settings['panel']['decimal_places']);
|
$traffic_complete['http'] = bcdiv($traffic_complete['http'], 1024 * 1024, $settings['panel']['decimal_places']);
|
||||||
$traffic_complete['ftp'] = bcdiv($traffic_complete['ftp'], 1024 * 1024, $settings['panel']['decimal_places']);
|
$traffic_complete['ftp'] = bcdiv($traffic_complete['ftp'], 1024 * 1024, $settings['panel']['decimal_places']);
|
||||||
$traffic_complete['mail'] = bcdiv($traffic_complete['mail'], 1024 * 1024, $settings['panel']['decimal_places']);
|
$traffic_complete['mail'] = bcdiv($traffic_complete['mail'], 1024 * 1024, $settings['panel']['decimal_places']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$traffic_complete['http'] = round($traffic_complete['http'] / 1024 * 1024, $settings['panel']['decimal_places']);
|
$traffic_complete['http'] = round($traffic_complete['http'] / 1024 * 1024, $settings['panel']['decimal_places']);
|
||||||
$traffic_complete['ftp'] = round($traffic_complete['ftp'] / 1024 * 1024, $settings['panel']['decimal_places']);
|
$traffic_complete['ftp'] = round($traffic_complete['ftp'] / 1024 * 1024, $settings['panel']['decimal_places']);
|
||||||
$traffic_complete['mail'] = round($traffic_complete['mail'] / 1024 * 1024, $settings['panel']['decimal_places']);
|
$traffic_complete['mail'] = round($traffic_complete['mail'] / 1024 * 1024, $settings['panel']['decimal_places']);
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("traffic/traffic") . "\";");
|
eval("echo \"" . getTemplate("traffic/traffic") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
1660
install/install.php
1660
install/install.php
File diff suppressed because it is too large
Load Diff
@@ -1,87 +1,87 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Language
|
* @package Language
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Begin
|
* Begin
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$lng['install']['language'] = 'Installation - Language';
|
$lng['install']['language'] = 'Installation - Language';
|
||||||
$lng['install']['welcome'] = 'Welcome to Froxlor Installation';
|
$lng['install']['welcome'] = 'Welcome to Froxlor Installation';
|
||||||
$lng['install']['welcometext'] = 'Thank you for choosing Froxlor. Please fill out the following fields with the required information to start the installation.<br /><b>Attention:</b> If the database you chose for Froxlor already exists on your System, it will be erased with all containing data!';
|
$lng['install']['welcometext'] = 'Thank you for choosing Froxlor. Please fill out the following fields with the required information to start the installation.<br /><b>Attention:</b> If the database you chose for Froxlor already exists on your System, it will be erased with all containing data!';
|
||||||
$lng['install']['database'] = 'Database';
|
$lng['install']['database'] = 'Database';
|
||||||
$lng['install']['mysql_hostname'] = 'MySQL-Hostname';
|
$lng['install']['mysql_hostname'] = 'MySQL-Hostname';
|
||||||
$lng['install']['mysql_database'] = 'MySQL-Database';
|
$lng['install']['mysql_database'] = 'MySQL-Database';
|
||||||
$lng['install']['mysql_unpriv_user'] = 'Username for the unprivileged MySQL-account';
|
$lng['install']['mysql_unpriv_user'] = 'Username for the unprivileged MySQL-account';
|
||||||
$lng['install']['mysql_unpriv_pass'] = 'Password for the unprivileged MySQL-account';
|
$lng['install']['mysql_unpriv_pass'] = 'Password for the unprivileged MySQL-account';
|
||||||
$lng['install']['mysql_root_user'] = 'Username for the MySQL-root-account';
|
$lng['install']['mysql_root_user'] = 'Username for the MySQL-root-account';
|
||||||
$lng['install']['mysql_root_pass'] = 'Password for the MySQL-root-account';
|
$lng['install']['mysql_root_pass'] = 'Password for the MySQL-root-account';
|
||||||
$lng['install']['admin_account'] = 'Administrator Account';
|
$lng['install']['admin_account'] = 'Administrator Account';
|
||||||
$lng['install']['admin_user'] = 'Administrator Username';
|
$lng['install']['admin_user'] = 'Administrator Username';
|
||||||
$lng['install']['admin_pass'] = 'Administrator Password';
|
$lng['install']['admin_pass'] = 'Administrator Password';
|
||||||
$lng['install']['admin_pass_confirm'] = 'Administrator-Password (confirm)';
|
$lng['install']['admin_pass_confirm'] = 'Administrator-Password (confirm)';
|
||||||
$lng['install']['serversettings'] = 'Server settings';
|
$lng['install']['serversettings'] = 'Server settings';
|
||||||
$lng['install']['servername'] = 'Server name (FQDN)';
|
$lng['install']['servername'] = 'Server name (FQDN)';
|
||||||
$lng['install']['serverip'] = 'Server IP';
|
$lng['install']['serverip'] = 'Server IP';
|
||||||
$lng['install']['httpuser'] = 'HTTP username';
|
$lng['install']['httpuser'] = 'HTTP username';
|
||||||
$lng['install']['httpgroup'] = 'HTTP groupname';
|
$lng['install']['httpgroup'] = 'HTTP groupname';
|
||||||
$lng['install']['apacheversion'] = 'Apacheversion';
|
$lng['install']['apacheversion'] = 'Apacheversion';
|
||||||
$lng['install']['next'] = 'Next';
|
$lng['install']['next'] = 'Next';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Progress
|
* Progress
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$lng['install']['testing_mysql'] = 'Testing if MySQL-root-username and password are correct...';
|
$lng['install']['testing_mysql'] = 'Testing if MySQL-root-username and password are correct...';
|
||||||
$lng['install']['erasing_old_db'] = 'Erasing old Database...';
|
$lng['install']['erasing_old_db'] = 'Erasing old Database...';
|
||||||
$lng['install']['backup_old_db'] = 'Create backup of the old Database...';
|
$lng['install']['backup_old_db'] = 'Create backup of the old Database...';
|
||||||
$lng['install']['backing_up'] = 'Backing up';
|
$lng['install']['backing_up'] = 'Backing up';
|
||||||
$lng['install']['backing_up_binary_missing'] = '/usr/bin/mysqldump is missing';
|
$lng['install']['backing_up_binary_missing'] = '/usr/bin/mysqldump is missing';
|
||||||
$lng['install']['create_mysqluser_and_db'] = 'Creating MySQL-database and username...';
|
$lng['install']['create_mysqluser_and_db'] = 'Creating MySQL-database and username...';
|
||||||
$lng['install']['testing_new_db'] = 'Testing if MySQL-database and username have been created correctly...';
|
$lng['install']['testing_new_db'] = 'Testing if MySQL-database and username have been created correctly...';
|
||||||
$lng['install']['importing_data'] = 'Importing data into MySQL-database...';
|
$lng['install']['importing_data'] = 'Importing data into MySQL-database...';
|
||||||
$lng['install']['changing_data'] = 'Changing imported data...';
|
$lng['install']['changing_data'] = 'Changing imported data...';
|
||||||
$lng['install']['adding_admin_user'] = 'Adding Administrator Account...';
|
$lng['install']['adding_admin_user'] = 'Adding Administrator Account...';
|
||||||
$lng['install']['creating_configfile'] = 'Creating configfile...';
|
$lng['install']['creating_configfile'] = 'Creating configfile...';
|
||||||
$lng['install']['creating_configfile_succ'] = 'OK, userdata.inc.php was saved in lib/.';
|
$lng['install']['creating_configfile_succ'] = 'OK, userdata.inc.php was saved in lib/.';
|
||||||
$lng['install']['creating_configfile_temp'] = 'File was saved in /tmp/userdata.inc.php, please move to lib/.';
|
$lng['install']['creating_configfile_temp'] = 'File was saved in /tmp/userdata.inc.php, please move to lib/.';
|
||||||
$lng['install']['creating_configfile_failed'] = 'Cannot create lib/userdata.inc.php, please create it manually with the following data:';
|
$lng['install']['creating_configfile_failed'] = 'Cannot create lib/userdata.inc.php, please create it manually with the following data:';
|
||||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor was installed successfully.';
|
$lng['install']['froxlor_succ_installed'] = 'Froxlor was installed successfully.';
|
||||||
$lng['install']['click_here_to_login'] = 'Click here to login.';
|
$lng['install']['click_here_to_login'] = 'Click here to login.';
|
||||||
$lng['install']['phpmysql'] = 'Testing if PHP MySQL-extension is installed...';
|
$lng['install']['phpmysql'] = 'Testing if PHP MySQL-extension is installed...';
|
||||||
$lng['install']['phpfilter'] = 'Testing if PHP filter-extension is installed...';
|
$lng['install']['phpfilter'] = 'Testing if PHP filter-extension is installed...';
|
||||||
$lng['install']['diedbecauseofrequirements'] = 'Cannot install Froxlor without these requirements! Aborting...';
|
$lng['install']['diedbecauseofrequirements'] = 'Cannot install Froxlor without these requirements! Aborting...';
|
||||||
$lng['install']['notinstalled'] = 'not installed!';
|
$lng['install']['notinstalled'] = 'not installed!';
|
||||||
$lng['install']['phpbcmath'] = 'Testing if PHP bcmath-extension is installed...';
|
$lng['install']['phpbcmath'] = 'Testing if PHP bcmath-extension is installed...';
|
||||||
$lng['install']['bcmathdescription'] = 'Traffic-calculation related functions will not work correctly!';
|
$lng['install']['bcmathdescription'] = 'Traffic-calculation related functions will not work correctly!';
|
||||||
$lng['install']['openbasedir'] = 'Testing if open_basedir is enabled...';
|
$lng['install']['openbasedir'] = 'Testing if open_basedir is enabled...';
|
||||||
$lng['install']['openbasedirenabled'] = 'enabled. Froxlor will not work properly with open_basedir enabled. Please disable open_basedir for Froxlor';
|
$lng['install']['openbasedirenabled'] = 'enabled. Froxlor will not work properly with open_basedir enabled. Please disable open_basedir for Froxlor';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renamed in 1.2.19-svn40
|
* Renamed in 1.2.19-svn40
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$lng['install']['webserver'] = 'Webserver';
|
$lng['install']['webserver'] = 'Webserver';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Added in Froxlor 0.9
|
* Added in Froxlor 0.9
|
||||||
*/
|
*/
|
||||||
$lng['install']['phpversion'] = 'Checking for PHP version >= 5.2';
|
$lng['install']['phpversion'] = 'Checking for PHP version >= 5.2';
|
||||||
$lng['install']['phpposix'] = 'Testing if PHP posix-extension is installed...';
|
$lng['install']['phpposix'] = 'Testing if PHP posix-extension is installed...';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,71 +1,71 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Tim Zielosko <mail@zielosko.net>
|
* @author Tim Zielosko <mail@zielosko.net>
|
||||||
* @author Romain MARIADASSOU <roms2000@free.fr>
|
* @author Romain MARIADASSOU <roms2000@free.fr>
|
||||||
* @author Froxlor Team <team@froxlor.org>
|
* @author Froxlor Team <team@froxlor.org>
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Language
|
* @package Language
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Begin
|
* Begin
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$lng['install']['language'] = 'Langue d\'installation';
|
$lng['install']['language'] = 'Langue d\'installation';
|
||||||
$lng['install']['welcome'] = 'Bienvenue <20> l\'installation de Froxlor';
|
$lng['install']['welcome'] = 'Bienvenue <20> l\'installation de Froxlor';
|
||||||
$lng['install']['welcometext'] = 'Merci beaucoup d\'avoir choisi Froxlor. Pour installer Froxlor remplissez les cases ci-dessous avec les informations demand<6E>es.<br /><b>Attention :</b> Si vous entrez le nom d\'une base de donn<6E>es existante, celle-ci sera effac<61>e !';
|
$lng['install']['welcometext'] = 'Merci beaucoup d\'avoir choisi Froxlor. Pour installer Froxlor remplissez les cases ci-dessous avec les informations demand<6E>es.<br /><b>Attention :</b> Si vous entrez le nom d\'une base de donn<6E>es existante, celle-ci sera effac<61>e !';
|
||||||
$lng['install']['database'] = 'Base de donn<6E>es';
|
$lng['install']['database'] = 'Base de donn<6E>es';
|
||||||
$lng['install']['mysql_hostname'] = 'Nom d\'h<>te du serveur MySQL';
|
$lng['install']['mysql_hostname'] = 'Nom d\'h<>te du serveur MySQL';
|
||||||
$lng['install']['mysql_database'] = 'Base de donn<6E>es MySQL';
|
$lng['install']['mysql_database'] = 'Base de donn<6E>es MySQL';
|
||||||
$lng['install']['mysql_unpriv_user'] = 'Utilisateur pour l\'acc<63>s non privil<69>gi<67> <20> MySQL';
|
$lng['install']['mysql_unpriv_user'] = 'Utilisateur pour l\'acc<63>s non privil<69>gi<67> <20> MySQL';
|
||||||
$lng['install']['mysql_unpriv_pass'] = 'Mot de passe pour l\'acc<63>s non privil<69>gi<67> <20> MySQL';
|
$lng['install']['mysql_unpriv_pass'] = 'Mot de passe pour l\'acc<63>s non privil<69>gi<67> <20> MySQL';
|
||||||
$lng['install']['mysql_root_user'] = 'Utilisateur pour l\'acc<63>s root <20> MySQL';
|
$lng['install']['mysql_root_user'] = 'Utilisateur pour l\'acc<63>s root <20> MySQL';
|
||||||
$lng['install']['mysql_root_pass'] = 'Mot de passe pour l\'acc<63>s root <20> MySQL';
|
$lng['install']['mysql_root_pass'] = 'Mot de passe pour l\'acc<63>s root <20> MySQL';
|
||||||
$lng['install']['admin_account'] = 'Acc<63>s administratif';
|
$lng['install']['admin_account'] = 'Acc<63>s administratif';
|
||||||
$lng['install']['admin_user'] = 'Login de l\'administrateur';
|
$lng['install']['admin_user'] = 'Login de l\'administrateur';
|
||||||
$lng['install']['admin_pass'] = 'Mot de passe de l\'administrateur';
|
$lng['install']['admin_pass'] = 'Mot de passe de l\'administrateur';
|
||||||
$lng['install']['admin_pass_confirm'] = 'Mot de passe de l\'administrateur (confirmation)';
|
$lng['install']['admin_pass_confirm'] = 'Mot de passe de l\'administrateur (confirmation)';
|
||||||
$lng['install']['serversettings'] = 'Configuration du serveur';
|
$lng['install']['serversettings'] = 'Configuration du serveur';
|
||||||
$lng['install']['servername'] = 'Nom du serveur (FQDN)';
|
$lng['install']['servername'] = 'Nom du serveur (FQDN)';
|
||||||
$lng['install']['serverip'] = 'Adresse IP du serveur';
|
$lng['install']['serverip'] = 'Adresse IP du serveur';
|
||||||
$lng['install']['apacheversion'] = 'Version du serveur Apache';
|
$lng['install']['apacheversion'] = 'Version du serveur Apache';
|
||||||
$lng['install']['next'] = 'Continuer';
|
$lng['install']['next'] = 'Continuer';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Progress
|
* Progress
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$lng['install']['testing_mysql'] = 'V<>rification du login root de MySQL ...';
|
$lng['install']['testing_mysql'] = 'V<>rification du login root de MySQL ...';
|
||||||
$lng['install']['erasing_old_db'] = 'Effacement de l\'ancienne base de donn<6E>es ...';
|
$lng['install']['erasing_old_db'] = 'Effacement de l\'ancienne base de donn<6E>es ...';
|
||||||
$lng['install']['create_mysqluser_and_db'] = 'Cr<43>ation de la base de donn<6E>es puis des utilisateurs ...';
|
$lng['install']['create_mysqluser_and_db'] = 'Cr<43>ation de la base de donn<6E>es puis des utilisateurs ...';
|
||||||
$lng['install']['testing_new_db'] = 'V<>rification de la base de donn<6E>es et des utilisateurs ...';
|
$lng['install']['testing_new_db'] = 'V<>rification de la base de donn<6E>es et des utilisateurs ...';
|
||||||
$lng['install']['importing_data'] = 'Importation des informations dans la base de donn<6E>es ...';
|
$lng['install']['importing_data'] = 'Importation des informations dans la base de donn<6E>es ...';
|
||||||
$lng['install']['changing_data'] = 'Modification des donn<6E>es import<72>s ...';
|
$lng['install']['changing_data'] = 'Modification des donn<6E>es import<72>s ...';
|
||||||
$lng['install']['adding_admin_user'] = 'Ajout de l\'utilisateur administrateur ...';
|
$lng['install']['adding_admin_user'] = 'Ajout de l\'utilisateur administrateur ...';
|
||||||
$lng['install']['creating_configfile'] = 'Cr<43>ation du fichier de configuration ...';
|
$lng['install']['creating_configfile'] = 'Cr<43>ation du fichier de configuration ...';
|
||||||
$lng['install']['creating_configfile_succ'] = 'OK, userdata.inc.php a <20>t<EFBFBD> sauvegard<72> dans le dossier lib/ de Froxlor.';
|
$lng['install']['creating_configfile_succ'] = 'OK, userdata.inc.php a <20>t<EFBFBD> sauvegard<72> dans le dossier lib/ de Froxlor.';
|
||||||
$lng['install']['creating_configfile_temp'] = 'Le fichier a <20>t<EFBFBD> sauvegard<72> dans /tmp/userdata.inc.php, veuillez le d<>placer / copier dans le dossier lib/ de Froxlor.';
|
$lng['install']['creating_configfile_temp'] = 'Le fichier a <20>t<EFBFBD> sauvegard<72> dans /tmp/userdata.inc.php, veuillez le d<>placer / copier dans le dossier lib/ de Froxlor.';
|
||||||
$lng['install']['creating_configfile_failed'] = 'Erreur en cr<63>ant le fichier lib/userdata.inc.php, veuillez le cr<63>er avec le contenu ci-dessous :';
|
$lng['install']['creating_configfile_failed'] = 'Erreur en cr<63>ant le fichier lib/userdata.inc.php, veuillez le cr<63>er avec le contenu ci-dessous :';
|
||||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor a <20>t<EFBFBD> install<6C> correctement.';
|
$lng['install']['froxlor_succ_installed'] = 'Froxlor a <20>t<EFBFBD> install<6C> correctement.';
|
||||||
$lng['install']['click_here_to_login'] = 'Cliquez ici pour vous rendre <20> l\'invite de connexion.';
|
$lng['install']['click_here_to_login'] = 'Cliquez ici pour vous rendre <20> l\'invite de connexion.';
|
||||||
$lng['install']['httpuser'] = 'Nom du utilisateur du HTTP';
|
$lng['install']['httpuser'] = 'Nom du utilisateur du HTTP';
|
||||||
$lng['install']['httpgroup'] = 'Nom du la group du HTTP';
|
$lng['install']['httpgroup'] = 'Nom du la group du HTTP';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renamed in 1.2.19-svn40
|
* Renamed in 1.2.19-svn40
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$lng['install']['webserver'] = 'Version du serveur';
|
$lng['install']['webserver'] = 'Version du serveur';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,84 +1,84 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2007 the SysCP Team (see authors).
|
* Copyright (c) 2003-2007 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.syscp.org/misc/COPYING.txt
|
* COPYING file online at http://files.syscp.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2007)
|
* @author Florian Lippert <flo@syscp.org> (2003-2007)
|
||||||
* @author Froxlor Team <team@froxlor.org> (2010-)
|
* @author Froxlor Team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Language
|
* @package Language
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Begin
|
* Begin
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$lng['install']['language'] = 'Installations - Sprache';
|
$lng['install']['language'] = 'Installations - Sprache';
|
||||||
$lng['install']['welcome'] = 'Willkommen zur Froxlor Installation';
|
$lng['install']['welcome'] = 'Willkommen zur Froxlor Installation';
|
||||||
$lng['install']['welcometext'] = 'Vielen Dank dass Sie sich für Froxlor entschieden haben. Um Ihre Installation von Froxlor zu starten, füllen Sie bitte alle Felder unten mit den geforderten Angaben.<br /><b>Achtung:</b> Eine eventuell bereits existierende Datenbank, die den selben Namen hat wie den, den Sie unten eingeben werden, wird mit allen enthaltenen Daten gelöscht!';
|
$lng['install']['welcometext'] = 'Vielen Dank dass Sie sich für Froxlor entschieden haben. Um Ihre Installation von Froxlor zu starten, füllen Sie bitte alle Felder unten mit den geforderten Angaben.<br /><b>Achtung:</b> Eine eventuell bereits existierende Datenbank, die den selben Namen hat wie den, den Sie unten eingeben werden, wird mit allen enthaltenen Daten gelöscht!';
|
||||||
$lng['install']['database'] = 'Datenbank';
|
$lng['install']['database'] = 'Datenbank';
|
||||||
$lng['install']['mysql_hostname'] = 'MySQL-Hostname';
|
$lng['install']['mysql_hostname'] = 'MySQL-Hostname';
|
||||||
$lng['install']['mysql_database'] = 'MySQL-Datenbank';
|
$lng['install']['mysql_database'] = 'MySQL-Datenbank';
|
||||||
$lng['install']['mysql_unpriv_user'] = 'Benutzername für den unprivilegierten MySQL-Account';
|
$lng['install']['mysql_unpriv_user'] = 'Benutzername für den unprivilegierten MySQL-Account';
|
||||||
$lng['install']['mysql_unpriv_pass'] = 'Passwort für den unprivilegierten MySQL-Account';
|
$lng['install']['mysql_unpriv_pass'] = 'Passwort für den unprivilegierten MySQL-Account';
|
||||||
$lng['install']['mysql_root_user'] = 'Benutzername für den MySQL-Root-Account';
|
$lng['install']['mysql_root_user'] = 'Benutzername für den MySQL-Root-Account';
|
||||||
$lng['install']['mysql_root_pass'] = 'Passwort für den MySQL-Root-Account';
|
$lng['install']['mysql_root_pass'] = 'Passwort für den MySQL-Root-Account';
|
||||||
$lng['install']['admin_account'] = 'Admin-Zugang';
|
$lng['install']['admin_account'] = 'Admin-Zugang';
|
||||||
$lng['install']['admin_user'] = 'Administrator-Benutzername';
|
$lng['install']['admin_user'] = 'Administrator-Benutzername';
|
||||||
$lng['install']['admin_pass'] = 'Administrator-Passwort';
|
$lng['install']['admin_pass'] = 'Administrator-Passwort';
|
||||||
$lng['install']['admin_pass_confirm'] = 'Administrator-Passwort (Bestätigung)';
|
$lng['install']['admin_pass_confirm'] = 'Administrator-Passwort (Bestätigung)';
|
||||||
$lng['install']['serversettings'] = 'Servereinstellungen';
|
$lng['install']['serversettings'] = 'Servereinstellungen';
|
||||||
$lng['install']['servername'] = 'Servername (FQDN)';
|
$lng['install']['servername'] = 'Servername (FQDN)';
|
||||||
$lng['install']['serverip'] = 'Server-IP';
|
$lng['install']['serverip'] = 'Server-IP';
|
||||||
$lng['install']['apacheversion'] = 'Apacheversion';
|
$lng['install']['apacheversion'] = 'Apacheversion';
|
||||||
$lng['install']['next'] = 'Fortfahren';
|
$lng['install']['next'] = 'Fortfahren';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Progress
|
* Progress
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$lng['install']['testing_mysql'] = 'Teste, ob die MySQL-Root-Benutzerdaten richtig sind...';
|
$lng['install']['testing_mysql'] = 'Teste, ob die MySQL-Root-Benutzerdaten richtig sind...';
|
||||||
$lng['install']['erasing_old_db'] = 'Entferne alte Datenbank...';
|
$lng['install']['erasing_old_db'] = 'Entferne alte Datenbank...';
|
||||||
$lng['install']['create_mysqluser_and_db'] = 'Erstelle Datenbank und Benutzer...';
|
$lng['install']['create_mysqluser_and_db'] = 'Erstelle Datenbank und Benutzer...';
|
||||||
$lng['install']['testing_new_db'] = 'Teste, ob die Datenbank und Passwort korrekt angelegt wurden...';
|
$lng['install']['testing_new_db'] = 'Teste, ob die Datenbank und Passwort korrekt angelegt wurden...';
|
||||||
$lng['install']['importing_data'] = 'Importiere Daten in die MySQL-Datenbank...';
|
$lng['install']['importing_data'] = 'Importiere Daten in die MySQL-Datenbank...';
|
||||||
$lng['install']['changing_data'] = 'Passe die importierten Daten an...';
|
$lng['install']['changing_data'] = 'Passe die importierten Daten an...';
|
||||||
$lng['install']['adding_admin_user'] = 'Füge den Admin-Benutzer hinzu...';
|
$lng['install']['adding_admin_user'] = 'Füge den Admin-Benutzer hinzu...';
|
||||||
$lng['install']['creating_configfile'] = 'Erstelle Konfigurationsdatei...';
|
$lng['install']['creating_configfile'] = 'Erstelle Konfigurationsdatei...';
|
||||||
$lng['install']['creating_configfile_succ'] = 'OK, userdata.inc.php wurde in lib/ gespeichert.';
|
$lng['install']['creating_configfile_succ'] = 'OK, userdata.inc.php wurde in lib/ gespeichert.';
|
||||||
$lng['install']['creating_configfile_temp'] = 'Datei wurde in /tmp/userdata.inc.php gespeichert, bitte nach lib/ verschieben.';
|
$lng['install']['creating_configfile_temp'] = 'Datei wurde in /tmp/userdata.inc.php gespeichert, bitte nach lib/ verschieben.';
|
||||||
$lng['install']['creating_configfile_failed'] = 'Konnte lib/userdata.inc.php nicht erstellen, bitte manuell mit folgendem Inhalt anlegen:';
|
$lng['install']['creating_configfile_failed'] = 'Konnte lib/userdata.inc.php nicht erstellen, bitte manuell mit folgendem Inhalt anlegen:';
|
||||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor wurde erfolgreich installiert.';
|
$lng['install']['froxlor_succ_installed'] = 'Froxlor wurde erfolgreich installiert.';
|
||||||
$lng['install']['click_here_to_login'] = 'Hier geht es weiter zum Login-Fenster.';
|
$lng['install']['click_here_to_login'] = 'Hier geht es weiter zum Login-Fenster.';
|
||||||
$lng['install']['phpmysql'] = 'Teste, ob die PHP MySQL-Erweiterung installiert ist...';
|
$lng['install']['phpmysql'] = 'Teste, ob die PHP MySQL-Erweiterung installiert ist...';
|
||||||
$lng['install']['phpfilter'] = 'Teste, ob die PHP Filter-Erweiterung installiert ist...';
|
$lng['install']['phpfilter'] = 'Teste, ob die PHP Filter-Erweiterung installiert ist...';
|
||||||
$lng['install']['diedbecauseofrequirements'] = 'Kann Froxlor ohne diese Voraussetzungen nicht installieren! Breche ab...';
|
$lng['install']['diedbecauseofrequirements'] = 'Kann Froxlor ohne diese Voraussetzungen nicht installieren! Breche ab...';
|
||||||
$lng['install']['notinstalled'] = 'nicht installiert!';
|
$lng['install']['notinstalled'] = 'nicht installiert!';
|
||||||
$lng['install']['phpbcmath'] = 'Teste, ob die PHP bcmath-Erweiterung installiert ist...';
|
$lng['install']['phpbcmath'] = 'Teste, ob die PHP bcmath-Erweiterung installiert ist...';
|
||||||
$lng['install']['bcmathdescription'] = 'Traffic-Berechnungs bezogene Funktionen stehen nicht vollständig zur Verfügung!';
|
$lng['install']['bcmathdescription'] = 'Traffic-Berechnungs bezogene Funktionen stehen nicht vollständig zur Verfügung!';
|
||||||
$lng['install']['openbasedir'] = 'Teste, ob open_basedir genutzt wird...';
|
$lng['install']['openbasedir'] = 'Teste, ob open_basedir genutzt wird...';
|
||||||
$lng['install']['openbasedirenabled'] = 'aktiviert. Froxlor wird mit aktiviertem open_basedir nicht vollständig funktionieren. Bitte deaktivieren Sie open_basedir für Froxlor';
|
$lng['install']['openbasedirenabled'] = 'aktiviert. Froxlor wird mit aktiviertem open_basedir nicht vollständig funktionieren. Bitte deaktivieren Sie open_basedir für Froxlor';
|
||||||
$lng['install']['httpuser'] = 'HTTP Username';
|
$lng['install']['httpuser'] = 'HTTP Username';
|
||||||
$lng['install']['httpgroup'] = 'HTTP Gruppenname';
|
$lng['install']['httpgroup'] = 'HTTP Gruppenname';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renamed in 1.2.19-svn40
|
* Renamed in 1.2.19-svn40
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$lng['install']['webserver'] = 'Webserver';
|
$lng['install']['webserver'] = 'Webserver';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Added in Froxlor 0.9
|
* Added in Froxlor 0.9
|
||||||
*/
|
*/
|
||||||
$lng['install']['phpversion'] = 'Prüfe PHP Version >= 5.2';
|
$lng['install']['phpversion'] = 'Prüfe PHP Version >= 5.2';
|
||||||
$lng['install']['phpposix'] = 'Teste, ob die PHP Posix-Erweiterung installiert ist...';
|
$lng['install']['phpposix'] = 'Teste, ob die PHP Posix-Erweiterung installiert ist...';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,106 +1,106 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the SysCP project.
|
* This file is part of the SysCP project.
|
||||||
* Copyright (c) 2003-2007 the SysCP Team (see authors).
|
* Copyright (c) 2003-2007 the SysCP Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.syscp.org/misc/COPYING.txt
|
* COPYING file online at http://files.syscp.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Michael Duergner <michael@duergner.com>
|
* @author Michael Duergner <michael@duergner.com>
|
||||||
* @license GPLv2 http://files.syscp.org/misc/COPYING.txt
|
* @license GPLv2 http://files.syscp.org/misc/COPYING.txt
|
||||||
* @package System
|
* @package System
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(@php_sapi_name() != 'cli'
|
if(@php_sapi_name() != 'cli'
|
||||||
&& @php_sapi_name() != 'cgi'
|
&& @php_sapi_name() != 'cgi'
|
||||||
&& @php_sapi_name() != 'cgi-fcgi')
|
&& @php_sapi_name() != 'cgi-fcgi')
|
||||||
{
|
{
|
||||||
die('This script will only work in the shell.');
|
die('This script will only work in the shell.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$pathtophpfiles = '/var/www/syscp';
|
$pathtophpfiles = '/var/www/syscp';
|
||||||
$filename = 'htpasswd-htaccess-remover.php';
|
$filename = 'htpasswd-htaccess-remover.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Includes the Usersettings eg. MySQL-Username/Passwort etc.
|
* Includes the Usersettings eg. MySQL-Username/Passwort etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ("$pathtophpfiles/lib/userdata.inc.php");
|
require ("$pathtophpfiles/lib/userdata.inc.php");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Includes the MySQL-Tabledefinitions etc.
|
* Includes the MySQL-Tabledefinitions etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ("$pathtophpfiles/lib/tables.inc.php");
|
require ("$pathtophpfiles/lib/tables.inc.php");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Includes the MySQL-Connection-Class
|
* Includes the MySQL-Connection-Class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ("$pathtophpfiles/lib/class_mysqldb.php");
|
require ("$pathtophpfiles/lib/class_mysqldb.php");
|
||||||
$debugMsg[] = 'Database Class has been loaded';
|
$debugMsg[] = 'Database Class has been loaded';
|
||||||
$db = new db($sql['host'], $sql['user'], $sql['password'], $sql['db']);
|
$db = new db($sql['host'], $sql['user'], $sql['password'], $sql['db']);
|
||||||
$db_root = new db($sql['host'], $sql['root_user'], $sql['root_password'], '');
|
$db_root = new db($sql['host'], $sql['root_user'], $sql['root_password'], '');
|
||||||
|
|
||||||
if($db->link_id == 0
|
if($db->link_id == 0
|
||||||
|| $db_root->link_id == 0)
|
|| $db_root->link_id == 0)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Do not proceed further if no database connection could be established (either normal or root)
|
* Do not proceed further if no database connection could be established (either normal or root)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
die('Cant connect to mysqlserver. Please check userdata.inc.php! Exiting...');
|
die('Cant connect to mysqlserver. Please check userdata.inc.php! Exiting...');
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($sql['password']);
|
unset($sql['password']);
|
||||||
unset($db->password);
|
unset($db->password);
|
||||||
$result = $db->query("SELECT `settingid`, `settinggroup`, `varname`, `value` FROM `" . TABLE_PANEL_SETTINGS . "`");
|
$result = $db->query("SELECT `settingid`, `settinggroup`, `varname`, `value` FROM `" . TABLE_PANEL_SETTINGS . "`");
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
$settings["$row[settinggroup]"]["$row[varname]"] = $row['value'];
|
$settings["$row[settinggroup]"]["$row[varname]"] = $row['value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($row);
|
unset($row);
|
||||||
unset($result);
|
unset($result);
|
||||||
|
|
||||||
if(!isset($settings['panel']['version'])
|
if(!isset($settings['panel']['version'])
|
||||||
|| $settings['panel']['version'] != $version)
|
|| $settings['panel']['version'] != $version)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Do not proceed further if the Database version is not the same as the script version
|
* Do not proceed further if the Database version is not the same as the script version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
die('Version of File doesnt match Version of Database. Exiting...');
|
die('Version of File doesnt match Version of Database. Exiting...');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Includes the Functions
|
* Includes the Functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ("$pathtophpfiles/lib/functions.php");
|
require ("$pathtophpfiles/lib/functions.php");
|
||||||
$result = $db->query('SELECT * FROM `' . TABLE_PANEL_HTACCESS . '` ');
|
$result = $db->query('SELECT * FROM `' . TABLE_PANEL_HTACCESS . '` ');
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
if(file_exists($row['path'] . '.htaccess'))
|
if(file_exists($row['path'] . '.htaccess'))
|
||||||
{
|
{
|
||||||
unlink($row['path'] . '.htaccess');
|
unlink($row['path'] . '.htaccess');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $db->query('SELECT * FROM `' . TABLE_PANEL_HTPASSWDS . '` ');
|
$result = $db->query('SELECT * FROM `' . TABLE_PANEL_HTPASSWDS . '` ');
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
if(file_exists($row['path'] . '.htpasswd'))
|
if(file_exists($row['path'] . '.htpasswd'))
|
||||||
{
|
{
|
||||||
unlink($row['path'] . '.htpasswd');
|
unlink($row['path'] . '.htpasswd');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,186 +1,186 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the SysCP project.
|
* This file is part of the SysCP project.
|
||||||
* Copyright (c) 2003-2007 the SysCP Team (see authors).
|
* Copyright (c) 2003-2007 the SysCP Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.syscp.org/misc/COPYING.txt
|
* COPYING file online at http://files.syscp.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Martin Burchert <eremit@syscp.org>
|
* @author Martin Burchert <eremit@syscp.org>
|
||||||
* @license GPLv2 http://files.syscp.org/misc/COPYING.txt
|
* @license GPLv2 http://files.syscp.org/misc/COPYING.txt
|
||||||
* @package System
|
* @package System
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// some configs
|
// some configs
|
||||||
|
|
||||||
$baseLanguage = 'english.lng.php';
|
$baseLanguage = 'english.lng.php';
|
||||||
|
|
||||||
// Check if we're in the CLI
|
// Check if we're in the CLI
|
||||||
|
|
||||||
if(@php_sapi_name() != 'cli'
|
if(@php_sapi_name() != 'cli'
|
||||||
&& @php_sapi_name() != 'cgi'
|
&& @php_sapi_name() != 'cgi'
|
||||||
&& @php_sapi_name() != 'cgi-fcgi')
|
&& @php_sapi_name() != 'cgi-fcgi')
|
||||||
{
|
{
|
||||||
die('This script will only work in the shell.');
|
die('This script will only work in the shell.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check argument count
|
// Check argument count
|
||||||
|
|
||||||
if(sizeof($argv) != 2)
|
if(sizeof($argv) != 2)
|
||||||
{
|
{
|
||||||
print_help($argv);
|
print_help($argv);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the contents of the given path
|
// Load the contents of the given path
|
||||||
|
|
||||||
$path = $argv[1];
|
$path = $argv[1];
|
||||||
$files = array();
|
$files = array();
|
||||||
|
|
||||||
if($dh = opendir($path))
|
if($dh = opendir($path))
|
||||||
{
|
{
|
||||||
while(false !== ($file = readdir($dh)))
|
while(false !== ($file = readdir($dh)))
|
||||||
{
|
{
|
||||||
if($file != "."
|
if($file != "."
|
||||||
&& $file != ".."
|
&& $file != ".."
|
||||||
&& !is_dir($file)
|
&& !is_dir($file)
|
||||||
&& preg_match('/(.+)\.lng\.php/i', $file))
|
&& preg_match('/(.+)\.lng\.php/i', $file))
|
||||||
{
|
{
|
||||||
$files[$file] = str_replace('//', '/', $path . '/' . $file);
|
$files[$file] = str_replace('//', '/', $path . '/' . $file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
closedir($dh);
|
closedir($dh);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "ERROR: The path you requested cannot be read! \n ";
|
print "ERROR: The path you requested cannot be read! \n ";
|
||||||
print "\n";
|
print "\n";
|
||||||
print_help();
|
print_help();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if there is the default language defined
|
// check if there is the default language defined
|
||||||
|
|
||||||
if(!isset($files[$baseLanguage]))
|
if(!isset($files[$baseLanguage]))
|
||||||
{
|
{
|
||||||
print "ERROR: The baselanguage cannot be found! \n";
|
print "ERROR: The baselanguage cannot be found! \n";
|
||||||
print "\n";
|
print "\n";
|
||||||
print_help();
|
print_help();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// import the baselanguage
|
// import the baselanguage
|
||||||
|
|
||||||
$base = import($files[$baseLanguage]);
|
$base = import($files[$baseLanguage]);
|
||||||
|
|
||||||
// and unset it in the files, because we don't need to compare base to base
|
// and unset it in the files, because we don't need to compare base to base
|
||||||
|
|
||||||
unset($files[$baseLanguage]);
|
unset($files[$baseLanguage]);
|
||||||
|
|
||||||
// compare each language with the baselanguage
|
// compare each language with the baselanguage
|
||||||
|
|
||||||
foreach($files as $key => $file)
|
foreach($files as $key => $file)
|
||||||
{
|
{
|
||||||
$comp = import($file);
|
$comp = import($file);
|
||||||
print "\n\nComparing " . $baseLanguage . " to " . $key . "\n";
|
print "\n\nComparing " . $baseLanguage . " to " . $key . "\n";
|
||||||
$result = compare($base, $comp);
|
$result = compare($base, $comp);
|
||||||
|
|
||||||
if(is_array($result)
|
if(is_array($result)
|
||||||
&& sizeof($result) > 0)
|
&& sizeof($result) > 0)
|
||||||
{
|
{
|
||||||
print " found missing strings: \n";
|
print " found missing strings: \n";
|
||||||
foreach($result as $value)
|
foreach($result as $value)
|
||||||
{
|
{
|
||||||
print " " . $value . "\n";
|
print " " . $value . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print " no missing strings found! \n ";
|
print " no missing strings found! \n ";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "\nReverse Checking " . $key . " to " . $baseLanguage . "\n";
|
print "\nReverse Checking " . $key . " to " . $baseLanguage . "\n";
|
||||||
$result = compare($comp, $base);
|
$result = compare($comp, $base);
|
||||||
|
|
||||||
if(is_array($result)
|
if(is_array($result)
|
||||||
&& sizeof($result) > 0)
|
&& sizeof($result) > 0)
|
||||||
{
|
{
|
||||||
print " found strings not in basefile: \n";
|
print " found strings not in basefile: \n";
|
||||||
foreach($result as $key => $value)
|
foreach($result as $key => $value)
|
||||||
{
|
{
|
||||||
print " " . $value . "\n";
|
print " " . $value . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print " There are no strings which are not in the basefile! \n ";
|
print " There are no strings which are not in the basefile! \n ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------
|
||||||
// FUNCTIONS
|
// FUNCTIONS
|
||||||
//-----------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* prints the help screen
|
* prints the help screen
|
||||||
*
|
*
|
||||||
* @param array $argv
|
* @param array $argv
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function print_help($argv)
|
function print_help($argv)
|
||||||
{
|
{
|
||||||
print "Usage: php " . $argv[0] . " /PATH/TO/LNG \n";
|
print "Usage: php " . $argv[0] . " /PATH/TO/LNG \n";
|
||||||
print " \n ";
|
print " \n ";
|
||||||
}
|
}
|
||||||
|
|
||||||
function import($file)
|
function import($file)
|
||||||
{
|
{
|
||||||
$input = file($file);
|
$input = file($file);
|
||||||
$return = array();
|
$return = array();
|
||||||
foreach($input as $key => $value)
|
foreach($input as $key => $value)
|
||||||
{
|
{
|
||||||
if(!preg_match('/^\$/', $value))
|
if(!preg_match('/^\$/', $value))
|
||||||
{
|
{
|
||||||
unset($input[$key]);
|
unset($input[$key]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// generate the key
|
// generate the key
|
||||||
|
|
||||||
$key = preg_replace('/^\$lng\[\'(.*)=(.*)$/U', '\\1', $value);
|
$key = preg_replace('/^\$lng\[\'(.*)=(.*)$/U', '\\1', $value);
|
||||||
$key = str_replace('[\'', '/', $key);
|
$key = str_replace('[\'', '/', $key);
|
||||||
$key = trim(str_replace('\']', '', $key));
|
$key = trim(str_replace('\']', '', $key));
|
||||||
|
|
||||||
//generate the value
|
//generate the value
|
||||||
|
|
||||||
$value = trim($value);
|
$value = trim($value);
|
||||||
|
|
||||||
// set the result
|
// set the result
|
||||||
|
|
||||||
$return[$key] = $value;
|
$return[$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function compare($array1, $array2)
|
function compare($array1, $array2)
|
||||||
{
|
{
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach($array1 as $key => $value)
|
foreach($array1 as $key => $value)
|
||||||
{
|
{
|
||||||
if(!isset($array2[$key]))
|
if(!isset($array2[$key]))
|
||||||
{
|
{
|
||||||
$result[$key] = $value;
|
$result[$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,82 +1,82 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Install
|
* @package Install
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We need those defines, because the tables.inc.php doesn't have them.
|
* We need those defines, because the tables.inc.php doesn't have them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('TABLE_POSTFIX_TRANSPORT', 'postfix_transport');
|
define('TABLE_POSTFIX_TRANSPORT', 'postfix_transport');
|
||||||
define('TABLE_POSTFIX_USERS', 'postfix_users');
|
define('TABLE_POSTFIX_USERS', 'postfix_users');
|
||||||
define('TABLE_POSTFIX_VIRTUAL', 'postfix_virtual');
|
define('TABLE_POSTFIX_VIRTUAL', 'postfix_virtual');
|
||||||
define('TABLE_PROFTPD_GROUPS', 'proftpd_groups');
|
define('TABLE_PROFTPD_GROUPS', 'proftpd_groups');
|
||||||
define('TABLE_PROFTPD_USERS', 'proftpd_users');
|
define('TABLE_PROFTPD_USERS', 'proftpd_users');
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.0.10')
|
if($settings['panel']['version'] == '1.0.10')
|
||||||
{
|
{
|
||||||
// Drop/Rename postfix_ tables
|
// Drop/Rename postfix_ tables
|
||||||
|
|
||||||
$db->query("DROP TABLE `" . TABLE_POSTFIX_TRANSPORT . "`");
|
$db->query("DROP TABLE `" . TABLE_POSTFIX_TRANSPORT . "`");
|
||||||
$db->query("ALTER TABLE `" . TABLE_POSTFIX_USERS . "` RENAME `" . TABLE_MAIL_USERS . "` ");
|
$db->query("ALTER TABLE `" . TABLE_POSTFIX_USERS . "` RENAME `" . TABLE_MAIL_USERS . "` ");
|
||||||
$db->query("ALTER TABLE `" . TABLE_POSTFIX_VIRTUAL . "` RENAME `" . TABLE_MAIL_VIRTUAL . "` ");
|
$db->query("ALTER TABLE `" . TABLE_POSTFIX_VIRTUAL . "` RENAME `" . TABLE_MAIL_VIRTUAL . "` ");
|
||||||
|
|
||||||
// Rename proftpd_ tables
|
// Rename proftpd_ tables
|
||||||
|
|
||||||
$db->query("ALTER TABLE `" . TABLE_PROFTPD_USERS . "` RENAME `" . TABLE_FTP_USERS . "` ");
|
$db->query("ALTER TABLE `" . TABLE_PROFTPD_USERS . "` RENAME `" . TABLE_FTP_USERS . "` ");
|
||||||
$db->query("ALTER TABLE `" . TABLE_PROFTPD_GROUPS . "` RENAME `" . TABLE_FTP_GROUPS . "` ");
|
$db->query("ALTER TABLE `" . TABLE_PROFTPD_GROUPS . "` RENAME `" . TABLE_FTP_GROUPS . "` ");
|
||||||
|
|
||||||
// Adding tables
|
// Adding tables
|
||||||
|
|
||||||
$db->query("DROP TABLE IF EXISTS `" . TABLE_PANEL_HTACCESS . "`;");
|
$db->query("DROP TABLE IF EXISTS `" . TABLE_PANEL_HTACCESS . "`;");
|
||||||
$db->query("CREATE TABLE `" . TABLE_PANEL_HTACCESS . "` (" . " `id` int(11) unsigned NOT NULL auto_increment," . " `customerid` int(11) unsigned NOT NULL default '0'," . " `path` varchar(255) NOT NULL default ''," . " `options_indexes` tinyint(1) NOT NULL default '0'," . " PRIMARY KEY (`id`)" . ") TYPE=MyISAM ;");
|
$db->query("CREATE TABLE `" . TABLE_PANEL_HTACCESS . "` (" . " `id` int(11) unsigned NOT NULL auto_increment," . " `customerid` int(11) unsigned NOT NULL default '0'," . " `path` varchar(255) NOT NULL default ''," . " `options_indexes` tinyint(1) NOT NULL default '0'," . " PRIMARY KEY (`id`)" . ") TYPE=MyISAM ;");
|
||||||
$db->query("DROP TABLE IF EXISTS `" . TABLE_PANEL_ADMINS . "`;");
|
$db->query("DROP TABLE IF EXISTS `" . TABLE_PANEL_ADMINS . "`;");
|
||||||
$db->query("CREATE TABLE `" . TABLE_PANEL_ADMINS . "` (" . " `adminid` int(11) unsigned NOT NULL auto_increment," . " `loginname` varchar(50) NOT NULL default ''," . " `password` varchar(50) NOT NULL default ''," . " `name` varchar(255) NOT NULL default ''," . " `email` varchar(255) NOT NULL default ''," . " `customers` int(15) NOT NULL default '0'," . " `customers_used` int(15) NOT NULL default '0'," . " `customers_see_all` tinyint(1) NOT NULL default '0'," . " `domains` int(15) NOT NULL default '0'," . " `domains_used` int(15) NOT NULL default '0'," . " `domains_see_all` tinyint(1) NOT NULL default '0'," . " `change_serversettings` tinyint(1) NOT NULL default '0'," . " `diskspace` int(15) NOT NULL default '0'," . " `diskspace_used` int(15) NOT NULL default '0'," . " `mysqls` int(15) NOT NULL default '0'," . " `mysqls_used` int(15) NOT NULL default '0'," . " `emails` int(15) NOT NULL default '0'," . " `emails_used` int(15) NOT NULL default '0'," . " `email_forwarders` int(15) NOT NULL default '0'," . " `email_forwarders_used` int(15) NOT NULL default '0'," . " `ftps` int(15) NOT NULL default '0'," . " `ftps_used` int(15) NOT NULL default '0'," . " `subdomains` int(15) NOT NULL default '0'," . " `subdomains_used` int(15) NOT NULL default '0'," . " `traffic` int(15) NOT NULL default '0'," . " `traffic_used` int(15) NOT NULL default '0'," . " `deactivated` tinyint(1) NOT NULL default '0'," . " `lastlogin_succ` int(11) unsigned NOT NULL default '0'," . " `lastlogin_fail` int(11) unsigned NOT NULL default '0'," . " `loginfail_count` int(11) unsigned NOT NULL default '0'," . " PRIMARY KEY (`adminid`)" . ") TYPE=MyISAM ;");
|
$db->query("CREATE TABLE `" . TABLE_PANEL_ADMINS . "` (" . " `adminid` int(11) unsigned NOT NULL auto_increment," . " `loginname` varchar(50) NOT NULL default ''," . " `password` varchar(50) NOT NULL default ''," . " `name` varchar(255) NOT NULL default ''," . " `email` varchar(255) NOT NULL default ''," . " `customers` int(15) NOT NULL default '0'," . " `customers_used` int(15) NOT NULL default '0'," . " `customers_see_all` tinyint(1) NOT NULL default '0'," . " `domains` int(15) NOT NULL default '0'," . " `domains_used` int(15) NOT NULL default '0'," . " `domains_see_all` tinyint(1) NOT NULL default '0'," . " `change_serversettings` tinyint(1) NOT NULL default '0'," . " `diskspace` int(15) NOT NULL default '0'," . " `diskspace_used` int(15) NOT NULL default '0'," . " `mysqls` int(15) NOT NULL default '0'," . " `mysqls_used` int(15) NOT NULL default '0'," . " `emails` int(15) NOT NULL default '0'," . " `emails_used` int(15) NOT NULL default '0'," . " `email_forwarders` int(15) NOT NULL default '0'," . " `email_forwarders_used` int(15) NOT NULL default '0'," . " `ftps` int(15) NOT NULL default '0'," . " `ftps_used` int(15) NOT NULL default '0'," . " `subdomains` int(15) NOT NULL default '0'," . " `subdomains_used` int(15) NOT NULL default '0'," . " `traffic` int(15) NOT NULL default '0'," . " `traffic_used` int(15) NOT NULL default '0'," . " `deactivated` tinyint(1) NOT NULL default '0'," . " `lastlogin_succ` int(11) unsigned NOT NULL default '0'," . " `lastlogin_fail` int(11) unsigned NOT NULL default '0'," . " `loginfail_count` int(11) unsigned NOT NULL default '0'," . " PRIMARY KEY (`adminid`)" . ") TYPE=MyISAM ;");
|
||||||
|
|
||||||
// Insert Admin user
|
// Insert Admin user
|
||||||
|
|
||||||
if(!isset($adminusername)
|
if(!isset($adminusername)
|
||||||
|| $adminusername == '')
|
|| $adminusername == '')
|
||||||
{
|
{
|
||||||
$adminusername = 'admin';
|
$adminusername = 'admin';
|
||||||
$adminpassword = 'admin';
|
$adminpassword = 'admin';
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->query("INSERT INTO `" . TABLE_PANEL_ADMINS . "` (`loginname`, `password`, `name`, `email`, `customers`, `customers_used`, `customers_see_all`, `domains`, `domains_used`, `domains_see_all`, `change_serversettings`, `diskspace`, `diskspace_used`, `mysqls`, `mysqls_used`, `emails`, `emails_used`, `email_forwarders`, `email_forwarders_used`, `ftps`, `ftps_used`, `subdomains`, `subdomains_used`, `traffic`, `traffic_used`, `deactivated`) VALUES ('" . $db->escape($adminusername) . "', '" . md5($adminpassword) . "', 'Siteadmin', 'admin@servername', -1, 0, 1, -1, 0, 1, 1, -1024, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1048576, 0, 0);");
|
$db->query("INSERT INTO `" . TABLE_PANEL_ADMINS . "` (`loginname`, `password`, `name`, `email`, `customers`, `customers_used`, `customers_see_all`, `domains`, `domains_used`, `domains_see_all`, `change_serversettings`, `diskspace`, `diskspace_used`, `mysqls`, `mysqls_used`, `emails`, `emails_used`, `email_forwarders`, `email_forwarders_used`, `ftps`, `ftps_used`, `subdomains`, `subdomains_used`, `traffic`, `traffic_used`, `deactivated`) VALUES ('" . $db->escape($adminusername) . "', '" . md5($adminpassword) . "', 'Siteadmin', 'admin@servername', -1, 0, 1, -1, 0, 1, 1, -1024, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1048576, 0, 0);");
|
||||||
|
|
||||||
// Alter Tables
|
// Alter Tables
|
||||||
|
|
||||||
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `adminid` INT( 11 ) UNSIGNED NOT NULL ," . "ADD `lastlogin_succ` INT( 11 ) UNSIGNED NOT NULL ," . "ADD `lastlogin_fail` INT( 11 ) UNSIGNED NOT NULL ," . "ADD `loginfail_count` INT( 11 ) UNSIGNED NOT NULL ;");
|
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `adminid` INT( 11 ) UNSIGNED NOT NULL ," . "ADD `lastlogin_succ` INT( 11 ) UNSIGNED NOT NULL ," . "ADD `lastlogin_fail` INT( 11 ) UNSIGNED NOT NULL ," . "ADD `loginfail_count` INT( 11 ) UNSIGNED NOT NULL ;");
|
||||||
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD INDEX ( `adminid` ) ;");
|
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD INDEX ( `adminid` ) ;");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `adminid` = '1'");
|
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `adminid` = '1'");
|
||||||
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `adminid` INT( 11 ) UNSIGNED NOT NULL ," . "ADD `iswildcarddomain` TINYINT( 1 ) NOT NULL ," . "ADD `speciallogfile` TINYINT( 1 ) NOT NULL ;");
|
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `adminid` INT( 11 ) UNSIGNED NOT NULL ," . "ADD `iswildcarddomain` TINYINT( 1 ) NOT NULL ," . "ADD `speciallogfile` TINYINT( 1 ) NOT NULL ;");
|
||||||
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD INDEX ( `adminid` ) ;");
|
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD INDEX ( `adminid` ) ;");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `adminid` = '1'");
|
$db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `adminid` = '1'");
|
||||||
$db->query("ALTER TABLE `" . TABLE_PANEL_SESSIONS . "` CHANGE `customerid` `userid` INT( 11 ) UNSIGNED DEFAULT '0' NOT NULL ");
|
$db->query("ALTER TABLE `" . TABLE_PANEL_SESSIONS . "` CHANGE `customerid` `userid` INT( 11 ) UNSIGNED DEFAULT '0' NOT NULL ");
|
||||||
$db->query("ALTER TABLE `" . TABLE_MAIL_USERS . "` CHANGE `password` `password_enc` VARCHAR( 128 ) NOT NULL ");
|
$db->query("ALTER TABLE `" . TABLE_MAIL_USERS . "` CHANGE `password` `password_enc` VARCHAR( 128 ) NOT NULL ");
|
||||||
$db->query("ALTER TABLE `" . TABLE_MAIL_USERS . "` ADD `password` VARCHAR( 128 ) NOT NULL AFTER `email` ;");
|
$db->query("ALTER TABLE `" . TABLE_MAIL_USERS . "` ADD `password` VARCHAR( 128 ) NOT NULL AFTER `email` ;");
|
||||||
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (24, 'login', 'maxloginattempts', '3');");
|
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (24, 'login', 'maxloginattempts', '3');");
|
||||||
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (25, 'login', 'deactivatetime', '900');");
|
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (25, 'login', 'deactivatetime', '900');");
|
||||||
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (26, 'panel', 'webmail_url', '');");
|
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (26, 'panel', 'webmail_url', '');");
|
||||||
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (27, 'panel', 'webftp_url', '');");
|
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (27, 'panel', 'webftp_url', '');");
|
||||||
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (28, 'panel', 'standardlanguage', 'german');");
|
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (28, 'panel', 'standardlanguage', 'german');");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname`='ipaddress' WHERE `settinggroup`='system' AND `varname`='ipadress'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname`='ipaddress' WHERE `settinggroup`='system' AND `varname`='ipadress'");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.2.0' WHERE `settinggroup`='panel' AND `varname`='version'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.2.0' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||||
$settings['panel']['version'] = '1.2.0';
|
$settings['panel']['version'] = '1.2.0';
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,132 +1,132 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Install
|
* @package Install
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('TABLE_POSTFIX_TRANSPORT', 'postfix_transport');
|
define('TABLE_POSTFIX_TRANSPORT', 'postfix_transport');
|
||||||
define('TABLE_POSTFIX_USERS', 'postfix_users');
|
define('TABLE_POSTFIX_USERS', 'postfix_users');
|
||||||
define('TABLE_POSTFIX_VIRTUAL', 'postfix_virtual');
|
define('TABLE_POSTFIX_VIRTUAL', 'postfix_virtual');
|
||||||
define('TABLE_PROFTPD_GROUPS', 'proftpd_groups');
|
define('TABLE_PROFTPD_GROUPS', 'proftpd_groups');
|
||||||
define('TABLE_PROFTPD_USERS', 'proftpd_users');
|
define('TABLE_PROFTPD_USERS', 'proftpd_users');
|
||||||
|
|
||||||
if(!isset($settings['panel']['version']))
|
if(!isset($settings['panel']['version']))
|
||||||
{
|
{
|
||||||
$settings['panel']['version'] = '1.0.0';
|
$settings['panel']['version'] = '1.0.0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.0.0')
|
if($settings['panel']['version'] == '1.0.0')
|
||||||
{
|
{
|
||||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '1.0.1')");
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '1.0.1')");
|
||||||
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `openbasedir` TINYINT( 1 ) NOT NULL , ADD `safemode` TINYINT( 1 ) NOT NULL");
|
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `openbasedir` TINYINT( 1 ) NOT NULL , ADD `safemode` TINYINT( 1 ) NOT NULL");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `openbasedir`='1', `safemode`='1'");
|
$db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `openbasedir`='1', `safemode`='1'");
|
||||||
$settings['panel']['version'] = '1.0.1';
|
$settings['panel']['version'] = '1.0.1';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.0.1')
|
if($settings['panel']['version'] == '1.0.1')
|
||||||
{
|
{
|
||||||
$db->query("ALTER TABLE `" . TABLE_POSTFIX_USERS . "` ADD `domainid` INT( 11 ) NOT NULL AFTER `postfix`");
|
$db->query("ALTER TABLE `" . TABLE_POSTFIX_USERS . "` ADD `domainid` INT( 11 ) NOT NULL AFTER `postfix`");
|
||||||
$db->query("ALTER TABLE `" . TABLE_POSTFIX_VIRTUAL . "` ADD `domainid` INT( 11 ) NOT NULL AFTER `destination`");
|
$db->query("ALTER TABLE `" . TABLE_POSTFIX_VIRTUAL . "` ADD `domainid` INT( 11 ) NOT NULL AFTER `destination`");
|
||||||
$result = $db->query("SELECT `id`, `domain` FROM `" . TABLE_PANEL_DOMAINS . "`");
|
$result = $db->query("SELECT `id`, `domain` FROM `" . TABLE_PANEL_DOMAINS . "`");
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
$db->query("UPDATE `" . TABLE_POSTFIX_USERS . "` SET `domainid`='" . (int)$row['id'] . "' WHERE `email` LIKE '%@" . $db->escape($row['domain']) . "'");
|
$db->query("UPDATE `" . TABLE_POSTFIX_USERS . "` SET `domainid`='" . (int)$row['id'] . "' WHERE `email` LIKE '%@" . $db->escape($row['domain']) . "'");
|
||||||
$db->query("UPDATE `" . TABLE_POSTFIX_VIRTUAL . "` SET `domainid`='" . (int)$row['id'] . "' WHERE `email` LIKE '%@" . $db->escape($row['domain']) . "'");
|
$db->query("UPDATE `" . TABLE_POSTFIX_VIRTUAL . "` SET `domainid`='" . (int)$row['id'] . "' WHERE `email` LIKE '%@" . $db->escape($row['domain']) . "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `createstdsubdomain` TINYINT( 1 ) NOT NULL AFTER `documentroot`");
|
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `createstdsubdomain` TINYINT( 1 ) NOT NULL AFTER `documentroot`");
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
inserttask('4');
|
inserttask('4');
|
||||||
$hostname = explode('@', $settings['panel']['adminmail']);
|
$hostname = explode('@', $settings['panel']['adminmail']);
|
||||||
$hostname = $hostname[1];
|
$hostname = $hostname[1];
|
||||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (23, 'system', 'hostname', '" . $db->escape($hostname) . "')");
|
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (23, 'system', 'hostname', '" . $db->escape($hostname) . "')");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.2' WHERE `settinggroup`='panel' AND `varname`='version'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.2' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||||
$settings['panel']['version'] = '1.0.2';
|
$settings['panel']['version'] = '1.0.2';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.0.2')
|
if($settings['panel']['version'] == '1.0.2')
|
||||||
{
|
{
|
||||||
$db->query("ALTER TABLE `" . TABLE_PANEL_SESSIONS . "` ADD `language` VARCHAR( 64 ) NOT NULL AFTER `lastactivity` ;");
|
$db->query("ALTER TABLE `" . TABLE_PANEL_SESSIONS . "` ADD `language` VARCHAR( 64 ) NOT NULL AFTER `lastactivity` ;");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.3' WHERE `settinggroup`='panel' AND `varname`='version'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.3' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||||
$settings['panel']['version'] = '1.0.3';
|
$settings['panel']['version'] = '1.0.3';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.0.3')
|
if($settings['panel']['version'] == '1.0.3')
|
||||||
{
|
{
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.4' WHERE `settinggroup`='panel' AND `varname`='version'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.4' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||||
$settings['panel']['version'] = '1.0.4';
|
$settings['panel']['version'] = '1.0.4';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.0.4')
|
if($settings['panel']['version'] == '1.0.4')
|
||||||
{
|
{
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.5' WHERE `settinggroup`='panel' AND `varname`='version'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.5' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||||
$settings['panel']['version'] = '1.0.5';
|
$settings['panel']['version'] = '1.0.5';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.0.5')
|
if($settings['panel']['version'] == '1.0.5')
|
||||||
{
|
{
|
||||||
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `deactivated` TINYINT( 1 ) NOT NULL ;");
|
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `deactivated` TINYINT( 1 ) NOT NULL ;");
|
||||||
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `deactivated` TINYINT( 1 ) NOT NULL ;");
|
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `deactivated` TINYINT( 1 ) NOT NULL ;");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.6' WHERE `settinggroup`='panel' AND `varname`='version'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.6' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||||
$settings['panel']['version'] = '1.0.6';
|
$settings['panel']['version'] = '1.0.6';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.0.6')
|
if($settings['panel']['version'] == '1.0.6')
|
||||||
{
|
{
|
||||||
$db->query("ALTER TABLE `" . TABLE_POSTFIX_VIRTUAL . "` ADD `popaccountid` INT( 11 ) NOT NULL ;");
|
$db->query("ALTER TABLE `" . TABLE_POSTFIX_VIRTUAL . "` ADD `popaccountid` INT( 11 ) NOT NULL ;");
|
||||||
$result = $db->query("SELECT `id`, `email` FROM `" . TABLE_POSTFIX_USERS . "`");
|
$result = $db->query("SELECT `id`, `email` FROM `" . TABLE_POSTFIX_USERS . "`");
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
$db->query("UPDATE `" . TABLE_POSTFIX_VIRTUAL . "` SET `popaccountid`='" . (int)$row['id'] . "' WHERE `email` = '" . $db->escape(str_replace($settings['email']['catchallkeyword'], '', $row['email'])) . "' AND `destination` = '" . $db->escape($row['email']) . "'");
|
$db->query("UPDATE `" . TABLE_POSTFIX_VIRTUAL . "` SET `popaccountid`='" . (int)$row['id'] . "' WHERE `email` = '" . $db->escape(str_replace($settings['email']['catchallkeyword'], '', $row['email'])) . "' AND `destination` = '" . $db->escape($row['email']) . "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $db->query("SELECT `id`, `email`, `destination` FROM `" . TABLE_POSTFIX_VIRTUAL . "` WHERE `popaccountid` = '0'");
|
$result = $db->query("SELECT `id`, `email`, `destination` FROM `" . TABLE_POSTFIX_VIRTUAL . "` WHERE `popaccountid` = '0'");
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
if(str_replace($settings['email']['catchallkeyword'], '', $row['email']) != $row['email'])
|
if(str_replace($settings['email']['catchallkeyword'], '', $row['email']) != $row['email'])
|
||||||
{
|
{
|
||||||
$db->query("UPDATE `" . TABLE_POSTFIX_VIRTUAL . "` SET `email` = '" . $db->escape(str_replace($settings['email']['catchallkeyword'], '', $row['email'])) . "' WHERE `id` = '" . (int)$row['id'] . "'");
|
$db->query("UPDATE `" . TABLE_POSTFIX_VIRTUAL . "` SET `email` = '" . $db->escape(str_replace($settings['email']['catchallkeyword'], '', $row['email'])) . "' WHERE `id` = '" . (int)$row['id'] . "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.7' WHERE `settinggroup`='panel' AND `varname`='version'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.7' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||||
$settings['panel']['version'] = '1.0.7';
|
$settings['panel']['version'] = '1.0.7';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.0.7')
|
if($settings['panel']['version'] == '1.0.7')
|
||||||
{
|
{
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.8' WHERE `settinggroup`='panel' AND `varname`='version'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.8' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||||
$settings['panel']['version'] = '1.0.8';
|
$settings['panel']['version'] = '1.0.8';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.0.8')
|
if($settings['panel']['version'] == '1.0.8')
|
||||||
{
|
{
|
||||||
$db->query("ALTER TABLE `" . TABLE_PANEL_DATABASES . "` DROP `password` ;");
|
$db->query("ALTER TABLE `" . TABLE_PANEL_DATABASES . "` DROP `password` ;");
|
||||||
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `specialsettings` TEXT NOT NULL AFTER `safemode` ;");
|
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `specialsettings` TEXT NOT NULL AFTER `safemode` ;");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.9' WHERE `settinggroup`='panel' AND `varname`='version'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.9' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||||
$settings['panel']['version'] = '1.0.9';
|
$settings['panel']['version'] = '1.0.9';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.0.9')
|
if($settings['panel']['version'] == '1.0.9')
|
||||||
{
|
{
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.10' WHERE `settinggroup`='panel' AND `varname`='version'");
|
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.10' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||||
$settings['panel']['version'] = '1.0.10';
|
$settings['panel']['version'] = '1.0.10';
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,120 +1,120 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Install
|
* @package Install
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.4')
|
if($settings['panel']['version'] == '1.4')
|
||||||
{
|
{
|
||||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.4 to 1.4-svn1");
|
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.4 to 1.4-svn1");
|
||||||
|
|
||||||
// Going to fix the stuff the update 1.2.19-svn42 to 1.2.19-svn43 broke
|
// Going to fix the stuff the update 1.2.19-svn42 to 1.2.19-svn43 broke
|
||||||
|
|
||||||
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `documentroot` LIKE 'http%';");
|
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `documentroot` LIKE 'http%';");
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
if(preg_match("#(https?)://?(.*)#i", $row['documentroot'], $matches))
|
if(preg_match("#(https?)://?(.*)#i", $row['documentroot'], $matches))
|
||||||
{
|
{
|
||||||
$row['documentroot'] = $matches[1] . "://" . $matches[2];
|
$row['documentroot'] = $matches[1] . "://" . $matches[2];
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `documentroot` = '" . $db->escape($row['documentroot']) . "' WHERE `id` = '" . $row['id'] . "';");
|
$db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `documentroot` = '" . $db->escape($row['documentroot']) . "' WHERE `id` = '" . $row['id'] . "';");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set new version
|
// set new version
|
||||||
|
|
||||||
$query = 'UPDATE `%s` SET `value` = \'1.4-svn1\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
$query = 'UPDATE `%s` SET `value` = \'1.4-svn1\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
||||||
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
$settings['panel']['version'] = '1.4-svn1';
|
$settings['panel']['version'] = '1.4-svn1';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.4-svn1')
|
if($settings['panel']['version'] == '1.4-svn1')
|
||||||
{
|
{
|
||||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.4-svn1 to 1.4.1");
|
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.4-svn1 to 1.4.1");
|
||||||
|
|
||||||
// set new version
|
// set new version
|
||||||
|
|
||||||
$query = 'UPDATE `%s` SET `value` = \'1.4.1\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
$query = 'UPDATE `%s` SET `value` = \'1.4.1\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
||||||
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
$settings['panel']['version'] = '1.4.1';
|
$settings['panel']['version'] = '1.4.1';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.4.1')
|
if($settings['panel']['version'] == '1.4.1')
|
||||||
{
|
{
|
||||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.4.1 to 1.4.1-svn1");
|
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.4.1 to 1.4.1-svn1");
|
||||||
|
|
||||||
// give at least ONE admin the permission to edit phpsettings, bug #1031
|
// give at least ONE admin the permission to edit phpsettings, bug #1031
|
||||||
|
|
||||||
$cntCanEditPHP = $db->query_first("SELECT COUNT(`caneditphpsettings`) as `cnt` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `caneditphpsettings` = '1'");
|
$cntCanEditPHP = $db->query_first("SELECT COUNT(`caneditphpsettings`) as `cnt` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `caneditphpsettings` = '1'");
|
||||||
|
|
||||||
if($cntCanEditPHP['cnt'] <= 0)
|
if($cntCanEditPHP['cnt'] <= 0)
|
||||||
{
|
{
|
||||||
// none of the admins can edit php-settings,
|
// none of the admins can edit php-settings,
|
||||||
//so we give those who can edit serversettings the right to edit php-settings
|
//so we give those who can edit serversettings the right to edit php-settings
|
||||||
|
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `caneditphpsettings` = '1' WHERE `change_serversettings` = '1'");
|
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `caneditphpsettings` = '1' WHERE `change_serversettings` = '1'");
|
||||||
}
|
}
|
||||||
|
|
||||||
// set new version
|
// set new version
|
||||||
|
|
||||||
$query = 'UPDATE `%s` SET `value` = \'1.4.1-svn1\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
$query = 'UPDATE `%s` SET `value` = \'1.4.1-svn1\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
||||||
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
$settings['panel']['version'] = '1.4.1-svn1';
|
$settings['panel']['version'] = '1.4.1-svn1';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.4.1-svn1')
|
if($settings['panel']['version'] == '1.4.1-svn1')
|
||||||
{
|
{
|
||||||
$updateto = '1.4.1-svn2';
|
$updateto = '1.4.1-svn2';
|
||||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from " . $settings['panel']['version'] . " to " . $updateto);
|
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from " . $settings['panel']['version'] . " to " . $updateto);
|
||||||
|
|
||||||
// set new version
|
// set new version
|
||||||
|
|
||||||
$query = 'UPDATE `%s` SET `value` = \'' . $updateto . '\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
$query = 'UPDATE `%s` SET `value` = \'' . $updateto . '\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
||||||
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
$settings['panel']['version'] = $updateto;
|
$settings['panel']['version'] = $updateto;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.4.1-svn2')
|
if($settings['panel']['version'] == '1.4.1-svn2')
|
||||||
{
|
{
|
||||||
$updateto = '1.4.1-svn3';
|
$updateto = '1.4.1-svn3';
|
||||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from " . $settings['panel']['version'] . " to " . $updateto);
|
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from " . $settings['panel']['version'] . " to " . $updateto);
|
||||||
|
|
||||||
// set new version
|
// set new version
|
||||||
|
|
||||||
$query = 'UPDATE `%s` SET `value` = \'' . $updateto . '\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
$query = 'UPDATE `%s` SET `value` = \'' . $updateto . '\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
||||||
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
$settings['panel']['version'] = $updateto;
|
$settings['panel']['version'] = $updateto;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.4.1-svn3')
|
if($settings['panel']['version'] == '1.4.1-svn3')
|
||||||
{
|
{
|
||||||
$updateto = '1.4.2';
|
$updateto = '1.4.2';
|
||||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from " . $settings['panel']['version'] . " to " . $updateto);
|
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from " . $settings['panel']['version'] . " to " . $updateto);
|
||||||
|
|
||||||
// set new version
|
// set new version
|
||||||
|
|
||||||
$query = 'UPDATE `%s` SET `value` = \'' . $updateto . '\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
$query = 'UPDATE `%s` SET `value` = \'' . $updateto . '\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
||||||
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
$settings['panel']['version'] = $updateto;
|
$settings['panel']['version'] = $updateto;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,95 +1,95 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Install
|
* @package Install
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'), $db, $settings);
|
$updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'), $db, $settings);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* since froxlor, we have to check if there's still someone
|
* since froxlor, we have to check if there's still someone
|
||||||
* out there using syscp and needs to upgrade
|
* out there using syscp and needs to upgrade
|
||||||
*/
|
*/
|
||||||
if(!isFroxlor())
|
if(!isFroxlor())
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* First case: We are updating from a version < 1.0.10
|
* First case: We are updating from a version < 1.0.10
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(!isset($settings['panel']['version'])
|
if(!isset($settings['panel']['version'])
|
||||||
|| (substr($settings['panel']['version'], 0, 3) == '1.0' && $settings['panel']['version'] != '1.0.10'))
|
|| (substr($settings['panel']['version'], 0, 3) == '1.0' && $settings['panel']['version'] != '1.0.10'))
|
||||||
{
|
{
|
||||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.0 to 1.0.10");
|
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.0 to 1.0.10");
|
||||||
include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.0/update_1.0_1.0.10.inc.php'));
|
include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.0/update_1.0_1.0.10.inc.php'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Second case: We are updating from version = 1.0.10
|
* Second case: We are updating from version = 1.0.10
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if($settings['panel']['version'] == '1.0.10')
|
if($settings['panel']['version'] == '1.0.10')
|
||||||
{
|
{
|
||||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.0.10 to 1.2-beta1");
|
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.0.10 to 1.2-beta1");
|
||||||
include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.0/update_1.0.10_1.2-beta1.inc.php'));
|
include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.0/update_1.0.10_1.2-beta1.inc.php'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Third case: We are updating from a version > 1.2-beta1
|
* Third case: We are updating from a version > 1.2-beta1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(substr($settings['panel']['version'], 0, 3) == '1.2')
|
if(substr($settings['panel']['version'], 0, 3) == '1.2')
|
||||||
{
|
{
|
||||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.2-beta1 to 1.2.19");
|
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.2-beta1 to 1.2.19");
|
||||||
include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.2/update_1.2-beta1_1.2.19.inc.php'));
|
include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.2/update_1.2-beta1_1.2.19.inc.php'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 4th case: We are updating from 1.2.19 to 1.2.20 (prolly the last from the 1.2.x series)
|
* 4th case: We are updating from 1.2.19 to 1.2.20 (prolly the last from the 1.2.x series)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(substr($settings['panel']['version'], 0, 6) == '1.2.19')
|
if(substr($settings['panel']['version'], 0, 6) == '1.2.19')
|
||||||
{
|
{
|
||||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.2.19 to 1.4");
|
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.2.19 to 1.4");
|
||||||
include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.2/update_1.2.19_1.4.inc.php'));
|
include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.2/update_1.2.19_1.4.inc.php'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 5th case: We are updating from a version >= 1.4
|
* 5th case: We are updating from a version >= 1.4
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(substr($settings['panel']['version'], 0, 3) == '1.4')
|
if(substr($settings['panel']['version'], 0, 3) == '1.4')
|
||||||
{
|
{
|
||||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.4");
|
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.4");
|
||||||
include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.4/update_1.4.inc.php'));
|
include_once (makeCorrectFile(dirname(__FILE__).'/updates/syscp/1.4/update_1.4.inc.php'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Upgrading SysCP to Froxlor-0.9
|
* Upgrading SysCP to Froxlor-0.9
|
||||||
*
|
*
|
||||||
* when we reach this part, all necessary updates
|
* when we reach this part, all necessary updates
|
||||||
* should have been installes automatically by the
|
* should have been installes automatically by the
|
||||||
* update scripts.
|
* update scripts.
|
||||||
*/
|
*/
|
||||||
include_once (makeCorrectFile(dirname(__FILE__).'/updates/froxlor/upgrade_syscp.inc.php'));
|
include_once (makeCorrectFile(dirname(__FILE__).'/updates/froxlor/upgrade_syscp.inc.php'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isFroxlor())
|
if(isFroxlor())
|
||||||
{
|
{
|
||||||
include_once (makeCorrectFile(dirname(__FILE__).'/updates/froxlor/0.9/update_0.9.inc.php'));
|
include_once (makeCorrectFile(dirname(__FILE__).'/updates/froxlor/0.9/update_0.9.inc.php'));
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,272 +1,272 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of the Application Packaging Standard from SwSoft/Parallels
|
* Implementation of the Application Packaging Standard from SwSoft/Parallels
|
||||||
* http://apsstandard.com
|
* http://apsstandard.com
|
||||||
*
|
*
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package APS
|
* @package APS
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @todo logging
|
* @todo logging
|
||||||
* install specific packages by name
|
* install specific packages by name
|
||||||
* other solution than using url_fopen
|
* other solution than using url_fopen
|
||||||
* move url for distributionserver into panel
|
* move url for distributionserver into panel
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ApsUpdater extends ApsParser
|
class ApsUpdater extends ApsParser
|
||||||
{
|
{
|
||||||
private $settings = array();
|
private $settings = array();
|
||||||
private $db = false;
|
private $db = false;
|
||||||
private $RequestDomain = '';
|
private $RequestDomain = '';
|
||||||
private $RootUrl = '';
|
private $RootUrl = '';
|
||||||
private $RootDir = '';
|
private $RootDir = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor of class. setup some basic variables needed by class
|
* constructor of class. setup some basic variables needed by class
|
||||||
*
|
*
|
||||||
* @param db instance of the database class from syscp
|
* @param db instance of the database class from syscp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->RequestDomain = 'apscatalog.com';
|
$this->RequestDomain = 'apscatalog.com';
|
||||||
$this->RootUrl = '/1/';
|
$this->RootUrl = '/1/';
|
||||||
$this->RootDir = dirname(dirname(__FILE__)) . '/';
|
$this->RootDir = dirname(dirname(__FILE__)) . '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main function of class which handles all around the update mechanism
|
* Main function of class which handles all around the update mechanism
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function UpdateHandler()
|
public function UpdateHandler()
|
||||||
{
|
{
|
||||||
chdir($this->RootDir);
|
chdir($this->RootDir);
|
||||||
|
|
||||||
//return if allow_url_fopen is disabled
|
//return if allow_url_fopen is disabled
|
||||||
|
|
||||||
if(ini_get('allow_url_fopen') == '0')
|
if(ini_get('allow_url_fopen') == '0')
|
||||||
{
|
{
|
||||||
echo ("The APS updater cronjob requires that allow_url_fopen is enabled for the PHP CLI binary!\n");
|
echo ("The APS updater cronjob requires that allow_url_fopen is enabled for the PHP CLI binary!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//return if no task exists
|
//return if no task exists
|
||||||
|
|
||||||
$Result = $this->db->query('SELECT * FROM `' . TABLE_APS_TASKS . '` WHERE `Task` IN (' . TASK_SYSTEM_UPDATE . ', ' . TASK_SYSTEM_DOWNLOAD . ')');
|
$Result = $this->db->query('SELECT * FROM `' . TABLE_APS_TASKS . '` WHERE `Task` IN (' . TASK_SYSTEM_UPDATE . ', ' . TASK_SYSTEM_DOWNLOAD . ')');
|
||||||
|
|
||||||
if($this->db->num_rows($Result) == 0)
|
if($this->db->num_rows($Result) == 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//query first task -> updater can only do one job within a run
|
//query first task -> updater can only do one job within a run
|
||||||
|
|
||||||
$Task = $this->db->fetch_array($Result);
|
$Task = $this->db->fetch_array($Result);
|
||||||
$this->db->query('DELETE FROM `' . TABLE_APS_TASKS . '` WHERE `Task` = ' . $Task['Task']);
|
$this->db->query('DELETE FROM `' . TABLE_APS_TASKS . '` WHERE `Task` = ' . $Task['Task']);
|
||||||
|
|
||||||
//fetch all vendors
|
//fetch all vendors
|
||||||
|
|
||||||
$Vendors = self::FetchSubUrls($this->RootUrl);
|
$Vendors = self::FetchSubUrls($this->RootUrl);
|
||||||
foreach($Vendors as $Vendor)
|
foreach($Vendors as $Vendor)
|
||||||
{
|
{
|
||||||
//fetch all applications from vendors
|
//fetch all applications from vendors
|
||||||
|
|
||||||
$Applications = self::FetchSubUrls($this->RootUrl . $Vendor);
|
$Applications = self::FetchSubUrls($this->RootUrl . $Vendor);
|
||||||
foreach($Applications as $Application)
|
foreach($Applications as $Application)
|
||||||
{
|
{
|
||||||
//get newest version of package which is already installed
|
//get newest version of package which is already installed
|
||||||
|
|
||||||
$CurrentVersion = '';
|
$CurrentVersion = '';
|
||||||
$Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '` WHERE `Name` = "' . $this->db->escape(substr($Application, 0, -1)) . '"');
|
$Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '` WHERE `Name` = "' . $this->db->escape(substr($Application, 0, -1)) . '"');
|
||||||
|
|
||||||
while($Row = $this->db->fetch_array($Result))
|
while($Row = $this->db->fetch_array($Result))
|
||||||
{
|
{
|
||||||
if(version_compare($Row['Version'] . '-' . $Row['Release'], $CurrentVersion) == 1)
|
if(version_compare($Row['Version'] . '-' . $Row['Release'], $CurrentVersion) == 1)
|
||||||
{
|
{
|
||||||
$CurrentVersion = $Row['Version'] . '-' . $Row['Release'];
|
$CurrentVersion = $Row['Version'] . '-' . $Row['Release'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->db->num_rows($Result) != 0)
|
if($this->db->num_rows($Result) != 0)
|
||||||
{
|
{
|
||||||
//package already installed in system, search for newer version
|
//package already installed in system, search for newer version
|
||||||
|
|
||||||
if($Task['Task'] != TASK_SYSTEM_UPDATE)continue;
|
if($Task['Task'] != TASK_SYSTEM_UPDATE)continue;
|
||||||
|
|
||||||
//fetch different versions of application from distribution server
|
//fetch different versions of application from distribution server
|
||||||
|
|
||||||
$NewerVersion = '';
|
$NewerVersion = '';
|
||||||
$Versions = self::FetchSubUrls($this->RootUrl . $Vendor . $Application);
|
$Versions = self::FetchSubUrls($this->RootUrl . $Vendor . $Application);
|
||||||
foreach($Versions as $Version)
|
foreach($Versions as $Version)
|
||||||
{
|
{
|
||||||
$OnlineVersion = substr($Version, 0, -1);
|
$OnlineVersion = substr($Version, 0, -1);
|
||||||
|
|
||||||
//is package newer than current version?
|
//is package newer than current version?
|
||||||
|
|
||||||
if(version_compare($OnlineVersion, $CurrentVersion) == 1)
|
if(version_compare($OnlineVersion, $CurrentVersion) == 1)
|
||||||
{
|
{
|
||||||
//is new package newer than another one found before?
|
//is new package newer than another one found before?
|
||||||
|
|
||||||
if(version_compare($OnlineVersion, $NewerVersion) == 1)
|
if(version_compare($OnlineVersion, $NewerVersion) == 1)
|
||||||
{
|
{
|
||||||
$NewerVersion = $OnlineVersion;
|
$NewerVersion = $OnlineVersion;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($NewerVersion != '')
|
if($NewerVersion != '')
|
||||||
{
|
{
|
||||||
//download package as an update
|
//download package as an update
|
||||||
|
|
||||||
self::DownloadPackage($this->RootUrl . $Vendor . $Application . $NewerVersion, substr($Application, 0, -1), $NewerVersion);
|
self::DownloadPackage($this->RootUrl . $Vendor . $Application . $NewerVersion, substr($Application, 0, -1), $NewerVersion);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if($Task['Task'] != TASK_SYSTEM_DOWNLOAD)continue;
|
if($Task['Task'] != TASK_SYSTEM_DOWNLOAD)continue;
|
||||||
|
|
||||||
//new packages
|
//new packages
|
||||||
|
|
||||||
$NewVersion = '';
|
$NewVersion = '';
|
||||||
$Versions = self::FetchSubUrls($this->RootUrl . $Vendor . $Application);
|
$Versions = self::FetchSubUrls($this->RootUrl . $Vendor . $Application);
|
||||||
foreach($Versions as $Version)
|
foreach($Versions as $Version)
|
||||||
{
|
{
|
||||||
$OnlineVersion = substr($Version, 0, -1);
|
$OnlineVersion = substr($Version, 0, -1);
|
||||||
|
|
||||||
//is package newer than another one found before?
|
//is package newer than another one found before?
|
||||||
|
|
||||||
if(version_compare($OnlineVersion, $NewVersion) == 1)
|
if(version_compare($OnlineVersion, $NewVersion) == 1)
|
||||||
{
|
{
|
||||||
$NewVersion = $OnlineVersion;
|
$NewVersion = $OnlineVersion;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($NewVersion != '')
|
if($NewVersion != '')
|
||||||
{
|
{
|
||||||
//download package as a new one
|
//download package as a new one
|
||||||
|
|
||||||
self::DownloadPackage($this->RootUrl . $Vendor . $Application . $NewVersion, substr($Application, 0, -1), $NewVersion);
|
self::DownloadPackage($this->RootUrl . $Vendor . $Application . $NewVersion, substr($Application, 0, -1), $NewVersion);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* download a package from the distribution server and move the downloaded file in the temporary directory
|
* download a package from the distribution server and move the downloaded file in the temporary directory
|
||||||
*
|
*
|
||||||
* @param url url to download
|
* @param url url to download
|
||||||
* @param application string identifying the application name
|
* @param application string identifying the application name
|
||||||
* @param version string identifying the application version
|
* @param version string identifying the application version
|
||||||
* @return success true/error false
|
* @return success true/error false
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private function DownloadPackage($Url, $Application, $Version)
|
private function DownloadPackage($Url, $Application, $Version)
|
||||||
{
|
{
|
||||||
$Downloads = self::FetchSubUrls($Url . '/');
|
$Downloads = self::FetchSubUrls($Url . '/');
|
||||||
|
|
||||||
//make url valid
|
//make url valid
|
||||||
|
|
||||||
$Url = str_replace(' ', '%20', $Url);
|
$Url = str_replace(' ', '%20', $Url);
|
||||||
|
|
||||||
//get content from website url
|
//get content from website url
|
||||||
|
|
||||||
$Content = @file_get_contents('http://' . $this->RequestDomain . $Url . '.aps' . $Downloads[0]);
|
$Content = @file_get_contents('http://' . $this->RequestDomain . $Url . '.aps' . $Downloads[0]);
|
||||||
|
|
||||||
if($Content != false)
|
if($Content != false)
|
||||||
{
|
{
|
||||||
//open file to write contents on disk
|
//open file to write contents on disk
|
||||||
|
|
||||||
$FileHandle = fopen($this->RootDir . 'temp/' . $Application . '-' . $Version . '.app.zip', 'wb');
|
$FileHandle = fopen($this->RootDir . 'temp/' . $Application . '-' . $Version . '.app.zip', 'wb');
|
||||||
|
|
||||||
if($FileHandle == true)
|
if($FileHandle == true)
|
||||||
{
|
{
|
||||||
//write results to disk
|
//write results to disk
|
||||||
|
|
||||||
fwrite($FileHandle, $Content);
|
fwrite($FileHandle, $Content);
|
||||||
fclose($FileHandle);
|
fclose($FileHandle);
|
||||||
|
|
||||||
//set right permissions
|
//set right permissions
|
||||||
|
|
||||||
chmod($this->RootDir . 'temp/' . $Application . '-' . $Version . '.app.zip', 0664);
|
chmod($this->RootDir . 'temp/' . $Application . '-' . $Version . '.app.zip', 0664);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetch html content of distribution server and parse all information
|
* fetch html content of distribution server and parse all information
|
||||||
*
|
*
|
||||||
* @param requestdomain domain to aps-/mirrorserver with package api
|
* @param requestdomain domain to aps-/mirrorserver with package api
|
||||||
* @param url url to fetch sub links from
|
* @param url url to fetch sub links from
|
||||||
* @return error false/success array with relative sub links
|
* @return error false/success array with relative sub links
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private function FetchSubUrls($Url)
|
private function FetchSubUrls($Url)
|
||||||
{
|
{
|
||||||
$Return = array();
|
$Return = array();
|
||||||
|
|
||||||
//make url valid
|
//make url valid
|
||||||
|
|
||||||
$Url = str_replace(' ', '%20', $Url);
|
$Url = str_replace(' ', '%20', $Url);
|
||||||
|
|
||||||
//get content from website url
|
//get content from website url
|
||||||
|
|
||||||
$Content = @file('http://' . $this->RequestDomain . $Url);
|
$Content = @file('http://' . $this->RequestDomain . $Url);
|
||||||
|
|
||||||
if($Content != false)
|
if($Content != false)
|
||||||
{
|
{
|
||||||
foreach($Content as $Temp)
|
foreach($Content as $Temp)
|
||||||
{
|
{
|
||||||
//skip empty lines
|
//skip empty lines
|
||||||
|
|
||||||
if($Temp != "\r\n"
|
if($Temp != "\r\n"
|
||||||
&& $Temp != "\r"
|
&& $Temp != "\r"
|
||||||
&& $Temp != "\n"
|
&& $Temp != "\n"
|
||||||
&& $Temp != "")
|
&& $Temp != "")
|
||||||
{
|
{
|
||||||
//remove unwanted characters
|
//remove unwanted characters
|
||||||
|
|
||||||
$Temp = trim($Temp);
|
$Temp = trim($Temp);
|
||||||
|
|
||||||
//grep URLs which match defined format
|
//grep URLs which match defined format
|
||||||
|
|
||||||
if(preg_match("/^<a href=\"(.+)\".+class=\"(vendor|application|version|packager)\"/", $Temp, $Matches))
|
if(preg_match("/^<a href=\"(.+)\".+class=\"(vendor|application|version|packager)\"/", $Temp, $Matches))
|
||||||
{
|
{
|
||||||
if(!in_array(urldecode($Matches[1]), $Return))$Return[] = urldecode($Matches[1]);
|
if(!in_array(urldecode($Matches[1]), $Return))$Return[] = urldecode($Matches[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $Return;
|
return $Return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,345 +1,345 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Classes
|
* @package Classes
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to manage the connection to the Database
|
* Class to manage the connection to the Database
|
||||||
* @package Functions
|
* @package Functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class db
|
class db
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Link ID for every connection
|
* Link ID for every connection
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var $link_id = 0;
|
var $link_id = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query ID for every query
|
* Query ID for every query
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var $query_id = 0;
|
var $query_id = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Errordescription, if an error occures
|
* Errordescription, if an error occures
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var $errdesc = '';
|
var $errdesc = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Errornumber, if an error occures
|
* Errornumber, if an error occures
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var $errno = 0;
|
var $errno = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Servername
|
* Servername
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var $server = '';
|
var $server = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Username
|
* Username
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var $user = '';
|
var $user = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Password
|
* Password
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var $password = '';
|
var $password = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database
|
* Database
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var $database = '';
|
var $database = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class constructor. Connects to Databaseserver and selects Database
|
* Class constructor. Connects to Databaseserver and selects Database
|
||||||
*
|
*
|
||||||
* @param string Servername
|
* @param string Servername
|
||||||
* @param string Username
|
* @param string Username
|
||||||
* @param string Password
|
* @param string Password
|
||||||
* @param string Database
|
* @param string Database
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function db($server, $user, $password, $database = '')
|
function db($server, $user, $password, $database = '')
|
||||||
{
|
{
|
||||||
// check for mysql extension
|
// check for mysql extension
|
||||||
|
|
||||||
if(!extension_loaded('mysql'))
|
if(!extension_loaded('mysql'))
|
||||||
{
|
{
|
||||||
$this->showerror('You should install the PHP MySQL extension!', false);
|
$this->showerror('You should install the PHP MySQL extension!', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->server = $server;
|
$this->server = $server;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
$this->password = $password;
|
$this->password = $password;
|
||||||
$this->database = $database;
|
$this->database = $database;
|
||||||
$this->link_id = @mysql_connect($this->server, $this->user, $this->password);
|
$this->link_id = @mysql_connect($this->server, $this->user, $this->password);
|
||||||
|
|
||||||
if(!$this->link_id)
|
if(!$this->link_id)
|
||||||
{
|
{
|
||||||
//try to connect with no password an change it afterwards. only for root user
|
//try to connect with no password an change it afterwards. only for root user
|
||||||
|
|
||||||
if($this->user == 'root')
|
if($this->user == 'root')
|
||||||
{
|
{
|
||||||
$this->link_id = @mysql_connect($this->server, $this->user, '');
|
$this->link_id = @mysql_connect($this->server, $this->user, '');
|
||||||
|
|
||||||
if($this->link_id)
|
if($this->link_id)
|
||||||
{
|
{
|
||||||
$this->query("SET PASSWORD = PASSWORD('" . $this->escape($this->password) . "')");
|
$this->query("SET PASSWORD = PASSWORD('" . $this->escape($this->password) . "')");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->showerror('Establishing connection failed, exiting');
|
$this->showerror('Establishing connection failed, exiting');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->showerror('Establishing connection failed, exiting');
|
$this->showerror('Establishing connection failed, exiting');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->database != '')
|
if($this->database != '')
|
||||||
{
|
{
|
||||||
if(!@mysql_select_db($this->database, $this->link_id))
|
if(!@mysql_select_db($this->database, $this->link_id))
|
||||||
{
|
{
|
||||||
$this->showerror('Trying to use database ' . $this->database . ' failed, exiting');
|
$this->showerror('Trying to use database ' . $this->database . ' failed, exiting');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mysql_query("SET NAMES utf8", $this->link_id);
|
mysql_query("SET NAMES utf8", $this->link_id);
|
||||||
mysql_query("SET CHARACTER SET utf8", $this->link_id);
|
mysql_query("SET CHARACTER SET utf8", $this->link_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes connection to Databaseserver
|
* Closes connection to Databaseserver
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function close()
|
function close()
|
||||||
{
|
{
|
||||||
return @mysql_close($this->link_id);
|
return @mysql_close($this->link_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes user input to be used in mysql queries
|
* Escapes user input to be used in mysql queries
|
||||||
*
|
*
|
||||||
* @param string $input
|
* @param string $input
|
||||||
* @return string escaped string
|
* @return string escaped string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function escape($input)
|
function escape($input)
|
||||||
{
|
{
|
||||||
if(is_int($input))
|
if(is_int($input))
|
||||||
{
|
{
|
||||||
return (int)$input;
|
return (int)$input;
|
||||||
}
|
}
|
||||||
elseif(is_float($input))
|
elseif(is_float($input))
|
||||||
{
|
{
|
||||||
return (float)$input;
|
return (float)$input;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return mysql_real_escape_string($input, $this->link_id);
|
return mysql_real_escape_string($input, $this->link_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query the Database
|
* Query the Database
|
||||||
*
|
*
|
||||||
* @param string Querystring
|
* @param string Querystring
|
||||||
* @param bool Unbuffered query?
|
* @param bool Unbuffered query?
|
||||||
* @return string RessourceId
|
* @return string RessourceId
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function query($query_str, $unbuffered = false)
|
function query($query_str, $unbuffered = false)
|
||||||
{
|
{
|
||||||
global $numbqueries;
|
global $numbqueries;
|
||||||
|
|
||||||
if(!$unbuffered)
|
if(!$unbuffered)
|
||||||
{
|
{
|
||||||
$this->query_id = mysql_query($query_str, $this->link_id);
|
$this->query_id = mysql_query($query_str, $this->link_id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->query_id = mysql_unbuffered_query($query_str, $this->link_id);
|
$this->query_id = mysql_unbuffered_query($query_str, $this->link_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$this->query_id)
|
if(!$this->query_id)
|
||||||
{
|
{
|
||||||
$this->showerror('Invalid SQL: ' . $query_str);
|
$this->showerror('Invalid SQL: ' . $query_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
$numbqueries++;
|
$numbqueries++;
|
||||||
|
|
||||||
//echo $query_str.' '.$numbqueries.'<br />';
|
//echo $query_str.' '.$numbqueries.'<br />';
|
||||||
|
|
||||||
return $this->query_id;
|
return $this->query_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches Row from Query and returns it as array
|
* Fetches Row from Query and returns it as array
|
||||||
*
|
*
|
||||||
* @param string RessourceId
|
* @param string RessourceId
|
||||||
* @param string Datatype, num or assoc
|
* @param string Datatype, num or assoc
|
||||||
* @return array The row
|
* @return array The row
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function fetch_array($query_id = - 1, $datatype = 'assoc')
|
function fetch_array($query_id = - 1, $datatype = 'assoc')
|
||||||
{
|
{
|
||||||
if($query_id != - 1)
|
if($query_id != - 1)
|
||||||
{
|
{
|
||||||
$this->query_id = $query_id;
|
$this->query_id = $query_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($datatype == 'num')
|
if($datatype == 'num')
|
||||||
{
|
{
|
||||||
$datatype = MYSQL_NUM;
|
$datatype = MYSQL_NUM;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$datatype = MYSQL_ASSOC;
|
$datatype = MYSQL_ASSOC;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->record = mysql_fetch_array($this->query_id, $datatype);
|
$this->record = mysql_fetch_array($this->query_id, $datatype);
|
||||||
return $this->record;
|
return $this->record;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query Database and fetche the first row from Query and returns it as array
|
* Query Database and fetche the first row from Query and returns it as array
|
||||||
*
|
*
|
||||||
* @param string Querystring
|
* @param string Querystring
|
||||||
* @param string Datatype, num or assoc
|
* @param string Datatype, num or assoc
|
||||||
* @return array The first row
|
* @return array The first row
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function query_first($query_string, $datatype = 'assoc')
|
function query_first($query_string, $datatype = 'assoc')
|
||||||
{
|
{
|
||||||
$this->query($query_string);
|
$this->query($query_string);
|
||||||
return $this->fetch_array($this->query_id, $datatype);
|
return $this->fetch_array($this->query_id, $datatype);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns how many rows have been selected
|
* Returns how many rows have been selected
|
||||||
*
|
*
|
||||||
* @param string RessourceId
|
* @param string RessourceId
|
||||||
* @return int Number of rows
|
* @return int Number of rows
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function num_rows($query_id = - 1)
|
function num_rows($query_id = - 1)
|
||||||
{
|
{
|
||||||
if($query_id != - 1)
|
if($query_id != - 1)
|
||||||
{
|
{
|
||||||
$this->query_id = $query_id;
|
$this->query_id = $query_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mysql_num_rows($this->query_id);
|
return mysql_num_rows($this->query_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the auto_incremental-Value of the inserted row
|
* Returns the auto_incremental-Value of the inserted row
|
||||||
*
|
*
|
||||||
* @return int auto_incremental-Value
|
* @return int auto_incremental-Value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function insert_id()
|
function insert_id()
|
||||||
{
|
{
|
||||||
return mysql_insert_id($this->link_id);
|
return mysql_insert_id($this->link_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of rows affected by last query
|
* Returns the number of rows affected by last query
|
||||||
*
|
*
|
||||||
* @return int affected rows
|
* @return int affected rows
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function affected_rows()
|
function affected_rows()
|
||||||
{
|
{
|
||||||
return mysql_affected_rows($this->link_id);
|
return mysql_affected_rows($this->link_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns errordescription and errornumber if an error occured.
|
* Returns errordescription and errornumber if an error occured.
|
||||||
*
|
*
|
||||||
* @return int Errornumber
|
* @return int Errornumber
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function geterrdescno()
|
function geterrdescno()
|
||||||
{
|
{
|
||||||
if($this->link_id != 0)
|
if($this->link_id != 0)
|
||||||
{
|
{
|
||||||
$this->errdesc = mysql_error($this->link_id);
|
$this->errdesc = mysql_error($this->link_id);
|
||||||
$this->errno = mysql_errno($this->link_id);
|
$this->errno = mysql_errno($this->link_id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Maybe we don't have any linkid so let's try to catch at least anything
|
// Maybe we don't have any linkid so let's try to catch at least anything
|
||||||
|
|
||||||
$this->errdesc = mysql_error();
|
$this->errdesc = mysql_error();
|
||||||
$this->errno = mysql_errno();
|
$this->errno = mysql_errno();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->errno;
|
return $this->errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dies with an errormessage
|
* Dies with an errormessage
|
||||||
*
|
*
|
||||||
* @param string Errormessage
|
* @param string Errormessage
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function showerror($errormsg, $mysqlActive = true)
|
function showerror($errormsg, $mysqlActive = true)
|
||||||
{
|
{
|
||||||
global $filename;
|
global $filename;
|
||||||
|
|
||||||
if($mysqlActive)
|
if($mysqlActive)
|
||||||
{
|
{
|
||||||
$this->geterrdescno();
|
$this->geterrdescno();
|
||||||
$errormsg.= "\n";
|
$errormsg.= "\n";
|
||||||
$errormsg.= 'mysql error number: ' . $this->errno . "\n";
|
$errormsg.= 'mysql error number: ' . $this->errno . "\n";
|
||||||
$errormsg.= 'mysql error desc: ' . $this->errdesc . "\n";
|
$errormsg.= 'mysql error desc: ' . $this->errdesc . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$errormsg.= 'Time/date: ' . date('d/m/Y h:i A') . "\n";
|
$errormsg.= 'Time/date: ' . date('d/m/Y h:i A') . "\n";
|
||||||
|
|
||||||
if($filename != 'cronscript.php')
|
if($filename != 'cronscript.php')
|
||||||
{
|
{
|
||||||
$errormsg.= 'Script: ' . htmlspecialchars(getenv('REQUEST_URI')) . "\n";
|
$errormsg.= 'Script: ' . htmlspecialchars(getenv('REQUEST_URI')) . "\n";
|
||||||
$errormsg.= 'Referer: ' . htmlspecialchars(getenv('HTTP_REFERER')) . "\n";
|
$errormsg.= 'Referer: ' . htmlspecialchars(getenv('HTTP_REFERER')) . "\n";
|
||||||
die(nl2br($errormsg));
|
die(nl2br($errormsg));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$errormsg.= 'Script: -- Cronscript --' . "\n";
|
$errormsg.= 'Script: -- Cronscript --' . "\n";
|
||||||
die($errormsg);
|
die($errormsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,145 +1,145 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Michael Duergner <michael@duergner.com> (2003-2009)
|
* @author Michael Duergner <michael@duergner.com> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Classes
|
* @package Classes
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for wrapping a specific idna conversion class and offering a standard interface
|
* Class for wrapping a specific idna conversion class and offering a standard interface
|
||||||
* @package Functions
|
* @package Functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class idna_convert_wrapper
|
class idna_convert_wrapper
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* idna converter we use
|
* idna converter we use
|
||||||
* @var object
|
* @var object
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var $idna_converter;
|
var $idna_converter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class constructor. Creates a new idna converter
|
* Class constructor. Creates a new idna converter
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function idna_convert_wrapper()
|
function idna_convert_wrapper()
|
||||||
{
|
{
|
||||||
$this->idna_converter = new idna_convert();
|
$this->idna_converter = new idna_convert();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode a domain name, a email address or a list of one of both.
|
* Encode a domain name, a email address or a list of one of both.
|
||||||
*
|
*
|
||||||
* @param string May be either a single domain name, e single email address or a list of one
|
* @param string May be either a single domain name, e single email address or a list of one
|
||||||
* seperated either by ',', ';' or ' '.
|
* seperated either by ',', ';' or ' '.
|
||||||
*
|
*
|
||||||
* @return string Returns either a single domain name, a single email address or a list of one of
|
* @return string Returns either a single domain name, a single email address or a list of one of
|
||||||
* both seperated by the same string as the input.
|
* both seperated by the same string as the input.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function encode($to_encode)
|
function encode($to_encode)
|
||||||
{
|
{
|
||||||
return $this->_do_action('encode', $to_encode);
|
return $this->_do_action('encode', $to_encode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode a domain name, a email address or a list of one of both.
|
* Decode a domain name, a email address or a list of one of both.
|
||||||
*
|
*
|
||||||
* @param string May be either a single domain name, e single email address or a list of one
|
* @param string May be either a single domain name, e single email address or a list of one
|
||||||
* seperated either by ',', ';' or ' '.
|
* seperated either by ',', ';' or ' '.
|
||||||
*
|
*
|
||||||
* @return string Returns either a single domain name, a single email address or a list of one of
|
* @return string Returns either a single domain name, a single email address or a list of one of
|
||||||
* both seperated by the same string as the input.
|
* both seperated by the same string as the input.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function decode($to_decode)
|
function decode($to_decode)
|
||||||
{
|
{
|
||||||
return $this->_do_action('decode', $to_decode);
|
return $this->_do_action('decode', $to_decode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Do the real de- or encoding. First checks if a list is submitted and seperates it. Afterwards sends
|
* Do the real de- or encoding. First checks if a list is submitted and seperates it. Afterwards sends
|
||||||
* each entry to the idna converter to do the converting.
|
* each entry to the idna converter to do the converting.
|
||||||
*
|
*
|
||||||
* @param string May be either 'decode' or 'encode'.
|
* @param string May be either 'decode' or 'encode'.
|
||||||
* @param string The string to de- or endcode.
|
* @param string The string to de- or endcode.
|
||||||
*
|
*
|
||||||
* @return string The input string after being processed.
|
* @return string The input string after being processed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function _do_action($action, $string)
|
function _do_action($action, $string)
|
||||||
{
|
{
|
||||||
$string = trim($string);
|
$string = trim($string);
|
||||||
|
|
||||||
if(strpos($string, ',') !== false)
|
if(strpos($string, ',') !== false)
|
||||||
{
|
{
|
||||||
$strings = explode(',', $string);
|
$strings = explode(',', $string);
|
||||||
$sepchar = ',';
|
$sepchar = ',';
|
||||||
}
|
}
|
||||||
elseif(strpos($string, ';') !== false)
|
elseif(strpos($string, ';') !== false)
|
||||||
{
|
{
|
||||||
$strings = explode(';', $string);
|
$strings = explode(';', $string);
|
||||||
$sepchar = ';';
|
$sepchar = ';';
|
||||||
}
|
}
|
||||||
elseif(strpos($string, ' ') !== false)
|
elseif(strpos($string, ' ') !== false)
|
||||||
{
|
{
|
||||||
$strings = explode(' ', $string);
|
$strings = explode(' ', $string);
|
||||||
$sepchar = ' ';
|
$sepchar = ' ';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$strings = array(
|
$strings = array(
|
||||||
$string
|
$string
|
||||||
);
|
);
|
||||||
$sepchar = '';
|
$sepchar = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($i = 0;$i < count($strings);$i++)
|
for ($i = 0;$i < count($strings);$i++)
|
||||||
{
|
{
|
||||||
if(strpos($strings[$i], '@') !== false)
|
if(strpos($strings[$i], '@') !== false)
|
||||||
{
|
{
|
||||||
$split = explode('@', $strings[$i]);
|
$split = explode('@', $strings[$i]);
|
||||||
$localpart = $split[0];
|
$localpart = $split[0];
|
||||||
$domain = $split[1];
|
$domain = $split[1];
|
||||||
$email = true;
|
$email = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$domain = $strings[$i];
|
$domain = $strings[$i];
|
||||||
$email = false;
|
$email = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strlen($domain) !== 0)
|
if(strlen($domain) !== 0)
|
||||||
{
|
{
|
||||||
$domain = utf8_decode($this->idna_converter->$action(utf8_encode($domain . '.none')));
|
$domain = utf8_decode($this->idna_converter->$action(utf8_encode($domain . '.none')));
|
||||||
$domain = substr($domain, 0, strlen($domain) - 5);
|
$domain = substr($domain, 0, strlen($domain) - 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($email)
|
if($email)
|
||||||
{
|
{
|
||||||
$strings[$i] = $localpart . '@' . $domain;
|
$strings[$i] = $localpart . '@' . $domain;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$strings[$i] = $domain;
|
$strings[$i] = $domain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return implode($sepchar, $strings);
|
return implode($sepchar, $strings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,100 +1,100 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Logger
|
* @package Logger
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @link http://www.nutime.de/
|
* @link http://www.nutime.de/
|
||||||
*
|
*
|
||||||
* Logger - Abstract-Logger-Class
|
* Logger - Abstract-Logger-Class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* We're using the syslog constants for all the loggers (partly implemented)
|
/* We're using the syslog constants for all the loggers (partly implemented)
|
||||||
|
|
||||||
LOG_EMERG system is unusable
|
LOG_EMERG system is unusable
|
||||||
LOG_ALERT action must be taken immediately
|
LOG_ALERT action must be taken immediately
|
||||||
LOG_CRIT critical conditions
|
LOG_CRIT critical conditions
|
||||||
LOG_ERR error conditions
|
LOG_ERR error conditions
|
||||||
LOG_WARNING warning conditions
|
LOG_WARNING warning conditions
|
||||||
LOG_NOTICE normal, but significant, condition
|
LOG_NOTICE normal, but significant, condition
|
||||||
LOG_INFO informational message
|
LOG_INFO informational message
|
||||||
LOG_DEBUG debug-level message
|
LOG_DEBUG debug-level message
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
abstract class AbstractLogger
|
abstract class AbstractLogger
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Settings array
|
* Settings array
|
||||||
* @var settings
|
* @var settings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private $settings = array();
|
private $settings = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable/Disable Logging
|
* Enable/Disable Logging
|
||||||
* @var logenabled
|
* @var logenabled
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private $logenabled = false;
|
private $logenabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable/Disable Cronjob-Logging
|
* Enable/Disable Cronjob-Logging
|
||||||
* @var logcronjob
|
* @var logcronjob
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private $logcronjob = false;
|
private $logcronjob = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loggin-Severity
|
* Loggin-Severity
|
||||||
* @var severity
|
* @var severity
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private $severity = 1;
|
private $severity = 1;
|
||||||
|
|
||||||
// normal
|
// normal
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setup the main logger
|
* setup the main logger
|
||||||
*
|
*
|
||||||
* @param array settings
|
* @param array settings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected function setupLogger($settings)
|
protected function setupLogger($settings)
|
||||||
{
|
{
|
||||||
$this->settings = $settings;
|
$this->settings = $settings;
|
||||||
$this->logenabled = $this->settings['logger']['enabled'];
|
$this->logenabled = $this->settings['logger']['enabled'];
|
||||||
$this->logcronjob = $this->settings['logger']['log_cron'];
|
$this->logcronjob = $this->settings['logger']['log_cron'];
|
||||||
$this->severity = $this->settings['logger']['severity'];
|
$this->severity = $this->settings['logger']['severity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function isEnabled()
|
protected function isEnabled()
|
||||||
{
|
{
|
||||||
return $this->logenabled;
|
return $this->logenabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getSeverity()
|
protected function getSeverity()
|
||||||
{
|
{
|
||||||
return $this->severity;
|
return $this->severity;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function logCron()
|
protected function logCron()
|
||||||
{
|
{
|
||||||
return $this->logcronjob;
|
return $this->logcronjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract public function logAction();
|
abstract public function logAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,188 +1,188 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Logger
|
* @package Logger
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @link http://www.nutime.de/
|
* @link http://www.nutime.de/
|
||||||
*
|
*
|
||||||
* Logger - File-Logger-Class
|
* Logger - File-Logger-Class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class FileLogger extends AbstractLogger
|
class FileLogger extends AbstractLogger
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Userinfo
|
* Userinfo
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private $userinfo = array();
|
private $userinfo = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logfile
|
* Logfile
|
||||||
* @var logfile
|
* @var logfile
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private $logfile = null;
|
private $logfile = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Syslogger Objects Array
|
* Syslogger Objects Array
|
||||||
* @var loggers
|
* @var loggers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static private $loggers = array();
|
static private $loggers = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class constructor.
|
* Class constructor.
|
||||||
*
|
*
|
||||||
* @param array userinfo
|
* @param array userinfo
|
||||||
* @param array settings
|
* @param array settings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected function __construct($userinfo, $settings)
|
protected function __construct($userinfo, $settings)
|
||||||
{
|
{
|
||||||
parent::setupLogger($settings);
|
parent::setupLogger($settings);
|
||||||
$this->userinfo = $userinfo;
|
$this->userinfo = $userinfo;
|
||||||
$this->setLogFile($settings['logger']['logfile']);
|
$this->setLogFile($settings['logger']['logfile']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Singleton ftw ;-)
|
* Singleton ftw ;-)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function getInstanceOf($_usernfo, $_settings)
|
static public function getInstanceOf($_usernfo, $_settings)
|
||||||
{
|
{
|
||||||
if(!isset(self::$loggers[$_usernfo['loginname']]))
|
if(!isset(self::$loggers[$_usernfo['loginname']]))
|
||||||
{
|
{
|
||||||
self::$loggers[$_usernfo['loginname']] = new FileLogger($_usernfo, $_settings);
|
self::$loggers[$_usernfo['loginname']] = new FileLogger($_usernfo, $_settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::$loggers[$_usernfo['loginname']];
|
return self::$loggers[$_usernfo['loginname']];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logAction($action = USR_ACTION, $type = LOG_NOTICE, $text = null)
|
public function logAction($action = USR_ACTION, $type = LOG_NOTICE, $text = null)
|
||||||
{
|
{
|
||||||
if(parent::isEnabled())
|
if(parent::isEnabled())
|
||||||
{
|
{
|
||||||
if(parent::getSeverity() <= 1
|
if(parent::getSeverity() <= 1
|
||||||
&& $type == LOG_NOTICE)
|
&& $type == LOG_NOTICE)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$_action = 'unknown';
|
$_action = 'unknown';
|
||||||
|
|
||||||
switch($action)
|
switch($action)
|
||||||
{
|
{
|
||||||
case USR_ACTION:
|
case USR_ACTION:
|
||||||
$_action = 'customer';
|
$_action = 'customer';
|
||||||
break;
|
break;
|
||||||
case RES_ACTION:
|
case RES_ACTION:
|
||||||
$_action = 'reseller';
|
$_action = 'reseller';
|
||||||
break;
|
break;
|
||||||
case ADM_ACTION:
|
case ADM_ACTION:
|
||||||
$_action = 'administrator';
|
$_action = 'administrator';
|
||||||
break;
|
break;
|
||||||
case CRON_ACTION:
|
case CRON_ACTION:
|
||||||
$_action = 'cronjob';
|
$_action = 'cronjob';
|
||||||
break;
|
break;
|
||||||
case LOG_ERROR:
|
case LOG_ERROR:
|
||||||
$_action = 'internal';
|
$_action = 'internal';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$_action = 'unknown';
|
$_action = 'unknown';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$_type = 'unknown';
|
$_type = 'unknown';
|
||||||
|
|
||||||
switch($type)
|
switch($type)
|
||||||
{
|
{
|
||||||
case LOG_INFO:
|
case LOG_INFO:
|
||||||
$_type = 'information';
|
$_type = 'information';
|
||||||
break;
|
break;
|
||||||
case LOG_NOTICE:
|
case LOG_NOTICE:
|
||||||
$_type = 'notice';
|
$_type = 'notice';
|
||||||
break;
|
break;
|
||||||
case LOG_WARNING:
|
case LOG_WARNING:
|
||||||
$_type = 'warning';
|
$_type = 'warning';
|
||||||
break;
|
break;
|
||||||
case LOG_ERR:
|
case LOG_ERR:
|
||||||
$_type = 'error';
|
$_type = 'error';
|
||||||
break;
|
break;
|
||||||
case LOG_CRIT:
|
case LOG_CRIT:
|
||||||
$_type = 'critical';
|
$_type = 'critical';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$_type = 'unknown';
|
$_type = 'unknown';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset($this->userinfo['loginname'])
|
if(!isset($this->userinfo['loginname'])
|
||||||
|| $this->userinfo['loginname'] == '')
|
|| $this->userinfo['loginname'] == '')
|
||||||
{
|
{
|
||||||
$name = 'unknown';
|
$name = 'unknown';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$name = " (" . $this->userinfo['loginname'] . ")";
|
$name = " (" . $this->userinfo['loginname'] . ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
$fp = @fopen($this->logfile, 'a');
|
$fp = @fopen($this->logfile, 'a');
|
||||||
|
|
||||||
if($fp !== false)
|
if($fp !== false)
|
||||||
{
|
{
|
||||||
$now = time();
|
$now = time();
|
||||||
|
|
||||||
if($text != null
|
if($text != null
|
||||||
&& $text != '')
|
&& $text != '')
|
||||||
{
|
{
|
||||||
fwrite($fp, date("d.m.Y H:i:s", $now) . " [" . $_type . "] [" . $_action . "-action" . $name . "] " . $text . "\n");
|
fwrite($fp, date("d.m.Y H:i:s", $now) . " [" . $_type . "] [" . $_action . "-action" . $name . "] " . $text . "\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fwrite($fp, date("d.m.Y H:i:s", $now) . " [" . $_type . "] [" . $_action . "-action" . $name . "] No text given!!! Check scripts!\n");
|
fwrite($fp, date("d.m.Y H:i:s", $now) . " [" . $_type . "] [" . $_action . "-action" . $name . "] No text given!!! Check scripts!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if($this->logfile != null
|
if($this->logfile != null
|
||||||
|| $this->logfile != '')
|
|| $this->logfile != '')
|
||||||
{
|
{
|
||||||
throw new Exception("Cannot open logfile '" . $this->logfile . "' for writing!");
|
throw new Exception("Cannot open logfile '" . $this->logfile . "' for writing!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function setLogFile($filename = null)
|
private function setLogFile($filename = null)
|
||||||
{
|
{
|
||||||
if($filename != null
|
if($filename != null
|
||||||
&& $filename != ''
|
&& $filename != ''
|
||||||
&& $filename != "."
|
&& $filename != "."
|
||||||
&& $filename != ".."
|
&& $filename != ".."
|
||||||
&& !is_dir($filename))
|
&& !is_dir($filename))
|
||||||
{
|
{
|
||||||
$this->logfile = $filename;
|
$this->logfile = $filename;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,205 +1,205 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Logger
|
* @package Logger
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @link http://www.nutime.de/
|
* @link http://www.nutime.de/
|
||||||
*
|
*
|
||||||
* Logger - Froxlor-Base-Logger-Class
|
* Logger - Froxlor-Base-Logger-Class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class FroxlorLogger
|
class FroxlorLogger
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Userinfo
|
* Userinfo
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private $userinfo = array();
|
private $userinfo = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database handler
|
* Database handler
|
||||||
* @var db
|
* @var db
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private $db = false;
|
private $db = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Settings array
|
* Settings array
|
||||||
* @var settings
|
* @var settings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private $settings = array();
|
private $settings = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LogTypes Array
|
* LogTypes Array
|
||||||
* @var logtypes
|
* @var logtypes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static private $logtypes = null;
|
static private $logtypes = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logger-Object-Array
|
* Logger-Object-Array
|
||||||
* @var loggers
|
* @var loggers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static private $loggers = null;
|
static private $loggers = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class constructor.
|
* Class constructor.
|
||||||
*
|
*
|
||||||
* @param array userinfo
|
* @param array userinfo
|
||||||
* @param array settings
|
* @param array settings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected function __construct($userinfo, $db, $settings)
|
protected function __construct($userinfo, $db, $settings)
|
||||||
{
|
{
|
||||||
$this->userinfo = $userinfo;
|
$this->userinfo = $userinfo;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->settings = $settings;
|
$this->settings = $settings;
|
||||||
self::$logtypes = array();
|
self::$logtypes = array();
|
||||||
|
|
||||||
if(!isset($this->settings['logger']['logtypes'])
|
if(!isset($this->settings['logger']['logtypes'])
|
||||||
&& (!isset($this->settings['logger']['logtypes']) || $this->settings['logger']['logtypes'] == '')
|
&& (!isset($this->settings['logger']['logtypes']) || $this->settings['logger']['logtypes'] == '')
|
||||||
&& isset($this->settings['logger']['enabled'])
|
&& isset($this->settings['logger']['enabled'])
|
||||||
&& $this->settings['logger']['enabled'])
|
&& $this->settings['logger']['enabled'])
|
||||||
{
|
{
|
||||||
self::$logtypes[0] = 'syslog';
|
self::$logtypes[0] = 'syslog';
|
||||||
self::$logtypes[1] = 'mysql';
|
self::$logtypes[1] = 'mysql';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(isset($this->settings['logger']['logtypes'])
|
if(isset($this->settings['logger']['logtypes'])
|
||||||
&& $this->settings['logger']['logtypes'] != '')
|
&& $this->settings['logger']['logtypes'] != '')
|
||||||
{
|
{
|
||||||
self::$logtypes = explode(',', $this->settings['logger']['logtypes']);
|
self::$logtypes = explode(',', $this->settings['logger']['logtypes']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
self::$logtypes = null;
|
self::$logtypes = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Singleton ftw ;-)
|
* Singleton ftw ;-)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function getInstanceOf($_usernfo, $_db, $_settings)
|
static public function getInstanceOf($_usernfo, $_db, $_settings)
|
||||||
{
|
{
|
||||||
if(!isset($_usernfo)
|
if(!isset($_usernfo)
|
||||||
|| $_usernfo == null)
|
|| $_usernfo == null)
|
||||||
{
|
{
|
||||||
$_usernfo = array();
|
$_usernfo = array();
|
||||||
$_usernfo['loginname'] = 'unknown';
|
$_usernfo['loginname'] = 'unknown';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset(self::$loggers[$_usernfo['loginname']]))
|
if(!isset(self::$loggers[$_usernfo['loginname']]))
|
||||||
{
|
{
|
||||||
self::$loggers[$_usernfo['loginname']] = new FroxlorLogger($_usernfo, $_db, $_settings);
|
self::$loggers[$_usernfo['loginname']] = new FroxlorLogger($_usernfo, $_db, $_settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::$loggers[$_usernfo['loginname']];
|
return self::$loggers[$_usernfo['loginname']];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logAction($action = USR_ACTION, $type = LOG_NOTICE, $text = null)
|
public function logAction($action = USR_ACTION, $type = LOG_NOTICE, $text = null)
|
||||||
{
|
{
|
||||||
if(self::$logtypes == null)
|
if(self::$logtypes == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->settings['logger']['log_cron'] == '0'
|
if($this->settings['logger']['log_cron'] == '0'
|
||||||
&& $action == CRON_ACTION)
|
&& $action == CRON_ACTION)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(self::$logtypes as $logger)
|
foreach(self::$logtypes as $logger)
|
||||||
{
|
{
|
||||||
switch($logger)
|
switch($logger)
|
||||||
{
|
{
|
||||||
case 'syslog':
|
case 'syslog':
|
||||||
$_log = SysLogger::getInstanceOf($this->userinfo, $this->settings);
|
$_log = SysLogger::getInstanceOf($this->userinfo, $this->settings);
|
||||||
break;
|
break;
|
||||||
case 'file':
|
case 'file':
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$_log = FileLogger::getInstanceOf($this->userinfo, $this->settings);
|
$_log = FileLogger::getInstanceOf($this->userinfo, $this->settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
if($action != CRON_ACTION)
|
if($action != CRON_ACTION)
|
||||||
{
|
{
|
||||||
standard_error('logerror', $e->getMessage());
|
standard_error('logerror', $e->getMessage());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo "Log-Error: " . $e->getMessage();
|
echo "Log-Error: " . $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'mysql':
|
case 'mysql':
|
||||||
$_log = MysqlLogger::getInstanceOf($this->userinfo, $this->settings, $this->db);
|
$_log = MysqlLogger::getInstanceOf($this->userinfo, $this->settings, $this->db);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$_log = null;
|
$_log = null;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_log != null)
|
if($_log != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$_log->logAction($action, $type, $text);
|
$_log->logAction($action, $type, $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
if($action != CRON_ACTION)
|
if($action != CRON_ACTION)
|
||||||
{
|
{
|
||||||
standard_error('logerror', $e->getMessage());
|
standard_error('logerror', $e->getMessage());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo "Log-Error: " . $e->getMessage();
|
echo "Log-Error: " . $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCronLog($_cronlog = 0)
|
public function setCronLog($_cronlog = 0)
|
||||||
{
|
{
|
||||||
$_cronlog = (int)$_cronlog;
|
$_cronlog = (int)$_cronlog;
|
||||||
|
|
||||||
if($_cronlog != 0
|
if($_cronlog != 0
|
||||||
&& $_cronlog != 1)
|
&& $_cronlog != 1)
|
||||||
{
|
{
|
||||||
$_cronlog = 0;
|
$_cronlog = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "`
|
$this->db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "`
|
||||||
SET `value`='" . $this->db->escape($_cronlog) . "'
|
SET `value`='" . $this->db->escape($_cronlog) . "'
|
||||||
WHERE `settinggroup`='logger'
|
WHERE `settinggroup`='logger'
|
||||||
AND `varname`='log_cron'");
|
AND `varname`='log_cron'");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,113 +1,113 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Logger
|
* @package Logger
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @link http://www.nutime.de/
|
* @link http://www.nutime.de/
|
||||||
*
|
*
|
||||||
* Logger - MySQL-Logger-Class
|
* Logger - MySQL-Logger-Class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class MysqlLogger extends AbstractLogger
|
class MysqlLogger extends AbstractLogger
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Userinfo
|
* Userinfo
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private $userinfo = array();
|
private $userinfo = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database handler
|
* Database handler
|
||||||
* @var db
|
* @var db
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private $db = false;
|
private $db = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Syslogger Objects Array
|
* Syslogger Objects Array
|
||||||
* @var loggers
|
* @var loggers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static private $loggers = array();
|
static private $loggers = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class constructor.
|
* Class constructor.
|
||||||
*
|
*
|
||||||
* @param array userinfo
|
* @param array userinfo
|
||||||
* @param array settings
|
* @param array settings
|
||||||
* @param resource database
|
* @param resource database
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected function __construct($userinfo, $settings, $db)
|
protected function __construct($userinfo, $settings, $db)
|
||||||
{
|
{
|
||||||
parent::setupLogger($settings);
|
parent::setupLogger($settings);
|
||||||
$this->userinfo = $userinfo;
|
$this->userinfo = $userinfo;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Singleton ftw ;-)
|
* Singleton ftw ;-)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function getInstanceOf($_usernfo, $_settings, $_db)
|
static public function getInstanceOf($_usernfo, $_settings, $_db)
|
||||||
{
|
{
|
||||||
if(!isset(self::$loggers[$_usernfo['loginname']]))
|
if(!isset(self::$loggers[$_usernfo['loginname']]))
|
||||||
{
|
{
|
||||||
self::$loggers[$_usernfo['loginname']] = new MysqlLogger($_usernfo, $_settings, $_db);
|
self::$loggers[$_usernfo['loginname']] = new MysqlLogger($_usernfo, $_settings, $_db);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::$loggers[$_usernfo['loginname']];
|
return self::$loggers[$_usernfo['loginname']];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logAction($action = USR_ACTION, $type = LOG_NOTICE, $text = null)
|
public function logAction($action = USR_ACTION, $type = LOG_NOTICE, $text = null)
|
||||||
{
|
{
|
||||||
if(parent::isEnabled())
|
if(parent::isEnabled())
|
||||||
{
|
{
|
||||||
if(parent::getSeverity() <= 1
|
if(parent::getSeverity() <= 1
|
||||||
&& $type == LOG_NOTICE)
|
&& $type == LOG_NOTICE)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset($this->userinfo['loginname'])
|
if(!isset($this->userinfo['loginname'])
|
||||||
|| $this->userinfo['loginname'] == '')
|
|| $this->userinfo['loginname'] == '')
|
||||||
{
|
{
|
||||||
$name = 'unknown';
|
$name = 'unknown';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$name = " (" . $this->userinfo['loginname'] . ")";
|
$name = " (" . $this->userinfo['loginname'] . ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
$now = time();
|
$now = time();
|
||||||
|
|
||||||
if($text != null
|
if($text != null
|
||||||
&& $text != '')
|
&& $text != '')
|
||||||
{
|
{
|
||||||
$this->db->query("INSERT INTO `panel_syslog` (`type`, `date`, `action`, `user`, `text`)
|
$this->db->query("INSERT INTO `panel_syslog` (`type`, `date`, `action`, `user`, `text`)
|
||||||
VALUES ('" . (int)$type . "', '" . $now . "', '" . (int)$action . "', '" . $this->db->escape($name) . "', '" . $this->db->escape($text) . "')");
|
VALUES ('" . (int)$type . "', '" . $now . "', '" . (int)$action . "', '" . $this->db->escape($name) . "', '" . $this->db->escape($text) . "')");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->db->query("INSERT INTO `panel_syslog` (`type`, `date`, `action`, `userid`, `text`)
|
$this->db->query("INSERT INTO `panel_syslog` (`type`, `date`, `action`, `userid`, `text`)
|
||||||
VALUES ('" . (int)$type . "', '" . $now . "', '" . (int)$action . "', '" . $this->db->escape($name) . "', 'No text given!!! Check scripts!')");
|
VALUES ('" . (int)$type . "', '" . $now . "', '" . (int)$action . "', '" . $this->db->escape($name) . "', 'No text given!!! Check scripts!')");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,128 +1,128 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Logger
|
* @package Logger
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @link http://www.nutime.de/
|
* @link http://www.nutime.de/
|
||||||
*
|
*
|
||||||
* Logger - SysLog-Logger-Class
|
* Logger - SysLog-Logger-Class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SysLogger extends AbstractLogger
|
class SysLogger extends AbstractLogger
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Userinfo
|
* Userinfo
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private $userinfo = array();
|
private $userinfo = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Syslogger Objects Array
|
* Syslogger Objects Array
|
||||||
* @var loggers
|
* @var loggers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static private $loggers = array();
|
static private $loggers = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class constructor.
|
* Class constructor.
|
||||||
*
|
*
|
||||||
* @param array userinfo
|
* @param array userinfo
|
||||||
* @param array settings
|
* @param array settings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected function __construct($userinfo, $settings)
|
protected function __construct($userinfo, $settings)
|
||||||
{
|
{
|
||||||
parent::setupLogger($settings);
|
parent::setupLogger($settings);
|
||||||
$this->userinfo = $userinfo;
|
$this->userinfo = $userinfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Singleton ftw ;-)
|
* Singleton ftw ;-)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function getInstanceOf($_usernfo, $_settings)
|
static public function getInstanceOf($_usernfo, $_settings)
|
||||||
{
|
{
|
||||||
if(!isset(self::$loggers[$_usernfo['loginname']]))
|
if(!isset(self::$loggers[$_usernfo['loginname']]))
|
||||||
{
|
{
|
||||||
self::$loggers[$_usernfo['loginname']] = new SysLogger($_usernfo, $_settings);
|
self::$loggers[$_usernfo['loginname']] = new SysLogger($_usernfo, $_settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::$loggers[$_usernfo['loginname']];
|
return self::$loggers[$_usernfo['loginname']];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logAction($action = USR_ACTION, $type = LOG_NOTICE, $text = null)
|
public function logAction($action = USR_ACTION, $type = LOG_NOTICE, $text = null)
|
||||||
{
|
{
|
||||||
if(parent::isEnabled())
|
if(parent::isEnabled())
|
||||||
{
|
{
|
||||||
if(parent::getSeverity() <= 1
|
if(parent::getSeverity() <= 1
|
||||||
&& $type == LOG_NOTICE)
|
&& $type == LOG_NOTICE)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$_action = 'unknown';
|
$_action = 'unknown';
|
||||||
|
|
||||||
switch($action)
|
switch($action)
|
||||||
{
|
{
|
||||||
case USR_ACTION:
|
case USR_ACTION:
|
||||||
$_action = 'customer';
|
$_action = 'customer';
|
||||||
break;
|
break;
|
||||||
case RES_ACTION:
|
case RES_ACTION:
|
||||||
$_action = 'reseller';
|
$_action = 'reseller';
|
||||||
break;
|
break;
|
||||||
case ADM_ACTION:
|
case ADM_ACTION:
|
||||||
$_action = 'administrator';
|
$_action = 'administrator';
|
||||||
break;
|
break;
|
||||||
case CRON_ACTION:
|
case CRON_ACTION:
|
||||||
$_action = 'cronjob';
|
$_action = 'cronjob';
|
||||||
break;
|
break;
|
||||||
case LOG_ERROR:
|
case LOG_ERROR:
|
||||||
$_action = 'internal';
|
$_action = 'internal';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$_action = 'unknown';
|
$_action = 'unknown';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset($this->userinfo['loginname'])
|
if(!isset($this->userinfo['loginname'])
|
||||||
|| $this->userinfo['loginname'] == '')
|
|| $this->userinfo['loginname'] == '')
|
||||||
{
|
{
|
||||||
$name = 'unknown';
|
$name = 'unknown';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$name = " (" . $this->userinfo['loginname'] . ")";
|
$name = " (" . $this->userinfo['loginname'] . ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
openlog("Froxlor", LOG_NDELAY, LOG_USER);
|
openlog("Froxlor", LOG_NDELAY, LOG_USER);
|
||||||
|
|
||||||
if($text != null
|
if($text != null
|
||||||
&& $text != '')
|
&& $text != '')
|
||||||
{
|
{
|
||||||
syslog((int)$type, "[" . ucfirst($_action) . " Action" . $name . "] " . $text);
|
syslog((int)$type, "[" . ucfirst($_action) . " Action" . $name . "] " . $text);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
syslog((int)$type, "[" . ucfirst($_action) . " Action" . $name . "] No text given!!! Check scripts!");
|
syslog((int)$type, "[" . ucfirst($_action) . " Action" . $name . "] No text given!!! Check scripts!");
|
||||||
}
|
}
|
||||||
|
|
||||||
closelog();
|
closelog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,37 +1,37 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*~ class.smtp.php
|
/*~ class.smtp.php
|
||||||
.---------------------------------------------------------------------------.
|
.---------------------------------------------------------------------------.
|
||||||
| Software: PHPMailer - PHP email class |
|
| Software: PHPMailer - PHP email class |
|
||||||
| Version: 2.0.0 rc1 |
|
| Version: 2.0.0 rc1 |
|
||||||
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
|
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
|
||||||
| Info: http://phpmailer.sourceforge.net |
|
| Info: http://phpmailer.sourceforge.net |
|
||||||
| Support: http://sourceforge.net/projects/phpmailer/ |
|
| Support: http://sourceforge.net/projects/phpmailer/ |
|
||||||
| ------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------- |
|
||||||
| Author: Andy Prevost (project admininistrator) |
|
| Author: Andy Prevost (project admininistrator) |
|
||||||
| Author: Brent R. Matzelle (original founder) |
|
| Author: Brent R. Matzelle (original founder) |
|
||||||
| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
|
| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
|
||||||
| Copyright (c) 2001-2003, Brent R. Matzelle |
|
| Copyright (c) 2001-2003, Brent R. Matzelle |
|
||||||
| ------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------- |
|
||||||
| License: Distributed under the Lesser General Public License (LGPL) |
|
| License: Distributed under the Lesser General Public License (LGPL) |
|
||||||
| http://www.gnu.org/copyleft/lesser.html |
|
| http://www.gnu.org/copyleft/lesser.html |
|
||||||
| This program is distributed in the hope that it will be useful - WITHOUT |
|
| This program is distributed in the hope that it will be useful - WITHOUT |
|
||||||
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||||
| FITNESS FOR A PARTICULAR PURPOSE. |
|
| FITNESS FOR A PARTICULAR PURPOSE. |
|
||||||
| ------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------- |
|
||||||
| We offer a number of paid services (www.codeworxtech.com): |
|
| We offer a number of paid services (www.codeworxtech.com): |
|
||||||
| - Web Hosting on highly optimized fast and secure servers |
|
| - Web Hosting on highly optimized fast and secure servers |
|
||||||
| - Technology Consulting |
|
| - Technology Consulting |
|
||||||
| - Oursourcing (highly qualified programmers and graphic designers) |
|
| - Oursourcing (highly qualified programmers and graphic designers) |
|
||||||
'---------------------------------------------------------------------------'
|
'---------------------------------------------------------------------------'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
|
* SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
|
||||||
* commands except TURN which will always return a not implemented
|
* commands except TURN which will always return a not implemented
|
||||||
* error. SMTP also provides some utility methods for sending mail
|
* error. SMTP also provides some utility methods for sending mail
|
||||||
* to an SMTP server.
|
* to an SMTP server.
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @author Chris Ryan
|
* @author Chris Ryan
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SMTP
|
class SMTP
|
||||||
@@ -66,8 +66,8 @@ class SMTP
|
|||||||
|
|
||||||
public $do_verp = false;
|
public $do_verp = false;
|
||||||
|
|
||||||
/**#@+
|
/**#@+
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private $smtp_conn;
|
private $smtp_conn;
|
||||||
@@ -97,8 +97,8 @@ class SMTP
|
|||||||
$this->do_debug = 0;
|
$this->do_debug = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
* CONNECTION FUNCTIONS *
|
* CONNECTION FUNCTIONS *
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -125,9 +125,9 @@ class SMTP
|
|||||||
|
|
||||||
if($this->connected())
|
if($this->connected())
|
||||||
{
|
{
|
||||||
/* ok we are connected! what should we do?
|
/* ok we are connected! what should we do?
|
||||||
* for now we will just give an error saying we
|
* for now we will just give an error saying we
|
||||||
* are already connected
|
* are already connected
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$this->error = array(
|
$this->error = array(
|
||||||
@@ -180,9 +180,9 @@ class SMTP
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sometimes the SMTP server takes a little longer to respond
|
/* sometimes the SMTP server takes a little longer to respond
|
||||||
* so we will give it a longer timeout for the first read
|
* so we will give it a longer timeout for the first read
|
||||||
* - Windows still does not have support for this timeout function
|
* - Windows still does not have support for this timeout function
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(substr(PHP_OS, 0, 3) != "WIN")socket_set_timeout($this->smtp_conn, $tval, 0);
|
if(substr(PHP_OS, 0, 3) != "WIN")socket_set_timeout($this->smtp_conn, $tval, 0);
|
||||||
@@ -340,8 +340,8 @@ class SMTP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************
|
/***************************************************************
|
||||||
* SMTP COMMANDS *
|
* SMTP COMMANDS *
|
||||||
*************************************************************/
|
*************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -403,15 +403,15 @@ class SMTP
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the server is ready to accept data!
|
/* the server is ready to accept data!
|
||||||
* according to rfc 821 we should not send more than 1000
|
* according to rfc 821 we should not send more than 1000
|
||||||
* including the CRLF
|
* including the CRLF
|
||||||
* characters on a single line so we will break the data up
|
* characters on a single line so we will break the data up
|
||||||
* into lines by \r and/or \n then if needed we will break
|
* into lines by \r and/or \n then if needed we will break
|
||||||
* each of those into smaller lines to fit within the limit.
|
* each of those into smaller lines to fit within the limit.
|
||||||
* in addition we will be looking for lines that start with
|
* in addition we will be looking for lines that start with
|
||||||
* a period '.' and append and additional period '.' to that
|
* a period '.' and append and additional period '.' to that
|
||||||
* line. NOTE: this does not count towards are limit.
|
* line. NOTE: this does not count towards are limit.
|
||||||
*/
|
*/
|
||||||
// normalize the line breaks so we know the explode works
|
// normalize the line breaks so we know the explode works
|
||||||
|
|
||||||
@@ -419,13 +419,13 @@ class SMTP
|
|||||||
$msg_data = str_replace("\r", "\n", $msg_data);
|
$msg_data = str_replace("\r", "\n", $msg_data);
|
||||||
$lines = explode("\n", $msg_data);
|
$lines = explode("\n", $msg_data);
|
||||||
|
|
||||||
/* we need to find a good way to determine is headers are
|
/* we need to find a good way to determine is headers are
|
||||||
* in the msg_data or if it is a straight msg body
|
* in the msg_data or if it is a straight msg body
|
||||||
* currently I am assuming rfc 822 definitions of msg headers
|
* currently I am assuming rfc 822 definitions of msg headers
|
||||||
* and if the first field of the first line (':' sperated)
|
* and if the first field of the first line (':' sperated)
|
||||||
* does not contain a space then it _should_ be a header
|
* does not contain a space then it _should_ be a header
|
||||||
* and we can process all lines before a blank "" line as
|
* and we can process all lines before a blank "" line as
|
||||||
* headers.
|
* headers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$field = substr($lines[0], 0, strpos($lines[0], ":"));
|
$field = substr($lines[0], 0, strpos($lines[0], ":"));
|
||||||
@@ -467,9 +467,9 @@ class SMTP
|
|||||||
$lines_out[] = substr($line, 0, $pos);
|
$lines_out[] = substr($line, 0, $pos);
|
||||||
$line = substr($line, $pos + 1);
|
$line = substr($line, $pos + 1);
|
||||||
|
|
||||||
/* if we are processing headers we need to
|
/* if we are processing headers we need to
|
||||||
* add a LWSP-char to the front of the new line
|
* add a LWSP-char to the front of the new line
|
||||||
* rfc 822 on long msg headers
|
* rfc 822 on long msg headers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if($in_headers)
|
if($in_headers)
|
||||||
@@ -1299,8 +1299,8 @@ class SMTP
|
|||||||
return $rply;
|
return $rply;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
* INTERNAL FUNCTIONS *
|
* INTERNAL FUNCTIONS *
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1345,4 +1345,4 @@ class SMTP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,284 +1,284 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Configfiles
|
* @package Configfiles
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return Array(
|
return Array(
|
||||||
'debian_etch' => Array(
|
'debian_etch' => Array(
|
||||||
'label' => 'Debian 4.0 (Etch)',
|
'label' => 'Debian 4.0 (Etch)',
|
||||||
'services' => Array(
|
'services' => Array(
|
||||||
'http' => Array(
|
'http' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['http'],
|
'label' => $lng['admin']['configfiles']['http'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'apache2' => Array(
|
'apache2' => Array(
|
||||||
'label' => 'Apache 2',
|
'label' => 'Apache 2',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'a2dismod userdir',
|
'a2dismod userdir',
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/apache2 restart'
|
'/etc/init.d/apache2 restart'
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'lighttpd' => Array(
|
'lighttpd' => Array(
|
||||||
'label' => 'Lighttpd Webserver',
|
'label' => 'Lighttpd Webserver',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
'apt-get install lighttpd',
|
'apt-get install lighttpd',
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_lighttpd.conf' => '/etc/lighttpd/lighttpd.conf',
|
'etc_lighttpd.conf' => '/etc/lighttpd/lighttpd.conf',
|
||||||
),
|
),
|
||||||
'commands_2' => Array(
|
'commands_2' => Array(
|
||||||
$configcommand['vhost'],
|
$configcommand['vhost'],
|
||||||
$configcommand['diroptions'],
|
$configcommand['diroptions'],
|
||||||
$configcommand['v_inclighty'],
|
$configcommand['v_inclighty'],
|
||||||
$configcommand['d_inclighty'],
|
$configcommand['d_inclighty'],
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/lighttpd restart'
|
'/etc/init.d/lighttpd restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'dns' => Array(
|
'dns' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['dns'],
|
'label' => $lng['admin']['configfiles']['dns'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'bind' => Array(
|
'bind' => Array(
|
||||||
'label' => 'Bind9',
|
'label' => 'Bind9',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install bind9',
|
'apt-get install bind9',
|
||||||
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/bind/named.conf',
|
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/bind/named.conf',
|
||||||
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf'
|
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/bind9 restart'
|
'/etc/init.d/bind9 restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'powerdns' => Array(
|
'powerdns' => Array(
|
||||||
'label' => 'PowerDNS',
|
'label' => 'PowerDNS',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf',
|
'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf',
|
||||||
'etc_powerdns_pdns-froxlor.conf' => '/etc/powerdns/pdns_froxlor.conf',
|
'etc_powerdns_pdns-froxlor.conf' => '/etc/powerdns/pdns_froxlor.conf',
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/pdns restart'
|
'/etc/init.d/pdns restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'smtp' => Array(
|
'smtp' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['smtp'],
|
'label' => $lng['admin']['configfiles']['smtp'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'postfix' => Array(
|
'postfix' => Array(
|
||||||
'label' => 'Postfix',
|
'label' => 'Postfix',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install postfix postfix-mysql libsasl2 libsasl2-modules libsasl2-modules-sql',
|
'apt-get install postfix postfix-mysql libsasl2 libsasl2-modules libsasl2-modules-sql',
|
||||||
'mkdir -p /etc/postfix/sasl',
|
'mkdir -p /etc/postfix/sasl',
|
||||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'touch /etc/postfix/sasl/smtpd.conf',
|
'touch /etc/postfix/sasl/smtpd.conf',
|
||||||
'chown root:root /etc/postfix/main.cf',
|
'chown root:root /etc/postfix/main.cf',
|
||||||
'chown root:root /etc/postfix/master.cf',
|
'chown root:root /etc/postfix/master.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'chown root:root /etc/postfix/sasl/smtpd.conf',
|
'chown root:root /etc/postfix/sasl/smtpd.conf',
|
||||||
'chmod 0644 /etc/postfix/main.cf',
|
'chmod 0644 /etc/postfix/main.cf',
|
||||||
'chmod 0644 /etc/postfix/master.cf',
|
'chmod 0644 /etc/postfix/master.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'chmod 0600 /etc/postfix/sasl/smtpd.conf',
|
'chmod 0600 /etc/postfix/sasl/smtpd.conf',
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
||||||
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
|
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
|
||||||
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
|
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'etc_postfix_sasl_smtpd.conf' => '/etc/postfix/sasl/smtpd.conf'
|
'etc_postfix_sasl_smtpd.conf' => '/etc/postfix/sasl/smtpd.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/postfix restart',
|
'/etc/init.d/postfix restart',
|
||||||
'newaliases'
|
'newaliases'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'exim4' => Array(
|
'exim4' => Array(
|
||||||
'label' => 'Exim4',
|
'label' => 'Exim4',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
'dpkg-reconfigure exim4-config',
|
'dpkg-reconfigure exim4-config',
|
||||||
'# choose "no configuration at this time" and "splitted configuration files" in the dialog'
|
'# choose "no configuration at this time" and "splitted configuration files" in the dialog'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt.rul' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul',
|
'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt.rul' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul',
|
||||||
'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config',
|
'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config',
|
||||||
'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options',
|
'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options',
|
||||||
'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config',
|
'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config',
|
||||||
'etc_exim4_conf.d_transport_30_froxlor-config' => '/etc/exim4/conf.d/transport/30_froxlor-config'
|
'etc_exim4_conf.d_transport_30_froxlor-config' => '/etc/exim4/conf.d/transport/30_froxlor-config'
|
||||||
),
|
),
|
||||||
'commands_2' => Array(
|
'commands_2' => Array(
|
||||||
'chmod o-rx /var/lib/exim4',
|
'chmod o-rx /var/lib/exim4',
|
||||||
'chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options'
|
'chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/exim4 restart'
|
'/etc/init.d/exim4 restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'mail' => Array(
|
'mail' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['mail'],
|
'label' => $lng['admin']['configfiles']['mail'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'courier' => Array(
|
'courier' => Array(
|
||||||
'label' => 'Courier',
|
'label' => 'Courier',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install courier-pop courier-imap courier-authlib-mysql'
|
'apt-get install courier-pop courier-imap courier-authlib-mysql'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_courier_authdaemonrc' => '/etc/courier/authdaemonrc',
|
'etc_courier_authdaemonrc' => '/etc/courier/authdaemonrc',
|
||||||
'etc_courier_authmysqlrc' => '/etc/courier/authmysqlrc'
|
'etc_courier_authmysqlrc' => '/etc/courier/authmysqlrc'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/courier-authdaemon restart',
|
'/etc/init.d/courier-authdaemon restart',
|
||||||
'/etc/init.d/courier-pop restart'
|
'/etc/init.d/courier-pop restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'dovecot' => Array(
|
'dovecot' => Array(
|
||||||
'label' => 'Dovecot',
|
'label' => 'Dovecot',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install dovecot-imapd dovecot-pop3d'
|
'apt-get install dovecot-imapd dovecot-pop3d'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
|
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
|
||||||
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
|
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/dovecot restart'
|
'/etc/init.d/dovecot restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'ftp' => Array(
|
'ftp' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['ftp'],
|
'label' => $lng['admin']['configfiles']['ftp'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'proftpd' => Array(
|
'proftpd' => Array(
|
||||||
'label' => 'ProFTPd',
|
'label' => 'ProFTPd',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
||||||
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/proftpd restart'
|
'/etc/init.d/proftpd restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'pure-ftpd' => Array(
|
'pure-ftpd' => Array(
|
||||||
'label' => 'Pure FTPd',
|
'label' => 'Pure FTPd',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install pure-ftpd-common pure-ftpd-mysql'
|
'apt-get install pure-ftpd-common pure-ftpd-mysql'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_pure-ftpd_conf_MinUID' => '/etc/pure-ftpd/conf/MinUID',
|
'etc_pure-ftpd_conf_MinUID' => '/etc/pure-ftpd/conf/MinUID',
|
||||||
'etc_pure-ftpd_conf_MySQLConfigFile' => '/etc/pure-ftpd/conf/MySQLConfigFile',
|
'etc_pure-ftpd_conf_MySQLConfigFile' => '/etc/pure-ftpd/conf/MySQLConfigFile',
|
||||||
'etc_pure-ftpd_conf_NoAnonymous' => '/etc/pure-ftpd/conf/NoAnonymous',
|
'etc_pure-ftpd_conf_NoAnonymous' => '/etc/pure-ftpd/conf/NoAnonymous',
|
||||||
'etc_pure-ftpd_conf_MaxIdleTime' => '/etc/pure-ftpd/conf/MaxIdleTime',
|
'etc_pure-ftpd_conf_MaxIdleTime' => '/etc/pure-ftpd/conf/MaxIdleTime',
|
||||||
'etc_pure-ftpd_conf_ChrootEveryone' => '/etc/pure-ftpd/conf/ChrootEveryone',
|
'etc_pure-ftpd_conf_ChrootEveryone' => '/etc/pure-ftpd/conf/ChrootEveryone',
|
||||||
'etc_pure-ftpd_conf_PAMAuthentication' => '/etc/pure-ftpd/conf/PAMAuthentication',
|
'etc_pure-ftpd_conf_PAMAuthentication' => '/etc/pure-ftpd/conf/PAMAuthentication',
|
||||||
'etc_pure-ftpd_db_mysql.conf' => '/etc/pure-ftpd/db/mysql.conf',
|
'etc_pure-ftpd_db_mysql.conf' => '/etc/pure-ftpd/db/mysql.conf',
|
||||||
'etc_pure-ftpd_conf_CustomerProof' => '/etc/pure-ftpd/conf/CustomerProof',
|
'etc_pure-ftpd_conf_CustomerProof' => '/etc/pure-ftpd/conf/CustomerProof',
|
||||||
'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind',
|
'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind',
|
||||||
'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common'
|
'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/pure-ftpd-mysql restart'
|
'/etc/init.d/pure-ftpd-mysql restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'etc' => Array(
|
'etc' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['etc'],
|
'label' => $lng['admin']['configfiles']['etc'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'cron' => Array(
|
'cron' => Array(
|
||||||
'label' => 'Crond (cronscript)',
|
'label' => 'Crond (cronscript)',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
|
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/cron restart'
|
'/etc/init.d/cron restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'xinetd' => Array(
|
'xinetd' => Array(
|
||||||
'label' => 'xinet.d (froxlor updates in realtime)',
|
'label' => 'xinet.d (froxlor updates in realtime)',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install xinetd'
|
'apt-get install xinetd'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
|
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/xinetd restart'
|
'/etc/init.d/xinetd restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'awstats' => Array(
|
'awstats' => Array(
|
||||||
'label' => 'Awstats',
|
'label' => 'Awstats',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
||||||
),
|
),
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'libnss' => Array(
|
'libnss' => Array(
|
||||||
'label' => 'libnss (system login with mysql)',
|
'label' => 'libnss (system login with mysql)',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install libnss-mysql nscd',
|
'apt-get install libnss-mysql nscd',
|
||||||
'chmod 600 /etc/nss-mysql.conf /etc/nss-mysql-root.conf'
|
'chmod 600 /etc/nss-mysql.conf /etc/nss-mysql-root.conf'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_nss-mysql.conf' => '/etc/nss-mysql.conf',
|
'etc_nss-mysql.conf' => '/etc/nss-mysql.conf',
|
||||||
'etc_nss-mysql-root.conf' => '/etc/nss-mysql-root.conf',
|
'etc_nss-mysql-root.conf' => '/etc/nss-mysql-root.conf',
|
||||||
'etc_nsswitch.conf' => '/etc/nsswitch.conf',
|
'etc_nsswitch.conf' => '/etc/nsswitch.conf',
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/nscd restart'
|
'/etc/init.d/nscd restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,301 +1,301 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Configfiles
|
* @package Configfiles
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return Array(
|
return Array(
|
||||||
'gentoo' => Array(
|
'gentoo' => Array(
|
||||||
'label' => 'Gentoo',
|
'label' => 'Gentoo',
|
||||||
'services' => Array(
|
'services' => Array(
|
||||||
'http' => Array(
|
'http' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['http'],
|
'label' => $lng['admin']['configfiles']['http'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'apache2' => Array(
|
'apache2' => Array(
|
||||||
'label' => 'Apache2 Webserver',
|
'label' => 'Apache2 Webserver',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'touch ' . $settings['system']['apacheconf_vhost'],
|
'touch ' . $settings['system']['apacheconf_vhost'],
|
||||||
'chown root:0 ' . $settings['system']['apacheconf_vhost'],
|
'chown root:0 ' . $settings['system']['apacheconf_vhost'],
|
||||||
'chmod 0600 ' . $settings['system']['apacheconf_vhost'],
|
'chmod 0600 ' . $settings['system']['apacheconf_vhost'],
|
||||||
'touch ' . $settings['system']['apacheconf_diroptions'],
|
'touch ' . $settings['system']['apacheconf_diroptions'],
|
||||||
'chown root:0 ' . $settings['system']['apacheconf_diroptions'],
|
'chown root:0 ' . $settings['system']['apacheconf_diroptions'],
|
||||||
'chmod 0600 ' . $settings['system']['apacheconf_diroptions'],
|
'chmod 0600 ' . $settings['system']['apacheconf_diroptions'],
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'rc-update add apache2 default',
|
'rc-update add apache2 default',
|
||||||
'/etc/init.d/apache2 restart'
|
'/etc/init.d/apache2 restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'lighttpd' => Array(
|
'lighttpd' => Array(
|
||||||
'label' => 'Lighttpd Webserver',
|
'label' => 'Lighttpd Webserver',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_lighttpd.conf' => '/etc/lighttpd/lighttpd.conf'
|
'etc_lighttpd.conf' => '/etc/lighttpd/lighttpd.conf'
|
||||||
),
|
),
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
$configcommand['vhost'],
|
$configcommand['vhost'],
|
||||||
$configcommand['diroptions'],
|
$configcommand['diroptions'],
|
||||||
$configcommand['v_inclighty'],
|
$configcommand['v_inclighty'],
|
||||||
$configcommand['d_inclighty'],
|
$configcommand['d_inclighty'],
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory']
|
'mkdir -p ' . $settings['system']['logfiles_directory']
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'rc-update add lighttpd default',
|
'rc-update add lighttpd default',
|
||||||
'/etc/init.d/lighttpd restart'
|
'/etc/init.d/lighttpd restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'dns' => Array(
|
'dns' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['dns'],
|
'label' => $lng['admin']['configfiles']['dns'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'bind' => Array(
|
'bind' => Array(
|
||||||
'label' => 'Bind9 Nameserver',
|
'label' => 'Bind9 Nameserver',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_bind_default.zone' => '/etc/bind/default.zone'
|
'etc_bind_default.zone' => '/etc/bind/default.zone'
|
||||||
),
|
),
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/bind/named.conf',
|
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/bind/named.conf',
|
||||||
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf',
|
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf',
|
||||||
'chown root:0 ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf',
|
'chown root:0 ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf',
|
||||||
'chmod 0600 ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf'
|
'chmod 0600 ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'rc-update add named default',
|
'rc-update add named default',
|
||||||
'/etc/init.d/named restart'
|
'/etc/init.d/named restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'smtp' => Array(
|
'smtp' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['smtp'],
|
'label' => $lng['admin']['configfiles']['smtp'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'postfix' => Array(
|
'postfix' => Array(
|
||||||
'label' => 'Postfix',
|
'label' => 'Postfix',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||||
'chmod 0750 ' . $settings['system']['vmail_homedir'],
|
'chmod 0750 ' . $settings['system']['vmail_homedir'],
|
||||||
'mv /etc/postfix/main.cf /etc/postfix/main.cf.gentoo',
|
'mv /etc/postfix/main.cf /etc/postfix/main.cf.gentoo',
|
||||||
'touch /etc/postfix/main.cf',
|
'touch /etc/postfix/main.cf',
|
||||||
'touch /etc/postfix/master.cf',
|
'touch /etc/postfix/master.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'touch /etc/sasl2/smtpd.conf',
|
'touch /etc/sasl2/smtpd.conf',
|
||||||
'chown root:root /etc/postfix/main.cf',
|
'chown root:root /etc/postfix/main.cf',
|
||||||
'chown root:root /etc/postfix/master.cf',
|
'chown root:root /etc/postfix/master.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'chown root:root /etc/sasl2/smtpd.conf',
|
'chown root:root /etc/sasl2/smtpd.conf',
|
||||||
'chmod 0644 /etc/postfix/main.cf',
|
'chmod 0644 /etc/postfix/main.cf',
|
||||||
'chmod 0644 /etc/postfix/master.cf',
|
'chmod 0644 /etc/postfix/master.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'chmod 0600 /etc/sasl2/smtpd.conf',
|
'chmod 0600 /etc/sasl2/smtpd.conf',
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
||||||
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
|
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
|
||||||
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
|
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'etc_sasl2_smtpd.conf' => '/etc/sasl2/smtpd.conf'
|
'etc_sasl2_smtpd.conf' => '/etc/sasl2/smtpd.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'rc-update add postfix default',
|
'rc-update add postfix default',
|
||||||
'/etc/init.d/postfix restart'
|
'/etc/init.d/postfix restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'dkim' => Array(
|
'dkim' => Array(
|
||||||
'label' => 'DomainKey filter',
|
'label' => 'DomainKey filter',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
'mkdir -p /etc/postfix/dkim'
|
'mkdir -p /etc/postfix/dkim'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'dkim-filter.conf' => '/etc/postfix/dkim/dkim-filter.conf'
|
'dkim-filter.conf' => '/etc/postfix/dkim/dkim-filter.conf'
|
||||||
),
|
),
|
||||||
'commands_2' => Array(
|
'commands_2' => Array(
|
||||||
'chgrp postfix /etc/postfix/dkim/dkim-filter.conf',
|
'chgrp postfix /etc/postfix/dkim/dkim-filter.conf',
|
||||||
'echo "smtpd_milters = inet:localhost:8891\n
|
'echo "smtpd_milters = inet:localhost:8891\n
|
||||||
milter_macro_daemon_name = SIGNING\n
|
milter_macro_daemon_name = SIGNING\n
|
||||||
milter_default_action = accept\n" >> /etc/postfix/main.cf'
|
milter_default_action = accept\n" >> /etc/postfix/main.cf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/dkim-filter restart'
|
'/etc/init.d/dkim-filter restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'mail' => Array(
|
'mail' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['mail'],
|
'label' => $lng['admin']['configfiles']['mail'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'courier' => Array(
|
'courier' => Array(
|
||||||
'label' => 'Courier-IMAP (POP3/IMAP)',
|
'label' => 'Courier-IMAP (POP3/IMAP)',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_courier_authlib_authdaemonrc' => '/etc/courier/authlib/authdaemonrc',
|
'etc_courier_authlib_authdaemonrc' => '/etc/courier/authlib/authdaemonrc',
|
||||||
'etc_courier_authlib_authmysqlrc' => '/etc/courier/authlib/authmysqlrc',
|
'etc_courier_authlib_authmysqlrc' => '/etc/courier/authlib/authmysqlrc',
|
||||||
'etc_courier-imap_pop3d' => '/etc/courier-imap/pop3d',
|
'etc_courier-imap_pop3d' => '/etc/courier-imap/pop3d',
|
||||||
'etc_courier-imap_imapd' => '/etc/courier-imap/imapd',
|
'etc_courier-imap_imapd' => '/etc/courier-imap/imapd',
|
||||||
'etc_courier-imap_pop3d-ssl' => '/etc/courier-imap/pop3d-ssl',
|
'etc_courier-imap_pop3d-ssl' => '/etc/courier-imap/pop3d-ssl',
|
||||||
'etc_courier-imap_imapd-ssl' => '/etc/courier-imap/imapd-ssl'
|
'etc_courier-imap_imapd-ssl' => '/etc/courier-imap/imapd-ssl'
|
||||||
),
|
),
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'rm /etc/courier/authlib/authdaemonrc',
|
'rm /etc/courier/authlib/authdaemonrc',
|
||||||
'rm /etc/courier/authlib/authmysqlrc',
|
'rm /etc/courier/authlib/authmysqlrc',
|
||||||
'rm /etc/courier-imap/pop3d',
|
'rm /etc/courier-imap/pop3d',
|
||||||
'rm /etc/courier-imap/imapd',
|
'rm /etc/courier-imap/imapd',
|
||||||
'rm /etc/courier-imap/pop3d-ssl',
|
'rm /etc/courier-imap/pop3d-ssl',
|
||||||
'rm /etc/courier-imap/imapd-ssl',
|
'rm /etc/courier-imap/imapd-ssl',
|
||||||
'touch /etc/courier/authlib/authdaemonrc',
|
'touch /etc/courier/authlib/authdaemonrc',
|
||||||
'touch /etc/courier/authlib/authmysqlrc',
|
'touch /etc/courier/authlib/authmysqlrc',
|
||||||
'touch /etc/courier-imap/pop3d',
|
'touch /etc/courier-imap/pop3d',
|
||||||
'touch /etc/courier-imap/imapd',
|
'touch /etc/courier-imap/imapd',
|
||||||
'touch /etc/courier-imap/pop3d-ssl',
|
'touch /etc/courier-imap/pop3d-ssl',
|
||||||
'touch /etc/courier-imap/imapd-ssl',
|
'touch /etc/courier-imap/imapd-ssl',
|
||||||
'chown root:0 /etc/courier/authlib/authdaemonrc',
|
'chown root:0 /etc/courier/authlib/authdaemonrc',
|
||||||
'chown root:0 /etc/courier/authlib/authmysqlrc',
|
'chown root:0 /etc/courier/authlib/authmysqlrc',
|
||||||
'chown root:0 /etc/courier-imap/pop3d',
|
'chown root:0 /etc/courier-imap/pop3d',
|
||||||
'chown root:0 /etc/courier-imap/imapd',
|
'chown root:0 /etc/courier-imap/imapd',
|
||||||
'chown root:0 /etc/courier-imap/pop3d-ssl',
|
'chown root:0 /etc/courier-imap/pop3d-ssl',
|
||||||
'chown root:0 /etc/courier-imap/imapd-ssl',
|
'chown root:0 /etc/courier-imap/imapd-ssl',
|
||||||
'chmod 0600 /etc/courier/authlib/authdaemonrc',
|
'chmod 0600 /etc/courier/authlib/authdaemonrc',
|
||||||
'chmod 0600 /etc/courier/authlib/authmysqlrc',
|
'chmod 0600 /etc/courier/authlib/authmysqlrc',
|
||||||
'chmod 0600 /etc/courier-imap/pop3d',
|
'chmod 0600 /etc/courier-imap/pop3d',
|
||||||
'chmod 0600 /etc/courier-imap/imapd',
|
'chmod 0600 /etc/courier-imap/imapd',
|
||||||
'chmod 0600 /etc/courier-imap/pop3d-ssl',
|
'chmod 0600 /etc/courier-imap/pop3d-ssl',
|
||||||
'chmod 0600 /etc/courier-imap/imapd-ssl'
|
'chmod 0600 /etc/courier-imap/imapd-ssl'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'rc-update add courier-authlib default',
|
'rc-update add courier-authlib default',
|
||||||
'rc-update add courier-pop3d default',
|
'rc-update add courier-pop3d default',
|
||||||
'rc-update add courier-imapd default',
|
'rc-update add courier-imapd default',
|
||||||
'/etc/init.d/courier-authlib restart',
|
'/etc/init.d/courier-authlib restart',
|
||||||
'/etc/init.d/courier-pop3d restart',
|
'/etc/init.d/courier-pop3d restart',
|
||||||
'/etc/init.d/courier-imapd restart'
|
'/etc/init.d/courier-imapd restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'dovecot' => Array(
|
'dovecot' => Array(
|
||||||
'label' => 'Dovecot',
|
'label' => 'Dovecot',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
'mv dovecot.conf dovecot.conf.gentoo',
|
'mv dovecot.conf dovecot.conf.gentoo',
|
||||||
'mv dovecot-sql.conf dovecot-sql.conf.gentoo',
|
'mv dovecot-sql.conf dovecot-sql.conf.gentoo',
|
||||||
'touch dovecot.conf',
|
'touch dovecot.conf',
|
||||||
'touch dovecot-sql.conf',
|
'touch dovecot-sql.conf',
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
|
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
|
||||||
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
|
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/dovecot restart'
|
'/etc/init.d/dovecot restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'ftp' => Array(
|
'ftp' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['ftp'],
|
'label' => $lng['admin']['configfiles']['ftp'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'proftpd' => Array(
|
'proftpd' => Array(
|
||||||
'label' => 'ProFTPd',
|
'label' => 'ProFTPd',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
||||||
),
|
),
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'touch /etc/proftpd/proftpd.conf',
|
'touch /etc/proftpd/proftpd.conf',
|
||||||
'chown root:0 /etc/proftpd/proftpd.conf',
|
'chown root:0 /etc/proftpd/proftpd.conf',
|
||||||
'chmod 0600 /etc/proftpd/proftpd.conf'
|
'chmod 0600 /etc/proftpd/proftpd.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'rc-update add proftpd default',
|
'rc-update add proftpd default',
|
||||||
'/etc/init.d/proftpd restart'
|
'/etc/init.d/proftpd restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'etc' => Array(
|
'etc' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['etc'],
|
'label' => $lng['admin']['configfiles']['etc'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'cron' => Array(
|
'cron' => Array(
|
||||||
'label' => 'Crond (cronscript)',
|
'label' => 'Crond (cronscript)',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
|
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
|
||||||
),
|
),
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'touch /etc/cron.d/froxlor',
|
'touch /etc/cron.d/froxlor',
|
||||||
'chown root:0 /etc/cron.d/froxlor',
|
'chown root:0 /etc/cron.d/froxlor',
|
||||||
'chmod 0640 /etc/cron.d/froxlor',
|
'chmod 0640 /etc/cron.d/froxlor',
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'rc-update add vixie-cron default',
|
'rc-update add vixie-cron default',
|
||||||
'/etc/init.d/vixie-cron restart'
|
'/etc/init.d/vixie-cron restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'xinetd' => Array(
|
'xinetd' => Array(
|
||||||
'label' => 'xinet.d (froxlor updates in realtime)',
|
'label' => 'xinet.d (froxlor updates in realtime)',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'emerge -av xinetd'
|
'emerge -av xinetd'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
|
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/xinetd restart'
|
'/etc/init.d/xinetd restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'awstats' => Array(
|
'awstats' => Array(
|
||||||
'label' => 'Awstats',
|
'label' => 'Awstats',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
||||||
),
|
),
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'libnss' => Array(
|
'libnss' => Array(
|
||||||
'label' => 'libnss (system login with mysql)',
|
'label' => 'libnss (system login with mysql)',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_libnss-mysql.cfg' => '/etc/libnss-mysql.cfg',
|
'etc_libnss-mysql.cfg' => '/etc/libnss-mysql.cfg',
|
||||||
'etc_libnss-mysql-root.cfg' => '/etc/libnss-mysql-root.cfg',
|
'etc_libnss-mysql-root.cfg' => '/etc/libnss-mysql-root.cfg',
|
||||||
'etc_nsswitch.conf' => '/etc/nsswitch.conf',
|
'etc_nsswitch.conf' => '/etc/nsswitch.conf',
|
||||||
),
|
),
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'emerge -av libnss-mysql',
|
'emerge -av libnss-mysql',
|
||||||
'chmod 600 /etc/libnss-mysql.cfg /etc/libnss-mysql-root.cfg'
|
'chmod 600 /etc/libnss-mysql.cfg /etc/libnss-mysql-root.cfg'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'rc-update add nscd default',
|
'rc-update add nscd default',
|
||||||
'/etc/init.d/nscd restart'
|
'/etc/init.d/nscd restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,278 +1,278 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Configfiles
|
* @package Configfiles
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return Array(
|
return Array(
|
||||||
'ubuntu_hardy' => Array(
|
'ubuntu_hardy' => Array(
|
||||||
'label' => 'Ubuntu 8.04 (Hardy)',
|
'label' => 'Ubuntu 8.04 (Hardy)',
|
||||||
'services' => Array(
|
'services' => Array(
|
||||||
'http' => Array(
|
'http' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['http'],
|
'label' => $lng['admin']['configfiles']['http'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'apache2' => Array(
|
'apache2' => Array(
|
||||||
'label' => 'Apache 2',
|
'label' => 'Apache 2',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'a2dismod userdir',
|
'a2dismod userdir',
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/apache2 restart'
|
'/etc/init.d/apache2 restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'lighttpd' => Array(
|
'lighttpd' => Array(
|
||||||
'label' => 'Lighttpd Webserver',
|
'label' => 'Lighttpd Webserver',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
'apt-get install lighttpd',
|
'apt-get install lighttpd',
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_lighttpd.conf' => '/etc/lighttpd/lighttpd.conf',
|
'etc_lighttpd.conf' => '/etc/lighttpd/lighttpd.conf',
|
||||||
),
|
),
|
||||||
'commands_2' => Array(
|
'commands_2' => Array(
|
||||||
$configcommand['vhost'],
|
$configcommand['vhost'],
|
||||||
$configcommand['diroptions'],
|
$configcommand['diroptions'],
|
||||||
$configcommand['v_inclighty'],
|
$configcommand['v_inclighty'],
|
||||||
$configcommand['d_inclighty'],
|
$configcommand['d_inclighty'],
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/lighttpd restart'
|
'/etc/init.d/lighttpd restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'dns' => Array(
|
'dns' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['dns'],
|
'label' => $lng['admin']['configfiles']['dns'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'bind' => Array(
|
'bind' => Array(
|
||||||
'label' => 'Bind9',
|
'label' => 'Bind9',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/bind/named.conf',
|
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/bind/named.conf',
|
||||||
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf'
|
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/bind9 restart'
|
'/etc/init.d/bind9 restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'powerdns' => Array(
|
'powerdns' => Array(
|
||||||
'label' => 'PowerDNS',
|
'label' => 'PowerDNS',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf',
|
'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf',
|
||||||
'etc_powerdns_pdns-froxlor.conf' => '/etc/powerdns/pdns_froxlor.conf',
|
'etc_powerdns_pdns-froxlor.conf' => '/etc/powerdns/pdns_froxlor.conf',
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/pdns restart'
|
'/etc/init.d/pdns restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'smtp' => Array(
|
'smtp' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['smtp'],
|
'label' => $lng['admin']['configfiles']['smtp'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'postfix' => Array(
|
'postfix' => Array(
|
||||||
'label' => 'Postfix',
|
'label' => 'Postfix',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
'mkdir -p /etc/postfix/sasl',
|
'mkdir -p /etc/postfix/sasl',
|
||||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||||
'mv /etc/postfix/main.cf /etc/postfix/main.cf.ubuntu',
|
'mv /etc/postfix/main.cf /etc/postfix/main.cf.ubuntu',
|
||||||
'touch /etc/postfix/main.cf',
|
'touch /etc/postfix/main.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'touch /etc/postfix/sasl/smtpd.conf',
|
'touch /etc/postfix/sasl/smtpd.conf',
|
||||||
'chown root:root /etc/postfix/main.cf',
|
'chown root:root /etc/postfix/main.cf',
|
||||||
'chown root:root /etc/postfix/master.cf',
|
'chown root:root /etc/postfix/master.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'chown root:root /etc/postfix/sasl/smtpd.conf',
|
'chown root:root /etc/postfix/sasl/smtpd.conf',
|
||||||
'chmod 0644 /etc/postfix/main.cf',
|
'chmod 0644 /etc/postfix/main.cf',
|
||||||
'chmod 0644 /etc/postfix/master.cf',
|
'chmod 0644 /etc/postfix/master.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'chmod 0600 /etc/postfix/sasl/smtpd.conf',
|
'chmod 0600 /etc/postfix/sasl/smtpd.conf',
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
||||||
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
|
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
|
||||||
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
|
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'etc_postfix_sasl_smtpd.conf' => '/etc/postfix/sasl/smtpd.conf'
|
'etc_postfix_sasl_smtpd.conf' => '/etc/postfix/sasl/smtpd.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/postfix restart',
|
'/etc/init.d/postfix restart',
|
||||||
'newaliases'
|
'newaliases'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'exim4' => Array(
|
'exim4' => Array(
|
||||||
'label' => 'Exim4',
|
'label' => 'Exim4',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
'dpkg-reconfigure exim4-config',
|
'dpkg-reconfigure exim4-config',
|
||||||
'# choose "no configuration at this time" and "splitted configuration files" in the dialog'
|
'# choose "no configuration at this time" and "splitted configuration files" in the dialog'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt.rul' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul',
|
'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt.rul' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul',
|
||||||
'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config',
|
'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config',
|
||||||
'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options',
|
'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options',
|
||||||
'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config',
|
'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config',
|
||||||
'etc_exim4_conf.d_transport_30_froxlor-config' => '/etc/exim4/conf.d/transport/30_froxlor-config'
|
'etc_exim4_conf.d_transport_30_froxlor-config' => '/etc/exim4/conf.d/transport/30_froxlor-config'
|
||||||
),
|
),
|
||||||
'commands_2' => Array(
|
'commands_2' => Array(
|
||||||
'chmod o-rx /var/lib/exim4',
|
'chmod o-rx /var/lib/exim4',
|
||||||
'chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options'
|
'chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/exim4 restart'
|
'/etc/init.d/exim4 restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'mail' => Array(
|
'mail' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['mail'],
|
'label' => $lng['admin']['configfiles']['mail'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'courier' => Array(
|
'courier' => Array(
|
||||||
'label' => 'Courier',
|
'label' => 'Courier',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_courier_authdaemonrc' => '/etc/courier/authdaemonrc',
|
'etc_courier_authdaemonrc' => '/etc/courier/authdaemonrc',
|
||||||
'etc_courier_authmysqlrc' => '/etc/courier/authmysqlrc'
|
'etc_courier_authmysqlrc' => '/etc/courier/authmysqlrc'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/courier-authdaemon restart',
|
'/etc/init.d/courier-authdaemon restart',
|
||||||
'/etc/init.d/courier-pop restart'
|
'/etc/init.d/courier-pop restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'dovecot' => Array(
|
'dovecot' => Array(
|
||||||
'label' => 'Dovecot',
|
'label' => 'Dovecot',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'/etc/init.d/dovecot stop',
|
'/etc/init.d/dovecot stop',
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
|
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
|
||||||
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
|
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/dovecot restart'
|
'/etc/init.d/dovecot restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'ftp' => Array(
|
'ftp' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['ftp'],
|
'label' => $lng['admin']['configfiles']['ftp'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'proftpd' => Array(
|
'proftpd' => Array(
|
||||||
'label' => 'ProFTPd',
|
'label' => 'ProFTPd',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
||||||
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/proftpd restart'
|
'/etc/init.d/proftpd restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'pure-ftpd' => Array(
|
'pure-ftpd' => Array(
|
||||||
'label' => 'Pure FTPd',
|
'label' => 'Pure FTPd',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_pure-ftpd_conf_MinUID' => '/etc/pure-ftpd/conf/MinUID',
|
'etc_pure-ftpd_conf_MinUID' => '/etc/pure-ftpd/conf/MinUID',
|
||||||
'etc_pure-ftpd_conf_MySQLConfigFile' => '/etc/pure-ftpd/conf/MySQLConfigFile',
|
'etc_pure-ftpd_conf_MySQLConfigFile' => '/etc/pure-ftpd/conf/MySQLConfigFile',
|
||||||
'etc_pure-ftpd_conf_NoAnonymous' => '/etc/pure-ftpd/conf/NoAnonymous',
|
'etc_pure-ftpd_conf_NoAnonymous' => '/etc/pure-ftpd/conf/NoAnonymous',
|
||||||
'etc_pure-ftpd_conf_MaxIdleTime' => '/etc/pure-ftpd/conf/MaxIdleTime',
|
'etc_pure-ftpd_conf_MaxIdleTime' => '/etc/pure-ftpd/conf/MaxIdleTime',
|
||||||
'etc_pure-ftpd_conf_ChrootEveryone' => '/etc/pure-ftpd/conf/ChrootEveryone',
|
'etc_pure-ftpd_conf_ChrootEveryone' => '/etc/pure-ftpd/conf/ChrootEveryone',
|
||||||
'etc_pure-ftpd_conf_PAMAuthentication' => '/etc/pure-ftpd/conf/PAMAuthentication',
|
'etc_pure-ftpd_conf_PAMAuthentication' => '/etc/pure-ftpd/conf/PAMAuthentication',
|
||||||
'etc_pure-ftpd_db_mysql.conf' => '/etc/pure-ftpd/db/mysql.conf',
|
'etc_pure-ftpd_db_mysql.conf' => '/etc/pure-ftpd/db/mysql.conf',
|
||||||
'etc_pure-ftpd_conf_CustomerProof' => '/etc/pure-ftpd/conf/CustomerProof',
|
'etc_pure-ftpd_conf_CustomerProof' => '/etc/pure-ftpd/conf/CustomerProof',
|
||||||
'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind',
|
'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind',
|
||||||
'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common'
|
'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/pure-ftpd-mysql restart'
|
'/etc/init.d/pure-ftpd-mysql restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'etc' => Array(
|
'etc' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['etc'],
|
'label' => $lng['admin']['configfiles']['etc'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'cron' => Array(
|
'cron' => Array(
|
||||||
'label' => 'Crond (cronscript)',
|
'label' => 'Crond (cronscript)',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
|
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/cron restart'
|
'/etc/init.d/cron restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'xinetd' => Array(
|
'xinetd' => Array(
|
||||||
'label' => 'xinet.d (froxlor updates in realtime)',
|
'label' => 'xinet.d (froxlor updates in realtime)',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install xinetd'
|
'apt-get install xinetd'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
|
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/xinetd restart'
|
'/etc/init.d/xinetd restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'awstats' => Array(
|
'awstats' => Array(
|
||||||
'label' => 'Awstats',
|
'label' => 'Awstats',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
||||||
),
|
),
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'libnss' => Array(
|
'libnss' => Array(
|
||||||
'label' => 'libnss (system login with mysql)',
|
'label' => 'libnss (system login with mysql)',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install libnss-mysql nscd',
|
'apt-get install libnss-mysql nscd',
|
||||||
'chmod 600 /etc/nss-mysql.conf /etc/nss-mysql-root.conf'
|
'chmod 600 /etc/nss-mysql.conf /etc/nss-mysql-root.conf'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_nss-mysql.conf' => '/etc/nss-mysql.conf',
|
'etc_nss-mysql.conf' => '/etc/nss-mysql.conf',
|
||||||
'etc_nss-mysql-root.conf' => '/etc/nss-mysql-root.conf',
|
'etc_nss-mysql-root.conf' => '/etc/nss-mysql-root.conf',
|
||||||
'etc_nsswitch.conf' => '/etc/nsswitch.conf',
|
'etc_nsswitch.conf' => '/etc/nsswitch.conf',
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/nscd restart'
|
'/etc/init.d/nscd restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,285 +1,285 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Configfiles
|
* @package Configfiles
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return Array(
|
return Array(
|
||||||
'debian_lenny' => Array(
|
'debian_lenny' => Array(
|
||||||
'label' => 'Debian 5.0 (Lenny)',
|
'label' => 'Debian 5.0 (Lenny)',
|
||||||
'services' => Array(
|
'services' => Array(
|
||||||
'http' => Array(
|
'http' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['http'],
|
'label' => $lng['admin']['configfiles']['http'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'apache2' => Array(
|
'apache2' => Array(
|
||||||
'label' => 'Apache 2',
|
'label' => 'Apache 2',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'a2dismod userdir',
|
'a2dismod userdir',
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/apache2 restart'
|
'/etc/init.d/apache2 restart'
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'lighttpd' => Array(
|
'lighttpd' => Array(
|
||||||
'label' => 'Lighttpd Webserver',
|
'label' => 'Lighttpd Webserver',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
'apt-get install lighttpd',
|
'apt-get install lighttpd',
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_lighttpd.conf' => '/etc/lighttpd/lighttpd.conf',
|
'etc_lighttpd.conf' => '/etc/lighttpd/lighttpd.conf',
|
||||||
),
|
),
|
||||||
'commands_2' => Array(
|
'commands_2' => Array(
|
||||||
$configcommand['vhost'],
|
$configcommand['vhost'],
|
||||||
$configcommand['diroptions'],
|
$configcommand['diroptions'],
|
||||||
$configcommand['v_inclighty'],
|
$configcommand['v_inclighty'],
|
||||||
$configcommand['d_inclighty'],
|
$configcommand['d_inclighty'],
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/lighttpd restart'
|
'/etc/init.d/lighttpd restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'dns' => Array(
|
'dns' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['dns'],
|
'label' => $lng['admin']['configfiles']['dns'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'bind' => Array(
|
'bind' => Array(
|
||||||
'label' => 'Bind9',
|
'label' => 'Bind9',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install bind9',
|
'apt-get install bind9',
|
||||||
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/bind/named.conf',
|
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/bind/named.conf',
|
||||||
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf'
|
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/bind9 restart'
|
'/etc/init.d/bind9 restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'powerdns' => Array(
|
'powerdns' => Array(
|
||||||
'label' => 'PowerDNS',
|
'label' => 'PowerDNS',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf',
|
'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf',
|
||||||
'etc_powerdns_pdns-froxlor.conf' => '/etc/powerdns/pdns_froxlor.conf',
|
'etc_powerdns_pdns-froxlor.conf' => '/etc/powerdns/pdns_froxlor.conf',
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/pdns restart'
|
'/etc/init.d/pdns restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'smtp' => Array(
|
'smtp' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['smtp'],
|
'label' => $lng['admin']['configfiles']['smtp'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'postfix' => Array(
|
'postfix' => Array(
|
||||||
'label' => 'Postfix',
|
'label' => 'Postfix',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install postfix postfix-mysql libsasl2 libsasl2-modules libsasl2-modules-sql',
|
'apt-get install postfix postfix-mysql libsasl2 libsasl2-modules libsasl2-modules-sql',
|
||||||
'mkdir -p /etc/postfix/sasl',
|
'mkdir -p /etc/postfix/sasl',
|
||||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'touch /etc/postfix/sasl/smtpd.conf',
|
'touch /etc/postfix/sasl/smtpd.conf',
|
||||||
'chown root:root /etc/postfix/main.cf',
|
'chown root:root /etc/postfix/main.cf',
|
||||||
'chown root:root /etc/postfix/master.cf',
|
'chown root:root /etc/postfix/master.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'chown root:root /etc/postfix/sasl/smtpd.conf',
|
'chown root:root /etc/postfix/sasl/smtpd.conf',
|
||||||
'chmod 0644 /etc/postfix/main.cf',
|
'chmod 0644 /etc/postfix/main.cf',
|
||||||
'chmod 0644 /etc/postfix/master.cf',
|
'chmod 0644 /etc/postfix/master.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'chmod 0600 /etc/postfix/sasl/smtpd.conf',
|
'chmod 0600 /etc/postfix/sasl/smtpd.conf',
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
||||||
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
|
'etc_postfix_master.cf' => '/etc/postfix/master.cf',
|
||||||
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
|
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'etc_postfix_sasl_smtpd.conf' => '/etc/postfix/sasl/smtpd.conf'
|
'etc_postfix_sasl_smtpd.conf' => '/etc/postfix/sasl/smtpd.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/postfix restart',
|
'/etc/init.d/postfix restart',
|
||||||
'newaliases'
|
'newaliases'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'exim4' => Array(
|
'exim4' => Array(
|
||||||
'label' => 'Exim4',
|
'label' => 'Exim4',
|
||||||
'commands_1' => Array(
|
'commands_1' => Array(
|
||||||
'dpkg-reconfigure exim4-config',
|
'dpkg-reconfigure exim4-config',
|
||||||
'# choose "no configuration at this time" and "splitted configuration files" in the dialog'
|
'# choose "no configuration at this time" and "splitted configuration files" in the dialog'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt.rul' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul',
|
'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt.rul' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul',
|
||||||
'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config',
|
'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config',
|
||||||
'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options',
|
'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options',
|
||||||
'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config',
|
'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config',
|
||||||
'etc_exim4_conf.d_transport_30_froxlor-config' => '/etc/exim4/conf.d/transport/30_froxlor-config'
|
'etc_exim4_conf.d_transport_30_froxlor-config' => '/etc/exim4/conf.d/transport/30_froxlor-config'
|
||||||
),
|
),
|
||||||
'commands_2' => Array(
|
'commands_2' => Array(
|
||||||
'chmod o-rx /var/lib/exim4',
|
'chmod o-rx /var/lib/exim4',
|
||||||
'chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options'
|
'chmod o-rx /etc/exim4/conf.d/main/10_froxlor-config_options'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/exim4 restart'
|
'/etc/init.d/exim4 restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'mail' => Array(
|
'mail' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['mail'],
|
'label' => $lng['admin']['configfiles']['mail'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'courier' => Array(
|
'courier' => Array(
|
||||||
'label' => 'Courier',
|
'label' => 'Courier',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install courier-pop courier-imap courier-authlib-mysql'
|
'apt-get install courier-pop courier-imap courier-authlib-mysql'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_courier_authdaemonrc' => '/etc/courier/authdaemonrc',
|
'etc_courier_authdaemonrc' => '/etc/courier/authdaemonrc',
|
||||||
'etc_courier_authmysqlrc' => '/etc/courier/authmysqlrc'
|
'etc_courier_authmysqlrc' => '/etc/courier/authmysqlrc'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/courier-authdaemon restart',
|
'/etc/init.d/courier-authdaemon restart',
|
||||||
'/etc/init.d/courier-pop restart'
|
'/etc/init.d/courier-pop restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'dovecot' => Array(
|
'dovecot' => Array(
|
||||||
'label' => 'Dovecot',
|
'label' => 'Dovecot',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install dovecot-imapd dovecot-pop3d'
|
'apt-get install dovecot-imapd dovecot-pop3d'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
|
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
|
||||||
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
|
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/dovecot restart'
|
'/etc/init.d/dovecot restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'ftp' => Array(
|
'ftp' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['ftp'],
|
'label' => $lng['admin']['configfiles']['ftp'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'proftpd' => Array(
|
'proftpd' => Array(
|
||||||
'label' => 'ProFTPd',
|
'label' => 'ProFTPd',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_proftpd_sql.conf' => '/etc/proftpd/sql.conf',
|
'etc_proftpd_sql.conf' => '/etc/proftpd/sql.conf',
|
||||||
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
||||||
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/proftpd restart'
|
'/etc/init.d/proftpd restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'pure-ftpd' => Array(
|
'pure-ftpd' => Array(
|
||||||
'label' => 'Pure FTPd',
|
'label' => 'Pure FTPd',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install pure-ftpd-common pure-ftpd-mysql'
|
'apt-get install pure-ftpd-common pure-ftpd-mysql'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_pure-ftpd_conf_MinUID' => '/etc/pure-ftpd/conf/MinUID',
|
'etc_pure-ftpd_conf_MinUID' => '/etc/pure-ftpd/conf/MinUID',
|
||||||
'etc_pure-ftpd_conf_MySQLConfigFile' => '/etc/pure-ftpd/conf/MySQLConfigFile',
|
'etc_pure-ftpd_conf_MySQLConfigFile' => '/etc/pure-ftpd/conf/MySQLConfigFile',
|
||||||
'etc_pure-ftpd_conf_NoAnonymous' => '/etc/pure-ftpd/conf/NoAnonymous',
|
'etc_pure-ftpd_conf_NoAnonymous' => '/etc/pure-ftpd/conf/NoAnonymous',
|
||||||
'etc_pure-ftpd_conf_MaxIdleTime' => '/etc/pure-ftpd/conf/MaxIdleTime',
|
'etc_pure-ftpd_conf_MaxIdleTime' => '/etc/pure-ftpd/conf/MaxIdleTime',
|
||||||
'etc_pure-ftpd_conf_ChrootEveryone' => '/etc/pure-ftpd/conf/ChrootEveryone',
|
'etc_pure-ftpd_conf_ChrootEveryone' => '/etc/pure-ftpd/conf/ChrootEveryone',
|
||||||
'etc_pure-ftpd_conf_PAMAuthentication' => '/etc/pure-ftpd/conf/PAMAuthentication',
|
'etc_pure-ftpd_conf_PAMAuthentication' => '/etc/pure-ftpd/conf/PAMAuthentication',
|
||||||
'etc_pure-ftpd_db_mysql.conf' => '/etc/pure-ftpd/db/mysql.conf',
|
'etc_pure-ftpd_db_mysql.conf' => '/etc/pure-ftpd/db/mysql.conf',
|
||||||
'etc_pure-ftpd_conf_CustomerProof' => '/etc/pure-ftpd/conf/CustomerProof',
|
'etc_pure-ftpd_conf_CustomerProof' => '/etc/pure-ftpd/conf/CustomerProof',
|
||||||
'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind',
|
'etc_pure-ftpd_conf_Bind' => '/etc/pure-ftpd/conf/Bind',
|
||||||
'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common'
|
'etc_default_pure-ftpd-common' => '/etc/default/pure-ftpd-common'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/pure-ftpd-mysql restart'
|
'/etc/init.d/pure-ftpd-mysql restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'etc' => Array(
|
'etc' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['etc'],
|
'label' => $lng['admin']['configfiles']['etc'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'cron' => Array(
|
'cron' => Array(
|
||||||
'label' => 'Crond (cronscript)',
|
'label' => 'Crond (cronscript)',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
|
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/cron restart'
|
'/etc/init.d/cron restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'xinetd' => Array(
|
'xinetd' => Array(
|
||||||
'label' => 'xinet.d (froxlor updates in realtime)',
|
'label' => 'xinet.d (froxlor updates in realtime)',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install xinetd'
|
'apt-get install xinetd'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
|
'etc_xinet.d_froxlor' => '/etc/xinetd.d/froxlor'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/xinetd restart'
|
'/etc/init.d/xinetd restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'awstats' => Array(
|
'awstats' => Array(
|
||||||
'label' => 'Awstats',
|
'label' => 'Awstats',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
||||||
),
|
),
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'libnss' => Array(
|
'libnss' => Array(
|
||||||
'label' => 'libnss (system login with mysql)',
|
'label' => 'libnss (system login with mysql)',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'apt-get install libnss-mysql nscd',
|
'apt-get install libnss-mysql nscd',
|
||||||
'chmod 600 /etc/nss-mysql.conf /etc/nss-mysql-root.conf'
|
'chmod 600 /etc/nss-mysql.conf /etc/nss-mysql-root.conf'
|
||||||
),
|
),
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_nss-mysql.conf' => '/etc/nss-mysql.conf',
|
'etc_nss-mysql.conf' => '/etc/nss-mysql.conf',
|
||||||
'etc_nss-mysql-root.conf' => '/etc/nss-mysql-root.conf',
|
'etc_nss-mysql-root.conf' => '/etc/nss-mysql-root.conf',
|
||||||
'etc_nsswitch.conf' => '/etc/nsswitch.conf',
|
'etc_nsswitch.conf' => '/etc/nsswitch.conf',
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/nscd restart'
|
'/etc/init.d/nscd restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,157 +1,157 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Configfiles
|
* @package Configfiles
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return Array(
|
return Array(
|
||||||
'suse_linux_10_0' => Array(
|
'suse_linux_10_0' => Array(
|
||||||
'label' => 'SUSE Linux 10.0',
|
'label' => 'SUSE Linux 10.0',
|
||||||
'services' => Array(
|
'services' => Array(
|
||||||
'http' => Array(
|
'http' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['http'],
|
'label' => $lng['admin']['configfiles']['http'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'apache' => Array(
|
'apache' => Array(
|
||||||
'label' => 'Apache',
|
'label' => 'Apache',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
$configcommand['vhost'],
|
$configcommand['vhost'],
|
||||||
$configcommand['diroptions'],
|
$configcommand['diroptions'],
|
||||||
$configcommand['include'],
|
$configcommand['include'],
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory']
|
'mkdir -p ' . $settings['system']['logfiles_directory']
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/apache2 restart'
|
'/etc/init.d/apache2 restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'dns' => Array(
|
'dns' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['dns'],
|
'label' => $lng['admin']['configfiles']['dns'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'bind' => Array(
|
'bind' => Array(
|
||||||
'label' => 'Bind9',
|
'label' => 'Bind9',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/named.conf',
|
'echo "include \"' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf\";" >> /etc/named.conf',
|
||||||
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf'
|
'touch ' . $settings['system']['bindconf_directory'] . 'syscp_bind.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/named restart'
|
'/etc/init.d/named restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'smtp' => Array(
|
'smtp' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['smtp'],
|
'label' => $lng['admin']['configfiles']['smtp'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'postfix' => Array(
|
'postfix' => Array(
|
||||||
'label' => 'Postfix',
|
'label' => 'Postfix',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
||||||
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
|
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'usr_lib_sasl2_smtpd.conf' => '/usr/lib/sasl2/smtpd.conf'
|
'usr_lib_sasl2_smtpd.conf' => '/usr/lib/sasl2/smtpd.conf'
|
||||||
),
|
),
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'touch /usr/lib/sasl2/smtpd.conf',
|
'touch /usr/lib/sasl2/smtpd.conf',
|
||||||
'chmod 660 /etc/postfix/mysql-virtual_alias_maps.cf',
|
'chmod 660 /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'chmod 660 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chmod 660 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chmod 660 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chmod 660 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'chmod 660 /usr/lib/sasl2/smtpd.conf',
|
'chmod 660 /usr/lib/sasl2/smtpd.conf',
|
||||||
'chgrp postfix /etc/postfix/mysql-virtual_alias_maps.cf',
|
'chgrp postfix /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||||
'chgrp postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
'chgrp postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||||
'chgrp postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
'chgrp postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||||
'chgrp postfix /usr/lib/sasl2/smtpd.conf'
|
'chgrp postfix /usr/lib/sasl2/smtpd.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/postfix restart'
|
'/etc/init.d/postfix restart'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'mail' => Array(
|
'mail' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['mail'],
|
'label' => $lng['admin']['configfiles']['mail'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'courier' => Array(
|
'courier' => Array(
|
||||||
'label' => 'Courier',
|
'label' => 'Courier',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_authlib_authdaemonrc' => '/etc/authlib/authdaemonrc',
|
'etc_authlib_authdaemonrc' => '/etc/authlib/authdaemonrc',
|
||||||
'etc_authlib_authmysqlrc' => '/etc/authlib/authmysqlrc'
|
'etc_authlib_authmysqlrc' => '/etc/authlib/authmysqlrc'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/courier-authdaemon restart',
|
'/etc/init.d/courier-authdaemon restart',
|
||||||
'/etc/init.d/courier-pop restart'
|
'/etc/init.d/courier-pop restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'ftp' => Array(
|
'ftp' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['ftp'],
|
'label' => $lng['admin']['configfiles']['ftp'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'proftpd' => Array(
|
'proftpd' => Array(
|
||||||
'label' => 'ProFTPd',
|
'label' => 'ProFTPd',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
||||||
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/proftpd restart'
|
'/etc/init.d/proftpd restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'etc' => Array(
|
'etc' => Array(
|
||||||
'label' => $lng['admin']['configfiles']['etc'],
|
'label' => $lng['admin']['configfiles']['etc'],
|
||||||
'daemons' => Array(
|
'daemons' => Array(
|
||||||
'cron' => Array(
|
'cron' => Array(
|
||||||
'label' => 'Crond (cronscript)',
|
'label' => 'Crond (cronscript)',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
|
'etc_cron.d_froxlor' => '/etc/cron.d/froxlor'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/init.d/cron restart'
|
'/etc/init.d/cron restart'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'awstats' => Array(
|
'awstats' => Array(
|
||||||
'label' => 'Awstats',
|
'label' => 'Awstats',
|
||||||
'files' => Array(
|
'files' => Array(
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
($settings['system']['mod_log_sql'] == 1 ? 'etc_awstats_awstats.model_log_sql.conf.froxlor' : 'etc_awstats_awstats.model.conf.froxlor') => '/etc/awstats/awstats.model.conf.froxlor',
|
||||||
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
($settings['system']['mod_log_sql'] == 1 ? 'etc_cron.d_awstats_log_sql' : 'etc_cron.d_awstats') => '/etc/cron.d/awstats',
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
($settings['system']['webserver'] == 'lighttpd' ? 'etc_lighttpd_froxlor-awstats.conf' : 'etc_apache_vhosts_05_awstats.conf') => ($settings['system']['webserver'] == 'lighttpd' ? '/etc/lighttpd/froxlor-awstats.conf' : '/etc/apache2/sites-enabled/05_awstats.conf')
|
||||||
),
|
),
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
($settings['system']['webserver'] == 'lighttpd' ? 'echo "include \"froxlor-awstats.conf\"" >> /etc/lighttpd/lighttpd.conf' : '')
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
($settings['system']['webserver'] == 'lighttpd' ? '/etc/init.d/lighttpd restart' : '/etc/init.d/apache2 restart')
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,50 +1,50 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Lib
|
* @package Lib
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$configcommand = array();
|
$configcommand = array();
|
||||||
|
|
||||||
if(isConfigDir($settings['system']['apacheconf_vhost']))
|
if(isConfigDir($settings['system']['apacheconf_vhost']))
|
||||||
{
|
{
|
||||||
$configcommand['vhost'] = 'mkdir -p ' . $settings['system']['apacheconf_vhost'];
|
$configcommand['vhost'] = 'mkdir -p ' . $settings['system']['apacheconf_vhost'];
|
||||||
$configcommand['include'] = 'echo -e "\\nInclude ' . makeCorrectDir($settings['system']['apacheconf_vhost']) . '*.conf" >> ' . makeCorrectFile(makeCorrectDir($settings['system']['apacheconf_vhost']) . '/httpd.conf');
|
$configcommand['include'] = 'echo -e "\\nInclude ' . makeCorrectDir($settings['system']['apacheconf_vhost']) . '*.conf" >> ' . makeCorrectFile(makeCorrectDir($settings['system']['apacheconf_vhost']) . '/httpd.conf');
|
||||||
$configcommand['v_inclighty'] = 'echo -e \'\\ninclude_shell "find ' . makeCorrectDir($settings['system']['apacheconf_vhost']) . ' -maxdepth 1 -name \'*.conf\' -exec cat {} \;"\' >> /etc/lighttpd/lighttpd.conf';
|
$configcommand['v_inclighty'] = 'echo -e \'\\ninclude_shell "find ' . makeCorrectDir($settings['system']['apacheconf_vhost']) . ' -maxdepth 1 -name \'*.conf\' -exec cat {} \;"\' >> /etc/lighttpd/lighttpd.conf';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$configcommand['vhost'] = 'touch ' . $settings['system']['apacheconf_vhost'];
|
$configcommand['vhost'] = 'touch ' . $settings['system']['apacheconf_vhost'];
|
||||||
$configcommand['include'] = 'echo -e "\\nInclude ' . $settings['system']['apacheconf_vhost'] . '" >> ' . makeCorrectFile(dirname($settings['system']['apacheconf_vhost']) . '/httpd.conf');
|
$configcommand['include'] = 'echo -e "\\nInclude ' . $settings['system']['apacheconf_vhost'] . '" >> ' . makeCorrectFile(dirname($settings['system']['apacheconf_vhost']) . '/httpd.conf');
|
||||||
$configcommand['v_inclighty'] = 'echo -e \'\\ninclude "' . $settings['system']['apacheconf_vhost'] . '"\' >> /etc/lighttpd/lighttpd.conf';
|
$configcommand['v_inclighty'] = 'echo -e \'\\ninclude "' . $settings['system']['apacheconf_vhost'] . '"\' >> /etc/lighttpd/lighttpd.conf';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isConfigDir($settings['system']['apacheconf_diroptions']))
|
if(isConfigDir($settings['system']['apacheconf_diroptions']))
|
||||||
{
|
{
|
||||||
$configcommand['diroptions'] = 'mkdir -p ' . $settings['system']['apacheconf_diroptions'];
|
$configcommand['diroptions'] = 'mkdir -p ' . $settings['system']['apacheconf_diroptions'];
|
||||||
$configcommand['d_inclighty'] = 'echo -e \'\\ninclude_shell "find ' . makeCorrectDir($settings['system']['apacheconf_diroptions']) . ' -maxdepth 1 -name \'*.conf\' -exec cat {} \;"\' >> /etc/lighttpd/lighttpd.conf';
|
$configcommand['d_inclighty'] = 'echo -e \'\\ninclude_shell "find ' . makeCorrectDir($settings['system']['apacheconf_diroptions']) . ' -maxdepth 1 -name \'*.conf\' -exec cat {} \;"\' >> /etc/lighttpd/lighttpd.conf';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$configcommand['diroptions'] = 'touch ' . $settings['system']['apacheconf_diroptions'];
|
$configcommand['diroptions'] = 'touch ' . $settings['system']['apacheconf_diroptions'];
|
||||||
$configcommand['d_inclighty'] = 'echo -e \'\\ninclude "' . $settings['system']['apacheconf_diroptions'] . '"\' >> /etc/lighttpd/lighttpd.conf';
|
$configcommand['d_inclighty'] = 'echo -e \'\\ninclude "' . $settings['system']['apacheconf_diroptions'] . '"\' >> /etc/lighttpd/lighttpd.conf';
|
||||||
}
|
}
|
||||||
|
|
||||||
$cfgPath = 'lib/configfiles/';
|
$cfgPath = 'lib/configfiles/';
|
||||||
$configfiles = Array();
|
$configfiles = Array();
|
||||||
$configfiles = array_merge(include $cfgPath . 'lenny.inc.php', include $cfgPath . 'etch.inc.php', include $cfgPath . 'hardy.inc.php', include $cfgPath . 'gentoo.inc.php', include $cfgPath . 'suse10.inc.php');
|
$configfiles = array_merge(include $cfgPath . 'lenny.inc.php', include $cfgPath . 'etch.inc.php', include $cfgPath . 'hardy.inc.php', include $cfgPath . 'gentoo.inc.php', include $cfgPath . 'suse10.inc.php');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,193 +1,193 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Cron
|
* @package Cron
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(@php_sapi_name() != 'cli'
|
if(@php_sapi_name() != 'cli'
|
||||||
&& @php_sapi_name() != 'cgi'
|
&& @php_sapi_name() != 'cgi'
|
||||||
&& @php_sapi_name() != 'cgi-fcgi')
|
&& @php_sapi_name() != 'cgi-fcgi')
|
||||||
{
|
{
|
||||||
die('This script will only work in the shell.');
|
die('This script will only work in the shell.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$lockdir = '/var/run/';
|
$lockdir = '/var/run/';
|
||||||
$lockFilename = 'froxlor_' . basename($_SERVER['PHP_SELF'], '.php') . '.lock-';
|
$lockFilename = 'froxlor_' . basename($_SERVER['PHP_SELF'], '.php') . '.lock-';
|
||||||
$lockfName = $lockFilename . getmypid();
|
$lockfName = $lockFilename . getmypid();
|
||||||
$lockfile = $lockdir . $lockfName;
|
$lockfile = $lockdir . $lockfName;
|
||||||
|
|
||||||
// guess the froxlor installation path
|
// guess the froxlor installation path
|
||||||
// normally you should not need to modify this script anymore, if your
|
// normally you should not need to modify this script anymore, if your
|
||||||
// froxlor installation isn't in /var/www/froxlor
|
// froxlor installation isn't in /var/www/froxlor
|
||||||
|
|
||||||
$pathtophpfiles = dirname(dirname(__FILE__));
|
$pathtophpfiles = dirname(dirname(__FILE__));
|
||||||
|
|
||||||
// should the froxlor installation guessing not work correctly,
|
// should the froxlor installation guessing not work correctly,
|
||||||
// uncomment the following line, and put your path in there!
|
// uncomment the following line, and put your path in there!
|
||||||
//$pathtophpfiles = '/var/www/froxlor/';
|
//$pathtophpfiles = '/var/www/froxlor/';
|
||||||
// create and open the lockfile!
|
// create and open the lockfile!
|
||||||
|
|
||||||
$keepLockFile = false;
|
$keepLockFile = false;
|
||||||
$debugHandler = fopen($lockfile, 'w');
|
$debugHandler = fopen($lockfile, 'w');
|
||||||
fwrite($debugHandler, 'Setting Lockfile to ' . $lockfile . "\n");
|
fwrite($debugHandler, 'Setting Lockfile to ' . $lockfile . "\n");
|
||||||
fwrite($debugHandler, 'Setting Froxlor installation path to ' . $pathtophpfiles . "\n");
|
fwrite($debugHandler, 'Setting Froxlor installation path to ' . $pathtophpfiles . "\n");
|
||||||
|
|
||||||
// open the lockfile directory and scan for existing lockfiles
|
// open the lockfile directory and scan for existing lockfiles
|
||||||
|
|
||||||
$lockDirHandle = opendir($lockdir);
|
$lockDirHandle = opendir($lockdir);
|
||||||
|
|
||||||
while($fName = readdir($lockDirHandle))
|
while($fName = readdir($lockDirHandle))
|
||||||
{
|
{
|
||||||
if($lockFilename == substr($fName, 0, strlen($lockFilename))
|
if($lockFilename == substr($fName, 0, strlen($lockFilename))
|
||||||
&& $lockfName != $fName)
|
&& $lockfName != $fName)
|
||||||
{
|
{
|
||||||
// Check if last run jailed out with an exception
|
// Check if last run jailed out with an exception
|
||||||
|
|
||||||
$croncontent = file($lockdir . $fName);
|
$croncontent = file($lockdir . $fName);
|
||||||
$lastline = $croncontent[(count($croncontent) - 1)];
|
$lastline = $croncontent[(count($croncontent) - 1)];
|
||||||
|
|
||||||
if($lastline == '=== Keep lockfile because of exception ===')
|
if($lastline == '=== Keep lockfile because of exception ===')
|
||||||
{
|
{
|
||||||
fclose($debugHandler);
|
fclose($debugHandler);
|
||||||
unlink($lockfile);
|
unlink($lockfile);
|
||||||
die('Last cron jailed out with an exception. Exiting...' . "\n" . 'Take a look into the contents of ' . $lockdir . $fName . '* for more information!' . "\n");
|
die('Last cron jailed out with an exception. Exiting...' . "\n" . 'Take a look into the contents of ' . $lockdir . $fName . '* for more information!' . "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if cron is running or has died.
|
// Check if cron is running or has died.
|
||||||
|
|
||||||
$check_pid = substr(strstr($fName, "-"), 1);
|
$check_pid = substr(strstr($fName, "-"), 1);
|
||||||
system("kill -CHLD " . $check_pid . " 1> /dev/null 2> /dev/null", $check_pid_return);
|
system("kill -CHLD " . $check_pid . " 1> /dev/null 2> /dev/null", $check_pid_return);
|
||||||
|
|
||||||
if($check_pid_return == 1)
|
if($check_pid_return == 1)
|
||||||
{
|
{
|
||||||
// Result: Existing lockfile/pid isnt running
|
// Result: Existing lockfile/pid isnt running
|
||||||
// Most likely it has died
|
// Most likely it has died
|
||||||
//
|
//
|
||||||
// Action: Remove it and continue
|
// Action: Remove it and continue
|
||||||
//
|
//
|
||||||
|
|
||||||
fwrite($debugHandler, 'Previous cronjob didn\'t exit clean. PID: ' . $check_pid . "\n");
|
fwrite($debugHandler, 'Previous cronjob didn\'t exit clean. PID: ' . $check_pid . "\n");
|
||||||
fwrite($debugHandler, 'Removing lockfile: ' . $lockdir . $fName . "\n");
|
fwrite($debugHandler, 'Removing lockfile: ' . $lockdir . $fName . "\n");
|
||||||
unlink($lockdir . $fName);
|
unlink($lockdir . $fName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Result: A Cronscript with this pid
|
// Result: A Cronscript with this pid
|
||||||
// is still running
|
// is still running
|
||||||
// Action: remove my own Lock and die
|
// Action: remove my own Lock and die
|
||||||
//
|
//
|
||||||
// close the current lockfile
|
// close the current lockfile
|
||||||
|
|
||||||
fclose($debugHandler);
|
fclose($debugHandler);
|
||||||
|
|
||||||
// ... and delete it
|
// ... and delete it
|
||||||
|
|
||||||
unlink($lockfile);
|
unlink($lockfile);
|
||||||
die('There is already a Cronjob in progress. Exiting...' . "\n" . 'Take a look into the contents of ' . $lockdir . $lockFilename . '* for more information!' . "\n");
|
die('There is already a Cronjob in progress. Exiting...' . "\n" . 'Take a look into the contents of ' . $lockdir . $lockFilename . '* for more information!' . "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Includes the Usersettings eg. MySQL-Username/Passwort etc.
|
* Includes the Usersettings eg. MySQL-Username/Passwort etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ($pathtophpfiles . '/lib/userdata.inc.php');
|
require ($pathtophpfiles . '/lib/userdata.inc.php');
|
||||||
fwrite($debugHandler, 'Userdatas included' . "\n");
|
fwrite($debugHandler, 'Userdatas included' . "\n");
|
||||||
|
|
||||||
// Legacy sql-root-information
|
// Legacy sql-root-information
|
||||||
if(isset($sql['root_user']) && isset($sql['root_password']) && (!isset($sql_root) || !is_array($sql_root)))
|
if(isset($sql['root_user']) && isset($sql['root_password']) && (!isset($sql_root) || !is_array($sql_root)))
|
||||||
{
|
{
|
||||||
$sql_root = array(0 => array('caption' => 'Default', 'host' => $sql['host'], 'user' => $sql['root_user'], 'password' => $sql['root_password']));
|
$sql_root = array(0 => array('caption' => 'Default', 'host' => $sql['host'], 'user' => $sql['root_user'], 'password' => $sql['root_password']));
|
||||||
unset($sql['root_user']);
|
unset($sql['root_user']);
|
||||||
unset($sql['root_password']);
|
unset($sql['root_password']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Includes the Functions
|
* Includes the Functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ($pathtophpfiles . '/lib/functions.php');
|
require ($pathtophpfiles . '/lib/functions.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Includes the MySQL-Tabledefinitions etc.
|
* Includes the MySQL-Tabledefinitions etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ($pathtophpfiles . '/lib/tables.inc.php');
|
require ($pathtophpfiles . '/lib/tables.inc.php');
|
||||||
fwrite($debugHandler, 'Table definitions included' . "\n");
|
fwrite($debugHandler, 'Table definitions included' . "\n");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Includes the MySQL-Connection-Class
|
* Includes the MySQL-Connection-Class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fwrite($debugHandler, 'Database Class has been loaded' . "\n");
|
fwrite($debugHandler, 'Database Class has been loaded' . "\n");
|
||||||
$db = new db($sql['host'], $sql['user'], $sql['password'], $sql['db']);
|
$db = new db($sql['host'], $sql['user'], $sql['password'], $sql['db']);
|
||||||
|
|
||||||
if($db->link_id == 0)
|
if($db->link_id == 0)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Do not proceed further if no database connection could be established
|
* Do not proceed further if no database connection could be established
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fclose($debugHandler);
|
fclose($debugHandler);
|
||||||
unlink($lockfile);
|
unlink($lockfile);
|
||||||
die('Froxlor can\'t connect to mysqlserver. Please check userdata.inc.php! Exiting...');
|
die('Froxlor can\'t connect to mysqlserver. Please check userdata.inc.php! Exiting...');
|
||||||
}
|
}
|
||||||
|
|
||||||
fwrite($debugHandler, 'Database-connection established' . "\n");
|
fwrite($debugHandler, 'Database-connection established' . "\n");
|
||||||
unset($sql);
|
unset($sql);
|
||||||
unset($db->password);
|
unset($db->password);
|
||||||
$result = $db->query("SELECT `settingid`, `settinggroup`, `varname`, `value` FROM `" . TABLE_PANEL_SETTINGS . "`");
|
$result = $db->query("SELECT `settingid`, `settinggroup`, `varname`, `value` FROM `" . TABLE_PANEL_SETTINGS . "`");
|
||||||
|
|
||||||
while($row = $db->fetch_array($result))
|
while($row = $db->fetch_array($result))
|
||||||
{
|
{
|
||||||
$settings[$row['settinggroup']][$row['varname']] = $row['value'];
|
$settings[$row['settinggroup']][$row['varname']] = $row['value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($row);
|
unset($row);
|
||||||
unset($result);
|
unset($result);
|
||||||
fwrite($debugHandler, 'Froxlor Settings has been loaded from the database' . "\n");
|
fwrite($debugHandler, 'Froxlor Settings has been loaded from the database' . "\n");
|
||||||
|
|
||||||
if(!isset($settings['panel']['version'])
|
if(!isset($settings['panel']['version'])
|
||||||
|| $settings['panel']['version'] != $version)
|
|| $settings['panel']['version'] != $version)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Do not proceed further if the Database version is not the same as the script version
|
* Do not proceed further if the Database version is not the same as the script version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fclose($debugHandler);
|
fclose($debugHandler);
|
||||||
unlink($lockfile);
|
unlink($lockfile);
|
||||||
die('Version of File doesnt match Version of Database. Exiting...');
|
die('Version of File doesnt match Version of Database. Exiting...');
|
||||||
}
|
}
|
||||||
|
|
||||||
fwrite($debugHandler, 'Froxlor Version and Database Version are correct' . "\n");
|
fwrite($debugHandler, 'Froxlor Version and Database Version are correct' . "\n");
|
||||||
|
|
||||||
$cronscriptDebug = ($settings['system']['debug_cron'] == '1') ? true : false;
|
$cronscriptDebug = ($settings['system']['debug_cron'] == '1') ? true : false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new idna converter
|
* Create a new idna converter
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$idna_convert = new idna_convert_wrapper();
|
$idna_convert = new idna_convert_wrapper();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize logging
|
* Initialize logging
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$cronlog = FroxlorLogger::getInstanceOf(array('loginname' => 'cronjob'), $db, $settings);
|
$cronlog = FroxlorLogger::getInstanceOf(array('loginname' => 'cronjob'), $db, $settings);
|
||||||
fwrite($debugHandler, 'Logger has been included' . "\n");
|
fwrite($debugHandler, 'Logger has been included' . "\n");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,47 +1,47 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Cron
|
* @package Cron
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if($settings['logger']['log_cron'] == '1')
|
if($settings['logger']['log_cron'] == '1')
|
||||||
{
|
{
|
||||||
$cronlog->setCronLog(0);
|
$cronlog->setCronLog(0);
|
||||||
fwrite($debugHandler, 'Logging for cron has been shutdown' . "\n");
|
fwrite($debugHandler, 'Logging for cron has been shutdown' . "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
fwrite($debugHandler, 'Closing database connection' . "\n");
|
fwrite($debugHandler, 'Closing database connection' . "\n");
|
||||||
|
|
||||||
if(isset($db_root))
|
if(isset($db_root))
|
||||||
{
|
{
|
||||||
$db_root->close();
|
$db_root->close();
|
||||||
fwrite($debugHandler, 'Closing database rootconnection' . "\n");
|
fwrite($debugHandler, 'Closing database rootconnection' . "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if($keepLockFile === true)
|
if($keepLockFile === true)
|
||||||
{
|
{
|
||||||
fwrite($debugHandler, '=== Keep lockfile because of exception ===');
|
fwrite($debugHandler, '=== Keep lockfile because of exception ===');
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose($debugHandler);
|
fclose($debugHandler);
|
||||||
|
|
||||||
if($keepLockFile === false
|
if($keepLockFile === false
|
||||||
&& $cronscriptDebug === false)
|
&& $cronscriptDebug === false)
|
||||||
{
|
{
|
||||||
unlink($lockfile);
|
unlink($lockfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,78 +1,78 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$libdirname = dirname(__FILE__);
|
$libdirname = dirname(__FILE__);
|
||||||
|
|
||||||
includeFunctions($libdirname . '/functions/');
|
includeFunctions($libdirname . '/functions/');
|
||||||
|
|
||||||
function includeFunctions($dirname)
|
function includeFunctions($dirname)
|
||||||
{
|
{
|
||||||
$dirhandle = opendir($dirname);
|
$dirhandle = opendir($dirname);
|
||||||
while(false !== ($filename = readdir($dirhandle)))
|
while(false !== ($filename = readdir($dirhandle)))
|
||||||
{
|
{
|
||||||
if($filename != '.' && $filename != '..' && $filename != '')
|
if($filename != '.' && $filename != '..' && $filename != '')
|
||||||
{
|
{
|
||||||
if((substr($filename, 0, 9) == 'function.' || substr($filename, 0, 9) == 'constant.') && substr($filename, -4 ) == '.php')
|
if((substr($filename, 0, 9) == 'function.' || substr($filename, 0, 9) == 'constant.') && substr($filename, -4 ) == '.php')
|
||||||
{
|
{
|
||||||
include($dirname . $filename);
|
include($dirname . $filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_dir($dirname . $filename))
|
if(is_dir($dirname . $filename))
|
||||||
{
|
{
|
||||||
includeFunctions($dirname . $filename . '/');
|
includeFunctions($dirname . $filename . '/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($dirhandle);
|
closedir($dirhandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
function __autoload($classname)
|
function __autoload($classname)
|
||||||
{
|
{
|
||||||
global $libdirname;
|
global $libdirname;
|
||||||
findIncludeClass($libdirname . '/classes/', $classname);
|
findIncludeClass($libdirname . '/classes/', $classname);
|
||||||
}
|
}
|
||||||
|
|
||||||
function findIncludeClass($dirname, $classname)
|
function findIncludeClass($dirname, $classname)
|
||||||
{
|
{
|
||||||
$dirhandle = opendir($dirname);
|
$dirhandle = opendir($dirname);
|
||||||
while(false !== ($filename = readdir($dirhandle)))
|
while(false !== ($filename = readdir($dirhandle)))
|
||||||
{
|
{
|
||||||
if($filename != '.' && $filename != '..' && $filename != '')
|
if($filename != '.' && $filename != '..' && $filename != '')
|
||||||
{
|
{
|
||||||
if($filename == 'class.' . $classname . '.php' || $filename == 'abstract.' . $classname . '.php')
|
if($filename == 'class.' . $classname . '.php' || $filename == 'abstract.' . $classname . '.php')
|
||||||
{
|
{
|
||||||
include($dirname . $filename);
|
include($dirname . $filename);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_dir($dirname . $filename))
|
if(is_dir($dirname . $filename))
|
||||||
{
|
{
|
||||||
findIncludeClass($dirname . $filename . '/', $classname);
|
findIncludeClass($dirname . $filename . '/', $classname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($dirhandle);
|
closedir($dirhandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function exportDetails($fielddata, $newfieldvalue)
|
function exportDetails($fielddata, $newfieldvalue)
|
||||||
{
|
{
|
||||||
print_r($newfieldvalue);
|
print_r($newfieldvalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,44 +1,44 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function storeSettingApsPhpExtensions($fieldname, $fielddata, $newfieldvalue)
|
function storeSettingApsPhpExtensions($fieldname, $fielddata, $newfieldvalue)
|
||||||
{
|
{
|
||||||
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
||||||
|
|
||||||
if($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'aps' && isset($fielddata['varname']) && $fielddata['varname'] == 'php-extension')
|
if($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'aps' && isset($fielddata['varname']) && $fielddata['varname'] == 'php-extension')
|
||||||
{
|
{
|
||||||
$newfieldvalue_array = explode(',', $newfieldvalue);
|
$newfieldvalue_array = explode(',', $newfieldvalue);
|
||||||
|
|
||||||
if(in_array('mcrypt', $newfieldvalue_array))
|
if(in_array('mcrypt', $newfieldvalue_array))
|
||||||
{
|
{
|
||||||
$functions = 'mcrypt_encrypt,mcrypt_decrypt';
|
$functions = 'mcrypt_encrypt,mcrypt_decrypt';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$functions = '';
|
$functions = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($functions != getSetting('aps', 'php-function'))
|
if($functions != getSetting('aps', 'php-function'))
|
||||||
{
|
{
|
||||||
saveSetting('aps', 'php-function', $functions);
|
saveSetting('aps', 'php-function', $functions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,48 +1,48 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function storeSettingApsWebserverModules($fieldname, $fielddata, $newfieldvalue)
|
function storeSettingApsWebserverModules($fieldname, $fielddata, $newfieldvalue)
|
||||||
{
|
{
|
||||||
if(is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'aps' && isset($fielddata['varname']) && $fielddata['varname'] == 'webserver-module')
|
if(is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'aps' && isset($fielddata['varname']) && $fielddata['varname'] == 'webserver-module')
|
||||||
{
|
{
|
||||||
$newfieldvalue_array = explode(',', $newfieldvalue);
|
$newfieldvalue_array = explode(',', $newfieldvalue);
|
||||||
|
|
||||||
if(in_array('mod_rewrite', $newfieldvalue_array))
|
if(in_array('mod_rewrite', $newfieldvalue_array))
|
||||||
{
|
{
|
||||||
// Don't have to guess if we have to remove the leading comma as mod_rewrite is set anyways when we're here...
|
// Don't have to guess if we have to remove the leading comma as mod_rewrite is set anyways when we're here...
|
||||||
$newfieldvalue .= ',mod_rewrite.c';
|
$newfieldvalue .= ',mod_rewrite.c';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(in_array('htaccess', $newfieldvalue_array))
|
if(in_array('htaccess', $newfieldvalue_array))
|
||||||
{
|
{
|
||||||
$htaccess = 'htaccess';
|
$htaccess = 'htaccess';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$htaccess = '';
|
$htaccess = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($htaccess != getSetting('aps', 'webserver-htaccess'))
|
if($htaccess != getSetting('aps', 'webserver-htaccess'))
|
||||||
{
|
{
|
||||||
saveSetting('aps', 'webserver-htaccess', $htaccess);
|
saveSetting('aps', 'webserver-htaccess', $htaccess);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
return storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,66 +1,66 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(!function_exists('sys_get_temp_dir'))
|
if(!function_exists('sys_get_temp_dir'))
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* function will return the temporary directory where we can write data
|
* function will return the temporary directory where we can write data
|
||||||
* function exists as a fallback for php versions lower than 5.2.1
|
* function exists as a fallback for php versions lower than 5.2.1
|
||||||
* source copied from php.net
|
* source copied from php.net
|
||||||
*
|
*
|
||||||
* @author Sven Skrabal <info@nexpa.de>
|
* @author Sven Skrabal <info@nexpa.de>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function sys_get_temp_dir()
|
function sys_get_temp_dir()
|
||||||
{
|
{
|
||||||
// Try to get from environment variable
|
// Try to get from environment variable
|
||||||
|
|
||||||
if(!empty($_ENV['TMP']))
|
if(!empty($_ENV['TMP']))
|
||||||
{
|
{
|
||||||
return realpath($_ENV['TMP']);
|
return realpath($_ENV['TMP']);
|
||||||
}
|
}
|
||||||
elseif(!empty($_ENV['TMPDIR']))
|
elseif(!empty($_ENV['TMPDIR']))
|
||||||
{
|
{
|
||||||
return realpath($_ENV['TMPDIR']);
|
return realpath($_ENV['TMPDIR']);
|
||||||
}
|
}
|
||||||
elseif(!empty($_ENV['TEMP']))
|
elseif(!empty($_ENV['TEMP']))
|
||||||
{
|
{
|
||||||
return realpath($_ENV['TEMP']);
|
return realpath($_ENV['TEMP']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Detect by creating a temporary file
|
// Detect by creating a temporary file
|
||||||
// Try to use system's temporary directory
|
// Try to use system's temporary directory
|
||||||
// as random name shouldn't exist
|
// as random name shouldn't exist
|
||||||
|
|
||||||
$temp_file = tempnam(md5(uniqid(rand(), true)), '');
|
$temp_file = tempnam(md5(uniqid(rand(), true)), '');
|
||||||
|
|
||||||
if($temp_file)
|
if($temp_file)
|
||||||
{
|
{
|
||||||
$temp_dir = realpath(dirname($temp_file));
|
$temp_dir = realpath(dirname($temp_file));
|
||||||
unlink($temp_file);
|
unlink($temp_file);
|
||||||
return $temp_dir;
|
return $temp_dir;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,91 +1,91 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function correctMysqlUsers($mysql_access_host_array)
|
function correctMysqlUsers($mysql_access_host_array)
|
||||||
{
|
{
|
||||||
global $db, $settings, $sql, $sql_root;
|
global $db, $settings, $sql, $sql_root;
|
||||||
|
|
||||||
foreach($sql_root as $mysql_server => $mysql_server_details)
|
foreach($sql_root as $mysql_server => $mysql_server_details)
|
||||||
{
|
{
|
||||||
$db_root = new db($mysql_server_details['host'], $mysql_server_details['user'], $mysql_server_details['password'], '');
|
$db_root = new db($mysql_server_details['host'], $mysql_server_details['user'], $mysql_server_details['password'], '');
|
||||||
unset($db_root->password);
|
unset($db_root->password);
|
||||||
|
|
||||||
$users = array();
|
$users = array();
|
||||||
$users_result = $db_root->query('SELECT * FROM `mysql`.`user`');
|
$users_result = $db_root->query('SELECT * FROM `mysql`.`user`');
|
||||||
|
|
||||||
while($users_row = $db_root->fetch_array($users_result))
|
while($users_row = $db_root->fetch_array($users_result))
|
||||||
{
|
{
|
||||||
if(!isset($users[$users_row['User']])
|
if(!isset($users[$users_row['User']])
|
||||||
|| !is_array($users[$users_row['User']]))
|
|| !is_array($users[$users_row['User']]))
|
||||||
{
|
{
|
||||||
$users[$users_row['User']] = array(
|
$users[$users_row['User']] = array(
|
||||||
'password' => $users_row['Password'],
|
'password' => $users_row['Password'],
|
||||||
'hosts' => array()
|
'hosts' => array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$users[$users_row['User']]['hosts'][] = $users_row['Host'];
|
$users[$users_row['User']]['hosts'][] = $users_row['Host'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$databases = array(
|
$databases = array(
|
||||||
$sql['db']
|
$sql['db']
|
||||||
);
|
);
|
||||||
$databases_result = $db->query('SELECT * FROM `' . TABLE_PANEL_DATABASES . '` WHERE `dbserver` = \'' . $mysql_server . '\'');
|
$databases_result = $db->query('SELECT * FROM `' . TABLE_PANEL_DATABASES . '` WHERE `dbserver` = \'' . $mysql_server . '\'');
|
||||||
|
|
||||||
while($databases_row = $db->fetch_array($databases_result))
|
while($databases_row = $db->fetch_array($databases_result))
|
||||||
{
|
{
|
||||||
$databases[] = $databases_row['databasename'];
|
$databases[] = $databases_row['databasename'];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($databases as $username)
|
foreach($databases as $username)
|
||||||
{
|
{
|
||||||
if(isset($users[$username])
|
if(isset($users[$username])
|
||||||
&& is_array($users[$username])
|
&& is_array($users[$username])
|
||||||
&& isset($users[$username]['hosts'])
|
&& isset($users[$username]['hosts'])
|
||||||
&& is_array($users[$username]['hosts']))
|
&& is_array($users[$username]['hosts']))
|
||||||
{
|
{
|
||||||
$password = $users[$username]['password'];
|
$password = $users[$username]['password'];
|
||||||
foreach($mysql_access_host_array as $mysql_access_host)
|
foreach($mysql_access_host_array as $mysql_access_host)
|
||||||
{
|
{
|
||||||
$mysql_access_host = trim($mysql_access_host);
|
$mysql_access_host = trim($mysql_access_host);
|
||||||
|
|
||||||
if(!in_array($mysql_access_host, $users[$username]['hosts']))
|
if(!in_array($mysql_access_host, $users[$username]['hosts']))
|
||||||
{
|
{
|
||||||
$db_root->query('GRANT ALL PRIVILEGES ON `' . str_replace('_', '\_', $db_root->escape($username)) . '`.* TO `' . $db_root->escape($username) . '`@`' . $db_root->escape($mysql_access_host) . '` IDENTIFIED BY \'password\'');
|
$db_root->query('GRANT ALL PRIVILEGES ON `' . str_replace('_', '\_', $db_root->escape($username)) . '`.* TO `' . $db_root->escape($username) . '`@`' . $db_root->escape($mysql_access_host) . '` IDENTIFIED BY \'password\'');
|
||||||
$db_root->query('SET PASSWORD FOR `' . $db_root->escape($username) . '`@`' . $db_root->escape($mysql_access_host) . '` = \'' . $db_root->escape($password) . '\'');
|
$db_root->query('SET PASSWORD FOR `' . $db_root->escape($username) . '`@`' . $db_root->escape($mysql_access_host) . '` = \'' . $db_root->escape($password) . '\'');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($users[$username]['hosts'] as $mysql_access_host)
|
foreach($users[$username]['hosts'] as $mysql_access_host)
|
||||||
{
|
{
|
||||||
if(!in_array($mysql_access_host, $mysql_access_host_array))
|
if(!in_array($mysql_access_host, $mysql_access_host_array))
|
||||||
{
|
{
|
||||||
$db_root->query('REVOKE ALL PRIVILEGES ON * . * FROM `' . $db_root->escape($username) . '`@`' . $db_root->escape($mysql_access_host) . '`');
|
$db_root->query('REVOKE ALL PRIVILEGES ON * . * FROM `' . $db_root->escape($username) . '`@`' . $db_root->escape($mysql_access_host) . '`');
|
||||||
$db_root->query('REVOKE ALL PRIVILEGES ON `' . str_replace('_', '\_', $db_root->escape($username)) . '` . * FROM `' . $db_root->escape($username) . '`@`' . $db_root->escape($mysql_access_host) . '`');
|
$db_root->query('REVOKE ALL PRIVILEGES ON `' . str_replace('_', '\_', $db_root->escape($username)) . '` . * FROM `' . $db_root->escape($username) . '`@`' . $db_root->escape($mysql_access_host) . '`');
|
||||||
$db_root->query('DELETE FROM `mysql`.`user` WHERE `User` = "' . $db_root->escape($username) . '" AND `Host` = "' . $db_root->escape($mysql_access_host) . '"');
|
$db_root->query('DELETE FROM `mysql`.`user` WHERE `User` = "' . $db_root->escape($username) . '" AND `Host` = "' . $db_root->escape($mysql_access_host) . '"');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$db_root->query('FLUSH PRIVILEGES');
|
$db_root->query('FLUSH PRIVILEGES');
|
||||||
$db_root->close();
|
$db_root->close();
|
||||||
unset($db_root);
|
unset($db_root);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,122 +1,122 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array with all tables with keys which are in the currently selected database
|
* Returns an array with all tables with keys which are in the currently selected database
|
||||||
*
|
*
|
||||||
* @param db A valid DB-object
|
* @param db A valid DB-object
|
||||||
* @return array Array with tables and keys
|
* @return array Array with tables and keys
|
||||||
*
|
*
|
||||||
* @author Florian Lippert <flo@syscp.org>
|
* @author Florian Lippert <flo@syscp.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getTables(&$db)
|
function getTables(&$db)
|
||||||
{
|
{
|
||||||
// This variable is our return-value
|
// This variable is our return-value
|
||||||
|
|
||||||
$tables = array();
|
$tables = array();
|
||||||
|
|
||||||
// The fieldname in the associative array which we get by fetch_array()
|
// The fieldname in the associative array which we get by fetch_array()
|
||||||
|
|
||||||
$tablefieldname = 'Tables_in_' . $db->database;
|
$tablefieldname = 'Tables_in_' . $db->database;
|
||||||
|
|
||||||
// Query for a list of tables in the currently selected database
|
// Query for a list of tables in the currently selected database
|
||||||
|
|
||||||
$tables_result = $db->query('SHOW TABLES');
|
$tables_result = $db->query('SHOW TABLES');
|
||||||
|
|
||||||
while($tables_row = $db->fetch_array($tables_result))
|
while($tables_row = $db->fetch_array($tables_result))
|
||||||
{
|
{
|
||||||
// Extract tablename
|
// Extract tablename
|
||||||
|
|
||||||
$tablename = $tables_row[$tablefieldname];
|
$tablename = $tables_row[$tablefieldname];
|
||||||
|
|
||||||
// Create sub-array with key tablename
|
// Create sub-array with key tablename
|
||||||
|
|
||||||
$tables[$tablename] = array();
|
$tables[$tablename] = array();
|
||||||
|
|
||||||
// Query for a list of indexes of the currently selected table
|
// Query for a list of indexes of the currently selected table
|
||||||
|
|
||||||
$keys_result = $db->query('SHOW INDEX FROM ' . $tablename);
|
$keys_result = $db->query('SHOW INDEX FROM ' . $tablename);
|
||||||
|
|
||||||
while($keys_row = $db->fetch_array($keys_result))
|
while($keys_row = $db->fetch_array($keys_result))
|
||||||
{
|
{
|
||||||
// Extract keyname
|
// Extract keyname
|
||||||
|
|
||||||
$keyname = $keys_row['Key_name'];
|
$keyname = $keys_row['Key_name'];
|
||||||
|
|
||||||
// If there is aleady a key in our tablename-sub-array with has the same name as our key
|
// If there is aleady a key in our tablename-sub-array with has the same name as our key
|
||||||
// OR if the sequence is not one
|
// OR if the sequence is not one
|
||||||
// then we have more then index-columns for our keyname
|
// then we have more then index-columns for our keyname
|
||||||
|
|
||||||
if((isset($tables[$tablename][$keyname]) && $tables[$tablename][$keyname] != '')
|
if((isset($tables[$tablename][$keyname]) && $tables[$tablename][$keyname] != '')
|
||||||
|| $keys_row['Seq_in_index'] != '1')
|
|| $keys_row['Seq_in_index'] != '1')
|
||||||
{
|
{
|
||||||
// If there is no keyname in the tablename-sub-array set ...
|
// If there is no keyname in the tablename-sub-array set ...
|
||||||
|
|
||||||
if(!isset($tables[$tablename][$keyname]))
|
if(!isset($tables[$tablename][$keyname]))
|
||||||
{
|
{
|
||||||
// ... then create one
|
// ... then create one
|
||||||
|
|
||||||
$tables[$tablename][$keyname] = array();
|
$tables[$tablename][$keyname] = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the keyname-sub-array isn't an array ...
|
// If the keyname-sub-array isn't an array ...
|
||||||
|
|
||||||
elseif (!is_array($tables[$tablename][$keyname]))
|
elseif (!is_array($tables[$tablename][$keyname]))
|
||||||
{
|
{
|
||||||
// temporary move columname
|
// temporary move columname
|
||||||
|
|
||||||
$tmpkeyvalue = $tables[$tablename][$keyname];
|
$tmpkeyvalue = $tables[$tablename][$keyname];
|
||||||
|
|
||||||
// unset keyname-key
|
// unset keyname-key
|
||||||
|
|
||||||
unset($tables[$tablename][$keyname]);
|
unset($tables[$tablename][$keyname]);
|
||||||
|
|
||||||
// create new array for keyname-key
|
// create new array for keyname-key
|
||||||
|
|
||||||
$tables[$tablename][$keyname] = array();
|
$tables[$tablename][$keyname] = array();
|
||||||
|
|
||||||
// keyindex will be 1 by default, if seq is also 1 we'd better use 0 (this case shouldn't ever occur)
|
// keyindex will be 1 by default, if seq is also 1 we'd better use 0 (this case shouldn't ever occur)
|
||||||
|
|
||||||
$keyindex = ($keys_row['Seq_in_index'] == '1') ? '0' : '1';
|
$keyindex = ($keys_row['Seq_in_index'] == '1') ? '0' : '1';
|
||||||
|
|
||||||
// then move back our tmp columname from above
|
// then move back our tmp columname from above
|
||||||
|
|
||||||
$tables[$tablename][$keyname][$keyindex] = $tmpkeyvalue;
|
$tables[$tablename][$keyname][$keyindex] = $tmpkeyvalue;
|
||||||
|
|
||||||
// end unset the variable afterwards
|
// end unset the variable afterwards
|
||||||
|
|
||||||
unset($tmpkeyvalue);
|
unset($tmpkeyvalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set columname
|
// set columname
|
||||||
|
|
||||||
$tables[$tablename][$keyname][$keys_row['Seq_in_index']] = $keys_row['Column_name'];
|
$tables[$tablename][$keyname][$keys_row['Seq_in_index']] = $keys_row['Column_name'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// set columname
|
// set columname
|
||||||
|
|
||||||
$tables[$tablename][$keyname] = $keys_row['Column_name'];
|
$tables[$tablename][$keyname] = $keys_row['Column_name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tables;
|
return $tables;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,55 +1,55 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//
|
//
|
||||||
// remove_remarks will strip the sql comment lines out of an uploaded sql file
|
// remove_remarks will strip the sql comment lines out of an uploaded sql file
|
||||||
// The whole function has been taken from the phpbb installer, copyright by the phpbb team, phpbb in summer 2004.
|
// The whole function has been taken from the phpbb installer, copyright by the phpbb team, phpbb in summer 2004.
|
||||||
//
|
//
|
||||||
|
|
||||||
function remove_remarks($sql)
|
function remove_remarks($sql)
|
||||||
{
|
{
|
||||||
$lines = explode("\n", $sql);
|
$lines = explode("\n", $sql);
|
||||||
|
|
||||||
// try to keep mem. use down
|
// try to keep mem. use down
|
||||||
|
|
||||||
$sql = "";
|
$sql = "";
|
||||||
$linecount = count($lines);
|
$linecount = count($lines);
|
||||||
$output = "";
|
$output = "";
|
||||||
for ($i = 0;$i < $linecount;$i++)
|
for ($i = 0;$i < $linecount;$i++)
|
||||||
{
|
{
|
||||||
if(($i != ($linecount - 1))
|
if(($i != ($linecount - 1))
|
||||||
|| (strlen($lines[$i]) > 0))
|
|| (strlen($lines[$i]) > 0))
|
||||||
{
|
{
|
||||||
if(substr($lines[$i], 0, 1) != "#")
|
if(substr($lines[$i], 0, 1) != "#")
|
||||||
{
|
{
|
||||||
$output.= $lines[$i] . "\n";
|
$output.= $lines[$i] . "\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$output.= "\n";
|
$output.= "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trading a bit of speed for lower mem. use here.
|
// Trading a bit of speed for lower mem. use here.
|
||||||
|
|
||||||
$lines[$i] = "";
|
$lines[$i] = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,140 +1,140 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//
|
//
|
||||||
// split_sql_file will split an uploaded sql file into single sql statements.
|
// split_sql_file will split an uploaded sql file into single sql statements.
|
||||||
// Note: expects trim() to have already been run on $sql
|
// Note: expects trim() to have already been run on $sql
|
||||||
// The whole function has been taken from the phpbb installer, copyright by the phpbb team, phpbb in summer 2004.
|
// The whole function has been taken from the phpbb installer, copyright by the phpbb team, phpbb in summer 2004.
|
||||||
//
|
//
|
||||||
|
|
||||||
function split_sql_file($sql, $delimiter)
|
function split_sql_file($sql, $delimiter)
|
||||||
{
|
{
|
||||||
// Split up our string into "possible" SQL statements.
|
// Split up our string into "possible" SQL statements.
|
||||||
|
|
||||||
$tokens = explode($delimiter, $sql);
|
$tokens = explode($delimiter, $sql);
|
||||||
|
|
||||||
// try to save mem.
|
// try to save mem.
|
||||||
|
|
||||||
$sql = "";
|
$sql = "";
|
||||||
$output = array();
|
$output = array();
|
||||||
|
|
||||||
// we don't actually care about the matches preg gives us.
|
// we don't actually care about the matches preg gives us.
|
||||||
|
|
||||||
$matches = array();
|
$matches = array();
|
||||||
|
|
||||||
// this is faster than calling count($oktens) every time thru the loop.
|
// this is faster than calling count($oktens) every time thru the loop.
|
||||||
|
|
||||||
$token_count = count($tokens);
|
$token_count = count($tokens);
|
||||||
for ($i = 0;$i < $token_count;$i++)
|
for ($i = 0;$i < $token_count;$i++)
|
||||||
{
|
{
|
||||||
// Don't wanna add an empty string as the last thing in the array.
|
// Don't wanna add an empty string as the last thing in the array.
|
||||||
|
|
||||||
if(($i != ($token_count - 1))
|
if(($i != ($token_count - 1))
|
||||||
|| (strlen($tokens[$i] > 0)))
|
|| (strlen($tokens[$i] > 0)))
|
||||||
{
|
{
|
||||||
// This is the total number of single quotes in the token.
|
// This is the total number of single quotes in the token.
|
||||||
|
|
||||||
$total_quotes = preg_match_all("/'/", $tokens[$i], $matches);
|
$total_quotes = preg_match_all("/'/", $tokens[$i], $matches);
|
||||||
|
|
||||||
// Counts single quotes that are preceded by an odd number of backslashes,
|
// Counts single quotes that are preceded by an odd number of backslashes,
|
||||||
// which means they're escaped quotes.
|
// which means they're escaped quotes.
|
||||||
|
|
||||||
$escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$i], $matches);
|
$escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$i], $matches);
|
||||||
$unescaped_quotes = $total_quotes - $escaped_quotes;
|
$unescaped_quotes = $total_quotes - $escaped_quotes;
|
||||||
|
|
||||||
// If the number of unescaped quotes is even, then the delimiter did NOT occur inside a string literal.
|
// If the number of unescaped quotes is even, then the delimiter did NOT occur inside a string literal.
|
||||||
|
|
||||||
if(($unescaped_quotes % 2) == 0)
|
if(($unescaped_quotes % 2) == 0)
|
||||||
{
|
{
|
||||||
// It's a complete sql statement.
|
// It's a complete sql statement.
|
||||||
|
|
||||||
$output[] = $tokens[$i];
|
$output[] = $tokens[$i];
|
||||||
|
|
||||||
// save memory.
|
// save memory.
|
||||||
|
|
||||||
$tokens[$i] = "";
|
$tokens[$i] = "";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// incomplete sql statement. keep adding tokens until we have a complete one.
|
// incomplete sql statement. keep adding tokens until we have a complete one.
|
||||||
// $temp will hold what we have so far.
|
// $temp will hold what we have so far.
|
||||||
|
|
||||||
$temp = $tokens[$i] . $delimiter;
|
$temp = $tokens[$i] . $delimiter;
|
||||||
|
|
||||||
// save memory..
|
// save memory..
|
||||||
|
|
||||||
$tokens[$i] = "";
|
$tokens[$i] = "";
|
||||||
|
|
||||||
// Do we have a complete statement yet?
|
// Do we have a complete statement yet?
|
||||||
|
|
||||||
$complete_stmt = false;
|
$complete_stmt = false;
|
||||||
for ($j = $i + 1;(!$complete_stmt && ($j < $token_count));$j++)
|
for ($j = $i + 1;(!$complete_stmt && ($j < $token_count));$j++)
|
||||||
{
|
{
|
||||||
// This is the total number of single quotes in the token.
|
// This is the total number of single quotes in the token.
|
||||||
|
|
||||||
$total_quotes = preg_match_all("/'/", $tokens[$j], $matches);
|
$total_quotes = preg_match_all("/'/", $tokens[$j], $matches);
|
||||||
|
|
||||||
// Counts single quotes that are preceded by an odd number of backslashes,
|
// Counts single quotes that are preceded by an odd number of backslashes,
|
||||||
// which means they're escaped quotes.
|
// which means they're escaped quotes.
|
||||||
|
|
||||||
$escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$j], $matches);
|
$escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$j], $matches);
|
||||||
$unescaped_quotes = $total_quotes - $escaped_quotes;
|
$unescaped_quotes = $total_quotes - $escaped_quotes;
|
||||||
|
|
||||||
if(($unescaped_quotes % 2) == 1)
|
if(($unescaped_quotes % 2) == 1)
|
||||||
{
|
{
|
||||||
// odd number of unescaped quotes. In combination with the previous incomplete
|
// odd number of unescaped quotes. In combination with the previous incomplete
|
||||||
// statement(s), we now have a complete statement. (2 odds always make an even)
|
// statement(s), we now have a complete statement. (2 odds always make an even)
|
||||||
|
|
||||||
$output[] = $temp . $tokens[$j];
|
$output[] = $temp . $tokens[$j];
|
||||||
|
|
||||||
// save memory.
|
// save memory.
|
||||||
|
|
||||||
$tokens[$j] = "";
|
$tokens[$j] = "";
|
||||||
$temp = "";
|
$temp = "";
|
||||||
|
|
||||||
// exit the loop.
|
// exit the loop.
|
||||||
|
|
||||||
$complete_stmt = true;
|
$complete_stmt = true;
|
||||||
|
|
||||||
// make sure the outer loop continues at the right point.
|
// make sure the outer loop continues at the right point.
|
||||||
|
|
||||||
$i = $j;
|
$i = $j;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// even number of unescaped quotes. We still don't have a complete statement.
|
// even number of unescaped quotes. We still don't have a complete statement.
|
||||||
// (1 odd and 1 even always make an odd)
|
// (1 odd and 1 even always make an odd)
|
||||||
|
|
||||||
$temp.= $tokens[$j] . $delimiter;
|
$temp.= $tokens[$j] . $delimiter;
|
||||||
|
|
||||||
// save memory.
|
// save memory.
|
||||||
|
|
||||||
$tokens[$j] = "";
|
$tokens[$j] = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// for..
|
// for..
|
||||||
}
|
}
|
||||||
|
|
||||||
// else
|
// else
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,88 +1,88 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of found directories
|
* Returns an array of found directories
|
||||||
*
|
*
|
||||||
* This function checks every found directory if they match either $uid or $gid, if they do
|
* This function checks every found directory if they match either $uid or $gid, if they do
|
||||||
* the found directory is valid. It uses recursive function calls to find subdirectories. Due
|
* the found directory is valid. It uses recursive function calls to find subdirectories. Due
|
||||||
* to the recursive behauviour this function may consume much memory.
|
* to the recursive behauviour this function may consume much memory.
|
||||||
*
|
*
|
||||||
* @param string path The path to start searching in
|
* @param string path The path to start searching in
|
||||||
* @param integer uid The uid which must match the found directories
|
* @param integer uid The uid which must match the found directories
|
||||||
* @param integer gid The gid which must match the found direcotries
|
* @param integer gid The gid which must match the found direcotries
|
||||||
* @param array _fileList recursive transport array !for internal use only!
|
* @param array _fileList recursive transport array !for internal use only!
|
||||||
* @return array Array of found valid pathes
|
* @return array Array of found valid pathes
|
||||||
*
|
*
|
||||||
* @author Martin Burchert <martin.burchert@syscp.de>
|
* @author Martin Burchert <martin.burchert@syscp.de>
|
||||||
* @author Manuel Bernhardt <manuel.bernhardt@syscp.de>
|
* @author Manuel Bernhardt <manuel.bernhardt@syscp.de>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function findDirs($path, $uid, $gid)
|
function findDirs($path, $uid, $gid)
|
||||||
{
|
{
|
||||||
$list = array(
|
$list = array(
|
||||||
$path
|
$path
|
||||||
);
|
);
|
||||||
$_fileList = array();
|
$_fileList = array();
|
||||||
|
|
||||||
while(sizeof($list) > 0)
|
while(sizeof($list) > 0)
|
||||||
{
|
{
|
||||||
$path = array_pop($list);
|
$path = array_pop($list);
|
||||||
$path = makeCorrectDir($path);
|
$path = makeCorrectDir($path);
|
||||||
|
|
||||||
if(!is_readable($path))
|
if(!is_readable($path))
|
||||||
{
|
{
|
||||||
return $_fileList;
|
return $_fileList;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dh = opendir($path);
|
$dh = opendir($path);
|
||||||
|
|
||||||
if($dh === false)
|
if($dh === false)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* this should never be called because we checked
|
* this should never be called because we checked
|
||||||
* 'is_readable' before...but we never know what might happen
|
* 'is_readable' before...but we never know what might happen
|
||||||
*/
|
*/
|
||||||
standard_error('cannotreaddir', $path);
|
standard_error('cannotreaddir', $path);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while(false !== ($file = @readdir($dh)))
|
while(false !== ($file = @readdir($dh)))
|
||||||
{
|
{
|
||||||
if($file == '.'
|
if($file == '.'
|
||||||
&& (fileowner($path . '/' . $file) == $uid || filegroup($path . '/' . $file) == $gid))
|
&& (fileowner($path . '/' . $file) == $uid || filegroup($path . '/' . $file) == $gid))
|
||||||
{
|
{
|
||||||
$_fileList[] = makeCorrectDir($path);
|
$_fileList[] = makeCorrectDir($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_dir($path . '/' . $file)
|
if(is_dir($path . '/' . $file)
|
||||||
&& $file != '..'
|
&& $file != '..'
|
||||||
&& $file != '.')
|
&& $file != '.')
|
||||||
{
|
{
|
||||||
array_push($list, $path . '/' . $file);
|
array_push($list, $path . '/' . $file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@closedir($dh);
|
@closedir($dh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $_fileList;
|
return $_fileList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,56 +1,56 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a given directory is valid for multiple configurations
|
* Checks if a given directory is valid for multiple configurations
|
||||||
* or should rather be used as a single file
|
* or should rather be used as a single file
|
||||||
*
|
*
|
||||||
* @param string The dir
|
* @param string The dir
|
||||||
* @return bool true if usable as dir, false otherwise
|
* @return bool true if usable as dir, false otherwise
|
||||||
*
|
*
|
||||||
* @author Florian Lippert <flo@syscp.org>
|
* @author Florian Lippert <flo@syscp.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function isConfigDir($dir)
|
function isConfigDir($dir)
|
||||||
{
|
{
|
||||||
if(file_exists($dir))
|
if(file_exists($dir))
|
||||||
{
|
{
|
||||||
if(is_dir($dir))
|
if(is_dir($dir))
|
||||||
{
|
{
|
||||||
$returnval = true;
|
$returnval = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$returnval = false;
|
$returnval = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(substr($dir, -1) == '/')
|
if(substr($dir, -1) == '/')
|
||||||
{
|
{
|
||||||
$returnval = true;
|
$returnval = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$returnval = false;
|
$returnval = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $returnval;
|
return $returnval;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +1,42 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function which returns a correct dirname, means to add slashes at the beginning and at the end if there weren't some
|
* Function which returns a correct dirname, means to add slashes at the beginning and at the end if there weren't some
|
||||||
*
|
*
|
||||||
* @param string The dirname
|
* @param string The dirname
|
||||||
* @return string The corrected dirname
|
* @return string The corrected dirname
|
||||||
* @author Florian Lippert <flo@syscp.org>
|
* @author Florian Lippert <flo@syscp.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function makeCorrectDir($dir)
|
function makeCorrectDir($dir)
|
||||||
{
|
{
|
||||||
if(substr($dir, -1, 1) != '/')
|
if(substr($dir, -1, 1) != '/')
|
||||||
{
|
{
|
||||||
$dir.= '/';
|
$dir.= '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(substr($dir, 0, 1) != '/')
|
if(substr($dir, 0, 1) != '/')
|
||||||
{
|
{
|
||||||
$dir = '/' . $dir;
|
$dir = '/' . $dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dir = makeSecurePath($dir);
|
$dir = makeSecurePath($dir);
|
||||||
return $dir;
|
return $dir;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +1,39 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function which returns a correct filename, means to add a slash at the beginning if there wasn't one
|
* Function which returns a correct filename, means to add a slash at the beginning if there wasn't one
|
||||||
*
|
*
|
||||||
* @param string filename the filename
|
* @param string filename the filename
|
||||||
* @return string the corrected filename
|
* @return string the corrected filename
|
||||||
* @author Florian Lippert <flo@syscp.org>
|
* @author Florian Lippert <flo@syscp.org>
|
||||||
* @author Michael Russ <mr@edvruss.com>
|
* @author Michael Russ <mr@edvruss.com>
|
||||||
* @author Martin Burchert <eremit@adm1n.de>
|
* @author Martin Burchert <eremit@adm1n.de>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function makeCorrectFile($filename)
|
function makeCorrectFile($filename)
|
||||||
{
|
{
|
||||||
if(substr($filename, 0, 1) != '/')
|
if(substr($filename, 0, 1) != '/')
|
||||||
{
|
{
|
||||||
$filename = '/' . $filename;
|
$filename = '/' . $filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
$filename = makeSecurePath($filename);
|
$filename = makeSecurePath($filename);
|
||||||
return $filename;
|
return $filename;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,79 +1,79 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a valid html tag for the choosen $fieldType for pathes
|
* Returns a valid html tag for the choosen $fieldType for pathes
|
||||||
*
|
*
|
||||||
* @param string path The path to start searching in
|
* @param string path The path to start searching in
|
||||||
* @param integer uid The uid which must match the found directories
|
* @param integer uid The uid which must match the found directories
|
||||||
* @param integer gid The gid which must match the found direcotries
|
* @param integer gid The gid which must match the found direcotries
|
||||||
* @param string fieldType Either "Manual" or "Dropdown"
|
* @param string fieldType Either "Manual" or "Dropdown"
|
||||||
* @return string The html tag for the choosen $fieldType
|
* @return string The html tag for the choosen $fieldType
|
||||||
*
|
*
|
||||||
* @author Martin Burchert <martin.burchert@syscp.de>
|
* @author Martin Burchert <martin.burchert@syscp.de>
|
||||||
* @author Manuel Bernhardt <manuel.bernhardt@syscp.de>
|
* @author Manuel Bernhardt <manuel.bernhardt@syscp.de>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function makePathfield($path, $uid, $gid, $fieldType, $value = '')
|
function makePathfield($path, $uid, $gid, $fieldType, $value = '')
|
||||||
{
|
{
|
||||||
global $lng;
|
global $lng;
|
||||||
$value = str_replace($path, '', $value);
|
$value = str_replace($path, '', $value);
|
||||||
$field = '';
|
$field = '';
|
||||||
|
|
||||||
if($fieldType == 'Manual')
|
if($fieldType == 'Manual')
|
||||||
{
|
{
|
||||||
$field = '<input type="text" name="path" value="' . htmlspecialchars($value) . '" size="30" />';
|
$field = '<input type="text" name="path" value="' . htmlspecialchars($value) . '" size="30" />';
|
||||||
}
|
}
|
||||||
elseif($fieldType == 'Dropdown')
|
elseif($fieldType == 'Dropdown')
|
||||||
{
|
{
|
||||||
$dirList = findDirs($path, $uid, $gid);
|
$dirList = findDirs($path, $uid, $gid);
|
||||||
|
|
||||||
natcasesort($dirList);
|
natcasesort($dirList);
|
||||||
|
|
||||||
if(sizeof($dirList) > 0)
|
if(sizeof($dirList) > 0)
|
||||||
{
|
{
|
||||||
if(sizeof(dirList) <= 100)
|
if(sizeof(dirList) <= 100)
|
||||||
{
|
{
|
||||||
$field = '<select name="path">';
|
$field = '<select name="path">';
|
||||||
foreach($dirList as $key => $dir)
|
foreach($dirList as $key => $dir)
|
||||||
{
|
{
|
||||||
if(strpos($dir, $path) === 0)
|
if(strpos($dir, $path) === 0)
|
||||||
{
|
{
|
||||||
$dir = makeCorrectDir(substr($dir, strlen($path)));
|
$dir = makeCorrectDir(substr($dir, strlen($path)));
|
||||||
}
|
}
|
||||||
|
|
||||||
$field.= makeoption($dir, $dir, $value);
|
$field.= makeoption($dir, $dir, $value);
|
||||||
}
|
}
|
||||||
$field.= '</select>';
|
$field.= '</select>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$field = $lng['panel']['toomanydirs'];
|
$field = $lng['panel']['toomanydirs'];
|
||||||
$field.= '<input type="text" name="path" value="' . htmlspecialchars($value) . '" size="30" />';
|
$field.= '<input type="text" name="path" value="' . htmlspecialchars($value) . '" size="30" />';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$field = $lng['panel']['dirsmissing'];
|
$field = $lng['panel']['dirsmissing'];
|
||||||
$field.= '<input type="hidden" name="path" value="/" />';
|
$field.= '<input type="hidden" name="path" value="/" />';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $field;
|
return $field;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +1,42 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function which returns a secure path, means to remove all multiple dots and slashes
|
* Function which returns a secure path, means to remove all multiple dots and slashes
|
||||||
*
|
*
|
||||||
* @param string The path
|
* @param string The path
|
||||||
* @return string The corrected path
|
* @return string The corrected path
|
||||||
* @author Florian Lippert <flo@syscp.org>
|
* @author Florian Lippert <flo@syscp.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function makeSecurePath($path)
|
function makeSecurePath($path)
|
||||||
{
|
{
|
||||||
$search = Array(
|
$search = Array(
|
||||||
'#/+#',
|
'#/+#',
|
||||||
'#\.+#',
|
'#\.+#',
|
||||||
'#\0+#'
|
'#\0+#'
|
||||||
);
|
);
|
||||||
$replace = Array(
|
$replace = Array(
|
||||||
'/',
|
'/',
|
||||||
'.',
|
'.',
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
$path = preg_replace($search, $replace, $path);
|
$path = preg_replace($search, $replace, $path);
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,86 +1,86 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a directory below a users homedir and sets all directories,
|
* Creates a directory below a users homedir and sets all directories,
|
||||||
* which had to be created below with correct Owner/Group
|
* which had to be created below with correct Owner/Group
|
||||||
* (Copied from cron_tasks.php:rev1189 as we'll need this more often in future)
|
* (Copied from cron_tasks.php:rev1189 as we'll need this more often in future)
|
||||||
*
|
*
|
||||||
* @param string The homedir of the user
|
* @param string The homedir of the user
|
||||||
* @param string The dir which should be created
|
* @param string The dir which should be created
|
||||||
* @param int The uid of the user
|
* @param int The uid of the user
|
||||||
* @param int The gid of the user
|
* @param int The gid of the user
|
||||||
* @return bool true if everything went okay, false if something went wrong
|
* @return bool true if everything went okay, false if something went wrong
|
||||||
*
|
*
|
||||||
* @author Florian Lippert <flo@syscp.org>
|
* @author Florian Lippert <flo@syscp.org>
|
||||||
* @author Martin Burchert <martin.burchert@syscp.org>
|
* @author Martin Burchert <martin.burchert@syscp.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function mkDirWithCorrectOwnership($homeDir, $dirToCreate, $uid, $gid)
|
function mkDirWithCorrectOwnership($homeDir, $dirToCreate, $uid, $gid)
|
||||||
{
|
{
|
||||||
$returncode = true;
|
$returncode = true;
|
||||||
|
|
||||||
if($homeDir != ''
|
if($homeDir != ''
|
||||||
&& $dirToCreate != '')
|
&& $dirToCreate != '')
|
||||||
{
|
{
|
||||||
$homeDir = makeCorrectDir($homeDir);
|
$homeDir = makeCorrectDir($homeDir);
|
||||||
$dirToCreate = makeCorrectDir($dirToCreate);
|
$dirToCreate = makeCorrectDir($dirToCreate);
|
||||||
|
|
||||||
if(substr($dirToCreate, 0, strlen($homeDir)) == $homeDir)
|
if(substr($dirToCreate, 0, strlen($homeDir)) == $homeDir)
|
||||||
{
|
{
|
||||||
$subdir = substr($dirToCreate, strlen($homeDir));
|
$subdir = substr($dirToCreate, strlen($homeDir));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$subdir = $dirToCreate;
|
$subdir = $dirToCreate;
|
||||||
}
|
}
|
||||||
|
|
||||||
$subdir = makeCorrectDir($subdir);
|
$subdir = makeCorrectDir($subdir);
|
||||||
$subdirlen = strlen($subdir);
|
$subdirlen = strlen($subdir);
|
||||||
$subdirs = array();
|
$subdirs = array();
|
||||||
array_push($subdirs, $dirToCreate);
|
array_push($subdirs, $dirToCreate);
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
|
|
||||||
while($offset < $subdirlen)
|
while($offset < $subdirlen)
|
||||||
{
|
{
|
||||||
$offset = strpos($subdir, '/', $offset);
|
$offset = strpos($subdir, '/', $offset);
|
||||||
$subdirelem = substr($subdir, 0, $offset);
|
$subdirelem = substr($subdir, 0, $offset);
|
||||||
$offset++;
|
$offset++;
|
||||||
array_push($subdirs, makeCorrectDir($homeDir . $subdirelem));
|
array_push($subdirs, makeCorrectDir($homeDir . $subdirelem));
|
||||||
}
|
}
|
||||||
|
|
||||||
$subdirs = array_unique($subdirs);
|
$subdirs = array_unique($subdirs);
|
||||||
sort($subdirs);
|
sort($subdirs);
|
||||||
foreach($subdirs as $sdir)
|
foreach($subdirs as $sdir)
|
||||||
{
|
{
|
||||||
if(!is_dir($sdir))
|
if(!is_dir($sdir))
|
||||||
{
|
{
|
||||||
$sdir = makeCorrectDir($sdir);
|
$sdir = makeCorrectDir($sdir);
|
||||||
safe_exec('mkdir -p ' . escapeshellarg($sdir));
|
safe_exec('mkdir -p ' . escapeshellarg($sdir));
|
||||||
safe_exec('chown -R ' . (int)$uid . ':' . (int)$gid . ' ' . escapeshellarg($sdir));
|
safe_exec('chown -R ' . (int)$uid . ':' . (int)$gid . ' ' . escapeshellarg($sdir));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$returncode = false;
|
$returncode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $returncode;
|
return $returncode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,117 +1,117 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper around the exec command.
|
* Wrapper around the exec command.
|
||||||
*
|
*
|
||||||
* @author Martin Burchert <eremit@adm1n.de>
|
* @author Martin Burchert <eremit@adm1n.de>
|
||||||
* @version 1.2
|
* @version 1.2
|
||||||
* @param string exec_string String to be executed
|
* @param string exec_string String to be executed
|
||||||
* @return string The result of the exec()
|
* @return string The result of the exec()
|
||||||
*
|
*
|
||||||
* History:
|
* History:
|
||||||
* 1.0 : Initial Version
|
* 1.0 : Initial Version
|
||||||
* 1.1 : Added |,&,>,<,`,*,$,~,? as security breaks.
|
* 1.1 : Added |,&,>,<,`,*,$,~,? as security breaks.
|
||||||
* 1.2 : Removed * as security break
|
* 1.2 : Removed * as security break
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function safe_exec($exec_string, &$return_value = false)
|
function safe_exec($exec_string, &$return_value = false)
|
||||||
{
|
{
|
||||||
global $settings;
|
global $settings;
|
||||||
|
|
||||||
//
|
//
|
||||||
// define allowed system commands
|
// define allowed system commands
|
||||||
//
|
//
|
||||||
|
|
||||||
$allowed_commands = array(
|
$allowed_commands = array(
|
||||||
'touch',
|
'touch',
|
||||||
'chown',
|
'chown',
|
||||||
'mkdir',
|
'mkdir',
|
||||||
'webalizer',
|
'webalizer',
|
||||||
'cp',
|
'cp',
|
||||||
'du',
|
'du',
|
||||||
'chmod',
|
'chmod',
|
||||||
'chattr',
|
'chattr',
|
||||||
$settings['system']['apachereload_command'],
|
$settings['system']['apachereload_command'],
|
||||||
$settings['system']['bindreload_command'],
|
$settings['system']['bindreload_command'],
|
||||||
$settings['dkim']['dkimrestart_command'],
|
$settings['dkim']['dkimrestart_command'],
|
||||||
$settings['system']['awstats_updateall_command'],
|
$settings['system']['awstats_updateall_command'],
|
||||||
'openssl',
|
'openssl',
|
||||||
'unzip',
|
'unzip',
|
||||||
'php',
|
'php',
|
||||||
'rm'
|
'rm'
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// check for ; in execute command
|
// check for ; in execute command
|
||||||
//
|
//
|
||||||
|
|
||||||
if((stristr($exec_string, ';'))
|
if((stristr($exec_string, ';'))
|
||||||
or (stristr($exec_string, '|'))
|
or (stristr($exec_string, '|'))
|
||||||
or (stristr($exec_string, '&'))
|
or (stristr($exec_string, '&'))
|
||||||
or (stristr($exec_string, '>'))
|
or (stristr($exec_string, '>'))
|
||||||
or (stristr($exec_string, '<'))
|
or (stristr($exec_string, '<'))
|
||||||
or (stristr($exec_string, '`'))
|
or (stristr($exec_string, '`'))
|
||||||
or (stristr($exec_string, '$'))
|
or (stristr($exec_string, '$'))
|
||||||
or (stristr($exec_string, '~'))
|
or (stristr($exec_string, '~'))
|
||||||
or (stristr($exec_string, '?')))
|
or (stristr($exec_string, '?')))
|
||||||
{
|
{
|
||||||
die('SECURITY CHECK FAILED!' . "\n" . 'The execute string "' . htmlspecialchars($exec_string) . '" is a possible security risk!' . "\n" . 'Please check your whole server for security problems by hand!' . "\n");
|
die('SECURITY CHECK FAILED!' . "\n" . 'The execute string "' . htmlspecialchars($exec_string) . '" is a possible security risk!' . "\n" . 'Please check your whole server for security problems by hand!' . "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// check if command is allowed here
|
// check if command is allowed here
|
||||||
//
|
//
|
||||||
|
|
||||||
$ok = false;
|
$ok = false;
|
||||||
foreach($allowed_commands as $allowed_command)
|
foreach($allowed_commands as $allowed_command)
|
||||||
{
|
{
|
||||||
if(strpos($exec_string, $allowed_command) == 0
|
if(strpos($exec_string, $allowed_command) == 0
|
||||||
&& (strlen($exec_string) === ($allowed_command_pos = strlen($allowed_command)) || substr($exec_string, $allowed_command_pos, 1) === ' '))
|
&& (strlen($exec_string) === ($allowed_command_pos = strlen($allowed_command)) || substr($exec_string, $allowed_command_pos, 1) === ' '))
|
||||||
{
|
{
|
||||||
$ok = true;
|
$ok = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$ok)
|
if(!$ok)
|
||||||
{
|
{
|
||||||
die('SECURITY CHECK FAILED!' . "\n" . 'Your command "' . htmlspecialchars($exec_string) . '" is not allowed!' . "\n" . 'Please check your whole server for security problems by hand!' . "\n");
|
die('SECURITY CHECK FAILED!' . "\n" . 'Your command "' . htmlspecialchars($exec_string) . '" is not allowed!' . "\n" . 'Please check your whole server for security problems by hand!' . "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// execute the command and return output
|
// execute the command and return output
|
||||||
//
|
//
|
||||||
// --- martin @ 08.08.2005 -------------------------------------------------------
|
// --- martin @ 08.08.2005 -------------------------------------------------------
|
||||||
// fixing usage of uninitialised variable
|
// fixing usage of uninitialised variable
|
||||||
|
|
||||||
$return = '';
|
$return = '';
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
|
|
||||||
if($return_value == false)
|
if($return_value == false)
|
||||||
{
|
{
|
||||||
exec($exec_string, $return);
|
exec($exec_string, $return);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
exec($exec_string, $return, $return_value);
|
exec($exec_string, $return, $return_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getFormFieldDataBool($fieldname, $fielddata, $input)
|
function getFormFieldDataBool($fieldname, $fielddata, $input)
|
||||||
{
|
{
|
||||||
if(isset($input[$fieldname]) && ($input[$fieldname] === '1' || $input[$fieldname] === 1 || $input[$fieldname] === true || strtolower($input[$fieldname]) === 'yes' || strtolower($input[$fieldname]) === 'ja'))
|
if(isset($input[$fieldname]) && ($input[$fieldname] === '1' || $input[$fieldname] === 1 || $input[$fieldname] === true || strtolower($input[$fieldname]) === 'yes' || strtolower($input[$fieldname]) === 'ja'))
|
||||||
{
|
{
|
||||||
$newfieldvalue = '1';
|
$newfieldvalue = '1';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$newfieldvalue = '0';
|
$newfieldvalue = '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $newfieldvalue;
|
return $newfieldvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getFormFieldOutputBool($fieldname, $fielddata)
|
function getFormFieldOutputBool($fieldname, $fielddata)
|
||||||
{
|
{
|
||||||
$label = $fielddata['label'];
|
$label = $fielddata['label'];
|
||||||
$boolswitch = makeYesNo($fieldname, '1', '0', $fielddata['value']);
|
$boolswitch = makeYesNo($fieldname, '1', '0', $fielddata['value']);
|
||||||
eval("\$returnvalue = \"" . getTemplate("formfields/bool", true) . "\";");
|
eval("\$returnvalue = \"" . getTemplate("formfields/bool", true) . "\";");
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function validateFormFieldBool($fieldname, $fielddata, $newfieldvalue)
|
function validateFormFieldBool($fieldname, $fielddata, $newfieldvalue)
|
||||||
{
|
{
|
||||||
if($newfieldvalue === '1' || $newfieldvalue === 1 || $newfieldvalue === true || strtolower($newfieldvalue) === 'yes' || strtolower($newfieldvalue) === 'ja' || $newfieldvalue === '0' || $newfieldvalue === 0 || $newfieldvalue === false || strtolower($newfieldvalue) === 'no' || strtolower($newfieldvalue) === 'nein' || strtolower($newfieldvalue) === '')
|
if($newfieldvalue === '1' || $newfieldvalue === 1 || $newfieldvalue === true || strtolower($newfieldvalue) === 'yes' || strtolower($newfieldvalue) === 'ja' || $newfieldvalue === '0' || $newfieldvalue === 0 || $newfieldvalue === false || strtolower($newfieldvalue) === 'no' || strtolower($newfieldvalue) === 'nein' || strtolower($newfieldvalue) === '')
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return 'noboolean';
|
return 'noboolean';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(!defined('FORMFIELDS_PLAUSIBILITY_CHECK_OK'))
|
if(!defined('FORMFIELDS_PLAUSIBILITY_CHECK_OK'))
|
||||||
define('FORMFIELDS_PLAUSIBILITY_CHECK_OK', 0);
|
define('FORMFIELDS_PLAUSIBILITY_CHECK_OK', 0);
|
||||||
if(!defined('FORMFIELDS_PLAUSIBILITY_CHECK_ERROR'))
|
if(!defined('FORMFIELDS_PLAUSIBILITY_CHECK_ERROR'))
|
||||||
define('FORMFIELDS_PLAUSIBILITY_CHECK_ERROR', 1);
|
define('FORMFIELDS_PLAUSIBILITY_CHECK_ERROR', 1);
|
||||||
if(!defined('FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION'))
|
if(!defined('FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION'))
|
||||||
define('FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION', 2);
|
define('FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION', 2);
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getFormFieldOutputDate($fieldname, $fielddata)
|
function getFormFieldOutputDate($fieldname, $fielddata)
|
||||||
{
|
{
|
||||||
if(isset($fielddata['date_timestamp']) && $fielddata['date_timestamp'] === true)
|
if(isset($fielddata['date_timestamp']) && $fielddata['date_timestamp'] === true)
|
||||||
{
|
{
|
||||||
$fielddata['value'] = date('Y-m-d', $fielddata['value']);
|
$fielddata['value'] = date('Y-m-d', $fielddata['value']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return getFormFieldOutputString($fieldname, $fielddata);
|
return getFormFieldOutputString($fieldname, $fielddata);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function manipulateFormFieldDataDate($fieldname, $fielddata, $newfieldvalue)
|
function manipulateFormFieldDataDate($fieldname, $fielddata, $newfieldvalue)
|
||||||
{
|
{
|
||||||
if(isset($fielddata['date_timestamp']) && $fielddata['date_timestamp'] === true)
|
if(isset($fielddata['date_timestamp']) && $fielddata['date_timestamp'] === true)
|
||||||
{
|
{
|
||||||
$newfieldvalue = strtotime($newfieldvalue);
|
$newfieldvalue = strtotime($newfieldvalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $newfieldvalue;
|
return $newfieldvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function validateFormFieldDate($fieldname, $fielddata, $newfieldvalue)
|
function validateFormFieldDate($fieldname, $fielddata, $newfieldvalue)
|
||||||
{
|
{
|
||||||
if($newfieldvalue == '0000-00-00' || preg_match('/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', $newfieldvalue))
|
if($newfieldvalue == '0000-00-00' || preg_match('/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', $newfieldvalue))
|
||||||
{
|
{
|
||||||
$returnvalue = true;
|
$returnvalue = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$returnvalue = false;
|
$returnvalue = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function buildForm($form)
|
function buildForm($form)
|
||||||
{
|
{
|
||||||
$fields = '';
|
$fields = '';
|
||||||
|
|
||||||
if(validateFormDefinition($form))
|
if(validateFormDefinition($form))
|
||||||
{
|
{
|
||||||
foreach($form['groups'] as $groupname => $groupdetails)
|
foreach($form['groups'] as $groupname => $groupdetails)
|
||||||
{
|
{
|
||||||
if(isset($groupdetails['title']) && $groupdetails['title'] != '')
|
if(isset($groupdetails['title']) && $groupdetails['title'] != '')
|
||||||
{
|
{
|
||||||
$fields .= getFormGroupOutput($groupname, $groupdetails);
|
$fields .= getFormGroupOutput($groupname, $groupdetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(validateFieldDefinition($groupdetails))
|
if(validateFieldDefinition($groupdetails))
|
||||||
{
|
{
|
||||||
// Prefetch form fields
|
// Prefetch form fields
|
||||||
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||||
{
|
{
|
||||||
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
|
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
|
||||||
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
|
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collect form field output
|
// Collect form field output
|
||||||
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||||
{
|
{
|
||||||
$fields .= getFormFieldOutput($fieldname, $fielddetails);
|
$fields .= getFormFieldOutput($fieldname, $fielddetails);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function checkPlausibilityFormField($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
|
function checkPlausibilityFormField($fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues)
|
||||||
{
|
{
|
||||||
$returnvalue = '';
|
$returnvalue = '';
|
||||||
if(is_array($fielddata) && isset($fielddata['plausibility_check_method']) && $fielddata['plausibility_check_method'] != '' && function_exists($fielddata['plausibility_check_method']))
|
if(is_array($fielddata) && isset($fielddata['plausibility_check_method']) && $fielddata['plausibility_check_method'] != '' && function_exists($fielddata['plausibility_check_method']))
|
||||||
{
|
{
|
||||||
$returnvalue = call_user_func($fielddata['plausibility_check_method'], $fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues);
|
$returnvalue = call_user_func($fielddata['plausibility_check_method'], $fieldname, $fielddata, $newfieldvalue, $allnewfieldvalues);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$returnvalue = false;
|
$returnvalue = false;
|
||||||
}
|
}
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,43 +1,43 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getFormFieldData($fieldname, $fielddata, $input)
|
function getFormFieldData($fieldname, $fielddata, $input)
|
||||||
{
|
{
|
||||||
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldData' . ucfirst($fielddata['type'])))
|
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldData' . ucfirst($fielddata['type'])))
|
||||||
{
|
{
|
||||||
$newfieldvalue = call_user_func('getFormFieldData' . ucfirst($fielddata['type']), $fieldname, $fielddata, &$input);
|
$newfieldvalue = call_user_func('getFormFieldData' . ucfirst($fielddata['type']), $fieldname, $fielddata, &$input);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(isset($input[$fieldname]))
|
if(isset($input[$fieldname]))
|
||||||
{
|
{
|
||||||
$newfieldvalue = $input[$fieldname];
|
$newfieldvalue = $input[$fieldname];
|
||||||
}
|
}
|
||||||
elseif(isset($fielddata['default']))
|
elseif(isset($fielddata['default']))
|
||||||
{
|
{
|
||||||
$newfieldvalue = $fielddata['default'];
|
$newfieldvalue = $fielddata['default'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$newfieldvalue = false;
|
$newfieldvalue = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $newfieldvalue;
|
return $newfieldvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,50 +1,50 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getFormFieldOutput($fieldname, $fielddata)
|
function getFormFieldOutput($fieldname, $fielddata)
|
||||||
{
|
{
|
||||||
$returnvalue = '';
|
$returnvalue = '';
|
||||||
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldOutput' . ucfirst($fielddata['type'])))
|
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('getFormFieldOutput' . ucfirst($fielddata['type'])))
|
||||||
{
|
{
|
||||||
if(isset($fielddata['label']) && is_array($fielddata['label']))
|
if(isset($fielddata['label']) && is_array($fielddata['label']))
|
||||||
{
|
{
|
||||||
if(isset($fielddata['label']['title']) && isset($fielddata['label']['description']))
|
if(isset($fielddata['label']['title']) && isset($fielddata['label']['description']))
|
||||||
{
|
{
|
||||||
$fielddata['label'] = '<b>' . $fielddata['label']['title'] . '</b><br />' . $fielddata['label']['description'];
|
$fielddata['label'] = '<b>' . $fielddata['label']['title'] . '</b><br />' . $fielddata['label']['description'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$fielddata['label'] = implode(' ', $fielddata['label']);
|
$fielddata['label'] = implode(' ', $fielddata['label']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!isset($fielddata['value']))
|
if(!isset($fielddata['value']))
|
||||||
{
|
{
|
||||||
if(isset($fielddata['default']))
|
if(isset($fielddata['default']))
|
||||||
{
|
{
|
||||||
$fielddata['value'] = $fielddata['default'];
|
$fielddata['value'] = $fielddata['default'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$fielddata['value'] = null;
|
$fielddata['value'] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$returnvalue = call_user_func('getFormFieldOutput' . ucfirst($fielddata['type']), $fieldname, $fielddata);
|
$returnvalue = call_user_func('getFormFieldOutput' . ucfirst($fielddata['type']), $fieldname, $fielddata);
|
||||||
}
|
}
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getFormGroupOutput($groupname, $groupdetails)
|
function getFormGroupOutput($groupname, $groupdetails)
|
||||||
{
|
{
|
||||||
global $lng;
|
global $lng;
|
||||||
eval("\$group = \"" . getTemplate("settings/settings_group") . "\";");
|
eval("\$group = \"" . getTemplate("settings/settings_group") . "\";");
|
||||||
return $group;
|
return $group;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function manipulateFormFieldData($fieldname, $fielddata, $newfieldvalue)
|
function manipulateFormFieldData($fieldname, $fielddata, $newfieldvalue)
|
||||||
{
|
{
|
||||||
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('manipulateFormFieldData' . ucfirst($fielddata['type'])))
|
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('manipulateFormFieldData' . ucfirst($fielddata['type'])))
|
||||||
{
|
{
|
||||||
$newfieldvalue = call_user_func('manipulateFormFieldData' . ucfirst($fielddata['type']), $fieldname, $fielddata, $newfieldvalue);
|
$newfieldvalue = call_user_func('manipulateFormFieldData' . ucfirst($fielddata['type']), $fieldname, $fielddata, $newfieldvalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $newfieldvalue;
|
return $newfieldvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function prefetchFormFieldData($fieldname, $fielddata)
|
function prefetchFormFieldData($fieldname, $fielddata)
|
||||||
{
|
{
|
||||||
$returnvalue = array();
|
$returnvalue = array();
|
||||||
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('prefetchFormFieldData' . ucfirst($fielddata['type'])))
|
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('prefetchFormFieldData' . ucfirst($fielddata['type'])))
|
||||||
{
|
{
|
||||||
$returnvalue = call_user_func('prefetchFormFieldData' . ucfirst($fielddata['type']), $fieldname, $fielddata);
|
$returnvalue = call_user_func('prefetchFormFieldData' . ucfirst($fielddata['type']), $fieldname, $fielddata);
|
||||||
}
|
}
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,145 +1,145 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function processForm($form, $input, $url_params = array())
|
function processForm($form, $input, $url_params = array())
|
||||||
{
|
{
|
||||||
if(validateFormDefinition($form))
|
if(validateFormDefinition($form))
|
||||||
{
|
{
|
||||||
$submitted_fields = array();
|
$submitted_fields = array();
|
||||||
$changed_fields = array();
|
$changed_fields = array();
|
||||||
$saved_fields = array();
|
$saved_fields = array();
|
||||||
|
|
||||||
foreach($form['groups'] as $groupname => $groupdetails)
|
foreach($form['groups'] as $groupname => $groupdetails)
|
||||||
{
|
{
|
||||||
if(validateFieldDefinition($groupdetails))
|
if(validateFieldDefinition($groupdetails))
|
||||||
{
|
{
|
||||||
// Prefetch form fields
|
// Prefetch form fields
|
||||||
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||||
{
|
{
|
||||||
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
|
$groupdetails['fields'][$fieldname] = array_merge_prefix($fielddetails, $fielddetails['type'], prefetchFormFieldData($fieldname, $fielddetails));
|
||||||
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
|
$form['groups'][$groupname]['fields'][$fieldname] = $groupdetails['fields'][$fieldname];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($form['groups'] as $groupname => $groupdetails)
|
foreach($form['groups'] as $groupname => $groupdetails)
|
||||||
{
|
{
|
||||||
if(validateFieldDefinition($groupdetails))
|
if(validateFieldDefinition($groupdetails))
|
||||||
{
|
{
|
||||||
// Validate fields
|
// Validate fields
|
||||||
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||||
{
|
{
|
||||||
$newfieldvalue = getFormFieldData($fieldname, $fielddetails, &$input);
|
$newfieldvalue = getFormFieldData($fieldname, $fielddetails, &$input);
|
||||||
|
|
||||||
if($newfieldvalue != $fielddetails['value'])
|
if($newfieldvalue != $fielddetails['value'])
|
||||||
{
|
{
|
||||||
if(($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true)
|
if(($error = validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true)
|
||||||
{
|
{
|
||||||
standard_error($error, $fieldname);
|
standard_error($error, $fieldname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$changed_fields[$fieldname] = $newfieldvalue;
|
$changed_fields[$fieldname] = $newfieldvalue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$submitted_fields[$fieldname] = $newfieldvalue;
|
$submitted_fields[$fieldname] = $newfieldvalue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($form['groups'] as $groupname => $groupdetails)
|
foreach($form['groups'] as $groupname => $groupdetails)
|
||||||
{
|
{
|
||||||
if(validateFieldDefinition($groupdetails))
|
if(validateFieldDefinition($groupdetails))
|
||||||
{
|
{
|
||||||
// Check fields for plausibility
|
// Check fields for plausibility
|
||||||
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||||
{
|
{
|
||||||
if(($plausibility_check = checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false)
|
if(($plausibility_check = checkPlausibilityFormField($fieldname, $fielddetails, $submitted_fields[$fieldname], $submitted_fields)) !== false)
|
||||||
{
|
{
|
||||||
if(is_array($plausibility_check) && isset($plausibility_check[0]))
|
if(is_array($plausibility_check) && isset($plausibility_check[0]))
|
||||||
{
|
{
|
||||||
if($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_OK)
|
if($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_OK)
|
||||||
{
|
{
|
||||||
// Nothing to do here, everything's okay
|
// Nothing to do here, everything's okay
|
||||||
}
|
}
|
||||||
elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_ERROR)
|
elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_ERROR)
|
||||||
{
|
{
|
||||||
unset($plausibility_check[0]);
|
unset($plausibility_check[0]);
|
||||||
$error = $plausibility_check[1];
|
$error = $plausibility_check[1];
|
||||||
unset($plausibility_check[1]);
|
unset($plausibility_check[1]);
|
||||||
$targetname = implode(' ', $plausibility_check);
|
$targetname = implode(' ', $plausibility_check);
|
||||||
standard_error($error, $targetname);
|
standard_error($error, $targetname);
|
||||||
}
|
}
|
||||||
elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION)
|
elseif($plausibility_check[0] == FORMFIELDS_PLAUSIBILITY_CHECK_QUESTION)
|
||||||
{
|
{
|
||||||
unset($plausibility_check[0]);
|
unset($plausibility_check[0]);
|
||||||
$question = $plausibility_check[1];
|
$question = $plausibility_check[1];
|
||||||
unset($plausibility_check[1]);
|
unset($plausibility_check[1]);
|
||||||
$targetname = implode(' ', $plausibility_check);
|
$targetname = implode(' ', $plausibility_check);
|
||||||
if(!isset($input[$question]))
|
if(!isset($input[$question]))
|
||||||
{
|
{
|
||||||
if(is_array($url_params) && isset($url_params['filename']))
|
if(is_array($url_params) && isset($url_params['filename']))
|
||||||
{
|
{
|
||||||
$filename = $url_params['filename'];
|
$filename = $url_params['filename'];
|
||||||
unset($url_params['filename']);
|
unset($url_params['filename']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$filename = '';
|
$filename = '';
|
||||||
}
|
}
|
||||||
ask_yesno($question, $filename, array_merge($url_params, $submitted_fields, array($question => $question)), $targetname);
|
ask_yesno($question, $filename, array_merge($url_params, $submitted_fields, array($question => $question)), $targetname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
standard_error('plausibilitychecknotunderstood');
|
standard_error('plausibilitychecknotunderstood');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($form['groups'] as $groupname => $groupdetails)
|
foreach($form['groups'] as $groupname => $groupdetails)
|
||||||
{
|
{
|
||||||
if(validateFieldDefinition($groupdetails))
|
if(validateFieldDefinition($groupdetails))
|
||||||
{
|
{
|
||||||
// Save fields
|
// Save fields
|
||||||
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
foreach($groupdetails['fields'] as $fieldname => $fielddetails)
|
||||||
{
|
{
|
||||||
if(isset($changed_fields[$fieldname]))
|
if(isset($changed_fields[$fieldname]))
|
||||||
{
|
{
|
||||||
if(($saved_field = saveFormField($fieldname, $fielddetails, manipulateFormFieldData($fieldname, $fielddetails, $changed_fields[$fieldname]))) !== false)
|
if(($saved_field = saveFormField($fieldname, $fielddetails, manipulateFormFieldData($fieldname, $fielddetails, $changed_fields[$fieldname]))) !== false)
|
||||||
{
|
{
|
||||||
$saved_fields = array_merge($saved_fields, $saved_field);
|
$saved_fields = array_merge($saved_fields, $saved_field);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
standard_error('errorwhensaving', $fieldname);
|
standard_error('errorwhensaving', $fieldname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save form
|
// Save form
|
||||||
return saveForm($form, $saved_fields);
|
return saveForm($form, $saved_fields);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function returnField($fieldname, $fielddata, $newfieldvalue)
|
function returnField($fieldname, $fielddata, $newfieldvalue)
|
||||||
{
|
{
|
||||||
return array($fieldname => $newfieldvalue);
|
return array($fieldname => $newfieldvalue);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,36 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function saveForm($fielddata, $newfieldvalue)
|
function saveForm($fielddata, $newfieldvalue)
|
||||||
{
|
{
|
||||||
$returnvalue = '';
|
$returnvalue = '';
|
||||||
if(is_array($fielddata) && isset($fielddata['save_method']) && $fielddata['save_method'] != '' && function_exists($fielddata['save_method']))
|
if(is_array($fielddata) && isset($fielddata['save_method']) && $fielddata['save_method'] != '' && function_exists($fielddata['save_method']))
|
||||||
{
|
{
|
||||||
$returnvalue = call_user_func($fielddata['save_method'], $fielddata, $newfieldvalue);
|
$returnvalue = call_user_func($fielddata['save_method'], $fielddata, $newfieldvalue);
|
||||||
}
|
}
|
||||||
elseif(is_array($fielddata) && !isset($fielddata['save_method']))
|
elseif(is_array($fielddata) && !isset($fielddata['save_method']))
|
||||||
{
|
{
|
||||||
$returnvalue = true;
|
$returnvalue = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$returnvalue = false;
|
$returnvalue = false;
|
||||||
}
|
}
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,36 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function saveFormField($fieldname, $fielddata, $newfieldvalue)
|
function saveFormField($fieldname, $fielddata, $newfieldvalue)
|
||||||
{
|
{
|
||||||
$returnvalue = '';
|
$returnvalue = '';
|
||||||
if(is_array($fielddata) && isset($fielddata['save_method']) && $fielddata['save_method'] != '' && function_exists($fielddata['save_method']))
|
if(is_array($fielddata) && isset($fielddata['save_method']) && $fielddata['save_method'] != '' && function_exists($fielddata['save_method']))
|
||||||
{
|
{
|
||||||
$returnvalue = call_user_func($fielddata['save_method'], $fieldname, $fielddata, $newfieldvalue);
|
$returnvalue = call_user_func($fielddata['save_method'], $fieldname, $fielddata, $newfieldvalue);
|
||||||
}
|
}
|
||||||
elseif(is_array($fielddata) && !isset($fielddata['save_method']))
|
elseif(is_array($fielddata) && !isset($fielddata['save_method']))
|
||||||
{
|
{
|
||||||
$returnvalue = array();
|
$returnvalue = array();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$returnvalue = false;
|
$returnvalue = false;
|
||||||
}
|
}
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function validateFieldDefinition($field)
|
function validateFieldDefinition($field)
|
||||||
{
|
{
|
||||||
$returnvalue = false;
|
$returnvalue = false;
|
||||||
|
|
||||||
if(is_array($field) && !empty($field) && isset($field['fields']) && is_array($field['fields']) && !empty($field['fields']))
|
if(is_array($field) && !empty($field) && isset($field['fields']) && is_array($field['fields']) && !empty($field['fields']))
|
||||||
{
|
{
|
||||||
$returnvalue = true;
|
$returnvalue = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function validateFormDefinition($form)
|
function validateFormDefinition($form)
|
||||||
{
|
{
|
||||||
$returnvalue = false;
|
$returnvalue = false;
|
||||||
|
|
||||||
if(is_array($form) && !empty($form) && isset($form['groups']) && is_array($form['groups']) && !empty($form['groups']))
|
if(is_array($form) && !empty($form) && isset($form['groups']) && is_array($form['groups']) && !empty($form['groups']))
|
||||||
{
|
{
|
||||||
$returnvalue = true;
|
$returnvalue = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function validateFormField($fieldname, $fielddata, $newfieldvalue)
|
function validateFormField($fieldname, $fielddata, $newfieldvalue)
|
||||||
{
|
{
|
||||||
$returnvalue = '';
|
$returnvalue = '';
|
||||||
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('validateFormField' . ucfirst($fielddata['type'])))
|
if(is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '' && function_exists('validateFormField' . ucfirst($fielddata['type'])))
|
||||||
{
|
{
|
||||||
$returnvalue = call_user_func('validateFormField' . ucfirst($fielddata['type']), $fieldname, $fielddata, $newfieldvalue);
|
$returnvalue = call_user_func('validateFormField' . ucfirst($fielddata['type']), $fieldname, $fielddata, $newfieldvalue);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$returnvalue = 'validation method not found';
|
$returnvalue = 'validation method not found';
|
||||||
}
|
}
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file is part of the Froxlor project.
|
* This file is part of the Froxlor project.
|
||||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the COPYING
|
* For the full copyright and license information, please view the COPYING
|
||||||
* file that was distributed with this source code. You can also view the
|
* file that was distributed with this source code. You can also view the
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
*
|
*
|
||||||
* @copyright (c) the authors
|
* @copyright (c) the authors
|
||||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Functions
|
* @package Functions
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function getFormFieldOutputHidden($fieldname, $fielddata)
|
function getFormFieldOutputHidden($fieldname, $fielddata)
|
||||||
{
|
{
|
||||||
$returnvalue = '<input type="hidden" name="' . $fieldname . '" value="' . htmlentities($fielddata['value']) . '" />';
|
$returnvalue = '<input type="hidden" name="' . $fieldname . '" value="' . htmlentities($fielddata['value']) . '" />';
|
||||||
|
|
||||||
if(isset($fielddata['label']) && $fielddata['label'] != '')
|
if(isset($fielddata['label']) && $fielddata['label'] != '')
|
||||||
{
|
{
|
||||||
$label = $fielddata['label'];
|
$label = $fielddata['label'];
|
||||||
$value = htmlentities($fielddata['value']);
|
$value = htmlentities($fielddata['value']);
|
||||||
eval("\$returnvalue .= \"" . getTemplate("formfields/hidden", true) . "\";");
|
eval("\$returnvalue .= \"" . getTemplate("formfields/hidden", true) . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user