Index: trunk/extensions/MetavidWiki/maintenance/metavid2mvWiki.inc.php |
— | — | @@ -209,6 +209,7 @@ |
210 | 210 | } |
211 | 211 | function do_annotate_speeches($stream, $force){ |
212 | 212 | print "do annotations for $stream->name \n"; |
| 213 | + $dbr =& wfGetDB(DB_SLAVE); |
213 | 214 | if($force){ |
214 | 215 | global $botUserName; |
215 | 216 | //get wiki stream id: |
— | — | @@ -280,15 +281,21 @@ |
281 | 282 | function do_proccess_text($stream, $force){ |
282 | 283 | $dbr = wfGetDB(DB_SLAVE); |
283 | 284 | if($force){ |
| 285 | + global $botUserName; |
284 | 286 | //get wiki stream id: |
285 | 287 | $wikiStream = new MV_Stream(array('name'=>$stream->name)); |
286 | 288 | //first remove all bot edited pages: |
287 | 289 | $mvd_res = MV_Index::getMVDInRange($wikiStream->getStreamId(),null,null,'Ht_en'); |
288 | 290 | while($row = $dbr->fetchObject($mvd_res)){ |
289 | 291 | $title = Title::newFromText($row->wiki_title, MV_NS_MVD); |
290 | | - $article = new Article($title); |
291 | | - $article->doDelete('mvbot removal'); |
292 | | - print "removed $row->wiki_title \n"; |
| 292 | + $current = Revision::newFromTitle( $title ); |
| 293 | + if($current->getUserText()==$botUserName){ |
| 294 | + $article = new Article($title); |
| 295 | + $article->doDelete('mvbot removal'); |
| 296 | + print "removed $row->wiki_title \n"; |
| 297 | + }else{ |
| 298 | + print "skiped $roe->wiki_title (last edit by: ". $current->getUserText().")\n"; |
| 299 | + } |
293 | 300 | } |
294 | 301 | } |
295 | 302 | /* for now use the stream search table (in the future should put in our orphaned person data) |
Index: trunk/extensions/MetavidWiki/maintenance/maintenance_util.inc.php |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | return ; |
133 | 133 | } |
134 | 134 | if($wgTitle->getNamespace()==MV_NS_MVD && MV_Index::getMVDbyTitle($wgTitle->getDBkey())==null){ |
135 | | - print "missing assoc mvd ...update \n"; |
| 135 | + //print "missing assoc mvd ...update \n"; |
136 | 136 | }else{ |
137 | 137 | if ($wgTitle->exists()) { |
138 | 138 | //if last edit!=mvBot skip (don't overwite peoples improvments') |
Index: trunk/extensions/MetavidWiki/includes/MV_EditStreamPage.php |
— | — | @@ -82,7 +82,10 @@ |
83 | 83 | return true; |
84 | 84 | } |
85 | 85 | function proccessReq(& $streamFiles){ |
86 | | - global $wgRequest; |
| 86 | + global $wgRequest, $wgUser; |
| 87 | + //make sure the user can edit streams: |
| 88 | + if(!$wgUser->isAllowed('mv_edit_stream'))return ; |
| 89 | + |
87 | 90 | $this->mv_action = $wgRequest->getVal('mv_action'); |
88 | 91 | if($this->mv_action=='new_stream_file'){ |
89 | 92 | //@@todo a bit more input scrubbing: |
Index: trunk/extensions/MetavidWiki/includes/MV_DefaultSettings.php |
— | — | @@ -150,7 +150,7 @@ |
151 | 151 | |
152 | 152 | $wgGroupPermissions['user']['mv_delete_mvd'] = true; |
153 | 153 | $wgGroupPermissions['sysop']['mv_edit_stream']=true; |
154 | | - |
| 154 | +$wgGroupPermissions['bot']['mv_edit_stream']=true; |
155 | 155 | ### |
156 | 156 | # If you already have custom namespaces on your site, insert |
157 | 157 | # $mvNamespaceIndex = ???; in your config before including the settings |