summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7d291e0)
raw | patch | inline | side by side (parent: 7d291e0)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 19 Sep 2006 06:59:14 +0000 (06:59 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 19 Sep 2006 06:59:14 +0000 (06:59 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4720 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_glpiAccount.inc | patch | blob | history | |
plugins/admin/systems/glpi.tpl | patch | blob | history |
diff --git a/plugins/admin/systems/class_glpiAccount.inc b/plugins/admin/systems/class_glpiAccount.inc
index b5837b86cccf35c13ba41cb0cb6a0350c5e2da5d..ffc5a46052c07e3eb38ad3fe07b0368ce57f7bef 100644 (file)
"OSs","TechnicalResponsibles","InstalledDevices","Attachments","AttachmentKeys",
"OSKeys","OSs","ManufacturerKeys","InstalledDeviceKeys") as $attr){
$smarty->assign($attr,array());
- $smarty->assign($attr."ACL"," disabled ");
}
foreach(array("type","FK_glpi_enterprise","os","tech_num","comments","contact_num","AttachmentsDiv") as $attr){
$smarty->assign($attr,"");
- $smarty->assign($attr."ACL"," disabled ");
+ }
+
+ $tmp = $this->plInfo();
+ foreach($tmp['plProvidedAcls'] as $name => $translation) {
+ $smarty->assign($name."ACL",$this->getacl($name));
}
/* Check if there is a glpi database server defined
/* Add Device was requested, open new dialog
*/
- if(isset($_POST['AddDevice'])){
+ if((isset($_POST['AddDevice'])) && ($this->acl_is_writeable("Devices"))){
$this->dialog =true;
$this->cur_dialog = new glpiDeviceManagement($this->config,$this->dn,$this->usedDevices);
}
/* Attachment pool was closed with use
*/
- if(isset($_POST['UseAttachment'])){
+ if(isset($_POST['UseAttachment']) && ($this->acl_is_writeable("Attachments"))){
if(count($this->cur_dialog->check())){
foreach($this->cur_dialog->check() as $msg){
print_red($msg);
/* Open Attachment pool to add/edit Attachments
*/
- if(isset($_POST['AddAttachment'])){
+ if(isset($_POST['AddAttachment']) && ($this->acl_is_writeable("Attachments"))){
$this->cur_dialog = new glpiAttachmentPool($this->config,$this->dn,$this->usedAttachments);
$this->dialog = true;
}
*/
$once = true;
foreach($_POST as $name => $value){
- if((preg_match("/^delAttachment_/",$name))&&($once)){
+ if((preg_match("/^delAttachment_/",$name))&&($once) && $this->acl_is_writeable("Attachments")){
$once= false;
$name = preg_replace("/^delAttachment_/","",$name);
$entry = preg_replace("/_.*$/","",$name);
}
}
}
- if((isset($_POST['RemoveAttachment']))&&(isset($_POST['Attachments']))){
+ if((isset($_POST['RemoveAttachment']))&&(isset($_POST['Attachments'])) && ($this->acl_is_writeable("Attachments"))){
foreach($_POST['Attachments'] as $entry){
if(isset($this->usedAttachments[$entry])){
unset($this->usedAttachments[$entry]);
/* We have selected some devices and pressed use button
*/
- if(isset($_POST['SelectDeviceSave'])){
+ if(isset($_POST['SelectDeviceSave']) && $this->acl_is_writeable("Devices")){
$this->cur_dialog->save_object();
$this->usedDevices= ($this->cur_dialog->getSelected());
$this->cur_dialog = false;
/* Aborted Device selction
*/
- if(isset($_POST['SelectDeviceCancel'])){
+ if(isset($_POST['SelectDeviceCancel']) && ($this->acl_is_writeable("Devices"))){
$this->dialog = false;
$this->cur_dialog = false;
$this->edit_type=false;
/* System type management
*/
- if(isset($_POST['edit_type'])){
+ if(isset($_POST['edit_type']) && $this->acl->acl_is_writeable("type")){
$this->dialog = true;
$this->edit_type=true;
}
/* This closes the system type editing dialog
*/
- if(isset($_POST['close_edit_type'])){
+ if(isset($_POST['close_edit_type']) && ($this->acl_is_writeable("type"))){
$this->edit_type=false;
$this->dialog = false;
}
/* This appends a new system to our sytem types
*/
- if((isset($_POST['add_type']))&&(!empty($_POST['type_string']))){
+ if((isset($_POST['add_type']))&&(!empty($_POST['type_string'])) && $this->acl_is_writeable("type")){
$attr = $this->handle->getSystemTypes();
if(in_array(trim($_POST['type_string']),$attr)){
print_red(_("Adding new sytem type failed, this system type name is already used.")) ;
/* Remove selected type from our system types list
*/
- if((isset($_POST['del_type']))&&(!empty($_POST['select_type']))){
+ if((isset($_POST['del_type']))&&(!empty($_POST['select_type'])) && $this->acl_is_writeable("type")){
$tmp = $this->handle->is_systemTypeUsed($_POST['select_type']);
if(count($tmp)){
$names = "";
/* System os management
*/
- if(isset($_POST['edit_os'])){
+ if(isset($_POST['edit_os']) && $this->acl_is_writeable("os")){
$this->dialog = true;
$this->edit_os=true;
}
/* Add new os to the db
*/
- if((isset($_POST['add_os']))&&(!empty($_POST['is_string']))){
+ if((isset($_POST['add_os']))&&(!empty($_POST['is_string'])) && $this->acl_is_writeable("os")){
$attr = $this->handle->getOSTypes();
if(in_array(trim($_POST['is_string']),$attr)){
print_red(_("Adding new operating system failed, specifed name is already used.")) ;
/* Delete selected os from list and db
*/
- if((isset($_POST['del_os']))&&(!empty($_POST['select_os']))){
+ if((isset($_POST['del_os']))&&(!empty($_POST['select_os'])) && $this->acl_is_writeable("os")){
$tmp = $this->handle->is_osUsed($_POST['select_os']);
if(count($tmp)){
/* Rename selected os to given string
*/
- if(isset($_POST['Rename_os_OK'])){
+ if(isset($_POST['Rename_os_OK']) && $this->acl_is_writeable("os")){
$attr = $this->handle->getOSTypes();
if(in_array(trim($_POST['string']),$attr)){
print_red(_("Updating operating system failed, specifed name is already used.")) ;
/* Show dialog to select a new contact person
* Select a contact person
*/
- if(isset($_POST['SelectContactPerson'])){
+ if(isset($_POST['SelectContactPerson']) && $this->acl_is_writeable("contact_num")){
$this->addUser = "contact";
$this->cur_dialog= new glpiSelectUser($this->config,$this->dn,"user_tech_num");
}
/* Open dialog which allows to edit the manufacturers
*/
- if(isset($_POST['edit_manufacturer'])){
+ if(isset($_POST['edit_manufacturer']) && $this->acl_is_writeable("FK_glpi_enterprise")){
$this->cur_dialog = new glpiManufacturer($this->config,$this->dn);
$this->dialog = true;
}
/* Selecte technical responsible person
*/
- if(isset($_POST['SelectTechPerson'])){
+ if(isset($_POST['SelectTechPerson']) && $this->acl_is_writeable("tech_num")){
$this->addUser ="tech";
$this->cur_dialog= new glpiSelectUser($this->config,$this->dn,"user_tech_num");
}
$smarty->assign($attr,array());
}
- foreach($this->attributes as $attr){
- $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
- }
-
/* Assign some vars to smarty
*/
foreach(array("type","FK_glpi_enterprise","os","tech_num","contact_num","Attachments","InstalledDevices") as $attr){
$smarty->assign($attr,"");
- $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
}
/* Do we need to flip is_account state? */
- if (isset($_POST['modify_state'])){
- $this->is_account= !$this->is_account;
+ if(isset($_POST['modify_state'])){
+ if($this->is_account && $this->acl_is_removeable()){
+ $this->is_account= FALSE;
+ }elseif(!$this->is_account && $this->acl_is_createable()){
+ $this->is_account= TRUE;
+ }
}
/* Show tab dialog headers */
return ($display);
}
- /* Assign ACLs to smarty*/
- foreach($this->attributes as $attr){
- $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
- }
-
/* Assign system types
*/
$smarty->assign("SystemTypeKeys", array_flip($this->handle->getSystemTypes()));
function remove_from_parent()
{
- if(!$this->initialy_was_account){
+ /* Cancel if there's nothing to do here */
+ if ((!$this->initially_was_account) || (!$this->acl_is_removeable())){
return;
}
if(function_exists("mysql_pconnect")){
return ;
}
plugin::save_object();
- foreach($this->attributes as $attrs){
- if(isset($_POST[$attrs])){
- $this->$attrs = stripslashes ($_POST[$attrs]);
- }
- }
}
"model" => _("Model"),
"type" => _("Type"),
"FK_glpi_enterprise" => _("Manufacturer"),
-
- "Attachment_name" => _("Attachment name"),
- "Attachment_comment" => _("Attachment comment"),
- "Attachment_mime" => _("Attachment mime type"),
- "Attachment_filename" => _("Attachment filename"),
-
- "Devices" => _("Peripheral devices"))
+ "Attachments" => _("Attachments"),
+ "Devices" => _("Peripheral devices"))
));
}
index b71261a25e446622a7ffd3285fa5d7d8c7f87971..eea99fdf2d7a024c573f9b1fab16114dea538f55 100644 (file)
<td >{t}System type{/t}
</td>
<td>
- <select name="type" {$typeACL}>
+{render acl=$typeACL}
+ <select name="type">
{html_options values=$SystemTypeKeys output=$SystemTypes selected=$type}
</select>
- <input type="submit" value="{t}edit{/t}" name="edit_type" {$typeACL}>
+{/render}
+{render acl=$typeACL}
+ <input type="submit" value="{t}edit{/t}" name="edit_type">
+{/render}
</td>
</tr>
<tr>
<td>{t}Operating system{/t}
</td>
<td>
- <select name="os" {$osACL}>
+{render acl=$osACL}
+ <select name="os">
{html_options values=$OSKeys output=$OSs selected=$os}
</select>
- <input type="submit" value="{t}edit{/t}" name="edit_os" {$osACL}>
+{/render}
+{render acl=$osACL}
+ <input type="submit" value="{t}edit{/t}" name="edit_os">
+{/render}
</td>
</tr>
<tr>
<td>{t}Manufacturer{/t}
</td>
<td>
- <select name="FK_glpi_enterprise" {$FK_glpi_enterpriseACL}>
+{render acl=$FK_glpi_enterpriseACL}
+ <select name="FK_glpi_enterprise">
{html_options values=$ManufacturerKeys output=$Manufacturers selected=$FK_glpi_enterprise}
</select>
- <input type="submit" value="{t}edit{/t}" name="edit_manufacturer" {$FK_glpi_enterpriseACL}>
+{/render}
+{render acl=$FK_glpi_enterpriseACL}
+ <input type="submit" value="{t}edit{/t}" name="edit_manufacturer">
+{/render}
</td>
</tr>
<!--</table>
</td>
<td>
<i>{$contact_num} </i>
- <input {$contact_numACL} type="submit" name="SelectContactPerson" value="{t}Edit{/t}">
+{render acl=$contact_numACL}
+ <input type="submit" name="SelectContactPerson" value="{t}Edit{/t}">
+{/render}
</td>
</tr>
<tr>
</td>
<td>
<i>{$tech_num} </i>
- <input type="submit" value="{t}Edit{/t}" name="SelectTechPerson" {$tech_numACL}>
+{render acl=$tech_numACL}
+ <input type="submit" value="{t}Edit{/t}" name="SelectTechPerson">
+{/render}
</td>
</tr>
</table>
<table summary="" width="100%">
<tr>
<td valign="top" colspan="2">
- <textarea name="comments" style="width:100%;height:180px;" {$commentsACL}>{$comments}</textarea>
+{render acl=$commentsACL}
+ <textarea name="comments" style="width:100%;height:180px;">{$comments}</textarea>
+{/render}
</td>
</tr>
</table>
<table summary="" width="100%">
<tr>
<td>
- <select name="InstalledDevices" {$InstalledDevicesACL} style="height:130px;width:100%;" multiple>
+{render acl=$DevicesACL}
+ <select name="InstalledDevices" style="height:130px;width:100%;" multiple>
{html_options values=$InstalledDeviceKeys output=$InstalledDevices}
</select>
- <input name="AddDevice" value="{t}Edit{/t}" type="submit" {$InstalledDevicesACL}>
+{/render}
+{render acl=$DevicesACL}
+ <input name="AddDevice" value="{t}Edit{/t}" type="submit">
+{/render}
</td>
</tr>
</table>
<table summary="" width="100%">
<tr>
<td>
+{render acl=$AttachmentsACL}
{$AttachmentsDiv}
- <input name="AddAttachment" value="{t}Add{/t}" type="submit" {$AttachmentsACL}>
+{/render}
+{render acl=$AttachmentsACL}
+ <input name="AddAttachment" value="{t}Add{/t}" type="submit">
+{/render}
</td>
</tr>
</table>
-
</td>
</tr>
</table>
<!-- // First input field on page
document.mainform.type.focus();
-->
-</script></td></tr></table><p style="text-align:right">
+</script><p style="text-align:right">