summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 95d1d3c)
raw | patch | inline | side by side (parent: 95d1d3c)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 16 Jun 2008 09:39:19 +0000 (09:39 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 16 Jun 2008 09:39:19 +0000 (09:39 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11337 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_gosaSupportDaemon.inc | patch | blob | history |
diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc
index 797d56f4804d5685e41dd35389950dcd74dce637..478eee9c7a9770f4f13fadc4209f8c8d122037b2 100644 (file)
return(array());
}
}
+
+
+ /*! \brief Imports the given key into the specified keyring (Servers mac address)
+ @param String The servers mac address
+ @param String The gpg key.
+ @return Boolean TRUE on success else FALSE
+ */
+ public function DAK_import_key($server,$key)
+ {
+ /* Ensure that we send the event to a valid mac address
+ */
+ if(!is_string($server) || !tests::is_mac($server)){
+ trigger_error("No valid mac address given '".$server."'.");
+ return;
+ }
+
+ /* Check if there is some cleanup required before importing the key.
+ There may be some Header lines like:
+ -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.4.6 (GNU/Linux)
+ */
+ if(preg_match("/".normalizePreg("BEGIN PGP PUBLIC KEY BLOCK")."/",$key)){
+
+ /* Remove header */
+ $key = preg_replace("/^.*\n\n/sim","",$key);
+ /* Remove footer */
+ $key = preg_replace("/-----.*$/sim","",$key);
+ }
+
+ /* Create query
+ */
+ $xml_msg = "<xml>
+ <header>gosa_import_dak_key</header>
+ <target>".$server."</target>
+ <key>".$key."</key>
+ <source>GOSA</source>
+ </xml>";
+
+ $res = $this->_send($xml_msg,TRUE);
+ return($this->is_error());
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: