Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make delayed redirect (login/logout) optional #1380

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions com.woltlab.wcf/option.xml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@
<optiontype>boolean</optiontype>
<defaultvalue>0</defaultvalue>
</option>
<option name="login_logout_redirect">
<categoryname>general.page</categoryname>
<optiontype>boolean</optiontype>
<defaultvalue>1</defaultvalue>
</option>
<option name="footer_code">
<categoryname>general.page</categoryname>
<optiontype>textarea</optiontype>
Expand Down
7 changes: 6 additions & 1 deletion wcfsetup/install/files/lib/action/LogoutAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ public function execute() {
$this->executed();

// forward to index page
HeaderUtil::delayedRedirect(LinkHandler::getInstance()->getLink(), WCF::getLanguage()->get('wcf.user.logout.redirect'));
if (defined('LOGIN_LOGOUT_REDIRECT') && LOGIN_LOGOUT_REDIRECT) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defined('LOGIN_LOGOUT_REDIRECT') is not necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know. Force of habit ;)

HeaderUtil::delayedRedirect(LinkHandler::getInstance()->getLink(), WCF::getLanguage()->get('wcf.user.logout.redirect'));
} else {
HeaderUtil::redirect(LinkHandler::getInstance()->getLink());
}

exit;
}
}
9 changes: 7 additions & 2 deletions wcfsetup/install/files/lib/form/LoginForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,13 @@ public function save() {
$this->saved();

// redirect to url
WCF::getTPL()->assign('__hideUserMenu', true);
HeaderUtil::delayedRedirect($this->url, WCF::getLanguage()->get('wcf.user.login.redirect'));
if (defined('LOGIN_LOGOUT_REDIRECT') && LOGIN_LOGOUT_REDIRECT) {
WCF::getTPL()->assign('__hideUserMenu', true);
HeaderUtil::delayedRedirect($this->url, WCF::getLanguage()->get('wcf.user.login.redirect'));
} else {
HeaderUtil::redirect($this->url);
}

exit;
}

Expand Down
2 changes: 2 additions & 0 deletions wcfsetup/install/lang/de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,8 @@
<item name="wcf.acp.option.external_link_rel_nofollow.description"><![CDATA[Das Attribut „rel="nofollow"“ weist Suchmaschinen an, einen bestimmten Link auf einer Seite zu ignorieren.]]></item>
<item name="wcf.acp.option.external_link_target_blank"><![CDATA[Externe Links in neuem Fenster öffnen]]></item>
<item name="wcf.acp.option.external_link_target_blank.description"><![CDATA[Setzt das Attribut „target="_blank"“ auf externe Links und weist den Browser dadurch an, einen aufgerufenen Link in einem neuen Browser-Fenster zu öffnen.]]></item>
<item name="wcf.acp.option.login_logout_redirect"><![CDATA[Verzögerte Weiterleitung nach Login/Logout aktivieren]]></item>
<item name="wcf.acp.option.login_logout_redirect.description"><![CDATA[Aktiviert die verzögerte Weiterleitung nach erfolgreichem Login/Logout]]></item>
<item name="wcf.acp.option.jquery_source"><![CDATA[jQuery-Quelle]]></item>
<item name="wcf.acp.option.jquery_source.local"><![CDATA[lokale Version]]></item>
<item name="wcf.acp.option.jquery_source.google"><![CDATA[Google Hosted Libraries CDN]]></item>
Expand Down
2 changes: 2 additions & 0 deletions wcfsetup/install/lang/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,8 @@ Examples for medium ID detection:
<item name="wcf.acp.option.external_link_rel_nofollow.description"><![CDATA[The attribute “rel="nofollow"” tells search engines to disregard external links.]]></item>
<item name="wcf.acp.option.external_link_target_blank"><![CDATA[Open external links in a new window]]></item>
<item name="wcf.acp.option.external_link_target_blank.description"><![CDATA[Appends the attribute “target="_blank"” to external links, causing the user’s browser to open the link in a new window.]]></item>
<item name="wcf.acp.option.login_logout_redirect"><![CDATA[Enable delayed redirect after login/logout]]></item>
<item name="wcf.acp.option.login_logout_redirect.description"><![CDATA[Enables the delayed redirect after successful login/logout]]></item>
<item name="wcf.acp.option.jquery_source"><![CDATA[jQuery Source]]></item>
<item name="wcf.acp.option.jquery_source.local"><![CDATA[Local Version]]></item>
<item name="wcf.acp.option.jquery_source.google"><![CDATA[Google Hosted Libraries CDN]]></item>
Expand Down