summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f278277)
raw | patch | inline | side by side (parent: f278277)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 10 Mar 2008 07:02:38 +0000 (07:02 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 10 Mar 2008 07:02:38 +0000 (07:02 +0000) |
-Fixed certificate selection.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9475 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9475 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/personal/generic/class_user.inc | patch | blob | history |
diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc
index ab72dfd592b0de60d4e20c3ed9f7649d745ea229..dee7b76212e24a833bcdbcc5623c2079384e101f 100644 (file)
$years[]= $y;
}
$years['-']= "- ";
- $months= array(_("January"), _("February"), _("March"), _("April"),
- _("May"), _("June"), _("July"), _("August"), _("September"),
- _("October"), _("November"), _("December"), '-' => '- ');
+ $months= msgPool::months();
+ $months['-'] = '- ';
+
$smarty->assign("day", $date["mday"]);
$smarty->assign("days", $days);
$smarty->assign("months", $months);
/* Upload new cert and close dialog? */
if($this->acl_is_writeable("Certificate",(!is_object($this->parent) && !session::is_set('edit')))){
+
+ $fail =false;
+
if (isset($_POST['cert_edit_finish'])){
/* for all certificates do */
$_POST["certificateSerialNumber"] != ""){
if (!tests::is_id($_POST["certificateSerialNumber"])){
- msg_dialog::display(_("Error"), _("Please enter a valid serial number!"), ERROR_DIALOG);
+ $fail = true;
+ msg_dialog::display(_("Error"), msgPool::invalid(_("Serial number"),$_POST["certificateSerialNumber"],"/[0-9]/"),ERROR_DIALOG);
foreach(array("userCertificate", "userSMIMECertificate", "userPKCS12") as $cert){
if ($this->$cert != ""){
$smarty->assign("$cert"."_state", "");
}
}
- return ($smarty->fetch (get_template_path('generic_certs.tpl', TRUE, dirname(__FILE__))));
}
$this->certificateSerialNumber= $_POST["certificateSerialNumber"];
$this->is_modified= TRUE;
}
-
- $this->cert_dialog= FALSE;
- $this->dialog= FALSE;
+ if(!$fail){
+ $this->cert_dialog= FALSE;
+ $this->dialog= FALSE;
+ }
}
}
/* Display picture dialog */
if ($this->cert_dialog){
$smarty->assign("CertificateACL",$this->getacl("Certificate",(!is_object($this->parent) && !session::is_set('edit'))));
$smarty->assign("Certificate_readable",$this->acl_is_readable("Certificate"));
+ $smarty->assign("certificateSerialNumber",$this->certificateSerialNumber);
foreach(array("userCertificate", "userSMIMECertificate", "userPKCS12") as $cert){
if ($this->$cert != ""){
$smarty->assign($cert."_state","");
}
}
- $smarty->assign("governmentmode", "false");
+ $this->config->current['GOVERNMENTMODE'] = "true";
+ if (isset($this->config->current['GOVERNMENTMODE']) &&
+ preg_match('/true/i', $this->config->current['GOVERNMENTMODE'])){
+ $smarty->assign("governmentmode", "true");
+ }else{
+ $smarty->assign("governmentmode", "false");
+ }
return($smarty->fetch (get_template_path('generic_certs.tpl', TRUE, dirname(__FILE__))));
}
/* Load certificate from file to object */
function set_cert($cert, $filename)
{
- if(!$thsi->acl_is_writeable("Certificate",(!is_object($this->parent) && !session::is_set('edit')))) return;
+ if(!$this->acl_is_writeable("Certificate",(!is_object($this->parent) && !session::is_set('edit')))) return;
$fd = fopen ($filename, "rb");
if (filesize($filename)>0) {
$this->$cert= fread ($fd, filesize ($filename));