summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/NewUserNotif/NewUserNotif.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/NewUserNotif/NewUserNotif.php')
-rw-r--r--www/wiki/extensions/NewUserNotif/NewUserNotif.php60
1 files changed, 60 insertions, 0 deletions
diff --git a/www/wiki/extensions/NewUserNotif/NewUserNotif.php b/www/wiki/extensions/NewUserNotif/NewUserNotif.php
new file mode 100644
index 00000000..dc75aaf0
--- /dev/null
+++ b/www/wiki/extensions/NewUserNotif/NewUserNotif.php
@@ -0,0 +1,60 @@
+<?php
+if ( ! defined( 'MEDIAWIKI' ) )
+ die();
+
+/**
+ * Extension to provide customisable email notification of new user creation
+ *
+ * @file
+ * @author Rob Church <robchur@gmail.com>
+ * @ingroup Extensions
+ * @copyright © 2006 Rob Church
+ * @license GNU General Public Licence 2.0 or later
+ */
+
+$wgExtensionCredits['other'][] = array(
+ 'path' => __FILE__,
+ 'name' => 'New User Email Notification',
+ 'version' => '1.6.0',
+ 'author' => 'Rob Church',
+ 'url' => 'https://www.mediawiki.org/wiki/Extension:New_User_Email_Notification',
+ 'descriptionmsg' => 'newusernotif-desc',
+);
+
+$dir = dirname(__FILE__) . '/';
+$wgMessagesDirs['NewUserNotif'] = __DIR__ . '/i18n';
+$wgAutoloadClasses['NewUserNotifier'] = $dir . 'NewUserNotif.class.php';
+$wgExtensionFunctions[] = 'efNewUserNotifSetup';
+
+/**
+ * Email address to use as the sender
+ */
+$wgNewUserNotifSender = $wgPasswordSender;
+
+/**
+ * Users who should receive notification mails
+ */
+$wgNewUserNotifTargets[] = 1;
+
+/**
+ * Additional email addresses to send mails to
+ */
+$wgNewUserNotifEmailTargets = array();
+
+/**
+ * Extension setup
+ */
+function efNewUserNotifSetup() {
+ global $wgHooks;
+ $wgHooks['AddNewAccount'][] = 'efNewUserNotif';
+}
+
+/**
+ * Hook account creation
+ *
+ * @param User $user User account that was created
+ * @return bool
+ */
+function efNewUserNotif( $user ) {
+ return NewUserNotifier::hook( $user );
+}