svn: /web/doc-editor/trunk/php/ ExtJsController.php
[email protected] (Yannick Torres)
| Newsgroups | php.doc.web |
|---|---|
| Message-ID | <[email protected]> |
yannick Mon, 17 Jan 2011 21:21:17 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=307545
Log:
Allow valid VCS user to change the owner of an anonymous patch
Changed paths:
U web/doc-editor/trunk/php/ExtJsController.php
Modified: web/doc-editor/trunk/php/ExtJsController.php
===================================================================
--- web/doc-editor/trunk/php/ExtJsController.php 2011-01-17 20:52:27 UTC (rev 307544)
+++ web/doc-editor/trunk/php/ExtJsController.php 2011-01-17 21:21:17 UTC (rev 307545)
@@ -1154,14 +1154,19 @@
public function setFileOwner()
{
$am = AccountManager::getInstance();
+ $rf = RepositoryFetcher::getInstance();
$am->isLogged();
$fileIdDB = $this->getRequestVariable('fileIdDB');
$newOwner = $this->getRequestVariable('newOwner');
+ $fileInfo = $rf->getModifiesById($fileIdDB);
+
// This user must be a global admin or the admin for this lang
- if( $am->isAdmin(true) )
+ // Or if the owner of this file is an anonymous and the current user is a valid user
+
+ if( $am->isAdmin(true) || ( !$am->isAnonymous && $am->anonymous($fileInfo[0]['user']) ))
{
$am->setFileOwner($fileIdDB, $newOwner);