diff --git a/phpgwapi/inc/class.egw_framework.inc.php b/phpgwapi/inc/class.egw_framework.inc.php index c54e442b47..9615e44e38 100644 --- a/phpgwapi/inc/class.egw_framework.inc.php +++ b/phpgwapi/inc/class.egw_framework.inc.php @@ -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) * diff --git a/phpgwapi/templates/default/login.tpl b/phpgwapi/templates/default/login.tpl index b580815831..0b71557d68 100644 --- a/phpgwapi/templates/default/login.tpl +++ b/phpgwapi/templates/default/login.tpl @@ -1,147 +1,66 @@ - - - - - - - - - - - -{website_title} - Login - - - - - - - - - -
-
- - - - - -
- - - - -
spacer
-
-
-
- -
-
-
{lang_message}
-
{cd}
-

 

-
- - - - - - - -
{website_title}
- - - - - - - - - +
+
+
+
{lang_message}
+
{cd}
+ +
-  -
- - - - -
+ + + + + + + - - - - + + + + - {select_domain} - + + + + - - - - + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + -
{website_title}
+ + + + +
{lang_language}: {select_language}
{lang_language}: {select_language}
{lang_domain}: {select_domain}
{lang_remember_me}: {select_remember_me}
{lang_remember_me}: {select_remember_me}
{lang_username}: 
{lang_password}: 
  - -
{lang_username}: 
{lang_password}: 
  + +
- - - - - - -
{lostpassword_link}{lostid_link}
{register_link}
-
+ {lostpassword_link} + {lostid_link} + {register_link} +
- -
-

 

-

 

-

 

-
- - - + + +
-
- - - diff --git a/phpgwapi/templates/default/login_denylogin.tpl b/phpgwapi/templates/default/login_denylogin.tpl index 22f2d2e154..e3b4b4d739 100644 --- a/phpgwapi/templates/default/login_denylogin.tpl +++ b/phpgwapi/templates/default/login_denylogin.tpl @@ -1,14 +1,6 @@ - -eGroupWare - - - - - -
- {deny_msg} -
+eGroupWare +

{deny_msg}

diff --git a/phpgwapi/templates/idots/class.idots_framework.inc.php b/phpgwapi/templates/idots/class.idots_framework.inc.php index eea7c7db89..716db6d562 100644 --- a/phpgwapi/templates/idots/class.idots_framework.inc.php +++ b/phpgwapi/templates/idots/class.idots_framework.inc.php @@ -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=' '.lang('Not a user yet? Register now').'
'; + } + if ($config_reg['lostpassword_link'] == 'True') + { + $lostpw_link=' '.lang('Lost password').'
'; + } + if ($config_reg['lostid_link'] == 'True') + { + $lostid_link=' '.lang('Lost Login Id').'
'; + } + + /* 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.'). + '
'.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); diff --git a/phpgwapi/templates/idots/css/idots.css b/phpgwapi/templates/idots/css/idots.css index cf716c91cf..f85d4ac1c6 100755 --- a/phpgwapi/templates/idots/css/idots.css +++ b/phpgwapi/templates/idots/css/idots.css @@ -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 @@ -375,4 +376,31 @@ body { .portal_box_header { height: 15px; padding-top: 0px; -} \ No newline at end of file +} + +/* + 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; +} diff --git a/phpgwapi/templates/idots/login.inc.php b/phpgwapi/templates/idots/login.inc.php deleted file mode 100755 index 43b21d3b0d..0000000000 --- a/phpgwapi/templates/idots/login.inc.php +++ /dev/null @@ -1,219 +0,0 @@ -\n"; - foreach($GLOBALS['egw_domain'] as $domain_name => $domain_vars) - { - $domain_select .= '