+if(array_key_exists('system_language',$_POST)) {
+ if(strlen($_POST['system_language']))
+ $_SESSION['language'] = $_POST['system_language'];
+ else
+ unset($_SESSION['language']);
+}
+if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) {
+ $lang = $_SESSION['language'];
+ load_translation_table($lang);
+}
+
+if(x($_GET,'zrl')) {
+ $_SESSION['my_url'] = $_GET['zrl'];
+ $a->query_string = preg_replace('/[\?&]zrl=(.*?)([\?&]|$)/is','',$a->query_string);
+}
+
+/**
+ *
+ * For Mozilla auth manager - still needs sorting, and this might conflict with LRDD header.
+ * Apache/PHP lumps the Link: headers into one - and other services might not be able to parse it
+ * this way. There's a PHP flag to link the headers because by default this will over-write any other
+ * link header.
+ *
+ * What we really need to do is output the raw headers ourselves so we can keep them separate.
+ *
+ */
+
+// header('Link: <' . $a->get_baseurl() . '/amcd>; rel="acct-mgmt";');
+
+if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module === 'login'))