- if((! $record) || (! count($record))) {
- logger('authenticate: failed login attempt: ' . trim($_POST['openid_url']));
- notice( t('Login failed.') . EOL );
- goaway($a->get_baseurl());
- }
-
- $_SESSION['uid'] = $record['uid'];
- $_SESSION['theme'] = $record['theme'];
- $_SESSION['authenticated'] = 1;
- $_SESSION['page_flags'] = $record['page-flags'];
- $_SESSION['my_url'] = $a->get_baseurl() . '/profile/' . $record['nickname'];
- $_SESSION['addr'] = $_SERVER['REMOTE_ADDR'];
-
- $a->user = $record;
-
- if($a->user['login_date'] === '0000-00-00 00:00:00') {
- $_SESSION['return_url'] = 'profile_photo/new';
- $a->module = 'profile_photo';
- info( t("Welcome ") . $a->user['username'] . EOL);
- info( t('Please upload a profile photo.') . EOL);
+ if (!$record || !count($record)) {
+ logger('authenticate: failed login attempt: '.notags(trim($_POST['username'])).' from IP '.$_SERVER['REMOTE_ADDR']);
+ notice(t('Login failed.').EOL);
+ goaway(z_root());