Viewing 1 replies (of 1 total)
  • Thread Starter thomas_n

    (@thomas_n)

    Nevermind. Found the solution. Add this to functions.php in your theme:

    function external_login() {
    	if (!is_user_logged_in() && !$_POST['username'])
    	{
    		echo '<script language="JavaScript">
    		<!--
    			 window.location="http://your.url/";
    		//-->
    		</script>';
    	}
    
    }
    
    add_action('login_head', 'external_login');

    Basically this checks if the user is logged in and/or the ‘username’ field is set. If neither is true, then it inserts some javascript that redirects the user to an external login page. On this page you can construct your own login form.

    (ps. now why would I want to do this? I redirect all of my users for their applications to my central hosting pages so I can use these to inform them on changes in infrastructure and so forth. Yes, you could call it ‘marketing’.)

Viewing 1 replies (of 1 total)

The topic ‘External login page’ is closed to new replies.