diff --git a/TODO b/TODO
index 5590c41..7cc171c 100644
--- a/TODO
+++ b/TODO
@@ -26,5 +26,3 @@ an email should be sent to everyone in that thread.
##################
# add distro table and administration screens for it. (Chris)
-
-# improve user class and functions (object oriented, etc) (Jonathan).
diff --git a/account.php b/account.php
index e51cd89..412f790 100644
--- a/account.php
+++ b/account.php
@@ -101,23 +101,16 @@ function cmd_do_new()
$user = new User();
- if($user->exists($_POST['ext_email']))
- {
- $_POST['ext_email'] = "";
- retry("new", "An account with this e-mail is already in use");
- return;
- }
-
$result = $user->create($_POST['ext_email'], $_POST['ext_password'], $_POST['ext_realname'], $_POST['CVSrelease'] );
- if($result == null)
+ if($result == true)
{
$user->login($_POST['ext_email'], $_POST['ext_password']);
addmsg("Account created! (".$_POST['ext_email'].")", "green");
redirect(apidb_fullurl());
}
else
- retry("new", "Failed to create account: $result");
+ retry("new", "Failed to create account");
}
@@ -173,14 +166,14 @@ function cmd_do_login()
$user = new User();
$result = $user->login($_POST['ext_email'], $_POST['ext_password']);
- if($result == null)
+ if($result == true)
{
$_SESSION['current'] = $user;
- addmsg("You are successfully logged in as '$user->realname'.", "green");
+ addmsg("You are successfully logged in as '$user->sRealname'.", "green");
redirect(apidb_fullurl("index.php"));
} else
{
- retry("login","Login failed ($result)");
+ retry("login","Login failed");
$_SESSION['current'] = "";
}
}
diff --git a/addcomment.php b/addcomment.php
index 5cc5541..9ba1b53 100644
--- a/addcomment.php
+++ b/addcomment.php
@@ -12,7 +12,7 @@ require(BASE."include/application.php");
require(BASE."include/mail.php");
// you must be logged in to submit comments
-if(!loggedin())
+if(!$_SESSION['current']->isLoggedIn())
{
apidb_header("Please login");
echo "To submit a comment for an application you must be logged in. Please login now or create a new account .","\n";
@@ -59,13 +59,14 @@ if(isset($_REQUEST['body']))
{
if (is_numeric($_REQUEST['originator']))
{
- if (UserWantsEmail($_REQUEST['originator']))
+ $oOriginator = new User($_REQUEST['originator']);
+ if ($oOriginator->getPref("send_email"))
{
- $sEmail = lookupEmail($_REQUEST['originator']);
+ $sEmail = $oOriginator->sEmail;
$sFullAppName = "Application: ".lookupAppName($_REQUEST['appId'])." Version: ".lookupVersionName($_REQUEST['appId'], $_REQUEST['versionId']);
$sMsg = APPDB_ROOT."appview.php?appId=".$_REQUEST['appId']."&versionId=".$_REQUEST['versionId'].".\n";
$sMsg .= "\r\n";
- $sMsg .= ($_SESSION['current']->realname ? $_SESSION['current']->realname : "Anonymous")." added comment to ".$sFullAppName."\r\n";
+ $sMsg .= $_SESSION['current']->realname." added comment to ".$sFullAppName."\r\n";
$sMsg .= "\r\n";
$sMsg .= "Subject: ".$subject."\r\n";
$sMsg .= "\r\n";
@@ -76,7 +77,7 @@ if(isset($_REQUEST['body']))
addmsg("Comment message sent to original poster", "green");
}
}
- $sEmail = getNotifyEmailAddressList($_REQUEST['appId'], $_REQUEST['versionId']);
+ $sEmail = get_notify_email_address_list($_REQUEST['appId'], $_REQUEST['versionId']);
if($sEmail)
{
$sFullAppName = "Application: ".lookupAppName($_REQUEST['appId'])." Version: ".lookupVersionName($_REQUEST['appId'], $_REQUEST['versionId']);
diff --git a/admin/addAppNote.php b/admin/addAppNote.php
index 80def82..6492c85 100644
--- a/admin/addAppNote.php
+++ b/admin/addAppNote.php
@@ -9,7 +9,7 @@ require(BASE."include/application.php");
require(BASE."include/mail.php");
//check for admin privs
-if(!loggedin() || (!havepriv("admin") && !$_SESSION['current']->is_maintainer($_REQUEST['appId'],$_REQUEST['versionId'])) )
+if(!$_SESSION['current']->isLoggedIn() || (!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer($_REQUEST['appId'],$_REQUEST['versionId'])) )
{
errorpage("Insufficient Privileges!");
exit;
@@ -40,7 +40,7 @@ if($_REQUEST['sub'] == "Submit")
if (query_appdb("INSERT INTO `appNotes` ({$aInsert['FIELDS']}) VALUES ({$aInsert['VALUES']})"))
{
// successful
- $sEmail = getNotifyEmailAddressList($_REQUEST['appId'], $_REQUEST['versionId']);
+ $sEmail = get_notify_email_address_list($_REQUEST['appId'], $_REQUEST['versionId']);
if($sEmail)
{
$sFullAppName = "Application: ".lookupAppName($_REQUEST['appId']);
diff --git a/admin/addCategory.php b/admin/addCategory.php
index 6cc2adc..bbb9bcc 100644
--- a/admin/addCategory.php
+++ b/admin/addCategory.php
@@ -4,7 +4,7 @@ include("path.php");
include(BASE."include/"."incl.php");
include(BASE."include/"."tableve.php");
-if(!havepriv("admin"))
+if(!$_SESSION['current']->hasPriv("admin"))
{
errorpage();
exit;
diff --git a/admin/addVendor.php b/admin/addVendor.php
index 27573f6..5ff43a1 100644
--- a/admin/addVendor.php
+++ b/admin/addVendor.php
@@ -4,7 +4,7 @@ include("path.php");
include(BASE."include/"."incl.php");
include(BASE."include/"."tableve.php");
-if(!havepriv("admin"))
+if(!$_SESSION['current']->hasPriv("admin"))
{
errorpage();
exit;
diff --git a/admin/adminAppDataQueue.php b/admin/adminAppDataQueue.php
index 95d264b..fcd2f9b 100644
--- a/admin/adminAppDataQueue.php
+++ b/admin/adminAppDataQueue.php
@@ -13,7 +13,7 @@ require(BASE."include/mail.php");
apidb_header("Admin Application Data Queue");
// deny access if not admin
-if(!havepriv("admin"))
+if(!$_SESSION['current']->hasPriv("admin"))
{
errorpage("Insufficient privileges.");
exit;
@@ -59,16 +59,19 @@ if (!$_REQUEST['queueId'])
$c = 1;
while($ob = mysql_fetch_object($hResult))
{
- if($_SESSION['current']->is_maintainer($ob->queueappId,
+ if($_SESSION['current']->isMaintainer($ob->queueappId,
$ob->queueversionId)
- || havepriv("admin"))
+ || $_SESSION['current']->hasPriv("admin"))
{
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
echo "
\n";
echo " ".date("Y-n-t h:i:sa", $ob->submitTime)." \n";
echo " ".$ob->queueId." \n";
if($ob->userId)
- echo " ".lookupRealname($ob->userId)." (".lookupEmail($ob->userId).") \n";
+ {
+ $oUser = new User($ob->userId);
+ echo " ".$oUser->sRealname." (".$oUser->sEmail.") \n";
+ }
else
echo " Anonymous \n";
echo "".appIdToName($ob->appId)." \n";
@@ -84,8 +87,8 @@ if (!$_REQUEST['queueId'])
} else // shows a particular appdata
{
- if(!(havepriv("admin") ||
- $_SESSION['current']->is_maintainer($obj_row->queueAppId,
+ if(!($_SESSION['current']->hasPriv("admin") ||
+ $_SESSION['current']->isMaintainer($obj_row->queueAppId,
$obj_row->queueVersionId)))
{
errorpage("You don't have sufficient privileges to use this page.");
@@ -133,7 +136,7 @@ if (!$_REQUEST['queueId'])
$randName = generate_passwd(5);
// set image link based on user pref
$img = ''.$imgSRC.' ';
- if (loggedin())
+ if ($_SESSION['current']->isLoggedIn())
{
if ($_SESSION['current']->getpref("window:screenshot") == "no")
{
@@ -200,14 +203,15 @@ if (!$_REQUEST['queueId'])
query_appdb("DELETE from appDataQueue where queueId = ".$obj_row->queueId.";");
//Send Status Email
- if (lookupEmail($obj_row->userId))
+ $oUser = new User($obj_row->userId);
+ if ($oUser->sEmail)
{
$sSubject = "Application Data Request Report";
$sMsg = "Your submission of an application data for ".appIdToName($obj_row->appId).versionIdToName($obj_row->versionId)." has been accepted. ";
$sMsg .= $_REQUEST['replyText'];
$sMsg .= "We appreciate your help in making the Application Database better for all users.\r\n";
- mail_appdb(lookupEmail($obj_row->userId), $sSubject ,$sMsg);
+ mail_appdb($oUser->sEmail, $sSubject ,$sMsg);
}
//done
@@ -216,13 +220,14 @@ if (!$_REQUEST['queueId'])
}
} elseif ($_REQUEST['reject'])
{
- if (lookupEmail($obj_row->userId))
+ $oUser = new User($obj_row->userId);
+ if ($oUser->sEmail)
{
$sSubject = "Application Data Request Report";
$sMsg = "Your submission of an application data for ".appIdToName($obj_row->appId).versionIdToName($obj_row->versionId)." was rejected. ";
$sMsg .= $_REQUEST['replyText'];
- mail_appdb(lookupEmail($obj_row->userId), $sSubject ,$sMsg);
+ mail_appdb($oUser->sEmail, $sSubject ,$sMsg);
}
//delete main item
diff --git a/admin/adminAppQueue.php b/admin/adminAppQueue.php
index eabf14e..7a25df7 100644
--- a/admin/adminAppQueue.php
+++ b/admin/adminAppQueue.php
@@ -10,7 +10,7 @@ require(BASE."include/application.php");
require(BASE."include/mail.php");
//deny access if not logged in
-if(!havepriv("admin"))
+if(!$_SESSION['current']->hasPriv("admin"))
{
errorpage("Insufficient privileges.");
exit;
@@ -318,7 +318,7 @@ if ($_REQUEST['sub'])
}
if ($goodtogo)
{
- $sEmail = getNotifyEmailAddressList($_REQUEST['appParent'], $_REQUEST['appVersion']);
+ $sEmail = get_notify_email_address_list($_REQUEST['appParent'], $_REQUEST['appVersion']);
if($sEmail)
{
$sFullAppName = "Application: ".lookupAppName($_REQUEST['appParent']).
diff --git a/admin/adminMaintainerQueue.php b/admin/adminMaintainerQueue.php
index 8dd7f10..3ab3629 100644
--- a/admin/adminMaintainerQueue.php
+++ b/admin/adminMaintainerQueue.php
@@ -10,7 +10,7 @@ require(BASE."include/category.php");
require(BASE."include/maintainer.php");
require(BASE."include/mail.php");
-if(!havepriv("admin"))
+if(!$_SESSION['current']->hasPriv("admin"))
{
errorpage("Insufficient privileges.");
exit;
@@ -27,6 +27,7 @@ if ($_REQUEST['sub'])
"FROM appMaintainerQueue WHERE queueId = ".$_REQUEST['queueId'].";";
$result = query_appdb($query);
$ob = mysql_fetch_object($result);
+ $oUser = new User($ob->userId);
mysql_free_result($result);
}
else
@@ -66,13 +67,14 @@ if ($_REQUEST['sub'])
$foundMaintainers = true;
while(list($index, list($userIdValue)) = each($other_users))
{
+ $oUser = new User($userIdValue);
if($firstDisplay)
{
- echo "".lookupRealname($userIdValue)." \n";
+ echo "".$oUser->sRealname." \n";
$firstDisplay = false;
} else
{
- echo "".lookupRealname($userIdValue)." \n";
+ echo "".$oUser->sRealname." \n";
}
}
}
@@ -83,13 +85,14 @@ if ($_REQUEST['sub'])
$foundMaintainers = true;
while(list($index, list($userIdValue)) = each($other_users))
{
+ $oUser = new User($userIdValue);
if($firstDisplay)
{
- echo "".lookupRealname($userIdValue)."* \n";
+ echo "".$oUser->sRealname."* \n";
$firstDisplay = false;
} else
{
- echo "".lookupRealname($userIdValue)."* \n";
+ echo "".$oUser->sRealname."* \n";
}
}
}
@@ -100,7 +103,7 @@ if ($_REQUEST['sub'])
}
// Show which other apps the user maintains
- echo 'This user also maintains these apps: ',"\n";
+ echo 'This user also maintains these apps: ',"\n";
$firstDisplay = true;
$other_apps = getAppsFromUserId($ob->userId);
@@ -144,9 +147,6 @@ if ($_REQUEST['sub'])
echo 'Email reply ',"\n";
echo " \n";
- //echo 'Email ,"\n";
- //echo ' ',"\n";
-
/* Add button */
echo '' ,"\n";
echo ' ',"\n";
@@ -184,7 +184,7 @@ if ($_REQUEST['sub'])
query_appdb("DELETE from appMaintainerQueue where queueId = ".$_REQUEST['queueId'].";");
//Send Status Email
- $sEmail = lookupEmail($ob->userId);
+ $sEmail = $oUser->sEmail;
if ($sEmail)
{
$sSubject = "Application Maintainer Request Report";
@@ -201,7 +201,7 @@ if ($_REQUEST['sub'])
}
else if (($_REQUEST['reject'] || ($_REQUEST['sub'] == 'reject')) && $_REQUEST['queueId'])
{
- $sEmail = lookupEmail($ob->userId);
+ $sEmail = $oUser->sEmail;
if ($sEmail)
{
$sSubject = "Application Maintainer Request Report";
@@ -278,11 +278,12 @@ if ($_REQUEST['sub'])
$c = 1;
while($ob = mysql_fetch_object($result))
{
+ $oUser = new User($ob->userId);
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
echo "\n";
echo " ".date("Y-n-t h:i:sa", $ob->submitTime)." \n";
echo " $ob->queueId \n";
- echo " ".lookupRealname($ob->userId)." \n";
+ echo " ".$oUser->sRealName." \n";
echo " ".appIdToName($ob->appId)." \n";
if($ob->superMaintainer)
@@ -291,11 +292,11 @@ if ($_REQUEST['sub'])
echo "Yes \n";
} else
{
- echo "".versionIdToName($ob->versionId)." \n";
+ echo "".versionIdToName($ob->versionId)." \n";
echo "No \n";
}
- echo " ".lookupEmail($ob->userId)." \n";
+ echo " ".$oUser->sEmail." \n";
echo " [reject ] \n";
echo " \n\n";
$c++;
@@ -308,7 +309,4 @@ if ($_REQUEST['sub'])
}
}
-
-
-
?>
diff --git a/admin/adminMaintainers.php b/admin/adminMaintainers.php
index 4506ea9..60a13d1 100644
--- a/admin/adminMaintainers.php
+++ b/admin/adminMaintainers.php
@@ -10,7 +10,7 @@ include("path.php");
require(BASE."include/incl.php");
// deny access if not logged in
-if(!havepriv("admin"))
+if(!$_SESSION['current']->hasPriv("admin"))
{
errorpage("Insufficient privileges.");
exit;
@@ -68,10 +68,11 @@ if ($_REQUEST['sub'])
$c = 1;
while($ob = mysql_fetch_object($hResult))
{
+ $oUser = new User($ob->userId);
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
echo "\n";
echo " ".date("Y-n-t h:i:sa", $ob->submitTime)." \n";
- echo " ".lookupRealname($ob->userId)." \n";
+ echo " ".$oUser->sRealname." \n";
if($ob->superMaintainer)
{
@@ -84,8 +85,7 @@ if ($_REQUEST['sub'])
echo " ".versionIdToName($ob->versionId)." \n";
echo " No \n";
}
-
- echo " ".lookupEmail($ob->userId)." \n";
+ echo " ".$oUser->sEmail." \n";
echo " [delete ] \n";
echo " \n\n";
$c++;
diff --git a/admin/adminScreenshots.php b/admin/adminScreenshots.php
index fadde19..f7d7ee8 100644
--- a/admin/adminScreenshots.php
+++ b/admin/adminScreenshots.php
@@ -11,7 +11,7 @@ require(BASE."include/"."screenshot.php");
apidb_header("Screenshots");
// deny access if not admin
-if(!havepriv("admin"))
+if(!$_SESSION['current']->hasPriv("admin"))
{
errorpage("Insufficient privileges.");
exit;
diff --git a/admin/adminUsers.php b/admin/adminUsers.php
index 70e424c..1b94634 100644
--- a/admin/adminUsers.php
+++ b/admin/adminUsers.php
@@ -8,7 +8,7 @@ include(BASE."include/"."incl.php");
apidb_header("Admin Users Management");
-if(!havepriv("admin"))
+if(!$_SESSION['current']->hasPriv("admin"))
{
errorpage("Insufficient privileges.");
exit;
@@ -17,10 +17,11 @@ if(!havepriv("admin"))
// we want to delete a user
if($_REQUEST['action'] == "delete" && is_numeric($_REQUEST['userId']))
{
- $sEmail = lookupEmail($_REQUEST['userId']);
+ $oUser = new User($_REQUEST['userId']);
+ $sEmail = $oUser->sEmail;
if($sEmail)
{
- $_SESSION['current']->remove($sEmail);
+ $oUser->delete();
}
}
@@ -85,15 +86,16 @@ if($_REQUEST['sSubmit'])
$i=0;
while($hResult && $oRow = mysql_fetch_object($hResult))
{
- $sAreYouSure = "Are you sure that you want to delete user ".addslashes($oRow->realname)." ?";
+ $oUser = new User($oRow->userid);
+ $sAreYouSure = "Are you sure that you want to delete user ".addslashes($oUser->sRealname)." ?";
echo "\n";
- echo " ".$oRow->realname." \n";
- echo " ".$oRow->email." \n";
- echo " ".$oRow->created." \n";
- echo " ".$oRow->stamp." \n";
+ echo " ".$oUser->sRealname." \n";
+ echo " ".$oUser->sEmail." \n";
+ echo " ".$oUser->sDateCreated." \n";
+ echo " ".$oUser->sStamp." \n";
echo " ";
- if(isAdministrator($oRow->userid)) echo "A";
- if(isMaintainer($oRow->userid)) echo "M";
+ if($oUser->hasPriv("admin")) echo "A";
+ if($oUser->isMaintainer()) echo "M";
echo " \n";
echo " [userid."&sSearch=".$sSearch."&iLimit=".$_REQUEST['iLimit']."&sOrderBy=".$_REQUEST['sOrderBy']."&sSubmit=true\">delete ] [userid."&sSearch=".$sSearch."&iLimit=".$_REQUEST['iLimit']."&sOrderBy=".$_REQUEST['sOrderBy']."\">edit ] \n";
echo " \n\n";
diff --git a/admin/adminVendors.php b/admin/adminVendors.php
index 6594cb4..80dbd35 100644
--- a/admin/adminVendors.php
+++ b/admin/adminVendors.php
@@ -9,7 +9,7 @@
include("path.php");
require(BASE."include/incl.php");
-if(!havepriv("admin"))
+if(!$_SESSION['current']->hasPriv("admin"))
{
errorpage("Insufficient privileges.");
exit;
diff --git a/admin/deleteAny.php b/admin/deleteAny.php
index e64aa30..ddb5848 100644
--- a/admin/deleteAny.php
+++ b/admin/deleteAny.php
@@ -11,7 +11,7 @@ include(BASE."include/incl.php");
include(BASE."include/category.php");
include(BASE."include/application.php");
-if(!havepriv("admin"))
+if(!$_SESSION['current']->hasPriv("admin"))
{
errorpage();
exit;
diff --git a/admin/editAppFamily.php b/admin/editAppFamily.php
index 791cd92..8783467 100644
--- a/admin/editAppFamily.php
+++ b/admin/editAppFamily.php
@@ -16,7 +16,7 @@ if(!is_numeric($_REQUEST['appId']))
exit;
}
-if(!(havepriv("admin") || $_SESSION['current']->is_super_maintainer($_REQUEST['appId'])))
+if(!($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isSuperMaintainer($_REQUEST['appId'])))
{
errorpage("Insufficient Privileges!");
exit;
@@ -180,7 +180,7 @@ if(isset($_REQUEST['submit']))
}
if ($bAppChanged)
{
- $sEmail = getNotifyEmailAddressList($_REQUEST['appId']);
+ $sEmail = get_notify_email_address_list($_REQUEST['appId']);
if($sEmail)
{
$sFullAppName = "Application: ".lookupAppName($_REQUEST['appId']);
diff --git a/admin/editAppNote.php b/admin/editAppNote.php
index 8737abc..7a59b0c 100644
--- a/admin/editAppNote.php
+++ b/admin/editAppNote.php
@@ -20,7 +20,7 @@ $hResult = query_appdb($sQuery);
$ob = mysql_fetch_object($hResult);
/* Check for privs */
-if(!loggedin() || (!havepriv("admin") && !$_SESSION['current']->is_maintainer($ob->appId,$ob->versionId)) )
+if(!$_SESSION['current']->isLoggedIn() || (!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer($ob->appId,$ob->versionId)) )
{
errorpage("Insufficient Privileges!");
exit;
@@ -37,7 +37,7 @@ if(isset($_REQUEST['sub']))
$sMsg = APPDB_ROOT."appview.php?appId={$ob->appId}&versionId={$ob->versionId}\r\n";
$sMsg .= "\r\n";
- $sEmail = getNotifyEmailAddressList($ob->appId, $ob->versionId);
+ $sEmail = get_notify_email_address_list($ob->appId, $ob->versionId);
if ($_REQUEST['sub'] == 'Delete')
{
diff --git a/admin/editAppVersion.php b/admin/editAppVersion.php
index 7cd4a47..3412668 100644
--- a/admin/editAppVersion.php
+++ b/admin/editAppVersion.php
@@ -11,8 +11,8 @@ if(!is_numeric($_REQUEST['appId']) OR !is_numeric($_REQUEST['versionId']))
exit;
}
-//check for admin privs
-if(!(havepriv("admin") || $_SESSION['current']->is_maintainer($_REQUEST['appId'],$_REQUEST['versionId'])))
+/* Check for admin privs */
+if(!($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isMaintainer($_REQUEST['appId'],$_REQUEST['versionId'])))
{
errorpage("Insufficient Privileges!");
exit;
diff --git a/admin/editBundle.php b/admin/editBundle.php
index 4253abe..a3b2a39 100644
--- a/admin/editBundle.php
+++ b/admin/editBundle.php
@@ -3,7 +3,7 @@
include("path.php");
include(BASE."include/"."incl.php");
-if(!havepriv("admin"))
+if(!$_SESSION['current']->hasPriv("admin"))
{
errorpage();
exit;
diff --git a/admin/editCategory.php b/admin/editCategory.php
index c50fafd..758e1a2 100644
--- a/admin/editCategory.php
+++ b/admin/editCategory.php
@@ -4,7 +4,7 @@ include("path.php");
include(BASE."include/"."incl.php");
include(BASE."include/"."tableve.php");
-if(!havepriv("admin"))
+if(!$_SESSION['current']->hasPriv("admin"))
{
errorpage();
exit;
diff --git a/admin/editVendor.php b/admin/editVendor.php
index 79c665d..6144a66 100644
--- a/admin/editVendor.php
+++ b/admin/editVendor.php
@@ -4,7 +4,7 @@ include("path.php");
include(BASE."include/"."incl.php");
include(BASE."include/"."tableve.php");
-if(!havepriv("admin"))
+if(!$_SESSION['current']->hasPriv("admin"))
{
errorpage();
exit;
diff --git a/appbrowse.php b/appbrowse.php
index 22b6617..78f5eab 100644
--- a/appbrowse.php
+++ b/appbrowse.php
@@ -37,7 +37,7 @@ $catFullPath = make_cat_path($cat->getCategoryPath());
$subs = $cat->getCategoryList();
//display admin box
-if(havepriv("admin") && $catId != 0)
+if($_SESSION['current']->hasPriv("admin") && $catId != 0)
apidb_sidebar_add("admin_menu");
//output header
diff --git a/appimage.php b/appimage.php
index 4d85c57..4962836 100644
--- a/appimage.php
+++ b/appimage.php
@@ -6,7 +6,7 @@
include("path.php");
require(BASE."include/"."incl.php");
require(BASE."include/"."screenshot.php");
-if(!havepriv("admin") && $_REQUEST['queued'])
+if(!$_SESSION['current']->hasPriv("admin") && $_REQUEST['queued'])
{
errorpage("Insufficient privileges.");
exit;
diff --git a/appsubmit.php b/appsubmit.php
index c3de882..758a0d6 100644
--- a/appsubmit.php
+++ b/appsubmit.php
@@ -10,7 +10,7 @@ require(BASE."include/"."tableve.php");
// Send user to the correct branch of code even if they try to bypass
// the first page (appsubmit.php without parameters)
-if(!loggedin())
+if(!$_SESSION['current']->isLoggedIn())
{
unset($_REQUEST['queueName']);
unset($_REQUEST['apptype']);
@@ -106,7 +106,7 @@ if (isset($_REQUEST['queueName']))
else if (isset($_REQUEST['apptype']))
{
// set email field if logged in
- if (loggedin())
+ if ($_SESSION['current']->isLoggedIn())
$email = $_SESSION['current']->lookup_email($_SESSION['current']->userid);
// header
@@ -213,7 +213,7 @@ else if (isset($_REQUEST['apptype']))
##########################
else
{
- if(!loggedin())
+ if(!$_SESSION['current']->isLoggedIn())
{
// you must be logged in to submit app
apidb_header("Please login");
diff --git a/appview.php b/appview.php
index 5a59fd8..530f574 100644
--- a/appview.php
+++ b/appview.php
@@ -107,7 +107,7 @@ function show_note($sType,$oData){
$s .= add_br(stripslashes($oData->noteDesc));
$s .= "\n";
- if (loggedin() && (havepriv("admin") || $_SESSION['current']->is_maintainer($_REQUEST['appId'], $_REQUEST['versionId'])))
+ if ($_SESSION['current']->isLoggedIn() && ($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isMaintainer($_REQUEST['appId'], $_REQUEST['versionId'])))
{
$s .= "";
$s .= " \n";
}
} else
{
@@ -278,10 +279,10 @@ if($appId && !$versionId)
// Display the app maintainer button
echo " \n";
- if(loggedin())
+ if($_SESSION['current']->isLoggedIn())
{
/* are we already a maintainer? */
- if($_SESSION['current']->is_super_maintainer($appId)) /* yep */
+ if($_SESSION['current']->isSuperMaintainer($appId)) /* yep */
{
echo ' ";
- if($_SESSION['current']->is_super_maintainer($appId) || havepriv("admin"))
+ if($_SESSION['current']->isSuperMaintainer($appId) || $_SESSION['current']->hasPriv("admin"))
{
echo ' ';
echo '';
}
- if(havepriv("admin"))
+ if($_SESSION['current']->hasPriv("admin"))
{
$url = BASE."admin/deleteAny.php?what=appFamily&appId=".$_REQUEST['appId']."&confirmed=yes";
echo " ";
@@ -396,7 +397,7 @@ else if($appId && $versionId)
while(list($index, list($userIdValue)) = each($other_maintainers))
{
echo "";
- echo "".lookupRealname($userIdValue)." \n";
+ echo "".$oUser->sRealname." \n";
}
} else
{
@@ -407,18 +408,18 @@ else if($appId && $versionId)
// display the app maintainer button
echo "";
- if(loggedin())
+ if($_SESSION['current']->isLoggedIn())
{
/* is this user a maintainer of this version by virtue of being a super maintainer */
/* of this app family? */
- if($_SESSION['current']->is_super_maintainer($appId))
+ if($_SESSION['current']->isSuperMaintainer($appId))
{
echo ' ";
- if (loggedin() && (havepriv("admin") || $_SESSION['current']->is_maintainer($appId, $versionId)))
+ if ($_SESSION['current']->isLoggedIn() && ($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isMaintainer($appId, $versionId)))
{
echo "";
echo ' \n";
// delete message button, for admins
- if (loggedin() && (havepriv("admin") || $_SESSION['current']->is_maintainer($ob->appId,$ob->versionId) ))
+ if ($_SESSION['current']->isLoggedIn() && ($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isMaintainer($ob->appId,$ob->versionId) ))
{
echo "";
echo "