diff --git a/ajax.php b/ajax.php index 41fc98dbd..bd87e0be5 100644 --- a/ajax.php +++ b/ajax.php @@ -96,6 +96,19 @@ $ajax_call = basename($PHORUM['ajax_args']['call']); +// try to get some session-id if there isn't already a user loaded through +// the regular ways +if(empty($PHORUM['user']['user_id'])) { + // check if we got a session-id in the ajax args and if we got one + // try to load a user with that data + $ajax_session_id = phorum_ajax_getarg(PHORUM_SESSION_LONG_TERM,'string',0); + if(!empty($ajax_session_id)) { + $PHORUM['use_cookies']=PHORUM_USE_COOKIES; + $PHORUM['args'][PHORUM_SESSION_LONG_TERM]=$ajax_session_id; + phorum_api_user_session_restore(PHORUM_FORUM_SESSION); + } +} + /** * [hook] * ajax_