Module: appdb Branch: master Commit: 236a6bc3bd9395d9b728f57b03a5421032c55a21 URL: http://source.winehq.org/git/appdb.git/?a=commit;h=236a6bc3bd9395d9b728f57b0...
Author: Alexander Nicolaysen Sørnes <alexander@linux-xqqm.(none)> Date: Wed Nov 11 22:17:48 2009 +0100
maintainerdelete.php: use delete() when deleting super maintianers
---
include/maintainer.php | 11 +++++++++++ maintainerdelete.php | 3 ++- 2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/include/maintainer.php b/include/maintainer.php index c2c73dc..3a39729 100644 --- a/include/maintainer.php +++ b/include/maintainer.php @@ -351,6 +351,17 @@ class maintainer return TRUE; }
+ public function findAppMaintainer($iUserId, $iAppId) + { + $hResult = query_parameters("SELECT * FROM appMaintainers WHERE userId = '?' AND appId = '?' AND superMaintainer = '1'", $iUserId, $iAppId); + + if(!$hResult) + return null; + + $oRow = mysql_fetch_object($hResult); + return new maintainer(null, $oRow); + } + function deleteMaintainer($oUser, $iAppId = null, $iVersionId = null) { /* remove supermaintainer */ diff --git a/maintainerdelete.php b/maintainerdelete.php index 5f5d4f1..9ca069c 100644 --- a/maintainerdelete.php +++ b/maintainerdelete.php @@ -33,7 +33,8 @@ if($aClean['iConfirmed']) if($aClean['iSuperMaintainer']) { apidb_header("You have resigned as super maintainer of ".$oApp->sName); - $result = Maintainer::deleteMaintainer($_SESSION['current'], $aClean['iAppId'], null); + $oMaintainer = maintainer::findAppMaintainer($_SESSION['current']->iUserId, $aClean['iAppId']); + $result = $oMaintainer->delete(); } else { $oVersion = new Version($aClean['iVersionId']);