summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorINOPIAE <inopiae@cacert.org>2012-11-21 09:22:53 +0100
committerINOPIAE <inopiae@cacert.org>2012-11-21 09:22:53 +0100
commitf4838bd359669c262faa0d7c145e3ee64718cca6 (patch)
tree512845fc0006df883d578d34284e5e2ffb0ddcbd
parentef4fa3cf7a767df0813577cf920e9a51939d452a (diff)
downloadcacert-devel-f4838bd359669c262faa0d7c145e3ee64718cca6.tar.gz
cacert-devel-f4838bd359669c262faa0d7c145e3ee64718cca6.tar.xz
cacert-devel-f4838bd359669c262faa0d7c145e3ee64718cca6.zip
bug 782: Update routine for description in includes/account.php, new view in pages/account/6.php, small changes in pages/account/5.php
-rw-r--r--includes/account.php17
-rw-r--r--pages/account/5.php17
-rw-r--r--pages/account/6.php89
3 files changed, 113 insertions, 10 deletions
diff --git a/includes/account.php b/includes/account.php
index 0b7bf85..07b93b6 100644
--- a/includes/account.php
+++ b/includes/account.php
@@ -1155,6 +1155,23 @@
}
+ if($oldid == 6 && $_REQUEST['certid'] != "")
+ {
+ if(trim($_REQUEST['description']) != ""){
+ $description= trim(mysql_real_escape_string(stripslashes($_REQUEST['description'])));
+ }else{
+ $description= "";
+ }
+ }
+ if(trim($_REQUEST['disablelogin']) == "1"){
+ $disablelogin = 1;
+ }else{
+ $disablelogin = 0;
+ }
+ }
+ mysql_query("update `emailcerts` set `disablelogin`='$disablelogin', `description`='description' where `id`='".$_REQUEST['certid']."' and `memid`='".$_SESSION['profile']['id']."'");
+
+ }
if($oldid == 13 && $process != "")
{
csrf_check("perschange");
diff --git a/pages/account/5.php b/pages/account/5.php
index 206a149..f8e9190 100644
--- a/pages/account/5.php
+++ b/pages/account/5.php
@@ -29,7 +29,7 @@
<td class="DataTD"><?=_("Revoked")?></td>
<td class="DataTD"><?=_("Expires")?></td>
<td class="DataTD"><?=_("Login")?></td>
- <td colspan="2" class="DataTD"><?=_("Comment *")?></td>
+ <td class="DataTD"><?=_("Comment *")?></td>
<?
$query = "select UNIX_TIMESTAMP(`emailcerts`.`created`) as `created`,
UNIX_TIMESTAMP(`emailcerts`.`expire`) - UNIX_TIMESTAMP() as `timeleft`,
@@ -57,7 +57,7 @@
{
?>
<tr>
- <td colspan="9" class="DataTD"><?=_("No client certificates are currently listed.")?></td>
+ <td colspan="8" class="DataTD"><?=_("No client certificates are currently listed.")?></td>
</tr>
<? } else {
while($row = mysql_fetch_assoc($res))
@@ -94,21 +94,18 @@
<input type="checkbox" name="disablelogin_<?=$row['id']?>" value="1" <?=$row['disablelogin']?"":"checked='checked'"?>/>
<input type="hidden" name="cert_<?=$row['id']?>" value="1"/>
</td>
- <td class="DataTD"><textarea name="description_<?=$row['id']?>" cols="50" rows="2"><?=htmlspecialchars($row['description'])?></textarea></td>
- <td class="DataTD">
- <input type="submit" name="descriptionsave_<?=$row['id']?>" value="<?=_("Save comment")?>">
- </td>
+ <td class="DataTD"><?=htmlspecialchars($row['description'])?></td>
</tr>
<? } ?>
<tr>
- <td class="DataTD" colspan="9">
+ <td class="DataTD" colspan="8">
<a href="account.php?id=5&amp;viewall=<?=!$viewall?>"><b><?=$viewall?_("Hide old certificates"):_("View all certificates")?></b></a>
</td>
</tr>
<tr>
- <td class="DataTD" colspan="9">
- <?=_("* Comment optional with max length of 100 characters. The comment is NOT included in the certificate as it is inteded for your personal reference only.. Save each comment seperately.")?>
+ <td class="DataTD" colspan="8">
+ <?=_("* Comment is NOT included in the certificate as it is inteded for your personal reference only. To change the comment go to the certificate view with hitting email address.")?>
</td>
</tr>
@@ -116,7 +113,7 @@
<td class="DataTD" colspan="5"><input type="submit" name="renew" value="<?=_("Renew")?>">&#160;&#160;&#160;&#160;
<input type="submit" name="revoke" value="<?=_("Revoke/Delete")?>"></td>
- <td class="DataTD" colspan="4"><input type="submit" name="change" value="<?=_("Change settings")?>"> </td>
+ <td class="DataTD" colspan="3"><input type="submit" name="change" value="<?=_("Change settings")?>"> </td>
</tr>
<? } ?>
diff --git a/pages/account/6.php b/pages/account/6.php
index 38af8e8..e76ef06 100644
--- a/pages/account/6.php
+++ b/pages/account/6.php
@@ -19,6 +19,23 @@
$certid = 0; if(array_key_exists('cert',$_REQUEST)) $certid=intval($_REQUEST['cert']);
$query = "select * from `emailcerts` where `id`='$certid' and `memid`='".intval($_SESSION['profile']['id'])."'";
+ $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`.`revoked` as `revoke`,
+ UNIX_TIMESTAMP(`emailcerts`.`revoked`) as `revoked`,
+ `emailcerts`.`id`,
+ `emailcerts`.`CN`,
+ `emailcerts`.`serial`,
+ emailcerts.disablelogin as `disablelogin`,
+ `emailcerts`.`crt_name`,
+ `emailcerts`.`keytype`,
+ `emailcerts`.`description`
+ from `emailcerts`
+ where `emailcerts`.`id`='$certid' and `emailcerts`.`memid`='".intval($_SESSION['profile']['id'])."'";
+
+
$res = mysql_query($query);
if(mysql_num_rows($res) <= 0)
{
@@ -134,3 +151,75 @@
}
?>
+<form method="post" action="account.php">
+<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
+ <tr>
+ <td colspan="2" class="title"><?=_("Information about the certificte")?></td>
+ </tr>
+<?
+ $res = mysql_query($query);
+ if(mysql_num_rows($res) > 0)
+ {
+ while($row = mysql_fetch_assoc($res))
+ {
+ if($row['timeleft'] > 0)
+ $verified = _("Valid");
+ if($row['timeleft'] < 0)
+ $verified = _("Expired");
+ if($row['expired'] == 0)
+ $verified = _("Pending");
+ if($row['revoked'] > 0)
+ $verified = _("Revoked");
+ if($row['revoked'] == 0)
+ $row['revoke'] = _("Not Revoked");
+?>
+ <tr>
+ <td class="DataTD"><?=_("Renew/Revoke/Delete")?></td>
+<? if($verified != _("Pending") && $verified != _("Revoked")) { ?>
+ <td class="DataTD"><input type="checkbox" name="revokeid[]" value="<?=$row['id']?>"></td>
+<? } else if($verified != _("Revoked")) { ?>
+ <td class="DataTD"><input type="checkbox" name="delid[]" value="<?=$row['id']?>"></td>
+<? } else { ?>
+ <td class="DataTD">&nbsp;</td>
+<? } ?>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Status")?></td>
+ <td class="DataTD"><?=$verified?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Email Address")?></td>
+ <td class="DataTD"><?=(trim($row['CN'])=="" ? _("empty") : $row['CN'])?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("SerialNumber")?></td>
+ <td class="DataTD"><?=$row['serial']?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Revoked")?></td>
+ <td class="DataTD"><?=$row['revoke']?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Expires")?></td>
+ <td class="DataTD"><?=$row['revoke']?></td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Login")?></td>
+ <td class="DataTD">
+ <input type="checkbox" name="disablelogin" value="1" <?=$row['disablelogin']?"":"checked='checked'"?>/>
+ </td>
+ </tr>
+ <tr>
+ <td class="DataTD"><?=_("Comment")?></td>
+ <td class="DataTD"><input type="text" name="description" maxlength="100" size=100 value="<?=htmlspecialchars($row['description'])?>"></td>
+ </tr>
+ <? } ?>
+ <tr>
+ <td class="DataTD" colspan="2"><input type="submit" name="change" value="<?=_("Change settings")?>"> </td>
+
+ </tr>
+<? } ?>
+</table>
+<input type="hidden" name="oldid" value="6">
+<input type="hidden" name="certid" value="<?=$certid?>">
+</form>