Ignore:
Timestamp:
Feb 7, 2014 7:17:49 PM (10 years ago)
Author:
anonymous
Message:

Added 'Remember me' checkbox to login form. Renamed 'persistent' key to 'saved' in Prefs.inc.php.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/services/login.php

    r396 r462  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    3232$app->sslOn();
    3333
    34 $frm['username'] = getFormdata('username');
     34require_once 'codebase/lib/Prefs.inc.php';
     35$login_prefs = new Prefs('login');
     36$login_prefs->setDefaults(array('username' => ''));
     37
     38if ('' != $login_prefs->get('username')) {
     39    $frm['remember_me'] = '1';
     40}
     41
     42$frm['username'] = getFormdata('username', $login_prefs->get('username'));
    3543$frm['password'] = getFormdata('password');
    3644
     
    3947
    4048    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        }
    4154        $app->raiseMsg(_("You are now logged in."), MSG_SUCCESS, __FILE__, __LINE__);
    4255        $app->dieBoomerangURL('login');
Note: See TracChangeset for help on using the changeset viewer.