ChangeSet ID: 31236
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/07/01 20:07:09
Modified files:
include : objectManager.php
Log message:
Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com>
Display login link when processing queues. Display a login link when processing queues and the
user isn't logged in, rather than saying that there are no entries.
Patch: http://cvs.winehq.org/patch.py?id=31236
Old revision New revision Changes Path
1.34 1.35 +9 -0 appdb/include/objectManager.php
Index: appdb/include/objectManager.php
diff -u -p appdb/include/objectManager.php:1.34 appdb/include/objectManager.php:1.35
--- appdb/include/objectManager.php:1.34 2 Jul 2007 1: 7: 9 -0000
+++ appdb/include/objectManager.php 2 Jul 2007 1: 7: 9 -0000
@@ -84,6 +84,15 @@ class ObjectManager
$this->checkMethods(array("ObjectGetEntries", "ObjectGetHeader",
"objectGetTableRow", "objectGetId", "canEdit"));
+ /* We cannot process a queue if we are not logged in */
+ if(!$_SESSION['current']->isLoggedIn())
+ {
+ $sQueueText = $this->bIsRejected ? "rejected" : "queued";
+ echo '<div align="center">You need to <a href="'.login_url().'">';
+ echo "log in</a> in order to process $sQueueText entries</div>\n";
+ return;
+ }
+
$oObject = new $this->sClass();
/* Display selectors for items per page and current page, if applicable. The function
ChangeSet ID: 31235
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/07/01 19:50:32
Modified files:
include : objectManager.php
Log message:
Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com>
Check for valid result resource before number of rows. objectGetEntries() may return FALSE if
the user does not have permission to view a queue, for instance.
Patch: http://cvs.winehq.org/patch.py?id=31235
Old revision New revision Changes Path
1.33 1.34 +1 -1 appdb/include/objectManager.php
Index: appdb/include/objectManager.php
diff -u -p appdb/include/objectManager.php:1.33 appdb/include/objectManager.php:1.34
--- appdb/include/objectManager.php:1.33 2 Jul 2007 0:50:32 -0000
+++ appdb/include/objectManager.php 2 Jul 2007 0:50:32 -0000
@@ -101,7 +101,7 @@ class ObjectManager
$hResult = $oObject->objectGetEntries($this->bIsQueue, $this->bIsRejected);
/* did we get any entries? */
- if(mysql_num_rows($hResult) == 0)
+ if(!$hResult || mysql_num_rows($hResult) == 0)
{
switch($this->getQueueString($this->bIsQueue, $this->bIsRejected))
{