source: trunk/services/login.php @ 21

Last change on this file since 21 was 20, checked in by scdev, 19 years ago

Tons of little updates and bugfixes. CSS updates to templates and core css files. File upload ability to module_maker. Remade Upload interface to use setParam/getParam.

File size: 1.3 KB
Line 
1<?php
2/**
3 * login.php
4 * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
5 */
6
7if (getFormData('boomerang', false) && isset($_SERVER['HTTP_REFERER'])) {
8    // We remember which page we came from so we can go back there.
9    App::setBoomerangURL($_SERVER['HTTP_REFERER']);
10}
11App::sslOn();
12
13$frm['username'] = getFormdata('username');
14$frm['password'] = getFormdata('password');
15
16if (getFormdata('username', false)) {
17    /* form has been submitted, check if the user login information is correct */
18
19    if ($auth->login($frm['username'], $frm['password'])) {
20        App::raiseMsg(_("You are now logged in."), MSG_SUCCESS, __FILE__, __LINE__);
21        App::dieBoomerangURL();
22        App::logMsg(sprintf('%s %s successfully logged-in.', $auth->getVal('auth_name'), $frm['username']), LOG_INFO, __FILE__, __LINE__);
23    } else {
24        App::raiseMsg(_("Login failed, please try again."), MSG_NOTICE, __FILE__, __LINE__);
25        App::logMsg(sprintf('%s %s failed login using (MD5ed) password: %s', $auth->getVal('auth_name'), $frm['username'], md5($frm['password'])), LOG_NOTICE, __FILE__, __LINE__);
26    }
27}
28
29// Titles and navigation header.
30$nav->addPage(_("Login"));
31
32// Templates.
33include 'header.ihtml';
34include 'codebase/services/templates/login_form.ihtml';
35include 'footer.ihtml';
36
37?>
Note: See TracBrowser for help on using the repository browser.