diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc
index 9f6084c8f17ad995f837f663781c632ff7aac0c4..39835f2275e1d0819fc96b759934d2b43b9d3444 100644 (file)
$headpage = new listing(get_template_path("system-list.xml", true));
$headpage->registerElementFilter("systemRelease", "systemManagement::systemRelease");
$headpage->registerElementFilter("filterSystemDescription", "systemManagement::filterSystemDescription");
+ $headpage->registerElementFilter("filterLink", "systemManagement::filterLink");
$headpage->setFilter($filter);
$filter->setConverter('systemManagement::incomingFilterConverter');
$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.");
$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','DeviceRDN'),
+ "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])?$description[0]:" ";
+ $desc = isset($description[0])?set_post($description[0]):"";
+
$rc = "";
switch($state){
case 'locked' : $rc = "<rowClass:entry-locked/><rowLabel:locked/>"; break;
case 'busy' : $rc = "<rowClass:entry-busy/><rowLabel:busy/>"; break;
case 'warning' : $rc = "<rowClass:entry-warning/><rowLabel:warning/>"; break;
}
- return("<a href='?plug=".$_GET['plug']."&PID={$pid}&act=listing_edit_{$row}' title='{$dn}'>".set_post($desc)."</a>{$rc}");
+ return("<a href='?plug=".$_GET['plug']."&PID={$pid}&act=listing_edit_{$row}' title='{$dn}'>".$desc."</a>{$rc}");
}
+
+ static function filterLink()
+ {
+ $result= " ";
+ $row= func_get_arg(0);
+ $pid= func_get_arg(4);
+ $dn= LDAP::fix(func_get_arg(1));
+ $params= array(func_get_arg(2));
+
+ // Collect sprintf params
+ for ($i = 3;$i < func_num_args();$i++) {
+ $val= func_get_arg($i);
+ if (is_array($val)){
+ $params[]= $val[0];
+ continue;
+ }
+ $params[]= $val;
+ }
+
+ $result= " ";
+ $trans= call_user_func_array("sprintf", $params);
+ if ($trans != "") {
+ return("<a href='?plug=".$_GET['plug']."&PID=$pid&act=listing_edit_$row' title='$dn'>".$trans."</a>");
+ }
+ return $result;
+ }
+
+
static function systemRelease($a,$b,$c,$objectclasses= null,$class= null)
{
global $config;
"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",