public function gdn_dispatcher_appStartup_handler($Sender)
{
safeHeader('P3P: CP="CAO PSA OUR"', true);
if ($SSO = Gdn::request()->get('sso')) {
saveToConfig('Garden.Registration.SendConnectEmail', false, false);
$IsApi = preg_match('`\\.json$`i', Gdn::request()->path());
$UserID = false;
try {
$CurrentUserID = Gdn::session()->UserID;
$UserID = Gdn::userModel()->sso($SSO);
} catch (Exception $Ex) {
trace($Ex, TRACE_ERROR);
}
if ($UserID) {
Gdn::session()->start($UserID, !$IsApi, !$IsApi);
if ($IsApi) {
Gdn::session()->validateTransientKey(true);
}
if ($UserID != $CurrentUserID) {
Gdn::userModel()->fireEvent('AfterSignIn');
}
} else {
// There was some sort of error. Let's print that out.
foreach (Gdn::userModel()->Validation->resultsArray() as $msg) {
trace($msg, TRACE_ERROR);
}
Gdn::userModel()->Validation->reset();
}
}
}