diff --git a/gosa-plugins/systems/admin/systems/class_servGeneric.inc b/gosa-plugins/systems/admin/systems/class_servGeneric.inc
index 0cd22e2397279e15f85832db50cd49a4adf63c0f..83cba2f758cc1651935eff036bbf9baa428f775e 100644 (file)
var $currently_installing_warned = FALSE;
var $kerberos_key_service = NULL;
+ var $baseSelector;
var $mapActions = array("reboot" => "",
"instant_update" => "softupdate",
plugin::plugin ($config, $dn, $parent);
- /* Initialize kerberos host key plugin */
- if(class_available("krbHostKeys")){
- $this->kerberos_key_service = new krbHostKeys($this->config,$this);
- }
-
+ /* Initialize */
$this->ui = get_userinfo();
$this->modes["active"]= _("Activated");
$this->modes["locked"]= _("Locked");
$this->base= dn2base($ui->dn);
$this->cn= "";
} else {
- $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("serverRDN"))."/", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("serverRDN"), '/')."/i", "", $this->dn);
}
$this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
$this->netConfigDNS->set_acl_category("server");
$this->netConfigDNS->set_acl_base($this->base);
+ $this->netConfigDNS->MACisMust =TRUE;
+
+ /* Initialize kerberos host key plugin */
+ if(class_available("krbHostKeys")){
+ $this->kerberos_key_service = new krbHostKeys($this->config,$this);
+ }
/* Check if this host is currently in installation process*/
if($this->dn != "new" && class_available("gosaSupportDaemon") && class_available("DaemonEvent")){
$this->orig_dn = $this->dn;
$this->orig_cn = $this->cn;
$this->orig_base = $this->base;
+
+ /* Instanciate base selector */
+ $this->baseSelector= new baseSelector($this->get_allowed_bases(), $this->base);
+ $this->baseSelector->setSubmitButton(false);
+ $this->baseSelector->setHeight(300);
+ $this->baseSelector->update(true);
}
}
}
- /* Base select dialog */
- $once = true;
- foreach($_POST as $name => $value){
- if(preg_match("/^chooseBase/",$name) && $once ){
- $once = false;
- $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases());
- $this->dialog->setCurrentBase($this->base);
- }
- }
-
- /* Dialog handling */
- if(is_object($this->dialog)){
- /* Must be called before save_object */
- $this->dialog->save_object();
-
- if($this->dialog->isClosed()){
- $this->dialog = false;
- }elseif($this->dialog->isSelected()){
-
- /* Only accept allowed bases */
- $tmp = $this->get_allowed_bases();
- if($tmp[$this->dialog->isSelected()]){
- $this->base = $this->dialog->isSelected();
- }
- $this->dialog= false;
- }else{
- return($this->dialog->execute());
- }
- }
-
/* Fill templating stuff */
$smarty= get_smarty();
+ $smarty->assign("usePrototype", "true");
$tmp = $this->plInfo();
foreach($tmp['plProvidedAcls'] as $name => $translated){
}
/* Assign base ACL */
- $smarty->assign("bases" , $this->get_allowed_bases());
+ $smarty->assign("base", $this->baseSelector->render());
/* Assign attributes */
foreach ($this->attributes as $attr){
}
$smarty->assign("staticAddress", "");
- $smarty->assign("base_select", $this->base);
/* Assign status */
if (gosaSupportDaemon::ping($this->netConfigDNS->macAddress)){
plugin::save_object();
$this->netConfigDNS->save_object();
- /* Get base selection */
- $tmp = $this->get_allowed_bases();
- if(isset($_POST['base'])){
- if($tmp[$_POST['base']]){
- $this->base = $_POST['base'];
- }else{
- $this->base = $base_tmp;
+ /* Refresh base */
+ if ($this->acl_is_moveable($this->base)){
+ if (!$this->baseSelector->update()) {
+ msg_dialog::display(_("Error"), msgPool::permMove(), ERROR_DIALOG);
+ }
+ if ($this->base != $this->baseSelector->getBase()) {
+ $this->base= $this->baseSelector->getBase();
+ $this->is_modified= TRUE;
}
}
+
/* Hanle kerberos host key plugin */
if(is_object($this->kerberos_key_service)){
$this->kerberos_key_service->save_object_by_prefix("host/");
if ($ldap->count() != 0){
while ($attrs= $ldap->fetch()){
if ($attrs['dn'] != $this->orig_dn){
- if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,".get_ou('systemIncomingRDN')."/",$attrs['dn']) && preg_match("/,".get_ou('serverRDN')."/",$attrs['dn'])){
+ if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,".preg_quote(get_ou('systemIncomingRDN'), '/')."/i",$attrs['dn']) && preg_match("/,".preg_quote(get_ou('serverRDN'), '/')."/i",$attrs['dn'])){
$message[]= msgPool::duplicated(_("Server name"));
break;
}
}
/* Warn the user, that this host is currently installing */
- if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
+ if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/i",$this->orig_dn)){
/* Force aborting without message dialog */
$message[] = "";
"base" => _("Base"),
"gotoMode" => _("Goto mode"),
- "gotoRootPasswd"=> _("Root password"),
+ "userPassword"=> _("Root password"),
"FAIstate" => _("Action flag"))
));
}
+
+
+ function is_modal_dialog()
+ {
+ return((isset($this->dialog) && $this->dialog) || (isset($this->netConfigDNS->dialog) && $this->netConfigDNS->dialog));
+ }
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: