bug 1138: don't alias columns that could cause ambiguities
authorMichael Tänzer <neo@nhng.de>
Sun, 6 Apr 2014 23:06:20 +0000 (01:06 +0200)
committerMichael Tänzer <neo@nhng.de>
Sun, 6 Apr 2014 23:06:20 +0000 (01:06 +0200)
Signed-off-by: Michael Tänzer <neo@nhng.de>
includes/notary.inc.php
pages/account/12.php
pages/account/5.php
pages/account/6.php
pages/gpg/2.php

index 4ec1e4e..62d56ab 100644 (file)
@@ -1393,13 +1393,13 @@ function get_client_certs($userid,$viewall=0){
        $query = "select UNIX_TIMESTAMP(`emailcerts`.`created`) as `created`,
                UNIX_TIMESTAMP(`emailcerts`.`expire`) - UNIX_TIMESTAMP() as `timeleft`,
                UNIX_TIMESTAMP(`emailcerts`.`expire`) as `expired`,
-               `emailcerts`.`expire` as `expires`,
+               `emailcerts`.`expire`,
                `emailcerts`.`revoked` as `revoke`,
                UNIX_TIMESTAMP(`emailcerts`.`revoked`) as `revoked`,
                `emailcerts`.`id`,
                `emailcerts`.`CN`,
                `emailcerts`.`serial`,
-               `emailcerts`.`disablelogin` as `disablelogin`,
+               `emailcerts`.`disablelogin`,
                `emailcerts`.`description`
                from `emailcerts`
                where `emailcerts`.`memid`='".$userid."'";
@@ -1425,7 +1425,8 @@ function get_server_certs($userid,$viewall=0){
        $query = "select UNIX_TIMESTAMP(`domaincerts`.`created`) as `created`,
                        UNIX_TIMESTAMP(`domaincerts`.`expire`) - UNIX_TIMESTAMP() as `timeleft`,
                        UNIX_TIMESTAMP(`domaincerts`.`expire`) as `expired`,
-                       `domaincerts`.`expire` as `expires`, `revoked` as `revoke`,
+                       `domaincerts`.`expire`,
+                       `domaincerts`.`revoked` as `revoke`,
                        UNIX_TIMESTAMP(`revoked`) as `revoked`, `CN`, `domaincerts`.`serial`, `domaincerts`.`id` as `id`,
                        `domaincerts`.`description`
                        from `domaincerts`,`domains`
@@ -1452,7 +1453,7 @@ function get_gpg_certs($userid,$viewall=0){
        $query = $query = "select UNIX_TIMESTAMP(`issued`) as `issued`,
                        UNIX_TIMESTAMP(`expire`) - UNIX_TIMESTAMP() as `timeleft`,
                        UNIX_TIMESTAMP(`expire`) as `expired`,
-                       `expire` as `expires`, `id`, `level`,
+                       `expire`, `id`, `level`,
                        `email`,`keyid`,`description` from `gpg` where `memid`='".$userid."'
                        ORDER BY `issued` desc";
        return mysql_query($query);
@@ -1721,7 +1722,7 @@ function output_client_cert($row, $support=0){
 
                <td class="DataTD"><?=$row['serial']?></td>
                <td class="DataTD"><?=$row['revoke']?></td>
-               <td class="DataTD"><?=$row['expires']?></td>
+               <td class="DataTD"><?=$row['expire']?></td>
 
        <? if ($support !=1) { ?>
                <td class="DataTD">
@@ -1805,7 +1806,7 @@ function output_log_server_certs($row, $support=0){
                <?}?>
                <td class="DataTD"><?=$row['serial']?></td>
                <td class="DataTD"><?=$row['revoke']?></td>
-               <td class="DataTD"><?=$row['expires']?></td>
+               <td class="DataTD"><?=$row['expire']?></td>
                <?if ($support !=1) { ?>
                        <td class="DataTD"><input name="comment_<?=$row['id']?>" type="text" value="<?=htmlspecialchars($row['description'])?>" /></td>
                        <td class="DataTD"><input type="checkbox" name="check_comment_<?=$row['id']?>" /></td>
@@ -1868,7 +1869,7 @@ function output_gpg_certs($row, $support=0){
                                <td class="DataTD"><?=$row['email']?></td>
                        <? } ?>
                <? } ?>
-               <td class="DataTD"><?=$row['expires']?></td>
+               <td class="DataTD"><?=$row['expire']?></td>
                <?if ($support != 1) { ?>
                        <td class="DataTD"><a href="gpg.php?id=3&amp;cert=<?=$row['id']?>"><?=$row['keyid']?></a></td>
                <? } else { ?>
index 9058a07..5ca8ce7 100644 (file)
@@ -34,7 +34,8 @@
        $query = "select UNIX_TIMESTAMP(`domaincerts`.`created`) as `created`,
                        UNIX_TIMESTAMP(`domaincerts`.`expire`) - UNIX_TIMESTAMP() as `timeleft`,
                        UNIX_TIMESTAMP(`domaincerts`.`expire`) as `expired`,
-                       `domaincerts`.`expire` as `expires`, `revoked` as `revoke`,
+                       `domaincerts`.`expire`,
+                       `domaincerts`.`revoked` as `revoke`,
                        UNIX_TIMESTAMP(`revoked`) as `revoked`, `CN`, `domaincerts`.`serial`, `domaincerts`.`id` as `id`,
                        `domaincerts`.`description`
                        from `domaincerts`,`domains`
@@ -79,7 +80,7 @@
     <td class="DataTD"><a href="account.php?id=15&amp;cert=<?=$row['id']?>"><?=$row['CN']?></a></td>
     <td class="DataTD"><?=$row['serial']?></td>
     <td class="DataTD"><?=$row['revoke']?></td>
-    <td class="DataTD"><?=$row['expires']?></td>
+    <td class="DataTD"><?=$row['expire']?></td>
     <td class="DataTD"><input name="comment_<?=$row['id']?>" type="text" value="<?=htmlspecialchars($row['description'])?>" /></td>
     <td class="DataTD"><input type="checkbox" name="check_comment_<?=$row['id']?>" /></td>
   </tr>
index 934ca0c..cca2f6f 100644 (file)
@@ -34,7 +34,7 @@
        $query = "select UNIX_TIMESTAMP(`emailcerts`.`created`) as `created`,
                        UNIX_TIMESTAMP(`emailcerts`.`expire`) - UNIX_TIMESTAMP() as `timeleft`,
                        UNIX_TIMESTAMP(`emailcerts`.`expire`) as `expired`,
-                       `emailcerts`.`expire` as `expires`,
+                       `emailcerts`.`expire`,
                        `emailcerts`.`revoked` as `revoke`,
                        UNIX_TIMESTAMP(`emailcerts`.`revoked`) as `revoked`,
                        `emailcerts`.`id`,
@@ -89,7 +89,7 @@
 <? } ?>
     <td class="DataTD"><?=$row['serial']?></td>
     <td class="DataTD"><?=$row['revoke']?></td>
-    <td class="DataTD"><?=$row['expires']?></td>
+    <td class="DataTD"><?=$row['expire']?></td>
     <td class="DataTD">
       <input type="checkbox" name="disablelogin_<?=$row['id']?>" value="1" <?=$row['disablelogin']?"":'checked="checked"'?>/>
       <input type="hidden" name="cert_<?=$row['id']?>" value="1" />
index 8455499..0803406 100644 (file)
@@ -25,7 +25,7 @@ if(array_key_exists('cert',$_REQUEST)) {
 $query = "select UNIX_TIMESTAMP(`emailcerts`.`created`) as `created`,
                        UNIX_TIMESTAMP(`emailcerts`.`expire`) - UNIX_TIMESTAMP() as `timeleft`,
                        UNIX_TIMESTAMP(`emailcerts`.`expire`) as `expired`,
-                       `emailcerts`.`expire` as `expires`,
+                       `emailcerts`.`expire`,
                        `emailcerts`.`revoked` as `revoke`,
                        UNIX_TIMESTAMP(`emailcerts`.`revoked`) as `revoked`,
                        `emailcerts`.`id`,
@@ -149,7 +149,7 @@ if (array_key_exists('format', $_REQUEST)) {
        </tr>
        <tr>
                <td class="DataTD"><?=_("Expires")?></td>
-               <td class="DataTD"><?=$row['expires']?></td>
+               <td class="DataTD"><?=$row['expire']?></td>
        </tr>
        <tr>
                <td class="DataTD"><?=_("Login")?></td>
index cc8a872..54d2bb2 100644 (file)
@@ -30,7 +30,7 @@
        $query = "select UNIX_TIMESTAMP(`issued`) as `issued`,
                        UNIX_TIMESTAMP(`expire`) - UNIX_TIMESTAMP() as `timeleft`,
                        UNIX_TIMESTAMP(`expire`) as `expired`,
-                       `expire` as `expires`, `id`, `level`,
+                       `expire`, `id`, `level`,
                        `email`,`keyid`,`description` from `gpg` where `memid`='".intval($_SESSION['profile']['id'])."'
                        ORDER BY `issued` desc";
        $res = mysql_query($query);
@@ -61,7 +61,7 @@
     <td class="DataTD"><?=$verified?></td>
     <td class="DataTD"><a href="gpg.php?id=3&amp;cert=<?=$row['id']?>"><?=$row['email']?></a></td>
 <? } ?>
-    <td class="DataTD"><?=$row['expires']?></td>
+    <td class="DataTD"><?=$row['expire']?></td>
     <td class="DataTD"><a href="gpg.php?id=3&amp;cert=<?=$row['id']?>"><?=$row['keyid']?></a></td>
     <td class="DataTD"><input name="comment_<?=$row['id']?>" type="text" value="<?=htmlspecialchars($row['description'])?>" /></td>
     <td class="DataTD"><input type="checkbox" name="check_comment_<?=$row['id']?>" /></td>