[wpmu-trac] Re: [WordPress MU Trac] #452: Ability to require https for admin interface and user login

WordPress MU Trac wpmu-trac at lists.automattic.com
Thu Oct 18 17:20:58 GMT 2007


#452: Ability to require https for admin interface and user login
-------------------------+--------------------------------------------------
 Reporter:  axelseaa     |        Owner:  somebody
     Type:  enhancement  |       Status:  new     
 Priority:  normal       |    Milestone:          
Component:  component1   |      Version:          
 Severity:  normal       |   Resolution:          
 Keywords:               |  
-------------------------+--------------------------------------------------
Comment (by beaulebens):

 You should be able to do this with a pretty basic plugin that just hooks
 into either the wp-login.php file somewhere (I couldn't find a decent hook
 here from a quick look?) or else just do it on 'init' and look for
 requests to log in. It'd just check that the protocol being used is
 'https' and if not, then redirect to the current page, but with 'https'.

 Something remotely (not tested or confirmed or anything) like this:


 {{{
 function check_https_login() {
         global $current_site
         if ('wp-login.php' == basename($_SERVER['REQUEST_URI']) &&
 !$_SERVER['HTTPS']) {
                 wp_redirect('https://' . $current_site->domain .
 $current_site->path);
                 exit;
         }
 }
 add_action('init', 'check_https_login');
 }}}

-- 
Ticket URL: <http://trac.mu.wordpress.org/ticket/452#comment:1>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser


More information about the wpmu-trac mailing list