summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2011-11-05 16:45:41 +0100
committerMichael Tänzer <neo@nhng.de>2011-11-05 16:45:41 +0100
commit531e09ffcda0674ff89321a3736c43149f2f7a32 (patch)
tree79b1b2716b3dcaa4767cdea876b88f8a7bef610e
parentace0ca3de88bbb2c8160db0aeb1b0dcf7d64a724 (diff)
downloadcacert-devel-531e09ffcda0674ff89321a3736c43149f2f7a32.tar.gz
cacert-devel-531e09ffcda0674ff89321a3736c43149f2f7a32.tar.xz
cacert-devel-531e09ffcda0674ff89321a3736c43149f2f7a32.zip
bug 976: Fixing ambiguous references in SQL
which were introduced by adding new columns on existing tables used in an SQL query on multiple tables which did not qualify the particular table of the columns used. -> MySQL returned an error which was not handled properly by the code and "No client certificates are currently listed." was displayed instead. Signed-off-by: Michael Tänzer <neo@nhng.de>
-rw-r--r--pages/account/18.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/pages/account/18.php b/pages/account/18.php
index 47fac9e..b5ec08e 100644
--- a/pages/account/18.php
+++ b/pages/account/18.php
@@ -30,20 +30,21 @@
<td class="DataTD"><?=_("Expires")?></td>
<?
- $query = "select UNIX_TIMESTAMP(`created`) as `created`,
- UNIX_TIMESTAMP(`expire`) - UNIX_TIMESTAMP() as `timeleft`,
- UNIX_TIMESTAMP(`expire`) as `expired`,
- `expire` as `expires`, `revoked` as `revoke`,
- UNIX_TIMESTAMP(`revoked`) as `revoked`, `CN`, `serial`, `id`
- from `orgemailcerts`, `org`
- where `memid`='".intval($_SESSION['profile']['id'])."' and
+ $query = "select UNIX_TIMESTAMP(`oemail`.`created`) as `created`,
+ UNIX_TIMESTAMP(`oemail`.`expire`) - UNIX_TIMESTAMP() as `timeleft`,
+ UNIX_TIMESTAMP(`oemail`.`expire`) as `expired`,
+ `oemail`.`expire` as `expires`, `oemail`.`revoked` as `revoke`,
+ UNIX_TIMESTAMP(`oemail`.`revoked`) as `revoked`,
+ `oemail`.`CN`, `oemail`.`serial`, `oeamil`.`id`
+ from `orgemailcerts` as `oemail`, `org`
+ where `org`.`memid`='".intval($_SESSION['profile']['id'])."' and
`org`.`orgid`=`orgemailcerts`.`orgid` ";
if($viewall != 1)
{
- $query .= "AND `revoked`=0 AND `renewed`=0 ";
+ $query .= "AND `oemail`.`revoked`=0 AND `oemail`.`renewed`=0 ";
$query .= "HAVING `timeleft` > 0 AND `revoked`=0 ";
}
- $query .= "ORDER BY `modified` desc";
+ $query .= "ORDER BY `oemail`.`modified` desc";
$res = mysql_query($query);
if(mysql_num_rows($res) <= 0)
{