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

Some recomended me to use some existing hooks. I tried to read about it but I´m not sure if I understood it correctly. This is what I´ve done so far. Am I going the right direction?

 __FILE__,       'name' => 'Approve Account',       'author' =>'Markus',        'url' => 'https://www.mediawiki.org/wiki/Extension:Approve_Account',        'description' => 'This extension require admin to allow recently'.                        ' registered users to login',       'version'  => 0.1,       ); $wgHooks['AddNewAccount'][] = 'approve_accountHooks::onAddNewAccount'; $user = User::loadFromSession; $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select('user_name, approved_account FROM user '.                          "WHERE user_name = $user"); if( approved_account == '0' {	      } }