On 28/07/07, Rob Church <robchur(a)gmail.com>
wrote:
The approach I'd use for this is to write a
quickie special page
extension which checks to see if the user is logged in, and if so,
issues a redirect to the "actual" main page, otherwise, redirects to
Special:Userlogin, with a "returnto" value that is the title of this
main page.
Rob:
I appreciated your direction, but unfortunately I am not well versed in PHP
and just beginning MediaWiki. I just don't know where to begin. Could you
please just describe how I check if somebody is logged-in and how to use the
returnto value you described?
Thanks for all you help.
Instead of writing to the special page:
global $wgUser;
if ( $wgUser->isLoggedIn() )
header("Location: /wiki/Real_Main_Page"); //Issues a 302 Redirect
else
header("Location: /wiki/Special:UserLogin");
exit(0);
#TODO: Send the redirect using the Mediawiki function.