Merge branch 'release' into bug-1123 bug-1123
authorMichael Tänzer <neo@nhng.de>
Sat, 24 Aug 2013 22:46:28 +0000 (00:46 +0200)
committerMichael Tänzer <neo@nhng.de>
Sat, 24 Aug 2013 22:46:28 +0000 (00:46 +0200)
Conflicts:
includes/account.php
pages/account/10.php
pages/account/3.php
pages/gpg/0.php
www/gpg.php

Signed-off-by: Michael Tänzer <neo@nhng.de>
1  2 
includes/account.php
pages/account/10.php
pages/account/3.php
pages/gpg/0.php
www/gpg.php

@@@ -17,8 -17,7 +17,8 @@@
  */
        require_once("../includes/loggedin.php");
        require_once("../includes/lib/l10n.php");
-       require_once('lib/check_weak_key.php');
-       require_once('notary.inc.php');
+       require_once("../includes/lib/check_weak_key.php");
++      require_once("../includes/notary.inc.php");
  
        loadem("account");
  
  
  <form method="post" action="account.php">
  <? if($_SESSION['profile']['points'] >= 50) { ?>
- <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>
+ <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><?=_("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")?>"/>
 -<input type="hidden" name="oldid" value="<?=$id?>"/>
 +<textarea name="CSR" cols="80" rows="15"></textarea><br />
 +<p><input type="checkbox" name="CCA" /> <strong><?=sprintf(_("I accept the CAcert Community Agreement (%s)."),"<a href='/policy/CAcertCommunityAgreement.html'>CCA</a>")?></strong><br />
 +  <?=_("Please Note: You need to accept the CCA to proceed.")?></p>
 +<input type="submit" name="process" value="<?=_("Submit")?>" />
 +<input type="hidden" name="oldid" value="<?=$id?>" />
  </form>
@@@ -82,21 -79,21 +81,26 @@@ if($_SESSION['profile']['points'] >= 50
  <? } ?>
  
    <tr>
 -    <td class="DataTD" colspan="2" align="left">
 -      <input type="checkbox" name="login" value="1" checked="checked" /> <?=_("Enable certificate login with this certificate")?><br />
 +    <td class="DataTD">
-       <input type="checkbox" name="login" value="1" checked="checked">
++      <input type="checkbox" name="login" value="1" checked="checked" />
 +    </td>
 +    <td class="DataTD"> <?=_("Enable certificate login with this certificate")?><br />
        <?=_("By allowing certificate login, this certificate can be used to login into this account at https://secure.cacert.org/ .")?><br/>
      </td>
    </tr>
+   <tr>
+    <td class="DataTD" colspan="2" align="left">
+       <?=_("Optional comment, only used in the certifictate overview max. 100 characters")?><br />
+        <input type="text" name="description" maxlength="100" size="100" />
+    </td>
+   </tr>
  
    <tr name="expertoff" style="display:none">
 -    <td class="DataTD" colspan="2" align="left">
 -      <input type="checkbox" name="expertbox" onchange="showExpert(this.checked)"/><?=_("Show advanced options")?>
 +    <td class="DataTD">
 +      <input type="checkbox" name="expertbox" onchange="showExpert(this.checked)" />
 +    </td>
 +    <td class="DataTD">
 +      <?=_("Show advanced options")?>
      </td>
    </tr>
  
   <tr name="expert">
      <td class="DataTD" colspan="2"><textarea name="optionalCSR" cols="80" rows="5"></textarea></td>
   </tr>
 +   <tr>
 +    <td class="DataTD">
 +      <input type="checkbox" name="CCA" />
 +    </td>
 +    <td class="DataTD" align="left">
 +      <strong><?=sprintf(_("I accept the CAcert Community Agreement (%s)."),"<a href='/policy/CAcertCommunityAgreement.html'>CCA</a>")?></strong><br />
 +        <?=_("Please Note: You need to accept the CCA to proceed.")?>
 +    </td>
 +  </tr>
   <tr>
-     <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Next")?>"></td>
+     <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Next")?>" /></td>
    </tr>
  </table>
- <input type="hidden" name="oldid" value="<?=$id?>">
+ <input type="hidden" name="oldid" value="<?=$id?>" />
  </form>
  
  <script language="javascript">
diff --cc pages/gpg/0.php
  ?>
  <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 />
 +<p><input type="checkbox" name="CCA" /> <strong><?=sprintf(_("I accept the CAcert Community Agreement (%s)."),"<a href='/policy/CAcertCommunityAgreement.html'>CCA</a>")?></strong><br />
 +  <?=_("Please Note: You need to accept the CCA to proceed.")?></p>
  <input type="submit" name="process" value="<?=_("Submit")?>" />
  <input type="hidden" name="oldid" value="<?=$id?>" />
  </form>
diff --cc www/gpg.php
@@@ -284,8 -274,13 +283,15 @@@ function verifyEmail($email
  
        if($oldid == "0" && $CSR != "")
        {
 +              write_user_agreement(intval($_SESSION['profile']['id']), "CCA", "certificate creation", "", 1);
 +
+               //set variable for comment
+               if(trim($_REQUEST['description']) == ""){
+                       $description= "";
+               }else{
+                       $description= trim(mysql_real_escape_string(stripslashes($_REQUEST['description'])));
+               }
                $query = "insert into `gpg` set `memid`='".intval($_SESSION['profile']['id'])."',
                                                `email`='".mysql_real_escape_string($lastvalidemail)."',
                                                `level`='1',