r187 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r186‎ | r187 | r188 >
Date:19:09, 22 February 2002
Author:magnus_manske
Status:old
Tags:
Comment:
restricted upload to logged-in users
Modified paths:
  • /trunk/phpwiki/fpw/special_upload.php (modified) (history)
  • /trunk/phpwiki/fpw/wikiTextEn.php (modified) (history)

Diff [purge]

Index: trunk/phpwiki/fpw/special_upload.php
@@ -6,7 +6,7 @@
77 global $removeFile , $xtitle , $removeFile , $Upload , $Upload_name , $no_copyright ;
88 global $user , $vpage , $wikiUploadTitle , $wikiUploadText , $wikiUploadDenied ;
99 global $wikiUploadDeleted , $wikiUploadDelMsg1 , $wikiUploadDelMsg2 ;
10 - global $wikiUploadAffirm , $wikiUploadFull ;
 10+ global $wikiUploadAffirm , $wikiUploadFull , $wikiUploadRestrictions ;
1111 global $wikiUploadSuccess , $wikiUploadSuccess1 , $wikiUploadSuccess2 ;
1212 global $wikiUploadAffirmText , $wikiUploadButton , $wikiUser ;
1313 $vpage->special ( $wikiUploadTitle ) ;
@@ -29,6 +29,7 @@
3030 unset ( $removeFile ) ;
3131 } else if (isset($Upload_name) or isset($Upload)) {
3232 if ( $no_copyright != "AFFIRMED" ) return $wikiUploadAffirm ;
 33+ if ( $user->id == 0 ) return $wikiUploadRestrictions ;
3334 # $Upload_name = ereg_replace(" ", "_", $Upload_name);
3435 $abc = split("\.", $Upload_name);
3536
Index: trunk/phpwiki/fpw/wikiTextEn.php
@@ -303,6 +303,7 @@
304304 $wikiUploadDelMsg1 = "*On $now, [[user:$1|$1]] deleted file '''$2'''\n" ;
305305 $wikiUploadDelMsg2 = "Deletion of file $1" ;
306306 $wikiUploadAffirm = "<nowiki>You need to affirm that the file is not violating copygights. Return to the <a href=\"$THESCRIPT?title=special:upload\">Upload page</a></nowiki>" ;
 307+$wikiUploadRestrictions = "<nowiki>You have to log in to upload a file!</nowiki>" ;
307308 $wikiUploadFull = "Sorry, we are almost out of disk space. We can't let you upload any files right now." ;
308309 $wikiUploadSuccess = "File <b>$1</b> was successfully uploaded!" ;
309310 $wikiUploadSuccess1 = "*On $1, $2 uploaded file '''$3'''\n" ;

Status & tagging log