summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorINOPIAE <inopiae@cacert.org>2013-12-08 14:49:56 +0100
committerINOPIAE <inopiae@cacert.org>2013-12-08 14:49:56 +0100
commited5c46d3f0e921f4764e0b2aa020c1d869443bc8 (patch)
tree475cdb6cf4f411535f640999d6ac0a82b999870c
parent91d56d5b8bac51581a419bf80e3a5d044ee5476c (diff)
downloadcacert-devel-ed5c46d3f0e921f4764e0b2aa020c1d869443bc8.tar.gz
cacert-devel-ed5c46d3f0e921f4764e0b2aa020c1d869443bc8.tar.xz
cacert-devel-ed5c46d3f0e921f4764e0b2aa020c1d869443bc8.zip
bug 1138: added function get_user_agreement
-rw-r--r--includes/notary.inc.php61
-rw-r--r--pages/account/59.php36
2 files changed, 77 insertions, 20 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php
index 54c3f60..da70820 100644
--- a/includes/notary.inc.php
+++ b/includes/notary.inc.php
@@ -694,6 +694,17 @@
return $rec;
}
+function get_user_agreement($memid){
+ $query="(SELECT u.`document`, u.`date`, u.`method`, u.`comment`, 1 as `active` FROM user_agreements u WHERE u.`document` = 'CCA' AND (u.`memid`=".$memid." ) order by u.`date` )
+ union
+ (SELECT u.`document`, u.`date`, u.`method`, u.`comment`, 0 as `active` FROM user_agreements u WHERE u.`document` = 'CCA' AND ( u.`secmemid`=".$memid.") order by u.`date`)
+ union
+ (SELECT u.`document`, u.`date`, u.`method`, u.`comment`, 0 as `active` FROM user_agreements u WHERE u.`document` != 'CCA' AND ( u.`memid`=".$memid.") order by u.u.`document`, u.`date`) " ;
+ $res = mysql_query($query);
+
+ return mysql_query($query);
+}
+
function delete_user_agreement($memid, $type="CCA"){
//deletes all entries to an user for the given type of user agreements
mysql_query("delete from `user_agreements` where `memid`='".$memid."'");
@@ -1215,9 +1226,9 @@ function get_domains($userid, $deleted=0){
function output_log_email_header(){
?>
<tr
- <td>_("Email, primary bold")</td>
- <td>_("Created")</td>
- <td>_("Deleted")</td>
+ <td><?= _("Email, primary bold") ?></td>
+ <td><?= _("Created") ?></td>
+ <td><?= _("Deleted") ?></td>
</tr>
<?
@@ -1231,20 +1242,21 @@ function output_log_email($row,$primary){
if ($primary==$row['email']) {
$bold= 'bold ';
}
-
+ ?>
<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>
+ <td><?= _("Domain") ?></td>
+ <td><?= _("Created") ?></td>
+ <td><?= _("Deleted") ?></td>
</tr>
<?
@@ -1254,9 +1266,32 @@ function output_log_domains($row){
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>
+ <?
+}
+
+function output_log_agreement_header(){
+ ?>
+ <tr
+ <td><?= _("Agreement") ?></td>
+ <td><?= _("Date") ?></td>
+ <td><?= _("Method") ?></td>
+ <td><?= _("Comment") ?></td>
+ </tr>
+ <?
+}
+function output_log_agreement($row){
+ ?>
<tr>
- <td class="<? $italic ?>">$row['domain']</td>
- <td class="<? $italic ?>">$row['created']</td>
- <td class="<? $italic ?>">$row['deleted']</td>
+ <td class="<? $italic ?>"><?=$row['document']?></td>
+ <td class="<? $italic ?>"><?=$row['date']?></td>
+ <td class="<? $italic ?>"><?=$row['method']?></td>
+ <td class="<? $italic ?>"><?= ($row['active']==0)? _('No'):_('Yes')?></td>
</tr>
+ <?
} \ No newline at end of file
diff --git a/pages/account/59.php b/pages/account/59.php
index e794e97..d499d35 100644
--- a/pages/account/59.php
+++ b/pages/account/59.php
@@ -117,18 +117,21 @@ while($drow = mysql_fetch_assoc($dres))
<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);
-} ?>
+if(mysql_num_rows($dres) > 0) {
+ output_log_domain_header();
+ while($drow = mysql_fetch_assoc($dres))
+ {
+ output_log_domain($drow,$email);
+ }ELSE{?>
+ <td colspan="3" ><?=_('no entry avialable')?></td>
+ <?}
+}?>
</table>
<br/>
@@ -136,9 +139,28 @@ while($drow = mysql_fetch_assoc($dres))
<tr>
<td colspan="<? $colspandefault ?>" class="title"><?=_('CATS')?></td>
</tr>
+
+<?
+$dres = get_user_agreement($userid,'',1);
+?>
+<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
<tr>
- <td colspan="<? $colspandefault ?>" class="title"><?=_('CCA')?></td>
+ <td colspan="4" class="title"><?=_('User agreements')?></td>
</tr>
+<?
+if(mysql_num_rows($dres) > 0) {
+ output_log_agreement_header();
+ while($drow = mysql_fetch_assoc($dres))
+ {
+ output_log_agreement($drow);
+ }ELSE{
+ ?><td colspan="4" ><?=_('no entry avialable')?></td><?
+ }
+}?>
+</table>
+<br/>
+
+<table>
<tr>
<td colspan="<? $colspandefault ?>" class="title"><?=_('Support Engineer actions')?></td>
</tr>