From: Brion Vibber Date: Mon, 5 Sep 2005 06:16:48 +0000 (+0000) Subject: * Add 'reupload' and 'reupload-shared' permission keys to restrict new X-Git-Tag: 1.6.0~1723 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=22f612045970b00f0574ad43b1345727ee358289;p=lhc%2Fweb%2Fwiklou.git * Add 'reupload' and 'reupload-shared' permission keys to restrict new uploads overwriting existing files; default is the old behavior (allowed). --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c58356548f..49441727d1 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -82,6 +82,8 @@ fully support the editing toolbar, but was found to be too confusing. * (bug 3306) Document $wgLocalTZoffset * (bug 3304) Language file for Croatian (LanguageHr.php) * (bug 2143) Update Vietnamese interface +* Add 'reupload' and 'reupload-shared' permission keys to restrict new uploads + overwriting existing files; default is the old behavior (allowed). === Caveats === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 273146a69a..0fbc7ee943 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -710,6 +710,8 @@ $wgGroupPermissions['user' ]['move'] = true; $wgGroupPermissions['user' ]['read'] = true; $wgGroupPermissions['user' ]['edit'] = true; $wgGroupPermissions['user' ]['upload'] = true; +$wgGroupPermissions['user' ]['reupload'] = true; +$wgGroupPermissions['user' ]['reupload-shared'] = true; $wgGroupPermissions['bot' ]['bot'] = true; @@ -724,6 +726,8 @@ $wgGroupPermissions['sysop']['patrol'] = true; $wgGroupPermissions['sysop']['protect'] = true; $wgGroupPermissions['sysop']['rollback'] = true; $wgGroupPermissions['sysop']['upload'] = true; +$wgGroupPermissions['sysop']['reupload'] = true; +$wgGroupPermissions['sysop']['reupload-shared'] = true; $wgGroupPermissions['bureaucrat']['userrights'] = true; // Used by the Special:Renameuser extension diff --git a/includes/Image.php b/includes/Image.php index 8076a71f37..674ce74f12 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -1484,6 +1484,16 @@ class Image $fname ); } + + /** + * Returns true if the image does not come from the shared + * image repository. + * + * @return bool + */ + function isLocal() { + return !$this->fromSharedDirectory; + } } //class diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 4c6cf28c8e..33c3c9cf96 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -286,9 +286,11 @@ END return; $sk = $wgUser->getSkin(); - $wgOut->addHTML( '