Code

Fixed cert layout
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 10 Jun 2005 09:39:48 +0000 (09:39 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 10 Jun 2005 09:39:48 +0000 (09:39 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@653 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/generic/class_user.inc

index afa0383aa4357b6c8238c7e42332fa5f0e288b29..70b2a56e52bc5d8ab3d6dea4c1095768578c5a2e 100644 (file)
@@ -359,9 +359,9 @@ class user extends plugin
 
           foreach(array("userCertificate", "userSMIMECertificate", "userPKCS12") as $cert){
             if ($this->$cert != ""){
-              $smarty->assign("$cert"."_state", _("present"));
+              $smarty->assign("$cert"."_state", "true");
             } else {
-              $smarty->assign("$cert"."_state", _("absent"));
+              $smarty->assign("$cert"."_state", "");
             }
           }
           return ($smarty->fetch (get_template_path('generic_certs.tpl', TRUE, dirname(__FILE__))));
@@ -389,14 +389,16 @@ class user extends plugin
           $certificate->import($this->$cert);
       
           /* Read out data*/
-          $timeto   = ($certificate->getvalidto_date());
-          $timefrom = ($certificate->getvalidfrom_date());
+          $timeto   = $certificate->getvalidto_date();
+          $timefrom = $certificate->getvalidfrom_date();
           $str = $certificate->getname()."<br>".
-                  _("Valid from")." ".date('d M Y',$timefrom)." "._("to")." ".date('d M Y',$timeto)." - "._("Serialnumber")." : ".$certificate->getSerialNumber()."<br>".
-                  _("This certificate is")." <b>".$certificate->isvalid(true)."</b>";
+                  _("Serialnumber")." : ".$certificate->getSerialNumber()."<br>".
+                  sprintf(_("Certificate is valid from <b>%s</b> to <b>%s</b> and is currently <b>%s</b>."), date('d M Y',$timefrom),date('d M Y',$timeto), $certificate->isvalid()?_("valid"):_("invalid"));
           $smarty->assign($cert."info",$str);
+          $smarty->assign($cert."_state","true");
         } else {
-          $smarty->assign($cert."info",_("No certificate present"));
+          $smarty->assign($cert."info", "<i>"._("No certificate installed")."</i>");
+          $smarty->assign($cert."_state","");
         }
       }
       $smarty->assign("governmentmode", "false");