mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
moved all the setup mess to its right place
This commit is contained in:
parent
cb0324e890
commit
a77d47cd5f
@ -35,13 +35,12 @@
|
||||
$_redir = $referer ? $referer : $GLOBALS['phpgw']->link('/admin/index.php');
|
||||
}
|
||||
|
||||
switch($GLOBALS['HTTP_GET_VARS']['appname'])
|
||||
$appname = $GLOBALS['HTTP_GET_VARS']['appname'];
|
||||
switch($appname)
|
||||
{
|
||||
case 'admin':
|
||||
case 'preferences':
|
||||
$appname = 'preferences';
|
||||
$config_appname = 'phpgwapi';
|
||||
break;
|
||||
//case 'preferences':
|
||||
//$appname = 'preferences';
|
||||
case 'addressbook':
|
||||
case 'calendar':
|
||||
case 'email':
|
||||
@ -50,7 +49,6 @@
|
||||
Other special apps can go here for now, e.g.:
|
||||
case 'bogusappname':
|
||||
*/
|
||||
$appname = $GLOBALS['HTTP_GET_VARS']['appname'];
|
||||
$config_appname = 'phpgwapi';
|
||||
break;
|
||||
case 'phpgwapi':
|
||||
@ -59,7 +57,6 @@
|
||||
Header('Location: ' . $_redir);
|
||||
break;
|
||||
default:
|
||||
$appname = $GLOBALS['HTTP_GET_VARS']['appname'];
|
||||
$config_appname = $appname;
|
||||
break;
|
||||
}
|
||||
|
@ -12,112 +12,17 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
function encryptalgo($config)
|
||||
function country_set($config)
|
||||
{
|
||||
if(@function_exists('mcrypt_list_algorithms'))
|
||||
{
|
||||
$listed = array();
|
||||
if(!isset($config['mcrypt_algo']))
|
||||
{
|
||||
$config['mcrypt_algo'] = 'tripledes'; /* MCRYPT_TRIPLEDES */
|
||||
}
|
||||
$algos = @mcrypt_list_algorithms();
|
||||
$found = False;
|
||||
|
||||
$out = '';
|
||||
while(list($key,$value) = each($algos))
|
||||
{
|
||||
$found = True;
|
||||
/* Only show each once - seems this is a problem in some installs */
|
||||
if(!in_array($value,$listed))
|
||||
{
|
||||
if($config['mcrypt_algo'] == $value)
|
||||
{
|
||||
$selected = ' selected';
|
||||
}
|
||||
else
|
||||
{
|
||||
$selected = '';
|
||||
}
|
||||
$descr = strtoupper($value);
|
||||
|
||||
$out .= '<option value="' . $value . '"' . $selected . '>' . $descr . '</option>' . "\n";
|
||||
$listed[] = $value;
|
||||
}
|
||||
}
|
||||
if(!$found)
|
||||
{
|
||||
/* Something is wrong with their mcrypt install or php.ini */
|
||||
$out = '<option value="">' . lang('no algorithms available') . '</option>' . "\n";;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$out = '<option value="tripledes">TRIPLEDES</option>' . "\n";;
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
function encryptmode($config)
|
||||
{
|
||||
if(@function_exists('mcrypt_list_modes'))
|
||||
{
|
||||
$listed = array();
|
||||
if(!isset($config['mcrypt_mode']))
|
||||
{
|
||||
$config['mcrypt_mode'] = 'cbc'; /* MCRYPT_MODE_CBC */
|
||||
}
|
||||
$modes = @mcrypt_list_modes();
|
||||
$found = False;
|
||||
|
||||
$out = '';
|
||||
while(list($key,$value) = each($modes))
|
||||
{
|
||||
$found = True;
|
||||
/* Only show each once - seems this is a problem in some installs */
|
||||
if(!in_array($value,$listed))
|
||||
{
|
||||
if($config['mcrypt_mode'] == $value)
|
||||
{
|
||||
$selected = ' selected';
|
||||
}
|
||||
else
|
||||
{
|
||||
$selected = '';
|
||||
}
|
||||
$descr = strtoupper($value);
|
||||
|
||||
$out .= '<option value="' . $value . '"' . $selected . '>' . $descr . '</option>' . "\n";
|
||||
$listed[] = $value;
|
||||
}
|
||||
}
|
||||
if(!$found)
|
||||
{
|
||||
/* Something is wrong with their mcrypt install or php.ini */
|
||||
$out = '<option value="" selected>' . lang('no modes available') . '</option>' . "\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$out = '<option value="cbc" selected>CBC</option>' . "\n";
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
function passwdhashes($config)
|
||||
{
|
||||
$hashes = array(
|
||||
'des' => 'des',
|
||||
'md5' => 'md5'
|
||||
$country = array(
|
||||
'user_choice' => 'Users Choice',
|
||||
'force_select' => 'Force Selectbox'
|
||||
);
|
||||
if(@function_exists('mhash'))
|
||||
{
|
||||
$hashes += array('sha' => 'sha');
|
||||
}
|
||||
|
||||
while(list($key, $value) = each($hashes))
|
||||
$out = '';
|
||||
while (list ($key, $value) = each ($country))
|
||||
{
|
||||
if($config['ldap_encryption_type'] == $value)
|
||||
if ($config['countrylist'] == $key)
|
||||
{
|
||||
$selected = ' selected';
|
||||
}
|
||||
@ -125,9 +30,9 @@
|
||||
{
|
||||
$selected = '';
|
||||
}
|
||||
$descr = strtoupper($value);
|
||||
$descr = lang($value);
|
||||
|
||||
$out .= '<option value="' . $value . '"' . $selected . '>' . $descr . '</option>' . "\n";
|
||||
$out .= '<option value="' . $key . '"' . $selected . '>' . $descr . '</option>' . "\n";
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
@ -1,198 +1,175 @@
|
||||
<!-- $Id$ -->
|
||||
|
||||
<!-- BEGIN header -->
|
||||
|
||||
<form method="POST" action="{action_url}">
|
||||
<table border="0" align="center" width="85%">
|
||||
<tr class="th">
|
||||
<td colspan="2"><font color="{th_text}"> <b>{title}</b></font></td>
|
||||
<td colspan="2"> <b>{title}</b></td>
|
||||
</tr>
|
||||
|
||||
<!-- END header -->
|
||||
|
||||
<!-- BEGIN body -->
|
||||
|
||||
<tr class="row_on">
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
|
||||
<tr class="th">
|
||||
<td colspan="2"><font color="{th_text}"><b>{lang_Authentication_/_Accounts}</b></font></td>
|
||||
<tr class="row_off">
|
||||
<td>{lang_Enter_the_title_for_your_site}.</td>
|
||||
<td><input name="newsettings[site_title]" value="{value_site_title}"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Select_which_type_of_authentication_you_are_using}:</td>
|
||||
<tr class="row_on">
|
||||
<td>{lang_Country_Selection} ({lang_Text_Entry}/{lang_SelectBox}):</td>
|
||||
<td>
|
||||
<select name="newsettings[auth_type]">
|
||||
<option value="sql"{selected_auth_type_sql}>SQL</option>
|
||||
<option value="sqlssl"{selected_auth_type_sqlssl}>SQL / SSL</option>
|
||||
<option value="ldap"{selected_auth_type_ldap}>LDAP</option>
|
||||
<option value="mail"{selected_auth_type_mail}>Mail</option>
|
||||
<option value="http"{selected_auth_type_http}>HTTP</option>
|
||||
<option value="nis"{selected_auth_type_nis}>NIS</option>
|
||||
<option value="pam"{selected_auth_type_pam}>PAM (Not Ready)</option>
|
||||
<select name="newsettings[countrylist]">
|
||||
{hook_country_set}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- <tr class="row_off">
|
||||
<td>{lang_Use_pure_HTML_compliant_code_(not_fully_working_yet)}:</td>
|
||||
<td>
|
||||
<select name="newsettings[htmlcompliant]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="True"{selected_htmlcompliant_True}>{lang_Yes}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr> -->
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Use_cookies_to_pass_sessionid}:</td>
|
||||
<td>
|
||||
<select name="newsettings[usecookies]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="True"{selected_usecookies_True}>{lang_Yes}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_Select_where_you_want_to_store/retrieve_user_accounts}:</td>
|
||||
<td>{lang_check_ip_address_of_all_sessions}:</td>
|
||||
<td>
|
||||
<select name="newsettings[account_repository]">
|
||||
<option value="sql"{selected_account_repository_sql}>SQL</option>
|
||||
<option value="ldap"{selected_account_repository_ldap}>LDAP</option>
|
||||
<option value="contacts"{selected_account_repository_contacts}>Contacts - EXPERIMENTAL</option>
|
||||
<select name="newsettings[sessions_checkip]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="True"{selected_sessions_checkip_True}>{lang_Yes}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Would_you_like_phpGroupWare_to_check_for_a_new_version<br>when_admins_login_?}:</td>
|
||||
<td>
|
||||
{lang_Select_where_you_want_to_store/retrieve_filesystem_information}:
|
||||
<br>
|
||||
({lang_file_type,_size,_version,_etc.})
|
||||
</td>
|
||||
<td>
|
||||
<select name="newsettings[file_repository]">
|
||||
<option value="sql"{selected_file_repository_sql}>SQL</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>
|
||||
{lang_Select_where_you_want_to_store/retrieve_file_contents}:
|
||||
<br>
|
||||
({lang_Recommended:_Filesystem})
|
||||
</td>
|
||||
<td>
|
||||
<select name="newsettings[file_store_contents]">
|
||||
<option value="filesystem"{selected_file_store_contents_filesystem}>Filesystem</option>
|
||||
<option value="sql"{selected_file_store_contents_sql}>SQL</option>
|
||||
<select name="newsettings[checkfornewversion]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="True"{selected_checkfornewversion_True}>{lang_Yes}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_Minimum_account_id_(e.g._500_or_100,_etc.)}:</td>
|
||||
<td><input name="newsettings[account_min_id]" value="{value_account_min_id}"></td>
|
||||
<td>
|
||||
{lang_Timeout_for_sessions_(in_seconds)}.
|
||||
<br>{lang_(not_for_php4_sessions)}
|
||||
</td>
|
||||
<td><input size="8" name="newsettings[sessions_timeout]" value="{value_sessions_timeout}"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Maximum_account_id_(e.g._65535_or_1000000)}:</td>
|
||||
<td><input name="newsettings[account_max_id]" value="{value_account_max_id}"></td>
|
||||
<td>{lang_Timeout_for_application_session_data_(in_seconds)}.</td>
|
||||
<td><input size="8" name="newsettings[sessions_app_timeout]" value="{value_sessions_app_timeout}"></td>
|
||||
</tr>
|
||||
|
||||
<!--
|
||||
<tr class="row_off">
|
||||
<td>{lang_How_would_you_like_to_sort_applications_in_the_navbar?}:</td>
|
||||
<td>
|
||||
<select name="newsettings[app_order]">
|
||||
<option value="">{lang_Order_id}</option>
|
||||
<option value="True"{selected_app_order_True}>{lang_Alphabetically}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
-->
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_Would_you_like_to_show_each_application's_upgrade_status_?}:</td><td>
|
||||
<select name="newsettings[checkappversions]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="Admin"{selected_checkappversions_Admin}>{lang_Admins}</option>
|
||||
<option value="All"{selected_checkappversions_All}>{lang_All_Users}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Would_you_like_phpGroupWare_to_cache_the_phpgw_info_array_?}:</td>
|
||||
<td>
|
||||
<select name="newsettings[cache_phpgw_info]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="True"{selected_cache_phpgw_info_True}>{lang_Yes}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_If_using_LDAP,_do_you_want_to_manage_homedirectory_and_loginshell_attributes?}:</td>
|
||||
<td>{lang_Deny_all_users_access_to_grant_other_users_access_to_their_entries_?}:</td>
|
||||
<td>
|
||||
<select name="newsettings[deny_user_grants_access]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="True"{selected_deny_user_grants_access_True}>{lang_Yes}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Minimum_password_length}.</td>
|
||||
<td><input size="4" name="newsettings[pass_min_length]" value="{value_pass_min_length}"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_Require_non-alpha_characters}:</td>
|
||||
<td>
|
||||
<select name="newsettings[pass_require_non_alpha]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="True"{selected_pass_require_non_alpha_True}>{lang_Yes}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row_off">
|
||||
<td>{lang_Require_numerical_characters}:</td>
|
||||
<td>
|
||||
<select name="newsettings[pass_require_numbers]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="True"{selected_pass_require_numbers_True}>{lang_Yes}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row_on">
|
||||
<td>{lang_Require_special_characters}:</td>
|
||||
<td>
|
||||
<select name="newsettings[pass_require_special_char]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="True"{selected_pass_require_special_char_True}>{lang_Yes}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<!--
|
||||
<tr class="row_off">
|
||||
<td>{lang_Default_file_system_space_per_user}/{lang_group_?}:</td>
|
||||
<td>
|
||||
<select name="newsettings[ldap_extra_attributes]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="True"{selected_ldap_extra_attributes_True}>{lang_Yes}</option>
|
||||
<input type="text" name="newsettings[vfs_default_account_size_number]" size="7" value="{value_vfs_default_account_size_number}">
|
||||
<select name="newsettings[vfs_default_account_size_type]">
|
||||
<option value="gb"{selected_vfs_default_account_size_type_gb}>GB</option>
|
||||
<option value="mb"{selected_vfs_default_account_size_type_mb}>MB</option>
|
||||
<option value="kb"{selected_vfs_default_account_size_type_kb}>KB</option>
|
||||
<option value="b"{selected_vfs_default_account_size_type_b}>B</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td> {lang_LDAP_Default_homedirectory_prefix_(e.g._/home_for_/home/username)}:</td>
|
||||
<td><input name="newsettings[ldap_account_home]" value="{value_ldap_account_home}"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td> {lang_LDAP_Default_shell_(e.g._/bin/bash)}:</td>
|
||||
<td><input name="newsettings[ldap_account_shell]" value="{value_ldap_account_shell}"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Auto_create_account_records_for_authenticated_users}:</td>
|
||||
<td>
|
||||
<select name="newsettings[auto_create_acct]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="True"{selected_auto_create_acct_True}>{lang_Yes}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_Auto-created_user_accounts_expire}:</td>
|
||||
<td>
|
||||
<select name="newsettings[auto_create_expire]">
|
||||
<option value="604800"{selected_auto_create_expire_604800}>{lang_one_week}</option>
|
||||
<option value="1209600"{selected_auto_create_expire_1209600}>{lang_two_weeks}</option>
|
||||
<option value="2592000"{selected_auto_create_expire_2592000}>{lang_one_month}</option>
|
||||
<option value="never"{selected_auto_create_expire_never}>{lang_Never}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Add_auto-created_users_to_this_group_('Default'_will_be_attempted_if_this_is_empty.)}:</td>
|
||||
<td><input name="newsettings[default_group_lid]" value="{value_default_group_lid}"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_If_no_ACL_records_for_user_or_any_group_the_user_is_a_member_of}:</td>
|
||||
<td>
|
||||
<select name="newsettings[acl_default]">
|
||||
<option value="deny"{selected_acl_default_deny}>{lang_Deny_Access}</option>
|
||||
<option value="grant"{selected_acl_default_grant}>{lang_Grant_Access}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_LDAP_host}:</td>
|
||||
<td><input name="newsettings[ldap_host]" value="{value_ldap_host}"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_LDAP_accounts_context}:</td>
|
||||
<td><input name="newsettings[ldap_context]" value="{value_ldap_context}" size="40"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_LDAP_groups_context}:</td>
|
||||
<td><input name="newsettings[ldap_group_context]" value="{value_ldap_group_context}" size="40"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_LDAP_rootdn}:</td>
|
||||
<td><input name="newsettings[ldap_root_dn]" value="{value_ldap_root_dn}" size="40"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_LDAP_root_password}:</td>
|
||||
<td><input name="newsettings[ldap_root_pw]" type="password" value="{value_ldap_root_pw}"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_LDAP_encryption_type}:</td>
|
||||
<td>
|
||||
<select name="newsettings[ldap_encryption_type]">
|
||||
{hook_passwdhashes}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="th">
|
||||
<td colspan="2"><font color="{th_text}"><b>{lang_Mcrypt_Settings_(requires_mcrypt_PHP_extension)}</b></font></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Enter_some_random_text_for_app_session_encryption}:</td>
|
||||
<td><input name="newsettings[encryptkey]" value="{value_encryptkey}" size="40"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_Mcrypt_algorithm_(default_TRIPLEDES)}:</td>
|
||||
<td>
|
||||
<select name="newsettings[mcrypt_algo]">
|
||||
{hook_encryptalgo}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Mcrypt_mode_(default_CBC)}:</td>
|
||||
<td>
|
||||
<select name="newsettings[mcrypt_mode]">
|
||||
{hook_encryptmode}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
-->
|
||||
<!-- END body -->
|
||||
|
||||
<!-- BEGIN footer -->
|
||||
|
@ -179,10 +179,10 @@
|
||||
$GLOBALS['phpgw']->common = CreateObject('phpgwapi.common');
|
||||
$GLOBALS['phpgw']->db = $GLOBALS['phpgw_setup']->db;
|
||||
|
||||
$cfg_apps = array('phpgwapi','admin','preferences');
|
||||
/*$cfg_apps = array('phpgwapi','admin','preferences');
|
||||
while(list(,$cfg_app) = each($cfg_apps))
|
||||
{
|
||||
$t = CreateObject('setup.Template',$GLOBALS['phpgw']->common->get_tpl_dir($cfg_app));
|
||||
{*/
|
||||
$t = CreateObject('setup.Template',$GLOBALS['phpgw']->common->get_tpl_dir('setup'));
|
||||
|
||||
$t->set_unknowns('keep');
|
||||
$t->set_file(array('config' => 'config.tpl'));
|
||||
@ -193,7 +193,7 @@
|
||||
$t->set_var('row_off', 'EEEEEE');
|
||||
|
||||
$vars = $t->get_undefined('body');
|
||||
$GLOBALS['phpgw_setup']->hook('config',$cfg_app);
|
||||
$GLOBALS['phpgw_setup']->hook('config','setup');
|
||||
|
||||
while(list($null,$value) = each($vars))
|
||||
{
|
||||
@ -256,7 +256,7 @@
|
||||
|
||||
$t->pfp('out','body');
|
||||
unset($t);
|
||||
}
|
||||
//}
|
||||
|
||||
$setup_tpl->set_var('more_configs',lang('Please login to phpgroupware and run the admin application for additional site configuration') . '.');
|
||||
|
||||
|
134
setup/inc/hook_config.inc.php
Normal file
134
setup/inc/hook_config.inc.php
Normal file
@ -0,0 +1,134 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Mark Peters <skeeter@phpgroupware.org> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
function encryptalgo($config)
|
||||
{
|
||||
if(@function_exists('mcrypt_list_algorithms'))
|
||||
{
|
||||
$listed = array();
|
||||
if(!isset($config['mcrypt_algo']))
|
||||
{
|
||||
$config['mcrypt_algo'] = 'tripledes'; /* MCRYPT_TRIPLEDES */
|
||||
}
|
||||
$algos = @mcrypt_list_algorithms();
|
||||
$found = False;
|
||||
|
||||
$out = '';
|
||||
while(list($key,$value) = each($algos))
|
||||
{
|
||||
$found = True;
|
||||
/* Only show each once - seems this is a problem in some installs */
|
||||
if(!in_array($value,$listed))
|
||||
{
|
||||
if($config['mcrypt_algo'] == $value)
|
||||
{
|
||||
$selected = ' selected';
|
||||
}
|
||||
else
|
||||
{
|
||||
$selected = '';
|
||||
}
|
||||
$descr = strtoupper($value);
|
||||
|
||||
$out .= '<option value="' . $value . '"' . $selected . '>' . $descr . '</option>' . "\n";
|
||||
$listed[] = $value;
|
||||
}
|
||||
}
|
||||
if(!$found)
|
||||
{
|
||||
/* Something is wrong with their mcrypt install or php.ini */
|
||||
$out = '<option value="">' . lang('no algorithms available') . '</option>' . "\n";;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$out = '<option value="tripledes">TRIPLEDES</option>' . "\n";;
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
function encryptmode($config)
|
||||
{
|
||||
if(@function_exists('mcrypt_list_modes'))
|
||||
{
|
||||
$listed = array();
|
||||
if(!isset($config['mcrypt_mode']))
|
||||
{
|
||||
$config['mcrypt_mode'] = 'cbc'; /* MCRYPT_MODE_CBC */
|
||||
}
|
||||
$modes = @mcrypt_list_modes();
|
||||
$found = False;
|
||||
|
||||
$out = '';
|
||||
while(list($key,$value) = each($modes))
|
||||
{
|
||||
$found = True;
|
||||
/* Only show each once - seems this is a problem in some installs */
|
||||
if(!in_array($value,$listed))
|
||||
{
|
||||
if($config['mcrypt_mode'] == $value)
|
||||
{
|
||||
$selected = ' selected';
|
||||
}
|
||||
else
|
||||
{
|
||||
$selected = '';
|
||||
}
|
||||
$descr = strtoupper($value);
|
||||
|
||||
$out .= '<option value="' . $value . '"' . $selected . '>' . $descr . '</option>' . "\n";
|
||||
$listed[] = $value;
|
||||
}
|
||||
}
|
||||
if(!$found)
|
||||
{
|
||||
/* Something is wrong with their mcrypt install or php.ini */
|
||||
$out = '<option value="" selected>' . lang('no modes available') . '</option>' . "\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$out = '<option value="cbc" selected>CBC</option>' . "\n";
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
function passwdhashes($config)
|
||||
{
|
||||
$hashes = array(
|
||||
'des' => 'des',
|
||||
'md5' => 'md5'
|
||||
);
|
||||
if(@function_exists('mhash'))
|
||||
{
|
||||
$hashes += array('sha' => 'sha');
|
||||
}
|
||||
|
||||
while(list($key, $value) = each($hashes))
|
||||
{
|
||||
if($config['ldap_encryption_type'] == $value)
|
||||
{
|
||||
$selected = ' selected';
|
||||
}
|
||||
else
|
||||
{
|
||||
$selected = '';
|
||||
}
|
||||
$descr = strtoupper($value);
|
||||
|
||||
$out .= '<option value="' . $value . '"' . $selected . '>' . $descr . '</option>' . "\n";
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
?>
|
353
setup/templates/default/config.tpl
Normal file
353
setup/templates/default/config.tpl
Normal file
@ -0,0 +1,353 @@
|
||||
<!-- $Id$ -->
|
||||
|
||||
<!-- BEGIN header -->
|
||||
|
||||
<form method="POST" action="{action_url}">
|
||||
<table border="0" align="center" width="85%">
|
||||
<tr bgcolor="{th_bg}">
|
||||
<td colspan="2"><font color="{th_text}"> <b>{title}</b></font></td>
|
||||
</tr>
|
||||
|
||||
<!-- END header -->
|
||||
|
||||
<!-- BEGIN body -->
|
||||
|
||||
<tr bgcolor="{th_bg}">
|
||||
<td colspan="2"><font color="{th_text}"> <b>{lang_Path_information}</b></font></td>
|
||||
</tr>
|
||||
|
||||
</tr>
|
||||
<tr bgcolor="{row_off}">
|
||||
<td>{lang_Enter_the_full_path_for_temporary_files.<br>Examples:_/tmp,_C:\TEMP}:</td>
|
||||
<td><input name="newsettings[temp_dir]" value="{value_temp_dir}" size="40"></td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_on}">
|
||||
<td>{lang_Enter_the_full_path_for_users_and_group_files.<br>Examples:_/files,_E:\FILES}:</td>
|
||||
<td><input name="newsettings[files_dir]" value="{value_files_dir}" size="40"></td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_off}">
|
||||
<td>{lang_Enter_the_location_of_phpGroupWare's_URL.<br>Example:_http://www.domain.com/phpgroupware_ _or_ _/phpgroupware<br><b>No_trailing_slash</b>}:</td>
|
||||
<td><input name="newsettings[webserver_url]" value="{value_webserver_url}" size="40"></td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_on}">
|
||||
<td>{lang_Image_type_selection_order}:</td>
|
||||
<td>
|
||||
<select name="newsettings[image_type]">
|
||||
<option value="">GIF->JPG->PNG</option>
|
||||
<option value="1"{selected_image_type_1}>PNG->JPG->GIF</option>
|
||||
<option value="2"{selected_image_type_2}>PNG->JPG</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_off}">
|
||||
<td>{lang_read_translations_from}:</td>
|
||||
<td>
|
||||
<select name="newsettings[translation_system]">
|
||||
<option value="sql"{selected_translation_system_sql}>SQL</option>
|
||||
<option value="file"{selected_translation_system_file}>{lang_file}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_on}">
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{th_bg}">
|
||||
<td colspan="2"><font color="{th_text}"> <b>{lang_Host_information}</b></font></td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_off}">
|
||||
<td>{lang_Enter_the_hostname_of_the_machine_on_which_this_server_is_running}:</td>
|
||||
<td><input name="newsettings[hostname]" value="{value_hostname}"></td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_on}">
|
||||
<td>{lang_Enter_your_default_FTP_server}:</td>
|
||||
<td><input name="newsettings[default_ftp_server]" value="{value_default_ftp_server}"></td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_off}">
|
||||
<td>{lang_Attempt_to_use_correct_mimetype_for_FTP_instead_of_default_'application/octet-stream'}:</td>
|
||||
<td>
|
||||
<select name="newsettings[ftp_use_mime]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="True"{selected_ftp_use_mime_True}>{lang_Yes}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_on}">
|
||||
<td>{lang_Datetime_port.<br>If_using_port_13,_please_set_firewall_rules_appropriately_before_submitting_this_page.<br>(Port:_13_/_Host:_129.6.15.28)}</td>
|
||||
<td>
|
||||
<select name="newsettings[daytime_port]">
|
||||
<option value="00"{selected_daytime_port_00}>{lang_00_(disable)}</option>
|
||||
<option value="13"{selected_daytime_port_13}>{lang_13_(ntp)}</option>
|
||||
<option value="80"{selected_daytime_port_80}>{lang_80_(http)}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_off}">
|
||||
<td>{lang_Enter_your_HTTP_proxy_server}:</td>
|
||||
<td><input name="newsettings[httpproxy_server]" value="{value_httpproxy_server}"></td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_on}">
|
||||
<td>{lang_Enter_your_HTTP_proxy_server_port}:</td>
|
||||
<td><input name="newsettings[httpproxy_port]" value="{value_httpproxy_port}"></td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_off}">
|
||||
<td>{lang_Enter_the_site_username_for_peer_servers}.</td>
|
||||
<td><input name="newsettings[site_username]" value="{value_site_username}"></td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_on}">
|
||||
<td>{lang_Enter_the_site_password_for_peer_servers}.</td>
|
||||
<td><input type="password" name="newsettings[site_password]" value="{value_site_password}"></td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_off}">
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
|
||||
<!-- from admin -->
|
||||
|
||||
<tr bgcolor="{th_bg}">
|
||||
<td colspan="2"><font color="{th_text}"><b>{lang_Authentication_/_Accounts}</b></font></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Select_which_type_of_authentication_you_are_using}:</td>
|
||||
<td>
|
||||
<select name="newsettings[auth_type]">
|
||||
<option value="sql"{selected_auth_type_sql}>SQL</option>
|
||||
<option value="sqlssl"{selected_auth_type_sqlssl}>SQL / SSL</option>
|
||||
<option value="ldap"{selected_auth_type_ldap}>LDAP</option>
|
||||
<option value="mail"{selected_auth_type_mail}>Mail</option>
|
||||
<option value="http"{selected_auth_type_http}>HTTP</option>
|
||||
<option value="nis"{selected_auth_type_nis}>NIS</option>
|
||||
<option value="pam"{selected_auth_type_pam}>PAM (Not Ready)</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_Select_where_you_want_to_store/retrieve_user_accounts}:</td>
|
||||
<td>
|
||||
<select name="newsettings[account_repository]">
|
||||
<option value="sql"{selected_account_repository_sql}>SQL</option>
|
||||
<option value="ldap"{selected_account_repository_ldap}>LDAP</option>
|
||||
<option value="contacts"{selected_account_repository_contacts}>Contacts - EXPERIMENTAL</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_Minimum_account_id_(e.g._500_or_100,_etc.)}:</td>
|
||||
<td><input name="newsettings[account_min_id]" value="{value_account_min_id}"></td>
|
||||
</tr>
|
||||
<tr class="row_off">
|
||||
<td>{lang_Maximum_account_id_(e.g._65535_or_1000000)}:</td>
|
||||
<td><input name="newsettings[account_max_id]" value="{value_account_max_id}"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Auto_create_account_records_for_authenticated_users}:</td>
|
||||
<td>
|
||||
<select name="newsettings[auto_create_acct]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="True"{selected_auto_create_acct_True}>{lang_Yes}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_Auto-created_user_accounts_expire}:</td>
|
||||
<td>
|
||||
<select name="newsettings[auto_create_expire]">
|
||||
<option value="604800"{selected_auto_create_expire_604800}>{lang_one_week}</option>
|
||||
<option value="1209600"{selected_auto_create_expire_1209600}>{lang_two_weeks}</option>
|
||||
<option value="2592000"{selected_auto_create_expire_2592000}>{lang_one_month}</option>
|
||||
<option value="never"{selected_auto_create_expire_never}>{lang_Never}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Add_auto-created_users_to_this_group_('Default'_will_be_attempted_if_this_is_empty.)}:</td>
|
||||
<td><input name="newsettings[default_group_lid]" value="{value_default_group_lid}"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_If_no_ACL_records_for_user_or_any_group_the_user_is_a_member_of}:</td>
|
||||
<td>
|
||||
<select name="newsettings[acl_default]">
|
||||
<option value="deny"{selected_acl_default_deny}>{lang_Deny_Access}</option>
|
||||
<option value="grant"{selected_acl_default_grant}>{lang_Grant_Access}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td colspan="2"><b>{lang_If_using_LDAP}:</b></td>
|
||||
<tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_Do_you_want_to_manage_homedirectory_and_loginshell_attributes?}:</td>
|
||||
<td>
|
||||
<select name="newsettings[ldap_extra_attributes]">
|
||||
<option value="">{lang_No}</option>
|
||||
<option value="True"{selected_ldap_extra_attributes_True}>{lang_Yes}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_LDAP_Default_homedirectory_prefix_(e.g._/home_for_/home/username)}:</td>
|
||||
<td><input name="newsettings[ldap_account_home]" value="{value_ldap_account_home}"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_LDAP_Default_shell_(e.g._/bin/bash)}:</td>
|
||||
<td><input name="newsettings[ldap_account_shell]" value="{value_ldap_account_shell}"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_LDAP_version}:</td>
|
||||
<td>
|
||||
<select name="newsettings[ldap_version]">
|
||||
<option value="2"{selected_ldap_version_2}>2</option>
|
||||
<option value="3"{selected_ldap_version_3}>3</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row_on">
|
||||
<td>{lang_LDAP_host}:</td>
|
||||
<td><input name="newsettings[ldap_host]" value="{value_ldap_host}"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_LDAP_accounts_context}:</td>
|
||||
<td><input name="newsettings[ldap_context]" value="{value_ldap_context}" size="40"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_LDAP_groups_context}:</td>
|
||||
<td><input name="newsettings[ldap_group_context]" value="{value_ldap_group_context}" size="40"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_LDAP_rootdn}:</td>
|
||||
<td><input name="newsettings[ldap_root_dn]" value="{value_ldap_root_dn}" size="40"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_LDAP_root_password}:</td>
|
||||
<td><input name="newsettings[ldap_root_pw]" type="password" value="{value_ldap_root_pw}"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_LDAP_encryption_type}:</td>
|
||||
<td>
|
||||
<select name="newsettings[ldap_encryption_type]">
|
||||
{hook_passwdhashes}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr bgcolor="{th_bg}">
|
||||
<td colspan="2"><font color="{th_text}"><b>{lang_Mcrypt_settings_(requires_mcrypt_PHP_extension)}</b></font></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Enter_some_random_text_for_app_session_encryption}:</td>
|
||||
<td><input name="newsettings[encryptkey]" value="{value_encryptkey}" size="40"></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<td>{lang_Mcrypt_algorithm_(default_TRIPLEDES)}:</td>
|
||||
<td>
|
||||
<select name="newsettings[mcrypt_algo]">
|
||||
{hook_encryptalgo}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_off">
|
||||
<td>{lang_Mcrypt_mode_(default_CBC)}:</td>
|
||||
<td>
|
||||
<select name="newsettings[mcrypt_mode]">
|
||||
{hook_encryptmode}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="{row_off}">
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
<tr bgcolor="{th_bg}">
|
||||
<td colspan="2"><font color="{th_text}"><b>{lang_Additional_settings}</b></font></td>
|
||||
</tr>
|
||||
<tr class="row_off">
|
||||
<td>
|
||||
{lang_Select_where_you_want_to_store/retrieve_filesystem_information}:
|
||||
<br>
|
||||
({lang_file_type,_size,_version,_etc.})
|
||||
</td>
|
||||
<td>
|
||||
<select name="newsettings[file_repository]">
|
||||
<option value="sql"{selected_file_repository_sql}>SQL</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row_off">
|
||||
<td>
|
||||
{lang_Select_where_you_want_to_store/retrieve_file_contents}:
|
||||
<br>
|
||||
({lang_Recommended:_Filesystem})
|
||||
</td>
|
||||
<td>
|
||||
<select name="newsettings[file_store_contents]">
|
||||
<option value="filesystem"{selected_file_store_contents_filesystem}>Filesystem</option>
|
||||
<option value="sql"{selected_file_store_contents_sql}>SQL</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- end from admin -->
|
||||
|
||||
<!-- END body -->
|
||||
|
||||
<!-- BEGIN footer -->
|
||||
<tr bgcolor="{th_bg}">
|
||||
<td colspan="2">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<input type="submit" name="submit" value="Submit">
|
||||
<input type="submit" name="cancel" value="Cancel">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<!-- END footer -->
|
Loading…
Reference in New Issue
Block a user