Changeset 11992 for trunk/themes


Ignore:
Timestamp:
Aug 24, 2011, 10:03:53 PM (13 years ago)
Author:
plg
Message:

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)

Location:
trunk/themes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/themes/Sylvia/theme.css

    r11200 r11992  
    464464        background-image: url(../default/s26/outline_ff7700.png);
    465465}
     466
     467.message {
     468  color:white;
     469  background-color:#666;
     470}
  • trunk/themes/dark/theme.css

    r8462 r11992  
    7676}
    7777
     78.message {
     79  color:white;
     80  background-color:#666;
     81}
  • trunk/themes/default/template/password.tpl

    r10824 r11992  
    11{if isset($MENUBAR)}{$MENUBAR}{/if}
    22<div id="content" class="content">
     3  <div class="titrePage">
     4    <ul class="categoryActions">
     5      <li>
     6        <a href="{$U_HOME}" title="{'Home'|@translate}" class="pwg-state-default pwg-button">
     7          <span class="pwg-icon pwg-icon-home">&nbsp;</span><span class="pwg-button-text">{'Home'|@translate}</span>
     8        </a>
     9      </li>
     10    </ul>
    311
    4         <div class="titrePage">
    5                 <ul class="categoryActions">
    6       <li><a href="{$U_HOME}" title="{'Home'|@translate}" class="pwg-state-default pwg-button">
    7         <span class="pwg-icon pwg-icon-home">&nbsp;</span><span class="pwg-button-text">{'Home'|@translate}</span>
    8       </a></li>
    9     </ul>
    10                 <h2>{'Password forgotten'|@translate}</h2>
    11         </div>
     12    <h2>{$title}</h2>
     13  </div>
    1214
    1315  {if count($errors)}
     
    3133  {/if}
    3234
    33 <form action="{$F_ACTION}" method="post" class="properties">
    34   <fieldset>
    35     <legend>{'Retrieve password'|@translate}</legend>
     35{if $action ne 'none'}
     36<form id="lostPassword" action="{$form_action}?action={$action}{if isset($key)}&amp;key={$key}{/if}" method="post">
     37  <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
    3638
    37     <ul>
    38       <li>
    39         <span class="property">
    40           <label for="mail_address">{'Email address'|@translate}</label>
    41         </span>
    42         <input class="login" type="text" name="mail_address" id="mail_address" size="40" maxlength="40" >
    43       </li>
    44       <li>
    45         <span class="property">
    46           <label for="no_mail_address">{'No email address'|@translate}</label>
    47         </span>
    48         <input type="checkbox" id="no_mail_address" name="no_mail_address" value="1">
    49       </li>
    50     </ul>
    51   </fieldset>
     39  {if $action eq 'lost'}
     40  <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>
    5241
    53   <p><input class="submit" type="submit" name="submit" value="{'Send new password'|@translate}"></p>
     42  <p>
     43    <label>
     44      {'Username or email'|@translate}
     45      <br>
     46      <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}>
     47    </label>
     48  </p>
     49
     50  <p class="bottomButtons"><input class="submit" type="submit" name="submit" value="{'Change my password'|@translate}"></p>
     51  {elseif $action eq 'reset'}
     52
     53  <div class="message">{'Hello'|@translate} <em>{$username}</em>. {'Enter your new password below.'|@translate}</div>
     54
     55  <p>
     56    <label>
     57      {'New password'|@translate}
     58      <br>
     59      <input type="password" name="use_new_pwd" id="use_new_pwd" value="">
     60    </label>
     61  </p>
     62
     63  <p>
     64    <label>
     65      {'Confirm Password'|@translate}
     66      <br>
     67      <input type="password" name="passwordConf" id="passwordConf" value="">
     68    </label>
     69  </p>
     70
     71  <p class="bottomButtons"><input class="submit" type="submit" name="submit" value="{'Submit'|@translate}"></p>
     72  {/if}
     73
    5474</form>
     75{/if} {* $action ne 'none' *}
     76
     77<script type="text/javascript">
     78{if $action eq 'lost'}
     79{literal}try{document.getElementById('username_or_email').focus();}catch(e){}{/literal}
     80{elseif $action eq 'reset'}
     81{literal}try{document.getElementById('use_new_pwd').focus();}catch(e){}{/literal}
     82{/if}
     83</script>
    5584
    5685</div> <!-- content -->
  • trunk/themes/default/theme.css

    r11182 r11992  
    788788#linkToPiwigo {text-align:center;}
    789789
     790.message {
     791  background-color: lightyellow;
     792  color:#333;
     793  /* margin: 0.5em 1em 0.5em 1em; */
     794  margin-bottom:1em;
     795  padding: 12px;
     796  -moz-border-radius: 3px;
     797  -khtml-border-radius: 3px;
     798  -webkit-border-radius: 3px;
     799  border-radius: 3px;
     800}
     801
     802#thePasswordPage form#lostPassword {
     803  padding: 1em;
     804}
     805
     806#thePasswordPage form#lostPassword p {
     807  text-align: left;
     808  margin: 0 0 1em 0;
     809  line-height: 1.5em;
     810}
     811
     812#thePasswordPage form#lostPassword p.bottomButtons {
     813  margin-top:2em;
     814}
Note: See TracChangeset for help on using the changeset viewer.