mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-27 16:29:22 +01:00
new login page using the framework class(es)
This commit is contained in:
parent
80d063e041
commit
c9377bfc61
@ -130,6 +130,27 @@ class egw_framework
|
||||
die('virtual, need to be reimplemented in the template!!!');
|
||||
}
|
||||
|
||||
/**
|
||||
* displays a login screen
|
||||
*
|
||||
* @string $extra_vars for login url
|
||||
* @return string
|
||||
*/
|
||||
function login_screen($extra_vars)
|
||||
{
|
||||
die('virtual, need to be reimplemented in the template!!!');
|
||||
}
|
||||
|
||||
/**
|
||||
* displays a login denied message
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function denylogin_screen()
|
||||
{
|
||||
die('virtual, need to be reimplemented in the template!!!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get footer as array to eg. set as vars for a template (from idots' head.inc.php)
|
||||
*
|
||||
|
@ -1,147 +1,66 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset={charset}" />
|
||||
<meta name="author" content="eGroupWare http://www.egroupware.org" />
|
||||
<meta name="description" content="eGroupWare login screen" />
|
||||
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
|
||||
<meta name="keywords" content="eGroupWare login screen" />
|
||||
<link rel="stylesheet" href="phpgwapi/templates/{template_set}/css/idots.css" type="text/css" />
|
||||
<link rel="icon" href="phpgwapi/templates/idots/images/favicon.ico" type="image/x-ico" />
|
||||
<link rel="shortcut icon" href="phpgwapi/templates/idots/images/favicon.ico" />
|
||||
<title>{website_title} - Login</title>
|
||||
<style type="text/css">
|
||||
<div id="divLogo"><a href="{logo_url}" target="_blank"><img src="{logo_file}" border="0" alt="{logo_title}" title="{logo_title}" /></a></div>
|
||||
|
||||
#divMain
|
||||
{
|
||||
height:85%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<!-- this solves the internet explorer png-transparency bug, but only for ie 5.5 and higher -->
|
||||
<!--[if gte ie 5.5000]>
|
||||
<script src="./phpgwapi/templates/idots/js/pngfix.js" type=text/javascript>
|
||||
</script>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="divLogo"><a href="{logo_url}" target="_blank"><img src="{logo_file}" border="0" alt="{logo_title}" title="{logo_title}"/></a></div>
|
||||
|
||||
<div id="divMain"style= "background-repeat:no-repeat;background-position: center center;background-image:url(./phpgwapi/templates/idots/images/login-background.jpg)">
|
||||
<div id="divAppIconBar">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="180"></td>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="100%"><img src="./phpgwapi/templates/idots/images/spacer.gif" width="1" height="68" alt="spacer" /></td>
|
||||
<div id="loginMainDiv">
|
||||
<div id="divAppIconBar"></div>
|
||||
<div id="centerBox">
|
||||
<div id="loginScreenMessage">{lang_message}</div>
|
||||
<div id="loginCdMessage">{cd}</div>
|
||||
<form name="login_form" method="post" action="{login_url}">
|
||||
<table class="divLoginbox divSideboxEntry" cellspacing="0" cellpadding="2" border="0" align="center">
|
||||
<tr class="divLoginboxHeader">
|
||||
<td colspan="3">{website_title}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<tr>
|
||||
<td colspan="2" height="20">
|
||||
<input type="hidden" name="passwd_type" value="text" />
|
||||
<input type="hidden" name="account_type" value="u" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<!--</div>-->
|
||||
<div id="containerDiv" >
|
||||
<div id="centerBox">
|
||||
<div align="center">{lang_message}</div>
|
||||
<div align="center">{cd}</div>
|
||||
<p> </p>
|
||||
<form name="login_form" method="post" action="{login_url}">
|
||||
<table class="divLoginbox" cellspacing="0" cellpadding="0" border="0" align="center">
|
||||
<tr>
|
||||
<td class="divLoginboxHeader" style="border-bottom: #9c9c9c 1px solid;" align="center">{website_title}</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td class="divSideboxEntry">
|
||||
|
||||
<table cellspacing="3" cellpadding="0" width="100%" border="0">
|
||||
<tr>
|
||||
<td colspan="4" align="center">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<input type="hidden" name="passwd_type" value="text">
|
||||
<input type="hidden" name="account_type" value="u">
|
||||
</td>
|
||||
<td rowspan="4">
|
||||
<td rowspan="6">
|
||||
<img src="phpgwapi/templates/{template_set}/images/password.png" />
|
||||
</td>
|
||||
</tr>
|
||||
<!-- BEGIN language_select -->
|
||||
<tr>
|
||||
<td align="right">{lang_language}: </td>
|
||||
<td align="left" colspan="2">{select_language}</td>
|
||||
<td>{select_language}</td>
|
||||
</tr>
|
||||
<!-- END language_select -->
|
||||
<!-- BEGIN domain_selection -->
|
||||
{select_domain}
|
||||
<!--<tr>
|
||||
<td align="right" tablindex="1">{lang_select_domain}: </td>
|
||||
<td align="left">{select_domain}</td>
|
||||
<td align="left"></td>
|
||||
</tr>-->
|
||||
<tr>
|
||||
<td align="right">{lang_domain}: </td>
|
||||
<td>{select_domain}</td>
|
||||
</tr>
|
||||
<!-- END domain_selection -->
|
||||
<!-- BEGIN remember_me_selection -->
|
||||
<tr>
|
||||
<td align="right">{lang_remember_me}: </td>
|
||||
<td align="left" colspan="2">{select_remember_me}</td>
|
||||
<td>{select_remember_me}</td>
|
||||
</tr>
|
||||
<!-- END remember_me_selection -->
|
||||
|
||||
<tr>
|
||||
<td align="right" tablindex="1">{lang_username}: </td>
|
||||
<td align="left"><input name="login" value="{cookie}" style="width: 150px; border: 1px solid silver;"></td>
|
||||
<td align="left"></td>
|
||||
<td align="right">{lang_username}: </td>
|
||||
<td><input name="login" tablindex="1" value="{cookie}" size="30" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">{lang_password}: </td>
|
||||
<td align="left"><input name="passwd" type="password" onChange="this.form.submit()" style="width: 150px; border: 1px solid silver;"></td>
|
||||
<td><input name="passwd" type="password" onChange="this.form.submit()" size="30" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"> </td>
|
||||
<td align="left" style="margin-top:5px;">
|
||||
<input type="submit" value="{lang_login}" name="submitit" style="width:100px">
|
||||
<td> </td>
|
||||
<td>
|
||||
<input type="submit" value=" {lang_login} " name="submitit" />
|
||||
</td>
|
||||
</tr>
|
||||
<!-- BEGIN registration -->
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<table width=100%>
|
||||
<tr>
|
||||
<td>{lostpassword_link}</td>
|
||||
<td>{lostid_link}</td>
|
||||
</tr>
|
||||
<tr><td colspan=2 align="center">{register_link}</td></tr>
|
||||
</table>
|
||||
<td colspan="3" height="20" align="center">
|
||||
{lostpassword_link}
|
||||
{lostid_link}
|
||||
{register_link}
|
||||
</td>
|
||||
</tr>
|
||||
<!-- END registration -->
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
</form>
|
||||
<script language="javascript1.2" type="text/javascript">
|
||||
<!--
|
||||
// position cursor in top form field
|
||||
document.login_form.login.focus();
|
||||
//-->
|
||||
</script>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,14 +1,6 @@
|
||||
|
||||
<!-- BEGIN form -->
|
||||
<body bgcolor="#ffffff">
|
||||
<a href="http://www.egroupware.org"><img src="phpgwapi/templates/idots/images/logo.png" alt="eGroupWare" border="0"></a>
|
||||
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
<td align="center">
|
||||
{deny_msg}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<a href="http://www.egroupware.org"><img src="phpgwapi/templates/idots/images/logo.png" alt="eGroupWare" border="0" /></a>
|
||||
|
||||
<h1 style="text-align: center;">{deny_msg}</h1>
|
||||
<!-- END form -->
|
||||
|
@ -196,6 +196,190 @@ class idots_framework extends egw_framework
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* displays a login screen
|
||||
*
|
||||
* @param string $extra_vars for login url
|
||||
*/
|
||||
function login_screen($extra_vars)
|
||||
{
|
||||
$tmpl =& new Template($GLOBALS['egw_info']['server']['template_dir']);
|
||||
if (!is_object($GLOBALS['egw']->html))
|
||||
{
|
||||
require_once(EGW_API_INC.'/class.html.inc.php');
|
||||
$GLOBALS['egw']->html = new html;
|
||||
}
|
||||
$tmpl->set_file(array('login_form' => 'login.tpl'));
|
||||
|
||||
$tmpl->set_var('lang_message',$GLOBALS['loginscreenmessage']);
|
||||
|
||||
$last_loginid = $_COOKIE['last_loginid'];
|
||||
|
||||
if($GLOBALS['egw_info']['server']['show_domain_selectbox'])
|
||||
{
|
||||
foreach($GLOBALS['egw_domain'] as $domain => $data)
|
||||
{
|
||||
$domains[$domain] = $domain;
|
||||
}
|
||||
$tmpl->set_var(array(
|
||||
'lang_domain' => lang('domain'),
|
||||
'select_domain' => $GLOBALS['egw']->html->select('logindomain',$_COOKIE['last_domain'],$domains,true),
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* trick to make domain section disapear */
|
||||
$tmpl->set_var('domain_selection',$GLOBALS['egw_info']['user']['domain'] ?
|
||||
$GLOBALS['egw']->html->input_hidden('logindomain',$GLOBALS['egw_info']['user']['domain']) : '');
|
||||
|
||||
if($last_loginid !== '')
|
||||
{
|
||||
reset($GLOBALS['egw_domain']);
|
||||
list($default_domain) = each($GLOBALS['egw_domain']);
|
||||
|
||||
if($_COOKIE['last_domain'] != $default_domain && !empty($_COOKIE['last_domain']))
|
||||
{
|
||||
$last_loginid .= '@' . $_COOKIE['last_domain'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require_once(EGW_API_INC.'/class.config.inc.php');
|
||||
$cnf_reg =& new config('registration');
|
||||
$cnf_reg->read_repository();
|
||||
$config_reg = $cnf_reg->config_data;
|
||||
unset($cnf_reg);
|
||||
|
||||
if($config_reg['enable_registration'] == 'True')
|
||||
{
|
||||
if ($config_reg['register_link'] == 'True')
|
||||
{
|
||||
$reg_link=' <a href="'. $GLOBALS['egw']->link('/registration/index.php','lang_code='.$_GET['lang']). '">'.lang('Not a user yet? Register now').'</a><br/>';
|
||||
}
|
||||
if ($config_reg['lostpassword_link'] == 'True')
|
||||
{
|
||||
$lostpw_link=' <a href="'. $GLOBALS['egw']->link('/registration/index.php','menuaction=registration.uireg.lostpw_step1_ask_login&lang_code='.$_GET['lang']). '">'.lang('Lost password').'</a><br/>';
|
||||
}
|
||||
if ($config_reg['lostid_link'] == 'True')
|
||||
{
|
||||
$lostid_link=' <a href="'. $GLOBALS['egw']->link('/registration/index.php','menuaction=registration.uireg.lostid_step1_ask_email&lang_code='.$_GET['lang']). '">'.lang('Lost Login Id').'</a><br/>';
|
||||
}
|
||||
|
||||
/* if at least one option of "registration" is activated display the registration section */
|
||||
if($config_reg['register_link'] == 'True' || $config_reg['lostpassword_link'] == 'True' || $config_reg['lostid_link'] == 'True')
|
||||
{
|
||||
$tmpl->set_var(array(
|
||||
'register_link' => $reg_link,
|
||||
'lostpassword_link' => $lostpw_link,
|
||||
'lostid_link' => $lostid_link,
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* trick to make registration section disapear */
|
||||
$tmpl->set_block('login_form','registration');
|
||||
$tmpl->set_var('registration','');
|
||||
}
|
||||
}
|
||||
|
||||
$tmpl->set_var('login_url', $GLOBALS['egw_info']['server']['webserver_url'] . '/login.php' . $extra_vars);
|
||||
$tmpl->set_var('version',$GLOBALS['egw_info']['server']['versions']['phpgwapi']);
|
||||
$tmpl->set_var('cd',check_logoutcode($_GET['cd']));
|
||||
$tmpl->set_var('cookie',$last_loginid);
|
||||
|
||||
$tmpl->set_var('lang_username',lang('username'));
|
||||
$tmpl->set_var('lang_password',lang('password'));
|
||||
$tmpl->set_var('lang_login',lang('login'));
|
||||
|
||||
$tmpl->set_var('website_title', $GLOBALS['egw_info']['server']['site_title']);
|
||||
$tmpl->set_var('template_set',$this->template);
|
||||
|
||||
if (substr($GLOBALS['egw_info']['server']['login_logo_file'],0,4) == 'http')
|
||||
{
|
||||
$var['logo_file'] = $GLOBALS['egw_info']['server']['login_logo_file'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$var['logo_file'] = $GLOBALS['egw']->common->image('phpgwapi',$GLOBALS['egw_info']['server']['login_logo_file']?$GLOBALS['egw_info']['server']['login_logo_file']:'logo');
|
||||
}
|
||||
$var['logo_url'] = $GLOBALS['egw_info']['server']['login_logo_url']?$GLOBALS['egw_info']['server']['login_logo_url']:'http://www.eGroupWare.org';
|
||||
if (substr($var['logo_url'],0,4) != 'http')
|
||||
{
|
||||
$var['logo_url'] = 'http://'.$var['logo_url'];
|
||||
}
|
||||
$var['logo_title'] = $GLOBALS['egw_info']['server']['login_logo_title']?$GLOBALS['egw_info']['server']['login_logo_title']:'www.eGroupWare.org';
|
||||
$tmpl->set_var($var);
|
||||
|
||||
/* language section if activated in site config */
|
||||
if (@$GLOBALS['egw_info']['server']['login_show_language_selection'])
|
||||
{
|
||||
$tmpl->set_var(array(
|
||||
'lang_language' => lang('Language'),
|
||||
'select_language' => $GLOBALS['egw']->html->select('lang',$GLOBALS['egw_info']['user']['preferences']['common']['lang'],
|
||||
$GLOBALS['egw']->translation->get_installed_langs(),true),
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpl->set_block('login_form','language_select');
|
||||
$tmpl->set_var('language_select','');
|
||||
}
|
||||
|
||||
/********************************************************\
|
||||
* Check if authentification via cookies is allowed *
|
||||
* and place a time selectbox, how long cookie is valid *
|
||||
\********************************************************/
|
||||
|
||||
if($GLOBALS['egw_info']['server']['allow_cookie_auth'])
|
||||
{
|
||||
$tmpl->set_block('login_form','remember_me_selection');
|
||||
$tmpl->set_var('lang_remember_me',lang('Remember me'));
|
||||
$tmpl->set_var('select_remember_me',$GLOBALS['egw']->html->select('remember_me', 'forever', array(
|
||||
false => lang('not'),
|
||||
'1hour' => lang('1 Hour'),
|
||||
'1day' => lang('1 Day'),
|
||||
'1week'=> lang('1 Week'),
|
||||
'1month' => lang('1 Month'),
|
||||
'forever' => lang('Forever'),
|
||||
),true));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* trick to make remember_me section disapear */
|
||||
$tmpl->set_block('login_form','remember_me_selection');
|
||||
$tmpl->set_var('remember_me_selection','');
|
||||
}
|
||||
$tmpl->set_var('autocomplete', ($GLOBALS['egw_info']['server']['autocomplete_login'] ? 'autocomplete="off"' : ''));
|
||||
|
||||
if (!is_object($GLOBALS['egw']->js))
|
||||
{
|
||||
require_once(EGW_API_INC.'/class.javascript.inc.php');
|
||||
$GLOBALS['egw']->js = new javascript();
|
||||
}
|
||||
$GLOBALS['egw']->js->set_onload('document.login_form.login.focus();');
|
||||
|
||||
$this->render($tmpl->fp('loginout','login_form'),false,false);
|
||||
}
|
||||
|
||||
/**
|
||||
* displays a login denied message
|
||||
*/
|
||||
function denylogin_screen()
|
||||
{
|
||||
$tmpl =& new Template($GLOBALS['egw_info']['server']['template_dir']);
|
||||
|
||||
$tmpl->set_file(array(
|
||||
'login_form' => 'login_denylogin.tpl'
|
||||
));
|
||||
|
||||
$tmpl->set_var(array(
|
||||
'template_set' => 'default',
|
||||
'deny_msg' => lang('Oops! You caught us in the middle of system maintainance.').
|
||||
'<br />'.lang('Please, check back with us shortly.'),
|
||||
));
|
||||
$this->render($tmpl->fp('loginout','login_form'),false,false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get navbar as array to eg. set as vars for a template (from idots' navbar.inc.php)
|
||||
*
|
||||
@ -220,7 +404,8 @@ class idots_framework extends egw_framework
|
||||
|
||||
if($GLOBALS['egw_info']['user']['userid'] == 'anonymous')
|
||||
{
|
||||
$cnf_reg =& CreateObject('phpgwapi.config','registration');
|
||||
require_once(EGW_API_INC.'/class.config.inc.php');
|
||||
$cnf_reg =& new config('registration');
|
||||
$cnf_reg->read_repository();
|
||||
$config_reg = $cnf_reg->config_data;
|
||||
unset($cnf_reg);
|
||||
|
@ -72,7 +72,6 @@ a:hover,a:active
|
||||
body
|
||||
{
|
||||
background-image:url(../images/body-background.png);
|
||||
padding:3px;
|
||||
}
|
||||
|
||||
form
|
||||
@ -234,13 +233,15 @@ a.textSidebox
|
||||
|
||||
body {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#divMain
|
||||
#divMain,#loginMainDiv
|
||||
{
|
||||
background-color:white;
|
||||
padding:9px;
|
||||
border:solid 1px #7e7e7e;
|
||||
background-color: white;
|
||||
padding: 8px;
|
||||
margin: 8px;
|
||||
border: solid 1px #7e7e7e;
|
||||
}
|
||||
|
||||
#divLogo
|
||||
@ -376,3 +377,30 @@ body {
|
||||
height: 15px;
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
/*
|
||||
Login page
|
||||
*/
|
||||
#loginMainDiv {
|
||||
padding-top: 24px;
|
||||
height: 640px; /* 95% does not work */
|
||||
position: relative;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-image: url(../images/login-background.jpg);
|
||||
}
|
||||
#loginScreenMessage {
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
}
|
||||
#loginCdMessage {
|
||||
text-align: center;
|
||||
padding-bottom: 10px;
|
||||
color: red;
|
||||
font-style: italic;
|
||||
}
|
||||
.divLoginboxHeader {
|
||||
text-align: center;
|
||||
border: #9c9c9c 1px solid; /* does NOT work */
|
||||
padding: 0px;
|
||||
}
|
||||
|
@ -1,219 +0,0 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare *
|
||||
* http://www.egroupware.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$ */
|
||||
|
||||
//to test:
|
||||
// no login
|
||||
|
||||
function login_fetch_select_domain()
|
||||
{
|
||||
$tmpl = CreateObject('phpgwapi.Template', $GLOBALS['egw_info']['server']['template_dir']);
|
||||
|
||||
$lang_domain_select = ' ';
|
||||
// $lang_domain_select = lang('Domain');
|
||||
|
||||
$domain_select = ' ';
|
||||
$domain_select = "<select name=\"logindomain\">\n";
|
||||
foreach($GLOBALS['egw_domain'] as $domain_name => $domain_vars)
|
||||
{
|
||||
$domain_select .= '<option value="' . $domain_name . '"';
|
||||
|
||||
if($domain_name == $_COOKIE['last_domain'])
|
||||
{
|
||||
$domain_select .= ' selected';
|
||||
}
|
||||
$domain_select .= '>' . $domain_name . "</option>\n";
|
||||
}
|
||||
$domain_select .= "</select>\n";
|
||||
|
||||
return '<tr>
|
||||
<td align="right" tablindex="1">'.lang('Domain').': </td>
|
||||
<td align="left">'.$domain_select.'</td>
|
||||
<td align="left"></td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
function parse_login_screen($extra_vars)
|
||||
{
|
||||
$tmpl = CreateObject('phpgwapi.Template', $GLOBALS['egw_info']['server']['template_dir']);
|
||||
$tmpl->set_file(array('login_form' => 'login.tpl'));
|
||||
|
||||
$tmpl->set_var('lang_message',$GLOBALS['loginscreenmessage']);
|
||||
|
||||
//$tmpl->set_block('login_form','domain_selection');
|
||||
$last_loginid = $_COOKIE['last_loginid'];
|
||||
|
||||
if($GLOBALS['egw_info']['server']['show_domain_selectbox'])
|
||||
{
|
||||
$domain_select = login_fetch_select_domain();
|
||||
}
|
||||
elseif($last_loginid !== '')
|
||||
{
|
||||
reset($GLOBALS['egw_domain']);
|
||||
list($default_domain) = each($GLOBALS['egw_domain']);
|
||||
|
||||
if($_COOKIE['last_domain'] != $default_domain && !empty($_COOKIE['last_domain']))
|
||||
{
|
||||
$last_loginid .= '@' . $_COOKIE['last_domain'];
|
||||
}
|
||||
}
|
||||
|
||||
//$tmpl->set_var('lang_select_domain',$lang_domain_select);
|
||||
$tmpl->set_var('select_domain',$domain_select);
|
||||
|
||||
if(!$GLOBALS['egw_info']['server']['show_domain_selectbox'])
|
||||
{
|
||||
/* trick to make domain section disapear */
|
||||
$tmpl->set_var('domain_selection',$GLOBALS['egw_info']['user']['domain'] ?
|
||||
'<input type="hidden" name="logindomain" value="'.htmlspecialchars($GLOBALS['egw_info']['user']['domain']).'" />' : '');
|
||||
}
|
||||
|
||||
$cnf_reg =& CreateObject('phpgwapi.config','registration');
|
||||
$cnf_reg->read_repository();
|
||||
$config_reg = $cnf_reg->config_data;
|
||||
|
||||
if($config_reg[enable_registration]=='True')
|
||||
{
|
||||
if ($config_reg[register_link]=='True')
|
||||
{
|
||||
$reg_link=' <a href="'. $GLOBALS['egw']->link('/registration/index.php','lang_code='.$_GET['lang']). '">'.lang('Not a user yet? Register now').'</a><br/>';
|
||||
}
|
||||
if ($config_reg[lostpassword_link]=='True')
|
||||
{
|
||||
$lostpw_link=' <a href="'. $GLOBALS['egw']->link('/registration/index.php','menuaction=registration.uireg.lostpw_step1_ask_login&lang_code='.$_GET['lang']). '">'.lang('Lost password').'</a><br/>';
|
||||
}
|
||||
if ($config_reg[lostid_link]=='True')
|
||||
{
|
||||
$lostid_link=' <a href="'. $GLOBALS['egw']->link('/registration/index.php','menuaction=registration.uireg.lostid_step1_ask_email&lang_code='.$_GET['lang']). '">'.lang('Lost Login Id').'</a><br/>';
|
||||
}
|
||||
|
||||
/* if at least one option of "registration" is activated display the registration section */
|
||||
if($config_reg[register_link]=='True' || $config_reg[lostpassword_link]=='True' || $config_reg[lostid_link]=='True')
|
||||
{
|
||||
$tmpl->set_var('register_link',$reg_link);
|
||||
$tmpl->set_var('lostpassword_link',$lostpw_link);
|
||||
$tmpl->set_var('lostid_link',$lostid_link) ;
|
||||
|
||||
//$tmpl->set_var('registration_url',$GLOBALS['egw_info']['server']['webserver_url'] . '/registration/');
|
||||
}
|
||||
else
|
||||
{
|
||||
/* trick to make registration section disapear */
|
||||
$tmpl->set_block('login_form','registration');
|
||||
$tmpl->set_var('registration','');
|
||||
}
|
||||
}
|
||||
|
||||
// add a content-type header to overwrite an existing default charset in apache (AddDefaultCharset directiv)
|
||||
header('Content-type: text/html; charset='.$GLOBALS['egw']->translation->charset());
|
||||
|
||||
$GLOBALS['egw_info']['server']['template_set'] = $GLOBALS['egw_info']['login_template_set'];
|
||||
|
||||
$tmpl->set_var('charset',$GLOBALS['egw']->translation->charset());
|
||||
$tmpl->set_var('login_url', $GLOBALS['egw_info']['server']['webserver_url'] . '/login.php' . $extra_vars);
|
||||
$tmpl->set_var('version',$GLOBALS['egw_info']['server']['versions']['phpgwapi']);
|
||||
$tmpl->set_var('cd',check_logoutcode($_GET['cd']));
|
||||
$tmpl->set_var('cookie',$last_loginid);
|
||||
|
||||
$tmpl->set_var('lang_username',lang('username'));
|
||||
$tmpl->set_var('lang_password',lang('password'));
|
||||
$tmpl->set_var('lang_login',lang('login'));
|
||||
|
||||
$tmpl->set_var('website_title', $GLOBALS['egw_info']['server']['site_title']);
|
||||
$tmpl->set_var('template_set',$GLOBALS['egw_info']['login_template_set']);
|
||||
$tmpl->set_var('bg_color',($GLOBALS['egw_info']['server']['login_bg_color']?$GLOBALS['egw_info']['server']['login_bg_color']:'FFFFFF'));
|
||||
$tmpl->set_var('bg_color_title',($GLOBALS['egw_info']['server']['login_bg_color_title']?$GLOBALS['egw_info']['server']['login_bg_color_title']:'486591'));
|
||||
|
||||
if (substr($GLOBALS['egw_info']['server']['login_logo_file'],0,4) == 'http')
|
||||
{
|
||||
$var['logo_file'] = $GLOBALS['egw_info']['server']['login_logo_file'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$var['logo_file'] = $GLOBALS['egw']->common->image('phpgwapi',$GLOBALS['egw_info']['server']['login_logo_file']?$GLOBALS['egw_info']['server']['login_logo_file']:'logo');
|
||||
}
|
||||
$var['logo_url'] = $GLOBALS['egw_info']['server']['login_logo_url']?$GLOBALS['egw_info']['server']['login_logo_url']:'http://www.eGroupWare.org';
|
||||
if (substr($var['logo_url'],0,4) != 'http')
|
||||
{
|
||||
$var['logo_url'] = 'http://'.$var['logo_url'];
|
||||
}
|
||||
$var['logo_title'] = $GLOBALS['egw_info']['server']['login_logo_title']?$GLOBALS['egw_info']['server']['login_logo_title']:'www.eGroupWare.org';
|
||||
$tmpl->set_var($var);
|
||||
|
||||
/* language section if activated in site config */
|
||||
if (@$GLOBALS['egw_info']['server']['login_show_language_selection'])
|
||||
{
|
||||
$select_lang = '<select name="lang" onchange="'."if (this.form.login.value && this.form.passwd.value) this.form.submit(); else location.href=location.href+(location.search?'&':'?')+'lang='+this.value".'">';
|
||||
foreach ($GLOBALS['egw']->translation->get_installed_langs() as $key => $name) // if we have a translation use it
|
||||
{
|
||||
$select_lang .= "\n\t".'<option value="'.$key.'"'.($key == $GLOBALS['egw_info']['user']['preferences']['common']['lang'] ? ' selected="selected"' : '').'>'.$name.'</option>';
|
||||
}
|
||||
$select_lang .= "\n</select>\n";
|
||||
$tmpl->set_var(array(
|
||||
'lang_language' => lang('Language'),
|
||||
'select_language' => $select_lang,
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpl->set_block('login_form','language_select');
|
||||
$tmpl->set_var('language_select','');
|
||||
}
|
||||
|
||||
/********************************************************\
|
||||
* Check if authentification via cookies is allowed *
|
||||
* and place a time selectbox, how long cookie is valid *
|
||||
\********************************************************/
|
||||
|
||||
if($GLOBALS['egw_info']['server']['allow_cookie_auth'])
|
||||
{
|
||||
$html =& CreateObject('phpgwapi.html'); /* Why the hell was nobody useing this here before??? */
|
||||
$tmpl->set_block('login_form','remember_me_selection');
|
||||
$tmpl->set_var('lang_remember_me',lang('Remember me'));
|
||||
$tmpl->set_var('select_remember_me',$html->select('remember_me', 'forever', array(
|
||||
false => lang('not'),
|
||||
'1hour' => lang('1 Hour'),
|
||||
'1day' => lang('1 Day'),
|
||||
'1week'=> lang('1 Week'),
|
||||
'1month' => lang('1 Month'),
|
||||
'forever' => lang('Forever')),true
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* trick to make remember_me section disapear */
|
||||
$tmpl->set_block('login_form','remember_me_selection');
|
||||
$tmpl->set_var('remember_me_selection','');
|
||||
}
|
||||
|
||||
$tmpl->set_var('autocomplete', ($GLOBALS['egw_info']['server']['autocomplete_login'] ? 'autocomplete="off"' : ''));
|
||||
|
||||
$tmpl->pfp('loginout','login_form');
|
||||
}
|
||||
|
||||
function login_parse_denylogin()
|
||||
{
|
||||
$tmpl = CreateObject('phpgwapi.Template', $GLOBALS['egw_info']['server']['template_dir']);
|
||||
|
||||
$deny_msg=lang('Oops! You caught us in the middle of system maintainance.<br/>
|
||||
Please, check back with us shortly.');
|
||||
|
||||
$tmpl->set_file(array
|
||||
(
|
||||
'login_form' => 'login_denylogin.tpl'
|
||||
));
|
||||
|
||||
$tmpl->set_var('template_set','default');
|
||||
$tmpl->set_var('deny_msg',$deny_msg);
|
||||
$tmpl->pfp('loginout','login_form');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user