Changeset 462 for trunk/services
- Timestamp:
- Feb 7, 2014 7:17:49 PM (10 years ago)
- Location:
- trunk/services
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/services/login.php
r396 r462 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 32 32 $app->sslOn(); 33 33 34 $frm['username'] = getFormdata('username'); 34 require_once 'codebase/lib/Prefs.inc.php'; 35 $login_prefs = new Prefs('login'); 36 $login_prefs->setDefaults(array('username' => '')); 37 38 if ('' != $login_prefs->get('username')) { 39 $frm['remember_me'] = '1'; 40 } 41 42 $frm['username'] = getFormdata('username', $login_prefs->get('username')); 35 43 $frm['password'] = getFormdata('password'); 36 44 … … 39 47 40 48 if ($auth->login($frm['username'], $frm['password'])) { 49 if (getFormData('remember_me')) { 50 $login_prefs->set('username', getFormData('username')); 51 } else { 52 $login_prefs->set('username', ''); 53 } 41 54 $app->raiseMsg(_("You are now logged in."), MSG_SUCCESS, __FILE__, __LINE__); 42 55 $app->dieBoomerangURL('login'); -
trunk/services/templates/login_form.ihtml
r421 r462 17 17 </td> 18 18 </tr> 19 <tr class="sc-form-row"> 20 <td class="sc-right"> </td> 21 <td> 22 <label class="sc-label-secondary"><input type="checkbox" name="remember_me" id="remember_me" value="1"<?php frmChecked($frm['remember_me']) ?> /> <?php echo _("Remember my username"); ?></label> 23 </td> 24 </tr> 19 25 <tr> 20 26 <td> </td> … … 23 29 </table> 24 30 </form> 31 <script type="text/javascript" charset="utf-8"> 32 /* <![CDATA[ */ 33 $(document).ready(function() { 34 if ($('input[name="username"]').val() != '') { 35 $('input[name="password"]').focus(); 36 } else { 37 $('input[name="username"]').focus(); 38 } 39 }); 40 /* ]]> */ 41 </script>
Note: See TracChangeset
for help on using the changeset viewer.