ini_set('pcre.backtrack_limit', 250000);
-define ( 'FRIENDIKA_VERSION', '2.2.988' );
+define ( 'FRIENDIKA_VERSION', '2.2.989' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
define ( 'DB_UPDATE_VERSION', 1054 );
if($a->interactive)
$_SESSION['sysmsg'] .= $s;
}}
+ if(! function_exists('info')) {
+ function info($s) {
+ $a = get_app();
+ if($a->interactive)
+ $_SESSION['sysmsg_info'] .= $s;
+ }}
+
// wrapper around config to limit the text length of an incoming message
}}
+
+
if(! function_exists('lang_selector')) {
function lang_selector() {
global $lang;
return true;
return false;
}}
+
// process logout request
nuke_session();
- notice( t('Logged out.') . EOL);
+ info( t('Logged out.') . EOL);
goaway($a->get_baseurl());
}
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);
if(strlen($a->user['timezone'])) {
date_default_timezone_set($a->user['timezone']);
$_SESSION['cid'] = $a->cid;
}
+ $l = get_language();
- q("UPDATE `user` SET `login_date` = '%s' WHERE `uid` = %d LIMIT 1",
+ q("UPDATE `user` SET `login_date` = '%s', `language` = '%s' WHERE `uid` = %d LIMIT 1",
dbesc(datetime_convert()),
+ dbesc($l),
intval($_SESSION['uid'])
);
@include(".htconfig.php");
-/**
- *
- * Get the language setting directly from system variables, bypassing get_config()
- * as database may not yet be configured.
- *
- * If possible, we use the value from the browser.
- *
- */
-
-if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
- $langs = preg_split("/[,-]/",$_SERVER['HTTP_ACCEPT_LANGUAGE'],2);
- $lang = $langs[0];
-} else {
- $lang = ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
-}
+$lang = get_language();
load_translation_table($lang);
if(! x($_SESSION,'sysmsg'))
$_SESSION['sysmsg'] = '';
+ if(! x($_SESSION,'sysmsg_info'))
+ $_SESSION['sysmsg_info'] = '';
+
/*
* check_config() is responsible for running update scripts. These automatically
* update the DB schema whenever we push a new one out. It also checks to see if
if(x($_SESSION,'sysmsg')) {
$a->page['content'] = "<div id=\"sysmsg\" class=\"error-message\">{$_SESSION['sysmsg']}</div>\r\n"
. ((x($a->page,'content')) ? $a->page['content'] : '');
+ $_SESSION['sysmsg']="";
unset($_SESSION['sysmsg']);
}
+ if(x($_SESSION,'sysmsg_info')) {
+ $a->page['content'] = "<div id=\"sysmsg_info\" class=\"info-message\">{$_SESSION['sysmsg_info']}</div>\r\n"
+ . ((x($a->page,'content')) ? $a->page['content'] : '');
+ $_SESSION['sysmsg_info']="";
+ unset($_SESSION['sysmsg_info']);
+ }
+
call_hooks('page_end', $a->page['content']);
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);
if(strlen($a->user['timezone'])) {
$_SESSION['cid'] = $a->cid;
}
- q("UPDATE `user` SET `login_date` = '%s' WHERE `uid` = %d LIMIT 1",
+ $l = get_language();
+
+ q("UPDATE `user` SET `login_date` = '%s', `language` = '%s' WHERE `uid` = %d LIMIT 1",
dbesc(datetime_convert()),
+ dbesc($l),
intval($_SESSION['uid'])
);
+
header('X-Account-Management-Status: active; name="' . $a->user['username'] . '"; id="' . $a->user['nickname'] .'"');
if(($a->module !== 'home') && isset($_SESSION['return_url']))
goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
notice( t('Login failed.') . EOL);
goaway($a->get_baseurl());
// NOTREACHED
- }
+ }