Module: appdb Branch: master Commit: 3c860528dda88b6656e11e9c2451086fd2cf1835 URL: http://source.winehq.org/git/appdb.git/?a=commit;h=3c860528dda88b6656e11e9c2...
Author: Alexander Nicolaysen Sørnes <alexander@linux-xqqm.(none)> Date: Thu Nov 12 19:24:17 2009 +0100
note: Don't allow version maintainers to create app-wide notes
---
include/note.php | 37 ++++++++++++++++++++++--------------- 1 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/include/note.php b/include/note.php index 92891b5..4cc9805 100644 --- a/include/note.php +++ b/include/note.php @@ -568,25 +568,32 @@ class Note { $aIds = $this->getDisplayModeIds(); $aOptions = $this->getDisplayModeNames();
- echo '<tr><td class="color1">Display mode</td>'."\n"; - echo '<td class="color0">'.html_radiobuttons($aIds, $aOptions, 'iVersionId', $this->iVersionId); + /* Version maintainers are not allowed to show a note app-wide */ + if($oApp->canEdit()) + { + echo '<tr><td class="color1">Display mode</td>'."\n"; + echo '<td class="color0">'.html_radiobuttons($aIds, $aOptions, 'iVersionId', $this->iVersionId);
- /* Allow the note to be shown for certain versions only */ - $aIds = array(); - $aOptions = array(); - $aSelected = array(); + /* Allow the note to be shown for certain versions only */ + $aIds = array(); + $aOptions = array(); + $aSelected = array();
- foreach($oApp->getVersions(true) as $oAppVersion) // Only accepted versions - { - - $aIds[] = $oAppVersion->objectGetId(); - $aOptions[] = $oAppVersion->objectMakeLink(); + foreach($oApp->getVersions(true) as $oAppVersion) // Only accepted versions + { + + $aIds[] = $oAppVersion->objectGetId(); + $aOptions[] = $oAppVersion->objectMakeLink();
- $aSelected[] = $this->isLinkedWith($oAppVersion->objectGetId(), false); - } - echo html_checkboxes('iVersionId', $aIds, $aOptions, $aSelected); + $aSelected[] = $this->isLinkedWith($oAppVersion->objectGetId(), false); + } + echo html_checkboxes('iVersionId', $aIds, $aOptions, $aSelected);
- echo '</td></tr>'; + echo '</td></tr>'; + } else + { + echo "<input type="hidden" name="iVersionId" value="{$oVersion->iVersionId}" />"; + } } else if(!$this->iAppId) { echo '<input type="hidden" name="iVersionId" value="'.$this->iVersionId.'">';