public static function out($jaxl, $payload) { JAXL0124::out($payload); }
public static function saveSession($xml, $jaxl) { if ($_SESSION['auth']) { $_SESSION['rid'] = isset($jaxl->bosh['rid']) ? $jaxl->bosh['rid'] : false; $_SESSION['sid'] = isset($jaxl->bosh['sid']) ? $jaxl->bosh['sid'] : false; $_SESSION['jid'] = $jaxl->jid; $_SESSION['id'] = $jaxl->lastid; session_write_close(); if (self::$sess) { // session already closed? list($body, $xml) = self::unwrapBody($xml); JAXLog::log("[[" . $jaxl->action . "]] Auth complete, sync now\n" . json_encode($_SESSION), 5, $jaxl); return self::out(array('jaxl' => 'jaxl', 'xml' => urlencode($xml))); } else { self::$sess = true; JAXLog::log("[[" . $jaxl->action . "]] Auth complete, commiting session now\n" . json_encode($_SESSION), 5, $jaxl); } } else { JAXLog::log("[[" . $jaxl->action . "]] Not authed yet, Not commiting session\n" . json_encode($_SESSION), 5, $jaxl); } return $xml; }
public static function saveSession($xml, $jaxl) { if ($_SESSION['auth'] === true) { $_SESSION['rid'] = isset($jaxl->bosh['rid']) ? $jaxl->bosh['rid'] : false; $_SESSION['sid'] = isset($jaxl->bosh['sid']) ? $jaxl->bosh['sid'] : false; $_SESSION['jid'] = $jaxl->jid; $_SESSION['id'] = $jaxl->lastid; if ($jaxl->bosh['out']) { session_write_close(); } if (self::$sess && $jaxl->bosh['out']) { list($body, $xml) = self::unwrapBody($xml); $jaxl->log("[[" . $_REQUEST['jaxl'] . "]] Auth complete, sync now\n" . json_encode($_SESSION), 5); return self::out(array('jaxl' => 'jaxl', 'xml' => urlencode($xml))); } else { self::$sess = true; $jaxl->log("[[" . $_REQUEST['jaxl'] . "]] Auth complete, commiting session now\n" . json_encode($_SESSION), 5); } } else { $jaxl->log("[[" . $_REQUEST['jaxl'] . "]] Not authed yet, Not commiting session\n" . json_encode($_SESSION), 5); } return $xml; }