diff --git a/plugins/admin/groups/class_groupGeneric.inc b/plugins/admin/groups/class_groupGeneric.inc
index 52df6e02369d44cc8bd4e8795c04e192b975ed0f..8b2c2b6ae20e7e86ee88ca1ce3f2a2c9e17cdc7c 100644 (file)
var $orig_dn= "";
var $has_mailAccount= FALSE;
var $group_dialog= FALSE;
+ var $nagios_group =FALSE;
/* attribute list for save action */
var $attributes= array("cn", "description", "gidNumber");
} else {
$this->fon_group= TRUE;
}
+ if (array_search ('nagiosContactGroup', $this->attrs['objectClass']) == NULL ){
+ $this->nagios_group= FALSE;
+ } else {
+ $this->nagios_group= TRUE;
+ }
}
/* Set mail flag */
function execute()
{
- /* Do we represent a valid group? */
+ /* Call parent execute */
+ plugin::execute();
+
+ $ui= get_userinfo();
+ $acla= get_permissions ($ui->dn, $ui->subtreeACL);
+ $this->acl= get_module_permission($acla, "group", $ui->dn);
+ /* Do we represent a valid group? */
if (!$this->is_account && $this->parent == NULL){
$display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\"> <b>".
_("This 'dn' is no group.")."</b>";
$smarty->assign("samba3", "");
}
+ if(search_config($this->config->data['MENU'], "nagiosaccount", "CLASS")){
+ $smarty->assign("nagios",true);
+ }else{
+ $smarty->assign("nagios",false);
+ }
+
+ if(search_config($this->config->data['MENU'], "phoneAccount", "CLASS")){
+ $smarty->assign("pickupGroup",true);
+ }else{
+ $smarty->assign("pickupGroup",false);
+ }
+
/* Manage object add dialog */
if ($this->group_dialog){
}
if ($this->force_gid != "1"){
$smarty->assign("forceMode", "disabled");
+ }else{
+ $smarty->assign("forceMode", "");
}
$smarty->assign("force_gidACL", chkacl($this->acl, "gidNumber"));
$smarty->assign("sambaDomainNameACL", chkacl($this->acl, "sambaDomainName"));
}
$smarty->assign("fon_groupACL", chkacl($this->acl, "fon_group"));
+ if ($this->nagios_group){
+ $smarty->assign("nagios_group", "checked");
+ } else {
+ $smarty->assign("nagios_group", "");
+ }
+ $smarty->assign("nagios_groupACL", chkacl($this->acl, "nagios_group"));
+
/* Fields */
foreach (array("cn", "description", "gidNumber") as $val){
$smarty->assign("$val", $this->$val);
$this->fon_group= FALSE;
}
}
-
+ if (chkacl ($this->acl, "nagios_group") == ""){
+ if (isset ($_POST['nagios_group'])){
+ $this->nagios_group= TRUE;
+ } else {
+ $this->nagios_group= FALSE;
+ }
+ }
}
}
for ($i= 0; $i<count($this->attrs["objectClass"]); $i++){
if ($this->attrs['objectClass'][$i] != 'sambaGroupMapping' &&
$this->attrs['objectClass'][$i] != 'sambaIdmapEntry' &&
- $this->attrs['objectClass'][$i] != 'goFonPickupGroup'){
+ $this->attrs['objectClass'][$i] != 'goFonPickupGroup' &&
+ $this->attrs['objectClass'][$i] != 'nagiosContactGroup'){
$tmp[]= $this->attrs['objectClass'][$i];
}
}
$this->attrs['objectClass'][]= "goFonPickupGroup";
}
+ /* Add nagios functionality */
+ if ($this->nagios_group){
+ $this->attrs['objectClass'][]= "nagiosContactGroup";
+ }
+
/* Take members array */
if (count ($this->memberUid)){
$this->attrs['memberUid']= array_unique($this->memberUid);
}
$ui= get_userinfo();
- $acl= get_permissions ($new_dn, $ui->subtreeACL);
- $acl= get_module_permission($acl, "group", $new_dn);
- if (chkacl($acl, "create") != ""){
+ $acl= get_permissions ($ui->dn, $ui->subtreeACL);
+ $acl= get_module_permission($acl, "group", $ui->dn);
+ if (chkacl($this->acl, "create") != ""){
$message[]= _("You have no permissions to create a group on this 'Base'.");
}