HTML Validation work

This commit is contained in:
Deon George 2010-02-25 02:03:10 +11:00
parent 1b55c84f06
commit f713afc8d1
33 changed files with 515 additions and 476 deletions

View File

@ -29,7 +29,7 @@ if (get_request('meth','REQUEST') != 'ajax') {
$request['page']->drawTitle(sprintf('%s <b>%s</b>',_('Add new attribute'),get_rdn($request['dn']))); $request['page']->drawTitle(sprintf('%s <b>%s</b>',_('Add new attribute'),get_rdn($request['dn'])));
$request['page']->drawSubTitle(); $request['page']->drawSubTitle();
echo '<center>'; echo '<div style="text-align: center;">';
if (count($request['template']->getAvailAttrs())) { if (count($request['template']->getAvailAttrs())) {
# If we have more than the configured entries, we'll separate our input to the old ways. # If we have more than the configured entries, we'll separate our input to the old ways.
if (count($request['template']->getAvailAttrs()) > $_SESSION[APPCONFIG]->getValue('appearance','max_add_attrs')) { if (count($request['template']->getAvailAttrs()) > $_SESSION[APPCONFIG]->getValue('appearance','max_add_attrs')) {
@ -50,6 +50,7 @@ if (get_request('meth','REQUEST') != 'ajax') {
echo '<br />'; echo '<br />';
echo '<form action="cmd.php" method="post">'; echo '<form action="cmd.php" method="post">';
echo '<div>';
if ($_SESSION[APPCONFIG]->getValue('confirm','update')) if ($_SESSION[APPCONFIG]->getValue('confirm','update'))
echo '<input type="hidden" name="cmd" value="update_confirm" />'; echo '<input type="hidden" name="cmd" value="update_confirm" />';
@ -75,6 +76,7 @@ if (get_request('meth','REQUEST') != 'ajax') {
echo '<input type="text" name="single_item_value" size="20" />'; echo '<input type="text" name="single_item_value" size="20" />';
printf('<input type="submit" name="submit" value="%s" class="update_dn" />',_('Add')); printf('<input type="submit" name="submit" value="%s" class="update_dn" />',_('Add'));
echo '</div>';
echo '</form>'; echo '</form>';
} else { } else {
@ -90,6 +92,7 @@ if (get_request('meth','REQUEST') != 'ajax') {
echo '<!-- Form to add a new BINARY attribute to this entry -->'; echo '<!-- Form to add a new BINARY attribute to this entry -->';
echo '<form action="cmd.php" method="post" enctype="multipart/form-data">'; echo '<form action="cmd.php" method="post" enctype="multipart/form-data">';
echo '<div>';
if ($_SESSION[APPCONFIG]->getValue('confirm','update')) if ($_SESSION[APPCONFIG]->getValue('confirm','update'))
echo '<input type="hidden" name="cmd" value="update_confirm" />'; echo '<input type="hidden" name="cmd" value="update_confirm" />';
@ -124,6 +127,7 @@ if (get_request('meth','REQUEST') != 'ajax') {
else else
printf('<br /><small><b>%s: %s</b></small><br />',_('Maximum file size'),ini_get('upload_max_filesize')); printf('<br /><small><b>%s: %s</b></small><br />',_('Maximum file size'),ini_get('upload_max_filesize'));
echo '</div>';
echo '</form>'; echo '</form>';
} else { } else {
@ -138,7 +142,7 @@ if (get_request('meth','REQUEST') != 'ajax') {
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($request['dn'])); printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($request['dn']));
echo '<table class="entry" cellspacing="0" align="center" border=0>'; echo '<table class="entry" cellspacing="0" align="center" border="0">';
foreach ($request['template']->getAvailAttrs() as $attribute) foreach ($request['template']->getAvailAttrs() as $attribute)
$request['page']->draw('Template',$attribute); $request['page']->draw('Template',$attribute);
@ -153,7 +157,7 @@ if (get_request('meth','REQUEST') != 'ajax') {
printf('<small>(%s)</small>',_('no new attributes available for this entry')); printf('<small>(%s)</small>',_('no new attributes available for this entry'));
} }
echo '</center>'; echo '</div>';
# The ajax addition (it is going into an existing TemplateRendered page # The ajax addition (it is going into an existing TemplateRendered page
} else { } else {
@ -161,10 +165,10 @@ if (get_request('meth','REQUEST') != 'ajax') {
echo '<fieldset>'; echo '<fieldset>';
printf('<legend>%s</legend>',_('Add Attribute')); printf('<legend>%s</legend>',_('Add Attribute'));
echo '<div id="ajADDATTR">'; echo '<div id="ajADDATTR">';
echo '<table class="entry" cellspacing="0" align="center" border=0>'; echo '<table class="entry" cellspacing="0" align="center" border="0">';
echo '<td valign="top" align="center">'; echo '<td valign="top" align="center">';
printf('<select name="attr" onChange="ajDISPLAY(\'%s\',\'cmd=add_value_form&server_id=%s&dn=%s&meth=ajax&attr=\'+this.value,\'%s\',\'append\');">', printf('<select name="attr" onchange="ajDISPLAY(\'%s\',\'cmd=add_value_form&server_id=%s&dn=%s&attr=\'+this.value,\'%s\',\'append\');">',
'ADDATTR',$app['server']->getIndex(),rawurlencode(get_request('dn','REQUEST')),_('Please Wait')); 'ADDATTR',$app['server']->getIndex(),rawurlencode(get_request('dn','REQUEST')),_('Please Wait'));
printf('<option value="%s">%s</option>','',''); printf('<option value="%s">%s</option>','','');

View File

@ -60,7 +60,7 @@ if (count($ldap['attrs']['need']) > 0) {
$request['page']->drawTitle(sprintf('%s <b>%s</b>',_('Add new objectClass to'),get_rdn($request['dn']))); $request['page']->drawTitle(sprintf('%s <b>%s</b>',_('Add new objectClass to'),get_rdn($request['dn'])));
$request['page']->drawSubTitle(); $request['page']->drawSubTitle();
echo '<center>'; echo '<div style="text-align: center">';
printf('<small><b>%s: </b>%s <b>%s</b> %s %s</small>', printf('<small><b>%s: </b>%s <b>%s</b> %s %s</small>',
_('Instructions'), _('Instructions'),
_('In order to add these objectClass(es) to this entry, you must specify'), _('In order to add these objectClass(es) to this entry, you must specify'),
@ -69,7 +69,8 @@ if (count($ldap['attrs']['need']) > 0) {
echo '<br /><br />'; echo '<br /><br />';
echo '<form action="cmd.php" method="post" name="entry_form">'; echo '<form action="cmd.php" method="post" id="entry_form">';
echo '<div>';
if ($_SESSION[APPCONFIG]->getValue('confirm','update')) if ($_SESSION[APPCONFIG]->getValue('confirm','update'))
echo '<input type="hidden" name="cmd" value="update_confirm" />'; echo '<input type="hidden" name="cmd" value="update_confirm" />';
@ -78,27 +79,25 @@ if (count($ldap['attrs']['need']) > 0) {
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($request['dn'])); printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($request['dn']));
echo '</div>';
echo '<table class="entry" cellspacing="0">'; echo '<table class="entry" cellspacing="0" border="0" style="margin-left: auto; margin-right: auto;">';
printf('<tr><th colspan="2">%s</th></tr>',_('New Required Attributes')); printf('<tr><th colspan="2">%s</th></tr>',_('New Required Attributes'));
$counter = 0; $counter = 0;
foreach ($request['template']->getAttribute('objectclass')->getValues() as $value) { echo '<tr><td colspan="2">';
echo '<tr><td colspan=2>'; foreach ($request['template']->getAttribute('objectclass')->getValues() as $value)
$request['page']->draw('HiddenValue',$request['template']->getAttribute('objectclass'),$counter++); $request['page']->draw('HiddenValue',$request['template']->getAttribute('objectclass'),$counter++);
echo '</td></tr>'; echo '</td></tr>';
}
foreach ($ldap['attrs']['need'] as $count => $attr) foreach ($ldap['attrs']['need'] as $count => $attr)
$request['page']->draw('Template',$attr); $request['page']->draw('Template',$attr);
echo '</table>'; echo '</table>';
echo '<br />'; printf('<div style="text-align: center;"><br /><input type="submit" value="%s" /></div>',_('Add ObjectClass and Attributes'));
printf('<center><input type="submit" value="%s" /></center>',_('Add ObjectClass and Attributes'));
echo '</form>'; echo '</form>';
echo '</center>'; echo '</div>';
# There are no other required attributes, so we just need to add the objectclass to the DN. # There are no other required attributes, so we just need to add the objectclass to the DN.
} else { } else {

View File

@ -38,11 +38,13 @@ if (get_request('meth','REQUEST') != 'ajax') {
$request['page']->drawSubTitle(); $request['page']->drawSubTitle();
if (! strcasecmp($request['attr'],'objectclass')) { if (! strcasecmp($request['attr'],'objectclass')) {
echo '<form action="cmd.php" method="post" class="new_value" name="entry_form">'; echo '<form action="cmd.php" method="post" class="new_value" id="entry_form">';
echo '<div>';
echo '<input type="hidden" name="cmd" value="add_oclass_form" />'; echo '<input type="hidden" name="cmd" value="add_oclass_form" />';
} else { } else {
echo '<form action="cmd.php" method="post" class="new_value" name="entry_form" enctype="multipart/form-data" onSubmit="return submitForm(this)">'; echo '<form action="cmd.php" method="post" class="new_value" id="entry_form" enctype="multipart/form-data" onsubmit="return submitForm(this)">';
echo '<div>';
if ($_SESSION[APPCONFIG]->getValue('confirm','update')) if ($_SESSION[APPCONFIG]->getValue('confirm','update'))
echo '<input type="hidden" name="cmd" value="update_confirm" />'; echo '<input type="hidden" name="cmd" value="update_confirm" />';
else else
@ -51,9 +53,9 @@ if (get_request('meth','REQUEST') != 'ajax') {
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($request['dn'])); printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($request['dn']));
echo '</div>';
echo '<center>'; echo '<table class="forminput" border="0" style="margin-left: auto; margin-right: auto;">';
echo '<table class="forminput" border=0>';
echo '<tr>'; echo '<tr>';
$request['attribute'] = $request['template']->getAttribute($request['attr']); $request['attribute'] = $request['template']->getAttribute($request['attr']);
@ -66,7 +68,7 @@ if (get_request('meth','REQUEST') != 'ajax') {
echo '<td>'; echo '<td>';
# Display current attribute values # Display current attribute values
echo '<table border=0><tr><td>'; echo '<table border="0"><tr><td>';
for ($i=0;$i<$request['count'];$i++) { for ($i=0;$i<$request['count'];$i++) {
if ($i > 0) if ($i > 0)
echo '<br/>'; echo '<br/>';
@ -97,9 +99,9 @@ if (get_request('meth','REQUEST') != 'ajax') {
unset($socs[strtolower($oclass)]); unset($socs[strtolower($oclass)]);
# Draw objectClass selection # Draw objectClass selection
echo '<table border=0>'; echo '<table border="0">';
echo '<tr><td>'; echo '<tr><td>';
echo '<select name="new_values[objectclass][]" multiple="true" size="15">'; echo '<select name="new_values[objectclass][]" multiple="multiple" size="15">';
foreach ($socs as $name => $oclass) { foreach ($socs as $name => $oclass) {
# Exclude any structural ones, that are not in the heirachy, as they'll only generate an LDAP_OBJECT_CLASS_VIOLATION # Exclude any structural ones, that are not in the heirachy, as they'll only generate an LDAP_OBJECT_CLASS_VIOLATION
if (($oclass->getType() == 'structural') && ! $oclass->isRelated($request['attribute']->getValues())) if (($oclass->getType() == 'structural') && ! $oclass->isRelated($request['attribute']->getValues()))
@ -117,16 +119,15 @@ if (get_request('meth','REQUEST') != 'ajax') {
echo '</tr>'; echo '</tr>';
if ($_SESSION[APPCONFIG]->getValue('appearance','show_hints')) if ($_SESSION[APPCONFIG]->getValue('appearance','show_hints'))
printf('<tr><td colspan=2><small><br /><img src="%s/light.png" alt="Hint" /><span class="hint">%s</span></small></td></tr>', printf('<tr><td colspan="2"><small><br /><img src="%s/light.png" alt="Hint" /><span class="hint">%s</span></small></td></tr>',
IMGDIR,_('Note: You may be required to enter new attributes that these objectClass(es) require')); IMGDIR,_('Note: You may be required to enter new attributes that these objectClass(es) require'));
echo '</table>'; echo '</table>';
echo '</center>';
echo '</form>'; echo '</form>';
} else { } else {
# Draw a blank field # Draw a blank field
echo '<table border=0><tr><td>'; echo '<table border="0"><tr><td>';
$request['page']->draw('FormValue',$request['attribute'],$request['count']); $request['page']->draw('FormValue',$request['attribute'],$request['count']);
echo '</td></tr><tr><td>'; echo '</td></tr><tr><td>';
@ -148,7 +149,6 @@ if (get_request('meth','REQUEST') != 'ajax') {
echo '</td></tr>'; echo '</td></tr>';
echo '</table>'; echo '</table>';
echo '</center>';
echo '</form>'; echo '</form>';
} }
@ -158,7 +158,7 @@ if (get_request('meth','REQUEST') != 'ajax') {
$attribute = $request['template']->getAttribute($request['attr']); $attribute = $request['template']->getAttribute($request['attr']);
$attribute->show(); $attribute->show();
echo '<table class="entry" cellspacing="0" align="center" border=0>'; echo '<table class="entry" cellspacing="0" align="center" border="0">';
$request['page']->draw('Template',$attribute); $request['page']->draw('Template',$attribute);
$request['page']->draw('Javascript',$attribute); $request['page']->draw('Javascript',$attribute);
echo '</table>'; echo '</table>';

View File

@ -65,7 +65,7 @@ if ($app['script_cmd'])
# Refresh a frame - this is so that one frame can trigger another frame to be refreshed. # Refresh a frame - this is so that one frame can trigger another frame to be refreshed.
if (isAjaxEnabled() && get_request('refresh','REQUEST') && get_request('refresh','REQUEST') != get_request('frame','REQUEST')) { if (isAjaxEnabled() && get_request('refresh','REQUEST') && get_request('refresh','REQUEST') != get_request('frame','REQUEST')) {
echo '<script type="text/javascript" language="javascript">'; echo '<script type="text/javascript" language="javascript">';
printf("ajDISPLAY('%s','cmd=refresh&server_id=%s&meth=ajax&noheader=%s','%s');", printf("ajDISPLAY('%s','cmd=refresh&server_id=%s&noheader=%s','%s');",
get_request('refresh','REQUEST'),$app['server']->getIndex(),get_request('noheader','REQUEST',false,0),_('Auto refresh')); get_request('refresh','REQUEST'),$app['server']->getIndex(),get_request('noheader','REQUEST',false,0),_('Auto refresh'));
echo '</script>'; echo '</script>';
} }

View File

@ -43,32 +43,34 @@ $request['pageSRC']->drawTitle(_('Comparing the following DNs'));
echo '<br/>'; echo '<br/>';
echo '<table class="entry" width=100% border=0>'; echo '<table class="entry" width="100%" border="0">';
echo '<tr class="heading">'; echo '<tr class="heading">';
$href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s', $href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',
$ldap['SRC']->getIndex(),rawurlencode($request['dnSRC'])); $ldap['SRC']->getIndex(),rawurlencode($request['dnSRC']));
printf('<td colspan=2 width=40%%>%s: <b>%s</b><br />%s: <b><a href="%s">%s</a></b></td>', printf('<td colspan="2" style="width: 40%%;">%s: <b>%s</b><br />%s: <b><a href="%s">%s</a></b></td>',
_('Server'),$ldap['SRC']->getName(),_('Distinguished Name'), _('Server'),$ldap['SRC']->getName(),_('Distinguished Name'),
htmlspecialchars($href),$request['dnSRC']); htmlspecialchars($href),$request['dnSRC']);
$href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s', $href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',
$ldap['DST']->getIndex(),rawurlencode($request['dnDST'])); $ldap['DST']->getIndex(),rawurlencode($request['dnDST']));
printf('<td colspan=2 width=40%%>%s: <b>%s</b><br />%s: <b><a href="%s">%s</a></b></td>', printf('<td colspan="2" style="width: 40%%;">%s: <b>%s</b><br />%s: <b><a href="%s">%s</a></b></td>',
_('Server'),$ldap['DST']->getName(),_('Distinguished Name'), _('Server'),$ldap['DST']->getName(),_('Distinguished Name'),
htmlspecialchars($href),$request['dnDST']); htmlspecialchars($href),$request['dnDST']);
echo '</tr>'; echo '</tr>';
echo '<tr>'; echo '<tr>';
echo '<td colspan=4 align=right>'; echo '<td colspan="4" style="text-align: right;">';
echo '<form action="cmd.php?cmd=compare" method="post" name="compare_form">'; echo '<form action="cmd.php?cmd=compare" method="post">';
echo '<div>';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
printf('<input type="hidden" name="server_id_src" value="%s" />',$ldap['DST']->getIndex()); printf('<input type="hidden" name="server_id_src" value="%s" />',$ldap['DST']->getIndex());
printf('<input type="hidden" name="server_id_dst" value="%s" />',$ldap['SRC']->getIndex()); printf('<input type="hidden" name="server_id_dst" value="%s" />',$ldap['SRC']->getIndex());
printf('<input type="hidden" name="dn_src" value="%s" />',htmlspecialchars($request['dnDST'])); printf('<input type="hidden" name="dn_src" value="%s" />',htmlspecialchars($request['dnDST']));
printf('<input type="hidden" name="dn_dst" value="%s" />',htmlspecialchars($request['dnSRC'])); printf('<input type="hidden" name="dn_dst" value="%s" />',htmlspecialchars($request['dnSRC']));
printf('<input type="submit" value="%s" />',_('Switch Entry')); printf('<input type="submit" value="%s" />',_('Switch Entry'));
echo '</div>';
echo '</form>'; echo '</form>';
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
@ -110,13 +112,13 @@ foreach ($attrs_all as $attr) {
echo '<td class="title">&nbsp;</td>'; echo '<td class="title">&nbsp;</td>';
else { else {
echo '<td class="note" align="right">'; echo '<td class="note" style="text-align: right;">';
$request['pageSRC']->draw('Notes',$attributeSRC); $request['pageSRC']->draw('Notes',$attributeSRC);
echo '</td>'; echo '</td>';
} }
} else { } else {
echo '<td colspan=2>&nbsp;</td>'; echo '<td colspan="2">&nbsp;</td>';
} }
break; break;
@ -132,12 +134,12 @@ foreach ($attrs_all as $attr) {
echo '</td>'; echo '</td>';
} }
echo '<td class="note" align="right">'; echo '<td class="note" style="text-align: right;">';
$request['pageDST']->draw('Notes',$attributeDST); $request['pageDST']->draw('Notes',$attributeDST);
echo '</td>'; echo '</td>';
} else { } else {
echo '<td colspan=2>&nbsp;</td>'; echo '<td colspan="2">&nbsp;</td>';
} }
break; break;
@ -154,31 +156,30 @@ foreach ($attrs_all as $attr) {
echo '<tr>'; echo '<tr>';
foreach (array('src','dst') as $side) { foreach (array('src','dst') as $side) {
echo '<td class="value" colspan="2"><table border="0">';
echo '<tr><td>';
switch ($side) { switch ($side) {
case 'src': case 'src':
echo '<td class="value" colspan=2><table border=0>';
if ($attributeSRC && count($attributeSRC->getValues())) if ($attributeSRC && count($attributeSRC->getValues()))
$request['pageSRC']->draw('CurrentValues',$attributeSRC); $request['pageSRC']->draw('CurrentValues',$attributeSRC);
else else
echo '<tr><td>&nbsp;</td></tr>'; echo '&nbsp;';
echo '</table></td>';
break; break;
case 'dst': case 'dst':
echo '<td class="value" colspan=2><table>';
if ($attributeDST && count($attributeDST->getValues())) if ($attributeDST && count($attributeDST->getValues()))
$request['pageDST']->draw('CurrentValues',$attributeDST); $request['pageDST']->draw('CurrentValues',$attributeDST);
else else
echo '<tr><td>&nbsp;</td></tr>'; echo '&nbsp;';
echo '</table></td>';
break; break;
} }
echo '</td></tr>';
echo '</table></td>';
} }
echo '</tr>'; echo '</tr>';

View File

@ -28,25 +28,28 @@ $request['page']->accept();
$request['page']->drawTitle(sprintf('%s <b>%s</b>',_('Compare another DN with'),get_rdn($request['dn']))); $request['page']->drawTitle(sprintf('%s <b>%s</b>',_('Compare another DN with'),get_rdn($request['dn'])));
$request['page']->drawSubTitle(); $request['page']->drawSubTitle();
printf('<script type="text/javascript" language="javascript" src="%sdnChooserPopup.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sdnChooserPopup.js"></script>',JSDIR);
echo '<center>'; echo '<div style="text-align: center;">';
printf('%s <b>%s</b> %s<br />',_('Compare'),get_rdn($request['dn']),_('with ')); printf('%s <b>%s</b> %s<br />',_('Compare'),get_rdn($request['dn']),_('with '));
echo '</div>';
echo '<form action="cmd.php" method="post" name="compare_form">'; echo '<form action="cmd.php" method="post" id="compare_form">';
echo '<div>';
echo '<input type="hidden" name="cmd" value="compare" />'; echo '<input type="hidden" name="cmd" value="compare" />';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
printf('<input type="hidden" name="server_id_src" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id_src" value="%s" />',$app['server']->getIndex());
printf('<input type="hidden" name="dn_src" value="%s" />',htmlspecialchars($request['dn'])); printf('<input type="hidden" name="dn_src" value="%s" />',htmlspecialchars($request['dn']));
echo '</div>';
echo "\n"; echo "\n";
echo '<table style="border-spacing: 10px">'; echo '<table border="0" style="border-spacing: 10px; margin-left: auto; margin-right: auto;">';
echo '<tr>'; echo '<tr>';
printf('<td><acronym title="%s">%s</acronym>:</td>', printf('<td><acronym title="%s">%s</acronym>:</td>',
_('Compare this DN with another'),_('Destination DN')); _('Compare this DN with another'),_('Destination DN'));
echo '<td>'; echo '<td>';
echo '<input type="text" name="dn_dst" size="45" value="" />'; echo '<input type="text" name="dn_dst" size="45" value="" />';
draw_chooser_link('compare_form.dn_dst','true',''); draw_chooser_link('compare_form','dn_dst','true','');
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
echo "\n"; echo "\n";
@ -54,10 +57,9 @@ echo "\n";
printf('<tr><td>%s:</td><td>%s</td></tr>',_('Destination Server'),server_select_list($app['server']->getIndex(),true,'server_id_dst')); printf('<tr><td>%s:</td><td>%s</td></tr>',_('Destination Server'),server_select_list($app['server']->getIndex(),true,'server_id_dst'));
echo "\n"; echo "\n";
printf('<tr><td colspan="2" align="right"><input type="submit" value="%s" /></td></tr>',_('Compare')); printf('<tr><td colspan="2" style="text-align: center;"><input type="submit" value="%s" /></td></tr>',_('Compare'));
echo "\n"; echo "\n";
echo '</table>'; echo '</table>';
echo '</form>'; echo '</form>';
echo '</center>';
?> ?>

View File

@ -27,25 +27,28 @@ $request['page']->accept();
$request['page']->drawTitle(sprintf('%s <b>%s</b>',_('Copy'),get_rdn($request['dn']))); $request['page']->drawTitle(sprintf('%s <b>%s</b>',_('Copy'),get_rdn($request['dn'])));
$request['page']->drawSubTitle(); $request['page']->drawSubTitle();
printf('<script type="text/javascript" language="javascript" src="%sdnChooserPopup.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sdnChooserPopup.js"></script>',JSDIR);
echo '<center>'; echo '<div style="text-align: center;">';
printf('%s <b>%s</b> %s:<br /><br />',_('Copy'),get_rdn($request['dn']),_('to a new object')); printf('%s <b>%s</b> %s:<br /><br />',_('Copy'),get_rdn($request['dn']),_('to a new object'));
echo '</div>';
echo '<form action="cmd.php" method="post" name="copy_form">'; echo '<form action="cmd.php" method="post" id="copy_form">';
echo '<div>';
echo '<input type="hidden" name="cmd" value="copy" />'; echo '<input type="hidden" name="cmd" value="copy" />';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
printf('<input type="hidden" name="server_id_src" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id_src" value="%s" />',$app['server']->getIndex());
printf('<input type="hidden" name="dn_src" value="%s" />',htmlspecialchars($request['dn'])); printf('<input type="hidden" name="dn_src" value="%s" />',htmlspecialchars($request['dn']));
echo '</div>';
echo "\n"; echo "\n";
echo '<table style="border-spacing: 10px">'; echo '<table border="0" style="border-spacing: 10px; margin-left: auto; margin-right: auto;">';
echo '<tr>'; echo '<tr>';
printf('<td><acronym title="%s">%s</acronym>:</td>', printf('<td><acronym title="%s">%s</acronym>:</td>',
_('The full DN of the new entry to be created when copying the source entry'),_('Destination DN')); _('The full DN of the new entry to be created when copying the source entry'),_('Destination DN'));
echo '<td>'; echo '<td>';
printf('<input type="text" name="dn_dst" size="45" value="%s" />',htmlspecialchars($request['dn'])); printf('<input type="text" name="dn_dst" size="45" value="%s" />',htmlspecialchars($request['dn']));
draw_chooser_link('copy_form.dn_dst','true',get_rdn($request['dn'])); draw_chooser_link('copy_form','dn_dst','true',get_rdn($request['dn']));
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
echo "\n"; echo "\n";
@ -59,7 +62,7 @@ $request['children'] = $app['server']->getContainerContents($request['dn']);
if (count($request['children']) > 0) { if (count($request['children']) > 0) {
echo '<tr>'; echo '<tr>';
printf('<td><label for="recursive">%s</label>:</td>',_('Recursive copy')); printf('<td><label for="recursive">%s</label>:</td>',_('Recursive copy'));
echo '<td><input type="checkbox" id="recursive" name="recursive" onClick="copy_field_toggle(this)" />'; echo '<td><input type="checkbox" id="recursive" name="recursive" onclick="copy_field_toggle(this)" />';
printf('<small>(%s)</small></td>',_('Recursively copy all children of this object as well.')); printf('<small>(%s)</small></td>',_('Recursively copy all children of this object as well.'));
echo '</tr>'; echo '</tr>';
echo "\n"; echo "\n";
@ -83,19 +86,18 @@ if (count($request['children']) > 0) {
} }
echo "\n"; echo "\n";
printf('<tr><td colspan="2" align="right"><input type="submit" value="%s" /></td></tr>',_('Copy ')); printf('<tr><td colspan="2" style="text-align: center;"><input type="submit" value="%s" /></td></tr>',_('Copy '));
echo "\n"; echo "\n";
echo '</table>'; echo '</table>';
echo '</form>'; echo '</form>';
if ($_SESSION[APPCONFIG]->getValue('appearance','show_hints')) if ($_SESSION[APPCONFIG]->getValue('appearance','show_hints'))
printf('<small><img src="%s/light.png" alt="Light" /><span class="hint">%s</span></small>', printf('<div style="text-align: center;"><small><img src="%s/light.png" alt="Light" /><span class="hint">%s</span></small></div>',
IMGDIR,_('Hint: Copying between different servers only works if there are no schema violations')); IMGDIR,_('Hint: Copying between different servers only works if there are no schema violations'));
echo '</center>';
# Draw the javascrpt to enable/disable the filter field if this may be a recursive copy # Draw the javascrpt to enable/disable the filter field if this may be a recursive copy
if (count($request['children']) > 0) if (count($request['children']) > 0)
printf('<script type="text/javascript" language="javascript" src="%sform_field_toggle_enable.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sform_field_toggle_enable.js"></script>',JSDIR);
?> ?>

View File

@ -54,12 +54,14 @@ $request['page']->drawSubTitle(sprintf('%s: <b>%s</b>&nbsp;&nbsp;&nbsp;%s: <b>%s
# Confirm the creation # Confirm the creation
if (count($request['template']->getLDAPadd(true))) { if (count($request['template']->getLDAPadd(true))) {
echo '<center>'; echo '<div style="text-align: center;">';
echo _('Do you want to create this entry?'); echo _('Do you want to create this entry?');
echo '<br /><br />'; echo '<br /><br />';
echo '</div>';
echo "\n\n"; echo "\n\n";
echo '<form action="cmd.php" method="post">'; echo '<form action="cmd.php" method="post">';
echo '<div>';
echo '<input type="hidden" name="cmd" value="create" />'; echo '<input type="hidden" name="cmd" value="create" />';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
printf('<input type="hidden" name="container" value="%s" />',htmlspecialchars($request['template']->getContainer())); printf('<input type="hidden" name="container" value="%s" />',htmlspecialchars($request['template']->getContainer()));
@ -69,8 +71,9 @@ if (count($request['template']->getLDAPadd(true))) {
echo "\n"; echo "\n";
$request['page']->drawHiddenAttributes(); $request['page']->drawHiddenAttributes();
echo '</div>';
echo '<table class="result_table">'; echo '<table class="result_table" style="margin-left: auto; margin-right: auto;">';
echo "\n"; echo "\n";
printf('<tr class="heading"><td>%s</td><td>%s</td><td>%s</td></tr>', printf('<tr class="heading"><td>%s</td><td>%s</td><td>%s</td></tr>',
@ -78,7 +81,7 @@ if (count($request['template']->getLDAPadd(true))) {
echo "\n\n"; echo "\n\n";
$counter = 0; $counter = 0;
printf('<tr class="%s"><td colspan=3><center><b>%s</b></center></td><tr>',$counter%2 ? 'even' : 'odd',$request['template']->getDN()); printf('<tr class="%s"><td colspan="3" style="text-align: center;"><b>%s</b></td></tr>',$counter%2 ? 'even' : 'odd',$request['template']->getDN());
foreach ($request['template']->getLDAPadd(true) as $attribute) { foreach ($request['template']->getLDAPadd(true) as $attribute) {
$counter++; $counter++;
@ -106,21 +109,21 @@ if (count($request['template']->getLDAPadd(true))) {
echo '</table>'; echo '</table>';
echo '<div style="text-align: center;">';
echo '<br />'; echo '<br />';
printf('<input type="submit" value="%s" />',_('Commit')); printf('<input type="submit" value="%s" />',_('Commit'));
printf('<input type="submit" name="cancel" value="%s" />',_('Cancel')); printf('<input type="submit" name="cancel" value="%s" />',_('Cancel'));
echo '</div>';
echo '</form>'; echo '</form>';
echo '<br />'; echo '<br />';
echo '</center>';
} else { } else {
echo '<center>'; echo '<div style="text-align: center;">';
echo _('You made no changes'); echo _('You made no changes');
$href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s', $href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',
$app['server']->getIndex(),rawurlencode($request['dn'])); $app['server']->getIndex(),rawurlencode($request['dn']));
printf(' <a href="%s">%s</a>.',htmlspecialchars($href),_('Go back')); printf(' <a href="%s">%s</a>.',htmlspecialchars($href),_('Go back'));
echo '</center>'; echo '</div>';
} }
?> ?>

View File

@ -46,43 +46,43 @@ if (count($request['children'])) {
$query['deref'] = LDAP_DEREF_NEVER; $query['deref'] = LDAP_DEREF_NEVER;
$request['search'] = $app['server']->query($query,null); $request['search'] = $app['server']->query($query,null);
echo '<table class="forminput" border=0>'; echo '<table class="forminput" border="0">';
echo '<tr>'; echo '<tr>';
echo '<td colspan=2>'; echo '<td colspan="2">';
printf(_('This entry is the root of a sub-tree containing %s entries.'),count($request['search'])); printf(_('This entry is the root of a sub-tree containing %s entries.'),count($request['search']));
printf(' <small>(<a href="%s">%s</a>)</small>', printf(' <small>(<a href="%s">%s</a>)</small>',
$search['href'],_('view entries')); $search['href'],_('view entries'));
echo '</td></tr>'; echo '</td></tr>';
echo '<tr><td colspan=2>&nbsp;</td></tr>'; echo '<tr><td colspan="2">&nbsp;</td></tr>';
printf('<tr><td colspan=2>%s</td></tr>', printf('<tr><td colspan="2">%s</td></tr>',
sprintf(_('phpLDAPadmin can recursively delete this entry and all %s of its children. See below for a list of all the entries that this action will delete. Do you want to do this?'),count($request['search']))); sprintf(_('phpLDAPadmin can recursively delete this entry and all %s of its children. See below for a list of all the entries that this action will delete. Do you want to do this?'),count($request['search'])));
echo '<tr><td colspan=2>&nbsp;</td></tr>'; echo '<tr><td colspan="2">&nbsp;</td></tr>';
printf('<tr><td colspan=2><small>%s</small></td></tr>', printf('<tr><td colspan="2"><small>%s</small></td></tr>',
_('Note: this is potentially very dangerous and you do this at your own risk. This operation cannot be undone. Take into consideration aliases, referrals, and other things that may cause problems.')); _('Note: this is potentially very dangerous and you do this at your own risk. This operation cannot be undone. Take into consideration aliases, referrals, and other things that may cause problems.'));
echo "\n"; echo "\n";
echo '<tr>'; echo '<tr>';
echo '<td width=50%><center>'; echo '<td style="width: 50%; text-align: center;">';
echo '<form action="cmd.php" method="post">'; echo '<form action="cmd.php" method="post">';
echo '<input type="hidden" name="cmd" value="rdelete" />'; echo '<input type="hidden" name="cmd" value="rdelete" />';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($request['dn'])); printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($request['dn']));
printf('<input type="submit" value="%s" />',sprintf(_('Delete all %s objects'),count($request['search']))); printf('<input type="submit" value="%s" />',sprintf(_('Delete all %s objects'),count($request['search'])));
echo '</form>'; echo '</form>';
echo '</center></td>'; echo '</td>';
echo '<td width=50%><center>'; echo '<td style="width: 50%; text-align: center;">';
echo '<form action="cmd.php" method="get">'; echo '<form action="cmd.php" method="get">';
echo '<input type="hidden" name="cmd" value="template_engine" />'; echo '<input type="hidden" name="cmd" value="template_engine" />';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($request['dn'])); printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($request['dn']));
printf('<input type="submit" name="submit" value="%s" />',_('Cancel')); printf('<input type="submit" name="submit" value="%s" />',_('Cancel'));
echo '</form>'; echo '</form>';
echo '</center></td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
echo "\n"; echo "\n";
@ -101,19 +101,19 @@ if (count($request['children'])) {
echo "\n"; echo "\n";
} else { } else {
echo '<table class="forminput" border=0>'; echo '<table class="forminput" border="0">';
printf('<tr><td colspan=4>%s</td></tr>',_('Are you sure you want to permanently delete this object?')); printf('<tr><td colspan="4">%s</td></tr>',_('Are you sure you want to permanently delete this object?'));
echo '<tr><td colspan=4>&nbsp;</td></tr>'; echo '<tr><td colspan="4">&nbsp;</td></tr>';
printf('<tr><td width=10%%>%s:</td><td colspan=3 width=75%%><b>%s</b></td></tr>',_('Server'),$app['server']->getName()); printf('<tr><td style="width: 10%%;">%s:</td><td colspan="3" style="width: 75%%;"><b>%s</b></td></tr>',_('Server'),$app['server']->getName());
printf('<tr><td width=10%%><acronym title="%s">%s</acronym></td><td colspan=3 width=75%%><b>%s</b></td></tr>', printf('<tr><td style="width: 10%%;"><acronym title="%s">%s</acronym></td><td colspan="3" style="width: 75%%;"><b>%s</b></td></tr>',
_('Distinguished Name'),_('DN'),$request['dn']); _('Distinguished Name'),_('DN'),$request['dn']);
echo '<tr><td colspan=4>&nbsp;</td></tr>'; echo '<tr><td colspan="4">&nbsp;</td></tr>';
echo "\n"; echo "\n";
echo '<tr>'; echo '<tr>';
echo '<td colspan=2 width=50%><center>'; echo '<td colspan="2" style="width: 50%; text-align: center;">';
echo '<form action="cmd.php" method="post">'; echo '<form action="cmd.php" method="post">';
echo '<input type="hidden" name="cmd" value="delete" />'; echo '<input type="hidden" name="cmd" value="delete" />';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
@ -121,8 +121,8 @@ if (count($request['children'])) {
printf('<input type="submit" name="submit" value="%s" />',_('Delete')); printf('<input type="submit" name="submit" value="%s" />',_('Delete'));
echo '</form>'; echo '</form>';
echo '</center></td>'; echo '</td>';
echo '<td colspan=2 width=50%><center>'; echo '<td colspan="2" style="width: 50%; text-align: center;">';
echo '<form action="cmd.php" method="get">'; echo '<form action="cmd.php" method="get">';
echo '<input type="hidden" name="cmd" value="template_engine" />'; echo '<input type="hidden" name="cmd" value="template_engine" />';
@ -131,7 +131,7 @@ if (count($request['children'])) {
printf('<input type="submit" name="submit" value="%s" />',_('Cancel')); printf('<input type="submit" name="submit" value="%s" />',_('Cancel'));
echo '</form>'; echo '</form>';
echo '</center></td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
echo '</table>'; echo '</table>';
echo "\n"; echo "\n";

View File

@ -15,24 +15,26 @@ $www['page'] = new page();
$request = array(); $request = array();
$request['container'] = get_request('container','GET'); $request['container'] = get_request('container','GET');
$request['element'] = get_request('form_element','GET'); $request['form'] = get_request('form','GET');
$request['element'] = get_request('element','GET');
$request['rdn'] = get_request('rdn','GET'); $request['rdn'] = get_request('rdn','GET');
echo '<div class="popup">'; echo '<div class="popup">';
printf('<h3 class="subtitle">%s</h3>',_('Entry Chooser')); printf('<h3 class="subtitle">%s</h3>',_('Entry Chooser'));
echo '<script type="text/javascript" language="javascript">'; echo '<script type="text/javascript">';
echo ' function returnDN(dn) {'; echo ' function returnDN(dn) {';
printf(' opener.document.%s.value = dn;',$request['element']); printf(" eval ('o = opener.document.getElementById(\"%s\").%s;');",$request['form'],$request['element']);
echo ' o.value = dn;';
echo ' close();'; echo ' close();';
echo ' }'; echo ' }';
echo '</script>'; echo '</script>';
echo '<table class="forminput" width=100% border=0>'; echo '<table class="forminput" width="100%" border="0">';
if ($request['container']) { if ($request['container']) {
printf('<tr><td class="heading" colspan=3>%s:</td><td>%s</td></tr>',_('Server'),$app['server']->getName()); printf('<tr><td class="heading" colspan="3">%s:</td><td>%s</td></tr>',_('Server'),$app['server']->getName());
printf('<tr><td class="heading" colspan=3>%s:</td><td>%s</td></tr>',_('Looking in'),$request['container']); printf('<tr><td class="heading" colspan="3">%s:</td><td>%s</td></tr>',_('Looking in'),$request['container']);
echo '<tr><td class="blank" colspan=4>&nbsp;</td></tr>'; echo '<tr><td class="blank" colspan="4">&nbsp;</td></tr>';
} }
# Has the user already begun to descend into a specific server tree? # Has the user already begun to descend into a specific server tree?
@ -47,36 +49,36 @@ if (isset($app['server']) && ! is_null($request['container'])) {
if (! pla_compare_dns($request['container'],$base)) { if (! pla_compare_dns($request['container'],$base)) {
$parent_container = false; $parent_container = false;
$href['up'] = sprintf('entry_chooser.php?form_element=%s&rdn=%s',$request['element'],rawurlencode($request['rdn'])); $href['up'] = sprintf('entry_chooser.php?form=%s&element=%s&rdn=%s',$request['form'],$request['element'],rawurlencode($request['rdn']));
break; break;
} else { } else {
$parent_container = $app['server']->getContainer($request['container']); $parent_container = $app['server']->getContainer($request['container']);
$href['up'] = sprintf('entry_chooser.php?form_element=%s&rdn=%s&server_id=%s&container=%s', $href['up'] = sprintf('entry_chooser.php?form=%s&element=%s&rdn=%s&server_id=%s&container=%s',
$request['element'],$request['rdn'],$app['server']->getIndex(),rawurlencode($parent_container)); $request['form'],$request['element'],$request['rdn'],$app['server']->getIndex(),rawurlencode($parent_container));
} }
} }
echo '<tr>'; echo '<tr>';
echo '<td class="blank">&nbsp;</td>'; echo '<td class="blank">&nbsp;</td>';
printf('<td class="icon"><a href="%s"><img src="%s/up.png" alt="Up" /></a></td>',$href['up'],IMGDIR); printf('<td class="icon"><a href="%s"><img src="%s/up.png" alt="Up" /></a></td>',$href['up'],IMGDIR);
printf('<td colspan=2><a href="%s">%s...</a></td>',$href['up'],_('Back Up')); printf('<td colspan="2"><a href="%s">%s...</a></td>',$href['up'],_('Back Up'));
echo '</tr>'; echo '</tr>';
if (! count($request['children'])) if (! count($request['children']))
printf('<td class="blank" colspan=2>&nbsp;</td><td colspan=2">(%s)</td>',_('no entries')); printf('<td class="blank" colspan="2">&nbsp;</td><td colspan="2">(%s)</td>',_('no entries'));
else else
foreach ($request['children'] as $dn) { foreach ($request['children'] as $dn) {
$href['return'] = sprintf("javascript:returnDN('%s%s')",($request['rdn'] ? sprintf('%s,',$request['rdn']) : ''),rawurlencode($dn)); $href['return'] = sprintf("javascript:returnDN('%s%s')",($request['rdn'] ? sprintf('%s,',$request['rdn']) : ''),rawurlencode($dn));
$href['expand'] = sprintf('entry_chooser.php?server_id=%s&form_element=%s&rdn=%s&container=%s', $href['expand'] = sprintf('entry_chooser.php?server_id=%s&form=%s&element=%s&rdn=%s&container=%s',
$app['server']->getIndex(),$request['element'],$request['rdn'],rawurlencode($dn)); $app['server']->getIndex(),$request['form'],$request['element'],$request['rdn'],rawurlencode($dn));
echo '<tr>'; echo '<tr>';
echo '<td class="blank">&nbsp;</td>'; echo '<td class="blank">&nbsp;</td>';
printf('<td class="icon"><a href="%s"><img src="%s/plus.png" alt="Plus" /></a></td>',$href['expand'],IMGDIR); printf('<td class="icon"><a href="%s"><img src="%s/plus.png" alt="Plus" /></a></td>',$href['expand'],IMGDIR);
printf('<td colspan=2><a href="%s">%s</a></td>',$href['return'],$dn); printf('<td colspan="2"><a href="%s">%s</a></td>',$href['return'],$dn);
echo '</tr>'; echo '</tr>';
echo "\n\n"; echo "\n\n";
} }
@ -85,24 +87,24 @@ if (isset($app['server']) && ! is_null($request['container'])) {
} else { } else {
foreach ($_SESSION[APPCONFIG]->getServerList() as $index => $server) { foreach ($_SESSION[APPCONFIG]->getServerList() as $index => $server) {
if ($server->isLoggedIn(null)) { if ($server->isLoggedIn(null)) {
printf('<tr><td class="heading" colspan=3>%s:</td><td class="heading">%s</td></tr>',_('Server'),$server->getName()); printf('<tr><td class="heading" colspan="3">%s:</td><td class="heading">%s</td></tr>',_('Server'),$server->getName());
foreach ($server->getBaseDN() as $dn) { foreach ($server->getBaseDN() as $dn) {
if (! $dn) { if (! $dn) {
printf('<tr><td class="blank">&nbsp;</td><td colspan=3>(%s)</td></tr>',_('Could not determine base DN')); printf('<tr><td class="blank">&nbsp;</td><td colspan="3">(%s)</td></tr>',_('Could not determine base DN'));
} else { } else {
$href['return'] = sprintf("javascript:returnDN('%s%s')",($request['rdn'] ? sprintf('%s,',$request['rdn']) : ''),rawurlencode($dn)); $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_element=%s&rdn=%s&container=%s', $href['expand'] = htmlspecialchars(sprintf('entry_chooser.php?server_id=%s&form=%s&element=%s&rdn=%s&container=%s',
$server->getIndex(),$request['element'],$request['rdn'],rawurlencode($dn))); $server->getIndex(),$request['form'],$request['element'],$request['rdn'],rawurlencode($dn)));
echo '<tr>'; echo '<tr>';
echo '<td class="blank">&nbsp;</td>'; echo '<td class="blank">&nbsp;</td>';
printf('<td colspan=2 class="icon"><a href="%s"><img src="%s/plus.png" alt="Plus" /></a></td>',$href['expand'],IMGDIR); printf('<td colspan="2" class="icon"><a href="%s"><img src="%s/plus.png" alt="Plus" /></a></td>',$href['expand'],IMGDIR);
printf('<td colspan=2><a href="%s">%s</a></td>',$href['return'],$dn); printf('<td colspan="2"><a href="%s">%s</a></td>',$href['return'],$dn);
} }
} }
echo '<tr><td class="blank" colspan=4>&nbsp;</td></tr>'; echo '<tr><td class="blank" colspan="4">&nbsp;</td></tr>';
} }
} }
} }

View File

@ -36,16 +36,16 @@ $available_scopes = array(
$request['page'] = new PageRender($app['server']->getIndex(),get_request('template','REQUEST',false,'none')); $request['page'] = new PageRender($app['server']->getIndex(),get_request('template','REQUEST',false,'none'));
$request['page']->drawTitle(sprintf('<b>%s</b>',_('Export'))); $request['page']->drawTitle(sprintf('<b>%s</b>',_('Export')));
printf('<script type="text/javascript" language="javascript" src="%sdnChooserPopup.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sdnChooserPopup.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%sform_field_toggle_enable.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sform_field_toggle_enable.js"></script>',JSDIR);
echo '<br />'; echo '<br />';
echo '<center>'; echo '<form id="export_form" action="cmd.php" method="post">';
echo '<form name="export_form" action="cmd.php" method="post">'; echo '<div>';
echo '<input type="hidden" name="cmd" value="export" />'; echo '<input type="hidden" name="cmd" value="export" />';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
echo '<table class="forminput">'; echo '<table class="forminput" style="margin-left: auto; margin-right: auto;">';
echo '<tr>'; echo '<tr>';
echo '<td>'; echo '<td>';
@ -59,7 +59,7 @@ echo '<tr>';
printf('<td style="white-space:nowrap">%s</td>',_('Base DN')); printf('<td style="white-space:nowrap">%s</td>',_('Base DN'));
echo '<td><span style="white-space: nowrap;">'; echo '<td><span style="white-space: nowrap;">';
printf('<input type="text" name="dn" id="dn" style="width:230px" value="%s" />&nbsp;',htmlspecialchars($request['dn'])); printf('<input type="text" name="dn" id="dn" style="width:230px" value="%s" />&nbsp;',htmlspecialchars($request['dn']));
draw_chooser_link('export_form.dn'); draw_chooser_link('export_form','dn');
echo '</span></td>'; echo '</span></td>';
echo '</tr>'; echo '</tr>';
@ -70,7 +70,7 @@ echo '<td>';
foreach ($available_scopes as $id => $desc) foreach ($available_scopes as $id => $desc)
printf('<input type="radio" name="scope" value="%s" id="%s"%s /><label for="%s">%s</label><br />', printf('<input type="radio" name="scope" value="%s" id="%s"%s /><label for="%s">%s</label><br />',
htmlspecialchars($id),$id,($id == $request['scope']) ? 'checked="true"' : '', htmlspecialchars($id),$id,($id == $request['scope']) ? 'checked="checked"' : '',
htmlspecialchars($id),$desc); htmlspecialchars($id),$desc);
echo '</td>'; echo '</td>';
@ -84,12 +84,12 @@ printf('<tr><td>%s</td><td><input type="text" name="attributes" style="width:300
_('Show Attributtes'),htmlspecialchars($request['attr'])); _('Show Attributtes'),htmlspecialchars($request['attr']));
printf('<tr><td>&nbsp;</td><td><input type="checkbox" name="sys_attr" id="sys_attr" %s/> <label for="sys_attr">%s</label></td></tr>', printf('<tr><td>&nbsp;</td><td><input type="checkbox" name="sys_attr" id="sys_attr" %s/> <label for="sys_attr">%s</label></td></tr>',
$request['sys_attr'] ? 'checked="true" ' : '',_('Include system attributes')); $request['sys_attr'] ? 'checked="checked" ' : '',_('Include system attributes'));
printf('<tr><td>&nbsp;</td><td><input type="checkbox" id="save_as_file" name="save_as_file" onclick="export_field_toggle(this)" /> <label for="save_as_file">%s</label></td></tr>', printf('<tr><td>&nbsp;</td><td><input type="checkbox" id="save_as_file" name="save_as_file" onclick="export_field_toggle(this)" /> <label for="save_as_file">%s</label></td></tr>',
_('Save as file')); _('Save as file'));
printf('<tr><td>&nbsp;</td><td><input type="checkbox" id="compress" name="compress" disabled /> <label for="compress">%s</label></td></tr>', printf('<tr><td>&nbsp;</td><td><input type="checkbox" id="compress" name="compress" disabled="disabled" /> <label for="compress">%s</label></td></tr>',
_('Compress')); _('Compress'));
echo '</table>'; echo '</table>';
@ -109,9 +109,9 @@ printf('<legend>%s</legend>',_('Export format'));
foreach (Exporter::types() as $index => $exporter) { foreach (Exporter::types() as $index => $exporter) {
printf('<input type="radio" name="exporter_id" id="exporter_id_%s" value="%s"%s/>', printf('<input type="radio" name="exporter_id" id="exporter_id_%s" value="%s"%s/>',
htmlspecialchars($exporter['type']),htmlspecialchars($exporter['type']),($exporter['type'] === $request['exporter_id']) ? ' checked="true"' : ''); htmlspecialchars($exporter['type']),htmlspecialchars($exporter['type']),($exporter['type'] === $request['exporter_id']) ? ' checked="checked"' : '');
printf('<label for="%s">%s</label><br />', printf('<label for="exporter_id_%s">%s</label><br />',
htmlspecialchars($exporter['type']),$exporter['type']); htmlspecialchars($exporter['type']),$exporter['type']);
} }
@ -124,7 +124,7 @@ echo '<fieldset style="height: 100px">';
printf('<legend>%s</legend>',_('Line ends')); printf('<legend>%s</legend>',_('Line ends'));
foreach ($available_formats as $id => $desc) foreach ($available_formats as $id => $desc)
printf('<input type="radio" name="format" value="%s" id="%s"%s /><label for="%s">%s</label><br />', printf('<input type="radio" name="format" value="%s" id="%s"%s /><label for="%s">%s</label><br />',
htmlspecialchars($id),htmlspecialchars($id),($request['format']==$id) ? ' checked="true"' : '', htmlspecialchars($id),htmlspecialchars($id),($request['format']==$id) ? ' checked="checked"' : '',
htmlspecialchars($id),$desc); htmlspecialchars($id),$desc);
echo '</fieldset>'; echo '</fieldset>';
@ -134,13 +134,13 @@ echo '</td>';
echo '</tr>'; echo '</tr>';
printf('<tr><td colspan="2"><center><input type="submit" name="target" value="%s" /></center></td></tr>', printf('<tr><td colspan="2" style="text-align: center;"><input type="submit" name="target" value="%s" /></td></tr>',
htmlspecialchars(_('Proceed >>'))); htmlspecialchars(_('Proceed >>')));
echo '</table>'; echo '</table>';
echo '</div>';
echo '</form>'; echo '</form>';
echo '</center>';
/** /**
* Helper function for fetching the line end format. * Helper function for fetching the line end format.

View File

@ -19,14 +19,15 @@ $request['page'] = new PageRender($app['server']->getIndex(),get_request('templa
$request['page']->drawTitle(sprintf('<b>%s</b>',_('Import'))); $request['page']->drawTitle(sprintf('<b>%s</b>',_('Import')));
$request['page']->drawSubTitle(sprintf('%s: <b>%s</b>',_('Server'),$app['server']->getName())); $request['page']->drawSubTitle(sprintf('%s: <b>%s</b>',_('Server'),$app['server']->getName()));
echo '<center>';
echo '<form action="cmd.php" method="post" class="new_value" enctype="multipart/form-data">'; echo '<form action="cmd.php" method="post" class="new_value" enctype="multipart/form-data">';
echo '<div>';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
echo '<input type="hidden" name="cmd" value="import" />'; echo '<input type="hidden" name="cmd" value="import" />';
echo '</div>';
echo '<table class="forminput" border=0>'; echo '<table class="forminput" border="0" style="margin-left: auto; margin-right: auto;">';
echo '<tr><td colspan=2>&nbsp;</td></tr>'; echo '<tr><td colspan="2">&nbsp;</td></tr>';
echo '<tr>'; echo '<tr>';
printf('<td>%s</td>',_('Select an LDIF file')); printf('<td>%s</td>',_('Select an LDIF file'));
echo '<td>'; echo '<td>';
@ -35,14 +36,13 @@ echo '</td></tr>';
printf('<tr><td>&nbsp;</td><td class="small"><b>%s %s</b></td></tr>',_('Maximum file size'),ini_get('upload_max_filesize')); printf('<tr><td>&nbsp;</td><td class="small"><b>%s %s</b></td></tr>',_('Maximum file size'),ini_get('upload_max_filesize'));
echo '<tr><td colspan=2>&nbsp;</td></tr>'; echo '<tr><td colspan="2">&nbsp;</td></tr>';
printf('<tr><td>%s</td></tr>',_('Or paste your LDIF here')); printf('<tr><td>%s</td></tr>',_('Or paste your LDIF here'));
echo '<tr><td colspan=2><textarea name="ldif" rows="20" cols="100"></textarea></td></tr>'; echo '<tr><td colspan="2"><textarea name="ldif" rows="20" cols="100"></textarea></td></tr>';
echo '<tr><td colspan=2>&nbsp;</td></tr>'; echo '<tr><td colspan="2">&nbsp;</td></tr>';
printf('<tr><td>&nbsp;</td><td class="small"><input type="checkbox" name="continuous_mode" value="1" />%s</td></tr>', printf('<tr><td>&nbsp;</td><td class="small"><input type="checkbox" name="continuous_mode" value="1" />%s</td></tr>',
_("Don't stop on errors")); _("Don't stop on errors"));
printf('<tr><td>&nbsp;</td><td><input type="submit" value="%s" /></td></tr>',_('Proceed >>')); printf('<tr><td>&nbsp;</td><td><input type="submit" value="%s" /></td></tr>',_('Proceed >>'));
echo '</table>'; echo '</table>';
echo '</form>'; echo '</form>';
echo '</center>';
?> ?>

View File

@ -1,6 +1,6 @@
function dnChooserPopup(form_element,rdn) function dnChooserPopup(form,element,rdn)
{ {
mywindow=open('entry_chooser.php','myname','resizable=no,width=600,height=370,scrollbars=1'); mywindow=open('entry_chooser.php','myname','resizable=no,width=600,height=370,scrollbars=1');
mywindow.location.href = 'entry_chooser.php?form_element=' + form_element + '&rdn=' + rdn; mywindow.location.href = 'entry_chooser.php?form=' + form + '&element=' + element + '&rdn=' + rdn;
if (mywindow.opener == null) mywindow.opener = self; if (mywindow.opener == null) mywindow.opener = self;
} }

View File

@ -1,5 +1,5 @@
var m1 = document.member.notmembers; var m1 = document.getElementById('member').notmembers;
var m2 = document.member.members; var m2 = document.getElementById('member').members;
/* This function generates hidden input array from new group members /* This function generates hidden input array from new group members
* when submit button is pressed. * when submit button is pressed.

View File

@ -17,13 +17,11 @@ echo '<br />';
# Check for a secure connection # Check for a secure connection
if (! isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on') { if (! isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on') {
echo '<center>'; echo '<div style="text-align: center; color:red">';
echo '<span style="color:red">';
printf('<acronym title="%s"><b>%s: %s.</b></acronym>', printf('<acronym title="%s"><b>%s: %s.</b></acronym>',
_('You are not using \'https\'. Web browser will transmit login information in clear text.'), _('You are not using \'https\'. Web browser will transmit login information in clear text.'),
_('Warning'),_('This web connection is unencrypted')); _('Warning'),_('This web connection is unencrypted'));
echo '</span>'; echo '</div>';
echo '</center>';
echo '<br />'; echo '<br />';
} }
@ -54,15 +52,17 @@ if ($app['server']->getAuthType() == 'http') {
# HTML Login Form # HTML Login Form
} else { } else {
echo '<form action="cmd.php" method="post" name="login_form">'; echo '<form action="cmd.php" method="post">';
echo '<div>';
echo '<input type="hidden" name="cmd" value="login" />'; echo '<input type="hidden" name="cmd" value="login" />';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
if (get_request('redirect','GET',false,false)) if (get_request('redirect','GET',false,false))
printf('<input type="hidden" name="redirect" value="%s" />',rawurlencode(get_request('redirect','GET'))); printf('<input type="hidden" name="redirect" value="%s" />',rawurlencode(get_request('redirect','GET')));
echo '<center>'; echo '</div>';
echo '<table class="forminput">';
echo '<table class="forminput" style="margin-left: auto; margin-right: auto;">';
printf('<tr><td><b>%s:</b></td></tr>', printf('<tr><td><b>%s:</b></td></tr>',
$app['server']->getValue('login','auth_text') ? $app['server']->getValue('login','auth_text') : $app['server']->getValue('login','auth_text') ? $app['server']->getValue('login','auth_text') :
@ -71,28 +71,27 @@ if ($app['server']->getAuthType() == 'http') {
printf('<tr><td><input type="text" id="login" name="login" size="40" value="%s" /></td></tr>', printf('<tr><td><input type="text" id="login" name="login" size="40" value="%s" /></td></tr>',
$app['server']->getValue('login','attr',false) == 'dn' ? $app['server']->getValue('login','bind_id') : ''); $app['server']->getValue('login','attr',false) == 'dn' ? $app['server']->getValue('login','bind_id') : '');
echo '<tr><td colspan=2>&nbsp;</td></tr>'; echo '<tr><td colspan="2">&nbsp;</td></tr>';
printf('<tr><td><b>%s:</b></td></tr>',_('Password')); printf('<tr><td><b>%s:</b></td></tr>',_('Password'));
echo '<tr><td><input type="password" id="password" size="40" value="" name="login_pass" /></td></tr>'; echo '<tr><td><input type="password" id="password" size="40" value="" name="login_pass" /></td></tr>';
echo '<tr><td colspan=2>&nbsp;</td></tr>'; echo '<tr><td colspan="2">&nbsp;</td></tr>';
# If Anon bind allowed, then disable the form if the user choose to bind anonymously. # If Anon bind allowed, then disable the form if the user choose to bind anonymously.
if ($app['server']->isAnonBindAllowed()) if ($app['server']->isAnonBindAllowed())
printf('<tr><td colspan="2"><small><b>%s</b></small> <input type="checkbox" name="anonymous_bind" onclick="form_field_toggle_enable(this,[\'login\',\'password\'],\'login\')" id="anonymous_bind_checkbox" /></td></tr>', printf('<tr><td colspan="2"><small><b>%s</b></small> <input type="checkbox" name="anonymous_bind" onclick="form_field_toggle_enable(this,[\'login\',\'password\'],\'login\')" id="anonymous_bind_checkbox" /></td></tr>',
_('Anonymous')); _('Anonymous'));
printf('<tr><td colspan="2"><center><input type="submit" name="submit" value="%s" /></center></td></tr>', printf('<tr><td colspan="2" style="text-align: center;"><input type="submit" name="submit" value="%s" /></td></tr>',
_('Authenticate')); _('Authenticate'));
echo '</table>'; echo '</table>';
echo '</center>';
echo '</form>'; echo '</form>';
echo '<br/>'; echo '<br/>';
echo '<script type="text/javascript" language="javascript">document.getElementById("login").focus()</script>'; echo '<script type="text/javascript">document.getElementById("login").focus()</script>';
if ($app['server']->isAnonBindAllowed()) if ($app['server']->isAnonBindAllowed())
printf('<script type="text/javascript" language="javascript" src="%sform_field_toggle_enable.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sform_field_toggle_enable.js"></script>',JSDIR);
} }
?> ?>

View File

@ -46,27 +46,27 @@ printf('<h3 class="subtitle">%s: <b>%s</b></h3>',_('Server'),$app['server']->get
echo "\n"; echo "\n";
echo '<center>'; echo '<center>';
echo '<table class="forminput" border=0>'; echo '<table class="forminput" border="0">';
if (count($request['parent']) == 1) if (count($request['parent']) == 1)
printf('<tr><td colspan=4><b>%s</b></td></tr>',_('Are you sure you want to permanently delete this object?')); printf('<tr><td colspan="4"><b>%s</b></td></tr>',_('Are you sure you want to permanently delete this object?'));
else else
printf('<tr><td colspan=4><b>%s</b></td></tr>',_('Are you sure you want to permanently delete these objects?')); printf('<tr><td colspan="4"><b>%s</b></td></tr>',_('Are you sure you want to permanently delete these objects?'));
echo '<tr><td colspan=4>&nbsp;</td></tr>'; echo '<tr><td colspan="4">&nbsp;</td></tr>';
printf('<tr><td width=10%%>%s:</td><td colspan=3 width=75%%><b>%s</b></td></tr>',_('Server'),$app['server']->getName()); printf('<tr><td style="width: 10%%;">%s:</td><td colspan="3" style="width: 75%%;"><b>%s</b></td></tr>',_('Server'),$app['server']->getName());
foreach ($request['parent'] as $dn) foreach ($request['parent'] as $dn)
printf('<tr><td width=10%%><acronym title="%s">%s</acronym></td><td colspan=3 width=75%%><b>%s</b></td></tr>', printf('<tr><td style="width: 10%%;"><acronym title="%s">%s</acronym></td><td colspan="3" style="width: 75%%;"><b>%s</b></td></tr>',
_('Distinguished Name'),_('DN'),$dn); _('Distinguished Name'),_('DN'),$dn);
echo '<tr><td colspan=4>&nbsp;</td></tr>'; echo '<tr><td colspan="4">&nbsp;</td></tr>';
$request['delete'] = $request['parent']; $request['delete'] = $request['parent'];
if (count($request['children'])) { if (count($request['children'])) {
printf('<tr><td colspan=4><b>%s</b></td></tr>',_('Permanently delete all children also?')); printf('<tr><td colspan="4"><b>%s</b></td></tr>',_('Permanently delete all children also?'));
echo '<tr><td colspan=4>&nbsp;</td></tr>'; echo '<tr><td colspan="4">&nbsp;</td></tr>';
# We need to see if the children have children # We need to see if the children have children
$query = array(); $query = array();
@ -85,28 +85,28 @@ if (count($request['children'])) {
array_push($request['delete'],$value['dn']); array_push($request['delete'],$value['dn']);
echo '<tr>'; echo '<tr>';
echo '<td colspan=4>'; echo '<td colspan="4">';
printf(_('This request also includes %s children entries.'),count($request['children'])); printf(_('This request also includes %s children entries.'),count($request['children']));
echo '</td></tr>'; echo '</td></tr>';
printf('<tr><td colspan=4>%s</td></tr>', printf('<tr><td colspan="4">%s</td></tr>',
sprintf(_('phpLDAPadmin can also recursively delete all %s of the child entries. See below for a list of all the entries that this action will delete. Do you want to do this?'),count($request['children']))); sprintf(_('phpLDAPadmin can also recursively delete all %s of the child entries. See below for a list of all the entries that this action will delete. Do you want to do this?'),count($request['children'])));
echo '<tr><td colspan=4>&nbsp;</td></tr>'; echo '<tr><td colspan="4">&nbsp;</td></tr>';
printf('<tr><td colspan=4><small>%s</small></td></tr>', printf('<tr><td colspan="4"><small>%s</small></td></tr>',
_('Note: this is potentially very dangerous and you do this at your own risk. This operation cannot be undone. Take into consideration aliases, referrals, and other things that may cause problems.')); _('Note: this is potentially very dangerous and you do this at your own risk. This operation cannot be undone. Take into consideration aliases, referrals, and other things that may cause problems.'));
echo "\n"; echo "\n";
echo '<tr><td colspan=4>&nbsp;</td></tr>'; echo '<tr><td colspan="4">&nbsp;</td></tr>';
echo "\n"; echo "\n";
printf('<tr><td colspan=4><center><b>%s</b></center></td></tr>',_('List of entries to be deleted:')); printf('<tr><td colspan="4"><center><b>%s</b></center></td></tr>',_('List of entries to be deleted:'));
echo '<tr><td colspan=4>&nbsp;</td></tr>'; echo '<tr><td colspan="4">&nbsp;</td></tr>';
$i = 0; $i = 0;
echo '<tr><td colspan=4><center>'; echo '<tr><td colspan="4"><center>';
printf('<select size="%s" multiple disabled style="background:white; color:black;width:500px" >',min(10,count($request['delete']))); printf('<select size="%s" multiple disabled style="background:white; color:black;width:500px" >',min(10,count($request['delete'])));
foreach ($request['delete'] as $key => $value) foreach ($request['delete'] as $key => $value)
printf('<option>%s. %s</option>',++$i,htmlspecialchars(dn_unescape($value))); printf('<option>%s. %s</option>',++$i,htmlspecialchars(dn_unescape($value)));
@ -114,11 +114,11 @@ if (count($request['children'])) {
echo '</center></td></tr>'; echo '</center></td></tr>';
echo "\n"; echo "\n";
echo '<tr><td colspan=4>&nbsp;</td></tr>'; echo '<tr><td colspan="4">&nbsp;</td></tr>';
} }
echo '<tr>'; echo '<tr>';
echo '<td width=50% colspan=2><center>'; echo '<td colspan="2" style="width: 50%; text-align: center;">';
echo '<form action="cmd.php" method="post">'; echo '<form action="cmd.php" method="post">';
echo '<input type="hidden" name="cmd" value="rdelete" />'; echo '<input type="hidden" name="cmd" value="rdelete" />';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
@ -128,7 +128,7 @@ printf('<input type="submit" value="%s" />',sprintf(_('Delete all %s objects'),c
echo '</form>'; echo '</form>';
echo '</center></td>'; echo '</center></td>';
echo '<td colspan=2 width=50%><center>'; echo '<td colspan="2" style="width: 50%; text-align: center;">';
echo '<form action="cmd.php" method="get">'; echo '<form action="cmd.php" method="get">';
echo '<input type="hidden" name="cmd" value="template_engine" />'; echo '<input type="hidden" name="cmd" value="template_engine" />';

View File

@ -64,13 +64,16 @@ $request['page'][0]->drawTitle(_('Bulk edit the following DNs'));
$request['page'][0]->drawSubTitle(sprintf('%s: <b>%s</b>',_('Server'),$app['server']->getName())); $request['page'][0]->drawSubTitle(sprintf('%s: <b>%s</b>',_('Server'),$app['server']->getName()));
echo '<form action="cmd.php" method="post">'; echo '<form action="cmd.php" method="post">';
echo '<div>';
echo '<input type="hidden" name="cmd" value="mass_update" />'; echo '<input type="hidden" name="cmd" value="mass_update" />';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
foreach ($request['page'] as $j => $page) foreach ($request['page'] as $j => $page)
printf('<input type="hidden" name="dn[%s]" value="%s" />',$j,$page->getTemplate()->getDN()); printf('<input type="hidden" name="dn[%s]" value="%s" />',$j,$page->getTemplate()->getDN());
echo '<table class="result_table" border=0>'; echo '</div>';
echo '<table class="result_table" border="0">';
echo '<tr class="heading">'; echo '<tr class="heading">';
echo '<td>DN</td>'; echo '<td>DN</td>';
@ -122,7 +125,9 @@ foreach ($request['page'] as $j => $page) {
} }
echo '</table>'; echo '</table>';
echo '<div>';
echo '<br/>'; echo '<br/>';
printf('<input type="submit" id="save_button" name="submit" value="%s" />',_('Update Values')); printf('<input type="submit" id="save_button" name="submit" value="%s" />',_('Update Values'));
echo '</div>';
echo '</form>'; echo '</form>';
?> ?>

View File

@ -71,12 +71,12 @@ if (count($request['update'])) {
foreach ($request['update'] as $j => $page) foreach ($request['update'] as $j => $page)
printf('<input type="hidden" name="dn[%s]" value="%s" />',$j,$page->getTemplate()->getDN()); printf('<input type="hidden" name="dn[%s]" value="%s" />',$j,$page->getTemplate()->getDN());
echo '<table class="result_box" width=100% border=1>'; echo '<table class="result_box" width="100%" border="1">';
echo '<tr><td>'; echo '<tr><td>';
echo '<br/>'; echo '<br/>';
echo '<table class="result" border=0>'; echo '<table class="result" border="0">';
echo '<tr><td>'; echo '<tr><td>';
printf(_('There will be %s updates done with this mass update'),sprintf('<b>%s</b>',count($request['update']))); printf(_('There will be %s updates done with this mass update'),sprintf('<b>%s</b>',count($request['update'])));
echo '</td></tr>'; echo '</td></tr>';
@ -87,15 +87,15 @@ if (count($request['update'])) {
foreach ($request['update'] as $index => $page) { foreach ($request['update'] as $index => $page) {
$template = $page->getTemplate(); $template = $page->getTemplate();
echo '<table class="result" border=0>'; echo '<table class="result" border="0">';
echo '<tr class="list_title">'; echo '<tr class="list_title">';
printf('<td class="icon"><img src="%s/%s" alt="icon" /></td>',IMGDIR,get_icon($app['server']->getIndex(),$template->getDN())); printf('<td class="icon"><img src="%s/%s" alt="icon" /></td>',IMGDIR,get_icon($app['server']->getIndex(),$template->getDN()));
printf('<td colspan=3><a href="cmd.php?cmd=template_engine&amp;server_id=%s&amp;dn=%s">%s</a></td>', printf('<td colspan="3"><a href="cmd.php?cmd=template_engine&amp;server_id=%s&amp;dn=%s">%s</a></td>',
$app['server']->getIndex(),rawurlencode(dn_unescape($template->getDN())),htmlspecialchars(get_rdn($template->getDN()))); $app['server']->getIndex(),rawurlencode(dn_unescape($template->getDN())),htmlspecialchars(get_rdn($template->getDN())));
echo '</tr>'; echo '</tr>';
printf('<tr class="list_item"><td class="blank">&nbsp;</td><td class="heading">dn</td><td class="value" width="45%%">%s</td><td class="value" width="45%%"><b>%s</b></td></tr>', printf('<tr class="list_item"><td class="blank">&nbsp;</td><td class="heading">dn</td><td class="value" style="width: 45%%;">%s</td><td class="value" style="width: 45%%;"><b>%s</b></td></tr>',
htmlspecialchars(dn_unescape($template->getDN())),_('Old Value')); htmlspecialchars(dn_unescape($template->getDN())),_('Old Value'));
foreach ($template->getLDAPmodify(true,$index) as $attribute) { foreach ($template->getLDAPmodify(true,$index) as $attribute) {

View File

@ -79,12 +79,13 @@ usort($possible_members,'pla_compare_dns');
echo '<br />'; echo '<br />';
echo '<br />'; echo '<br />';
printf('<script type="text/javascript" language="javascript" src="%smodify_member.js"></script>',JSDIR); echo '<form action="cmd.php" method="post" class="add_value" id="member">';
echo '<form action="cmd.php" method="post" class="add_value" name="member">'; echo '<div>';
if ($_SESSION[APPCONFIG]->getValue('confirm','update')) if ($_SESSION[APPCONFIG]->getValue('confirm','update'))
echo '<input type="hidden" name="cmd" value="update_confirm" />'; echo '<input type="hidden" name="cmd" value="update_confirm" />';
else else
echo '<input type="hidden" name="cmd" value="update" />'; echo '<input type="hidden" name="cmd" value="update" />';
echo '</div>';
echo '<table class="modify_members">'; echo '<table class="modify_members">';
@ -96,20 +97,20 @@ echo '</tr>';
# Generate select box from all possible members # Generate select box from all possible members
echo '<tr>'; echo '<tr>';
echo '<td>'; echo '<td>';
echo '<select name="notmembers" size="10" multiple>'; echo '<select name="notmembers" size="10" multiple="multiple">';
foreach ($possible_members as $possible) foreach ($possible_members as $possible)
printf('<option>%s</option>',$possible); printf('<option>%s</option>',htmlspecialchars($possible));
echo '</select>'; echo '</select>';
echo '</td>'; echo '</td>';
# Generate select box from all current members # Generate select box from all current members
echo '<td>'; echo '<td>';
echo '<select name="members" size="10" multiple>'; echo '<select name="members" size="10" multiple="multiple">';
foreach ($current_members as $current) foreach ($current_members as $current)
printf('<option>%s</option>',$current); printf('<option>%s</option>',htmlspecialchars($current));
echo '</select>'; echo '</select>';
echo '</td>'; echo '</td>';
@ -119,11 +120,11 @@ echo '</tr>';
# Show buttons which move users from left to right and vice versa # Show buttons which move users from left to right and vice versa
echo '<tr>'; echo '<tr>';
echo '<td>'; echo '<td>';
printf('<input type="button" onClick="one2two()" value="%s >>" />&nbsp;<input type="button" onClick="all2two()" value="%s >>" />', printf('<input type="button" onclick="one2two()" value="%s >>" />&nbsp;<input type="button" onclick="all2two()" value="%s >>" />',
_('Add selected'),_('Add all')); _('Add selected'),_('Add all'));
echo '</td>'; echo '</td>';
echo '<td>'; echo '<td>';
printf('<input type="button" onClick="two2one()" value="<< %s" />&nbsp;<input type="button" onClick="all2one()" value="<< %s" />', printf('<input type="button" onclick="two2one()" value="<< %s" />&nbsp;<input type="button" onclick="all2one()" value="<< %s" />',
_('Remove selected'),('Remove all')); _('Remove selected'),('Remove all'));
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
@ -149,10 +150,10 @@ printf('<input type="hidden" name="new_values[%s][]" value="" />',htmlspecialcha
echo '</div>'; echo '</div>';
# Submit values to update_confirm.php and when clicked, run addSelected # Submit values to update_confirm.php and when clicked, run addSelected
printf('<input type="submit" name="save" value="%s" onClick="update_new_values(\'%s\')" />',_('Save changes'),$request['attr']); printf('<input type="submit" name="save" value="%s" onclick="update_new_values(\'%s\')" />',_('Save changes'),$request['attr']);
echo '</td></tr>'; echo '</td></tr>';
echo '</table>'; echo '</table>';
echo '</form>'; echo '</form>';
echo '</body></html>'; printf('<script type="text/javascript" src="%smodify_member.js"></script>',JSDIR);
?> ?>

View File

@ -28,13 +28,13 @@ if (! isset($attrs['monitorcontext']) || ! count($results))
printf('<h3 class="title">%s%s</h3>',_('Monitor info for: '),$app['server']->getName()); printf('<h3 class="title">%s%s</h3>',_('Monitor info for: '),$app['server']->getName());
printf('<h3 class="subtitle">%s</h3>',_('Server reports the following information about itself')); printf('<h3 class="subtitle">%s</h3>',_('Server reports the following information about itself'));
echo '<table class="result" border=0>'; echo '<table class="result" border="0">';
# cn=Monitor # cn=Monitor
printf('<tr class="list_item"><td class="heading" rowspan=2>%s</td></tr>',_('LDAP Server')); printf('<tr class="list_item"><td class="heading" rowspan="2">%s</td></tr>',_('LDAP Server'));
printf('<tr class="list_item"><td class="value">'); printf('<tr class="list_item"><td class="value">');
echo '<table class="result" border=0>'; echo '<table class="result" border="0">';
printf('<tr><td>%s</td></tr>',$results[$attrs['monitorcontext'][0]]['monitoredinfo'][0]); printf('<tr><td>%s</td></tr>',$results[$attrs['monitorcontext'][0]]['monitoredinfo'][0]);
echo '</table>'; echo '</table>';
@ -53,10 +53,10 @@ foreach (array(
$description = ''; $description = '';
} }
printf('<tr class="list_item"><td class="heading" rowspan=2><acronym title="%s">%s</acronym></td></tr>',$description,$dn); printf('<tr class="list_item"><td class="heading" rowspan="2"><acronym title="%s">%s</acronym></td></tr>',$description,$dn);
echo '<tr class="list_item"><td class="value">'; echo '<tr class="list_item"><td class="value">';
echo '<table class="result"><tr><td>'; echo '<table class="result"><tr><td>';
echo '<table class="result_table" border=0 width="100%">'; echo '<table class="result_table" border="0" width="100%">';
$attrs = array( $attrs = array(
'monitorruntimeconfig', 'monitorruntimeconfig',
@ -64,10 +64,10 @@ foreach (array(
); );
echo '<tr class="highlight">'; echo '<tr class="highlight">';
printf('<td width="10%%">%s</td><td width="20%%">%s</td>',_('Type'),'namingContext'); printf('<td style="width: 10%%;">%s</td><td style="width: 20%%;">%s</td>',_('Type'),'namingContext');
foreach ($attrs as $attr) foreach ($attrs as $attr)
printf('<td width="20%%">%s</td>',$attr); printf('<td style="width: 20%%;">%s</td>',$attr);
echo '</tr>'; echo '</tr>';
@ -129,14 +129,14 @@ foreach (array(
} }
# cn=Connections,cn=Monitor # cn=Connections,cn=Monitor
printf('<tr class="list_item"><td class="heading" rowspan=2><acronym title="%s">%s</acronym></td></tr>',$results['cn=Connections,cn=Monitor']['description'],_('LDAP Connections')); printf('<tr class="list_item"><td class="heading" rowspan="2"><acronym title="%s">%s</acronym></td></tr>',$results['cn=Connections,cn=Monitor']['description'],_('LDAP Connections'));
printf('<tr class="list_item"><td class="value">'); printf('<tr class="list_item"><td class="value">');
echo '<table class="result"><tr><td>'; echo '<table class="result"><tr><td>';
echo '<table class="result_table" border=0 width="100%">'; echo '<table class="result_table" border="0" width="100%">';
printf('<tr class="highlight"><td class="20%%">%s</td><td class="value" width="80%%">%s</td></tr>', printf('<tr class="highlight"><td class="20%%">%s</td><td class="value" style="width: 80%%;">%s</td></tr>',
_('Total Connections'),$results['cn=Total,cn=Connections,cn=Monitor']['monitorcounter']); _('Total Connections'),$results['cn=Total,cn=Connections,cn=Monitor']['monitorcounter']);
printf('<tr class="highlight"><td class="20%%">%s</td><td class="value" width="80%%">%s</td></tr>', printf('<tr class="highlight"><td class="20%%">%s</td><td class="value" style="width: 80%%;">%s</td></tr>',
_('Current Connections'),$results['cn=Current,cn=Connections,cn=Monitor']['monitorcounter']); _('Current Connections'),$results['cn=Current,cn=Connections,cn=Monitor']['monitorcounter']);
# Look for some connections # Look for some connections
@ -146,7 +146,7 @@ foreach ($results as $key => $value) {
printf('<td>%s</td>',$results[$key]['cn'][0]); printf('<td>%s</td>',$results[$key]['cn'][0]);
echo '<td class="value">'; echo '<td class="value">';
echo '<table class="result_table" border=0 width="100%">'; echo '<table class="result_table" border="0" width="100%">';
$counter = 0; $counter = 0;
foreach (array( foreach (array(
@ -171,7 +171,7 @@ foreach ($results as $key => $value) {
printf('<tr class="%s">',$counter++%2==0?'even':'odd'); printf('<tr class="%s">',$counter++%2==0?'even':'odd');
printf('<td class="title" width="35%%">%s</td><td width="65%%">%s</td>', printf('<td class="title" style="width: 35%%;">%s</td><td style="width: 65%%;">%s</td>',
$metric,isset($results[$key][$metric]) ? $results[$key][$metric][0] : '&nbsp;'); $metric,isset($results[$key][$metric]) ? $results[$key][$metric][0] : '&nbsp;');
echo '</tr>'; echo '</tr>';
} }
@ -201,29 +201,29 @@ foreach (array(
$description = implode(' ',$results[$dn]['description']); $description = implode(' ',$results[$dn]['description']);
$description = preg_replace('/"/','\'',$description); $description = preg_replace('/"/','\'',$description);
printf('<tr class="list_item"><td class="heading" rowspan=2><acronym title="%s">%s</acronym></td></tr>',$description,$dn); printf('<tr class="list_item"><td class="heading" rowspan="2"><acronym title="%s">%s</acronym></td></tr>',$description,$dn);
echo '<tr class="list_item"><td class="value">'; echo '<tr class="list_item"><td class="value">';
echo '<table class="result"><tr><td>'; echo '<table class="result"><tr><td>';
echo '<table class="result_table" border=0 width="100%">'; echo '<table class="result_table" border="0" width="100%">';
if (isset($results[$dn]['monitoropinitiated'])) if (isset($results[$dn]['monitoropinitiated']))
printf('<tr class="highlight"><td width="20%%">%s</td><td class="value" width="80%%">%s</td></tr>', printf('<tr class="highlight"><td style="width: 20%%;">%s</td><td class="value" style="width: 80%%;">%s</td></tr>',
'monitorOpInitiated',$results[$dn]['monitoropinitiated'][0]); 'monitorOpInitiated',$results[$dn]['monitoropinitiated'][0]);
if (isset($results[$dn]['monitoropcompleted'])) if (isset($results[$dn]['monitoropcompleted']))
printf('<tr class="highlight"><td width="20%%">%s</td><td class="value" width="80%%">%s</td></tr>', printf('<tr class="highlight"><td style="width: 20%%;">%s</td><td class="value" style="width: 80%%;">%s</td></tr>',
'monitorOpCompleted',$results[$dn]['monitoropcompleted'][0]); 'monitorOpCompleted',$results[$dn]['monitoropcompleted'][0]);
if (isset($results[$dn]['monitoredinfo'])) if (isset($results[$dn]['monitoredinfo']))
printf('<tr class="highlight"><td width="20%%">%s</td><td class="value" width="80%%">%s</td></tr>', printf('<tr class="highlight"><td style="width: 20%%;">%s</td><td class="value" style="width: 80%%;">%s</td></tr>',
'monitoredInfo',$results[$dn]['monitoredinfo'][0]); 'monitoredInfo',$results[$dn]['monitoredinfo'][0]);
# Look for some connecitons # Look for some connecitons
foreach ($results as $key => $value) { foreach ($results as $key => $value) {
if (preg_match('/^.*,'.$dn.'$/',$key)) { if (preg_match('/^.*,'.$dn.'$/',$key)) {
echo '<tr class="highlight">'; echo '<tr class="highlight">';
printf('<td width="20%%">%s</td>',$results[$key]['cn'][0]); printf('<td style="width: 20%%;">%s</td>',$results[$key]['cn'][0]);
echo '<td class="value" width="80%">'; echo '<td class="value" style="width: 80%;">';
echo '<table class="result_table" border=0 width="100%">'; echo '<table class="result_table" border="0" width="100%">';
foreach (array( foreach (array(
'labeleduri', 'labeleduri',
@ -238,7 +238,7 @@ foreach (array(
if (isset($results[$key][$metric])) { if (isset($results[$key][$metric])) {
printf('<tr class="%s">',$counter++%2==0?'even':'odd'); printf('<tr class="%s">',$counter++%2==0?'even':'odd');
printf('<td class="title" width="35%%">%s</td><td width="65%%">%s</td>', printf('<td class="title" style="width: 35%%;">%s</td><td style="width: 65%%;">%s</td>',
$metric,$results[$key][$metric][0]); $metric,$results[$key][$metric][0]);
echo '</tr>'; echo '</tr>';

View File

@ -31,7 +31,7 @@ printf('<h3 class="subtitle">%s</h3>',_('Password Checker Tool'));
echo '<form action="password_checker.php" method="post">'; echo '<form action="password_checker.php" method="post">';
echo '<input type="hidden" name="action" value="compare" />'; echo '<input type="hidden" name="action" value="compare" />';
echo '<table class="forminput" width=100% border=0>'; echo '<table class="forminput" width="100%" border="0">';
echo '<tr>'; echo '<tr>';
printf('<td class="heading">%s</td>',_('Compare')); printf('<td class="heading">%s</td>',_('Compare'));

View File

@ -28,7 +28,7 @@ if (! is_null($entry['value'])) {
$entry['value'] = strtolower($entry['value']); $entry['value'] = strtolower($entry['value']);
} }
$schema_error_str = sprintf('%s <b>%s</b>.<br /><br /></center>%s<ul><li>%s</li><li>%s</li><li>%s</li><li>%s</li></ul>', $schema_error_str = sprintf('%s <b>%s</b>.<br /><br /></div>%s<ul><li>%s</li><li>%s</li><li>%s</li><li>%s</li></ul>',
_('Could not retrieve schema from'),$app['server']->getName(), _('Could not retrieve schema from'),$app['server']->getName(),
_('This could happen for several reasons, the most probable of which are:'),_('The server does not fully support the LDAP protocol.'), _('This could happen for several reasons, the most probable of which are:'),_('The server does not fully support the LDAP protocol.'),
_('Your version of PHP does not correctly perform the query.'),_('phpLDAPadmin doesn\'t know how to fetch the schema for your server.'), _('Your version of PHP does not correctly perform the query.'),_('phpLDAPadmin doesn\'t know how to fetch the schema for your server.'),
@ -43,7 +43,7 @@ $entry['schema_types'] = array(
'matching_rules'=>_('Matching Rules')); 'matching_rules'=>_('Matching Rules'));
echo '<br />'; echo '<br />';
echo '<center>'; echo '<div style="text-align: center;">';
$counter = 0; $counter = 0;
foreach ($entry['schema_types'] as $item => $value) { foreach ($entry['schema_types'] as $item => $value) {
@ -57,22 +57,21 @@ foreach ($entry['schema_types'] as $item => $value) {
} else { } else {
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajDISPLAY(\'BODY\',\'%s\',\'Loading %s\');" title="Loading %s">%s</a>', printf('<a href="cmd.php?%s" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'Loading %s\');" title="Loading %s">%s</a>',
htmlspecialchars($entry['href'][$item]),htmlspecialchars($entry['href'][$item]),$value,$value,$value); htmlspecialchars($entry['href'][$item]),htmlspecialchars($entry['href'][$item]),$value,$value,$value);
else else
printf('<a href="cmd.php?%s">%s</a>',htmlspecialchars($entry['href'][$item]),_($value)); printf('<a href="cmd.php?%s">%s</a>',htmlspecialchars($entry['href'][$item]),_($value));
} }
} }
echo '</center>'; echo '</div>';
echo '<br />'; echo '<br />';
switch($entry['view']) { switch($entry['view']) {
case 'syntaxes': case 'syntaxes':
$highlight_oid = get_request('highlight_oid','GET',false,false); $highlight_oid = get_request('highlight_oid','GET',false,false);
echo '<center>'; echo '<table class="result_table" border="0" style="margin-left: auto; margin-right: auto;">';
echo '<table class="result_table" border=0>';
printf('<tr class="heading"><td>%s</td><td>%s</td></tr>',_('Syntax OID'),_('Description')); printf('<tr class="heading"><td>%s</td><td>%s</td></tr>',_('Syntax OID'),_('Description'));
$counter = 1; $counter = 1;
@ -96,7 +95,6 @@ switch($entry['view']) {
} }
echo '</table>'; echo '</table>';
echo '</center>';
break; break;
case 'attributes': case 'attributes':
@ -125,32 +123,34 @@ switch($entry['view']) {
printf('<small>%s:</small>',_('Jump to an attribute type')); printf('<small>%s:</small>',_('Jump to an attribute type'));
echo '<form action="cmd.php" method="get">'; echo '<form action="cmd.php" method="get">';
echo '<div>';
echo '<input type="hidden" name="cmd" value="schema" />'; echo '<input type="hidden" name="cmd" value="schema" />';
printf('<input type="hidden" name="view" value="%s" />',$entry['view']); printf('<input type="hidden" name="view" value="%s" />',$entry['view']);
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
if (isAjaxEnabled()) { if (isAjaxEnabled()) {
drawJSItems($sattrs); drawJSItems($sattrs);
echo '<select name="viewvalue" onChange="ajSHOWSCHEMA(\'attributes\',\'at\')" id="attributes">'; echo '<select name="viewvalue" onchange="ajSHOWSCHEMA(\'attributes\',\'at\')" id="attributes">';
} else } else
echo '<select name="viewvalue" onChange="submit()">'; echo '<select name="viewvalue" onchange="submit()">';
echo '<option value=""> - all -</option>'; echo '<option value=""> - all -</option>';
foreach ($sattrs as $name => $attr) foreach ($sattrs as $name => $attr)
printf('<option value="%s" %s>%s</option>', printf('<option value="%s" %s>%s</option>',
$name,$name == $entry['value'] ? 'selected ': '',$attr->getName(false)); $name,$name == $entry['value'] ? 'selected="selected" ': '',$attr->getName(false));
echo '</select>'; echo '</select>';
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<input type="button" value="%s" onClick="ajSHOWSCHEMA(\'attributes\',\'at\')"/>',_('Go')); printf('<input type="button" value="%s" onclick="ajSHOWSCHEMA(\'attributes\',\'at\')"/>',_('Go'));
else else
printf('<input type="submit" value="%s" />',_('Go')); printf('<input type="submit" value="%s" />',_('Go'));
echo '</div>';
echo '</form>'; echo '</form>';
echo '<br />'; echo '<br />';
foreach ($sattrs as $attr) { foreach ($sattrs as $attr) {
if (isAjaxEnabled() || (is_null($entry['value']) || ! strcasecmp($entry['value'],$attr->getName()))) { if (isAjaxEnabled() || (is_null($entry['value']) || ! trim($entry['value']) || $entry['value']==$attr->getName())) {
if (! is_null($entry['value']) && strcasecmp($entry['value'],$attr->getName())) if ((! is_null($entry['value']) && $entry['value']==$attr->getName()) || ! trim($entry['value']))
$entry['viewed'] = true; $entry['viewed'] = true;
if (isAjaxEnabled() && $entry['value']) if (isAjaxEnabled() && $entry['value'])
@ -158,8 +158,8 @@ switch($entry['view']) {
else else
printf('<div id="at%s">',$attr->getName()); printf('<div id="at%s">',$attr->getName());
echo '<table class="result_table" width=100% border=0>'; echo '<table class="result_table" width="100%" border="0">';
printf('<tr class="heading"><td colspan=2><a name="%s">%s</a></td></tr>', printf('<tr class="heading"><td colspan="2"><a name="%s">%s</a></td></tr>',
$attr->getName(),$attr->getName(false)); $attr->getName(),$attr->getName(false));
$counter = 0; $counter = 0;
@ -167,7 +167,7 @@ switch($entry['view']) {
foreach ($entry['attr_types'] as $item => $value) { foreach ($entry['attr_types'] as $item => $value) {
printf('<tr class="%s">',++$counter%2 ? 'odd' : 'even'); printf('<tr class="%s">',++$counter%2 ? 'odd' : 'even');
printf('<td class="title" width=30%%>%s</td>',$value); printf('<td class="title" style="width: 30%%;">%s</td>',$value);
switch ($item) { switch ($item) {
case 'desc': case 'desc':
@ -195,7 +195,7 @@ switch($entry['view']) {
else { else {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],strtolower($attr->getSupAttribute()))); $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],strtolower($attr->getSupAttribute())));
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajSHOWSCHEMA(\'attributes\',\'at\',\'%s\');">%s</a>', printf('<a href="cmd.php?%s" onclick="return ajSHOWSCHEMA(\'attributes\',\'at\',\'%s\');">%s</a>',
$href,strtolower($attr->getSupAttribute()),$attr->getSupAttribute()); $href,strtolower($attr->getSupAttribute()),$attr->getSupAttribute());
else else
printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getSupAttribute()); printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getSupAttribute());
@ -213,7 +213,7 @@ switch($entry['view']) {
else { else {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['matching_rules'],$attr->getEquality())); $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['matching_rules'],$attr->getEquality()));
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s</a>', printf('<a href="cmd.php?%s" onclick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s</a>',
$href,$href,_('Matching Rules'),$attr->getEquality(),$attr->getEquality()); $href,$href,_('Matching Rules'),$attr->getEquality(),$attr->getEquality());
else else
printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getEquality()); printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getEquality());
@ -241,7 +241,7 @@ switch($entry['view']) {
} else { } else {
$href = htmlspecialchars(sprintf('%s&highlight_oid=%s',$entry['href']['syntaxes'],$attr->getSyntaxOID())); $href = htmlspecialchars(sprintf('%s&highlight_oid=%s',$entry['href']['syntaxes'],$attr->getSyntaxOID()));
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s (%s)</a>', printf('<a href="cmd.php?%s" onclick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s (%s)</a>',
$href,$href,_('Syntaxes'),'',$attr->getType(),$attr->getSyntaxOID()); $href,$href,_('Syntaxes'),'',$attr->getType(),$attr->getSyntaxOID());
else else
printf('<a href="cmd.php?%s">%s (%s)</a>',$href,$attr->getType(),$attr->getSyntaxOID()); printf('<a href="cmd.php?%s">%s (%s)</a>',$href,$attr->getType(),$attr->getSyntaxOID());
@ -289,7 +289,7 @@ switch($entry['view']) {
foreach ($attr->getAliases() as $alias) { foreach ($attr->getAliases() as $alias) {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],strtolower($alias))); $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],strtolower($alias)));
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajSHOWSCHEMA(\'attributes\',\'at\',\'%s\');">%s</a>', printf('<a href="cmd.php?%s" onclick="return ajSHOWSCHEMA(\'attributes\',\'at\',\'%s\');">%s</a>',
$href,strtolower($alias),$alias); $href,strtolower($alias),$alias);
else else
printf('<a href="cmd.php?%s">%s</a>',$href,$alias); printf('<a href="cmd.php?%s">%s</a>',$href,$alias);
@ -308,7 +308,7 @@ switch($entry['view']) {
foreach ($attr->getUsedInObjectClasses() as $objectclass) { foreach ($attr->getUsedInObjectClasses() as $objectclass) {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($objectclass))); $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($objectclass)));
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s</a> ', printf('<a href="cmd.php?%s" onclick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s</a> ',
$href,$href,_('ObjectClasses'),strtolower($objectclass),$objectclass); $href,$href,_('ObjectClasses'),strtolower($objectclass),$objectclass);
else else
printf('<a href="cmd.php?%s">%s</a> ',$href,$objectclass); printf('<a href="cmd.php?%s">%s</a> ',$href,$objectclass);
@ -340,33 +340,35 @@ switch($entry['view']) {
printf('<small>%s</small><br />',_('Jump to a matching rule')); printf('<small>%s</small><br />',_('Jump to a matching rule'));
echo '<form action="cmd.php" method="get">'; echo '<form action="cmd.php" method="get">';
echo '<div>';
echo '<input type="hidden" name="cmd" value="schema" />'; echo '<input type="hidden" name="cmd" value="schema" />';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
echo '<input type="hidden" name="view" value="matching_rules" />'; echo '<input type="hidden" name="view" value="matching_rules" />';
if (isAjaxEnabled()) { if (isAjaxEnabled()) {
drawJSItems($schema_matching_rules); drawJSItems($schema_matching_rules);
echo '<select name="viewvalue" onChange="ajSHOWSCHEMA(\'matchingrules\',\'mr\')" id="matchingrules">'; echo '<select name="viewvalue" onchange="ajSHOWSCHEMA(\'matchingrules\',\'mr\')" id="matchingrules">';
} else } else
echo '<select name="viewvalue" onChange="submit()">'; echo '<select name="viewvalue" onchange="submit()">';
echo '<option value=""> - all -</option>'; echo '<option value=""> - all -</option>';
foreach ($schema_matching_rules as $rule) foreach ($schema_matching_rules as $rule)
printf('<option value="%s" %s>%s</option>', printf('<option value="%s" %s>%s</option>',
$rule->getName(), $rule->getName(),
($rule->getName() == $entry['value'] ? 'selected': ''), ($rule->getName() == $entry['value'] ? 'selected="selected"': ''),
$rule->getName(false)); $rule->getName(false));
echo '</select>'; echo '</select>';
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<input type="button" value="%s" onClick="ajSHOWSCHEMA(\'matchingrules\',\'mr\')"/>',_('Go')); printf('<input type="button" value="%s" onclick="ajSHOWSCHEMA(\'matchingrules\',\'mr\')"/>',_('Go'));
else else
printf('<input type="submit" value="%s" />',_('Go')); printf('<input type="submit" value="%s" />',_('Go'));
echo '</div>';
echo '</form>'; echo '</form>';
echo '<br />'; echo '<br />';
echo '<table class="result_table" width=100% border=0>'; echo '<table class="result_table" width="100%" border="0">';
printf('<tr class="heading"><td>%s</td><td>%s</td><td>%s</td></tr>', printf('<tr class="heading"><td>%s</td><td>%s</td><td>%s</td></tr>',
_('Matching Rule OID'),_('Name'),_('Used by Attributes')); _('Matching Rule OID'),_('Name'),_('Used by Attributes'));
@ -377,8 +379,8 @@ switch($entry['view']) {
$oid = $rule->getOID(); $oid = $rule->getOID();
$desc = $rule->getName(false); $desc = $rule->getName(false);
if (isAjaxEnabled() || (is_null($entry['value']) || ! strcasecmp($entry['value'],$rule->getName()))) { if (isAjaxEnabled() || (is_null($entry['value']) || ! trim($entry['value']) || $entry['value']==$rule->getName())) {
if (! is_null($entry['value']) && strcasecmp($entry['value'],$rule->getName())) if ((! is_null($entry['value']) && $entry['value']==$rule->getName()) || ! trim($entry['value']))
$entry['viewed'] = true; $entry['viewed'] = true;
if (null != $rule->getDescription()) if (null != $rule->getDescription())
@ -398,11 +400,12 @@ switch($entry['view']) {
echo '<td>'; echo '<td>';
if (count($rule->getUsedByAttrs()) == 0) { if (count($rule->getUsedByAttrs()) == 0) {
printf('<center>(%s)</center><br /><br />',_('none')); printf('<div style="text-align: center;">(%s)</div><br /><br />',_('none'));
} else { } else {
echo '<table width=100% border=0><tr><td>'; echo '<table width="100%" border="0"><tr><td>';
echo '<form action="cmd.php" method="get">'; echo '<form action="cmd.php" method="get">';
echo '<div>';
echo '<input type="hidden" name="cmd" value="schema" />'; echo '<input type="hidden" name="cmd" value="schema" />';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
echo '<input type="hidden" name="view" value="attributes" />'; echo '<input type="hidden" name="view" value="attributes" />';
@ -413,10 +416,11 @@ switch($entry['view']) {
echo '</select><br />'; echo '</select><br />';
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<input type="button" value="%s" onClick="return ajJUMP(\'cmd=schema&amp;view=attributes&amp;server_id=%s\',\'%s\',\'%s\',\'vv\');"/>', printf('<input type="button" value="%s" onclick="return ajJUMP(\'cmd=schema&amp;view=attributes&amp;server_id=%s\',\'%s\',\'%s\',\'vv\');"/>',
_('Go'),$app['server']->getIndex(),_('Attributes'),$rule->getName()); _('Go'),$app['server']->getIndex(),_('Attributes'),$rule->getName());
else else
printf('<input type="submit" value="%s" />',_('Go')); printf('<input type="submit" value="%s" />',_('Go'));
echo '</div>';
echo '</form>'; echo '</form>';
echo '</td></tr></table>'; echo '</td></tr></table>';
} }
@ -436,33 +440,35 @@ switch($entry['view']) {
printf('<small>%s:</small>',_('Jump to an objectClass')); printf('<small>%s:</small>',_('Jump to an objectClass'));
echo '<form action="cmd.php" method="get">'; echo '<form action="cmd.php" method="get">';
echo '<div>';
echo '<input type="hidden" name="cmd" value="schema" />'; echo '<input type="hidden" name="cmd" value="schema" />';
printf('<input type="hidden" name="view" value="%s" />',$entry['view']); printf('<input type="hidden" name="view" value="%s" />',$entry['view']);
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
if (isAjaxEnabled()) { if (isAjaxEnabled()) {
drawJSItems($socs); drawJSItems($socs);
echo '<select name="viewvalue" onChange="ajSHOWSCHEMA(\'objectclasses\',\'oc\')" id="objectclasses">'; echo '<select name="viewvalue" onchange="ajSHOWSCHEMA(\'objectclasses\',\'oc\')" id="objectclasses">';
} else } else
echo '<select name="viewvalue" onChange="submit()">'; echo '<select name="viewvalue" onchange="submit()">';
echo '<option value=""> - all - </option>'; echo '<option value=""> - all - </option>';
foreach ($socs as $name => $oclass) foreach ($socs as $name => $oclass)
printf('<option value="%s" %s>%s</option>', printf('<option value="%s" %s>%s</option>',
$name,$name == $entry['value'] ? 'selected ': '',$oclass->getName(false)); $name,$name == $entry['value'] ? 'selected="selected" ': '',$oclass->getName(false));
echo '</select>'; echo '</select>';
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<input type="button" value="%s" onClick="ajSHOWSCHEMA(\'objectclasses\',\'oc\')"/>',_('Go')); printf('<input type="button" value="%s" onclick="ajSHOWSCHEMA(\'objectclasses\',\'oc\')"/>',_('Go'));
else else
printf('<input type="submit" value="%s" />',_('Go')); printf('<input type="submit" value="%s" />',_('Go'));
echo '</div>';
echo '</form>'; echo '</form>';
echo '<br />'; echo '<br />';
foreach ($socs as $name => $oclass) { foreach ($socs as $name => $oclass) {
if (isAjaxEnabled() || (is_null($entry['value']) || ! strcasecmp($entry['value'],$oclass->getName()))) { if (isAjaxEnabled() || (is_null($entry['value']) || ! trim($entry['value']) || $entry['value']==$oclass->getName())) {
if (! is_null($entry['value']) && strcasecmp($entry['value'],$oclass->getName())) if ((! is_null($entry['value']) && $entry['value']==$oclass->getName()) || ! trim($entry['value']))
$entry['viewed'] = true; $entry['viewed'] = true;
if (isAjaxEnabled() && $entry['value']) if (isAjaxEnabled() && $entry['value'])
@ -470,19 +476,19 @@ switch($entry['view']) {
else else
printf('<div id="oc%s">',$oclass->getName()); printf('<div id="oc%s">',$oclass->getName());
echo '<table class="result_table" width=100% border=0>'; echo '<table class="result_table" width="100%" border="0">';
printf('<tr class="heading"><td colspan=4><a name="%s">%s</a></td></tr>',$name,$oclass->getName(false)); printf('<tr class="heading"><td colspan="4"><a name="%s">%s</a></td></tr>',$name,$oclass->getName(false));
printf('<tr class="odd"><td colspan=4>%s: <b>%s</b></td></tr>',_('OID'),$oclass->getOID()); printf('<tr class="odd"><td colspan="4">%s: <b>%s</b></td></tr>',_('OID'),$oclass->getOID());
if ($oclass->getDescription()) if ($oclass->getDescription())
printf('<tr class="odd"><td colspan=4>%s: <b>%s</b></td></tr>',_('Description'),$oclass->getDescription()); printf('<tr class="odd"><td colspan="4">%s: <b>%s</b></td></tr>',_('Description'),$oclass->getDescription());
printf('<tr class="odd"><td colspan=4>%s: <b>%s</b></td></tr>',_('Type'),$oclass->getType()); printf('<tr class="odd"><td colspan="4">%s: <b>%s</b></td></tr>',_('Type'),$oclass->getType());
if ($oclass->getIsObsolete()) if ($oclass->getIsObsolete())
printf('<tr class="odd"><td colspan=4>%s</td></tr>',_('This objectClass is obsolete.')); printf('<tr class="odd"><td colspan="4">%s</td></tr>',_('This objectClass is obsolete.'));
printf('<tr class="odd"><td colspan=4>%s: <b>',_('Inherits from')); printf('<tr class="odd"><td colspan="4">%s: <b>',_('Inherits from'));
if (count($oclass->getSupClasses()) == 0) if (count($oclass->getSupClasses()) == 0)
printf('(%s)',_('none')); printf('(%s)',_('none'));
@ -490,7 +496,7 @@ switch($entry['view']) {
foreach ($oclass->getSupClasses() as $i => $object_class) { foreach ($oclass->getSupClasses() as $i => $object_class) {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($object_class))); $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($object_class)));
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>', printf('<a href="cmd.php?%s" onclick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
$href,strtolower($object_class),$object_class); $href,strtolower($object_class),$object_class);
else else
printf('<a href="cmd.php?%s&viewvalue=%s" title="%s">%s</a>', printf('<a href="cmd.php?%s&viewvalue=%s" title="%s">%s</a>',
@ -501,11 +507,11 @@ switch($entry['view']) {
} }
echo '</b></td></tr>'; echo '</b></td></tr>';
printf('<tr class="odd"><td colspan=4>%s: <b>',_('Parent to')); printf('<tr class="odd"><td colspan="4">%s: <b>',_('Parent to'));
if (strcasecmp($oclass->getName(),'top') == 0) { if (strcasecmp($oclass->getName(),'top') == 0) {
$href = htmlspecialchars($entry['href']['objectclasses']); $href = htmlspecialchars($entry['href']['objectclasses']);
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'\');">all</a>', printf('<a href="cmd.php?%s" onclick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'\');">all</a>',
$href); $href);
else else
printf('(<a href="cmd.php?%s">all</a>)',$href); printf('(<a href="cmd.php?%s">all</a>)',$href);
@ -517,7 +523,7 @@ switch($entry['view']) {
foreach ($oclass->getChildObjectClasses() as $i => $object_class) { foreach ($oclass->getChildObjectClasses() as $i => $object_class) {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($object_class))); $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($object_class)));
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<a href="cmd.php?%s" title="%s" onClick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>', printf('<a href="cmd.php?%s" title="%s" onclick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
$href,_('Jump to this objectClass definition'),strtolower($object_class),$object_class); $href,_('Jump to this objectClass definition'),strtolower($object_class),$object_class);
else else
printf('<a href="cmd.php?%s" title="%s">%s</a>',$href,_('Jump to this objectClass definition'),$object_class); printf('<a href="cmd.php?%s" title="%s">%s</a>',$href,_('Jump to this objectClass definition'),$object_class);
@ -527,7 +533,7 @@ switch($entry['view']) {
} }
echo '</b></td></tr>'; echo '</b></td></tr>';
printf('<tr class="even"><td class="blank" rowspan=2 width=5%%>&nbsp;</td><td width=45%%><b>%s</b></td><td width=45%%><b>%s</b></td><td class="blank" rowspan=2 width=5%%>&nbsp;</td></tr>', printf('<tr class="even"><td class="blank" rowspan="2" style="width: 5%%;">&nbsp;</td><td style="width: 45%%;"><b>%s</b></td><td style="width: 45%%;"><b>%s</b></td><td class="blank" rowspan="2" style="width: 5%%;">&nbsp;</td></tr>',
_('Required Attributes'),_('Optional Attributes')); _('Required Attributes'),_('Optional Attributes'));
echo '<tr class="odd">'; echo '<tr class="odd">';
@ -540,7 +546,7 @@ switch($entry['view']) {
echo '<li>'; echo '<li>';
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],$attr->getName())); $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],$attr->getName()));
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s</a>', printf('<a href="cmd.php?%s" onclick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s</a>',
$href,$href,_('Attributes'),$attr->getName(),$attr->getName(false)); $href,$href,_('Attributes'),$attr->getName(),$attr->getName(false));
else else
printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getName(false)); printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getName(false));
@ -550,7 +556,7 @@ switch($entry['view']) {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($attr->getSource()))); $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($attr->getSource())));
printf('<small>(%s ',_('Inherited from')); printf('<small>(%s ',_('Inherited from'));
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<a href="cmd.php?%s" title="%s" onClick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>', printf('<a href="cmd.php?%s" title="%s" onclick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
$href,_('Jump to this objectClass definition'),strtolower($attr->getSource()),$attr->getSource()); $href,_('Jump to this objectClass definition'),strtolower($attr->getSource()),$attr->getSource());
else else
printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getSource()); printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getSource());
@ -573,7 +579,7 @@ switch($entry['view']) {
echo '<li>'; echo '<li>';
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],$attr->getName())); $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],$attr->getName()));
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s</a>', printf('<a href="cmd.php?%s" onclick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s</a>',
$href,$href,_('Attributes'),$attr->getName(),$attr->getName(false)); $href,$href,_('Attributes'),$attr->getName(),$attr->getName(false));
else else
printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getName(false)); printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getName(false));
@ -583,7 +589,7 @@ switch($entry['view']) {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($attr->getSource()))); $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($attr->getSource())));
printf('<small>(%s ',_('Inherited from')); printf('<small>(%s ',_('Inherited from'));
if (isAjaxEnabled()) if (isAjaxEnabled())
printf('<a href="cmd.php?%s" title="%s" onClick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>', printf('<a href="cmd.php?%s" title="%s" onclick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
$href,_('Jump to this objectClass definition'),strtolower($attr->getSource()),$attr->getSource()); $href,_('Jump to this objectClass definition'),strtolower($attr->getSource()),$attr->getSource());
else else
printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getSource()); printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getSource());
@ -615,7 +621,7 @@ if (! is_null($entry['value']) && ! $entry['viewed'])
error(sprintf(_('No such schema item: "%s"'),$entry['value']),'error','index.php'); error(sprintf(_('No such schema item: "%s"'),$entry['value']),'error','index.php');
function drawJSItems($object) { function drawJSItems($object) {
echo '<script type="text/javascript" language="javascript">'."\n"; echo '<script type="text/javascript">'."\n";
echo " echo "
function items() { function items() {

View File

@ -18,16 +18,16 @@ printf('<h3 class="subtitle">%s</h3>',_('Server reports the following informatio
if (! count($attrs)) { if (! count($attrs)) {
echo '<br /><br />'; echo '<br /><br />';
printf('<center>%s</center>',_('This server has nothing to report.')); printf('<div style="text-align: center;">%s</div>',_('This server has nothing to report.'));
return; return;
} }
echo '<table class="result" border=0>'; echo '<table class="result" border="0">';
foreach ($attrs as $key => $values) { foreach ($attrs as $key => $values) {
if ($key == 'dn') if ($key == 'dn')
continue; continue;
echo '<tr class="list_item"><td class="heading" rowspan=2>'; echo '<tr class="list_item"><td class="heading" rowspan="2">';
$sattr = $app['server']->getSchemaAttribute($key); $sattr = $app['server']->getSchemaAttribute($key);
@ -42,7 +42,7 @@ foreach ($attrs as $key => $values) {
echo '</td></tr>'; echo '</td></tr>';
echo '<tr class="list_item"><td class="blank">&nbsp;</td><td class="value">'; echo '<tr class="list_item"><td class="blank">&nbsp;</td><td class="value">';
echo '<table class="result" border=0>'; echo '<table class="result" border="0">';
if (is_array($values)) if (is_array($values))
foreach ($values as $value) { foreach ($values as $value) {
@ -50,7 +50,7 @@ foreach ($attrs as $key => $values) {
print '<tr>'; print '<tr>';
if (preg_match('/^[0-9]+\.[0-9]+/',$value)) { if (preg_match('/^[0-9]+\.[0-9]+/',$value)) {
printf('<td width=5%% rowspan=2 style="vertical-align: top"><img src="%s/rfc.png" title="%s" alt="%s"/></td>', printf('<td rowspan="2" style="width: 5%%; vertical-align: top"><img src="%s/rfc.png" title="%s" alt="%s"/></td>',
IMGDIR,$value,htmlspecialchars($value)); IMGDIR,$value,htmlspecialchars($value));
if ($oidtext = support_oid_to_text($value)) if ($oidtext = support_oid_to_text($value))
@ -64,7 +64,7 @@ foreach ($attrs as $key => $values) {
printf('<td><small>%s</small></td>',$value); printf('<td><small>%s</small></td>',$value);
} else { } else {
printf('<td rowspan=2 colspan=2>%s</td>',$value); printf('<td rowspan="2" colspan="2">%s</td>',$value);
} }
print '</tr>'; print '</tr>';
@ -75,11 +75,11 @@ foreach ($attrs as $key => $values) {
echo '<tr><td>&nbsp;</td></tr>'; echo '<tr><td>&nbsp;</td></tr>';
if ($oidtext) if ($oidtext)
echo '<tr><td colspan=2>&nbsp;</td></tr>'; echo '<tr><td colspan="2">&nbsp;</td></tr>';
} }
else else
printf('<tr><td colspan=2>%s&nbsp;</td></tr>',$values); printf('<tr><td colspan="2">%s&nbsp;</td></tr>',$values);
echo '</table>'; echo '</table>';

View File

@ -32,20 +32,23 @@ $request['page']->drawSubTitle();
# Confirm the updates # Confirm the updates
if (count($request['template']->getLDAPmodify(true))) { if (count($request['template']->getLDAPmodify(true))) {
echo '<center>'; echo '<div style="text-align: center;">';
echo _('Do you want to make these changes?'); echo _('Do you want to make these changes?');
echo '<br /><br />'; echo '<br /><br />';
echo '</div>';
echo "\n\n"; echo "\n\n";
echo '<form action="cmd.php" method="post">'; echo '<form action="cmd.php" method="post">';
echo '<div>';
echo '<input type="hidden" name="cmd" value="update" />'; echo '<input type="hidden" name="cmd" value="update" />';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($request['dn'])); printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($request['dn']));
echo "\n"; echo "\n";
$request['page']->drawHiddenAttributes(); $request['page']->drawHiddenAttributes();
echo '</div>';
echo '<table class="result_table">'; echo '<table class="result_table" style="margin-left: auto; margin-right: auto;">';
echo "\n"; echo "\n";
printf('<tr class="heading"><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', printf('<tr class="heading"><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>',
@ -182,9 +185,11 @@ if (count($request['template']->getLDAPmodify(true))) {
echo '</table>'; echo '</table>';
echo '<div style="text-align: center;">';
echo '<br />'; echo '<br />';
printf('<input type="submit" value="%s" />',_('Commit')); printf('<input type="submit" value="%s" />',_('Commit'));
printf('<input type="submit" name="cancel" value="%s" />',_('Cancel')); printf('<input type="submit" name="cancel" value="%s" />',_('Cancel'));
echo '</div>';
echo '</form>'; echo '</form>';
echo '<br />'; echo '<br />';
@ -206,16 +211,14 @@ if (count($request['template']->getLDAPmodify(true))) {
echo '</b></td></tr></table>'; echo '</b></td></tr></table>';
} }
echo '</center>';
} else { } else {
echo '<center>'; echo '<div style="text-align: center;">';
echo _('You made no changes'); echo _('You made no changes');
$href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s', $href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',
$app['server']->getIndex(),rawurlencode($request['dn'])); $app['server']->getIndex(),rawurlencode($request['dn']));
printf(' <a href="%s">%s</a>.',htmlspecialchars($href),_('Go back')); printf(' <a href="%s">%s</a>.',htmlspecialchars($href),_('Go back'));
echo '</center>'; echo '</div>';
} }
function getMustAttrs($oclasses) { function getMustAttrs($oclasses) {

View File

@ -11,7 +11,7 @@
require './common.php'; require './common.php';
echo '<center>'; echo '<div style="text-align: center;">';
echo '<br /><br />'; echo '<br /><br />';
printf('<img src="%s/logo.png" title="%s" alt="%s" />',IMGDIR,_('phpLDAPadmin logo'),_('phpLDAPadmin logo')); printf('<img src="%s/logo.png" title="%s" alt="%s" />',IMGDIR,_('phpLDAPadmin logo'),_('phpLDAPadmin logo'));
echo '<br /><br />'; echo '<br /><br />';
@ -19,11 +19,11 @@ echo _('Use the menu to the left to navigate');
echo '<br /><br />'; echo '<br /><br />';
if ($_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks')) { if ($_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks')) {
printf('<a href="%s" target="_blank">%s</a>',get_href('credits'),_('Credits')); printf('<a href="%s" onclick="target=\'_blank\';">%s</a>',get_href('credits'),_('Credits'));
printf(' | <a href="%s" target="_blank">%s</a>',get_href('documentation'),_('Documentation')); printf(' | <a href="%s" onclick="target=\'_blank\';">%s</a>',get_href('documentation'),_('Documentation'));
printf(' | <a href="%s" target="_blank">%s</a>',get_href('donate'),_('Donate')); printf(' | <a href="%s" onclick="target=\'_blank\';">%s</a>',get_href('donate'),_('Donate'));
echo '<br /><br />'; echo '<br /><br />';
} }
echo '</center>'; echo '</div>';
?> ?>

View File

@ -97,21 +97,21 @@ class AJAXTree extends HTMLTree {
echo $this->get_indentation($code); echo $this->get_indentation($code);
if (! $child_count) if (! $child_count)
printf('<img align="top" border="0" class="imgs" id="jt%snode" src="%s/%s" alt="--" />',$node_id,IMGDIR,$imgs['tree'][$nb]); printf('<img id="jt%snode" src="%s/%s" alt="--" class="imgs" style="border: 0px; vertical-align:text-top;" />',$node_id,IMGDIR,$imgs['tree'][$nb]);
else { else {
printf('<a href="#" onclick="return opencloseTreeNode(\'%s\',\'%s\',\'%s\');">',$node_id,$parms['openclose'],IMGDIR); printf('<a href="#" onclick="return opencloseTreeNode(\'%s\',\'%s\',\'%s\');">',$node_id,$parms['openclose'],IMGDIR);
if ($entry->isOpened()) if ($entry->isOpened())
printf('<img align="top" border="0" class="imgs" id="jt%snode" src="%s/%s" alt="+-" />',$node_id,IMGDIR,$imgs['collapse'][$nb]); printf('<img id="jt%snode" src="%s/%s" alt="+-" class="imgs" style="border: 0px; vertical-align:text-top;" />',$node_id,IMGDIR,$imgs['collapse'][$nb]);
else else
printf('<img align="top" border="0" class="imgs" id="jt%snode" src="%s/%s" alt="+-" />',$node_id,IMGDIR,$imgs['expand'][$nb]); printf('<img id="jt%snode" src="%s/%s" alt="+-" class="imgs" style="border: 0px; vertical-align:text-top;" />',$node_id,IMGDIR,$imgs['expand'][$nb]);
echo '</a>'; echo '</a>';
} }
printf('<a href="%s" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'%s\');" title="%s" >',$href,$parms['edit'],_('Retrieving DN'),htmlspecialchars($item)); printf('<a href="%s" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'%s\');" title="%s" >',$href,$parms['edit'],_('Retrieving DN'),htmlspecialchars($item));
printf('<span class="dnicon"><img align="top" border="0" class="imgs" id="jt%sfolder" src="%s/%s" alt="->" /></span>',$node_id,IMGDIR,$entry->getIcon($server)); printf('<span class="dnicon"><img id="jt%sfolder" src="%s/%s" alt="->" class="imgs" style="border: 0px; vertical-align:text-top;" /></span>',$node_id,IMGDIR,$entry->getIcon($server));
echo '</a>'; echo '</a>';
echo '&nbsp;'; echo '&nbsp;';
@ -192,11 +192,11 @@ class AJAXTree extends HTMLTree {
for ($i=0; $i<strlen($code); $i++) { for ($i=0; $i<strlen($code); $i++) {
switch ($code[$i]) { switch ($code[$i]) {
case '0': case '0':
$indent .= sprintf('<img align="top" border="0" class="imgs" src="%s/tree_space.png" alt=" " />',IMGDIR); $indent .= sprintf('<img src="%s/tree_space.png" alt=" " class="imgs" style="border: 0px; vertical-align:text-top;" />',IMGDIR);
break; break;
case '1': case '1':
$indent .= sprintf('<img align="top" border="0" class="imgs" src="%s/tree_vertline.png" alt="| " />',IMGDIR); $indent .= sprintf('<img src="%s/tree_vertline.png" alt="| " class="imgs" style="border: 0px; vertical-align:text-top;" />',IMGDIR);
break; break;
} }
} }
@ -211,8 +211,8 @@ class AJAXTree extends HTMLTree {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs); debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs);
printf('<script type="text/javascript" language="javascript" src="%slayersmenu-browser_detection.js"></script>',JSDIR); printf('<script type="text/javascript" src="%slayersmenu-browser_detection.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%sajax_tree.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sajax_tree.js"></script>',JSDIR);
} }
/** /**
@ -266,9 +266,9 @@ class AJAXTree extends HTMLTree {
$href = sprintf('cmd=template_engine&server_id=%s&container=%s',$this->getServerID(),rawurlencode($entry->getDN())); $href = sprintf('cmd=template_engine&server_id=%s&container=%s',$this->getServerID(),rawurlencode($entry->getDN()));
$output .= $this->get_indentation($level); $output .= $this->get_indentation($level);
$output .= sprintf('<img align="top" border="0" class="imgs" src="%s" alt="--" />',$img); $output .= sprintf('<img src="%s" alt="--" class="imgs" style="border: 0px; vertical-align:text-top;" />',$img);
$output .= sprintf('<a href="%s" title="%s">',htmlspecialchars($href),$entry->getDN()); $output .= sprintf('<a href="%s" title="%s">',htmlspecialchars($href),$entry->getDN());
$output .= sprintf('<img align="top" border="0" class="imgs" src="%s/create.png" alt="->" />',IMGDIR); $output .= sprintf('<img src="%s/create.png" alt="->" class="imgs" style="border: 0px; vertical-align:text-top;" />',IMGDIR);
$output .= '</a>'; $output .= '</a>';
$output .= '&nbsp;'; $output .= '&nbsp;';

View File

@ -30,7 +30,7 @@ class HTMLTree extends Tree {
$server = $this->getServer(); $server = $this->getServer();
echo '<table class="tree" border=0>'; echo '<table class="tree" border="0">';
if (! $onlytree) if (! $onlytree)
$this->draw_server_name(); $this->draw_server_name();
@ -60,7 +60,7 @@ class HTMLTree extends Tree {
$server->getIndex()); $server->getIndex());
} }
echo '<table class="tree" border=0>'; echo '<table class="tree" border="0">';
if (! count($this->getBaseEntries())) { if (! count($this->getBaseEntries())) {
# We didnt get any baseDN entries in our tree? # We didnt get any baseDN entries in our tree?
@ -90,13 +90,13 @@ class HTMLTree extends Tree {
printf('<tr><td class="spacer"></td><td class="spacer"></td><td><img src="%s/unknown.png" /></td><td colspan="%s">%s</td></tr>', printf('<tr><td class="spacer"></td><td class="spacer"></td><td><img src="%s/unknown.png" /></td><td colspan="%s">%s</td></tr>',
IMGDIR,$this->getDepth()+3-3,pretty_print_dn($base->getDN())); IMGDIR,$this->getDepth()+3-3,pretty_print_dn($base->getDN()));
$this->javascript .= sprintf('<form name="create_base_form_%s" method="post" action="cmd.php?cmd=template_engine">',$javascript_id); $this->javascript .= sprintf('<form id="create_base_form_%s" method="post" action="cmd.php?cmd=template_engine">',$javascript_id);
$this->javascript .= sprintf('<input type="hidden" name="server_id" value="%s" />',$server->getIndex()); $this->javascript .= sprintf('<input type="hidden" name="server_id" value="%s" />',$server->getIndex());
$this->javascript .= sprintf('<input type="hidden" name="container" value="%s" />',htmlspecialchars($server->getContainer($base->getDN()))); $this->javascript .= sprintf('<input type="hidden" name="container" value="%s" />',htmlspecialchars($server->getContainer($base->getDN())));
$this->javascript .= sprintf('<input type="hidden" name="rdn" value="%s" />',get_rdn($base->getDN())); $this->javascript .= sprintf('<input type="hidden" name="rdn" value="%s" />',get_rdn($base->getDN()));
$this->javascript .= sprintf('</form>'); $this->javascript .= sprintf('</form>');
printf('<tr><td class="spacer"></td><td class="spacer"></td><td class="spacer"></td><td colspan="%s"><small>%s<a href="javascript:document.create_base_form_%s.submit()">%s</a></small></td></tr>', printf('<tr><td class="spacer"></td><td class="spacer"></td><td class="spacer"></td><td colspan="%s"><small>%s<a href="javascript:document.getElementById(\'create_base_form_%s\').submit()">%s</a></small></td></tr>',
$this->getDepth()+3-3,_('This base entry does not exist.'),$javascript_id,_('Create it?')); $this->getDepth()+3-3,_('This base entry does not exist.'),$javascript_id,_('Create it?'));
echo '</table>'; echo '</table>';
@ -163,7 +163,7 @@ class HTMLTree extends Tree {
if (! is_null($server->inactivityTime())) { if (! is_null($server->inactivityTime())) {
$m = sprintf(_('Inactivity will log you off at %s'), $m = sprintf(_('Inactivity will log you off at %s'),
strftime('%H:%M',$server->inactivityTime())); strftime('%H:%M',$server->inactivityTime()));
printf(' <img width=14 height=14 src="%s/timeout.png" title="%s" alt="%s"/>',IMGDIR,$m,'Timeout'); printf(' <img width="14" height="14" src="%s/timeout.png" title="%s" alt="%s"/>',IMGDIR,$m,'Timeout');
} }
echo '</td></tr>'; echo '</td></tr>';
} }
@ -420,7 +420,7 @@ class HTMLTree extends Tree {
$href['edit'] = htmlspecialchars(sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',$server->getIndex(),$dnENCODE)); $href['edit'] = htmlspecialchars(sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s',$server->getIndex(),$dnENCODE));
echo '<tr class="option">'; echo '<tr class="option">';
printf('<td class="spacer" colspan=%s></td>',$level+2); printf('<td class="spacer" colspan="%s"></td>',$level+2);
# Is this node expanded? (deciding whether to draw "+" or "-") # Is this node expanded? (deciding whether to draw "+" or "-")
if ($entry->isOpened()) if ($entry->isOpened())
@ -437,7 +437,7 @@ class HTMLTree extends Tree {
printf('<td class="icon"><a href="%s" id="node_%s_%s"><img src="%s/%s" alt="img" /></a></td>', printf('<td class="icon"><a href="%s" id="node_%s_%s"><img src="%s/%s" alt="img" /></a></td>',
$href['edit'],$server->getIndex(),preg_replace('/=/','_',base64_encode($item)),IMGDIR,$entry->getIcon()); $href['edit'],$server->getIndex(),preg_replace('/=/','_',base64_encode($item)),IMGDIR,$entry->getIcon());
printf('<td class="phplm" width=100%% colspan="%s"><span style="white-space: nowrap;">',$this->getDepth()+3-$level); printf('<td class="phplm" colspan="%s" style="width: 100%%;"><span style="white-space: nowrap;">',$this->getDepth()+3-$level);
printf('<a href="%s">%s</a>',$href['edit'],$this->get_formatted_dn($entry,$level)); printf('<a href="%s">%s</a>',$href['edit'],$this->get_formatted_dn($entry,$level));
if ($child_count) if ($child_count)
@ -493,7 +493,7 @@ class HTMLTree extends Tree {
$href = htmlspecialchars(sprintf('cmd.php?cmd=template_engine&server_id=%s&container=%s',$this->getServerID(),$encoded_dn)); $href = htmlspecialchars(sprintf('cmd.php?cmd=template_engine&server_id=%s&container=%s',$this->getServerID(),$encoded_dn));
echo '<tr>'; echo '<tr>';
printf('<td class="spacer" colspan=%s></td>',$level+3); printf('<td class="spacer" colspan="%s"></td>',$level+3);
printf('<td class="icon"><a href="%s"><img src="%s/create.png" alt="%s" /></a></td>',$href,IMGDIR,_('new')); printf('<td class="icon"><a href="%s"><img src="%s/create.png" alt="%s" /></a></td>',$href,IMGDIR,_('new'));
printf('<td class="link" colspan="%s"><a href="%s" title="%s %s">%s</a></td>', printf('<td class="link" colspan="%s"><a href="%s" title="%s %s">%s</a></td>',
$this->getDepth()+3-$level,$href,_('Create a new entry in'),$rdn,_('Create new entry here')); $this->getDepth()+3-$level,$href,_('Create a new entry in'),$rdn,_('Create new entry here'));
@ -525,8 +525,8 @@ class HTMLTree extends Tree {
echo '</tr>'; echo '</tr>';
printf('<tr><td class="blank" colspan="%s">&nbsp;</td>',$this->getDepth()+3); printf('<tr><td class="blank" colspan="%s">&nbsp;</td></tr>',$this->getDepth()+3);
printf('<tr><td class="blank" colspan="%s">&nbsp;</td>',$this->getDepth()+3); printf('<tr><td class="blank" colspan="%s">&nbsp;</td></tr>',$this->getDepth()+3);
} }
/** /**

View File

@ -25,8 +25,8 @@ class MassRender extends TemplateRender {
$j,htmlspecialchars($attribute->getName()),$i, $j,htmlspecialchars($attribute->getName()),$i,
$j,htmlspecialchars($attribute->getName()),$i, $j,htmlspecialchars($attribute->getName()),$i,
htmlspecialchars($val), htmlspecialchars($val),
$attribute->needJS('focus') ? sprintf('onFocus="focus_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('focus') ? sprintf('onfocus="focus_%s(this);" ',$attribute->getName()) : '',
$attribute->needJS('blur') ? sprintf('onBlur="blur_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('blur') ? sprintf('onblur="blur_%s(this);" ',$attribute->getName()) : '',
($attribute->getSize() > 0) ? sprintf('size="%s"',$attribute->getSize()) : '', ($attribute->getSize() > 0) ? sprintf('size="%s"',$attribute->getSize()) : '',
($attribute->getMaxLength() > 0) ? sprintf('maxlength="%s"',$attribute->getMaxLength()) : ''); ($attribute->getMaxLength() > 0) ? sprintf('maxlength="%s"',$attribute->getMaxLength()) : '');

View File

@ -558,7 +558,7 @@ class PageRender extends Visitor {
if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__); if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__);
if (DEBUGTMPSUB) printf(' <small>[%s]</small>',__METHOD__); if (DEBUGTMPSUB) printf(' <small>[%s]</small>',__METHOD__);
echo $attribute->getValue($i); echo htmlspecialchars($attribute->getValue($i));
} }
/** /**
@ -588,7 +588,7 @@ class PageRender extends Visitor {
$val = $attribute->getValue($i); $val = $attribute->getValue($i);
printf('<input type="text" class="roval" name="new_values[%s][%s]" id="new_values_%s_%s" value="%s" readonly />', printf('<input type="text" class="roval" name="new_values[%s][%s]" id="new_values_%s_%s" value="%s" readonly="readonly" />',
htmlspecialchars($attribute->getName()),$i,htmlspecialchars($attribute->getName()),$i,htmlspecialchars($val)); htmlspecialchars($attribute->getName()),$i,htmlspecialchars($attribute->getName()),$i,htmlspecialchars($val));
} }
@ -598,14 +598,14 @@ class PageRender extends Visitor {
$val = $attribute->getValue($i); $val = $attribute->getValue($i);
if ($attribute->getHelper() || $attribute->getVerify()) if ($attribute->getHelper() || $attribute->getVerify())
echo '<table cellspacing="0" cellpadding="0" border=1><tr><td valign="top">'; echo '<table cellspacing="0" cellpadding="0" border="0"><tr><td valign="top">';
printf('<input type="text" class="value" name="new_values[%s][%s]" id="new_values_%s_%s" value="%s" %s%s %s %s/>', printf('<input type="text" class="value" name="new_values[%s][%s]" id="new_values_%s_%s" value="%s" %s%s %s %s/>',
htmlspecialchars($attribute->getName()),$i, htmlspecialchars($attribute->getName()),$i,
htmlspecialchars($attribute->getName()),$i, htmlspecialchars($attribute->getName()),$i,
htmlspecialchars($val), htmlspecialchars($val),
$attribute->needJS('focus') ? sprintf('onFocus="focus_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('focus') ? sprintf('onfocus="focus_%s(this);" ',$attribute->getName()) : '',
$attribute->needJS('blur') ? sprintf('onBlur="blur_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('blur') ? sprintf('onblur="blur_%s(this);" ',$attribute->getName()) : '',
($attribute->getSize() > 0) ? sprintf('size="%s"',$attribute->getSize()) : '', ($attribute->getSize() > 0) ? sprintf('size="%s"',$attribute->getSize()) : '',
($attribute->getMaxLength() > 0) ? sprintf('maxlength="%s"',$attribute->getMaxLength()) : ''); ($attribute->getMaxLength() > 0) ? sprintf('maxlength="%s"',$attribute->getMaxLength()) : '');
@ -689,8 +689,8 @@ class PageRender extends Visitor {
printf('<input type="file" class="value" name="new_values[%s][%s]" id="new_values_%s_%s" value="" %s%s %s %s/><br />', printf('<input type="file" class="value" name="new_values[%s][%s]" id="new_values_%s_%s" value="" %s%s %s %s/><br />',
htmlspecialchars($attribute->getName()),$i, htmlspecialchars($attribute->getName()),$i,
htmlspecialchars($attribute->getName()),$i, htmlspecialchars($attribute->getName()),$i,
$attribute->needJS('focus') ? sprintf('onFocus="focus_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('focus') ? sprintf('onfocus="focus_%s(this);" ',$attribute->getName()) : '',
$attribute->needJS('blur') ? sprintf('onBlur="blur_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('blur') ? sprintf('onblur="blur_%s(this);" ',$attribute->getName()) : '',
($attribute->getSize() > 0) ? 'size="'.$attribute->getSize().'"' : '', ($attribute->getSize() > 0) ? 'size="'.$attribute->getSize().'"' : '',
($attribute->getMaxLength() > 0) ? 'maxlength="'.$attribute->getMaxLength().'"' : ''); ($attribute->getMaxLength() > 0) ? 'maxlength="'.$attribute->getMaxLength().'"' : '');
} }
@ -705,8 +705,8 @@ class PageRender extends Visitor {
printf('<input type="text" class="value" id="new_values_%s_%s" name="new_values[%s][%s]" value="%s" %s%s %s %s/>&nbsp;', printf('<input type="text" class="value" id="new_values_%s_%s" name="new_values[%s][%s]" value="%s" %s%s %s %s/>&nbsp;',
$attribute->getName(),$i, $attribute->getName(),$i,
htmlspecialchars($attribute->getName()),$i,htmlspecialchars($val), htmlspecialchars($attribute->getName()),$i,htmlspecialchars($val),
$attribute->needJS('focus') ? sprintf('onFocus="focus_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('focus') ? sprintf('onfocus="focus_%s(this);" ',$attribute->getName()) : '',
$attribute->needJS('blur') ? sprintf('onBlur="blur_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('blur') ? sprintf('onblur="blur_%s(this);" ',$attribute->getName()) : '',
($attribute->getSize() > 0) ? sprintf('size="%s"',$attribute->getSize()) : '', ($attribute->getSize() > 0) ? sprintf('size="%s"',$attribute->getSize()) : '',
($attribute->getMaxLength() > 0) ? sprintf('maxlength="%s"',$attribute->getMaxLength()) : ''); ($attribute->getMaxLength() > 0) ? sprintf('maxlength="%s"',$attribute->getMaxLength()) : '');
@ -727,13 +727,13 @@ class PageRender extends Visitor {
printf('<span style="white-space: nowrap;"><input type="text" class="value" name="%s" id="%s" value="%s" %s%s %s %s/>&nbsp;', printf('<span style="white-space: nowrap;"><input type="text" class="value" name="%s" id="%s" value="%s" %s%s %s %s/>&nbsp;',
$input_name,$id,htmlspecialchars($val), $input_name,$id,htmlspecialchars($val),
$attribute->needJS('focus') ? sprintf('onFocus="focus_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('focus') ? sprintf('onfocus="focus_%s(this);" ',$attribute->getName()) : '',
$attribute->needJS('blur') ? sprintf('onBlur="blur_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('blur') ? sprintf('onblur="blur_%s(this);" ',$attribute->getName()) : '',
($attribute->getSize() > 0) ? 'size="'.$attribute->getSize().'"' : '', ($attribute->getSize() > 0) ? 'size="'.$attribute->getSize().'"' : '',
($attribute->getMaxLength() > 0) ? 'maxlength="'.$attribute->getMaxLength().'"' : ''); ($attribute->getMaxLength() > 0) ? 'maxlength="'.$attribute->getMaxLength().'"' : '');
# Draw a link for popping up the entry browser if this is the type of attribute that houses DNs. # Draw a link for popping up the entry browser if this is the type of attribute that houses DNs.
draw_chooser_link(sprintf('entry_form.%s',$id),false); draw_chooser_link('entry_form',$id,false);
echo '</span>'; echo '</span>';
if ($attribute->getHelper()) { if ($attribute->getHelper()) {
@ -837,9 +837,9 @@ class PageRender extends Visitor {
$val = $attribute->getValue($i); $val = $attribute->getValue($i);
printf('<textarea class="roval" %s %s name="new_values[%s][%s]" id="new_values_%s_%s" readonly>%s</textarea>', printf('<textarea class="roval" rows="%s" cols="%s" name="new_values[%s][%s]" id="new_values_%s_%s" readonly="readonly">%s</textarea>',
($attribute->getRows() > 0) ? 'rows="'.$attribute->getRows().'"' : '', ($attribute->getRows() > 0) ? $attribute->getRows() : 5,
($attribute->getCols() > 0) ? 'cols="'.$attribute->getCols().'"' : '', ($attribute->getCols() > 0) ? $attribute->getCols() : 100,
htmlspecialchars($attribute->getName()),$i, htmlspecialchars($attribute->getName()),$i,
htmlspecialchars($attribute->getName()),$i, htmlspecialchars($attribute->getName()),$i,
$val); $val);
@ -850,13 +850,13 @@ class PageRender extends Visitor {
$val = $attribute->getValue($i); $val = $attribute->getValue($i);
printf('<textarea class="value" %s %s name="new_values[%s][%s]" id="new_values_%s_%s" %s%s>%s</textarea>', printf('<textarea class="value" rows="%s" cols="%s" name="new_values[%s][%s]" id="new_values_%s_%s" %s%s>%s</textarea>',
($attribute->getRows() > 0) ? 'rows="'.$attribute->getRows().'"' : '', ($attribute->getRows() > 0) ? $attribute->getRows() : 5,
($attribute->getCols() > 0) ? 'cols="'.$attribute->getCols().'"' : '', ($attribute->getCols() > 0) ? $attribute->getCols() : 100,
htmlspecialchars($attribute->getName()),$i, htmlspecialchars($attribute->getName()),$i,
htmlspecialchars($attribute->getName()),$i, htmlspecialchars($attribute->getName()),$i,
$attribute->needJS('focus') ? sprintf('onFocus="focus_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('focus') ? sprintf('onfocus="focus_%s(this);" ',$attribute->getName()) : '',
$attribute->needJS('blur') ? sprintf('onBlur="blur_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('blur') ? sprintf('onblur="blur_%s(this);" ',$attribute->getName()) : '',
$val); $val);
} }
@ -937,7 +937,7 @@ class PageRender extends Visitor {
$obfuscate_password = obfuscate_password_display($enc_type); $obfuscate_password = obfuscate_password_display($enc_type);
printf('<input type="%s" class="roval" name="new_values[%s][%s]" id="new_values_%s_%s" value="%s" %s readonly /><br />', printf('<input type="%s" class="roval" name="new_values[%s][%s]" id="new_values_%s_%s" value="%s" %s readonly="readonly" /><br />',
($obfuscate_password ? 'password' : 'text'), ($obfuscate_password ? 'password' : 'text'),
htmlspecialchars($attribute->getName()),$i,htmlspecialchars($attribute->getName()), htmlspecialchars($attribute->getName()),$i,htmlspecialchars($attribute->getName()),
$i,htmlspecialchars($val),($attribute->getSize() > 0) ? 'size="'.$attribute->getSize().'"' : ''); $i,htmlspecialchars($val),($attribute->getSize() > 0) ? 'size="'.$attribute->getSize().'"' : '');
@ -969,8 +969,8 @@ class PageRender extends Visitor {
($obfuscate_password ? 'password' : 'text'), ($obfuscate_password ? 'password' : 'text'),
htmlspecialchars($attribute->getName()),$i,$id, htmlspecialchars($attribute->getName()),$i,$id,
htmlspecialchars($val), htmlspecialchars($val),
$attribute->needJS('focus') ? sprintf('onFocus="focus_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('focus') ? sprintf('onfocus="focus_%s(this);" ',$attribute->getName()) : '',
$attribute->needJS('blur') ? sprintf('onBlur="blur_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('blur') ? sprintf('onblur="blur_%s(this);" ',$attribute->getName()) : '',
($attribute->getSize() > 0) ? sprintf('size="%s"',$attribute->getSize()) : '', ($attribute->getSize() > 0) ? sprintf('size="%s"',$attribute->getSize()) : '',
($attribute->getMaxLength() > 0) ? sprintf('maxlength="%s"',$attribute->getMaxLength()) : ''); ($attribute->getMaxLength() > 0) ? sprintf('maxlength="%s"',$attribute->getMaxLength()) : '');
@ -1016,24 +1016,24 @@ class PageRender extends Visitor {
if (($attribute->getSize() > 0) && ($attribute->getSize() < $attribute->getOptionCount())) { if (($attribute->getSize() > 0) && ($attribute->getSize() < $attribute->getOptionCount())) {
printf('<select name="new_values[%s][]" size="%s" multiple>', printf('<select name="new_values[%s][]" size="%s" multiple="multiple">',
htmlspecialchars($attribute->getName()),$attribute->getSize()); htmlspecialchars($attribute->getName()),$attribute->getSize());
foreach ($attribute->getSelection() as $value => $description) { foreach ($attribute->getSelection() as $value => $description) {
if (in_array($value,$vals)) if (in_array($value,$vals))
$selected[$value] = true; $selected[$value] = true;
printf('<option id="new_values_%s_%s" value="%s" onMouseDown="focus_%s(this);" onClick="blur_%s(this);" %s>%s</option>', printf('<option id="new_values_%s_%s" value="%s" onmouseDown="focus_%s(this);" onclick="blur_%s(this);" %s>%s</option>',
htmlspecialchars($attribute->getName()),$j++, htmlspecialchars($attribute->getName()),$j++,
$value,htmlspecialchars($attribute->getName()),htmlspecialchars($attribute->getName()), $value,htmlspecialchars($attribute->getName()),htmlspecialchars($attribute->getName()),
isset($selected[$value]) ? 'selected' : '',$description); isset($selected[$value]) ? 'selected="selected"' : '',$description);
echo "\n"; echo "\n";
} }
foreach ($vals as $val) { foreach ($vals as $val) {
if (! isset($selected[$val])) if (! isset($selected[$val]))
printf('<option id="new_values_%s_%s" value="%s" onMouseDown="focus_%s(this);" onClick="blur_%s(this);" selected>%s</option>', printf('<option id="new_values_%s_%s" value="%s" onmousedown="focus_%s(this);" onclick="blur_%s(this);" selected="selected">%s</option>',
htmlspecialchars($attribute->getName()),$j++, htmlspecialchars($attribute->getName()),$j++,
$val,htmlspecialchars($attribute->getName()), $val,htmlspecialchars($attribute->getName()),
htmlspecialchars($attribute->getName()),$val); htmlspecialchars($attribute->getName()),$val);
@ -1044,7 +1044,7 @@ class PageRender extends Visitor {
echo '</select>'; echo '</select>';
} else { } else {
echo '<table cellspacing="0" cellpadding="0" border=0>'; echo '<table cellspacing="0" cellpadding="0" border="0">';
foreach ($attribute->getSelection() as $value => $description) { foreach ($attribute->getSelection() as $value => $description) {
if (in_array($value,$vals)) if (in_array($value,$vals))
@ -1053,19 +1053,19 @@ class PageRender extends Visitor {
printf('<tr><td><input type="checkbox" id="new_values_%s_%s" name="new_values[%s][]" value="%s" %s%s %s/></td><td><span style="white-space: nowrap;">&nbsp;%s</span></td></tr>', printf('<tr><td><input type="checkbox" id="new_values_%s_%s" name="new_values[%s][]" value="%s" %s%s %s/></td><td><span style="white-space: nowrap;">&nbsp;%s</span></td></tr>',
htmlspecialchars($attribute->getName()),$j++, htmlspecialchars($attribute->getName()),$j++,
htmlspecialchars($attribute->getName()),$value, htmlspecialchars($attribute->getName()),$value,
$attribute->needJS('focus') ? sprintf('onFocus="focus_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('focus') ? sprintf('onfocus="focus_%s(this);" ',$attribute->getName()) : '',
$attribute->needJS('blur') ? sprintf('onBlur="blur_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('blur') ? sprintf('onblur="blur_%s(this);" ',$attribute->getName()) : '',
isset($selected[$value]) ? 'checked' : '', isset($selected[$value]) ? 'checked="checked"' : '',
$description); $description);
} }
foreach ($vals as $val) foreach ($vals as $val)
if (! isset($selected[$val])) if (! isset($selected[$val]))
printf('<tr><td><input type="checkbox" id="new_values_%s_%s" name="new_values[%s][]" value="%s" %s%s checked/></td><td><span style="white-space: nowrap;">&nbsp;%s</span></td></tr>', printf('<tr><td><input type="checkbox" id="new_values_%s_%s" name="new_values[%s][]" value="%s" %s%s checked="checked"/></td><td><span style="white-space: nowrap;">&nbsp;%s</span></td></tr>',
htmlspecialchars($attribute->getName()),$j++, htmlspecialchars($attribute->getName()),$j++,
htmlspecialchars($attribute->getName()),$val, htmlspecialchars($attribute->getName()),$val,
$attribute->needJS('focus') ? sprintf('onFocus="focus_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('focus') ? sprintf('onfocus="focus_%s(this);" ',$attribute->getName()) : '',
$attribute->needJS('blur') ? sprintf('onBlur="blur_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('blur') ? sprintf('onblur="blur_%s(this);" ',$attribute->getName()) : '',
$val); $val);
echo '</table>'; echo '</table>';
@ -1091,12 +1091,12 @@ class PageRender extends Visitor {
printf('<select name="new_values[%s][]" id="new_values_%s_%s" %s%s>', printf('<select name="new_values[%s][]" id="new_values_%s_%s" %s%s>',
htmlspecialchars($attribute->getName()), htmlspecialchars($attribute->getName()),
htmlspecialchars($attribute->getName()),$i, htmlspecialchars($attribute->getName()),$i,
$attribute->needJS('focus') ? sprintf('onFocus="focus_%s(this);" ',$attribute->getName()) : '', $attribute->needJS('focus') ? sprintf('onfocus="focus_%s(this);" ',$attribute->getName()) : '',
$attribute->needJS('blur') ? sprintf('onBlur="blur_%s(this);" ',$attribute->getName()) : ''); $attribute->needJS('blur') ? sprintf('onblur="blur_%s(this);" ',$attribute->getName()) : '');
foreach ($attribute->getSelection() as $value => $description) { foreach ($attribute->getSelection() as $value => $description) {
printf('<option value="%s" %s>%s</option>',$value, printf('<option value="%s" %s>%s</option>',$value,
($value == $val) ? 'selected' : '',$description); ($value == $val) ? 'selected="selected"' : '',$description);
if ($value == $val) if ($value == $val)
$found = true; $found = true;
@ -1108,7 +1108,7 @@ class PageRender extends Visitor {
} }
if (!$found) { if (!$found) {
printf('<option value="%s" selected>%s</option>',$val,$val == '' ? '&nbsp;' : $val); printf('<option value="%s" selected="selected">%s</option>',$val,$val == '' ? '&nbsp;' : $val);
if ($val == '') if ($val == '')
$empty_value = true; $empty_value = true;
echo "\n"; echo "\n";

View File

@ -79,14 +79,15 @@ class QueryRender extends PageRender {
$baseDNs = $server->getBaseDN(); $baseDNs = $server->getBaseDN();
echo '<center>'; printf('<script type="text/javascript" src="%sdnChooserPopup.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%sdnChooserPopup.js"></script>',JSDIR); echo '<form action="cmd.php" id="advanced_search_form">';
echo '<form action="cmd.php" name="advanced_search_form">'; echo '<div>';
echo '<input type="hidden" name="cmd" value="query_engine" />'; echo '<input type="hidden" name="cmd" value="query_engine" />';
printf('<input type="hidden" name="server_id" value="%s" />',$server->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$server->getIndex());
echo '</div>';
echo '<table class="forminput" border=0>'; echo '<table class="forminput" border="0" style="margin-left: auto; margin-right: auto;">';
echo '<tr><td colspan=2>&nbsp;</td></tr>'; echo '<tr><td colspan="2">&nbsp;</td></tr>';
$templates = $this->getTemplates(); $templates = $this->getTemplates();
@ -101,21 +102,22 @@ class QueryRender extends PageRender {
foreach ($templates->getTemplates() as $template) foreach ($templates->getTemplates() as $template)
printf('<option value="%s" %s>%s</option>', printf('<option value="%s" %s>%s</option>',
$template->getID(), $template->getID(),
($this->template_id == $template->getID() ? 'selected' : ''), ($this->template_id == $template->getID() ? 'selected="selected"' : ''),
$template->getDescription()); $template->getDescription());
echo '</select>'; echo '</select>';
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
} }
echo '<tr>';
printf('<td><acronym title="%s">%s</acronym></td>',_('The format to show the query results'),_('Display Format')); printf('<td><acronym title="%s">%s</acronym></td>',_('The format to show the query results'),_('Display Format'));
echo '<td>'; echo '<td>';
echo '<select name="format" style="width: 200px">'; echo '<select name="format" style="width: 200px">';
printf('<option value="list" %s>%s</option>', printf('<option value="list" %s>%s</option>',
$_SESSION[APPCONFIG]->getValue('search','display') == 'list' ? 'selected' : '',_('list')); $_SESSION[APPCONFIG]->getValue('search','display') == 'list' ? 'selected="selected"' : '',_('list'));
printf('<option value="table" %s>%s</option>', printf('<option value="table" %s>%s</option>',
$_SESSION[APPCONFIG]->getValue('search','display') == 'table' ? 'selected' : '',_('table')); $_SESSION[APPCONFIG]->getValue('search','display') == 'table' ? 'selected="selected"' : '',_('table'));
echo '</select>'; echo '</select>';
echo '</td>'; echo '</td>';
@ -135,17 +137,17 @@ class QueryRender extends PageRender {
echo '<tr>'; echo '<tr>';
echo '<td colspan=2>'; echo '<td colspan="2">';
printf('<div id="customquery" style="display: %s">','block'); printf('<div id="customquery" style="display: %s">','block');
echo '<br/>'; echo '<br/>';
echo '<fieldset>'; echo '<fieldset>';
printf('<legend>%s</legend>',_('Custom Query')); printf('<legend>%s</legend>',_('Custom Query'));
echo '<table border=0></tr>'; echo '<table border="0"><tr>';
printf('<td>%s</td>',_('Base DN')); printf('<td>%s</td>',_('Base DN'));
printf('<td><input type="text" name="base" value="%s" style="width: 200px" id="base" />',count($baseDNs) == 1 ? $baseDNs[0] : ''); printf('<td><input type="text" name="base" value="%s" style="width: 200px" id="base" />',count($baseDNs) == 1 ? $baseDNs[0] : '');
draw_chooser_link('advanced_search_form.base'); draw_chooser_link('advanced_search_form','base');
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
@ -202,11 +204,10 @@ class QueryRender extends PageRender {
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
printf('<tr><td colspan="2"><br /><center><input type="submit" name="search" value="%s" /></center></td></tr>',_('Search')); printf('<tr><td colspan="2" style="text-align: center;"><br /><input type="submit" name="search" value="%s" /></td></tr>',_('Search'));
echo '</table>'; echo '</table>';
echo '</form>'; echo '</form>';
echo '</center>';
} }
private function visitStart() { private function visitStart() {
@ -248,7 +249,7 @@ class QueryRender extends PageRender {
printf('<div id="DN%s" style="display: %s">', printf('<div id="DN%s" style="display: %s">',
$this->getAjaxRef($base), ($show == $this->getAjaxRef($base) ? 'block' : 'none')); $this->getAjaxRef($base), ($show == $this->getAjaxRef($base) ? 'block' : 'none'));
echo '<table class="result_box" border=0 width=100%>'; echo '<table class="result_box" border="0" width="100%">';
echo '<tr><td>'; echo '<tr><td>';
echo '<br/>'; echo '<br/>';
echo '<br/>'; echo '<br/>';
@ -266,12 +267,12 @@ class QueryRender extends PageRender {
# Temporarily set our DN, for rendering that leverages our DN (eg: JpegPhoto) # Temporarily set our DN, for rendering that leverages our DN (eg: JpegPhoto)
$this->template->setDN($dndetails['dn']); $this->template->setDN($dndetails['dn']);
echo '<table class="result" border=0>'; echo '<table class="result" border="0">';
echo '<tr class="list_title">'; echo '<tr class="list_title">';
printf('<td class="icon"><img src="%s/%s" alt="icon" /></td>',IMGDIR,get_icon($server->getIndex(),$dndetails['dn'])); printf('<td class="icon"><img src="%s/%s" alt="icon" /></td>',IMGDIR,get_icon($server->getIndex(),$dndetails['dn']));
printf('<td colspan=2><a href="cmd.php?cmd=template_engine&amp;server_id=%s&amp;dn=%s">%s</a></td>', printf('<td colspan="2"><a href="cmd.php?cmd=template_engine&amp;server_id=%s&amp;dn=%s">%s</a></td>',
$server->getIndex(),rawurlencode(dn_unescape($dndetails['dn'])),htmlspecialchars(get_rdn($dndetails['dn']))); $server->getIndex(),rawurlencode(dn_unescape($dndetails['dn'])),htmlspecialchars(get_rdn($dndetails['dn'])));
echo '</tr>'; echo '</tr>';
@ -323,12 +324,15 @@ class QueryRender extends PageRender {
} }
printf('<form action="cmd.php" method="post" id="massform_%s">',$counter); printf('<form action="cmd.php" method="post" id="massform_%s">',$counter);
echo '<div>';
printf('<input type="hidden" name="server_id" value="%s" />',$server->getIndex()); printf('<input type="hidden" name="server_id" value="%s" />',$server->getIndex());
foreach ($this->template->resultsdata[$base]['attrs'] as $attr) foreach ($this->template->resultsdata[$base]['attrs'] as $attr)
printf('<input type="hidden" name="attrs[]" value="%s" />',$attr); printf('<input type="hidden" name="attrs[]" value="%s" />',$attr);
echo '<table class="result_table" border=0>'; echo '</div>';
echo '<table class="result_table" border="0">';
echo '<thead class="fixheader">'; echo '<thead class="fixheader">';
echo '<tr class="heading">'; echo '<tr class="heading">';
@ -352,7 +356,7 @@ class QueryRender extends PageRender {
# Temporarily set our DN, for rendering that leverages our DN (eg: JpegPhoto) # Temporarily set our DN, for rendering that leverages our DN (eg: JpegPhoto)
$this->template->setDN($dndetails['dn']); $this->template->setDN($dndetails['dn']);
printf('<tr class="%s" id="tr_ma_%s" onClick="var cb=document.getElementById(\'ma_%s\'); cb.checked=!cb.checked;">', printf('<tr class="%s" id="tr_ma_%s" onclick="var cb=document.getElementById(\'ma_%s\'); cb.checked=!cb.checked;">',
$j%2 ? 'even' : 'odd',$j,$j); $j%2 ? 'even' : 'odd',$j,$j);
# Is mass action enabled. # Is mass action enabled.
@ -401,8 +405,8 @@ class QueryRender extends PageRender {
if ($_SESSION[APPCONFIG]->getValue('mass','enabled')) { if ($_SESSION[APPCONFIG]->getValue('mass','enabled')) {
printf('<tr class="%s">',++$j%2 ? 'odd' : 'even'); printf('<tr class="%s">',++$j%2 ? 'odd' : 'even');
printf('<td><input type="checkbox" name="allbox" value="1" onclick="CheckAll(1,\'massform_\',%s);" /></td>',$counter); printf('<td><input type="checkbox" name="allbox" value="1" onclick="CheckAll(1,\'massform_\',%s);" /></td>',$counter);
printf('<td colspan=%s>',2+count(explode(',',$ado))); printf('<td colspan="%s">',2+count(explode(',',$ado)));
echo '<select name="cmd" onChange="if (this.value) submit();" style="font-size: 12px">'; echo '<select name="cmd" onchange="if (this.value) submit();" style="font-size: 12px">';
foreach ($mass_actions as $action => $display) foreach ($mass_actions as $action => $display)
printf('<option value="%s">%s</option>',$display,$action); printf('<option value="%s">%s</option>',$display,$action);
@ -430,7 +434,7 @@ class QueryRender extends PageRender {
} }
if (get_request('format','REQUEST',false,'table') == 'table') if (get_request('format','REQUEST',false,'table') == 'table')
printf('<script type="text/javascript" language="javascript" src="%sCheckAll.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sCheckAll.js"></script>',JSDIR);
} }
public function drawSubTitle($subtitle=null) { public function drawSubTitle($subtitle=null) {
@ -472,7 +476,7 @@ class QueryRender extends PageRender {
private function drawBaseTabs() { private function drawBaseTabs() {
# Setup the Javascript to show/hide our DIVs. # Setup the Javascript to show/hide our DIVs.
echo '<script type="text/javascript" language="javascript">'; echo '<script type="text/javascript">';
echo 'function items() {'; echo 'function items() {';
echo 'var $items = new Array();'; echo 'var $items = new Array();';
$counter = 0; $counter = 0;
@ -482,7 +486,7 @@ class QueryRender extends PageRender {
echo '}</script>'; echo '}</script>';
echo "\n\n"; echo "\n\n";
echo '<table class="result_table" border=0>'; echo '<table class="result_table" border="0">';
echo '<tr>'; echo '<tr>';
$counter = 0; $counter = 0;
foreach ($this->template->results as $base => $results) { foreach ($this->template->results as $base => $results) {
@ -503,7 +507,7 @@ class QueryRender extends PageRender {
private function drawResultsTable($base,$results) { private function drawResultsTable($base,$results) {
$server = $this->getServer(); $server = $this->getServer();
echo '<table class="result" border=0>'; echo '<table class="result" border="0">';
echo '<tr>'; echo '<tr>';
printf('<td>%s: <b>%s</b><br/><br/><div class="execution_time">(%s %s)</div></td>',_('Entries found'), printf('<td>%s: <b>%s</b><br/><br/><div class="execution_time">(%s %s)</div></td>',_('Entries found'),

View File

@ -498,17 +498,21 @@ class TemplateRender extends PageRender {
$avail_templates = $this->getTemplates(); $avail_templates = $this->getTemplates();
$templates = $avail_templates->getTemplates($this->getMode(),$this->getModeContainer()); $templates = $avail_templates->getTemplates($this->getMode(),$this->getModeContainer());
printf('<center><h3>%s</h3></center>',$msg); printf('<h3 style="text-align: center;">%s</h3>',$msg);
$href_parms = array_to_query_string($_GET,array('meth')); $href_parms = array_to_query_string($_GET,array('meth'));
printf('<form name="template_choice_form" action="cmd.php?%s" method="post">',htmlspecialchars($href_parms)); printf('<form id="template_choice_form" action="cmd.php?%s" method="post">',htmlspecialchars($href_parms));
echo "\n\n"; echo "\n\n";
if (count($_POST)) {
echo '<div>';
foreach ($_POST as $p => $v) foreach ($_POST as $p => $v)
printf('<input type="hidden" name="%s" value="%s">',$p,$v); printf('<input type="hidden" name="%s" value="%s" />',$p,$v);
echo '</div>';
echo "\n\n"; echo "\n\n";
}
echo '<table class="forminput" width="100%" border=0>'; echo '<table class="forminput" width="100%" border="0">';
echo '<tr>'; echo '<tr>';
printf('<td class="heading" style="vertical-align: top">%s:</td>',_('Templates')); printf('<td class="heading" style="vertical-align: top">%s:</td>',_('Templates'));
echo '<td>'; echo '<td>';
@ -542,7 +546,7 @@ class TemplateRender extends PageRender {
printf('<td><input type="radio" name="template" value="%s" id="%s" onclick="return ajDISPLAY(\'BODY\',\'%s&amp;template=%s\',\'%s\');" /></td>', printf('<td><input type="radio" name="template" value="%s" id="%s" onclick="return ajDISPLAY(\'BODY\',\'%s&amp;template=%s\',\'%s\');" /></td>',
htmlspecialchars($details->getID()),htmlspecialchars($details->getID()),htmlspecialchars($href_parms),$details->getID(),_('Retrieving DN')); htmlspecialchars($details->getID()),htmlspecialchars($details->getID()),htmlspecialchars($href_parms),$details->getID(),_('Retrieving DN'));
else else
printf('<td><input type="radio" name="template" value="%s" id="%s" onclick="document.forms.template_choice_form.submit()" /></td>', printf('<td><input type="radio" name="template" value="%s" id="%s" onclick="document.getElementById(\'template_choice_form\').submit()" /></td>',
htmlspecialchars($details->getID()),htmlspecialchars($details->getID())); htmlspecialchars($details->getID()),htmlspecialchars($details->getID()));
} }
@ -552,7 +556,7 @@ class TemplateRender extends PageRender {
htmlspecialchars($details->getID())); htmlspecialchars($details->getID()));
if ($isInValid) if ($isInValid)
printf('<span style="color: gray"><acronym title="%s">',_($isInValid)); printf('<span id="%s" style="color: gray"><acronym title="%s">',htmlspecialchars($details->getID()),_($isInValid));
echo _($details->getTitle()); echo _($details->getTitle());
@ -579,7 +583,7 @@ class TemplateRender extends PageRender {
printf('<td><input type="radio" name="template" value="none" id="none" onclick="return ajDISPLAY(\'BODY\',\'%s&amp;template=%s\',\'%s\');" /></td>', printf('<td><input type="radio" name="template" value="none" id="none" onclick="return ajDISPLAY(\'BODY\',\'%s&amp;template=%s\',\'%s\');" /></td>',
htmlspecialchars($href_parms),'none',_('Retrieving DN')); htmlspecialchars($href_parms),'none',_('Retrieving DN'));
else else
echo '<td><input type="radio" name="template" value="none" id="none" onclick="document.forms.template_choice_form.submit()" /></td>'; echo '<td><input type="radio" name="template" value="none" id="none" onclick="document.getElementById(\'template_choice_form\').submit()" /></td>';
printf('<td class="icon"><label for="none"><img src="%s/ldap-default.png" alt="" /></label></td>',IMGDIR); printf('<td class="icon"><label for="none"><img src="%s/ldap-default.png" alt="" /></label></td>',IMGDIR);
printf('<td class="label"><label for="none">%s</label></td>',_('Default')); printf('<td class="label"><label for="none">%s</label></td>',_('Default'));
@ -640,7 +644,7 @@ class TemplateRender extends PageRender {
} else { } else {
# Draw internal attributes # Draw internal attributes
if (get_request('show_internal_attrs','REQUEST')) { if (get_request('show_internal_attrs','REQUEST')) {
echo '<table class="entry" cellspacing="0" align="center" border=0>'; echo '<table class="entry" cellspacing="0" border="0" style="margin-left: auto; margin-right: auto;">';
$this->drawInternalAttributes(); $this->drawInternalAttributes();
echo '</table><br/>'; echo '</table><br/>';
echo "\n"; echo "\n";
@ -700,7 +704,7 @@ class TemplateRender extends PageRender {
case 'creation': case 'creation':
$subtitle = sprintf('%s: <b>%s</b>&nbsp;&nbsp;&nbsp;%s: <b>%s</b>', $subtitle = sprintf('%s: <b>%s</b>&nbsp;&nbsp;&nbsp;%s: <b>%s</b>',
_('Server'),$this->getServer()->getName(), _('Server'),$this->getServer()->getName(),
_('Container'),$this->container); _('Container'),htmlspecialchars($this->container));
if ($this->template_id) { if ($this->template_id) {
$subtitle .= '<br />'; $subtitle .= '<br />';
@ -714,7 +718,7 @@ class TemplateRender extends PageRender {
case 'modification': case 'modification':
$subtitle = sprintf('%s: <b>%s</b>&nbsp;&nbsp;&nbsp;%s: <b>%s</b>', $subtitle = sprintf('%s: <b>%s</b>&nbsp;&nbsp;&nbsp;%s: <b>%s</b>',
_('Server'),$this->getServer()->getName(), _('Server'),$this->getServer()->getName(),
_('Distinguished Name'),$this->dn); _('Distinguished Name'),htmlspecialchars($this->dn));
if ($this->template_id) { if ($this->template_id) {
$subtitle .= '<br />'; $subtitle .= '<br />';
@ -737,7 +741,7 @@ class TemplateRender extends PageRender {
# We only have a menu for editing entries. # We only have a menu for editing entries.
if ($this->template->getContext() == 'edit') { if ($this->template->getContext() == 'edit') {
echo '<table class="menu" width="100%" border=0>'; echo '<table class="menu" width="100%" border="0">';
echo '<tr>'; echo '<tr>';
$menuitem_number = 0; $menuitem_number = 0;
@ -767,7 +771,7 @@ class TemplateRender extends PageRender {
if ($ms) { if ($ms) {
if (($menuitem_number % 2) == 1) { if (($menuitem_number % 2) == 1) {
$menuitem_number++; $menuitem_number++;
echo '<td colspan=2>&nbsp;</td>'; echo '<td colspan="2">&nbsp;</td>';
$endofrow = false; $endofrow = false;
$start = false; $start = false;
} }
@ -792,7 +796,7 @@ class TemplateRender extends PageRender {
} elseif ($ms) { } elseif ($ms) {
if (($menuitem_number % 2) == 1) { if (($menuitem_number % 2) == 1) {
$menuitem_number++; $menuitem_number++;
echo '<td colspan=2>&nbsp;</td>'; echo '<td colspan="2">&nbsp;</td>';
$endofrow = false; $endofrow = false;
$start = false; $start = false;
} }
@ -1249,7 +1253,7 @@ class TemplateRender extends PageRender {
if (! count($this->template->getRDNAttrs())) { if (! count($this->template->getRDNAttrs())) {
printf('<tr><th colspan="2">%s</th></tr>','RDN'); printf('<tr><th colspan="2">%s</th></tr>','RDN');
echo '<tr><td class="value" colspan="2"><center><select name="rdn_attribute[]" id="rdn_attribute">'; echo '<tr><td class="value" colspan="2" style="text-align: center;"><select name="rdn_attribute[]" id="rdn_attribute" />';
printf('<option value="">%s</option>',_('select the rdn attribute')); printf('<option value="">%s</option>',_('select the rdn attribute'));
if ($_SESSION[APPCONFIG]->getValue('appearance','rdn_all_attrs')) if ($_SESSION[APPCONFIG]->getValue('appearance','rdn_all_attrs'))
@ -1267,7 +1271,7 @@ class TemplateRender extends PageRender {
} }
} }
echo '</select></center></td></tr>'; echo '</select></td></tr>';
} else { } else {
echo '<tr><td colspan="2">'; echo '<tr><td colspan="2">';
@ -1286,7 +1290,7 @@ class TemplateRender extends PageRender {
echo '<tr>'; echo '<tr>';
printf('<td class="heading">%s</td>',_('Container')); printf('<td class="heading">%s</td>',_('Container'));
printf('<td><input type="text" name="container" size="40" value="%s" />',htmlspecialchars($default_container)); printf('<td><input type="text" name="container" size="40" value="%s" />',htmlspecialchars($default_container));
draw_chooser_link('entry_form.container'); draw_chooser_link('entry_form','container');
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
} }
@ -1303,7 +1307,7 @@ class TemplateRender extends PageRender {
echo '<tr>'; echo '<tr>';
printf('<td class="heading">%s</td>',_('ObjectClasses')); printf('<td class="heading">%s</td>',_('ObjectClasses'));
echo '<td><select name="new_values[objectclass][]" multiple="true" size="15">'; echo '<td><select name="new_values[objectclass][]" multiple="multiple" size="15">';
foreach ($socs as $name => $oclass) { foreach ($socs as $name => $oclass) {
if (! strcasecmp('top',$name)) if (! strcasecmp('top',$name))
@ -1346,29 +1350,35 @@ class TemplateRender extends PageRender {
/** FORM METHODS **/ /** FORM METHODS **/
public function drawFormStart() { public function drawFormStart() {
echo '<form action="cmd.php" method="post" enctype="multipart/form-data" name="entry_form" onSubmit="return submitForm(this)">'; echo '<form action="cmd.php" method="post" enctype="multipart/form-data" id="entry_form" onsubmit="return submitForm(this)">';
echo '<div>';
if ($_SESSION[APPCONFIG]->getValue('confirm','update')) if ($_SESSION[APPCONFIG]->getValue('confirm','update'))
echo '<input type="hidden" name="cmd" value="update_confirm" />'; echo '<input type="hidden" name="cmd" value="update_confirm" />';
else else
echo '<input type="hidden" name="cmd" value="update" />'; echo '<input type="hidden" name="cmd" value="update" />';
echo '</div>';
} }
protected function drawForm() { protected function drawForm() {
if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__); if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__);
echo '<div>';
printf('<input type="hidden" name="server_id" value="%s" />',$this->getServerID()); printf('<input type="hidden" name="server_id" value="%s" />',$this->getServerID());
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($this->template->getDN())); printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($this->template->getDN()));
printf('<input type="hidden" name="template" value="%s" />',$this->template->getID()); printf('<input type="hidden" name="template" value="%s" />',$this->template->getID());
echo '</div>';
echo '<table class="entry" cellspacing="0" align="center" border=0>'; echo '<table class="entry" cellspacing="0" border="0" style="margin-left: auto; margin-right: auto;">';
$this->drawShownAttributes(); $this->drawShownAttributes();
$this->drawFormSubmitButton(); $this->drawFormSubmitButton();
echo '</table>'; echo '</table>';
echo '<div>&nbsp;';
$this->drawHiddenAttributes(); $this->drawHiddenAttributes();
echo '</div>';
} }
public function drawFormEnd() { public function drawFormEnd() {
@ -1382,11 +1392,11 @@ class TemplateRender extends PageRender {
# For debugging, show the template object. # For debugging, show the template object.
if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_debug_info') && get_request('debug','GET')) { if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_debug_info') && get_request('debug','GET')) {
echo "\n\n"; echo "\n\n";
printf('<img src="%s/plus.png" alt="Plus" onClick="if (document.getElementById(\'DEBUGtemplate\').style.display == \'none\') { document.getElementById(\'DEBUGtemplate\').style.display = \'block\' } else { document.getElementById(\'DEBUGtemplate\').style.display = \'none\' };"/>',IMGDIR); printf('<img src="%s/plus.png" alt="Plus" onclick="if (document.getElementById(\'DEBUGtemplate\').style.display == \'none\') { document.getElementById(\'DEBUGtemplate\').style.display = \'block\' } else { document.getElementById(\'DEBUGtemplate\').style.display = \'none\' };"/>',IMGDIR);
echo '<div id="DEBUGtemplate" style="display: none">'; echo '<div id="DEBUGtemplate" style="display: none">';
echo '<fieldset>'; echo '<fieldset>';
printf('<legend>DEBUG: %s</legend>',$this->template->getDescription()); printf('<legend>DEBUG: %s</legend>',$this->template->getDescription());
echo '<textarea cols=120 rows=20>'; echo '<textarea cols="120" rows="20">';
debug_dump($this); debug_dump($this);
echo '</textarea>'; echo '</textarea>';
echo '</fieldset>'; echo '</fieldset>';
@ -1398,7 +1408,7 @@ class TemplateRender extends PageRender {
if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__); if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__);
if (! $this->template->isReadOnly()) if (! $this->template->isReadOnly())
printf('<tr><td colspan=2><center><input type="submit" id="create_button" name="submit" value="%s" /></center></td></tr>',_('Update Object')); printf('<tr><td colspan="2" style="text-align: center;"><input type="submit" id="create_button" name="submit" value="%s" /></td></tr>',_('Update Object'));
} }
/** STEP FORM METHODS **/ /** STEP FORM METHODS **/
@ -1412,7 +1422,7 @@ class TemplateRender extends PageRender {
# The default template only uses 2 pages # The default template only uses 2 pages
$this->pagelast = 2; $this->pagelast = 2;
echo '<center><h4>'; echo '<h4 style="text-align: center;">';
printf('%s: ',sprintf(_('Step %s of %s'),$page,$this->pagelast)); printf('%s: ',sprintf(_('Step %s of %s'),$page,$this->pagelast));
if ($page == 1) if ($page == 1)
@ -1420,10 +1430,10 @@ class TemplateRender extends PageRender {
else else
echo _('Specify attributes and values'); echo _('Specify attributes and values');
echo '</h4></center>'; echo '</h4>';
} elseif ($this->template->getDescription()) } elseif ($this->template->getDescription())
printf('<center><h4>%s (%s)</h4></center>', printf('<h4 style="text-align: center;">%s (%s)</h4>',
_($this->template->getDescription()), _($this->template->getDescription()),
sprintf(_('Step %s of %s'),$page,$this->pagelast)); sprintf(_('Step %s of %s'),$page,$this->pagelast));
} }
@ -1432,10 +1442,11 @@ class TemplateRender extends PageRender {
if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__); if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__);
if (($this->template->isType('default') && $this->template->getContext() == 'create' && $page == 1) || $page < $this->pagelast) { if (($this->template->isType('default') && $this->template->getContext() == 'create' && $page == 1) || $page < $this->pagelast) {
echo '<form action="cmd.php?cmd=template_engine" method="post" enctype="multipart/form-data" name="entry_form" onSubmit="return submitForm(this)">'; echo '<form action="cmd.php?cmd=template_engine" method="post" enctype="multipart/form-data" id="entry_form" onsubmit="return submitForm(this)">';
} else { } else {
echo '<form action="cmd.php" method="post" enctype="multipart/form-data" name="entry_form" onSubmit="return submitForm(this)">'; echo '<form action="cmd.php" method="post" enctype="multipart/form-data" id="entry_form" onsubmit="return submitForm(this)">';
echo '<div>';
if ($_SESSION[APPCONFIG]->getValue('confirm','create')) if ($_SESSION[APPCONFIG]->getValue('confirm','create'))
echo '<input type="hidden" name="cmd" value="create_confirm" />'; echo '<input type="hidden" name="cmd" value="create_confirm" />';
@ -1454,15 +1465,18 @@ class TemplateRender extends PageRender {
$this->drawHiddenAttributes(); $this->drawHiddenAttributes();
if ($this->template->isType('default') && $page == 1) { if ($this->template->isType('default') && $page == 1) {
echo '<table class="forminput" align="center" border=0>'; echo '</div>';
echo '<table class="forminput" border="0" style="margin-left: auto; margin-right: auto;">';
$this->drawContainerChooser($this->template->getContainer()); $this->drawContainerChooser($this->template->getContainer());
$this->drawObjectClassChooser(); $this->drawObjectClassChooser();
} else { } else {
printf('<input type="hidden" name="container" value="%s" />',htmlspecialchars($this->template->getContainer())); printf('<input type="hidden" name="container" value="%s" />',htmlspecialchars($this->template->getContainer()));
echo '</div>';
echo '<table class="entry" cellspacing="0" align="center" border=0>'; echo '<table class="entry" cellspacing="0" border="0" style="margin-left: auto; margin-right: auto;">';
$this->drawRDNChooser(); $this->drawRDNChooser();
@ -1490,7 +1504,7 @@ class TemplateRender extends PageRender {
if ($page < $this->pagelast) if ($page < $this->pagelast)
printf('<td>&nbsp;</td><td><input type="submit" id="create_button" value="%s" /></td>',_('Proceed &gt;&gt;')); printf('<td>&nbsp;</td><td><input type="submit" id="create_button" value="%s" /></td>',_('Proceed &gt;&gt;'));
else else
printf('<td><center><input type="submit" id="create_button" name="submit" value="%s"/></center></td>',_('Create Object')); printf('<td style="text-align: center;"><input type="submit" id="create_button" name="submit" value="%s" /></td>',_('Create Object'));
echo '</tr>'; echo '</tr>';
} }
@ -1522,7 +1536,7 @@ class TemplateRender extends PageRender {
$this->draw('Template',$attribute); $this->draw('Template',$attribute);
else else
printf('<tr class="noinput"><td colspan="2"><center>(%s)</center></td></tr>',_('none')); printf('<tr class="noinput"><td colspan="2" style="text-align: center;">(%s)</td></tr>',_('none'));
printf('<tr><th colspan="2">%s</th></tr>',_('Optional Attributes')); printf('<tr><th colspan="2">%s</th></tr>',_('Optional Attributes'));
if (count($attrs['optional'])) if (count($attrs['optional']))
@ -1530,7 +1544,7 @@ class TemplateRender extends PageRender {
$this->draw('Template',$attribute); $this->draw('Template',$attribute);
else else
printf('<tr class="noinput"><td colspan="2"><center>(%s)</center></td></tr>',_('none')); printf('<tr class="noinput"><td colspan="2" style="text-align: center;">(%s)</td></tr>',_('none'));
echo "\n"; echo "\n";
} }
@ -1556,14 +1570,14 @@ class TemplateRender extends PageRender {
printf('<!-- START: %s -->',__METHOD__); printf('<!-- START: %s -->',__METHOD__);
echo "\n"; echo "\n";
printf('<script type="text/javascript" language="javascript" src="%sTemplateRender.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sTemplateRender.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%stoAscii.js"></script>',JSDIR); printf('<script type="text/javascript" src="%stoAscii.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%sdnChooserPopup.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sdnChooserPopup.js"></script>',JSDIR);
echo "\n"; echo "\n";
printf('<!-- START: MAIN FORM VALIDATION: %s -->',__METHOD__); printf('<!-- START: MAIN FORM VALIDATION: %s -->',__METHOD__);
echo ' echo '
<script type="text/javascript" language="javascript"> <script type="text/javascript">
function validateForm(silence) { function validateForm(silence) {
var i = 0; var i = 0;
var valid = true; var valid = true;
@ -1598,7 +1612,7 @@ function validateForm(silence) {
# For DateAttributes, we need to set some defaults for the js_calendar. # For DateAttributes, we need to set some defaults for the js_calendar.
echo '<!-- START: GLOBAL SETTINGS FOR THE js_calendar -->'."\n"; echo '<!-- START: GLOBAL SETTINGS FOR THE js_calendar -->'."\n";
echo '<script type="text/javascript" language="javascript">'."\n"; echo '<script type="text/javascript">'."\n";
echo 'var defaults = new Array();'."\n"; echo 'var defaults = new Array();'."\n";
printf('var default_date_format = "%s";',$_SESSION[APPCONFIG]->getValue('appearance','date')); printf('var default_date_format = "%s";',$_SESSION[APPCONFIG]->getValue('appearance','date'));
echo "\n"; echo "\n";
@ -1609,7 +1623,7 @@ function validateForm(silence) {
foreach ($this->template->getAttributesShown() as $attribute) foreach ($this->template->getAttributesShown() as $attribute)
$this->draw('Javascript',$attribute); $this->draw('Javascript',$attribute);
echo '<script type="text/javascript" language="javascript">validateForm(true);</script>'."\n"; echo '<script type="text/javascript">validateForm(true);</script>'."\n";
printf('<!-- END: %s -->',__METHOD__); printf('<!-- END: %s -->',__METHOD__);
echo "\n"; echo "\n";
} }
@ -1633,7 +1647,7 @@ function validateForm(silence) {
printf('<!-- START: %s -->',__METHOD__); printf('<!-- START: %s -->',__METHOD__);
echo ' echo '
<script type="text/javascript" language="javascript"> <script type="text/javascript">
var attrTrace; var attrTrace;
function fill(id,value) { function fill(id,value) {
attrTrace = new Array(); attrTrace = new Array();
@ -1718,7 +1732,7 @@ function fillRec(id,value) {
else else
echo '<tr>'; echo '<tr>';
echo '<td class="value" colspan=2>'; echo '<td class="value" colspan="2">';
} }
protected function drawEndValueLineAttribute($attribute) { protected function drawEndValueLineAttribute($attribute) {
@ -1784,7 +1798,7 @@ function fillRec(id,value) {
else { else {
if ($icon = $attribute->getIcon()) if ($icon = $attribute->getIcon())
printf('<img src="%s" alt="Icon" align="top" />&nbsp;',$icon); printf('<img src="%s" alt="Icon" style="float: right;" />&nbsp;',$icon);
} }
} }
@ -1792,7 +1806,7 @@ function fillRec(id,value) {
if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__); if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__);
if (strlen($val) <= 0) if (strlen($val) <= 0)
printf('<img src="%s/ldap-alias.png" alt="Go" align="top" />&nbsp;',IMGDIR); printf('<img src="%s/ldap-alias.png" alt="Go" style="float: right;" />&nbsp;',IMGDIR);
elseif ($this->getServer()->dnExists($val)) elseif ($this->getServer()->dnExists($val))
printf('<a href="cmd.php?cmd=template_engine&amp;server_id=%s&amp;dn=%s" title="%s %s"><img src="%s/ldap-alias.png" alt="Go" /></a>&nbsp;', printf('<a href="cmd.php?cmd=template_engine&amp;server_id=%s&amp;dn=%s" title="%s %s"><img src="%s/ldap-alias.png" alt="Go" /></a>&nbsp;',
$this->getServerID(),rawurlencode($val),_('Go to'),$val,IMGDIR); $this->getServerID(),rawurlencode($val),_('Go to'),$val,IMGDIR);
@ -1803,7 +1817,7 @@ function fillRec(id,value) {
protected function drawMailValueIconAttribute($attribute,$val) { protected function drawMailValueIconAttribute($attribute,$val) {
if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__); if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__);
$img = sprintf('<img src="%s/mail.png" alt="%s" align="top" />',IMGDIR,_('Mail')); $img = sprintf('<img src="%s/mail.png" alt="%s" style="float: right;" />',IMGDIR,_('Mail'));
if (strlen($val) <= 0) if (strlen($val) <= 0)
echo $img; echo $img;
else else
@ -1814,13 +1828,13 @@ function fillRec(id,value) {
protected function drawUrlValueIconAttribute($attribute,$val) { protected function drawUrlValueIconAttribute($attribute,$val) {
if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__); if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__);
$img = sprintf('<img src="%s/ldap-dc.png" alt="%s" align="top" />',IMGDIR,_('URL')); $img = sprintf('<img src="%s/ldap-dc.png" alt="%s" style="float: right;" />',IMGDIR,_('URL'));
$url = explode(' +',$val,2); $url = explode(' +',$val,2);
if (strlen($val) <= 0) if (strlen($val) <= 0)
echo $img; echo $img;
else else
printf('<a href="%s" target="new">%s</a>',htmlspecialchars($url[0]),$img); printf('<a href="%s" onclick="target=\'new\';">%s</a>',htmlspecialchars($url[0]),$img);
echo '&nbsp;'; echo '&nbsp;';
} }
@ -1838,7 +1852,7 @@ function fillRec(id,value) {
printf('<!-- START: ATTRIBUTE %s (%s)-->',__METHOD__,$attribute->getName()); printf('<!-- START: ATTRIBUTE %s (%s)-->',__METHOD__,$attribute->getName());
echo "\n"; echo "\n";
echo '<script type="text/javascript" language="javascript">'."\n"; echo '<script type="text/javascript">'."\n";
echo '// focus'."\n"; echo '// focus'."\n";
if ($attribute->needJS('focus')) { if ($attribute->needJS('focus')) {
@ -1936,7 +1950,7 @@ function fillRec(id,value) {
$item = ''; $item = '';
echo '<table class="entry" border=0><tr><td width=25>&nbsp;</td>'; echo '<table class="entry" border="0"><tr><td style="width: 25px;">&nbsp;</td>';
echo '<td>'; echo '<td>';
foreach (array('add','modify','rename') as $action) foreach (array('add','modify','rename') as $action)
if ($item = $this->get('MenuItem',$attribute,$action)) if ($item = $this->get('MenuItem',$attribute,$action))
@ -2048,7 +2062,7 @@ function fillRec(id,value) {
$val = $attribute->getValue($i); $val = $attribute->getValue($i);
if ($attribute->isVisible()) { if ($attribute->isVisible()) {
echo '<table cellspacing="0" cellpadding="0" width="100%" border=0><tr><td class="icon" width=25>'; echo '<table cellspacing="0" cellpadding="0" width="100%" border="0"><tr><td class="icon" style="width: 25px;">';
$this->draw('Icon',$attribute,$val); $this->draw('Icon',$attribute,$val);
echo '</td>'; echo '</td>';
@ -2063,7 +2077,7 @@ function fillRec(id,value) {
if ($attribute->isVisible()) { if ($attribute->isVisible()) {
echo '</td>'; echo '</td>';
echo '<td valign="top" align="right">'; echo '<td valign="top" style="text-align: right;">';
$this->draw('RequiredSymbol',$attribute); $this->draw('RequiredSymbol',$attribute);
echo '</td></tr></table>'; echo '</td></tr></table>';
} }
@ -2129,14 +2143,14 @@ function fillRec(id,value) {
$id,htmlspecialchars($attribute->getName()),$i); $id,htmlspecialchars($attribute->getName()),$i);
foreach ($vals as $v) { foreach ($vals as $v) {
printf('<option value="%s" %s>%s</option>',$v,($v == $default) ? 'selected' : '',$v); printf('<option value="%s" %s>%s</option>',$v,($v == $default) ? 'selected="selected"' : '',$v);
if ($v == $default) if ($v == $default)
$found = true; $found = true;
} }
if (! $found) if (! $found)
printf('<option value="%s" selected>%s</option>',$default,$default ? $default : '&nbsp;'); printf('<option value="%s" selected="selected">%s</option>',$default,$default ? $default : '&nbsp;');
echo '</select>'; echo '</select>';
@ -2185,7 +2199,7 @@ function fillRec(id,value) {
echo "\n"; echo "\n";
echo '<!-- This form is submitted by JavaScript when the user clicks "Delete attribute" on a binary attribute -->'; echo '<!-- This form is submitted by JavaScript when the user clicks "Delete attribute" on a binary attribute -->';
echo '<form name="delete_attribute_form" action="cmd.php?cmd=delete_attr" method="post">'; echo '<form id="delete_attribute_form" action="cmd.php?cmd=delete_attr" method="post">';
printf('<input type="hidden" name="server_id" value="%s" />',$this->getServerID()); printf('<input type="hidden" name="server_id" value="%s" />',$this->getServerID());
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($this->template->getDN())); printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($this->template->getDN()));
printf('<input type="hidden" name="template" value="%s" />',$this->template->getID()); printf('<input type="hidden" name="template" value="%s" />',$this->template->getID());
@ -2194,13 +2208,13 @@ function fillRec(id,value) {
echo '</form>'; echo '</form>';
echo ' echo '
<script type="text/javascript" language="javascript"> <script type="text/javascript">
function deleteAttribute(attrName,friendlyName,i) function deleteAttribute(attrName,friendlyName,i)
{ {
if (confirm("'._('Really delete value from attribute').' \'" + friendlyName + "\'?")) { if (confirm("'._('Really delete value from attribute').' \'" + friendlyName + "\'?")) {
document.delete_attribute_form.attr.value = attrName; document.getElementById(\'delete_attribute_form\'.attr.value = attrName;
document.delete_attribute_form.index.value = i; document.getElementById(\'delete_attribute_form\'.index.value = i;
document.delete_attribute_form.submit(); document.getElementById(\'delete_attribute_form\'.submit();
} }
} }
</script>'; </script>';
@ -2224,9 +2238,9 @@ function deleteAttribute(attrName,friendlyName,i)
# This JS may have been rendered by multiple Date attributes # This JS may have been rendered by multiple Date attributes
if (! $drawn) { if (! $drawn) {
printf('<script type="text/javascript" language="javascript" src="%sjscalendar/lang/calendar-en.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sjscalendar/lang/calendar-en.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%sjscalendar/calendar-setup.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sjscalendar/calendar-setup.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%sdate_selector.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sdate_selector.js"></script>',JSDIR);
$drawn = true; $drawn = true;
} }
@ -2240,10 +2254,10 @@ function deleteAttribute(attrName,friendlyName,i)
$config['format'] = $config['date'][$attribute->getName()]; $config['format'] = $config['date'][$attribute->getName()];
for ($i=0;$i<=$attribute->getValueCount();$i++) { for ($i=0;$i<=$attribute->getValueCount();$i++) {
printf('<script type="text/javascript" language="javascript">defaults[\'new_values_%s_%s\'] = \'%s\';</script>',$attribute->getName(),$i,$config['format']); printf('<script type="text/javascript">defaults[\'new_values_%s_%s\'] = \'%s\';</script>',$attribute->getName(),$i,$config['format']);
if (in_array_ignore_case($attribute->getName(),array_keys($config['time'])) && ($config['time'][$attribute->getName()])) if (in_array_ignore_case($attribute->getName(),array_keys($config['time'])) && ($config['time'][$attribute->getName()]))
printf('<script type="text/javascript" language="javascript">defaults[\'f_time_%s_%s\'] = \'%s\';</script>',$attribute->getName(),$i,'true'); printf('<script type="text/javascript">defaults[\'f_time_%s_%s\'] = \'%s\';</script>',$attribute->getName(),$i,'true');
echo "\n"; echo "\n";
} }
@ -2256,7 +2270,7 @@ function deleteAttribute(attrName,friendlyName,i)
* Draws an HTML date selector button which, when clicked, pops up a date selector dialog. * Draws an HTML date selector button which, when clicked, pops up a date selector dialog.
*/ */
protected function drawSelectorPopupDateAttribute($attribute,$i) { protected function drawSelectorPopupDateAttribute($attribute,$i) {
printf('<a href="javascript:dateSelector(\'%s_%s\');" title="%s"><img class="chooser" src="%s/calendar.png" id="f_trigger_%s_%s" style="cursor: pointer;" alt="Calendar" /></a>', printf('<a href="javascript:dateSelector(\'%s_%s\');" title="%s"><img src="%s/calendar.png" alt="Calendar" class="chooser" id="f_trigger_%s_%s" style="cursor: pointer;" /></a>',
$attribute->getName(),$i,_('Click to popup a dialog to select a date graphically'),IMGDIR,$attribute->getName(),$i); $attribute->getName(),$i,_('Click to popup a dialog to select a date graphically'),IMGDIR,$attribute->getName(),$i);
} }
@ -2299,7 +2313,7 @@ function deleteAttribute(attrName,friendlyName,i)
# Add the javascript so we can call check password later. # Add the javascript so we can call check password later.
echo ' echo '
<script type="text/javascript" language="javascript"> <script type="text/javascript">
function passwordComparePopup(component_id) { function passwordComparePopup(component_id) {
mywindow = open(\'password_checker.php\',\'myname\',\'resizable=no,width=500,height=200,scrollbars=1\'); mywindow = open(\'password_checker.php\',\'myname\',\'resizable=no,width=500,height=200,scrollbars=1\');
mywindow.location.href = \'password_checker.php?componentid=\'+component_id; mywindow.location.href = \'password_checker.php?componentid=\'+component_id;
@ -2337,7 +2351,7 @@ function deleteAttribute(attrName,friendlyName,i)
$pwd = str_replace("'","\\'",$pwd); $pwd = str_replace("'","\\'",$pwd);
printf("\n<!-- %s -->\n",__METHOD__); printf("\n<!-- %s -->\n",__METHOD__);
echo '<script type="text/javascript" language="javascript">'."\n"; echo '<script type="text/javascript">'."\n";
echo 'var i = 0;'."\n"; echo 'var i = 0;'."\n";
printf('var component = document.getElementById(\'new_values_%s_\'+i);',$attribute->getName()); printf('var component = document.getElementById(\'new_values_%s_\'+i);',$attribute->getName());
echo "\n"; echo "\n";
@ -2368,14 +2382,14 @@ function deleteAttribute(attrName,friendlyName,i)
$default = $this->getServer()->getValue('appearance','password_hash'); $default = $this->getServer()->getValue('appearance','password_hash');
if (! $attribute->getPostValue()) if (! $attribute->getPostValue())
printf('<input type="hidden" name="post_value[%s][]" value="%s"/>',$attribute->getName(),$i); printf('<input type="hidden" name="post_value[%s][]" value="%s" />',$attribute->getName(),$i);
printf('<select name="%s[%s][%s]" id="%s_%s_%s">', printf('<select name="%s[%s][%s]" id="%s_%s_%s">',
$id,htmlspecialchars($attribute->getName()),$i, $id,htmlspecialchars($attribute->getName()),$i,
$id,htmlspecialchars($attribute->getName()),$i); $id,htmlspecialchars($attribute->getName()),$i);
foreach (password_types() as $v => $display) foreach (password_types() as $v => $display)
printf('<option value="%s" %s>%s</option>',$v,($v == $default) ? 'selected' : '',$display); printf('<option value="%s" %s>%s</option>',$v,($v == $default) ? 'selected="selected"' : '',$display);
echo '</select>'; echo '</select>';
} }
@ -2384,7 +2398,7 @@ function deleteAttribute(attrName,friendlyName,i)
$id = 'enc'; $id = 'enc';
if (! $attribute->getPostValue()) if (! $attribute->getPostValue())
printf('<input type="hidden" name="post_value[%s][]" value="%s"/>',$attribute->getName(),$i); printf('<input type="hidden" name="post_value[%s][]" value="%s" />',$attribute->getName(),$i);
switch ($attribute->getName()) { switch ($attribute->getName()) {
case 'sambalmpassword' : $enc = 'lm'; break; case 'sambalmpassword' : $enc = 'lm'; break;
@ -2394,7 +2408,7 @@ function deleteAttribute(attrName,friendlyName,i)
return ''; return '';
} }
printf('<input type="hidden" name="%s[%s][%s]" id="%s_%s_%s" value="%s">', printf('<input type="hidden" name="%s[%s][%s]" id="%s_%s_%s" value="%s" />',
$id,htmlspecialchars($attribute->getName()),$i, $id,htmlspecialchars($attribute->getName()),$i,
$id,htmlspecialchars($attribute->getName()),$i,$enc); $id,htmlspecialchars($attribute->getName()),$i,$enc);
} }

View File

@ -167,7 +167,7 @@ function app_error_handler($errno,$errstr,$file,$lineno) {
$body .= sprintf('<tr><td>Web server:</td><td><b>%s</b></td></tr>',isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : 'SCRIPT'); $body .= sprintf('<tr><td>Web server:</td><td><b>%s</b></td></tr>',isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : 'SCRIPT');
if (function_exists('get_href')) if (function_exists('get_href'))
$body .= sprintf('<tr><td colspan="2"><a href="%s" target="_blank"><center>%s.</center></a></td></tr>', $body .= sprintf('<tr><td colspan="2"><a href="%s" onclick="target=\'_blank\';"><center>%s.</center></a></td></tr>',
get_href('search_bug',"&summary_keyword=".rawurlencode($errstr)), get_href('search_bug',"&summary_keyword=".rawurlencode($errstr)),
_('Please check and see if this bug has been reported')); _('Please check and see if this bug has been reported'));
$body .= '</table>'; $body .= '</table>';
@ -375,31 +375,31 @@ function cmd_control_pane($type) {
'forum'=>array( 'forum'=>array(
'title'=>_('Forum'), 'title'=>_('Forum'),
'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true,
'link'=>sprintf('href="%s" title="%s" target="_blank"',get_href('forum'),_('Forum')), 'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('forum'),_('Forum')),
'image'=>sprintf('<img src="%s/forum-big.png" alt="%s" />',IMGDIR,_('Forum'))), 'image'=>sprintf('<img src="%s/forum-big.png" alt="%s" />',IMGDIR,_('Forum'))),
'feature'=>array( 'feature'=>array(
'title'=>_('Request feature'), 'title'=>_('Request feature'),
'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true,
'link'=>sprintf('href="%s" title="%s" target="_blank"',get_href('add_rfe'),_('Request feature')), 'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('add_rfe'),_('Request feature')),
'image'=>sprintf('<img src="%s/request-feature-big.png" alt="%s" />',IMGDIR,_('Request feature'))), 'image'=>sprintf('<img src="%s/request-feature-big.png" alt="%s" />',IMGDIR,_('Request feature'))),
'bug'=>array( 'bug'=>array(
'title'=>_('Report a bug'), 'title'=>_('Report a bug'),
'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true,
'link'=>sprintf('href="%s" title="%s" target="_blank"',get_href('add_bug'),_('Report a bug')), 'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('add_bug'),_('Report a bug')),
'image'=>sprintf('<img src="%s/bug-big.png" alt="%s" />',IMGDIR,_('Report a bug'))), 'image'=>sprintf('<img src="%s/bug-big.png" alt="%s" />',IMGDIR,_('Report a bug'))),
'donation'=>array( 'donation'=>array(
'title'=>_('Donate'), 'title'=>_('Donate'),
'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true,
'link'=>sprintf('href="%s" title="%s" target="_blank"',get_href('donate'),_('Donate')), 'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('donate'),_('Donate')),
'image'=>sprintf('<img src="%s/smile-big.png" alt="%s" />',IMGDIR,_('Donate'))), 'image'=>sprintf('<img src="%s/smile-big.png" alt="%s" />',IMGDIR,_('Donate'))),
'help'=>array( 'help'=>array(
'title'=>_('Help'), 'title'=>_('Help'),
'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true, 'enable'=>isset($_SESSION[APPCONFIG]) ? $_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks') : true,
'link'=>sprintf('href="%s" title="%s" target="_blank"',get_href('documentation'),_('Help')), 'link'=>sprintf('href="%s" title="%s" onclick="target=\'_blank\';"',get_href('documentation'),_('Help')),
'image'=>sprintf('<img src="%s/help-big.png" alt="%s" />',IMGDIR,_('Help'))) 'image'=>sprintf('<img src="%s/help-big.png" alt="%s" />',IMGDIR,_('Help')))
); );
@ -615,7 +615,7 @@ function error($msg,$type='note',$redirect=null,$fatal=false,$backtrace=false) {
$display = strlen(serialize($line['args'])) < 50 ? htmlspecialchars(serialize($line['args'])) : htmlspecialchars(substr(serialize($line['args']),0,50)).'...<TRUNCATED>'; $display = strlen(serialize($line['args'])) < 50 ? htmlspecialchars(serialize($line['args'])) : htmlspecialchars(substr(serialize($line['args']),0,50)).'...<TRUNCATED>';
$_SESSION['backtrace'][$error]['args'] = $line['args']; $_SESSION['backtrace'][$error]['args'] = $line['args'];
if (file_exists(LIBDIR.'../tools/unserialize.php')) if (file_exists(LIBDIR.'../tools/unserialize.php'))
$body .= sprintf('&nbsp;(<a href="%s?index=%s" target="backtrace">%s</a>)', $body .= sprintf('&nbsp;(<a href="%s?index=%s" onclick="target=\'backtrace\';">%s</a>)',
'../tools/unserialize.php',$error,$display); '../tools/unserialize.php',$error,$display);
else else
$body .= sprintf('&nbsp;(%s)',$display); $body .= sprintf('&nbsp;(%s)',$display);
@ -1919,7 +1919,7 @@ function support_oid_to_text($key) {
if ($oid_id) { if ($oid_id) {
$CACHE[$oid_id]['title'] = isset($entry[4]) ? $entry[4] : null; $CACHE[$oid_id]['title'] = isset($entry[4]) ? $entry[4] : null;
$CACHE[$oid_id]['ref'] = isset($entry[6]) ? $entry[6] : null; $CACHE[$oid_id]['ref'] = isset($entry[6]) ? $entry[6] : null;
$desc = isset($entry[8]) ? $entry[8] : sprintf('<acryonym title="%s"><small>%s</small></acryonym>',$unknown['desc'],$unknown['title']); $desc = isset($entry[8]) ? $entry[8] : sprintf('<acronym title="%s">%s</acronym>',$unknown['desc'],$unknown['title']);
$CACHE[$oid_id]['desc'] = preg_replace('/\s+/',' ',$desc); $CACHE[$oid_id]['desc'] = preg_replace('/\s+/',' ',$desc);
} }
} }
@ -1931,7 +1931,7 @@ function support_oid_to_text($key) {
return array( return array(
'title'=>$key, 'title'=>$key,
'ref'=>null, 'ref'=>null,
'desc'=>sprintf('<acryonym title="%s"><small>%s</small></acryonym>',$unknown['desc'],$unknown['title'])); 'desc'=>sprintf('<acronym title="%s">%s</acronym>',$unknown['desc'],$unknown['title']));
} }
/** /**
@ -1941,7 +1941,7 @@ function ldap_error_msg($msg,$errnum) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs); debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
$body = '<table border=0>'; $body = '<table border="0">';
$errnum = ('0x'.str_pad(dechex($errnum),2,0,STR_PAD_LEFT)); $errnum = ('0x'.str_pad(dechex($errnum),2,0,STR_PAD_LEFT));
$verbose_error = pla_verbose_error($errnum); $verbose_error = pla_verbose_error($errnum);
@ -2386,15 +2386,11 @@ function get_enc_type($user_password) {
* "edit_form.member_uid". See /templates/modification/default.php for example usage. * "edit_form.member_uid". See /templates/modification/default.php for example usage.
* @param boolean (optional) If true, the function draws the localized text "choose" to the right of the button. * @param boolean (optional) If true, the function draws the localized text "choose" to the right of the button.
*/ */
function draw_chooser_link($form_element,$include_choose_text=true,$rdn='none') { function draw_chooser_link($form,$element,$include_choose_text=true,$rdn='none') {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs); debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
if ($rdn == 'none') $href = sprintf("javascript:dnChooserPopup('%s','%s','%s');",$form,$element,$rdn == 'none' ? '' : rawurlencode($rdn));
$href = sprintf("javascript:dnChooserPopup('%s','');",$form_element);
else
$href = sprintf("javascript:dnChooserPopup('%s','%s');",$form_element,$rdn);
$title = _('Click to popup a dialog to select an entry (DN) graphically'); $title = _('Click to popup a dialog to select an entry (DN) graphically');
printf('<a href="%s" title="%s"><img class="chooser" src="%s/find.png" alt="Find" /></a>',$href,$title,IMGDIR); printf('<a href="%s" title="%s"><img class="chooser" src="%s/find.png" alt="Find" /></a>',$href,$title,IMGDIR);
@ -2795,7 +2791,7 @@ function server_select_list($selected=null,$logged_on=false,$name='index',$isVis
$count++; $count++;
$server_menu_html .= sprintf('<option value="%s" %s>%s</option>', $server_menu_html .= sprintf('<option value="%s" %s>%s</option>',
$server->getIndex(),($server->getIndex() == $selected ? 'selected' : ''),$server->getName()); $server->getIndex(),($server->getIndex() == $selected ? 'selected="selected"' : ''),$server->getName());
# We will set this variable, in case there is only 1 hit. # We will set this variable, in case there is only 1 hit.
$selected_server = $server; $selected_server = $server;

View File

@ -79,12 +79,10 @@ class page {
ob_start(); ob_start();
# Initial Values # Initial Values
$this->_pageheader[] .= '<?xml version="1.0" encoding="utf-8"?>'."\n"; #$this->_pageheader[] .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"';
$this->_pageheader[] .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"'."\n"; #$this->_pageheader[] .= '"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">'."\n";
$this->_pageheader[] .= '"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">'."\n"; $this->_pageheader[] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
$this->_pageheader[] .= "\n"; $this->_pageheader[] .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="auto">'."\n";
$this->_pageheader[] .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="auto" lang="auto" dir="ltr">'."\n";
$this->_pageheader[] .= "\n";
} }
/* Add to the HTML Header */ /* Add to the HTML Header */
@ -121,8 +119,8 @@ class page {
if (defined('JSDIR')) { if (defined('JSDIR')) {
printf('<link type="text/css" rel="stylesheet" media="all" href="%sjscalendar/calendar-blue.css" title="blue" />',JSDIR); printf('<link type="text/css" rel="stylesheet" media="all" href="%sjscalendar/calendar-blue.css" title="blue" />',JSDIR);
echo "\n"; echo "\n";
printf('<script type="text/javascript" language="javascript" src="%sajax_functions.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sajax_functions.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%sjscalendar/calendar.js"></script>',JSDIR); printf('<script type="text/javascript" src="%sjscalendar/calendar.js"></script>',JSDIR);
echo "\n"; echo "\n";
} }
@ -146,8 +144,8 @@ class page {
echo '<tr class="pagehead">'; echo '<tr class="pagehead">';
echo '<td colspan=3><div id="ajHEAD"><table width=100% border=0><tr>'; echo '<td colspan="3"><div id="ajHEAD"><table width="100%" border="0"><tr>';
printf('<td align="left"><a href="%s" target="_blank"><img src="%s" alt="Logo" class="logo" /></a></td>',get_href('sf'),$this->_app['logo']); printf('<td style="text-align: left;"><a href="%s" onclick="target=\'_blank\';"><img src="%s" alt="Logo" class="logo" /></a></td>',get_href('sf'),$this->_app['logo']);
echo '<td class="imagetop">'; echo '<td class="imagetop">';
$empty = true; $empty = true;
@ -175,7 +173,7 @@ class page {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs); debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
echo '<table class="control" width=100% border=0>'; echo '<table class="control" width="100%" border="0">';
echo '<tr><td>'; echo '<tr><td>';
$empty = true; $empty = true;
@ -210,7 +208,7 @@ class page {
$this->index = min(array_keys($_SESSION[APPCONFIG]->getServerList())); $this->index = min(array_keys($_SESSION[APPCONFIG]->getServerList()));
if (count($_SESSION[APPCONFIG]->getServerList()) > 1) { if (count($_SESSION[APPCONFIG]->getServerList()) > 1) {
echo '<form name="server_select" action="cmd.php" method="post">'; echo '<form id="server_select" action="cmd.php" method="post">';
echo '<table class="server_select"><tr><td>'; echo '<table class="server_select"><tr><td>';
printf('%s:<br />%s',_('Server Select'), printf('%s:<br />%s',_('Server Select'),
server_select_list($this->index,false,'index',true,sprintf("onchange=\"tree_unhide('index',%s)\"",$this->index))); server_select_list($this->index,false,'index',true,sprintf("onchange=\"tree_unhide('index',%s)\"",$this->index)));
@ -245,7 +243,7 @@ class page {
if (! isset($this->_block[$side])) if (! isset($this->_block[$side]))
return; return;
printf('<td class="%s" colspan=2>',$side); printf('<td class="%s" colspan="2">',$side);
foreach ($this->_block[$side] as $object) foreach ($this->_block[$side] as $object)
echo $object->draw($side); echo $object->draw($side);
echo '</td>'; echo '</td>';
@ -273,7 +271,7 @@ class page {
} }
if (isset($details['title'])) if (isset($details['title']))
printf('<tr><td class="icon" rowspan=2 align="right"><img src="%s" alt="%s" /></td><td class="head" align="right">%s</td></tr>', printf('<tr><td class="icon" rowspan="2"><img src="%s" alt="%s" /></td><td class="head">%s</td></tr>',
$icon,$details['type'],$details['title']); $icon,$details['type'],$details['title']);
if (isset($details['body'])) if (isset($details['body']))
@ -317,10 +315,10 @@ class page {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs); debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
printf('<tr class="foot"><td><small>%s</small></td><td colspan=2><div id="ajFOOT">%s</div>%s</td></tr>', printf('<tr class="foot"><td><small>%s</small></td><td colspan="2"><div id="ajFOOT">%s</div>%s</td></tr>',
isCompress() ? '[C]' : '&nbsp;', isCompress() ? '[C]' : '&nbsp;',
app_version(), app_version(),
get_href('logo') ? sprintf('<a href="%s"><img src="%s" border="0" alt="SourceForge.net Logo" /></a>',get_href('sf'),get_href('logo')) : '&nbsp;'); get_href('logo') ? sprintf('<a href="%s"><img src="%s" alt="SourceForge.net Logo" style="border: 0px;" /></a>',get_href('sf'),get_href('logo')) : '&nbsp;');
} }
/** /**
@ -382,14 +380,14 @@ class page {
# Page Header # Page Header
echo '<body>'; echo '<body>';
echo "\n"; echo "\n";
echo '<table class="page" border=0 width=100%>'; echo '<table class="page" border="0" width="100%">';
if ($display['HEAD']) if ($display['HEAD'])
$this->head_print(); $this->head_print();
# Control Line # Control Line
if ($display['CONTROL']) { if ($display['CONTROL']) {
echo '<tr class="control"><td colspan=3>'; echo '<tr class="control"><td colspan="3">';
echo '<div id="ajCONTROL">'; echo '<div id="ajCONTROL">';
$this->control_print(); $this->control_print();
echo '</div></td></tr>'; echo '</div></td></tr>';
@ -400,15 +398,15 @@ class page {
echo '<tr>'; echo '<tr>';
if ($display['TREE']) { if ($display['TREE']) {
echo '<td class="tree" colspan=2>'; echo '<td class="tree" colspan="2">';
printf('<acronym title="%s"><img src="%s/plus.png" align="right" onClick="if (document.getElementById(\'ajTREE\').style.display == \'none\') { document.getElementById(\'ajTREE\').style.display = \'block\' } else { document.getElementById(\'ajTREE\').style.display = \'none\' };"/></acronym>',_('Hide/Unhide the tree'),IMGDIR); printf('<acronym title="%s"><img src="%s/plus.png" alt="" style="float: right;" onclick="if (document.getElementById(\'ajTREE\').style.display == \'none\') { document.getElementById(\'ajTREE\').style.display = \'block\' } else { document.getElementById(\'ajTREE\').style.display = \'none\' };"/></acronym>',_('Hide/Unhide the tree'),IMGDIR);
echo '<div id="ajTREE">'; echo '<div id="ajTREE">';
$this->tree(); $this->tree();
echo '</div>'; echo '</div>';
echo '</td>'; echo '</td>';
} }
echo '<td class="body" width=80%>'; echo '<td class="body" style="width: 80%;">';
echo '<div id="ajBODY">'; echo '<div id="ajBODY">';
echo "\n"; echo "\n";
$this->body(); $this->body();