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/default/template/password.tpl | |
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/default/template/password.tpl')
-rw-r--r-- | themes/default/template/password.tpl | 83 |
1 files changed, 56 insertions, 27 deletions
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 --> |