From e77d39deb50d75ed4964a4cda30eea6c090b48ff Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 16 Nov 2010 19:43:54 +1100 Subject: [PATCH] Suppress create base when base DN is not level 1 --- lib/HTMLTree.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/HTMLTree.php b/lib/HTMLTree.php index 7ebd3f6..858f123 100644 --- a/lib/HTMLTree.php +++ b/lib/HTMLTree.php @@ -89,7 +89,7 @@ class HTMLTree extends Tree { $js_drawn = false; $javascript_id++; - $rdn = split('=',get_rdn($base->getDN())); + $rdn = explode('=',get_rdn($base->getDN())); printf('%s', IMGDIR,$this->getDepth()+3-3,pretty_print_dn($base->getDN())); @@ -106,8 +106,12 @@ class HTMLTree extends Tree { $this->javascript .= ''; $this->javascript .= sprintf(''); - printf('%s %s', - $this->getDepth()+3-3,_('This base entry does not exist.'),$server->getIndex(),$javascript_id,_('Create it?')); + if (preg_match('/,/',$base->getDN())) + printf('%s', + $this->getDepth()+3-3,_('This base cannot be created with PLA.')); + else + printf('%s %s', + $this->getDepth()+3-3,_('This base entry does not exist.'),$server->getIndex(),$javascript_id,_('Create it?')); } else { $this->draw_item($base->getDN(),-1);