'; printf('

%s

',_('Entry Chooser')); echo ''; echo ''; if ($request['container']) { printf('',_('Server'),$app['server']->getName()); printf('',_('Looking in'),$request['container']); echo ''; } # Has the user already begun to descend into a specific server tree? if (isset($app['server']) && ! is_null($request['container'])) { $request['children'] = $app['server']->getContainerContents($request['container'],null,0,'(objectClass=*)',$_SESSION[APPCONFIG]->getValue('deref','tree')); sort($request['children']); foreach ($app['server']->getBaseDN() as $base) { if (DEBUG_ENABLED) debug_log('Comparing BaseDN [%s] with container [%s]',64,0,__FILE__,__LINE__,__METHOD__,$base,$request['container']); if (! pla_compare_dns($request['container'],$base)) { $parent_container = false; $href['up'] = sprintf('entry_chooser.php?form=%s&element=%s&rdn=%s',$request['form'],$request['element'],rawurlencode($request['rdn'])); break; } else { $parent_container = $app['server']->getContainer($request['container']); $href['up'] = sprintf('entry_chooser.php?form=%s&element=%s&rdn=%s&server_id=%s&container=%s', $request['form'],$request['element'],$request['rdn'],$app['server']->getIndex(),rawurlencode($parent_container)); } } echo ''; echo ''; printf('',$href['up'],IMGDIR); printf('',$href['up'],_('Back up')); echo ''; if (! count($request['children'])) printf('',_('no entries')); else foreach ($request['children'] as $dn) { $href['return'] = sprintf("javascript:returnDN('%s%s')",($request['rdn'] ? sprintf('%s,',$request['rdn']) : ''),str_replace('\\','\\\\',$dn)); $href['expand'] = sprintf('entry_chooser.php?server_id=%s&form=%s&element=%s&rdn=%s&container=%s', $app['server']->getIndex(),$request['form'],$request['element'],$request['rdn'],rawurlencode($dn)); echo ''; echo ''; printf('',$href['expand'],IMGDIR); printf('',$href['return'],$dn); echo ''; echo "\n\n"; } # Draw the root of the selection tree (ie, list all the servers) } else { foreach ($_SESSION[APPCONFIG]->getServerList() as $index => $server) { if ($server->isLoggedIn(null)) { printf('',_('Server'),$server->getName()); foreach ($server->getBaseDN() as $dn) { if (! $dn) { printf('',('Could not determine base DN')); } else { $href['return'] = sprintf("javascript:returnDN('%s%s')",($request['rdn'] ? sprintf('%s,',$request['rdn']) : ''),rawurlencode($dn)); $href['expand'] = htmlspecialchars(sprintf('entry_chooser.php?server_id=%s&form=%s&element=%s&rdn=%s&container=%s', $server->getIndex(),$request['form'],$request['element'],$request['rdn'],rawurlencode($dn))); echo ''; echo ''; printf('',$href['expand'],IMGDIR); printf('',$href['return'],$dn); } } echo ''; } } } echo '
%s:%s
%s:%s
 
 Up%s...
 (%s)
 Plus%s
%s:%s
 (%s)
 Plus%s
 
'; echo ''; # Capture the output and put into the body of the page. $www['body'] = new block(); $www['body']->SetBody(ob_get_contents()); $www['page']->block_add('body',$www['body']); ob_end_clean(); # Render the popup. $www['page']->display(array('CONTROL'=>false,'FOOT'=>false,'HEAD'=>false,'TREE'=>false)); ?>