diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc
index 76c3e7c25c002856e7ac1770cbf41e4f90b4ecde..fcccd5843bb22ea457bd8fca0aeb3de6e6b6b18b 100644 (file)
public function get_error()
{
$str = $this->s_error;
- $str = preg_replace("/ /"," ",$str);
- return($str);
+ $ret = "";
+ if(is_string($str)){
+ $ret = $str;
+ }else{
+ foreach($str as $msg){
+ $ret .= $msg." ";
+ }
+ }
+ $ret = preg_replace("/ /"," ",$ret);
+ return($ret);
}
$attr = "";
foreach($data as $key => $value){
+ $key = strtolower($key);
if(is_array($value)){
foreach($value as $sub_value){
$attr.= "<$key>".strtolower($sub_value)."</$key>\n";
"<target>".$server."</target>".
"</xml>";
- return($this->_send($xml_msg,TRUE));
+ $res = $this->_send($xml_msg,TRUE);
+ if(isset($res['XML'])){
+ return($res['XML']);
+ }else{
+ return($ret);
+ }
}
trigger_error("Invalid configuration attribute given '".$key."=".$value."'.");
return($ret);
}
+ $key = strtolower($key);
if(is_array($value)){
foreach($value as $val){
$attrs.= "<$key>$val</$key>\n";
trigger_error("Invalid configuration attribute given '".$key."=".$value."'.");
return($ret);
}
+ $key = strtolower($key);
if(is_array($value)){
foreach($value as $val){
$attrs.= "<$key>$val</$key>\n";
*/
$xml_msg =
"<xml>".
- "<header>gosa_krb5_set_principal</header>".
+ "<header>gosa_krb5_modify_principal</header>".
"<principal>".$name."</principal>".
$attrs.
"<source>GOSA</source>".
trigger_error("Invalid policy configuration attribute given '".$id."=".$value."'.");
return($ret);
}
+ $id = strtolower($id);
$attrs.= "<$id>$value</$id>\n";
}
trigger_error("Invalid policy configuration attribute given '".$id."=".$value."'.");
return($ret);
}
+ $id = strtolower($id);
$attrs.= "<$id>$value</$id>\n";
}
}
+ /*! \brief Sets the password of for the given principal.
+ (Uses the GOsa support daemon instead of the ldap database.)
+ @param String The servers mac
+ @param String The principals name
+ @param String $the new password.
+ @return Boolean TRUE on success else FALSE
+ */
+ public function krb5_set_password($server,$name,$password)
+ {
+ $ret = FALSE;
+
+ /* Check if the given server is a valid mac address
+ */
+ if(!tests::is_mac($server)){
+ trigger_error("The given server address '".$server."' is invalid, it must be a valid mac address");
+ return($ret);
+ }
+
+ /* Check if the given name is a valid request value
+ */
+ if(!is_string($name) || empty($name)){
+ trigger_error("The given principal name is not of type string or it is empty.");
+ return($ret);
+ }
+
+ /* Prepare request event
+ */
+ $xml_msg =
+ "<xml>".
+ "<header>gosa_krb5_set_password</header>".
+ "<principal>".$name."</principal>".
+ "<password>".$password."</password>".
+ "<source>GOSA</source>".
+ "<target>".$server."</target>".
+ "</xml>";
+ return($this->_send($xml_msg,TRUE) == TRUE && !$this->is_error());
+ }
+
+
/*! \brief Returns log file informations for a given mac address
@param $mac The mac address to fetch logs for.
@retrun Array A Multidimensional array containing log infos.