function janrain_capture_render_logout_link in Janrain Registration 7.4
Same name and namespace in other branches
- 7 janrain_capture.module \janrain_capture_render_logout_link()
- 7.2 janrain_capture.module \janrain_capture_render_logout_link()
- 7.3 janrain_capture.module \janrain_capture_render_logout_link()
Generates a 'Logout' link for Janrain Capture.
1 call to janrain_capture_render_logout_link()
- janrain_capture_block_content in ./
janrain_capture.module - Provides the content for the Janrain Capture block, and is also used to replace the user login block content if the "enforce" setting is on.
File
- ./
janrain_capture.module, line 576 - This module implements authentication endpoints for Janrain Capture.
Code
function janrain_capture_render_logout_link() {
$ver = variable_get('janrain_capture_ver', JANRAIN_CAPTURE_VERSION_DEFAULT);
if ($ver == JANRAIN_CAPTURE_VERSION_LEGACY) {
$janrain_capture_optional = variable_get('janrain_capture_optional', array());
}
else {
$janrain_capture_optional = variable_get('janrain_capture_federate2', array());
$janrain_capture_optional = $janrain_capture_optional[$_SESSION['country_id']];
}
// TODO: Actually change the logout link
if ($ver == JANRAIN_CAPTURE_VERSION_WIDGET && $janrain_capture_optional['capture_sso_enabled'] == 1) {
$link = '<a href="javascript:CAPTURE.logout();">' . t('Log out') . '</a>';
}
elseif ($ver == JANRAIN_CAPTURE_VERSION_LEGACY && $janrain_capture_optional['capture_sso_address'] != '') {
$link = '<a href="javascript:CAPTURE.logout()">' . t('Log out') . '</a>';
}
else {
$link = l(t('Log out'), 'user/logout');
}
return $link;
}