summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4360d53)
raw | patch | inline | side by side (parent: 4360d53)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 24 Apr 2008 10:05:29 +0000 (10:05 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 24 Apr 2008 10:05:29 +0000 (10:05 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10667 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc | patch | blob | history | |
gosa-plugins/heimdal/admin/systems/services/kerberos/class_krb5_policy.inc | patch | blob | history |
diff --git a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_goKrbServer.inc
index 979da7f5677593b5a8dc2dcb638d88e3e26f593b..923ec72dc66e937d7927a662fa103aeead5e9925 100644 (file)
var $policies = array();
var $id = -1;
+ var $macAddress = "00:01:6c:9d:aa:16" ;
- function goKrbServer(&$config,$dn)
+ public function goKrbServer(&$config,$dn)
{
goService::goService($config,$dn);
$this->DisplayName = _("Kerberos service");
/* Get configured policies
*/
$o = new gosaSupportDaemon();
- $tmp = $o->krb5_list_policies("00:01:6c:9d:aa:16");
+ $tmp = $o->krb5_list_policies($this->macAddress);
if($o->is_error()){
- msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
+ msg_dialog::display(_("Service infrastructure"),msgPool::siError($o->get_error()),ERROR_DIALOG);
}else{
$this->policies = array();
foreach($tmp as $policy){
}
- function execute()
+ /*! \brief Create HTML output
+ @return String HMTL output.
+ */
+ public function execute()
{
$smarty = get_smarty();
}
- function getListEntry()
+ /* \brief Return serice informations, which will be shown in the service overview.
+ @return Array Some service information.
+ */
+ public function getListEntry()
{
$fields = goService::getListEntry();
$fields['Message'] = _("Kerberos service (kadmin access informations)");
return($fields);
}
- function check()
+
+ /*! \brief Checks if all given values are valid
+ @return Array An array containing all error messages.
+ */
+ public function check()
{
$message = plugin::check();
if (empty($this->goKrbRealm)){
}
-
- function AddPolicy($id,$policy)
+ /*! \brief Adds or updated a given policy.
+ @param Integer ID The policy to update, or -1 if it is a new one.
+ @param Array The policy settings.
+ */
+ public function AddPolicy($id,$policy)
{
if($id != -1 && $this->policies[$id]['NAME'] == $policy['NAME']){
}
- function getPolicyNames()
+ /*! \brief Returns all used policy names.
+ @return Array A list of used policy names.
+ */
+ public function getPolicyNames()
{
$ret = array();
foreach($this->policies as $policy){
return($ret);
}
-
- function RemovePolicy($id)
+
+ /*! \brief Marks a policy as remvoed
+ @param Integer the Id of the policy to remove
+ */
+ public function RemovePolicy($id)
{
if($this->policies[$id]['STATUS'] == "ADDED"){
unset($this->policies[$id]);
}
- function save_object()
+ /*! \brief Save POSTed html variables
+ */
+ public function save_object()
{
if(isset($_POST['goKrbServerPosted'])){
plugin::save_object();
*/
if($this->policies[$id]['STATUS'] == "LOADED" && empty($this->policies[$id]['DATA'])){
$o = new gosaSupportDaemon();
- $this->policies[$id]['DATA'] = $o->krb5_get_policy("00:01:6c:9d:aa:16",$this->policies[$id]['NAME']);
+ $this->policies[$id]['DATA'] = $o->krb5_get_policy($this->macAddress,$this->policies[$id]['NAME']);
}
/* Open dialog */
}
- /* Return plugin informations for acl handling */
+ /*! \brief Save changes to ldap
+ */
+ public function save()
+ {
+ goService::save();
+
+ /* Send policy changes back to the si daemon
+ */
+ $actions = array("del" => array(),"add" => array(),"edit"=>array());
+ foreach($this->policies as $policy){
+ switch($policy['STATUS']){
+ case "REMOVED" : $actions['del'] [] = $policy;break;
+ case "ADDED" : $actions['add'] [] = $policy;break;
+ case "EDITED" : $actions['edit'][] = $policy;break;
+ }
+ }
+
+ $o = new gosaSupportDaemon();
+ /* Send remove policy event
+ */
+ foreach($actions['del'] as $policy){
+ if(!$o->krb5_del_policy($this->macAddress,$policy['NAME'])){
+ msg_dialog::display(_("Service infrastructure"),msgPool::siError($o->get_error()),ERROR_DIALOG);
+ }
+ }
+
+ /* Send add new policy event
+ */
+ foreach($actions['add'] as $policy){
+ if(!$o->krb5_add_policy($this->macAddress,$policy['NAME'],$policy['DATA'])){
+ msg_dialog::display(_("Service infrastructure"),msgPool::siError($o->get_error()),ERROR_DIALOG);
+ }
+ }
+
+ /* Send update policy event
+ */
+ foreach($actions['edit'] as $policy){
+ if(!$o->krb5_set_policy($this->macAddress,$policy['NAME'],$policy['DATA'])){
+ msg_dialog::display(_("Service infrastructure"),msgPool::siError($o->get_error()),ERROR_DIALOG);
+ }
+ }
+ }
+
+
+ /*! \brief Return plugin informations for acl handling
+ @return Array ACL infos.
+ */
static function plInfo()
{
return (array(
diff --git a/gosa-plugins/heimdal/admin/systems/services/kerberos/class_krb5_policy.inc b/gosa-plugins/heimdal/admin/systems/services/kerberos/class_krb5_policy.inc
index 18ee90b81db4879f81ba7256039bbb3c10387b83..7dac3ac5f6763e9e0e29b208fbd96acbba7612d1 100644 (file)
$this->is_new =FALSE;
$this->name = $entry['NAME'];
$this->data = $entry['DATA'];
+ }else{
+ foreach($this->attributes as $attr){
+ $this->data[$attr] = 0;
+ }
}
$this->init_name = $this->name;
}