diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc
index d49555a2a2d0790ebf5efd6d9ae8e7fea9c4f2a4..3c2b052f4ce518de9f461479be2f42f2c36d4f7c 100644 (file)
$this->registerAction("systemTypeChosen","systemTypeChosen");
$this->registerAction("handleActivationQueue","handleActivationQueue");
+ $this->registerAction("new_device", "newEntry");
$this->registerAction("new_goServer", "newEntry");
$this->registerAction("new_gotoWorkstation", "newEntry");
$this->registerAction("new_gotoTerminal", "newEntry");
$entry = $headpage->getEntry($dn);
$ui = get_userinfo();
$smarty = get_smarty();
- if(in_array("FAKE_OC_PWD_changeAble", $entry['objectClass'])){
+ if(in_array_strict("FAKE_OC_PWD_changeAble", $entry['objectClass'])){
$acl = $tDefs[$type]['aclCategory'].'/'.$tDefs[$type]['aclClass'];
$tabacl = $ui->get_permissions($dn,$acl,"userPassword");
if(preg_match("/w/",$tabacl)){
}
+ function getAclCategories()
+ {
+ $ret = array();
+ $tDefs= $this->getObjectDefinitions();
+ foreach($tDefs as $type => $data){
+ $ret[] = $data['aclCategory'];
+ }
+ return(array_unique($ret));
+ }
+
+
/*! \brief This method is used to queue and process copy&paste actions.
* Allows to copy, cut and paste mutliple entries at once.
* @param String 'action' The name of the action which was the used as trigger.
$ui = get_userinfo();
$smarty = get_smarty();
- if(!in_array('FAKE_OC_PWD_changeAble', $entry['objectClass'])){
+ if(!in_array_strict('FAKE_OC_PWD_changeAble', $entry['objectClass'])){
trigger_error("Tried to change pwd, for invalid object!");
}elseif (get_post('new_password') != get_post('repeated_password')){
msg_dialog::display(_("Error"),
/* Remove password attribute
*/
- if(in_array("simpleSecurityObject",$old_attrs['objectClass'])){
+ if(in_array_strict("simpleSecurityObject",$old_attrs['objectClass'])){
$attrs['objectClass'] = array();
for($i = 0 ; $i < $old_attrs['objectClass']['count'] ; $i ++){
if(!preg_match("/simpleSecurityObject/i",$old_attrs['objectClass'][$i])){
/* Add/modify password attribute
*/
- if(!in_array("simpleSecurityObject",$old_attrs['objectClass'])){
+ if(!in_array_strict("simpleSecurityObject",$old_attrs['objectClass'])){
$attrs['objectClass'] = array();
for($i = 0 ; $i < $old_attrs['objectClass']['count'] ; $i ++){
$attrs['objectClass'][] = $old_attrs['objectClass'][$i];
/* Skip installation or update trigerred events,
* if this entry is currently processing.
*/
- if($triggered && in_array($event,array("DaemonEvent_reinstall","DaemonEvent_update"))){
+ if($triggered && in_array_strict($event,array("DaemonEvent_reinstall","DaemonEvent_update"))){
foreach($mac as $key => $mac_address){
foreach($o_queue->get_entries_by_mac(array($mac_address)) as $entry){
$entry['STATUS'] = strtoupper($entry['STATUS']);
if($entry['STATUS'] == "PROCESSING" &&
isset($events['QUEUED'][$entry['HEADERTAG']]) &&
- in_array($events['QUEUED'][$entry['HEADERTAG']],array("DaemonEvent_reinstall","DaemonEvent_update"))){
+ in_array_strict($events['QUEUED'][$entry['HEADERTAG']],array("DaemonEvent_reinstall","DaemonEvent_update"))){
unset($mac[$key]);
new log("security","systems/".get_class($this),"",array(),"Skip adding 'DaemonEvent::".$type."' for mac '".$mac_address."', there is already a job in progress.");
// Delete the object
$this->dn = $dn;
if($info['tabClass'] == "phonetabs"){
- $this->tabObject= new $tabtype($this->config, $this->config->data['TABS'][$tabobj], $dn,$type);
+ $this->tabObject= new $info['tabClass']($this->config, $this->config->data['TABS'][$info['tabDesc']], $dn,$type);
$this->tabObject->set_acl_base($dn);
$this->tabObject->by_object['phoneGeneric']->remove_from_parent ();
}else{
$headpage = $this->getHeadpage();
$dn = $target[0];
$type =$headpage->getType($dn);
+
+ if(!isset($tInfo[$type])){
+ msg_dialog::display(_("Information"),sprintf(_("The object-type '%s' cannot be managed with your setup of GOsa, please install the required plugins!"), $type), ERROR_DIALOG);
+ return;
+ }
+
$tData = $tInfo[$type];
if($type == "FAKE_OC_ArpNewDevice"){
$ocs = $attrs['objectClass'];
unset($ocs['count']);
$new_attrs = array();
- if(!in_array("FAIobject",$ocs)){
+ if(!in_array_strict("FAIobject",$ocs)){
$ocs[] = "FAIobject";
$new_attrs['objectClass'] = $ocs;
}
public function getObjectDefinitions()
{
$tabs = array(
+ "device" => array(
+ "ou" => get_ou('Device','GOsaDeviceRDN'),
+ "plugClass" => "Device",
+ "tabClass" => "DeviceTab",
+ "tabDesc" => "NEWDEVICETABS",
+ "aclClass" => "Device",
+ "sendEvents" => FALSE,
+ "aclCategory" => "Device"),
+
"FAKE_OC_OpsiHost" => array(
"ou" => "",
"plugClass" => "opsiGeneric",
$tabs['FAKE_OC_ArpNewDevice'] = &$tabs['FAKE_OC_NewDevice'];
+
+ // Remove those types, we cannot handle at the moment due to lack of
+ // installed GOsa-plugins.
+ foreach($tabs as $name => $tab){
+
+ if(!class_available($tab['plugClass'])) {
+ unset($tabs[$name]);
+ }
+ }
+
return($tabs);
}
- static function filterSystemDescription($row,$dn,$pid,$state,$description=array())
+ static function filterSystemDescription($row,$dn,$pid,$state = '',$description=array())
{
$dn= LDAP::fix(func_get_arg(1));
$desc = isset($description[0])?set_post($description[0]):"";
"name" => "systemRDN",
"type" => "rdn",
"default" => "ou=systems,",
- "description" => _("The 'systemRDN' statement defines the location where new systems will be created. The default is 'ou=systems,'."),
+ "description" => _("RDN for system storage."),
"check" => "gosaProperty::isRdn",
"migrate" => "migrate_systemRDN",
"group" => "plugin",