diff --git a/ConfirmAccount/ConfirmAccount.php b/ConfirmAccount/ConfirmAccount.php index 608ef35..c511663 100644 --- a/ConfirmAccount/ConfirmAccount.php +++ b/ConfirmAccount/ConfirmAccount.php @@ -1,81 +1,81 @@ - __FILE__, - 'name' => 'Confirm User Accounts', - 'descriptionmsg' => 'confirmedit-desc', - 'author' => 'Aaron Schulz', - 'url' => 'https://www.mediawiki.org/wiki/Extension:ConfirmAccount', -); - -# Load default config variables -require( dirname( __FILE__ ) . '/ConfirmAccount.config.php' ); - -# Define were PHP files and i18n files are located -require( dirname( __FILE__ ) . '/ConfirmAccount.setup.php' ); -ConfirmAccountSetup::defineSourcePaths( $wgAutoloadClasses, $wgExtensionMessagesFiles ); - -# Define JS/CSS modules and file locations -ConfirmAccountUISetup::defineResourceModules( $wgResourceModules ); - -# Let some users confirm account requests and view credentials for created accounts -$wgAvailableRights[] = 'confirmaccount'; // user can confirm account requests -$wgAvailableRights[] = 'requestips'; // user can see IPs in request queue -$wgAvailableRights[] = 'lookupcredentials'; // user can lookup info on confirmed users - -# Actually register special pages -ConfirmAccountUISetup::defineSpecialPages( $wgSpecialPages, $wgSpecialPageGroups ); - -# ####### HOOK CALLBACK FUNCTIONS ######### - -# UI-related hook handlers -ConfirmAccountUISetup::defineHookHandlers( $wgHooks ); - -# Check for account name collisions -$wgHooks['AbortNewAccount'][] = 'ConfirmAccountUIHooks::checkIfAccountNameIsPending'; - -# Schema changes -$wgHooks['LoadExtensionSchemaUpdates'][] = 'ConfirmAccountUpdaterHooks::addSchemaUpdates'; - -# ####### END HOOK CALLBACK FUNCTIONS ######### - -# Load the extension after setup is finished -$wgExtensionFunctions[] = 'efLoadConfirmAccount'; - -/** - * This function is for setup that has to happen in Setup.php - * when the functions in $wgExtensionFunctions get executed. - * @return void - */ -function efLoadConfirmAccount() { - global $wgEnableEmail; - # This extension needs email enabled! - # Otherwise users can't get their passwords... - if ( !$wgEnableEmail ) { - echo "ConfirmAccount extension requires \$wgEnableEmail set to true.\n"; - exit( 1 ) ; - } -} + __FILE__, + 'name' => 'Confirm User Accounts', + 'descriptionmsg' => 'confirmedit-desc', + 'author' => 'Aaron Schulz and Jacob G.', + 'url' => 'https://www.mediawiki.org/wiki/Extension:ConfirmAccount', +); + +# Load default config variables +require( dirname( __FILE__ ) . '/ConfirmAccount.config.php' ); + +# Define were PHP files and i18n files are located +require( dirname( __FILE__ ) . '/ConfirmAccount.setup.php' ); +ConfirmAccountSetup::defineSourcePaths( $wgAutoloadClasses, $wgExtensionMessagesFiles ); + +# Define JS/CSS modules and file locations +ConfirmAccountUISetup::defineResourceModules( $wgResourceModules ); + +# Let some users confirm account requests and view credentials for created accounts +$wgAvailableRights[] = 'confirmaccount'; // user can confirm account requests +$wgAvailableRights[] = 'requestips'; // user can see IPs in request queue +$wgAvailableRights[] = 'lookupcredentials'; // user can lookup info on confirmed users + +# Actually register special pages +ConfirmAccountUISetup::defineSpecialPages( $wgSpecialPages, $wgSpecialPageGroups ); + +# ####### HOOK CALLBACK FUNCTIONS ######### + +# UI-related hook handlers +ConfirmAccountUISetup::defineHookHandlers( $wgHooks ); + +# Check for account name collisions +$wgHooks['AbortNewAccount'][] = 'ConfirmAccountUIHooks::checkIfAccountNameIsPending'; + +# Schema changes +$wgHooks['LoadExtensionSchemaUpdates'][] = 'ConfirmAccountUpdaterHooks::addSchemaUpdates'; + +# ####### END HOOK CALLBACK FUNCTIONS ######### + +# Load the extension after setup is finished +$wgExtensionFunctions[] = 'efLoadConfirmAccount'; + +/** + * This function is for setup that has to happen in Setup.php + * when the functions in $wgExtensionFunctions get executed. + * @return void + */ +function efLoadConfirmAccount() { + global $wgEnableEmail; + # This extension needs email enabled! + # Otherwise users can't get their passwords... + if ( !$wgEnableEmail ) { + echo "ConfirmAccount extension requires \$wgEnableEmail set to true.\n"; + exit( 1 ) ; + } +}