Remove isMaintainer() and isSuperMaintainer and instead use the user

classes is_maintainer() and is_super_maintainer.
This commit is contained in:
Chris Morgan
2004-12-19 19:30:27 +00:00
committed by WineHQ
parent ddbd9ed0cc
commit 77a038d4f9
10 changed files with 41 additions and 40 deletions

View File

@@ -64,7 +64,7 @@ function view_app_comment($ob)
echo "</td></tr>\n";
// delete message button, for admins
if(havepriv("admin") || isMaintainer($ob->appId, $ob->versionId))
if(havepriv("admin") || $_SESSION['current']->is_maintainer($ob->appId, $ob->versionId))
{
echo "<tr>";
echo "<td><form method=\"post\" name=\"message\" action=\"".$apidb_root."deletecomment.php\"><input type=submit value='Delete' class=button>\n";

View File

@@ -217,7 +217,7 @@ class User {
*/
function is_maintainer($appId, $versionId)
{
if(!loggedin() || !$this->userid)
if(!$this->userid)
return false;
/* if this user is a super maintainer of this appid then they */
@@ -240,7 +240,7 @@ class User {
*/
function is_super_maintainer($appId)
{
if(!loggedin() || !$this->userid)
if(!$this->userid)
return false;
$query = "SELECT * FROM appMaintainers WHERE userid = '$this->userid' AND appId = '$appId' AND superMaintainer = '1'";
@@ -304,25 +304,6 @@ function havepriv($priv)
return $_SESSION['current']->checkpriv($priv);
}
function isMaintainer($appId, $versionId)
{
if(!loggedin())
return false;
return $_SESSION['current']->is_maintainer($appId, $versionId);
}
function isSuperMaintainer($appId)
{
if(!loggedin())
return false;
return $_SESSION['current']->is_super_maintainer($appId);
}
function debugging()
{
return ((loggedin() && $_SESSION['current']->getpref("debug") == "yes") || APPDB_DEBUG == 1);