// process logout request
nuke_session();
- notice( t('Logged out.') . EOL);
- goaway($a->get_baseurl());
+ info( t('Logged out.') . EOL);
+ goaway(z_root());
}
if(x($_SESSION,'visitor_id') && (! x($_SESSION,'uid'))) {
// extra paranoia - if the IP changed, log them out
if($check && ($_SESSION['addr'] != $_SERVER['REMOTE_ADDR'])) {
nuke_session();
- goaway($a->get_baseurl());
+ goaway(z_root());
}
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
if(! count($r)) {
nuke_session();
- goaway($a->get_baseurl());
+ goaway(z_root());
}
// initialise user environment
$_SESSION['theme'] = $a->user['theme'];
$_SESSION['page_flags'] = $a->user['page-flags'];
+ $member_since = strtotime($a->user['register_date']);
+ if(time() < ($member_since + ( 60 * 60 * 24 * 14)))
+ $_SESSION['new_member'] = true;
+ else
+ $_SESSION['new_member'] = false;
+
if(strlen($a->user['timezone'])) {
date_default_timezone_set($a->user['timezone']);
$a->timezone = $a->user['timezone'];
if(($noid) || (strpos($temp_string,'@')) || (! validate_url($temp_string))) {
$a = get_app();
notice( t('Login failed.') . EOL);
- goaway($a->get_baseurl());
+ goaway(z_root());
// NOTREACHED
}
if($a->config['register_policy'] == REGISTER_CLOSED) {
$a = get_app();
notice( t('Login failed.') . EOL);
- goaway($a->get_baseurl());
+ goaway(z_root());
// NOTREACHED
}
// new account
if((! $record) || (! count($record))) {
logger('authenticate: failed login attempt: ' . trim($_POST['openid_url']));
notice( t('Login failed.') . EOL );
- goaway($a->get_baseurl());
+ goaway(z_root());
}
$_SESSION['uid'] = $record['uid'];
if($a->user['login_date'] === '0000-00-00 00:00:00') {
$_SESSION['return_url'] = 'profile_photo/new';
$a->module = 'profile_photo';
- notice( t("Welcome ") . $a->user['username'] . EOL);
- notice( t('Please upload a profile photo.') . EOL);
+ info( t("Welcome ") . $a->user['username'] . EOL);
+ info( t('Please upload a profile photo.') . EOL);
}
else
- notice( t("Welcome back ") . $a->user['username'] . EOL);
+ info( t("Welcome back ") . $a->user['username'] . EOL);
+
+
+ $member_since = strtotime($a->user['register_date']);
+ if(time() < ($member_since + ( 60 * 60 * 24 * 14)))
+ $_SESSION['new_member'] = true;
+ else
+ $_SESSION['new_member'] = false;
if(strlen($a->user['timezone'])) {
date_default_timezone_set($a->user['timezone']);