summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 240b60a)
raw | patch | inline | side by side (parent: 240b60a)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 6 May 2008 07:38:55 +0000 (07:38 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 6 May 2008 07:38:55 +0000 (07:38 +0000) |
-Initialize methods with dn, else we can't set or remove passwords for krb5_mit
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10780 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10780 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc
index 04538015981620e03b80638ca9d3367a8c0902ef..b1c52777522a175ce6e055903d0aad16219a1bb8 100644 (file)
}
+ /*! \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.
index 4f7236ae5ca02b5e6d145a2752aeef9a5789e1d4..736db99cf295c868f0089ad5ae7d1cded0446568 100644 (file)
/* Extract used hash */
if ($hash == ""){
- $test = passwordMethod::get_method($attrs['userPassword'][0]);
+ $test = passwordMethod::get_method($attrs['userPassword'][0],$dn);
} else {
- $test = new $available[$hash]($config);
+ $test = new $available[$hash]($config,$dn);
$test->set_hash($hash);
}
diff --git a/gosa-core/include/password-methods/class_password-methods.inc b/gosa-core/include/password-methods/class_password-methods.inc
index d0495b09f85264865e585e8d746d9371be9862ac..d45ec058a9f1be3930dd96650f7b8a7c3bf64f57 100644 (file)
// Try to find out if it's our hash...
- static function get_method($password_hash)
+ static function get_method($password_hash,$dn)
{
global $config;
foreach ($methods['class'] as $class){
- $test = new $class($config);
+ $test = new $class($config,$dn);
if(!$test->is_available())continue;
$method= $test->_extract_method($password_hash);
if ($method != ""){