index f7e784d5f6c5484640b9aa5f7f663a91c83b252e..cd588c3bd7e9918aea485842ff468be5cd7af75f 100644 (file)
<?php
<?php
+/*
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id$$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
/* definitions */
/* definitions */
if(!$fp){
$this->certificate();
if(!$fp){
$this->certificate();
- $this->error=_("Can't open specified file, check accessibility and or existence");
+ $this->error= msgPool::cannotReadFile($data);
return(false);
}else{
/* Reading data*/
return(false);
}else{
/* Reading data*/
/* Data can't be empty */
if($data = ""){
$this->certificate();
/* Data can't be empty */
if($data = ""){
$this->certificate();
- $this->error = _("Can't read specified certificate / or empty string given");
+ $this->error = _("Certificate is empty!");
return(false);
}
return(false);
}
/* If cert is loaded correctly and is PEM now, we could read some data out of it */
if(count($this->info()) <=1) {
$this->certificate();
/* If cert is loaded correctly and is PEM now, we could read some data out of it */
if(count($this->info()) <=1) {
$this->certificate();
- $this->error = _("Can't load certificate, possibly unsupported format (use PEM/DER) ");
+ $this->error = _("Cannot load certificate - only PEM/DER is supported!");
/* Reset*/
return(false);
}
/* Reset*/
return(false);
}
function info($ret = true)
{
if($this->type != PEM){
function info($ret = true)
{
if($this->type != PEM){
- $this->error = _("The Format must be PEM, to output certificate informations");
+ $this->error = _("Cannot extract information for non PEM certificates!");
return(false);
} else {
/* return an array with all given information */
return(false);
} else {
/* return an array with all given information */
$fp = fopen($filename,"w+");
if(!$fp){
$fp = fopen($filename,"w+");
if(!$fp){
- $this->error= _("Can't create/open File");
+ $this->error= msgPool::cannotWriteFile($filename);
return(false);
}else{
fwrite($fp,$this->data,strlen($this->data));
}
return(true);
}else{
return(false);
}else{
fwrite($fp,$this->data,strlen($this->data));
}
return(true);
}else{
- $this->error= _("No valid certificate loaded");
+ $this->error= _("No valid certificate loaded!");
return(false);
}
return(false);
return(false);
}
return(false);