Created
April 13, 2016 20:39
-
-
Save khitrenovich/33c0bca70d3774f20fbeacb917736125 to your computer and use it in GitHub Desktop.
Gallery 3.0.9 - redirect login requests to HTTPS (under "modules/gallery3/helpers")
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- gallery_event.php.orig 2016-04-09 15:04:14.537098381 -0700 | |
+++ gallery_event.php 2016-04-09 15:31:20.334599254 -0700 | |
@@ -241,11 +241,19 @@ | |
if ($theme->page_subtype != "login") { | |
$user = identity::active_user(); | |
if ($user->guest) { | |
- $menu->append(Menu::factory("dialog") | |
+ if (request::protocol() != "https") { | |
+ $menu->append(Menu::factory("link") | |
+ ->id("user_menu_ssl_redirect") | |
+ ->css_id("g-login-redirect") | |
+ ->url("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]") | |
+ ->label(t("Login"))); | |
+ } else { | |
+ $menu->append(Menu::factory("dialog") | |
->id("user_menu_login") | |
->css_id("g-login-link") | |
->url(url::site("login/ajax")) | |
->label(t("Login"))); | |
+ } | |
} else { | |
$csrf = access::csrf_token(); | |
$menu->append(Menu::factory("link") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment