bug 1138: added function get_domains
authorINOPIAE <inopiae@cacert.org>
Sun, 8 Dec 2013 13:12:55 +0000 (14:12 +0100)
committerINOPIAE <inopiae@cacert.org>
Sun, 8 Dec 2013 13:12:55 +0000 (14:12 +0100)
includes/notary.inc.php
pages/account/43.php
pages/account/59.php

index b9a13d2..54c3f60 100644 (file)
@@ -1188,6 +1188,7 @@ function get_alerts($userid){
  * @return
  */
 function get_email_address($userid, $primary,$deleted=0){
+       //should be entered in account/2.php
        $userid = intval($userid);
        $filter='';
        if (0==$deleted) {
@@ -1200,6 +1201,17 @@ function get_email_address($userid, $primary,$deleted=0){
        return mysql_query($query);
 }
 
+function get_domains($userid, $deleted=0){
+       //should be entered in account/9.php
+       $userid = intval($userid);
+       $filter='';
+       if (0==$deleted) {
+               $filter=' and `deleted`=0';
+       }
+       $query = "select * from `domains` where `memid`='".$userid."' and `hash`=''".$filter." order by `created`";
+       return mysql_query($query);
+}
+
 function output_log_email_header(){
        ?>
        <tr
@@ -1221,8 +1233,30 @@ function output_log_email($row,$primary){
        }
 
        <tr>
-       <td class="<?$bold . $italic ?>">$row['email']</td>
-       <td class="<?$bold . $italic ?>">$row['created']</td>
-       <td class="<?$bold . $italic ?>">$row['deleted']</td>
+       <td class="<? $bold . $italic ?>">$row['email']</td>
+       <td class="<? $bold . $italic ?>">$row['created']</td>
+       <td class="<? $bold . $italic ?>">$row['deleted']</td>
+       </tr>
+}
+
+function output_log_domains_header(){
+       ?>
+       <tr
+               <td>_("Domain")</td>
+               <td>_("Created")</td>
+               <td>_("Deleted")</td>
+       </tr>
+
+       <?
+}
+function output_log_domains($row){
+       $italic='';
+       if (0==$row['deleted']) {
+               $italic='italic ';
+       }
+       <tr>
+       <td class="<? $italic ?>">$row['domain']</td>
+       <td class="<? $italic ?>">$row['created']</td>
+       <td class="<? $italic ?>">$row['deleted']</td>
        </tr>
 }
\ No newline at end of file
index 8dcedad..2ba94b0 100644 (file)
@@ -346,8 +346,10 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php");
 </table>
 <br><? } ?>
 <?
-  $query = "select * from `domains` where `memid`='".intval($row['id'])."' and `deleted`=0 and `hash`=''";
-  $dres = mysql_query($query);
+// comment to be deleted before release
+//    $query = "select * from `domains` where `memid`='".intval($row['id'])."' and `deleted`=0 and `hash`=''";
+//  $dres = mysql_query($query);
+  $dres=get_domains(intval($row['id']));
   if(mysql_num_rows($dres) > 0) { ?>
 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
   <tr>
index 53c885b..e794e97 100644 (file)
@@ -31,7 +31,7 @@ $name = $fname." ".$mname." ".$lname." ".$suffix;
 $email = $row['email'];
 $alerts =get_alerts($userid)
 ?>
-<table>
+<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
   <tr>
     <td colspan="<? $colspandefault ?>" class="title"><?=sprintf(_('Account history of %s'),'username')?></td>
   </tr>
@@ -103,7 +103,7 @@ $alerts =get_alerts($userid)
 $dres = get_email_address($userid,'',1);
 if(mysql_num_rows($dres) > 0) {
 ?>
-<table>
+<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
   <tr>
     <td colspan="3" class="title"><?=_('Email addresses')?></td>
   </tr>
@@ -115,6 +115,22 @@ while($drow = mysql_fetch_assoc($dres))
  } ?>
 </table>
 <br/>
+<?
+$dres = get_domains($userid,'',1);
+if(mysql_num_rows($dres) > 0) {
+?>
+<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
+  <tr>
+    <td colspan="3" class="title"><?=_('Domains')?></td>
+  </tr>
+<?
+output_log_domain_header();
+while($drow = mysql_fetch_assoc($dres))
+{
+       output_log_domain($drow,$email);
+} ?>
+</table>
+<br/>
 
 <table>
   <tr>