summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/notary.inc.php44
-rw-r--r--pages/account/18.php65
2 files changed, 77 insertions, 32 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php
index a928c78..20e01db 100644
--- a/includes/notary.inc.php
+++ b/includes/notary.inc.php
@@ -1274,3 +1274,47 @@ function output_oa_domain($orgid)
output_log_oa_summary_content($orgid,'Org domain');
output_summary_footer();
}
+
+function output_orgclientcerts_data($orgadminid = 0, $orgfilterid = 0, $sorting, $status){
+ $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`, `oemail`.`id`,
+ `oemail`.`description`, `oemail`.`ou`, `orginfo`.`O`,
+ `cu`.`fname` as cfname, `cu`.`lname` as clname ,
+ `ru`.`fname` as rfname, `ru`.`lname` as rlname
+ from `org`, `orginfo`, `orgemailcerts` as `oemail`
+ left join users as `cu` on `oemail`.`orgadminid` = `cu`.`id`
+ left join users as `ru` on `oemail`.`revokeorgadminid` = `ru`.`id`
+ where `org`.`orgid`=`oemail`.`orgid` and `orginfo`.`id` = `org`.`orgid` ";
+
+ if($orgadminid > 0)
+ {
+ $query .= "AND `org`.`memid` = $orgadminid ";
+ }
+
+ if($orgfilterid > 0)
+ {
+ $query .= "AND `org`.`orgid` = $orgfilterid ";
+ }
+
+ if(0 == $status)
+ {
+ $query .= "AND `oemail`.`revoked`=0 AND `oemail`.`renewed`=0 ";
+ $query .= "HAVING `timeleft` > 0 AND `revoked`=0 ";
+ }
+ switch ($sorting){
+ case 0:
+ $query .= "ORDER BY `orginfo`.`O`, `oemail`.`expire` desc";
+ break;
+ case 1:
+ $query .= "ORDER BY `orginfo`.`O`, `oemail`.`ou`, `oemail`.`expire` desc";
+ break;
+ case 2:
+ $query .= "ORDER BY `orginfo`.`O`, `oemail`.`CN`, `oemail`.`expire` desc";
+ break;
+ }
+ return mysql_query($query);
+}
diff --git a/pages/account/18.php b/pages/account/18.php
index 9ab13b2..42b4a65 100644
--- a/pages/account/18.php
+++ b/pages/account/18.php
@@ -74,38 +74,39 @@ $status = array_key_exists('status',$_SESSION['_config']) ? intval($_SESSION['_c
</tr>
<?
- $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`, `oemail`.`id`,
- `oemail`.`description`, `oemail`.`ou`, `orginfo`.`O`
- from `orgemailcerts` as `oemail`, `org`, `orginfo`
- where `org`.`memid`='".intval($_SESSION['profile']['id'])."' and
- `org`.`orgid`=`oemail`.`orgid` and `orginfo`.`id` = `org`.`orgid`";
- if($orgfilterid>0)
- {
- $query .= "AND `org`.`orgid`=$orgfilterid ";
- }
-
- if(0==$status)
- {
- $query .= "AND `oemail`.`revoked`=0 AND `oemail`.`renewed`=0 ";
- $query .= "HAVING `timeleft` > 0 AND `revoked`=0 ";
- }
- switch ($sorting){
- case 0:
- $query .= "ORDER BY `orginfo`.`O`, `oemail`.`expire` desc";
- break;
- case 1:
- $query .= "ORDER BY `orginfo`.`O`, `oemail`.`ou`, `oemail`.`expire` desc";
- break;
- case 2:
- $query .= "ORDER BY `orginfo`.`O`, `oemail`.`CN`, `oemail`.`expire` desc";
- break;
- }
- $res = mysql_query($query);
+// $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`, `oemail`.`id`,
+// `oemail`.`description`, `oemail`.`ou`, `orginfo`.`O`
+// from `orgemailcerts` as `oemail`, `org`, `orginfo`
+// where `org`.`memid`='".intval($_SESSION['profile']['id'])."' and
+// `org`.`orgid`=`oemail`.`orgid` and `orginfo`.`id` = `org`.`orgid`";
+// if($orgfilterid>0)
+// {
+// $query .= "AND `org`.`orgid`=$orgfilterid ";
+// }
+//
+// if(0==$status)
+// {
+// $query .= "AND `oemail`.`revoked`=0 AND `oemail`.`renewed`=0 ";
+// $query .= "HAVING `timeleft` > 0 AND `revoked`=0 ";
+// }
+// switch ($sorting){
+// case 0:
+// $query .= "ORDER BY `orginfo`.`O`, `oemail`.`expire` desc";
+// break;
+// case 1:
+// $query .= "ORDER BY `orginfo`.`O`, `oemail`.`ou`, `oemail`.`expire` desc";
+// break;
+// case 2:
+// $query .= "ORDER BY `orginfo`.`O`, `oemail`.`CN`, `oemail`.`expire` desc";
+// break;
+// }
+// $res = mysql_query($query);
+ $res = output_orgclientcerts_data(intval($_SESSION['profile']['id']), $orgfilterid, $sorting, $status);
if(mysql_num_rows($res) <= 0)
{
?>