Use $_SESSION[] instead of global $current

This commit is contained in:
Chris Morgan
2004-12-11 21:05:42 +00:00
committed by WineHQ
parent b070dfd1aa
commit 0d23899b68

View File

@@ -244,11 +244,16 @@ class User {
*/ */
function is_super_maintainer($appId) function is_super_maintainer($appId)
{ {
global $current;
if(!loggedin() || !$this->userid) if(!loggedin() || !$this->userid)
{
echo "not logged in or not this userid";
return false; return false;
}else {
echo "running the query";
}
$query = "SELECT * FROM appMaintainers WHERE userid = '$this->userid' AND appId = '$appId' AND superMaintainer = 1"; $query = "SELECT * FROM appMaintainers WHERE userid = '$this->userid' AND appId = '$appId' AND superMaintainer = '1'";
echo "$query";
$result = mysql_query($query, $this->link); $result = mysql_query($query, $this->link);
if(!$result) if(!$result)
return 0; return 0;
@@ -304,53 +309,43 @@ function loggedin()
function havepriv($priv) function havepriv($priv)
{ {
global $current;
if(!loggedin()) if(!loggedin())
return false; return false;
return $current->checkpriv($priv); return $_SESSION['current']->checkpriv($priv);
} }
function isMaintainer($appId, $versionId) function isMaintainer($appId, $versionId)
{ {
global $current;
if(!loggedin()) if(!loggedin())
return false; return false;
return $current->is_maintainer($appId, $versionId); return $_SESSION['current']->is_maintainer($appId, $versionId);
} }
function isSuperMaintainer($appId) function isSuperMaintainer($appId)
{ {
global $current;
if(!loggedin()) if(!loggedin())
return false; return false;
return $current->is_super_maintainer($appId); return $_SESSION['current']->is_super_maintainer($appId);
} }
function debugging() function debugging()
{ {
global $current;
if(!loggedin()) if(!loggedin())
return false; return false;
return $current->getpref("debug") == "yes"; return $_SESSION['current']->getpref("debug") == "yes";
} }
function makeurl($text, $url, $pref = null) function makeurl($text, $url, $pref = null)
{ {
global $current;
if(loggedin()) if(loggedin())
{ {
if($current->getpref($pref) == "yes") if($_SESSION['current']->getpref($pref) == "yes")
$extra = "window='new'"; $extra = "window='new'";
} }
return "<a href='$url' $extra> $text </a>\n"; return "<a href='$url' $extra> $text </a>\n";
} }