r113077 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113076‎ | r113077 | r113078 >
Date:20:08, 5 March 2012
Author:ialex
Status:ok
Tags:
Comment:
svn:eol-style native
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5MailerJob.php (modified) (history)
  • /trunk/extensions/Genderize/AGPL-3.0.txt (modified) (history)
  • /trunk/extensions/Genderize/README (modified) (history)
  • /trunk/extensions/HidePrefix/AGPL-3.0.txt (modified) (history)
  • /trunk/extensions/HidePrefix/README (modified) (history)
  • /trunk/extensions/SemanticTitle/AGPL-3.0.txt (modified) (history)
  • /trunk/extensions/SemanticTitle/README (modified) (history)

Diff [purge]

Property changes on: trunk/extensions/HidePrefix/AGPL-3.0.txt
___________________________________________________________________
Added: svn:eol-style
11 + native
Property changes on: trunk/extensions/HidePrefix/README
___________________________________________________________________
Added: svn:eol-style
22 + native
Property changes on: trunk/extensions/SemanticTitle/AGPL-3.0.txt
___________________________________________________________________
Added: svn:eol-style
33 + native
Property changes on: trunk/extensions/SemanticTitle/README
___________________________________________________________________
Added: svn:eol-style
44 + native
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5MailerJob.php
@@ -1,103 +1,103 @@
2 -<?php
3 -/**
4 - * SpecialArticleFeedbackv5 class
5 - *
6 - * @package ArticleFeedback
7 - * @subpackage Job
8 - * @author Elizabeth M Smith <elizabeth@omniti.com>
9 - * @version $Id$
10 - */
11 -
12 -/**
13 - * This is a job to do mailings for oversight requests
14 - *
15 - * @package ArticleFeedback
16 - * @subpackage Job
17 - */
18 -class ArticleFeedbackv5MailerJob extends Job {
19 -
20 - /**
21 - * Passthrough that sends the name of the class as the name of the job
22 - *
23 - * @param $command
24 - * @param $title
25 - * @param $params array
26 - * @param int $id
27 - */
28 - function __construct( $title, $params, $id = 0 ) {
29 - parent::__construct( __CLASS__, $title, $params, $id );
30 - }
31 -
32 - /**
33 - * Run the job
34 - * @return boolean success
35 - */
36 - function run() {
37 - global $wgArticleFeedbackv5OversightEmails, $wgArticleFeedbackv5OversightEmailName;
38 - global $wgPasswordSender, $wgPasswordSenderName, $wgNoReplyAddress;
39 -
40 - $params = $this->params;
41 -
42 - // if the oversight email address is empty we're going to just skip all this, but return true
43 - if ( null === $wgArticleFeedbackv5OversightEmails ) {
44 - return true;
45 - }
46 -
47 - // if we don't have the right params set return false, job can't run
48 - if ( !array_key_exists( 'user_name', $params)
49 - || !array_key_exists( 'user_url', $params)
50 - || !array_key_exists( 'page_name', $params)
51 - || !array_key_exists( 'page_url', $params)
52 - || !array_key_exists( 'permalink', $params)) {
53 - return false;
54 - }
55 -
56 - // get our addresses
57 - $to = new MailAddress( $wgArticleFeedbackv5OversightEmails, $wgArticleFeedbackv5OversightEmailName );
58 - $from = new MailAddress( $wgPasswordSender, $wgPasswordSenderName );
59 - $replyto = new MailAddress( $wgNoReplyAddress );
60 -
61 - // get our text
62 - list($subject, $body) = $this->composeMail($params['user_name'],
63 - $params['user_url'],
64 - $params['page_name'],
65 - $params['page_url'],
66 - $params['permalink']);
67 -
68 - return UserMailer::send( $to, $from, $subject,
69 - $body, $replyto );
70 - }
71 -
72 - /**
73 - * Generate the "an oversight request has been made" email for sending
74 - * to the mailing list
75 - *
76 - * @param string $requestor_name user name
77 - * @param string $requestor_url link to user page
78 - * @param string $page_name page title
79 - * @param string $page_url page url
80 - * @param string $feedback_permalink permalink url to feedback
81 - */
82 - protected function composeMail( $requestor_name, $requestor_url, $page_name, $page_url, $feedback_permalink ) {
83 - global $wgPasswordSender, $wgPasswordSenderName, $wgNoReplyAddress, $wgRequest;
84 -
85 - // build the subject
86 - $subject = wfMessage( 'articlefeedbackv5-email-request-oversight-subject' )->params(
87 - $requestor_name,
88 - $page_name )->escaped();
89 -
90 - //text version, no need to escape since client will interpret it as plain text
91 - $body = wfMessage( 'articlefeedbackv5-email-request-oversight-body' )
92 - ->rawParams(
93 - $requestor_url,
94 - $page_url,
95 - $feedback_permalink)
96 - ->params(
97 - $requestor_name,
98 - $page_name)
99 - ->text();
100 -
101 - return array($subject, $body);
102 - }
103 -
 2+<?php
 3+/**
 4+ * SpecialArticleFeedbackv5 class
 5+ *
 6+ * @package ArticleFeedback
 7+ * @subpackage Job
 8+ * @author Elizabeth M Smith <elizabeth@omniti.com>
 9+ * @version $Id$
 10+ */
 11+
 12+/**
 13+ * This is a job to do mailings for oversight requests
 14+ *
 15+ * @package ArticleFeedback
 16+ * @subpackage Job
 17+ */
 18+class ArticleFeedbackv5MailerJob extends Job {
 19+
 20+ /**
 21+ * Passthrough that sends the name of the class as the name of the job
 22+ *
 23+ * @param $command
 24+ * @param $title
 25+ * @param $params array
 26+ * @param int $id
 27+ */
 28+ function __construct( $title, $params, $id = 0 ) {
 29+ parent::__construct( __CLASS__, $title, $params, $id );
 30+ }
 31+
 32+ /**
 33+ * Run the job
 34+ * @return boolean success
 35+ */
 36+ function run() {
 37+ global $wgArticleFeedbackv5OversightEmails, $wgArticleFeedbackv5OversightEmailName;
 38+ global $wgPasswordSender, $wgPasswordSenderName, $wgNoReplyAddress;
 39+
 40+ $params = $this->params;
 41+
 42+ // if the oversight email address is empty we're going to just skip all this, but return true
 43+ if ( null === $wgArticleFeedbackv5OversightEmails ) {
 44+ return true;
 45+ }
 46+
 47+ // if we don't have the right params set return false, job can't run
 48+ if ( !array_key_exists( 'user_name', $params)
 49+ || !array_key_exists( 'user_url', $params)
 50+ || !array_key_exists( 'page_name', $params)
 51+ || !array_key_exists( 'page_url', $params)
 52+ || !array_key_exists( 'permalink', $params)) {
 53+ return false;
 54+ }
 55+
 56+ // get our addresses
 57+ $to = new MailAddress( $wgArticleFeedbackv5OversightEmails, $wgArticleFeedbackv5OversightEmailName );
 58+ $from = new MailAddress( $wgPasswordSender, $wgPasswordSenderName );
 59+ $replyto = new MailAddress( $wgNoReplyAddress );
 60+
 61+ // get our text
 62+ list($subject, $body) = $this->composeMail($params['user_name'],
 63+ $params['user_url'],
 64+ $params['page_name'],
 65+ $params['page_url'],
 66+ $params['permalink']);
 67+
 68+ return UserMailer::send( $to, $from, $subject,
 69+ $body, $replyto );
 70+ }
 71+
 72+ /**
 73+ * Generate the "an oversight request has been made" email for sending
 74+ * to the mailing list
 75+ *
 76+ * @param string $requestor_name user name
 77+ * @param string $requestor_url link to user page
 78+ * @param string $page_name page title
 79+ * @param string $page_url page url
 80+ * @param string $feedback_permalink permalink url to feedback
 81+ */
 82+ protected function composeMail( $requestor_name, $requestor_url, $page_name, $page_url, $feedback_permalink ) {
 83+ global $wgPasswordSender, $wgPasswordSenderName, $wgNoReplyAddress, $wgRequest;
 84+
 85+ // build the subject
 86+ $subject = wfMessage( 'articlefeedbackv5-email-request-oversight-subject' )->params(
 87+ $requestor_name,
 88+ $page_name )->escaped();
 89+
 90+ //text version, no need to escape since client will interpret it as plain text
 91+ $body = wfMessage( 'articlefeedbackv5-email-request-oversight-body' )
 92+ ->rawParams(
 93+ $requestor_url,
 94+ $page_url,
 95+ $feedback_permalink)
 96+ ->params(
 97+ $requestor_name,
 98+ $page_name)
 99+ ->text();
 100+
 101+ return array($subject, $body);
 102+ }
 103+
104104 }
\ No newline at end of file
Property changes on: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5MailerJob.php
___________________________________________________________________
Added: svn:eol-style
105105 + native
Property changes on: trunk/extensions/Genderize/AGPL-3.0.txt
___________________________________________________________________
Added: svn:eol-style
106106 + native
Property changes on: trunk/extensions/Genderize/README
___________________________________________________________________
Added: svn:eol-style
107107 + native

Status & tagging log