summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaco <franco@reevo.org>2019-09-09 13:30:35 -0300
committerYaco <franco@reevo.org>2019-09-09 13:30:35 -0300
commitdbeef1a8c353ef5e43b1a05ff09e757d5e215648 (patch)
tree38dadc20156256e12656616915277867e762b730
parentfc1f81c1be54cd6ecab886010b6bad8dff014f71 (diff)
Agrega cambios para cuerpo y asunto del correo de notificacion en el codigo de la extension
-rw-r--r--www/wiki/LocalSettings.Reevo.php2
-rw-r--r--www/wiki/extensions/NewUserNotif/ExtendedParamsForReevo.php85
-rw-r--r--www/wiki/extensions/NewUserNotif/NewUserNotif.class.php10
3 files changed, 7 insertions, 90 deletions
diff --git a/www/wiki/LocalSettings.Reevo.php b/www/wiki/LocalSettings.Reevo.php
index 771e1308..4fff0537 100644
--- a/www/wiki/LocalSettings.Reevo.php
+++ b/www/wiki/LocalSettings.Reevo.php
@@ -387,8 +387,6 @@ require_once( "$IP/extensions/HideEmptySections/HideEmptySections.php" );
## NewUserNotif
require_once "$IP/extensions/NewUserNotif/NewUserNotif.php";
-require_once "$IP/extensions/NewUserNotif/ExtendedParamsForReevo.php";
-
$wgNewUserNotifEmailTargets = array(
'sysadmins@reevo.org'
);
diff --git a/www/wiki/extensions/NewUserNotif/ExtendedParamsForReevo.php b/www/wiki/extensions/NewUserNotif/ExtendedParamsForReevo.php
deleted file mode 100644
index 19247aff..00000000
--- a/www/wiki/extensions/NewUserNotif/ExtendedParamsForReevo.php
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-/**
- * Example Extension to provide additional parameters to the subject line and message body for NewUserNotif
- *
- * @file
- * @author Jack D. Pond <jack.pond@psitex.com>
- * @ingroup Extensions
- * @copyright 2011 Jack D. pond
- * @url http://www.mediawiki.org/wiki/Manual:Extensions
- * @licence GNU General Public Licence 2.0 or later
- */
-
-if (!defined('MEDIAWIKI')) die('Not an entry point.');
-
-$wgExtensionFunctions[] = 'efNewUserNotifSetupExtension';
-$wgExtensionCredits['other'][] = array(
- 'path' => __FILE__,
- 'name' => 'AdditionalNewUserNotifParams',
- 'author' => array( 'Jack D. Pond' ),
- 'version' => '1.0',
- 'url' => 'https://www.mediawiki.org/wiki/Extension:NewUserNotif',
-);
-
-/**
- * Set up hooks for Additional NewUserNotif Parameters
- *
-*/
-function efNewUserNotifSetupExtension() {
- global $wgHooks;
- $wgHooks['NewUserNotifSubject'][] = 'efNewUserNotifSubject';
- $wgHooks['NewUserNotifBody'][] = 'efNewUserNotifBody';
- return true;
-}
-
-
-/**
- * This function creates additional parameters which can be used in the email notification Subject Line for new users
- *
- * @param $callobj NewUserNotifier object (this).
- * @param $subjectLine String: Returns the message subject line
- * @param $siteName Site Name of the Wiki
- * @param $recipient Email/User Name of the Message Recipient.
- * @param $user User name of the added user
- * @return true
- */
-
-function efNewUserNotifSubject ( $callobj , $subjectLine , $siteName , $recipient , $user )
-{
- $subjectLine = wfMessage(
- 'newusernotifsubj',
- $siteName, // $1 Site Name
- $user->getName() // $2 User Name
- )->inContentLanguage()->text();
- return ( true );
-}
-
-/**
- * This function creates additional parameters which can be used in the email notification message body for new users
- *
- * @param $callobj NewUserNotifier object (this).
- * @param $messageBody String: Returns the message body.
- * @param $siteName Site Name of the Wiki
- * @param $recipient Email/User Name of the Message Recipient.
- * @param $user User name of the added user
- * @return true
- */
-
-function efNewUserNotifBody ( $callobj , $messageBody , $siteName , $recipient , $user )
-{
- global $wgContLang, $wgRequest;
- $messageBody = wfMessage(
- 'newusernotifbody',
- $recipient, // $1 Recipient (of notification message)
- $user->getName(), // $2 User Name
- $siteName, // $3 Site Name
- $wgContLang->timeAndDate( wfTimestampNow() ), // $4 Time and date stamp
- $wgContLang->date( wfTimestampNow() ), // $5 Date Stamp
- $wgContLang->time( wfTimestampNow() ), // $6 Time Stamp
- $user->getEmail(), // $7 email
- rawurlencode($siteName), // $8 Site name encoded for email message link
- $wgRequest->getIP(), // $9 Submitter's IP Address
- rawurlencode($user->getName()) // $10 User Name encoded for email message link
- )->inContentLanguage()->text();
- return ( true );
-}
diff --git a/www/wiki/extensions/NewUserNotif/NewUserNotif.class.php b/www/wiki/extensions/NewUserNotif/NewUserNotif.class.php
index 4cfabe58..b9e88b33 100644
--- a/www/wiki/extensions/NewUserNotif/NewUserNotif.class.php
+++ b/www/wiki/extensions/NewUserNotif/NewUserNotif.class.php
@@ -91,7 +91,7 @@ class NewUserNotifier {
$userNotif = $this;
Hooks::run( 'NewUserNotifSubject', array( &$userNotif, &$subjectLine, $wgSitename, $recipient, $user ) );
if (!strlen($subjectLine) )
- return wfMessage( 'newusernotifsubj', $wgSitename )->inContentLanguage()->text();
+ return wfMessage( 'newusernotifsubj', $wgSitename, $user->getName() )->inContentLanguage()->text();
return $subjectLine;
}
@@ -102,7 +102,7 @@ class NewUserNotifier {
* @param User $user User that was created
*/
private function makeMessage( $recipient, $user ) {
- global $wgSitename, $wgContLang;
+ global $wgSitename, $wgContLang, $wgRequest;
$messageBody = "";
// Avoid PHP 7.1 warning of passing $this by reference
$userNotif = $this;
@@ -115,7 +115,11 @@ class NewUserNotifier {
$wgSitename,
$wgContLang->timeAndDate( wfTimestampNow() ),
$wgContLang->date( wfTimestampNow() ),
- $wgContLang->time( wfTimestampNow() )
+ $wgContLang->time( wfTimestampNow() ),
+ $user->getEmail(), // $7 email
+ rawurlencode($wgSitename), // $8 Site name encoded for email message link
+ $wgRequest->getIP(), // $9 Submitter's IP Address
+ rawurlencode($user->getName()) // $10 User Name encoded for email message link
)->inContentLanguage()->text();
return $messageBody;
}