bug 782: Added a comment field to all certificate pages
authorINOPIAE <inopiae@cacert.org>
Sun, 11 Nov 2012 19:14:15 +0000 (20:14 +0100)
committerBenny Baumann <BenBE@geshi.org>
Mon, 12 Nov 2012 00:26:38 +0000 (01:26 +0100)
12 files changed:
includes/account.php
pages/account/10.php
pages/account/12.php
pages/account/16.php
pages/account/18.php
pages/account/20.php
pages/account/22.php
pages/account/3.php
pages/account/5.php
pages/gpg/0.php
pages/gpg/2.php
www/gpg.php

index 4faa0e5..2f57bf9 100644 (file)
@@ -17,7 +17,6 @@
 */
        require_once("../includes/loggedin.php");
        require_once("../includes/lib/l10n.php");
-       require_once('lib/check_weak_key.php');
 
        loadem("account");
 
                        exit;
                }
                $row = mysql_fetch_assoc($res);
-               $body  = sprintf(_("Hi %s,"),$_SESSION['profile']['fname'])."\n\n";
-               $body .= _("You are receiving this email because you or someone else ".
-                               "has changed the default email on your account.")."\n\n";
+               $body  = sprintf(_("Hi %s,"),$_SESSION['profile']['fname'])."\n";
+               $body .= _("You are receiving this email because you or someone else")."\n";
+               $body .= _("has changed the default email on your account.")."\n\n";
 
                $body .= _("Best regards")."\n"._("CAcert.org Support!");
 
                        $_REQUEST['keytype'] = "MS";
                        $csr = clean_csr($_REQUEST['optionalCSR']);
                }
+               if(trim($_REQUEST['description']) == ""){
+       $_SESSION['_config']['description']= trim(mysql_real_escape_string(stripslashes($_REQUEST['description'])));
+    }else{
+       $_SESSION['_config']['description']= "";
+    }
        }
 
        if($oldid == 4)
                                                `created`=FROM_UNIXTIME(UNIX_TIMESTAMP()),
                                                `codesign`='".intval($_SESSION['_config']['codesign'])."',
                                                `disablelogin`='".($_SESSION['_config']['disablelogin']?1:0)."',
-                                               `rootcert`='".intval($_SESSION['_config']['rootcert'])."'";
+                                               `rootcert`='".intval($_SESSION['_config']['rootcert'])."', 
+                                               `description`='".intval($_SESSION['_config']['description'])."'";
                        mysql_query($query);
                        $emailid = mysql_insert_id();
                        if(is_array($addys))
                                                `created`=FROM_UNIXTIME(UNIX_TIMESTAMP()),
                                                `subject`='".mysql_real_escape_string($csrsubject)."',
                                                `codesign`='".$_SESSION['_config']['codesign']."',
-                                               `rootcert`='".$_SESSION['_config']['rootcert']."'";
+                                               `rootcert`='".$_SESSION['_config']['rootcert']."', 
+                                               `description`='".intval($_SESSION['_config']['description'])."'";
                        mysql_query($query);
                        $emailid = mysql_insert_id();
                        if(is_array($addys))
                                {
                                        $row = mysql_fetch_assoc($res);
                                        echo $row['domain']."<br>\n";
-                                       
-                                       $dres = mysql_query(
-                                               "select distinct `domaincerts`.`id`
-                                                       from `domaincerts`, `domlink`
-                                                       where `domaincerts`.`domid` = '$id'
-                                                       or (
-                                                               `domaincerts`.`id` = `domlink`.`certid`
-                                                               and `domlink`.`domid` = '$id'
-                                                               )");
+                                       mysql_query("update `domains` set `deleted`=NOW() where `id`='$id'");
+                                       $dres = mysql_query("select * from `domlink` where `domid`='$id'");
                                        while($drow = mysql_fetch_assoc($dres))
-                                       {
-                                               mysql_query(
-                                                       "update `domaincerts`
-                                                               set `revoked`='1970-01-01 10:00:01'
-                                                               where `id` = '".$drow['id']."'
-                                                               and `revoked` = 0
-                                                               and UNIX_TIMESTAMP(`expire`) -
-                                                                               UNIX_TIMESTAMP() > 0");
-                                       }
-                                       
-                                       mysql_query(
-                                               "update `domains`
-                                                       set `deleted`=NOW()
-                                                       where `id` = '$id'");
+                                               mysql_query("update `domaincerts` set `revoked`='1970-01-01 10:00:01' where `id`='".$drow['certid']."' and `revoked`=0 and UNIX_TIMESTAMP(`expire`)-UNIX_TIMESTAMP() > 0");
                                }
                        }
                }
                        exit;
                }
                
+               if(trim($_REQUEST['description']) == ""){
+       $_SESSION['_config']['description']= trim(mysql_real_escape_string(stripslashes($_REQUEST['description'])));
+    }else{
+       $_SESSION['_config']['description']= "";
+    }
+    
                $_SESSION['_config']['tmpfname'] = tempnam("/tmp", "id10CSR");
                $fp = fopen($_SESSION['_config']['tmpfname'], "w");
                fputs($fp, $CSR);
                                                `CN`='".mysql_real_escape_string($_SESSION['_config']['rows']['0'])."',
                                                `domid`='".mysql_real_escape_string($_SESSION['_config']['rowid']['0'])."',
                                                `created`=NOW(),`subject`='".mysql_real_escape_string($subject)."',
-                                               `rootcert`='".mysql_real_escape_string($_SESSION['_config']['rootcert'])."'";
+                                               `rootcert`='".mysql_real_escape_string($_SESSION['_config']['rootcert'])."', 
+                                               `description`='".intval($_SESSION['_config']['description'])."'";
                } elseif(array_key_exists('0',$_SESSION['_config']['altid']) && $_SESSION['_config']['altid']['0'] > 0) {
                        $query = "insert into `domaincerts` set 
                                                `CN`='".mysql_real_escape_string($_SESSION['_config']['altrows']['0'])."',
                                                `domid`='".mysql_real_escape_string($_SESSION['_config']['altid']['0'])."',
                                                `created`=NOW(),`subject`='".mysql_real_escape_string($subject)."',
-                                               `rootcert`='".mysql_real_escape_string($_SESSION['_config']['rootcert'])."'";
+                                               `rootcert`='".mysql_real_escape_string($_SESSION['_config']['rootcert'])."', 
+                                               `description`='".intval($_SESSION['_config']['description'])."'";
                } else {
                        showheader(_("My CAcert.org Account!"));
                        echo _("Domain not verified.");
                                                `modified`=NOW(), 
                                                `rootcert`='".$row['rootcert']."',
                                                `type`='".$row['type']."',
-                                               `pkhash`='".$row['pkhash']."'";
+                                               `pkhash`='".$row['pkhash']."', 
+                                               `description`='".$row['description']."'";
                                mysql_query($query);
                                $newid = mysql_insert_id();
                                $newfile=generatecertpath("csr","server",$newid);
                                                `modified`=NOW(),
                                                `disablelogin`='".$row['disablelogin']."',
                                                `codesign`='".$row['codesign']."',
-                                               `rootcert`='".$row['rootcert']."'";
+                                               `rootcert`='".$row['rootcert']."', 
+                                               `description`='".$row['description']."'";
                                mysql_query($query);
                                $newid = mysql_insert_id();
                                $newfile=generatecertpath("csr","client",$newid);
                                                where `id`='".$_SESSION['profile']['id']."'");
                                echo '<h3>', _("Pass Phrase Changed Successfully"), '</h3>', "\n";
                                echo _("Your Pass Phrase has been updated and your primary email account has been notified of the change.");
-                               $body  = sprintf(_("Hi %s,"),$_SESSION['profile']['fname'])."\n\n";
-                               $body .= _("You are receiving this email because you or someone else ".
-                                               "has changed the password on your account.")."\n\n";
+                               $body  = sprintf(_("Hi %s,"),$_SESSION['profile']['fname'])."\n";
+                               $body .= _("You are receiving this email because you or someone else")."\n";
+                               $body .= _("has changed the password on your account.")."\n";
 
                                $body .= _("Best regards")."\n"._("CAcert.org Support!");
 
                }
                $_SESSION['_config']['name'] = mysql_real_escape_string(stripslashes(trim($_REQUEST['name'])));
                $_SESSION['_config']['OU'] = mysql_real_escape_string(stripslashes(trim($_REQUEST['OU'])));
+               
+      
+    if(trim($_REQUEST['description']) == ""){
+        $_SESSION['_config']['description']= trim(mysql_real_escape_string(stripslashes($_REQUEST['description'])));
+    }else{
+        $_SESSION['_config']['description']= "";
+    }
        }
 
        if($oldid == 16 && (intval(count($_SESSION['_config']['emails'])) + 0) <= 0)
                if($_SESSION['_config']['rootcert'] < 1 || $_SESSION['_config']['rootcert'] > 2)
                        $_SESSION['_config']['rootcert'] = 1;
 
+    if(trim($_REQUEST['description']) == ""){
+        $_SESSION['_config']['description']= trim(mysql_real_escape_string(stripslashes($_REQUEST['description'])));
+    }else{
+        $_SESSION['_config']['description']= "";
+    }
+      
                if(@count($_SESSION['_config']['emails']) > 0)
                        $id = 17;
        }
                                $emails .= "countryName = ".$org['C']."\n";
                        if($_SESSION['_config']['rootcert'] < 1 || $_SESSION['_config']['rootcert'] > 2)
                                $_SESSION['_config']['rootcert'] = 1;
-
+      
+      
                        $emails .= "SPKAC = $spkac";
                        if (($weakKey = checkWeakKeySPKAC($emails)) !== "")
                        {
                                                `orgid`='".$org['orgid']."',
                                                `created`=FROM_UNIXTIME(UNIX_TIMESTAMP()),
                                                `codesign`='".$_SESSION['_config']['codesign']."',
-                                               `rootcert`='".$_SESSION['_config']['rootcert']."'";
+                                               `rootcert`='".$_SESSION['_config']['rootcert']."', 
+                                               `description`='".intval($_SESSION['_config']['description'])."'";
                        mysql_query($query);
                        $emailid = mysql_insert_id();
 
                                                `created`=FROM_UNIXTIME(UNIX_TIMESTAMP()),
                                                `subject`='$csrsubject',
                                                `codesign`='".$_SESSION['_config']['codesign']."',
-                                               `rootcert`='".$_SESSION['_config']['rootcert']."'";
+                                               `rootcert`='".$_SESSION['_config']['rootcert'].."', 
+                                               `description`='".intval($_SESSION['_config']['description'])."'";
                        mysql_query($query);
                        $emailid = mysql_insert_id();
 
                                                `created`='".$row['created']."', 
                                                `modified`=NOW(),
                                                `codesign`='".$row['codesign']."',
-                                               `rootcert`='".$row['rootcert']."'";
+                                               `rootcert`='".$row['rootcert']."', 
+                                               `description`='".$row['description']."'";
                                mysql_query($query);
                                $newid = mysql_insert_id();
                                $newfile=generatecertpath("csr","orgclient",$newid);
                        exit;
                }
                
+               if(trim($_REQUEST['description']) == ""){
+       $_SESSION['_config']['description']= trim(mysql_real_escape_string(stripslashes($_REQUEST['description'])));
+    }else{
+       $_SESSION['_config']['description']= "";
+    }
+    
                $_SESSION['_config']['tmpfname'] = tempnam("/tmp", "id20CSR");
                $fp = fopen($_SESSION['_config']['tmpfname'], "w");
                fputs($fp, $CSR);
                                                 `created`=NOW(),
                                                `subject`='$csrsubject',
                                                `rootcert`='".$_SESSION['_config']['rootcert']."',
-                                               `type`='$type'";
+                                               `type`='$type', 
+                                               `description`='".intval($_SESSION['_config']['description'])."'";
                 }
                 mysql_query($query);
                $CSRid = mysql_insert_id();
                                                `modified`=NOW(), 
                                                `subject`='".$row['subject']."', 
                                                `type`='".$row['type']."',
-                                               `rootcert`='".$row['rootcert']."'";
+                                               `rootcert`='".$row['rootcert']."', 
+                                               `description`='".$row['description']."'";
                                mysql_query($query);
                                $newid = mysql_insert_id();
                                //echo "NewID: $newid<br/>\n";
                        $row = mysql_fetch_assoc($res);
                        if ( !is_assurer(intval($row['id'])) )
                        {
-                               $id = $oldid;\r
-                               $oldid=0;\r
+                               $id = $oldid;
+                               $oldid=0;
                                $_SESSION['_config']['errmsg'] =
                                                _("The user is not an Assurer yet");
                        } else {
                        printf(_("The password for %s has been updated successfully in the system."), sanitizeHTML($row['email']));
 
 
-                       $body  = sprintf(_("Hi %s,"),$row['fname'])."\n\n";
-                       $body .= _("You are receiving this email because a CAcert administrator ".
-                                       "has changed the password on your account.")."\n\n";
+                       $body  = sprintf(_("Hi %s,"),$row['fname'])."\n";
+                       $body .= _("You are receiving this email because a CAcert administrator")."\n";
+                       $body .= _("has changed the password on your account.")."\n";
 
                        $body .= _("Best regards")."\n"._("CAcert.org Support!");
 
index 704a05c..f5527ab 100644 (file)
@@ -34,6 +34,8 @@
 <input type="radio" name="rootcert" value="2" checked> <?=_("Sign by class 3 root certificate")?><br>
 <p><?=_("Please note: The class 3 root certificate needs to be setup in your webserver as a chained certificate, while slightly more complicated to setup, this root certificate is more likely to be trusted by more people.")?></p>
 <? } ?>
+<p> <?=_("Optional comment, only used in the certifictate overview")?><br>
+       <input type="text" name="description" maxlength="80" size=80></p>
 <p><?=_("Paste your CSR(Certificate Signing Request) below...")?></p>
 <textarea name="CSR" cols="80" rows="15"></textarea><br>
 <input type="submit" name="process" value="<?=_("Submit")?>">
index 44926ca..35ae6c2 100644 (file)
@@ -25,7 +25,8 @@
     <td class="DataTD"><?=_("Renew/Revoke/Delete")?></td>
     <td class="DataTD"><?=_("Status")?></td>
     <td class="DataTD"><?=_("CommonName")?></td>
-       <td class="DataTD"><?=_("SerialNumber")?></td>
+         <td class="DataTD"><?=_("SerialNumber")?></td>
+         <td class="DataTD"><?=_("Comment")?></td>
     <td class="DataTD"><?=_("Revoked")?></td>
     <td class="DataTD"><?=_("Expires")?></td>
   </tr>
@@ -34,7 +35,8 @@
                        UNIX_TIMESTAMP(`domaincerts`.`expire`) - UNIX_TIMESTAMP() as `timeleft`,
                        UNIX_TIMESTAMP(`domaincerts`.`expire`) as `expired`,
                        `domaincerts`.`expire` as `expires`, `revoked` as `revoke`,
-                       UNIX_TIMESTAMP(`revoked`) as `revoked`, `CN`, `domaincerts`.`serial`, `domaincerts`.`id` as `id`
+                       UNIX_TIMESTAMP(`revoked`) as `revoked`, `CN`, `domaincerts`.`serial`, `domaincerts`.`id` as `id`,
+                       `domaincerts`.`description`
                        from `domaincerts`,`domains`
                        where `memid`='".intval($_SESSION['profile']['id'])."' and `deleted`=0 and `domaincerts`.`domid`=`domains`.`id` ";
        if($viewall != 1)
@@ -75,7 +77,8 @@
 <? } ?>
     <td class="DataTD"><?=$verified?></td>
     <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['serial']?></td>
+               <td class="DataTD"><?=$row['description']?></td>
     <td class="DataTD"><?=$row['revoke']?></td>
     <td class="DataTD"><?=$row['expires']?></td>
   </tr>
index 514ecfd..338878d 100644 (file)
     <td class="DataTD" colspan="2" align="left"><input type="checkbox" name="codesign" value="1" /><?=_("Code Signing")?></td>
   </tr>
 <? } ?>
+   <tr>
+   <td class="DataTD" colspan="2" align="left">
+      <?=_("Optional comment, only used in the certifictate overview")?><br>
+       <input type="text" name="description" maxlength="80" size=80>
+   </td>
+  </tr>
   <tr>
     <td class="DataTD" colspan="2"><input type="submit" name="add_email" value="<?=_("Another Email")?>">
                        <input type="submit" name="process" value="<?=_("Next")?>"></td>
index 13dcc30..45e3be9 100644 (file)
@@ -25,7 +25,8 @@
     <td class="DataTD"><?=_("Renew/Revoke/Delete")?></td>
     <td class="DataTD"><?=_("Status")?></td>
     <td class="DataTD"><?=_("CommonName")?></td>
-       <td class="DataTD"><?=_("SerialNumber")?></td>
+         <td class="DataTD"><?=_("SerialNumber")?></td>
+               <td class="DataTD"><?=_("Comment")?></td>
     <td class="DataTD"><?=_("Revoked")?></td>
     <td class="DataTD"><?=_("Expires")?></td>
 
@@ -35,7 +36,8 @@
                        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`.`CN`, `oemail`.`serial`, `oemail`.`id`,
+                       `oemail`.`description`
                        from `orgemailcerts` as `oemail`, `org`
                        where `org`.`memid`='".intval($_SESSION['profile']['id'])."' and
                                `org`.`orgid`=`oemail`.`orgid` ";
@@ -80,7 +82,8 @@
     <td class="DataTD"><?=$verified?></td>
     <td class="DataTD"><a href="account.php?id=19&cert=<?=$row['id']?>"><?=$row['CN']?></a></td>
 <? } ?>
-       <td class="DataTD"><?=$row['serial']?></td>
+         <td class="DataTD"><?=$row['serial']?></td>
+               <td class="DataTD"><?=$row['description']?></td>
     <td class="DataTD"><?=$row['revoke']?></td>
     <td class="DataTD"><?=$row['expires']?></td>
   </tr>
index 510b708..5e91e77 100644 (file)
 <form method="post" action="account.php">
 <input type="radio" name="rootcert" value="1"> <?=_("Sign by class 1 root certificate")?><br>
 <input type="radio" name="rootcert" value="2" checked> <?=_("Sign by class 3 root certificate")?><br>
+<p> <?=_("Optional comment, only used in the certifictate overview")?><br>
+       <input type="text" name="description" maxlength="80" size=80></p>
 <p><?=_("Please note: The class 3 root certificate needs to be setup in your webserver as a chained certificate, while slightly more complicated to setup, this root certificate is more likely to be trusted by more people.")?></p>
 <p><?=_("Paste your CSR below...")?></p>
-<textarea name="CSR" cols="80" rows="15"></textarea><br>
+<textarea name="CSR" cols="80" rows="15"></textarea><br> 
 <input type="submit" name="process" value="<?=_("Submit")?>">
 <input type="hidden" name="oldid" value="<?=$id?>">
 </form>
index 9df8200..ac7a645 100644 (file)
@@ -25,7 +25,8 @@
     <td class="DataTD"><?=_("Renew/Revoke/Delete")?></td>
     <td class="DataTD"><?=_("Status")?></td>
     <td class="DataTD"><?=_("CommonName")?></td>
-       <td class="DataTD"><?=_("SerialNumber")?></td>
+         <td class="DataTD"><?=_("SerialNumber")?></td>
+               <td class="DataTD"><?=_("Comment")?></td>
     <td class="DataTD"><?=_("Revoked")?></td>
     <td class="DataTD"><?=_("Expires")?></td>
 
@@ -36,7 +37,8 @@
                        `orgdomaincerts`.`expire` as `expires`, `revoked` as `revoke`,
                        UNIX_TIMESTAMP(`revoked`) as `revoked`, `CN`,
                        `orgdomaincerts`.`serial`,
-                        `orgdomaincerts`.`id` as `id`
+                       `orgdomaincerts`.`id` as `id`,
+                       `orgdomaincerts`.`description`
                        from `orgdomaincerts`,`org`
                        where `org`.`memid`='".intval($_SESSION['profile']['id'])."' and `orgdomaincerts`.`orgid`=`org`.`orgid` ";
        if($viewall != 1)
@@ -77,7 +79,8 @@
 <? } ?>
     <td class="DataTD"><?=$verified?></td>
     <td class="DataTD"><a href="account.php?id=23&cert=<?=$row['id']?>"><?=$row['CN']?></a></td>
-       <td class="DataTD"><?=$row['serial']?></td>
+         <td class="DataTD"><?=$row['serial']?></td>
+               <td class="DataTD"><?=$row['description']?></td>
     <td class="DataTD"><?=$row['revoke']?></td>
     <td class="DataTD"><?=$row['expires']?></td>
   </tr>
index 5590488..b2e3184 100644 (file)
@@ -53,6 +53,12 @@ if($_SESSION['profile']['points'] >= 50)
        $suffix = $_SESSION['profile']['suffix'];
 ?>
   <tr>
+   <td class="DataTD" colspan="2" align="left">
+      <?=_("Optional comment, only used in the certifictate overview")?><br>
+       <input type="text" name="description" maxlength="80" size=80>
+   </td>
+  </tr>
+  <tr>
     <td class="DataTD" colspan="2" align="left">
        <input type="radio" name="rootcert" value="1" checked> <?=_("Sign by class 1 root certificate")?><br>
        <input type="radio" name="rootcert" value="2"> <?=_("Sign by class 3 root certificate")?><br>
index 5c131ba..539f237 100644 (file)
@@ -25,7 +25,8 @@
     <td class="DataTD"><?=_("Renew/Revoke/Delete")?></td>
     <td class="DataTD"><?=_("Status")?></td>
     <td class="DataTD"><?=_("Email Address")?></td>
-       <td class="DataTD"><?=_("SerialNumber")?></td>
+         <td class="DataTD"><?=_("SerialNumber")?></td>
+         <td class="DataTD"><?=_("Comment")?></td>
     <td class="DataTD"><?=_("Revoked")?></td>
     <td class="DataTD"><?=_("Expires")?></td>
     <td class="DataTD"><?=_("Login")?></td>
@@ -40,8 +41,9 @@
                        `emailcerts`.`id`,
                        `emailcerts`.`CN`,
                        `emailcerts`.`serial`,
-                       emailcerts.disablelogin as `disablelogin`
-                       from `emailcerts`
+                       emailcerts.disablelogin as `disablelogin`,
+                       `emailcerts`.`description`
+                       from `emailcerts`
                        where `emailcerts`.`memid`='".$_SESSION['profile']['id']."'
                        ";
        if($viewall != 1)
@@ -86,7 +88,8 @@
     <td class="DataTD"><?=$verified?></td>
     <td class="DataTD"><?=(trim($row['CN'])=="" ? _("empty") : $row['CN'])?></td>
 <? } ?>
-       <td class="DataTD"><?=$row['serial']?></td>
+         <td class="DataTD"><?=$row['serial']?></td>
+               <td class="DataTD"><?=$row['description']?></td>
     <td class="DataTD"><?=$row['revoke']?></td>
     <td class="DataTD"><?=$row['expires']?></td>
     <td class="DataTD">
index ce3b72a..319c2f9 100644 (file)
@@ -19,6 +19,8 @@
 ?>
 <p><?=_("Paste your own public OpenPGP key below. It should not contain a picture. CAcert will sign your key after submission.")?></p>
 <form method="post" action="gpg.php">
+<p> <?=_("Optional comment, only used in the certifictate overview")?><br>
+       <input type="text" name="description" maxlength="80" size=80></p>
 <textarea name="CSR" cols="80" rows="15"><?=array_key_exists('CSR',$_POST)?strip_tags($_POST['CSR']):""?></textarea><br>
 <input type="submit" name="process" value="<?=_("Submit")?>">
 <input type="hidden" name="oldid" value="<?=$id?>">
index e10935e..fd26367 100644 (file)
     <td class="DataTD"><?=_("Email Address")?></td>
     <td class="DataTD"><?=_("Expires")?></td>
     <td class="DataTD"><?=_("Key ID")?></td>
-
+    <td class="DataTD"><?=_("Comment")?></td>
 <?
        $query = "select UNIX_TIMESTAMP(`issued`) as `issued`,
                        UNIX_TIMESTAMP(`expire`) - UNIX_TIMESTAMP() as `timeleft`,
                        UNIX_TIMESTAMP(`expire`) as `expired`,
                        `expire` as `expires`, `id`, `level`, 
-                       `email`,`keyid` from `gpg` where `memid`='".intval($_SESSION['profile']['id'])."'
+                       `email`,`keyid`,`description` from `gpg` where `memid`='".intval($_SESSION['profile']['id'])."'
                        ORDER BY `issued` desc";
        $res = mysql_query($query);
        if(mysql_num_rows($res) <= 0)
@@ -62,7 +62,7 @@
 <? } ?>
     <td class="DataTD"><?=$row['expires']?></td>
     <td class="DataTD"><a href="gpg.php?id=3&amp;cert=<?=$row['id']?>"><?=$row['keyid']?></a></td>
-
+    <td class="DataTD"><?=$row['description']?></td>
   </tr>
 <? } ?>
 <? } ?>
index 345b559..fcc0742 100644 (file)
@@ -248,6 +248,12 @@ function verifyEmail($email)
                        $resulttable.="</tr>\n";
 
                        if($emailok) $multiple++;
+                       
+                       if(trim($_REQUEST['description']) == ""){
+       $description= trim(mysql_real_escape_string(stripslashes($_REQUEST['description'])));
+      }else{
+       $description= "";
+      }
                }
                $resulttable.="</table>";
 
@@ -280,7 +286,8 @@ function verifyEmail($email)
                                                `level`='1',
                                                `expires`='".mysql_real_escape_string($expires)."',
                                                `multiple`='".mysql_real_escape_string($multiple)."',
-                                               `keyid`='".mysql_real_escape_string($keyid)."'";
+                                               `keyid`='".mysql_real_escape_string($keyid)."', 
+                                               `description`='".mysql_real_escape_string($description)."'";
                mysql_query($query);
                $id = mysql_insert_id();