Now using the same template files as the admin/config.php - only api/admin/prefs templates

are included, and all are saved in the config table as appname='phpgwapi'.
This commit is contained in:
Miles Lott 2001-09-21 20:14:04 +00:00
parent 49751a6a73
commit 4ef07f8d67
4 changed files with 321 additions and 11 deletions

View File

@ -1,15 +1,160 @@
<!-- begin config_post_script.tpl -->
<tr bgcolor="FFFFFF">
<!-- 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}">&nbsp;<b>{title}</b></font></td>
</tr>
<!-- END header -->
<!-- BEGIN body -->
<tr bgcolor="{row_on}">
<td colspan="2">&nbsp;</td>
</tr>
<tr bgcolor="{th_bg}">
<td colspan="2"><font color="{th_text}"><b>{lang_Authentication_/_Accounts}</b></font></td>
</tr>
<tr bgcolor="{row_off}">
<td>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="pam"{selected_auth_type_pam}>PAM (Not Ready)</option>
</select>
</td>
</tr>
<tr bgcolor="{row_off}">
<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 bgcolor="{row_off}">
<td>{lang_Select_where_you_want_to_store/retrieve_filesystem_information}:</td>
<td>
<select name="newsettings[file_repository]">
<option value="sql"{selected_file_repository_sql}>SQL</option>
</select>
</td>
</tr>
<tr bgcolor="{row_off}">
<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 bgcolor="{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 bgcolor="{row_off}">
<td>{lang_If_using_LDAP,_do_you_want_to_manage_homedirectory_and_loginshell_attributes?}:</td>
<td>
<select name="newsettings[ldap_extra_attributes]">
<option value="">No</option>
<option value="True"{selected_ldap_extra_attributes_True}>Yes</option>
</select>
</td>
</tr>
<tr bgcolor="{row_off}">
<td>&nbsp;&nbsp;&nbsp;{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 bgcolor="{row_off}">
<td>&nbsp;&nbsp;&nbsp;{lang_LDAP_Default_shell_(e.g._/bin/bash)}:</td>
<td><input name="newsettings[ldap_account_shell]" value="{value_ldap_account_shell}"></td>
</tr>
<tr bgcolor="{row_off}">
<td>{lang_Auto_create_account_records_for_authenticated_users}:</td>
<td>
<select name="newsettings[auto_create_acct]">
<option value="">No</option>
<option value="True"{selected_auto_create_acct_True}>Yes</option>
</select>
</td>
</tr>
<tr bgcolor="{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 bgcolor="{row_off}">
<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}>Deny Access</option>
<option value="grant"{selected_acl_default_grant}>Grant Access</option>
</select>
</td>
</tr>
<tr bgcolor="{row_off}">
<td>{lang_LDAP_host}:</td>
<td><input name="newsettings[ldap_host]" value="{value_ldap_host}"></td>
</tr>
<tr bgcolor="{row_off}">
<td>{lang_LDAP_accounts_context}:</td>
<td><input name="newsettings[ldap_context]" value="{value_ldap_context}" size="40"></td>
</tr>
<tr bgcolor="{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 bgcolor="{row_off}">
<td>{lang_LDAP_rootdn}:</td>
<td><input name="newsettings[ldap_root_dn]" value="{value_ldap_root_dn}" size="40"></td>
</tr>
<tr bgcolor="{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 bgcolor="{row_off}">
<td>{lang_LDAP_encryption_type}:</td>
<td>
<select name="newsettings[ldap_encryption_type]">
<option value="DES"{selected_ldap_encryption_type_DES}>DES</option>
<option value="MD5"{selected_ldap_encryption_type_MD5}>MD5</option>
</select>
</td>
</tr>
<tr bgcolor="{row_off}">
<td>{lang_Enter_some_random_text_for_app_session_<br>encryption_(requires_mcrypt)}:</td>
<td><input name="newsettings[encryptkey]" value="{value_encryptkey}" size="40"></td>
</tr>
<!-- END body -->
<!-- BEGIN footer -->
<tr bgcolor="{th_bg}">
<td colspan="2">
&nbsp;
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="{lang_submit}">
<input type="submit" name="cancel" value="{lang_cancel}">
<input type="submit" name="submit" value="Submit">
<input type="submit" name="cancel" value="Cancel">
</td>
</tr>
</table>
</form>
<!-- end config_post_script.tpl -->
<!-- END footer -->

View File

@ -0,0 +1,82 @@
<!-- 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}">&nbsp;<b>{title}</b></font></td>
</tr>
<!-- END header -->
<!-- BEGIN body -->
<tr bgcolor="{th_bg}">
<td colspan="2"><font color="{th_text}">&nbsp;<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_off}">
<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_&nbsp;_or_&nbsp;_/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 colspan="2">&nbsp;</td>
</tr>
<tr bgcolor="{th_bg}">
<td colspan="2"><font color="{th_text}">&nbsp;<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_off}">
<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="">No</option>
<option value="True"{selected_ftp_use_mime_True}>Yes</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_off}">
<td>{lang_Enter_your_HTTP_proxy_server_port}:</td>
<td><input name="newsettings[httpproxy_port]" value="{value_httpproxy_port}"></td>
</tr>
<!-- END body -->
<!-- BEGIN footer -->
<tr bgcolor="{th_bg}">
<td colspan="2">
&nbsp;
</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 -->

View File

@ -10,8 +10,8 @@
<td colspan="2">&nbsp;</td>
</tr>
<tr bgcolor="{row_off}">
<td colspan="2">&nbsp;<b>{lang_Preferences}</b></td>
<tr bgcolor="{th_bg}">
<td colspan="2"><font color="{th_text}"><b>{lang_Preferences}</b></font></td>
</tr>
<tr bgcolor="{row_on}">
@ -99,7 +99,7 @@
</tr>
<tr bgcolor="{row_on}">
<td>{lang_Would_you_like_phpGroupWare_to_cache_the_phpgw_info_array ?}:</td>
<td>{lang_Would_you_like_phpGroupWare_to_cache_the_phpgw_info_array_?}:</td>
<td>
<select name="newsettings[cache_phpgw_info]">
<option value="">No</option>
@ -109,7 +109,7 @@
</tr>
<tr bgcolor="{row_off}">
<td>{lang_Deny_all_users_access_to_grant_other_users_access_to_there_entrys ?}:</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="">No</option>

View File

@ -41,7 +41,8 @@
}
$phpgw_setup->loaddb();
/* Guessing default paths. */
/* Guessing default values. */
$GLOBALS['current_config']['hostname'] = $HTTP_HOST;
$GLOBALS['current_config']['files_dir'] = ereg_replace('/setup','/files',dirname($SCRIPT_FILENAME));
if (is_dir('/tmp'))
{
@ -142,7 +143,89 @@
$setup_tpl->pparse('out','T_config_pre_script');
$phpgw_setup->execute_script('config',array('phpgwapi','admin','preferences')); /* ;,'preferences','email','nntp')); */
/* Now parse each of the templates we want to show here */
class phpgw
{
var $common;
var $accounts;
var $applications;
var $db;
}
$phpgw = new phpgw;
$phpgw->common = CreateObject('phpgwapi.common');
$cfg_apps = array('phpgwapi','admin','preferences');
while(list(,$cfg_app) = each($cfg_apps))
{
$t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir($cfg_app));
$t->set_unknowns('keep');
$t->set_file(array('config' => 'config.tpl'));
$t->set_block('config','body','body');
$t->set_var('th_bg', '486591');
$t->set_var('th_text', 'FFFFFF');
$t->set_var('row_on', 'DDDDDD');
$t->set_var('row_off', 'EEEEEE');
$vars = $t->get_undefined('body');
$phpgw->common->hook_single('config',$cfg_app);
while (list($null,$value) = each($vars))
{
$valarray = explode('_',$value);
$type = $valarray[0];
$new = $newval = '';
while($chunk = next($valarray))
{
$new[] = $chunk;
}
$newval = implode(' ',$new);
switch ($type)
{
case 'lang':
$t->set_var($value,lang($newval));
break;
case 'value':
$newval = ereg_replace(' ','_',$newval);
$t->set_var($value,$current_config[$newval]);
break;
case 'selected':
$configs = array();
$config = '';
$newvals = explode(' ',$newval);
$setting = end($newvals);
for ($i=0;$i<(count($newvals) - 1); $i++)
{
$configs[] = $newvals[$i];
}
$config = implode('_',$configs);
/* echo $config . '=' . $current_config[$config]; */
if ($current_config[$config] == $setting)
{
$t->set_var($value,' selected');
}
else
{
$t->set_var($value,'');
}
break;
case 'hook':
$newval = ereg_replace(' ','_',$newval);
$t->set_var($value,$newval($current_config));
break;
default:
$t->set_var($value,'');
break;
}
}
$t->pfp('out','body');
unset($t);
}
//$phpgw_setup->execute_script('config',array('phpgwapi','admin','preferences')); /* ;,'preferences','email','nntp')); */
$setup_tpl->set_var('more_configs',lang('Please login to phpgroupware and run the admin application for additional site configuration') . '.');
$setup_tpl->set_var('lang_submit',lang('submit'));