ChangeSet ID: 31065
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/04/21 12:05:54
Modified files:
include : user.php
Log message:
Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com>
Remove unused appData functions from the user class
Patch: http://cvs.winehq.org/patch.py?id=31065
Old revision New revision Changes Path
1.87 1.88 +0 -81 appdb/include/user.php
Index: appdb/include/user.php
diff -u -p appdb/include/user.php:1.87 appdb/include/user.php:1.88
--- appdb/include/user.php:1.87 21 Apr 2007 17: 5:54 -0000
+++ appdb/include/user.php 21 Apr 2007 17: 5:54 -0000
@@ -316,62 +316,6 @@ class User {
return ($this->isLoggedIn() && $this->getPref("send_email","yes")=="yes");
}
- /**
- * Return an app query based on the user permissions and an iAppDataId
- * Used to display appropriate appdata entries based upon admin vs. maintainer
- * as well as to determine if the maintainer has permission to delete an appdata entry
- */
- function getAppDataQuery($iAppDataId, $queryQueuedCount, $queryQueued)
- {
- /* escape all of the input variables */
- /* code is too complex to easily use query_parameters() */
- $iAppDataId = mysql_real_escape_string($iAppDataId);
- $queryQueuedCount = mysql_real_escape_string($queryQueuedCount);
- $queryQueued = mysql_real_escape_string($queryQueued);
-
- /* either look for queued app data entries */
- /* or ones that match the given id */
- if($queryQueuedCount)
- {
- $selectTerms = "count(*) as queued_appdata";
- $additionalTerms = "AND appData.queued='true'";
- } else if($queryQueued)
- {
- $selectTerms = "appData.*, appVersion.appId AS appId";
- $additionalTerms = "AND appData.queued='true'";
- } else
- {
- $selectTerms = "appData.*, appVersion.appId AS appId";
- $additionalTerms = "AND id='".$iAppDataId."'";
- }
-
- if($this->hasPriv("admin"))
- {
- $sQuery = "SELECT ".$selectTerms."
- FROM appData,appVersion
- WHERE appVersion.versionId = appData.versionId
- ".$additionalTerms.";";
- } else
- {
- /* select versions where we supermaintain the application or where */
- /* we maintain the appliation, and where the versions we supermaintain */
- /* or maintain are in the appData list */
- /* then apply some additional terms */
- $sQuery = "select ".$selectTerms." from appMaintainers, appVersion, appData where
- (
- ((appMaintainers.appId = appVersion.appId) AND
- (appMaintainers.superMaintainer = '1'))
- OR
- ((appMaintainers.versionId = appVersion.versionId)
- AND (appMaintainers.superMaintainer = '0'))
- )
- AND appData.versionId = appVersion.versionId
- AND appMaintainers.userId = '".mysql_real_escape_string($this->iUserId)."'
- ".$additionalTerms.";";
- }
-
- return query_appdb($sQuery);
- }
/**
* Delete appData
@@ -684,31 +628,6 @@ class User {
return false;
}
- function canDeleteAppDataId($iAppDataId)
- {
- /* admins can delete anything */
- if($this->hasPriv("admin"))
- return true;
-
- $isMaintainer = false;
-
- /* if we aren't an admin we should see if we can find any results */
- /* for a query based on this appDataId, if we can then */
- /* we have permission to delete the entry */
- $hResult = $this->getAppDataQuery($iAppDataId, false, false);
- if(!$hResult)
- return false;
-
- if(mysql_num_rows($hResult) > 0)
- $isMaintainer = true;
-
- /* if this user maintains the app data, they can delete it */
- if($isMaintainer)
- return true;
-
- return false;
- }
-
/***************************/
/* application permissions */
function canViewApplication($oApp)
ChangeSet ID: 31064
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/04/21 11:54:17
Modified files:
include : menu.php
Log message:
Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com>
Include <a> links for menu items. This is necessary for browsers without JavaScript and it
makes it possible to see the url the link is pointing to
Patch: http://cvs.winehq.org/patch.py?id=31064
Old revision New revision Changes Path
1.7 1.8 +7 -5 appdb/include/menu.php
Index: appdb/include/menu.php
diff -u -p appdb/include/menu.php:1.7 appdb/include/menu.php:1.8
--- appdb/include/menu.php:1.7 21 Apr 2007 16:54:17 -0000
+++ appdb/include/menu.php 21 Apr 2007 16:54:17 -0000
@@ -33,7 +33,7 @@ class htmlmenu {
<tr class="topMenu"><td>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
';
-
+
}
/* add a table row */
@@ -41,14 +41,16 @@ class htmlmenu {
{
if($shUrl)
{
- // we have a valid url, make the entire table row clickable and provide some highlighting
- // for visual feedback
+ // we have a valid url, make the entire table row clickable and provide
+ // some highlighting for visual feedback
html_tr_highlight_clickable($shUrl, "sideMenu", "#e0e6ff", "#ffffff");
- echo "<td width='100%' align=$sAlign><span class=MenuItem> <u>$sName</u></span></td>";
+ echo "<td width='100%' align=$sAlign><span class=MenuItem> <u>".
+ "<a href=\"$shUrl\">$sName</a></u></span></td>";
echo "</tr>\n";
} else
{
- echo " <tr class=sideMenu><td width='100%' align=$sAlign><span class=menuItem> $sName</span></td></tr>\n";
+ echo " <tr class=sideMenu><td width='100%' align=$sAlign><span ".
+ "class=menuItem> $sName</span></td></tr>\n";
}
}