appdb/include user.php
WineHQ
wineowner at wine.codeweavers.com
Sat Apr 21 12:05:54 CDT 2007
ChangeSet ID: 31065
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner at winehq.org 2007/04/21 12:05:54
Modified files:
include : user.php
Log message:
Alexander Nicolaysen Sørnes <alex at 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)
More information about the wine-cvs
mailing list