summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d5e3e1e)
raw | patch | inline | side by side (parent: d5e3e1e)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 24 Nov 2006 08:25:39 +0000 (08:25 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 24 Nov 2006 08:25:39 +0000 (08:25 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5217 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc
index 4332d8c83c3facd9c1f4618a877b681b572bc0bd..9ca7308e34863955aed51446c334754ebfe97cc1 100644 (file)
if(preg_match("/(c.*w|w.*c)/",$all_module_acls)){
$listhead .= $this->get_snapshot_header($this->selectedBase);
}
- $listhead .= " <input class='center' type='image' align='middle' src='images/select_new_terminal.png'
- name='newsystem_terminal' alt='"._("New Terminal template")."' title='"._("New Terminal")."'>".
- " <input class='center' type='image' align='middle' src='images/select_new_workstation.png'
- name='newsystem_workstation' alt='"._("New Workstation template")."' title='"._("New Workstation")."'>".
- " <input class='center' type='image' align='middle' src='images/select_new_server.png' name='newsystem_server' alt='"._("New Server")."'
- title='"._("New Server")."'>".
- " <input class='center' type='image' align='middle' src='images/select_new_printer.png' name='newsystem_printer' alt='"._("New Printer")."'
- title='"._("New Printer")."'>".
- " <input class='center' type='image' align='middle' src='images/select_new_phone.png' name='newsystem_phone' alt='"._("New Phone")."'
- title='"._("New Phone")."'>".
- " <input class='center' type='image' align='middle' src='images/select_new_component.png' name='newsystem_component' alt='"._("New Component")."'
- title='"._("New Component")."'>".
- " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> "._("Base")." ".
+
+
+ if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"terminal/termgeneric"))){
+ $listhead .= "<input class='center' type='image' align='middle' src='images/select_new_terminal.png'
+ name='newsystem_terminal' alt='"._("New Terminal template")."' title='"._("New Terminal")."'> ";
+ }
+
+ if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/workgeneric"))){
+ $listhead .= "<input class='center' type='image' align='middle' src='images/select_new_workstation.png'
+ name='newsystem_workstation' alt='"._("New Workstation template")."' title='"._("New Workstation")."'> ";
+ }
+
+ if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"server/servgeneric"))){
+ $listhead .= "<input class='center' type='image' align='middle' src='images/select_new_server.png'
+ name='newsystem_server' alt='"._("New Server")."' title='"._("New Server")."'> ";
+ }
+
+ if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"printer/printgenric"))){
+ $listhead .= "<input class='center' type='image' align='middle' src='images/select_new_printer.png'
+ name='newsystem_printer' alt='"._("New Printer")."' title='"._("New Printer")."'> ";
+ }
+
+ if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"phone/phoneGeneric"))){
+ $listhead .= "<input class='center' type='image' align='middle' src='images/select_new_phone.png'
+ name='newsystem_phone' alt='"._("New Phone")."' title='"._("New Phone")."'> ";
+ }
+
+ if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"component/componentGeneric"))){
+ $listhead .= "<input class='center' type='image' align='middle' src='images/select_new_component.png'
+ name='newsystem_component' alt='"._("New Component")."' title='"._("New Component")."'> ";
+ }
+
+ $listhead .= "<img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> "._("Base")." ".
" <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
" <input class='center' type='image' src='images/list_submit.png' align='middle'
title='"._("Submit department")."' name='submit_department' alt='". _("Submit")."'> ".
$display= $val["cn"][0].$dsc;
}
- if((in_array("gotoTerminal",$val['objectClass']))||(in_array("gotoWorkstation",$val['objectClass']))){
+
+ /* Check if this is a terminal/workstation && if we are allowed to change the gotoRootPasswd */
+ $pwd_acl ="";
+ if(in_array("gotoWorkstation",$val['objectClass'])){
+ $pwd_acl = $ui->get_permissions($val['dn'],"workstation/workgeneric","gotoRootPasswd");
+ }
+ if(in_array("gotoTerminal",$val['objectClass'])){
+ $pwd_acl = $ui->get_permissions($val['dn'],"terminal/termgeneric","gotoRootPasswd");
+ }
+ if(preg_match("/w/",$pwd_acl)){
$action2 = "<input class='center' type='image' src='images/certs.png' alt='"._("Password")."' name='user_setpwd_%KEY%' title='"._("Set root password")."'>";
}else{
$action2 = "";
}
+
if(in_array("gotoWorkstation",$val['objectClass'])){
$action2= "<input class='center' type='image' src='images/cdrom.png' alt='"._("Create CD")."'
name='gen_cd_%KEY%' title='"._("Create FAI CD")."'>".$action2;
diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc
index d20bc1766c96cfcdb3eb188a3ceaaddd270c0576..6bd56f6b14fbe2e619817749c2856caf9262b4d6 100644 (file)
$tabname = $tabs[$sw]["TABNAME"];
$tabclass = $tabs[$sw]["TABCLASS"];
$acl_cat = $tabs[$sw]["ACL"];
- $this->systab= new $tabclass($this->config, $this->config->data['TABS'][$class], $this->dn,$acl_cat);
- $this->systab->set_acl_base($this->DivListSystem->selectedBase);
- $this->systab->by_object[$tabname]->base = $this->DivListSystem->selectedBase;
- $this->systab->base = $this->DivListSystem->selectedBase;
+
+ /* Load permissions for selected 'dn' and check if
+ we're allowed to remove this 'dn' */
+ $ui = get_userinfo();
+ $tabacl = $ui->get_permissions($this->DivListSystem->selectedBase,$acl_cat."/".$tabname);
+ if(preg_match("/c/",$tabacl)){
+ $this->systab= new $tabclass($this->config, $this->config->data['TABS'][$class], $this->dn,$sw);
+ $this->systab->set_acl_base($this->DivListSystem->selectedBase);
+ $this->systab->by_object[$tabname]->base = $this->DivListSystem->selectedBase;
+ $this->systab->base = $this->DivListSystem->selectedBase;
+ }else{
+ print_red(_("You are not allowed to create a new object of this type."));
+ }
}
}
/* Set terminals root password */
if ($s_action=="change_pw"){
+ $tabs = array(
+ "terminal" => array("CLASS"=>"TERMTABS", "TABNAME"=>"termgeneric", "TABCLASS" =>"termtabs", "ACL"=> "terminal"),
+ "workstation" => array("CLASS"=>"WORKTABS", "TABNAME"=>"workgeneric", "TABCLASS" =>"worktabs", "ACL"=> "workstation"));
+
+ $type = $this->get_system_type($this->terminals[$s_entry]['objectClass']);
+
+ $class = $tabs[$type]["CLASS"];
+ $tabname = $tabs[$type]["TABNAME"];
+ $acl_cat = $tabs[$type]["ACL"];
+ $tabclass = $tabs[$type]["TABCLASS"];
+
+ $ui = get_userinfo();
+ $tabacl = $ui->get_permissions($this->DivListSystem->selectedBase,$acl_cat."/".$tabname,"gotoRootPasswd");
+ if(preg_match("/w/",$tabacl)){
+
+
$this->dn= $this->terminals[$s_entry]['dn'];
$_SESSION['objectinfo']= $this->dn;
return ($smarty->fetch(get_template_path('password.tpl', TRUE)));
+ }else{
+ print_red(_("You are not allowed to change the password for this object."));
+ }
}
diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc
index ca29ec1e23dedc0213ab45507bc169b314e96e53..a2780325da4ba9dc891234e1a9bb864596e69fd8 100644 (file)
"gotoNtpServer" => _("Ntp server settings"),
"base" => _("Base"),
"cn" => _("Name"),
+ "gotoRootPasswd" => _("Root password"),
"FAIstate" => _("Action flag"))
));
}
diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc
index 8b34d8278bc664254873358c65f8810cde67120e..365456b749ec12e226b69e37d2455ffcb0ee092e 100644 (file)
"gotoMode" => _("Goto mode"),
"gotoSyslogServer" => _("Syslog server"),
"gotoNtpServer" => _("Ntp server"),
+ "gotoRootPasswd" => _("Root password"),
"FAIstate" => _("Action flag"))
));
}