X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=actions%2Flogin.php;h=d3e4312f71152f86e42047250f1361c95c8fd6df;hb=2b56d3b534389cba1d44c6f5ef4d1a8a514acda6;hp=dc6352368a698e0753619bdb9827df4b555585d9;hpb=e547a2f54c2a2184d55c57c7712d4d50621f5fc2;p=quix0rs-gnu-social.git diff --git a/actions/login.php b/actions/login.php index dc6352368a..d3e4312f71 100644 --- a/actions/login.php +++ b/actions/login.php @@ -62,6 +62,28 @@ class LoginAction extends Action return false; } + /** + * Prepare page to run + * + * + * @param $args + * @return string title + */ + + function prepare($args) + { + parent::prepare($args); + + // @todo this check should really be in index.php for all sensitive actions + $ssl = common_config('site', 'ssl'); + if (empty($_SERVER['HTTPS']) && ($ssl == 'always' || $ssl == 'sometimes')) { + common_redirect(common_local_url('login')); + // exit + } + + return true; + } + /** * Handle input, produce output *