r78355 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78354‎ | r78355 | r78356 >
Date:06:14, 14 December 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Change to the per target autehtnication settings
Modified paths:
  • /trunk/extensions/Push/Push.php (modified) (history)
  • /trunk/extensions/Push/api/ApiPush.php (modified) (history)
  • /trunk/extensions/Push/api/ApiPushImages.php (modified) (history)
  • /trunk/extensions/Push/includes/Push_Functions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Push/Push.php
@@ -110,3 +110,4 @@
111111 }
112112
113113 require_once 'Push_Settings.php';
 114+
Index: trunk/extensions/Push/includes/Push_Functions.php
@@ -105,6 +105,35 @@
106106 }
107107
108108 return $pageSet;
109 - }
 109+ }
110110
 111+ /**
 112+ * Function to change the keys of $egPushLoginUsers and $egPushLoginPasswords
 113+ * from target url to target name using the $egPushTargets array.
 114+ *
 115+ * @since 0.5
 116+ *
 117+ * @param array $arr
 118+ * @param string $id Some string to indentify the array and keep track of it having been flipped.
 119+ */
 120+ public static function flipKeys( array &$arr, $id ) {
 121+ static $handledArrays = array();
 122+
 123+ if ( !in_array( $id, $handledArrays ) ) {
 124+ $handledArrays[] = $id;
 125+
 126+ global $egPushTargets;
 127+
 128+ $flipped = array();
 129+
 130+ foreach ( $arr as $key => $value ) {
 131+ if ( array_key_exists( $key, $egPushTargets ) ) {
 132+ $flipped[$egPushTargets[$key]] = $value;
 133+ }
 134+ }
 135+
 136+ $arr = $flipped;
 137+ }
 138+ }
 139+
111140 }
\ No newline at end of file
Index: trunk/extensions/Push/api/ApiPush.php
@@ -41,6 +41,9 @@
4242 $this->dieUsageMsg( array( 'missingparam', 'targets' ) );
4343 }
4444
 45+ PushFunctions::flipKeys( $egPushLoginUsers, 'users' );
 46+ PushFunctions::flipKeys( $egPushLoginPasswords, 'passwds' );
 47+
4548 foreach ( $params['targets'] as &$target ) {
4649 $user = false;
4750 $pass = false;
Index: trunk/extensions/Push/api/ApiPushImages.php
@@ -39,6 +39,9 @@
4040 $this->dieUsageMsg( array( 'missingparam', 'targets' ) );
4141 }
4242
 43+ PushFunctions::flipKeys( $egPushLoginUsers, 'users' );
 44+ PushFunctions::flipKeys( $egPushLoginPasswords, 'passwds' );
 45+
4346 foreach ( $params['targets'] as &$target ) {
4447 $user = false;
4548 $pass = false;

Follow-up revisions

RevisionCommit summaryAuthorDate
r78357Follow up to r78355jeroendedauw06:45, 14 December 2010

Status & tagging log