From ac6539adf39e3ad7205fa48e09ce36fc87e4ea39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= <jannehess@gmail.com> Date: Wed, 5 Jul 2017 13:51:13 +0200 Subject: [PATCH] Redesign login screen and password recovery - Add copyright - Remove odd looking icon and version - Add a way to navigate back from password recovery - Add icons to password recovery fields Conflicts: ihtml/themes/breezy/recovery.tpl --- html/class_passwordRecovery.inc | 5 ++ html/index.php | 4 +- html/themes/breezy/login.css | 11 ++++ html/themes/legacy/login.css | 11 ++++ ihtml/themes/breezy/login.tpl | 13 ++-- ihtml/themes/breezy/recovery.tpl | 101 ++++++++++++++----------------- locale/en/fusiondirectory.po | 4 ++ 7 files changed, 89 insertions(+), 60 deletions(-) diff --git a/html/class_passwordRecovery.inc b/html/class_passwordRecovery.inc index feaee1264..961680558 100644 --- a/html/class_passwordRecovery.inc +++ b/html/class_passwordRecovery.inc @@ -147,10 +147,15 @@ class standAlonePage { clean_smarty_compile_dir($smarty->compile_dir); $smarty->assign('password_img', 'geticon.php?context=status&icon=dialog-password&size=48'); + $smarty->assign('mail_img', 'geticon.php?context=applications&icon=internet-mail&size=48'); + $smarty->assign('directory_img', "geticon.php?context=places&icon=network-server&size=48"); + $smarty->assign('personal_img', "geticon.php?context=types&icon=user&size=48"); $smarty->assign('date', gmdate("D, d M Y H:i:s")); $smarty->assign('params', ""); $smarty->assign('message', ""); $smarty->assign('changed', FALSE); + $smarty->assign('revision', FD_VERSION); + $smarty->assign('year', date('Y')); } function checkForSSL() diff --git a/html/index.php b/html/index.php index 668af40a7..6a463ef7a 100644 --- a/html/index.php +++ b/html/index.php @@ -43,6 +43,8 @@ function displayLogin() $smarty->assign ('personal_img', "geticon.php?context=types&icon=user&size=48"); $smarty->assign ('password_img', "geticon.php?context=status&icon=dialog-password&size=48"); $smarty->assign ('directory_img', "geticon.php?context=places&icon=network-server&size=48"); + $smarty->assign ('revision', FD_VERSION); + $smarty->assign ('year', date('Y')); $smarty->append ('css_files', get_template_path('login.css')); /* Some error to display? */ @@ -51,7 +53,7 @@ function displayLogin() } $smarty->assign ("message", $message); - /* Displasy SSL mode warning? */ + /* Display SSL mode warning? */ if (($ssl != '') && ($config->get_cfg_value('warnSSL') == 'TRUE')) { $smarty->assign ('ssl', sprintf(_('Warning: <a href="%s">Session is not encrypted!</a>'), $ssl)); } else { diff --git a/html/themes/breezy/login.css b/html/themes/breezy/login.css index e033cae3a..c88ff28fb 100644 --- a/html/themes/breezy/login.css +++ b/html/themes/breezy/login.css @@ -79,6 +79,17 @@ span.warning, p.warning { color: red; } +div.copynotice { +position: fixed; +bottom: 0; +right: 5px; +border: none; +} + +div.copynotice a { +color: #31363b; +} + /* On small screens */ @media (max-width: 640px) { div#window-div { diff --git a/html/themes/legacy/login.css b/html/themes/legacy/login.css index bd516a3e4..e41f818eb 100644 --- a/html/themes/legacy/login.css +++ b/html/themes/legacy/login.css @@ -73,6 +73,17 @@ span.warning, p.warning { color: red; } +div.copynotice { +position: fixed; +bottom: 0; +right: 5px; +border: none; +} + +div.copynotice a { +color: #31363b; +} + /* On small screens */ @media (max-width: 640px) { div#window-div { diff --git a/ihtml/themes/breezy/login.tpl b/ihtml/themes/breezy/login.tpl index 4e72104c1..fc42199c0 100644 --- a/ihtml/themes/breezy/login.tpl +++ b/ihtml/themes/breezy/login.tpl @@ -1,7 +1,6 @@ <body> {$php_errors} - {include file={filePath file="setup_header.tpl"}} {* FusionDirectory login - smarty template *} @@ -13,7 +12,7 @@ {$msg_dialogs} <div id="window-titlebar"> <p> - {t}Login screen{/t} + {t}FusionDirectory{/t} </p> </div> <div id="window-content"> @@ -49,9 +48,9 @@ <p class="gosaLoginWarning"> <script type="text/javascript"> <!-- - document.cookie = "gosatest=empty;path=/"; - if (document.cookie.indexOf( "gosatest=") > -1 ) - document.cookie = "gosatest=empty;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT"; + document.cookie = "fdtest=empty;path=/"; + if (document.cookie.indexOf( "fdtest=") > -1 ) + document.cookie = "fdtest=empty;path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT"; else document.write("{$cookies}"); --> @@ -76,6 +75,10 @@ </div> +<div class="copynotice"> + © 2002-{$year} <a href="http://www.fusionDirectory.org">{t}The FusionDirectory team{/t}, {$revision}</a> +</div> + <script type="text/javascript"> <!-- enable_keyPress = false; diff --git a/ihtml/themes/breezy/recovery.tpl b/ihtml/themes/breezy/recovery.tpl index d8eab83c8..f1c4d2cc5 100644 --- a/ihtml/themes/breezy/recovery.tpl +++ b/ihtml/themes/breezy/recovery.tpl @@ -1,9 +1,6 @@ <body onLoad="javascript:$$('div.debug_div').each(function (a) { a.hide(); });"> {* FusionDirectory recovery - smarty template *} {$php_errors} - <div> - {include file={filePath file="setup_header.tpl"}} - </div> {$msg_dialogs} <div id="window-container"> @@ -40,39 +37,35 @@ </p> <br/> - <table> - {if $show_directory_chooser} - <tr> - <td>{t}Directory{/t}</td> - <td> - <select name="server" title="{t}Directory{/t}"> - {html_options options=$server_options selected=$server_id} - </select> - </td> - </tr> - {/if} - <tr> - <td><label for="login">{t}Login{/t}</label></td> - <td> - <i>{$login}</i> - </td> - </tr> - <tr> - <td><label for="new_password">{t}New password{/t}</label></td> - <td><input type="password" name="new_password" id="new_password" value="" title="{t}New password{/t}" onkeyup="testPasswordCss(document.getElementById('new_password').value);" /></td> - </tr> - <tr> - <td><label for="new_password_repeated">{t}New password repeated{/t}</label></td> - <td><input type="password" name="new_password_repeated" id="new_password_repeated" value="" title="{t}New password repeated{/t}" /></td> - </tr> - <tr> - <td>{t}Password strength{/t}</td> - <td> + <div style="text-align: center;"> + <label for="login"> + <img class="center" src="{$personal_img|escape}" alt="{t}Username{/t}" title="{t}Username{/t}"/> + </label> + <input type="text" name="login" value="{$login}" title="{t}Username{/t}" readonly /> + <br /> + <label for="new_password"> + <img class="center" src="{$password_img|escape}" alt="{t}New password{/t}" title="{t}New password{/t}"/> + </label> + <input type="password" name="new_password" id="new_password" value="" title="{t}New password{/t}" onkeyup="testPasswordCss(document.getElementById('new_password').value);" /> + <br /> + <label for="new_password_repeated"> + <img class="center" src="{$password_img|escape}" alt="{t}New password repeated{/t}" title="{t}New password repeated{/t}"/> + </label> + <input type="password" name="new_password_repeated" id="new_password_repeated" maxlength="40" value="" title="{t}New password repeated{/t}" /> + <br> + <div style="width: 190px; display: inline-block; margin-left: 54px;" title="{t}Password strength{/t}"> <span id="meterEmpty" style="padding:0;margin:0;width:100%;background-color:#DC143C;display:block;height:5px;"> <span id="meterFull" style="padding:0;margin:0;z-index:100;width:0;background-color:#006400;display:block;height:5px;"></span></span> - </td> - </tr> - </table> + </div> + </div> + {if $show_directory_chooser} + <div> + <img class="center" src="{$directory_img|escape}" alt="{t}Directory{/t}" title="{t}Directory{/t}" /> + <select name="server" title="{t}Directory{/t}" onchange="javascript:document.loginform.submit();"> + {html_options options=$server_options selected=$server_id} + </select> + </div> + {/if} </div> </div> <div id="window-footer" class="plugbottom"> @@ -85,7 +78,7 @@ {elseif $changed} <div class="success"> <img class="center" src="geticon.php?context=status&icon=task-complete&size=16" alt="{t}Success{/t}" title="{t}Success{/t}"> <b>{t}Your password has been changed successfully.{/t}</b><br/> - <br/><a href="./">Return to login screen</a> + <br/><a href="index.php">{t}Return to login screen{/t}</a> </div> </div> </div> @@ -95,25 +88,22 @@ <strong>{t}=> Use your e-mail in the long format, e.g : John Doe => john.doe@example.com{/t}</strong> </p> - <br/> - <table> - {if $show_directory_chooser} - <tr> - <td>{t}Directory{/t}</td> - <td> - <select name="server" title="{t}Directory{/t}"> - {html_options options=$server_options selected=$server_id} - </select> - </td> - </tr> - {/if} - <tr> - <td><label for="email_address">{t}Email address{/t}</label></td> - <td> - <input type="text" name="email_address" id="email_address" value="{$email_address}" title="{t}Email{/t}" onFocus=""/> - </td> - </tr> - </table> + <div> + <label for="email_address"> + <img class="center" src="{$mail_img|escape}" alt="{t}Email address{/t}" title="{t}Email address{/t}" /> + </label> + <input type="text" name="email_address" id="email_address" value="{$email_address}" title="{t}Email{/t}" onFocus=""/> + </div> + {if $show_directory_chooser} + <div> + <img class="center" src="{$directory_img|escape}" alt="{t}Directory{/t}" title="{t}Directory{/t}" /> + <select name="server" title="{t}Directory{/t}" onchange="javascript:document.loginform.submit();"> + {html_options options=$server_options selected=$server_id} + </select> + </div> + {/if} + <br /> + <a href="index.php">{t}Return to login screen{/t}</a> </div> </div> <div id="window-footer" class="plugbottom"> @@ -133,6 +123,9 @@ {/if} </form> </div> +</div> +<div class="copynotice"> + © 2002-{$year} <a href="http://www.fusionDirectory.org">{t}The FusionDirectory team{/t}, {$revision}</a> </div> <!-- Place cursor in email field --> diff --git a/locale/en/fusiondirectory.po b/locale/en/fusiondirectory.po index e7279669f..4539df6c2 100644 --- a/locale/en/fusiondirectory.po +++ b/locale/en/fusiondirectory.po @@ -4494,6 +4494,10 @@ msgid "" "password (twice) in the fields below and press the 'Change' button." msgstr "" +#: ihtml/themes/breezy/recovery.tpl.c:106 +msgid "Return to login screen" +msgstr "" + #: ihtml/themes/breezy/recovery.tpl.c:20 ihtml/themes/breezy/recovery.tpl.c:23 #: ihtml/themes/breezy/recovery.tpl.c:65 ihtml/themes/breezy/recovery.tpl.c:68 #: ihtml/themes/breezy/login.tpl.c:29 ihtml/themes/breezy/login.tpl.c:32 -- GitLab