r106369 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106368‎ | r106369 | r106370 >
Date:21:08, 15 December 2011
Author:reedy
Status:ok
Tags:
Comment:
Changes that were made so far...
Modified paths:
  • /trunk/tools/rotatebot/login.php (modified) (history)
  • /trunk/tools/rotatebot/rotbot.php (modified) (history)
  • /trunk/tools/rotatebot/settings.php (modified) (history)

Diff [purge]

Index: trunk/tools/rotatebot/rotbot.php
@@ -62,7 +62,7 @@
6363 $wrongfiles = array();
6464
6565 //Kategorie auf Bilder überprüfen
66 -$katname = "Images_requiring_rotation_by_bot";
 66+//$katname = "Images_requiring_rotation_by_bot";
6767 logfile("Prüfe 'Category:$katname' auf Bilder");
6868
6969 $queryurl = "http://commons.wikimedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:".$katname."&format=php&cmprop=ids|title|sortkey|timestamp&cmnamespace=6&cmsort=timestamp&cmtype=file&cmlimit=".$config['limit'];
@@ -201,20 +201,21 @@
202202 }
203203 else
204204 {
205 - logfile("API: Error: not a array!");
206 - logfile($totrevs);
 205+ logfile("API: Error: not a array!");
 206+ logfile($totrevs);
207207 }
 208+ }
208209 }
209 -}
210 -
 210+$wrongfile = false;
211211 //Benutzer prüfen! #########################################
212212 if($catcontent[$arraykey]['tmplsetter']) //autoconfirmed
213213 {
214214 $wgAuthor = $catcontent[$arraykey]['tmplsetter'];
215215 logfile("check user ".$wgAuthor.".");
216216
 217+ $cachedbar = array();
217218 //Datenbank abfragen nach status
218 - if(!$cachedbar["$wgAuthor"])
 219+ if(!isset($cachedbar["$wgAuthor"]))
219220 {
220221 $mysresult = mysql_query( "SELECT * FROM user WHERE user_name='".mysql_real_escape_string($wgAuthor)."'", $myslink) or suicide("MySQL error");
221222 $a_row = mysql_fetch_row($mysresult);
@@ -675,8 +676,8 @@
676677 }
677678 logfile("Upload finished. Do error pictures now.");
678679
 680+mkdir( $homedir . "cache" );
679681
680 -
681682 //Cache leeren
682683 foreach($catcontent2 as $filename => $arraycontent)
683684 {
Index: trunk/tools/rotatebot/settings.php
@@ -1,7 +1,7 @@
22 <?php
33
44 $homedir = "/home/luxo/rotbot/";
5 -$cookies = "/home/lux/cks";
 5+//$cookies = "/home/lux/cks";
66 $exiftool = "/home/luxor/rotbot/exiftool/exiftool";
77 $useragent = "Luxo (Toolserver; php) luxo@ts.wikimedia.org"; // ' User:Rotatebot by Luxo on the Toolserver / PHP'
88
@@ -13,3 +13,7 @@
1414
1515 $username = ""; // Bot username
1616 $password = ""; // Bot password
 17+
 18+$katname = "";
 19+$cookies = array();
 20+
Index: trunk/tools/rotatebot/login.php
@@ -138,7 +138,8 @@
139139 }
140140 logfile("Seite geladen, Anmeldung prüfen.");
141141
142 - if(strstr($bodyy,'"wgUserName": "' . $username . '",'))
 142+ $noUnderscore = str_replace( '_', ' ', $username );
 143+ if(strstr($bodyy,'"wgUserName": "' . $noUnderscore . '",'))
143144 {
144145 logfile("Anmeldung erfolgreich!");
145146

Status & tagging log