Thread:Project:Support desk/Aprrove account before they are able to login

I have a request since I don´t have the skills to create this my self. I´ve been looking on ConfirmAccount Extension which is almost what I need. Alltough we don´t have the possibillity to use email on our wiki so I can´t use that extension.

What I wan´t is to let users create their own account´s with password and all like normal. But all accounts will be declined login access untill approved by sysop or something.

I was thinking about creating a new column (approved_account) in user table with autoset value, for example 0 and in login code add an extra if approved_account = 0 then decline login.

I have tried multiple times but I have no idea how to solve this. What I put together so far is seen below, but it might be totally wrong.

I would appreciate some help.

include("$IP/includes/SpecialUserlogout.php");

function Auth_remote_user_hook { global $wgUser; global $wgRequest;

// For a few special pages, don't do anything. $title = $wgRequest->getVal('title'); if ($title == 'Special:Userlogout' ||     $title == 'Special:Userlogin') { return; }

$wgUser = User::loadFromSession; $username = strtolower($wgUser->getName); $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select(user_name, approved_account FROM user WHERE user_name = $wgUser);

if( approved_account = '0' ) { wfSpecialUserLogout; }

if ($wgUser->isLoggedIn) { return; }