diff options
author | plegall <plg@piwigo.org> | 2011-08-24 20:03:53 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2011-08-24 20:03:53 +0000 |
commit | 2de0f01dce5913dcca68c28376205f0a6d473b7c (patch) | |
tree | 6eb4b4a2011ba5cc05fa4a37ecec4bac2ef646ec /themes | |
parent | c1d7fbebdde17a90f8cb42e7a4c3fa551dcb6b79 (diff) |
feature 2027 implemented: the "lost password" feature was rewritten.
The algorithm is highly inspired from WordPress :
1) in a single field, you give a username or an email
2) Piwigo sends an email with the activation key
3) the user clicks on the link in the email (with the activation key) and is able to set a new password
The "lost password" feature is no longer limited to "classic" users:
administrators and webmasters can use it too (no need to tell webmasters
that they can only change their password in the database)
git-svn-id: http://piwigo.org/svn/trunk@11992 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'themes')
-rw-r--r-- | themes/Sylvia/theme.css | 5 | ||||
-rw-r--r-- | themes/dark/theme.css | 4 | ||||
-rw-r--r-- | themes/default/template/password.tpl | 83 | ||||
-rw-r--r-- | themes/default/theme.css | 25 |
4 files changed, 90 insertions, 27 deletions
diff --git a/themes/Sylvia/theme.css b/themes/Sylvia/theme.css index f996108f2..8d0f8aac9 100644 --- a/themes/Sylvia/theme.css +++ b/themes/Sylvia/theme.css @@ -463,3 +463,8 @@ tr.tagLine, fieldset.tagLetter, legend.tagLetterLegend { A:hover .pwg-icon { background-image: url(../default/s26/outline_ff7700.png); } + +.message { + color:white; + background-color:#666; +} diff --git a/themes/dark/theme.css b/themes/dark/theme.css index ba10883c9..aa3975b43 100644 --- a/themes/dark/theme.css +++ b/themes/dark/theme.css @@ -75,3 +75,7 @@ A:hover .pwg-icon { background-image: url(../default/s26/outline_ffff80.png); } +.message { + color:white; + background-color:#666; +}
\ No newline at end of file diff --git a/themes/default/template/password.tpl b/themes/default/template/password.tpl index 6c6f9a35d..eef2c64e2 100644 --- a/themes/default/template/password.tpl +++ b/themes/default/template/password.tpl @@ -1,14 +1,16 @@ {if isset($MENUBAR)}{$MENUBAR}{/if} <div id="content" class="content"> - - <div class="titrePage"> - <ul class="categoryActions"> - <li><a href="{$U_HOME}" title="{'Home'|@translate}" class="pwg-state-default pwg-button"> - <span class="pwg-icon pwg-icon-home"> </span><span class="pwg-button-text">{'Home'|@translate}</span> - </a></li> + <div class="titrePage"> + <ul class="categoryActions"> + <li> + <a href="{$U_HOME}" title="{'Home'|@translate}" class="pwg-state-default pwg-button"> + <span class="pwg-icon pwg-icon-home"> </span><span class="pwg-button-text">{'Home'|@translate}</span> + </a> + </li> </ul> - <h2>{'Password forgotten'|@translate}</h2> - </div> + + <h2>{$title}</h2> + </div> {if count($errors)} <div class="errors"> @@ -30,27 +32,54 @@ </div> {/if} -<form action="{$F_ACTION}" method="post" class="properties"> - <fieldset> - <legend>{'Retrieve password'|@translate}</legend> +{if $action ne 'none'} +<form id="lostPassword" action="{$form_action}?action={$action}{if isset($key)}&key={$key}{/if}" method="post"> + <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> - <ul> - <li> - <span class="property"> - <label for="mail_address">{'Email address'|@translate}</label> - </span> - <input class="login" type="text" name="mail_address" id="mail_address" size="40" maxlength="40" > - </li> - <li> - <span class="property"> - <label for="no_mail_address">{'No email address'|@translate}</label> - </span> - <input type="checkbox" id="no_mail_address" name="no_mail_address" value="1"> - </li> - </ul> - </fieldset> + {if $action eq 'lost'} + <div class="message">{'Please enter your username or email address.'|@translate} {'You will receive a link to create a new password via email.'|@translate}</div> + + <p> + <label> + {'Username or email'|@translate} + <br> + <input type="text" id="username_or_email" name="username_or_email" size="40" maxlength="40"{if isset($username_or_email)} value="{$username_or_email}"{/if}> + </label> + </p> + + <p class="bottomButtons"><input class="submit" type="submit" name="submit" value="{'Change my password'|@translate}"></p> + {elseif $action eq 'reset'} + + <div class="message">{'Hello'|@translate} <em>{$username}</em>. {'Enter your new password below.'|@translate}</div> + + <p> + <label> + {'New password'|@translate} + <br> + <input type="password" name="use_new_pwd" id="use_new_pwd" value=""> + </label> + </p> + + <p> + <label> + {'Confirm Password'|@translate} + <br> + <input type="password" name="passwordConf" id="passwordConf" value=""> + </label> + </p> + + <p class="bottomButtons"><input class="submit" type="submit" name="submit" value="{'Submit'|@translate}"></p> + {/if} - <p><input class="submit" type="submit" name="submit" value="{'Send new password'|@translate}"></p> </form> +{/if} {* $action ne 'none' *} + +<script type="text/javascript"> +{if $action eq 'lost'} +{literal}try{document.getElementById('username_or_email').focus();}catch(e){}{/literal} +{elseif $action eq 'reset'} +{literal}try{document.getElementById('use_new_pwd').focus();}catch(e){}{/literal} +{/if} +</script> </div> <!-- content --> diff --git a/themes/default/theme.css b/themes/default/theme.css index 63f61ae7b..f1e0df44b 100644 --- a/themes/default/theme.css +++ b/themes/default/theme.css @@ -787,3 +787,28 @@ LEGEND { #piwigoAbout {width:600px;margin:0 auto;} #linkToPiwigo {text-align:center;} +.message { + background-color: lightyellow; + color:#333; + /* margin: 0.5em 1em 0.5em 1em; */ + margin-bottom:1em; + padding: 12px; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +#thePasswordPage form#lostPassword { + padding: 1em; +} + +#thePasswordPage form#lostPassword p { + text-align: left; + margin: 0 0 1em 0; + line-height: 1.5em; +} + +#thePasswordPage form#lostPassword p.bottomButtons { + margin-top:2em; +}
\ No newline at end of file |