Actually you don't even need to do that. $wgUser->isLoggedIn(); will tell you if you're logged in. And $wgOut->redirect( SpecialPage::getTitleFor( 'Special:UserLogin' )->fullURL() ); should direct to the login page (Though I may have a function name or two wrong.)
~Daniel Friesen(Dantman) of: -The Gaiapedia (http://gaia.wikia.com) -Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) -and Wiki-Tools.com (http://wiki-tools.com)
Adam Meyer wrote:
I am notorious for over complicating things, but you could have it check if the user is logged-in, and if not, redirect them to a login page, and if they are, let them brows as usual. You would probably need to do this in php at the level of the skin something like this at the very top of the skin template should work
The name of the user cookie is different for each install, so you would need to find the name and enter it in.
if(!isset($_COOKIE['name_of_user_cookie'])){ // if cookie not set - redirect header("Location: http://www.example.com/index.php/ Special:Userlogin"); // Redirects browser to login page }
On Mar 31, 2008, at 12:11 PM, for.register for.register wrote:
On Tue, Apr 1, 2008 at 12:05 AM, for.register for.register fregister@gmail.com wrote:
On Mon, Mar 31, 2008 at 11:56 PM, for.register for.register fregister@gmail.com wrote:
On Mon, Mar 31, 2008 at 11:21 PM, Schneelocke schneelocke@gmail.com wrote:
2008/3/31, for.register for.register fregister@gmail.com:
I am a new user of mediawiki, my wiki is a private wiki, only authentic user is allowed. My question is how to set the homepage directly to login window.
Have you tried putting '#REDIRECT [[Special:Userlogin]]' on your main page? Alternatively, you could probably also edit MediaWiki:Mainpage and put 'Special:Userlogin' in there.
I haven't tried either method, though.
-- schnee
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Thanks, but frankly I do not know where is my Mainpage, I use default index.php.
Could you explain a little more?
I got it. on MediaWiki:Mainpage 'Special:Userlogin' works good. Thank you!
The only problem with this method (changing Mediawiki:Mainpage) is once a user logs in they are taken back to the Special:UserLogin page, not the Main Page. Is there anyway to accomplish this and redirect back to the Main Page?
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l