dnExists($entry['dn']['string']) or error(sprintf('%s (%s)',_('No such entry'),pretty_print_dn($entry['dn']['string'])),'error','index.php'); $tree = get_cached_item($ldapserver->server_id,'tree'); if ($tree) { $entry['dn']['tree'] = $tree->getEntry($entry['dn']['string']); if (! $entry['dn']['tree']) { /* * The entry doesn't exists in the tree because it * may be filtered ; as we ask for its display, we * add all the same the entry in the tree */ $tree->addEntry($entry['dn']['string']); $entry['dn']['tree'] = $tree->getEntry($entry['dn']['string']); } if ($entry['dn']['tree']) { eval('$reader = new '.$_SESSION[APPCONFIG]->GetValue('appearance', 'entry_reader').'($ldapserver);'); $entry['dn']['tree']->accept($reader); eval('$writer = new '.$_SESSION[APPCONFIG]->GetValue('appearance', 'entry_writer').'($ldapserver);'); $entry['dn']['tree']->accept($writer); } } } else { if ($ldapserver->isReadOnly()) error(_('You cannot perform updates while server is in read-only mode'),'error','index.php'); # Create a new empty entry $entryfactoryclass = $_SESSION[APPCONFIG]->GetValue('appearance','entry_factory'); eval('$entry_factory = new '.$entryfactoryclass.'();'); $entry['dn']['tree'] = $entry_factory->newCreatingEntry(''); # Init the entry with incoming data eval('$reader = new '.$_SESSION[APPCONFIG]->GetValue('appearance', 'entry_reader').'($ldapserver);'); $entry['dn']['tree']->accept($reader); # Display the creating entry eval('$writer = new '.$_SESSION[APPCONFIG]->GetValue('appearance', 'entry_writer').'($ldapserver);'); $entry['dn']['tree']->accept($writer); } ?>