The header files now controls the template set to be used for login, applied some source formating, and minor code cleanup

This commit is contained in:
jengo 2001-05-11 10:02:34 +00:00
parent ae203b17bd
commit 11e95e9661
3 changed files with 92 additions and 95 deletions

View File

@ -1,83 +1,92 @@
<?php <?php
/**************************************************************************\ /**************************************************************************\
* phpGroupWare * * phpGroupWare *
* http://www.phpgroupware.org * * http://www.phpgroupware.org *
* This file written by Dan Kuykendall <seek3r@phpgroupware.org> * * This file written by Dan Kuykendall <seek3r@phpgroupware.org> *
* -------------------------------------------- * * -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it * * 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 * * 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 * * Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. * * option) any later version. *
\**************************************************************************/ \**************************************************************************/
/* $Id$ */ /* $Id$ */
/**************************************************************************\ /**************************************************************************\
* !!!!!!! EDIT THESE LINES !!!!!!!! * * !!!!!!! EDIT THESE LINES !!!!!!!! *
* This setting allows you to easily move the include directory and the * * This setting allows you to easily move the include directory and the *
* base of the phpGroupWare install. Simple edit the following 2 lines with * * base of the phpGroupWare install. Simple edit the following 2 lines with *
* the absolute path to fit your site, and you should be up and running. * * the absolute path to fit your site, and you should be up and running. *
\**************************************************************************/ \**************************************************************************/
define("PHPGW_SERVER_ROOT", "{SERVER_ROOT}"); define('PHPGW_SERVER_ROOT','{SERVER_ROOT}');
define("PHPGW_INCLUDE_ROOT", "{INCLUDE_ROOT}"); define('PHPGW_INCLUDE_ROOT','{INCLUDE_ROOT}');
$phpgw_info["server"]["header_admin_password"] = "{HEADER_ADMIN_PASSWORD}"; $phpgw_info['server']['header_admin_password'] = '{HEADER_ADMIN_PASSWORD}';
$phpgw_domain["default"] = array ( $phpgw_domain['default'] = array (
"db_host" => "{DB_HOST}", 'db_host' => '{DB_HOST}',
"db_name" => "{DB_NAME}", 'db_name' => '{DB_NAME}',
"db_user" => "{DB_USER}", 'db_user' => '{DB_USER}',
"db_pass" => "{DB_PASS}", 'db_pass' => '{DB_PASS}',
/* Look at the README file */ /* Look at the README file */
"db_type" => "{DB_TYPE}", 'db_type' => '{DB_TYPE}',
/* This will limit who is allowed to make configuration modifcations */ /* This will limit who is allowed to make configuration modifcations */
"config_passwd" => "{CONFIG_PASS}" 'config_passwd' => '{CONFIG_PASS}'
); );
/* If you want to have your domains in a select box, change to True */ /*
$phpgw_info["server"]["show_domain_selectbox"] = {DOMAIN_SELECTBOX}; ** If you want to have your domains in a select box, change to True
** If not, users will have to login as user@domain
** Note: This is only for virtual domian support, default domain users can login only using
** there loginid.
*/
$phpgw_info['server']['show_domain_selectbox'] = {DOMAIN_SELECTBOX};
/* This is used to control mcrypt's use */ /* Select which login template set you want, most people will use default */
$phpgw_info["server"]["mcrypt_enabled"] = {ENABLE_MCRYPT}; $phpgw_info['login_template_set'] = 'default';
/* Set this to "old" for versions < 2.4, otherwise the exact mcrypt version you use. */
$phpgw_info["server"]["versions"]["mcrypt"] = "{MCRYPT_VERSION}";
/* This is a random string used as the initilazation vector for mcrypt /* This is used to control mcrypt's use */
feel free to change it when setting up phpgroupware on a clean database, $phpgw_info['server']['mcrypt_enabled'] = {ENABLE_MCRYPT};
but you must not change it after that point! /* Set this to "old" for versions < 2.4, otherwise the exact mcrypt version you use. */
It should be around 30 bytes in length. $phpgw_info['server']['versions']['mcrypt'] = '{MCRYPT_VERSION}';
/*
** This is a random string used as the initilazation vector for mcrypt
** feel free to change it when setting up phpgroupware on a clean database,
** but you must not change it after that point!
** It should be around 30 bytes in length.
*/ */
$phpgw_info["server"]["mcrypt_iv"] = "{MCRYPT_IV}"; $phpgw_info['server']['mcrypt_iv'] = '{MCRYPT_IV}';
/* Uncomment this out and use this for supporting different domains using this single install */ /* Uncomment this out and use this for supporting different domains using this single install */
/* (ignore if you are only supporting a single domain)*/ /* (ignore if you are only supporting a single domain)*/
/* /*
$phpgw_domain["domain2.com"] = array ( $phpgw_domain['domain2.com'] = array (
"db_host" => "localhost", 'db_host' => 'localhost',
"db_name" => "phpgw_domain2", 'db_name' => 'phpgw_domain2',
"db_user" => "phpgroupware", 'db_user' => 'phpgroupware',
"db_pass" => "their_password", 'db_pass' => 'their_password',
"db_type" => "mysql", 'db_type' => 'mysql',
"config_passwd" => "changeme" 'config_passwd' => 'changeme'
); );
*/ */
/* If you do not want phpGroupWare to be cached by proxy servers, uncomment the following */ /* If you do not want phpGroupWare to be cached by proxy servers, uncomment the following */
/* This is recommended, but not required. */ /* This is recommended, but not required. */
//header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 //header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1
//header("Pragma: no-cache"); // HTTP/1.0 //header('Pragma: no-cache'); // HTTP/1.0
/**************************************************************************\ /**************************************************************************\
* Do not edit these lines * * Do not edit these lines *
\**************************************************************************/ \**************************************************************************/
define("PHPGW_API_INC", PHPGW_INCLUDE_ROOT."/phpgwapi/inc"); define('PHPGW_API_INC',PHPGW_INCLUDE_ROOT.'/phpgwapi/inc');
include(PHPGW_SERVER_ROOT."/version.inc.php"); include(PHPGW_SERVER_ROOT.'/version.inc.php');
$phpgw_info["server"]["versions"]["header"] = "1.11"; $phpgw_info['server']['versions']['header'] = '1.12';
// This is a fix for NT // This is a fix for NT
if (!isset($phpgw_info["flags"]["noapi"]) || if (!isset($phpgw_info['flags']['noapi']) || !$phpgw_info['flags']['noapi'] == True)
!$phpgw_info["flags"]["noapi"] == True){ {
include(PHPGW_API_INC . "/functions.inc.php"); include(PHPGW_API_INC . '/functions.inc.php');
} }
// Leave off the final php closing tag, some editors will add // Leave off the final php closing tag, some editors will add
// a \n or space after which will mess up cookies later on // a \n or space after which will mess up cookies later on

View File

@ -21,12 +21,23 @@
); );
include('./header.inc.php'); include('./header.inc.php');
$deny_login = False; $phpgw_info['server']['template_dir'] = PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $phpgw_info['login_template_set'];
$tmpl = CreateObject('phpgwapi.Template', $phpgw_info['server']['template_dir']);
// This is used for system downtime, to prevent new logins.
if ($phpgw_info['server']['deny_all_logins'])
{
$tmpl->set_file(array(
'login_form' => 'login_denylogin.tpl'
));
$tmpl->set_var('template_set','default');
$tmpl->pfp('loginout','login_form');
exit;
}
// !! NOTE !! // !! NOTE !!
// Do NOT and I repeat, do NOT touch ANYTHING to do with lang in this file. // Do NOT and I repeat, do NOT touch ANYTHING to do with lang in this file.
// If there is a problem, tell me and I will fix it. (jengo) // If there is a problem, tell me and I will fix it. (jengo)
/* /*
if ($code != 10 && $phpgw_info['server']['usecookies'] == False) if ($code != 10 && $phpgw_info['server']['usecookies'] == False)
@ -47,9 +58,6 @@
} }
*/ */
$phpgw_info['server']['template_dir'] = PHPGW_SERVER_ROOT . '/phpgwapi/templates/default';
$tmpl = CreateObject('phpgwapi.Template', $phpgw_info['server']['template_dir']);
if (! $deny_login && ! $phpgw_info['server']['show_domain_selectbox']) if (! $deny_login && ! $phpgw_info['server']['show_domain_selectbox'])
{ {
$tmpl->set_file(array('login_form' => 'login.tpl')); $tmpl->set_file(array('login_form' => 'login.tpl'));
@ -60,21 +68,6 @@
$tmpl->set_file(array('login_form' => 'login_selectdomain.tpl')); $tmpl->set_file(array('login_form' => 'login_selectdomain.tpl'));
$tmpl->set_var('charset',lang('charset')); $tmpl->set_var('charset',lang('charset'));
} }
else
{
$tmpl->set_file(array('login_form' => 'login_denylogin.tpl'));
}
// When I am updating my server, I don't want people logging in a messing
// things up.
function deny_login()
{
global $tmpl;
$tmpl->set_var('template_set','default');
$tmpl->pfp('loginout','login_form');
exit;
}
function show_cookie() function show_cookie()
{ {
@ -112,11 +105,6 @@
} }
/* Program starts here */ /* Program starts here */
if ($deny_login)
{
deny_login();
}
if ($phpgw_info['server']['auth_type'] == 'http' && isset($PHP_AUTH_USER)) if ($phpgw_info['server']['auth_type'] == 'http' && isset($PHP_AUTH_USER))
{ {
@ -264,7 +252,7 @@
$tmpl->set_var('version',$phpgw_info['server']['versions']['phpgwapi']); $tmpl->set_var('version',$phpgw_info['server']['versions']['phpgwapi']);
$tmpl->set_var('lang_password',lang('password')); $tmpl->set_var('lang_password',lang('password'));
$tmpl->set_var('lang_login',lang('login')); $tmpl->set_var('lang_login',lang('login'));
$tmpl->set_var('template_set','default'); $tmpl->set_var('template_set',$phpgw_info['login_template_set']);
$tmpl->pfp('loginout','login_form'); $tmpl->pfp('loginout','login_form');
?> ?>

View File

@ -12,4 +12,4 @@
/* $Id$ */ /* $Id$ */
$phpgw_info['server']['versions']['phpgwapi'] = '0.9.11.009'; $phpgw_info['server']['versions']['phpgwapi'] = '0.9.11.009';
$phpgw_info['server']['versions']['current_header'] = '1.11'; $phpgw_info['server']['versions']['current_header'] = '1.12';