Code

Added certificate acls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Jul 2006 07:01:34 +0000 (07:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Jul 2006 07:01:34 +0000 (07:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4220 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/generic/class_user.inc
plugins/personal/generic/generic_certs.tpl

index 06d7605f3d64ccc09837547740976ecb8e52d813..be511d51ce32eef21673f09f132b8687b9fca8c9 100644 (file)
@@ -154,6 +154,8 @@ class user extends plugin
         $this->base= dn2base($dn);
       }
 
+      echo $this->base;
+
       /* get password storage type */
       if (isset ($this->attrs['userPassword'][0])){
        /* Initialize local array */
@@ -357,7 +359,7 @@ class user extends plugin
 
 
     /* Want certificate= */
-    if (isset($_POST['edit_cert'])){
+    if ((isset($_POST['edit_cert'])) && $this->acl_is_readable("Certificate")){
 
       /* Save original values for later reconstruction */
       foreach (array("certificateSerialNumber", "userCertificate",
@@ -446,6 +448,9 @@ class user extends plugin
 
     /* Display cert dialog */
     if ($this->cert_dialog){
+      $smarty->assign("CertificateACL",$this->getacl("Certificate"));
+      $smarty->assign("Certificate_readable",$this->acl_is_readable("Certificate"));
+
       foreach(array("userCertificate", "userSMIMECertificate", "userPKCS12") as $cert){
         if ($this->$cert != ""){
           /* import certificate */
index f39a4e174f740aed6ef7e0fe97823b502f316b27..0b5e7597c5dab950cca156093f988c6a14cd3f9b 100644 (file)
@@ -7,15 +7,20 @@
    <td width="12%" style="vertical-align:top">
       {t}Standard certificate{/t}
    </td>
+  
    <td style="vertical-align:top">
-        <LABEL for="userCertificate_file">{$userCertificateinfo}</LABEL>
+        <LABEL for="userCertificate_file">{if $Certificate_readable}{$userCertificateinfo}{/if}</LABEL>
         </td>
         <td style="vertical-align:top;text-align:right">
         {if $userCertificate_state ne "true"}
+       {render acl=$CertificateACL}
      <input id="userCertificate_file" name="userCertificate_file" type="file" size="20" maxlength="255" accept="text/*.*">
+       {/render}
      {else}
+       {render acl=$CertificateACL}
      <input type=submit name="remove_userCertificate" value="{t}Remove{/t}">
-        {/if}
+       {/render}
+     {/if}
    </td>
  </tr>
  </table>
       {t}S/MIME certificate{/t} 
    </td>
    <td style="vertical-align:top">
-     <LABEL for="userSMIMECertificate_file">{$userSMIMECertificateinfo}</LABEL>
+     <LABEL for="userSMIMECertificate_file">{if $Certificate_readable}{$userSMIMECertificateinfo}{/if}</LABEL>
    </td>
    <td style="vertical-align:top;text-align:right">
         {if $userSMIMECertificate_state ne "true"}
+       {render acl=$CertificateACL}
      <input id="userSMIMECertificate_file" name="userSMIMECertificate_file" type="file" size="20" maxlength="255" accept="text/*.*">
+       {/render}
      {else}
+       {render acl=$CertificateACL}
      <input type=submit name="remove_userSMIMECertificate" value="{t}Remove{/t}">
+       {/render}
         {/if}
    </td>
  </tr>
       {t}PKCS12 certificate{/t} 
    </td>
    <td style="vertical-align:top">
-     <LABEL for="userPKCS12_file">{$userPKCS12info}</LABEL>
+     <LABEL for="userPKCS12_file">{if $Certificate_readable}{$userPKCS12info}{/if}</LABEL>
    </td>
    <td style="vertical-align:top;text-align:right">
         {if $userPKCS12_state ne "true"}
+       {render acl=$CertificateACL}
      <input id="userPKCS12_file" name="userPKCS12_file" type="file" size="20" maxlength="255" accept="text/*.*">
+       {/render}
         {else}
+       {render acl=$CertificateACL}
      <input type=submit name="remove_userPKCS12" value="{t}Remove{/t}">
+       {/render}
         {/if}
    </td>
  </tr>
      <LABEL for="certificateSerialNumber">{t}Certificate serial number{/t}</LABEL>
    </td>
    <td>
-     <input id="certificateSerialNumber" name="certificateSerialNumber" size=10 maxlength=20 {$certificateSerialNumberACL}
-            value="{$certificateSerialNumber}">
+       {render acl=$CertificateACL}
+     <input id="certificateSerialNumber" name="certificateSerialNumber" size=10 maxlength=20 value="{$certificateSerialNumber}">
+       {/render}
    </td>
  </tr>
  {/if}
 </table>
 
 <p class="plugbottom">
+       {render acl=$CertificateACL}
   <input type=submit name="cert_edit_finish" value="{t}Save{/t}">
+       {/render}
   &nbsp;
   <input type=submit name="cert_edit_cancel" value="{t}Cancel{/t}">
 </p>