RELEASE 1.1.0.6

This commit is contained in:
Deon George
2009-06-30 21:52:55 +10:00
parent d5f4f91f1b
commit 647f86562f
118 changed files with 32686 additions and 19807 deletions

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr.php,v 1.20.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr.php,v 1.20.2.2 2008/12/12 12:20:22 wurley Exp $
/**
* Adds an attribute/value pair to an object
@@ -19,11 +19,12 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute')),'error','index.php');
$entry = array();
$entry['val'] = get_request('val','POST');
$entry['binary'] = get_request('binary','POST');
@@ -34,7 +35,7 @@ $entry['attr']['string'] = get_request('attr','POST');
$entry['attr']['encode'] = rawurlencode($entry['attr']['string']);
if ((strlen($entry['binary']) <= 0) && (strlen($entry['val']) <= 0))
pla_error(_('You left the attribute value blank. Please go back and try again.'));
error(_('You left the attribute value blank. Please go back and try again.'),'error','index.php');
/*
* Special case for binary attributes (like jpegPhoto and userCertificate):
@@ -48,44 +49,44 @@ if ($badattr = $ldapserver->checkUniqueAttr($entry['dn']['string'],$entry['attr'
$href = htmlspecialchars(sprintf('cmd.php?cmd=search&search=true&form=advanced&server_id=%s&filter=%s=%s',
$ldapserver->server_id,$entry['attr']['string'],$badattr));
pla_error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'),$entry['attr']['string'],$badattr,$entry['dn']['string'],$href));
error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'),$entry['attr']['string'],$badattr,$entry['dn']['string'],$href),'error','index.php');
}
if (strlen($entry['binary']) > 0) {
if ($_FILES['val']['size'] == 0)
pla_error(_('The file you chose is either empty or does not exist. Please go back and try again.'));
error(_('The file you chose is either empty or does not exist. Please go back and try again.'),'error','index.php');
if (! is_uploaded_file($_FILES['val']['tmp_name'])) {
if (isset($_FILES['val']['error']))
switch($_FILES['val']['error']) {
case 0: # No error; possible file attack!
pla_error(_('Security error: The file being uploaded may be malicious.'));
error(_('Security error: The file being uploaded may be malicious.'),'error','index.php');
break;
case 1: # Uploaded file exceeds the upload_max_filesize directive in php.ini
pla_error(_('The file you uploaded is too large. Please check php.ini, upload_max_size setting'));
error(_('The file you uploaded is too large. Please check php.ini, upload_max_size setting'),'error','index.php');
break;
case 2: # Uploaded file exceeds the MAX_FILE_SIZE directive specified in the html form
pla_error(_('The file you uploaded is too large. Please check php.ini, upload_max_size setting'));
error(_('The file you uploaded is too large. Please check php.ini, upload_max_size setting'),'error','index.php');
break;
case 3: # Uploaded file was only partially uploaded
pla_error(_('The file you selected was only partially uploaded, likley due to a network error.'));
error(_('The file you selected was only partially uploaded, likley due to a network error.'),'error','index.php');
break;
case 4: # No file was uploaded
pla_error(_('You left the attribute value blank. Please go back and try again.'));
error(_('You left the attribute value blank. Please go back and try again.'),'error','index.php');
break;
default: # A default error, just in case! :)
pla_error(_('Security error: The file being uploaded may be malicious.'));
error(_('Security error: The file being uploaded may be malicious.'),'error','index.php');
break;
}
else
pla_error(_('Security error: The file being uploaded may be malicious.'));
error(_('Security error: The file being uploaded may be malicious.'),'error','index.php');
}
$binaryfile['name'] = $_FILES['val']['tmp_name'];
@@ -125,7 +126,10 @@ if ($result) {
die();
} else {
pla_error(_('Failed to add the attribute.'),$ldapserver->error(),$ldapserver->errno());
system_message(array(
'title'=>_('Failed to add the attribute.'),
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
'type'=>'error'));
}
/**

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr_form.php,v 1.16.2.2 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr_form.php,v 1.16.2.4 2008/12/12 12:20:22 wurley Exp $
/**
* Displays a form for adding an attribute/value to an LDAP entry.
@@ -15,8 +15,9 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
$entry = array();
$entry['dn']['string'] = get_request('dn','GET');
$entry['rdn'] = get_rdn($entry['dn']['string']);
@@ -24,6 +25,7 @@ printf('<h3 class="title">%s <b>%s</b></h3>',_('Add new attribute'),htmlspecialc
printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',
_('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars($entry['dn']['string']));
$dn = array();
$dn['attrs'] = $ldapserver->getDNAttrs($entry['dn']['string']);
$dn['oclasses'] = $ldapserver->getDNAttr($entry['dn']['string'],'objectClass');

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass.php,v 1.19 2007/12/15 07:50:30 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass.php,v 1.19.2.1 2008/12/12 12:20:22 wurley Exp $
/**
* Adds an objectClass to the specified dn.
@@ -20,11 +20,12 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
if ($ldapserver->isAttrReadOnly('objectClass'))
pla_error(_('ObjectClasses are flagged as read only in the phpLDAPadmin configuration.'));
error(_('ObjectClasses are flagged as read only in the phpLDAPadmin configuration.'),'error','index.php');
$entry = array();
$entry['dn']['encode'] = get_request('dn');
$entry['dn']['string'] = urldecode($entry['dn']['encode']);
@@ -42,7 +43,7 @@ if (is_array($entry['new']['attrs']) && count($entry['new']['attrs']) > 0)
$href['search'] = htmlspecialchars(sprintf('cmd.php?cmd=search&search=true&form=advanced&server_id=%s&filter=%s=%s',
$ldapserver->server_id,$attr,$badattr));
pla_error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'),$attr,$badattr,$entry['dn']['string'],$href['search']));
error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'),$attr,$badattr,$entry['dn']['string'],$href['search']),'error','index.php');
}
$new_entry[$attr] = $val;
@@ -51,7 +52,10 @@ if (is_array($entry['new']['attrs']) && count($entry['new']['attrs']) > 0)
$result = $ldapserver->attrModify($entry['dn']['string'],$new_entry);
if (! $result)
pla_error(_('Could not perform ldap_mod_add operation.'),$ldapserver->error(),$ldapserver->errno());
system_message(array(
'title'=>_('Could not perform ldap_mod_add operation.'),
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
'type'=>'error'));
else {
$modified_attrs = array_keys($entry['new']['attrs']);

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass_form.php,v 1.25.2.1 2008/01/13 05:37:00 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass_form.php,v 1.25.2.2 2008/12/12 12:20:22 wurley Exp $
/**
* This page may simply add the objectClass and take you back to the edit page,
@@ -20,14 +20,15 @@
*/
require './common.php';
$entry = array();
$entry['oclass']['new'] = get_request('new_oclass','REQUEST');
$entry['dn']['string'] = get_request('dn','REQUEST');
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
if (! $entry['oclass']['new'])
pla_error(_('You did not select any ObjectClasses for this object. Please go back and do so.'));
error(_('You did not select any ObjectClasses for this object. Please go back and do so.'),'error','index.php');
/* Ensure that the object has defined all MUST attrs for this objectClass.
* If it hasn't, present a form to have the user enter values for all the
@@ -108,7 +109,10 @@ if (count($ldap['attrs']['need']) > 0) {
$result = $ldapserver->attrModify($entry['dn']['string'],array('objectClass'=>$entry['oclass']['new']));
if (! $result)
pla_error('Could not perform ldap_mod_add operation.',$ldapserver->error(),$ldapserver->errno());
system_message(array(
'title'=>_('Could not perform ldap_mod_add operation.'),
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
'type'=>'error'));
else {
$href = sprintf('cmd.php?cmd=template_engine&server_id=%s&dn=%s&modified_attrs[]=objectClass',

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value.php,v 1.21.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value.php,v 1.21.2.2 2008/12/12 12:20:22 wurley Exp $
/**
* Adds a value to an attribute for a given dn.
@@ -18,12 +18,13 @@
*/
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add_value'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute value')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute value')),'error','index.php');
# The DN and ATTR we are working with.
$entry = array();
$entry['dn']['encode'] = get_request('dn','POST',true);
$entry['dn']['string'] = rawurldecode($entry['dn']['encode']);
$entry['attr']['encode'] = get_request('attr','POST',true);
@@ -34,7 +35,7 @@ $entry['value']['string'] = get_request('new_value','POST',true);
$entry['value']['bin'] = get_request('binary','POST') ? true : false;
if ($ldapserver->isAttrReadOnly($entry['attr']['string']))
pla_error(sprintf(_('The attribute "%s" is flagged as read-only in the phpLDAPadmin configuration.'),$entry['attr']['html']));
error(sprintf(_('The attribute "%s" is flagged as read-only in the phpLDAPadmin configuration.'),$entry['attr']['html']),'error','index.php');
/*
* Special case for binary attributes:
@@ -56,7 +57,7 @@ if ($badattr = $ldapserver->checkUniqueAttr($entry['dn']['string'],$entry['attr'
$href = htmlspecialchars(sprintf('cmd.php?cmd=search&search=true&form=advanced&server_id=%s&filter=%s=%s',
$ldapserver->server_id,$entry['attr']['string'],$badattr));
pla_error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'),$entry['attr']['string'],$badattr,$entry['dn']['string'],$href));
error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'),$entry['attr']['string'],$badattr,$entry['dn']['string'],$href),'error','index.php');
}
# Call the custom callback for each attribute modification and verify that it should be modified.
@@ -69,8 +70,11 @@ if (run_hook('pre_attr_add',
$add_result = $ldapserver->attrModify($entry['dn']['string'],$new_entry);
if (! $add_result) {
pla_error(_('Could not perform ldap_mod_add operation.'),
$ldapserver->error(),$ldapserver->errno());
system_message(array(
'title'=>_('Could not perform ldap_mod_add operation.'),
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
'type'=>'error'));
} else {
run_hook('post_attr_modify',
array('server_id'=>$ldapserver->server_id,'dn'=>$entry['dn']['string'],'attr_name'=>$entry['attr']['string'],'new_value'=>$new_entry));

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value_form.php,v 1.39.2.3 2008/01/13 05:43:13 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value_form.php,v 1.39.2.6 2008/12/12 12:20:22 wurley Exp $
/**
* Displays a form to allow the user to enter a new value to add
@@ -13,9 +13,10 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
# The DN and ATTR we are working with.
$entry = array();
$entry['dn']['encode'] = get_request('dn','GET',true);
$entry['dn']['string'] = urldecode($entry['dn']['encode']);
$entry['dn']['html'] = htmlspecialchars($entry['dn']['string']);
@@ -34,7 +35,7 @@ $entry['rdn']['html'] = htmlspecialchars($entry['rdn']['string']);
/***************/
if (! $entry['dn']['string'] || ! $ldapserver->dnExists($entry['dn']['string']))
pla_error(sprintf(_('The entry (%s) does not exist.'),$entry['dn']['html']),null,-1,true);
error(sprintf(_('The entry (%s) does not exist.'),$entry['dn']['html']),'error','index.php');
$tree = get_cached_item($ldapserver->server_id,'tree');
$entry['ldap'] = null;
@@ -52,7 +53,7 @@ eval('$reader = new '.$_SESSION[APPCONFIG]->GetValue('appearance','entry_reader'
$reader->visit('Start', $entry['ldap']);
if (! $entry['ldap'] || $entry['ldap']->isReadOnly())
pla_error(sprintf(_('The entry (%s) is in readonly mode.'),$entry['dn']['html']),null,-1,true);
error(sprintf(_('The entry (%s) is in readonly mode.'),$entry['dn']['html']),'error','index.php');
/*********************/
/* attribute values */
@@ -71,11 +72,13 @@ if (!$ldap['attr']) {
$ldap['count'] = $ldap['attr']->getValueCount();
if ($ldap['attr']->isReadOnly())
pla_error(sprintf(_('The attribute (%s) is in readonly mode.'),$entry['attr']['html']),null,-1,true);
error(sprintf(_('The attribute (%s) is in readonly mode.'),$entry['attr']['html']),'error','index.php');
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add_value'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute value')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute value')),'error','index.php');
if (($ldap['attr']->getValueCount() == 0) && ! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute')),'error','index.php');
$entry['attr']['oclass'] = (strcasecmp($entry['attr']['string'],'objectClass') == 0) ? true : false;
@@ -156,8 +159,8 @@ if ($entry['attr']['oclass']) {
echo '</tr>';
if ($_SESSION[APPCONFIG]->GetValue('appearance','show_hints'))
printf('<tr><td colspan=2><small><br /><img src="images/light.png" alt="Hint" /><span class="hint">%s</span></small></td></tr>',
_('Note: You may be required to enter new attributes that these objectClass(es) require'));
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'));
echo '</table>';
echo '</center>';
echo '</form>';
@@ -165,7 +168,7 @@ if ($entry['attr']['oclass']) {
} else {
# Draw a blank field
echo '<table border=0><tr><td>';
$writer->draw('BlankValue', $ldap['attr'], $ldap['count']);
$writer->draw('BlankValue',$ldap['attr'],$ldap['count'],$reader);
echo '</td></tr><tr><td>';
if ($ldap['schema']->getDescription())

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare.php,v 1.16.2.3 2008/01/13 06:33:50 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare.php,v 1.16.2.7 2008/12/12 12:20:22 wurley Exp $
/**
* Compare two DNs - the destination DN is editable.
@@ -8,27 +8,28 @@
require_once './common.php';
$dn_src = isset($_POST['dn_src']) ? $_POST['dn_src'] : null;
$dn_dst = isset($_POST['dn_dst']) ? $_POST['dn_dst'] : null;
$dn_src = get_request('dn_src');
$dn_dst = get_request('dn_dst');
$encoded_dn_src = rawurlencode($dn_src);
$encoded_dn_dst = rawurlencode($dn_dst);
$server_id_src = (isset($_POST['server_id_src']) ? $_POST['server_id_src'] : '');
$server_id_dst = (isset($_POST['server_id_dst']) ? $_POST['server_id_dst'] : '');
$server_id_src = get_request('server_id_src');
$server_id_dst = get_request('server_id_dst');
$ldapserver_src = $_SESSION[APPCONFIG]->ldapservers->Instance($server_id_src);
if (! $ldapserver_src->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
error(_('Not enough information to login to server. Please check your configuration.'),'error','index.php');
$ldapserver_dst = $_SESSION[APPCONFIG]->ldapservers->Instance($server_id_dst);
if (! $ldapserver_src->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
error(_('Not enough information to login to server. Please check your configuration.'),'error','index.php');
if (! $ldapserver_src->dnExists($dn_src))
pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($dn_src)));
error(sprintf('%s (%s)',_('No such entry.'),pretty_print_dn($dn_src)),'error','index.php');
if (! $ldapserver_dst->dnExists($dn_dst))
pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($dn_dst)));
error(sprintf('%s (%s)',_('No such entry.'),pretty_print_dn($dn_dst)),'error','index.php');
$attrs_src = $ldapserver_src->getDNAttrs($dn_src,false,$_SESSION[APPCONFIG]->GetValue('deref','view'));
$attrs_dst = $ldapserver_dst->getDNAttrs($dn_dst,false,$_SESSION[APPCONFIG]->GetValue('deref','view'));
@@ -253,12 +254,12 @@ foreach ($attrs_all as $attr) {
if (count($vals) > 1)
for ($i=1; $i<=count($vals); $i++)
printf('<a href="%s&amp;value_num=%s"><img src="images/save.png" /> %s(%s)</a><br />',$href,$i,_('download value'),$i);
printf('<a href="%s&amp;value_num=%s"><img src="%s/save.png" /> %s(%s)</a><br />',$href,$i,_('download value'),IMGDIR,$i);
else
printf('<a href="%s"><img src="images/save.png" /> %s</a><br />',$href,_('download value'));
printf('<a href="%s"><img src="%s/save.png" /> %s</a><br />',$href,IMGDIR,_('download value'));
if ($side == 'dst' && ! $ldapserver_dst->isReadOnly() && ! $ldapserver->isAttrReadOnly($attr))
printf('<a href="javascript:deleteAttribute(\'%s\');" style="color:red;"><img src="images/trash.png" /> %s</a>',$attr,_('delete attribute'));
printf('<a href="javascript:deleteAttribute(\'%s\');" style="color:red;"><img src="%s/trash.png" /> %s</a>',$attr,IMGDIR,_('delete attribute'));
echo '</small>';
echo '</td>';
@@ -322,8 +323,7 @@ foreach ($attrs_all as $attr) {
if ($side == 'dst') {
printf('<input style="width: 260px" type="password" name="new_values[userpassword]" value="%s" />',htmlspecialchars($user_password));
echo enc_type_select_list($enc_type);
echo enc_type_select_list($enc_type,'enc','userpassword',0);
}
echo '<br />';
@@ -383,8 +383,8 @@ foreach ($attrs_all as $attr) {
# Is this value is a structural objectClass, make it read-only
if (0 == strcasecmp($attr,'objectClass')) {
printf('<a title="%s" href="cmd.php?cmd=schema&amp;server_id=%s&amp;view=objectClasses&amp;viewvalue=%s"><img src="images/info.png" /></a>',
_('View the schema description for this objectClass'),$ldapserver->server_id,htmlspecialchars($val));
printf('<a title="%s" href="cmd.php?cmd=schema&amp;server_id=%s&amp;view=objectClasses&amp;viewvalue=%s"><img src="%s/info.png" /></a>',
_('View the schema description for this objectClass'),$ldapserver->server_id,htmlspecialchars($val),IMGDIR);
$schema_object = $ldapserver->getSchemaObjectClass($val);
@@ -400,14 +400,14 @@ foreach ($attrs_all as $attr) {
}
if (is_dn_string($val) || $ldapserver->isDNAttr($attr))
printf('<a title="%s" href="cmd.php?cmd=template_engine&amp;server_id=%s&amp;dn=%s"><img style="vertical-align: top" src="images/go.png" /></a>',
sprintf(_('Go to %s'),htmlspecialchars($val)),$ldapserver->server_id,rawurlencode($val));
printf('<a title="%s" href="cmd.php?cmd=template_engine&amp;server_id=%s&amp;dn=%s"><img style="vertical-align: top" src="%s/go.png" /></a>',
sprintf(_('Go to %s'),htmlspecialchars($val)),$ldapserver->server_id,rawurlencode($val),IMGDIR);
elseif (is_mail_string($val))
printf('<a href="mailto:%s><img style="vertical-align: center" src="images/mail.png" /></a>',htmlspecialchars($val));
printf('<a href="mailto:%s><img style="vertical-align: center" src="%s/mail.png" /></a>',htmlspecialchars($val),IMGDIR);
elseif (is_url_string($val))
printf('<a href="%s" target="new"><img style="vertical-align: center" src="images/dc.png" /></a>',htmlspecialchars($val));
printf('<a href="%s" target="new"><img style="vertical-align: center" src="%s/dc.png" /></a>',htmlspecialchars($val),IMGDIR);
if ($ldapserver->isMultiLineAttr($attr,$val)) {
if ($side == 'dst')

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare_form.php,v 1.5 2007/12/15 07:50:30 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare_form.php,v 1.5.2.1 2008/12/12 07:29:55 wurley Exp $
/**
* Compares to DN entries side by side.
@@ -14,7 +14,7 @@
require_once './common.php';
$dn = (isset($_GET['dn']) ? $_GET['dn'] : '');
$dn = get_request('dn','GET');
$rdn = get_rdn($dn);
$select_server_html = server_select_list($ldapserver->server_id,true,'server_id_dst');

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy.php,v 1.44.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy.php,v 1.44.2.3 2008/12/12 12:20:22 wurley Exp $
/**
* Copies a given object to create a new one.
@@ -17,8 +17,9 @@
require './common.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_move'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('copy entry')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('copy entry')),'error','index.php');
$entry = array();
$entry['src']['id'] = get_request('server_id');
$entry['dst']['id'] = get_request('dest_server_id');
@@ -26,10 +27,10 @@ $entry['src']['ldapserver'] = $_SESSION[APPCONFIG]->ldapservers->Instance($entry
$entry['dst']['ldapserver'] = $_SESSION[APPCONFIG]->ldapservers->Instance($entry['dst']['id']);
if ($entry['dst']['ldapserver']->isReadOnly())
pla_error(_('Destination server is currently READ-ONLY.'));
error(_('Destination server is currently READ-ONLY.'),'error','index.php');
if (! $entry['src']['ldapserver']->haveAuthInfo() || ! $entry['dst']['ldapserver']->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
error(_('Not enough information to login to server. Please check your configuration.'),'error','index.php');
$entry['src']['dn'] = get_request('old_dn');
$entry['dst']['dn'] = get_request('new_dn');
@@ -38,19 +39,19 @@ $entry['src']['remove'] = (get_request('remove') == 'yes') ? true : false;
# Error checking
if (strlen(trim($entry['dst']['dn'])) == 0)
pla_error(_('You left the destination DN blank.'));
error(_('You left the destination DN blank.'),'error','index.php');
if (pla_compare_dns($entry['src']['dn'],$entry['dst']['dn']) == 0 && $entry['src']['id'] == $entry['dst']['id'])
pla_error(_('The source and destination DN are the same.'));
error(_('The source and destination DN are the same.'),'error','index.php');
if ($entry['dst']['ldapserver']->dnExists($entry['dst']['dn']))
pla_error(sprintf(_('The destination entry (%s) already exists.'),pretty_print_dn($entry['dst']['dn'])));
error(sprintf(_('The destination entry (%s) already exists.'),pretty_print_dn($entry['dst']['dn'])),'error','index.php');
if (! $entry['dst']['ldapserver']->dnExists(get_container($entry['dst']['dn'])))
pla_error(sprintf(_('The destination container (%s) does not exist.'),pretty_print_dn(get_container($entry['dst']['dn']))));
error(sprintf(_('The destination container (%s) does not exist.'),pretty_print_dn(get_container($entry['dst']['dn']))),'error','index.php');
if ($entry['src']['recursive']) {
$filter = isset($_POST['filter']) ? $_POST['filter'] : '(objectClass=*)';
$filter = get_request('filter','POST',false,'(objectClass=*)');
# Build a tree similar to that of the tree browser to give to r_copy_dn
$snapshot_tree = array();
@@ -141,7 +142,11 @@ function copy_dn($ldapserver_src,$ldapserver_dst,$dn_src,$dn_dst) {
$add_result = $ldapserver_dst->add($dn_dst,$new_entry);
if (! $add_result) {
echo '</small><br /><br />';
pla_error(_('Failed to copy DN: ').$dn_dst,$ldapserver_dst->error(),$ldapserver_dst->errno());
system_message(array(
'title'=>_('Failed to copy DN.').sprintf(' (%s)',$dn_dst),
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
'type'=>'error'));
} else {
run_hook('post_entry_create',
array('server_id'=>$ldapserver_dst->server_id,'dn'=>$dn_dst,'attrs'=>$new_entry));

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy_form.php,v 1.30.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy_form.php,v 1.30.2.3 2008/12/12 12:20:22 wurley Exp $
/**
* Copies a given object to create a new one.
@@ -15,8 +15,9 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
$entry = array();
$entry['dn'] = get_request('dn','GET');
$entry['rdn'] = get_rdn($entry['dn']);
@@ -99,7 +100,7 @@ echo '</table></form>';
echo "\n";
if ($_SESSION[APPCONFIG]->GetValue('appearance','show_hints'))
printf('<small><img src="images/light.png" alt="Light" /><span class="hint">%s</span></small>',_('Hint: Copying between different servers only works if there are no schema violations'));
printf('<small><img src="%s/light.png" alt="Light" /><span class="hint">%s</span></small>',IMGDIR,_('Hint: Copying between different servers only works if there are no schema violations'));
echo '</center>';
?>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/create.php,v 1.48.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/create.php,v 1.48.2.4 2008/12/12 12:20:22 wurley Exp $
/**
* Creates a new object.
@@ -19,12 +19,12 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'), null, -1, true);
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_create'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('create entry')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('create entry')),'error','index.php');
$rdn_attr = isset($_POST['rdn_attribute']) ? $_POST['rdn_attribute'] : null;
$rdn_attr = get_request('rdn_attribute');
$entryfactoryclass = $_SESSION[APPCONFIG]->GetValue('appearance','entry_factory');
eval('$entry_factory = new '.$entryfactoryclass.'();');
@@ -36,7 +36,7 @@ $entry->accept($reader);
$container = $entry->getContainer();
if (!$container || !$ldapserver->dnExists($container))
pla_error(sprintf(_('The container you specified (%s) does not exist. Please try again.'),htmlspecialchars($container)),null,-1,true);
error(sprintf(_('The container you specified (%s) does not exist. Please try again.'),htmlspecialchars($container)),'error','index.php');
$tree = get_cached_item($ldapserver->server_id,'tree');
if ($tree) {
@@ -46,18 +46,18 @@ if ($tree) {
$container_entry = $tree->getEntry($container);
if ($container_entry->isLeaf())
pla_error(sprintf(_('The container (%s) is a leaf.'), htmlspecialchars($container)), null, -1, true);
error(sprintf(_('The container (%s) is a leaf.'), htmlspecialchars($container)),'error','index.php');
}
$entry->setRdnAttributeName($rdn_attr);
if (!$entry->getRdnAttribute())
pla_error(sprintf(_('The Rdn attribute (%s) does not exist.'), htmlspecialchars($rdn_attr)), null, -1, true);
error(sprintf(_('The Rdn attribute (%s) does not exist.'), htmlspecialchars($rdn_attr)),'error','index.php');
$new_dn = $entry->getDn();
if (! $new_dn)
pla_error(_('You left the RDN field blank.'));
error(_('You left the RDN field blank.'),'error','index.php');
$redirect = isset($_POST['redirect']) ? $_POST['redirect'] : false;
$redirect = get_request('redirect','POST',false,false);
$new_entry = array();
$attrs = $entry->getAttributes();
@@ -69,8 +69,9 @@ foreach ($attrs as $attr) {
$new_vals[] = $val;
}
if ($attr->isRequired() && !$new_vals)
pla_error(sprintf(_('You left the value blank for required attribute (%s).'), htmlspecialchars($attr->getName())));
if ($attr->isRequired() && !$new_vals && !$ldapserver->isIgnoredAttr($attr->getName()))
error(sprintf(_('You left the value blank for required attribute (%s).'),htmlspecialchars($attr->getName())),'error','index.php');
if ($new_vals)
$new_entry[$attr->getName()] = $new_vals;
@@ -83,7 +84,7 @@ foreach ($new_entry as $attr => $vals) {
# Check to see if this is a unique Attribute
if ($badattr = $ldapserver->checkUniqueAttr($new_dn,$attr,$vals)) {
$search_href = sprintf('?cmd=search&amp;search=true&amp;form=advanced&amp;server_id=%s&amp;filter=%s=%s', $ldapserver->server_id,$attr,$badattr);
pla_error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'),$attr,$badattr,$new_dn,$search_href));
error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'),$attr,$badattr,$new_dn,$search_href),'error','index.php');
}
}
@@ -129,6 +130,9 @@ if ($add_result) {
}
} else {
pla_error(_('Could not add the object to the LDAP server.'),$ldapserver->error(),$ldapserver->errno());
system_message(array(
'title'=>_('Could not add the object to the LDAP server.'),
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
'type'=>'error'));
}
?>

View File

@@ -1,4 +1,4 @@
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/css/style.css,v 1.48.2.4 2008/01/13 07:17:23 wurley Exp $ */
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/css/style.css,v 1.48.2.8 2008/12/19 00:38:31 wurley Exp $ */
/* Global Page */
table.page {
@@ -96,7 +96,7 @@ table.page table.control td.logo img.logo {
text-align: right;
width: 100px;
height: 60px;
height: 50px;
}
/* Global Page - LDAP Tree */
@@ -276,6 +276,7 @@ table.tree td.rdn a:hover {
font-size: 13px;
color: #841212;
background-color: #FFF0C0;
text-decoration: none;
}
table.tree td.rdn span.count {
@@ -300,13 +301,6 @@ table.tree td.link a:hover {
text-decoration: none;
}
table.tree td.rdn a:hover {
font-size: 13px;
color: #841212;
background-color: #FFF0C0;
text-decoration: none;
}
table.tree td.links a:hover {
text-decoration: none;
color: blue;
@@ -438,6 +432,7 @@ table.entry input {
}
table.entry input.value {
color: #000000;
font-size: 14px;
width: 350px;
background-color: #FFFFFF;
@@ -447,15 +442,16 @@ table.entry div.helper {
text-align: left;
white-space: nowrap;
background-color: #FFFFFF;
color: #888;
font-size: 14px;
font-weight: normal;
color: #888;
}
table.entry input.roval {
font-size: 14px;
width: 350px;
background-color: #FFFFFF;
color: #000000;
border: none;
}
@@ -463,12 +459,14 @@ table.entry textarea.value {
font-size: 14px;
width: 350px;
background-color: #FFFFFF;
color: #000000;
}
table.entry textarea.roval {
font-size: 14px;
width: 350px;
background-color: #FFFFFF;
color: #000000;
border: none;
}
@@ -604,41 +602,50 @@ table.entry tr.updated td.ew2_val {
#login {
background: url('../images/uid.png') no-repeat 0 1px;
background-color: #FAFAFF;
color: #000000;
padding-left: 17px;
}
#login:focus {
background-color: #F0F0FF;
color: #000000;
}
#login:disabled {
background-color: #DDDDFF;
color: #000000;
}
#password {
background: url('../images/key.png') no-repeat 0 1px;
background-color: #FAFAFF;
color: #000000;
padding-left: 17px;
}
#password:focus {
background-color: #F0F0FF;
color: #000000;
}
#password:disabled {
background-color: #DDDDFF;
color: #000000;
}
#generic {
background-color: #FAFAFF;
color: #000000;
padding-left: 17px;
}
#generic:focus {
background-color: #F0F0FF;
color: #000000;
}
#generic:disabled {
background-color: #DDDDFF;
color: #000000;
}
/* After input results */

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete.php,v 1.27.2.2 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete.php,v 1.27.2.3 2008/12/12 12:20:22 wurley Exp $
/**
* Deletes a DN and presents a "job's done" message.
@@ -15,24 +15,25 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete', 'simple_delete'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete entry')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete entry')),'error','index.php');
$entry = array();
$entry['dn'] = get_request('dn');
if (! $entry['dn'])
pla_error(_('You must specify a DN'));
error(_('You must specify a DN'),'error','index.php');
if (! $ldapserver->dnExists($entry['dn']))
pla_error(sprintf(_('No such entry: %s'),'<b>'.pretty_print_dn($entry['dn']).'</b>'));
error(sprintf('%s (%s)',_('No such entry.'),'<b>'.pretty_print_dn($entry['dn']).'</b>'),'error','index.php');
# Check the user-defined custom callback first.
if (run_hook('pre_entry_delete',array('server_id'=>$ldapserver->server_id,'dn'=>$entry['dn'])))
$result = $ldapserver->delete($entry['dn']);
else
pla_error(sprintf(_('Could not delete the entry: %s'),'<b>'.pretty_print_dn($entry['dn']).'</b>'));
error(sprintf(_('Could not delete the entry: %s'),'<b>'.pretty_print_dn($entry['dn']).'</b>'),'error','index.php');
if ($result) {
# Custom callback
@@ -46,7 +47,9 @@ if ($result) {
sprintf('index.php?server_id=%s',$ldapserver->server_id));
} else {
pla_error(sprintf(_('Could not delete the entry: %s'),'<b>'.pretty_print_dn($entry['dn']).'</b>'),
$ldapserver->error(),$ldapserver->errno());
system_message(array(
'title'=>_('Could not delete the entry.').sprintf(' (%s)',pretty_print_dn($entry['dn'])),
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
'type'=>'error'));
}
?>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_attr.php,v 1.16.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_attr.php,v 1.16.2.2 2008/12/12 12:20:22 wurley Exp $
/**
* Deletes an attribute from an entry with NO confirmation.
@@ -15,23 +15,24 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_delete'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete attribute')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete attribute')),'error','index.php');
$entry = array();
$entry['dn']['string'] = get_request('dn');
$entry['dn']['encode'] = rawurlencode($entry['dn']['string']);
$entry['attr'] = get_request('attr');
if (! $entry['dn']['string'])
pla_error(_('No DN specified'));
error(_('No DN specified'),'error','index.php');
if (! $entry['attr'])
pla_error(_('No attribute name specified.'));
error(_('No attribute name specified.'),'error','index.php');
if ($ldapserver->isAttrReadOnly($entry['attr']))
pla_error(sprintf(_('The attribute "%s" is flagged as read-only in the phpLDAPadmin configuration.'),htmlspecialchars($entry['attr'])));
error(sprintf(_('The attribute "%s" is flagged as read-only in the phpLDAPadmin configuration.'),htmlspecialchars($entry['attr'])),'error','index.php');
$update_array = array();
$update_array[$entry['attr']] = array();
@@ -47,6 +48,9 @@ if ($result) {
die();
} else {
pla_error(_('Could not perform ldap_modify operation.'),$ldapserver->error(),$ldapserver->errno());
system_message(array(
'title'=>_('Could not perform ldap_modify operation.'),
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
'type'=>'error'));
}
?>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_form.php,v 1.26.2.1 2008/01/13 05:37:00 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_form.php,v 1.26.2.2 2008/12/12 12:20:22 wurley Exp $
/**
* delete_form.php
@@ -16,8 +16,9 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
$entry = array();
$entry['dn']['string'] = get_request('dn','GET');
$entry['dn']['html'] = htmlspecialchars($entry['dn']['string']);

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/download_binary_attr.php,v 1.15.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/download_binary_attr.php,v 1.15.2.4 2008/12/12 12:20:22 wurley Exp $
/**
* @package phpLDAPadmin
@@ -12,27 +12,32 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
if (! $ldapserver->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
$dn = rawurldecode($_GET['dn']);
$attr = $_GET['attr'];
if (! $ldapserver->haveAuthInfo())
error(_('Not enough information to login to server. Please check your configuration.'),'error','index.php');
$dn = rawurldecode(get_request('dn','GET'));
$attr = get_request('attr','GET');
# if there are multiple values in this attribute, which one do you want to see?
$value_num = isset($_GET['value_num']) ? $_GET['value_num'] : null;
$value_num = get_request('value_num','GET');
if (! $ldapserver->dnExists($dn))
pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($dn)));
error(sprintf('%s (%s)',_('No such entry.'),pretty_print_dn($dn)),'error','index.php');
$search = $ldapserver->search(null,$dn,'(objectClass=*)',array($attr),'base',false,$_SESSION[APPCONFIG]->GetValue('deref','view'));
# Dump the binary data to the browser
if (ob_get_level()) ob_end_clean();
$obStatus = ob_get_status();
if (isset($obStatus['type']) && $obStatus['type'] && $obStatus['status'])
ob_end_clean();
header('Content-type: octet-stream');
header("Content-disposition: attachment; filename=$attr");
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
if ($value_num && is_array($search[$attr][$dn]))
echo $search[$dn][$attr][$value_num];
else

View File

@@ -1,41 +1,42 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/draw_tree_node.php,v 1.2.2.1 2007/12/21 12:11:55 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/draw_tree_node.php,v 1.2.2.2 2008/12/12 12:20:22 wurley Exp $
/**
* @package phpLDAPadmin
*/
$entry['dn'] = get_request('dn','REQUEST');
$entry['server_id'] = get_request('server_id','REQUEST');
$entry['code'] = get_request('code','REQUEST');
$entry['action'] = get_request('action','REQUEST');
$entry = array();
$entry['dn'] = get_request('dn','REQUEST');
$entry['server_id'] = get_request('server_id','REQUEST');
$entry['code'] = get_request('code','REQUEST');
$entry['action'] = get_request('action','REQUEST');
$tree = Tree::getInstance($entry['server_id']);
if (! $tree)
die();
$dnentry = $tree->getEntry($entry['dn']);
if (! $dnentry) {
$tree->addEntry($entry['dn']);
$dnentry = $this->getEntry($entry['dn']);
}
if (! $dnentry)
die();
if ($entry['action'] == 0) {
$dnentry->close();
} elseif ($entry['action'] == 2) {
$dnentry->open();
} else {
$dnentry->open();
if ($entry['dn']) {
echo $tree->draw_children($dnentry,$entry['code']);
} else {
$tree->draw(true);
}
}
$tree = Tree::getInstance($entry['server_id']);
if (! $tree)
die();
$dnentry = $tree->getEntry($entry['dn']);
if (! $dnentry) {
$tree->addEntry($entry['dn']);
$dnentry = $this->getEntry($entry['dn']);
}
if (! $dnentry)
die();
if ($entry['action'] == 0) {
$dnentry->close();
} elseif ($entry['action'] == 2) {
$dnentry->open();
} else {
$dnentry->open();
if ($entry['dn']) {
echo $tree->draw_children($dnentry,$entry['code']);
} else {
$tree->draw(true);
}
}
die();
?>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/entry_chooser.php,v 1.31.2.3 2008/01/13 05:37:00 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/entry_chooser.php,v 1.31.2.5 2008/12/12 12:20:22 wurley Exp $
/**
* Display a selection (popup window) to pick a DN.
@@ -10,6 +10,7 @@
include './common.php';
include HTDOCDIR.'header.php';
$entry = array();
$entry['container'] = get_request('container','GET');
$entry['element'] = get_request('form_element','GET');
$entry['rdn'] = get_request('rdn','GET');
@@ -38,7 +39,7 @@ if ($entry['container']) {
if (isset($ldapserver) && ! is_null($entry['container'])) {
if (! $ldapserver->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
error(_('Not enough information to login to server. Please check your configuration.'),'error','index.php');
$entry['children'] = $ldapserver->getContainerContents($entry['container'],0,'(objectClass=*)',$_SESSION[APPCONFIG]->GetValue('deref','tree'));
sort($entry['children']);
@@ -61,7 +62,7 @@ if (isset($ldapserver) && ! is_null($entry['container'])) {
echo '<tr>';
echo '<td class="blank">&nbsp;</td>';
printf('<td class="icon"><a href="%s"><img src="images/up.png" alt="Up" /></a></td>',$href['up']);
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...'));
echo '</tr>';
@@ -76,7 +77,7 @@ if (isset($ldapserver) && ! is_null($entry['container'])) {
echo '<tr>';
echo '<td class="blank">&nbsp;</td>';
printf('<td class="icon"><a href="%s"><img src="images/plus.png" alt="Plus" /></a></td>',$href['expand']);
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'],htmlspecialchars($dn));
echo '</tr>';
@@ -107,7 +108,7 @@ if (isset($ldapserver) && ! is_null($entry['container'])) {
echo '<tr>';
echo '<td class="blank">&nbsp;</td>';
printf('<td colspan=2 class="icon"><a href="%s"><img src="images/plus.png" alt="Plus" /></a></td>',$href['expand']);
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'],htmlspecialchars($dn));
}
}

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export.php,v 1.18.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export.php,v 1.18.2.4 2008/12/12 12:20:22 wurley Exp $
/**
* @package phpLDAPadmin
@@ -15,8 +15,9 @@ ini_set('session.cache_limiter','');
require LIBDIR.'export_functions.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('export'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('export')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('export')),'error','index.php');
$entry = array();
$entry['base_dn'] = get_request('dn');
$entry['format'] = get_request('format','POST',false,'unix');
$entry['scope'] = get_request('scope','POST',false,'base');
@@ -40,8 +41,8 @@ if ($entry['sys_attr']) {
array_push($attributes,'+');
}
(! is_null($entry['exporter_id'])) or pla_error(_('You must choose an export format.'));
isset($exporters[$entry['exporter_id']]) or pla_error(_('Invalid export format'));
(! is_null($entry['exporter_id'])) or error(_('You must choose an export format.'),'error','index.php');
isset($exporters[$entry['exporter_id']]) or error(_('Invalid export format'),'error','index.php');
# Initialisation of other variables
$friendly_rdn = get_rdn($entry['base_dn'],1);
@@ -85,13 +86,13 @@ switch ($entry['exporter_id']) {
default:
# truly speaking,this default case will never be reached. See check at the bottom.
pla_error(_('No available exporter found.'));
error(_('No available exporter found.'),'error','index.php');
}
# set the CLRN
$exporter->setOutputFormat($br);
if (isset($_REQUEST['compress']) && $_REQUEST['compress'] = 'on')
if (get_request('compress','REQUEST') == 'on')
$exporter->compress(true);
# prevent script from bailing early for long search
@@ -99,7 +100,10 @@ if (isset($_REQUEST['compress']) && $_REQUEST['compress'] = 'on')
# send the header
if ($entry['file']) {
if (ob_get_level()) ob_end_clean();
$obStatus = ob_get_status();
if (isset($obStatus['type']) && $obStatus['type'] && $obStatus['status'])
ob_end_clean();
header('Content-type: application/download');
header(sprintf('Content-Disposition: filename="%s.%s"',$friendly_rdn,$exporters[$entry['exporter_id']]['extension'].($exporter->isCompressed()?'.gz':'')));
$exporter->export();

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export_form.php,v 1.26.2.1 2008/01/13 05:37:01 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export_form.php,v 1.26.2.2 2008/12/12 12:20:22 wurley Exp $
/**
* export_form.php
@@ -13,6 +13,7 @@ require './common.php';
require LIBDIR.'export_functions.php';
$entry = array();
$entry['format'] = get_request('format','GET',false,get_line_end_format());
$entry['scope'] = get_request('scope','GET',false,'base');
$entry['id'] = get_request('exporter_id','GET',false,0);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 B

After

Width:  |  Height:  |  Size: 662 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 648 B

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 902 B

After

Width:  |  Height:  |  Size: 902 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

BIN
htdocs/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 B

After

Width:  |  Height:  |  Size: 661 B

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/index.php,v 1.49.2.5 2008/01/12 10:01:28 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/index.php,v 1.49.2.10 2008/12/12 12:20:22 wurley Exp $
/**
* @package phpLDAPadmin
@@ -40,6 +40,10 @@ if (! is_readable(LIBDIR.'functions.php')) {
if (ob_get_level())
ob_end_clean();
# Make sure this PHP install has pcre
if (! extension_loaded('pcre'))
die('<p>Your install of PHP appears to be missing PCRE support.</p><p>Please install PCRE support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small></p>');
require LIBDIR.'functions.php';
# Define the path to our configuration file.
@@ -48,9 +52,30 @@ if (defined('CONFDIR'))
else
$app['config_file'] = 'config.php';
# Make sure this PHP install has session support
if (! extension_loaded('session'))
error('<p>Your install of PHP appears to be missing php-session support.</p><p>Please install php-session support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small></p>','error',null,true);
# Make sure this PHP install has gettext, we use it for language translation
if (! extension_loaded('gettext'))
error('<p>Your install of PHP appears to be missing GETTEXT support.</p><p>GETTEXT is used for language translation.</p><p>Please install GETTEXT support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small></p>','error',true);
system_message(array(
'title'=>_('Missing required extension'),
'body'=>'Your install of PHP appears to be missing GETTEXT support.</p><p>GETTEXT is used for language translation.</p><p>Please install GETTEXT support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>',
'type'=>'error'));
# Make sure this PHP install has all our required extensions
if (! extension_loaded('ldap'))
system_message(array(
'title'=>_('Missing required extension'),
'body'=>'Your install of PHP appears to be missing LDAP support.<br /><br />Please install LDAP support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>',
'type'=>'error'));
# Make sure that we have php-xml loaded.
if (! function_exists('xml_parser_create'))
system_message(array(
'title'=>_('Missing required extension'),
'body'=>'Your install of PHP appears to be missing XML support.<br /><br />Please install XML support before using phpLDAPadmin.<br /><small>(Dont forget to restart your web server afterwards)</small>',
'type'=>'error'));
/**
* Helper functions.
@@ -59,10 +84,10 @@ if (! extension_loaded('gettext'))
if (isset($app['function_files']) && is_array($app['function_files']))
foreach ($app['function_files'] as $file_name ) {
if (! file_exists($file_name))
error(sprintf('Fatal error: Required file "%s" does not exist.',$file_name),'error',true);
error(sprintf('Fatal error: Required file "%s" does not exist.',$file_name),'error',null,true);
if (! is_readable($file_name))
error(sprintf('Fatal error: Cannot read the file "%s", its permissions may be too strict.',$file_name),'error',true);
error(sprintf('Fatal error: Cannot read the file "%s", its permissions may be too strict.',$file_name),'error',null,true);
ob_start();
require $file_name;
@@ -71,10 +96,10 @@ if (isset($app['function_files']) && is_array($app['function_files']))
# Configuration File check
if (! file_exists($app['config_file'])) {
error(sprintf(_('You need to configure %s. Edit the file "%s" to do so. An example config file is provided in "%s.example".'),'phpLDAPadmin',$app['config_file'],$app['config_file']),'error',true);
error(sprintf(_('You need to configure %s. Edit the file "%s" to do so. An example config file is provided in "%s.example".'),'phpLDAPadmin',$app['config_file'],$app['config_file']),'error',null,true);
} elseif (! is_readable($app['config_file'])) {
error(sprintf('Fatal error: Cannot read your configuration file "%s", its permissions may be too strict.',$app['config_file']),'error',true);
error(sprintf('Fatal error: Cannot read your configuration file "%s", its permissions may be too strict.',$app['config_file']),'error',null,true);
}
# If our config file fails the sanity check, then stop now.
@@ -87,5 +112,8 @@ if (! check_config($app['config_file'])) {
exit;
}
if ($uri = get_request('URI','GET'))
header(sprintf('Location: cmd.php?%s',base64_decode($uri)));
include './cmd.php';
?>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import.php,v 1.35.2.2 2008/01/28 12:58:43 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import.php,v 1.35.2.4 2008/12/12 12:20:22 wurley Exp $
/**
* Imports an LDIF file to the specified server_id.
@@ -16,8 +16,9 @@
require './common.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('import'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('import')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('import')),'error','index.php');
$entry = array();
$entry['continuous_mode'] = get_request('continuous_mode') ? true : false;
$entry['ldif'] = get_request('ldif');
@@ -31,20 +32,20 @@ if ($entry['ldif']) {
$entry['size'] = $_FILES['ldif_file']['size'];
if (! is_array($_FILES['ldif_file'])) {
pla_error(_('Missing uploaded file.'),null,-1,false);
error(_('Missing uploaded file.'),'error');
return;
}
if (! file_exists($file)) {
pla_error(_('No LDIF file specified. Please try again.'),null,-1,false);
error(_('No LDIF file specified. Please try again.'),'error');
return;
}
if ($entry['size'] <= 0) {
pla_error(_('Uploaded LDIF file is empty.'),null,-1,false);
error(_('Uploaded LDIF file is empty.'),'error');
return;
}
} else {
pla_error(_('You must either upload a file or provide an LDIF in the text box.'),null,-1,false);
error(_('You must either upload a file or provide an LDIF in the text box.'),'error');
return;
}
@@ -182,7 +183,7 @@ function display_pla_parse_error($exception,$faultyEntry) {
$errorMessage = $actionErrorMsg[$faultyEntry->getChangeType()];
echo '<center>';
echo '<table class="error"><tr><td class="img"><img src="images/warning.png" /></td>';
printf('<table class="error"><tr><td class="img"><img src="%s/warning.png" /></td>',IMGDIR);
echo '<td>';
printf('<center><h2>%s</h2></center>',_('LDIF Parse Error'));
echo '<br />';

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import_form.php,v 1.22.2.1 2008/01/13 05:43:13 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import_form.php,v 1.22.2.3 2008/12/12 12:20:22 wurley Exp $
/**
* Displays a form to allow the user to upload and import
@@ -13,10 +13,10 @@
require './common.php';
if (! ini_get('file_uploads'))
pla_error(_('Your PHP.INI does not have file_uploads = ON. Please enable file uploads in PHP.'));
error(_('Your PHP.INI does not have file_uploads = ON. Please enable file uploads in PHP.'),'error','index.php');
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
printf('<h3 class="title" colspan=0>%s</h3>',_('Import LDIF File'));
printf('<h3 class="subtitle" colspan=0>%s: <b>%s</b></h3>',_('Server'),htmlspecialchars($ldapserver->name));
@@ -38,7 +38,7 @@ printf('<tr><td>&nbsp;</td><td class="small"><b>%s %s</b></td></tr>',_('Maximum
echo '<tr><td colspan=2>&nbsp;</td></tr>';
printf('<tr><td>%s</td></tr>',_('Or paste your LDIF here'));
echo '<tr><td colspan=2><textarea name="ldif" rows="20" cols="60"></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>';
printf('<tr><td>&nbsp;</td><td class="small"><input type="checkbox" name="continuous_mode" value="1" />%s</td></tr>',
_("Don't stop on errors"));

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login.php,v 1.56.2.4 2008/01/04 12:29:15 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login.php,v 1.56.2.5 2008/12/12 12:20:22 wurley Exp $
/**
* For servers whose auth_type is set to 'cookie' or 'session'. Pass me the
@@ -149,7 +149,7 @@ if (! is_resource($ds)) {
}
$ldapserver->auth_type = $save_auth_type;
$ldapserver->setLoginDN($login['dn'],$login['pass'],$anon_bind) or pla_error(_('Could not set cookie.'));
$ldapserver->setLoginDN($login['dn'],$login['pass'],$anon_bind) or error(_('Could not set cookie.'),'error','index.php');
set_lastactivity($ldapserver);
if (! $anon_bind) {

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login_form.php,v 1.29.2.4 2008/01/13 05:37:01 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login_form.php,v 1.29.2.7 2008/12/12 12:20:22 wurley Exp $
/**
* Displays the login form for a server for users who specify 'cookie' or 'session' for their auth_type.
@@ -14,12 +14,12 @@
require './common.php';
if (! in_array($ldapserver->auth_type, array('cookie','session')))
pla_error(sprintf(_('Unknown auth_type: %s'),htmlspecialchars($ldapserver->auth_type)));
error(sprintf(_('Unknown auth_type: %s'),htmlspecialchars($ldapserver->auth_type)),'error','index.php');
printf('<h3 class="title">%s %s</h3>',_('Authenticate to server'),$ldapserver->name);
# Check for a secure connection
if (! isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on') {
if (! isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on') {
echo '<br />';
echo '<center>';
echo '<span style="color:red">';
@@ -36,8 +36,8 @@ echo '<form action="cmd.php" method="post" name="login_form">';
echo '<input type="hidden" name="cmd" value="login" />';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
if (isset($_GET['redirect']))
printf('<input type="hidden" name="redirect" value="%s" />',rawurlencode($_GET['redirect']));
if (get_request('redirect','GET',false,false))
printf('<input type="hidden" name="redirect" value="%s" />',rawurlencode(get_request('redirect','GET')));
echo '<center>';
echo '<table class="forminput">';

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/logout.php,v 1.20.2.1 2007/12/26 03:25:38 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/logout.php,v 1.20.2.2 2008/12/12 12:20:22 wurley Exp $
/**
* For servers whose auth_type is set to 'cookie' or 'session'. Pass me
@@ -16,18 +16,18 @@
require './common.php';
if (! $ldapserver->haveAuthInfo())
pla_error(_('No one is logged in to that server.'));
error(_('No one is logged in to that server.'),'error','index.php');
if (in_array($ldapserver->auth_type, array('cookie','session','http'))) {
syslog_notice (sprintf('Logout for %s',$ldapserver->getLoggedInDN()));
if($ldapserver->auth_type!='http')
$ldapserver->unsetLoginDN() or pla_error(_('Could not logout.'));
$ldapserver->unsetLoginDN() or error(_('Could not logout.'),'error','index.php');
unset_lastactivity($ldapserver);
@session_destroy();
} else
pla_error(sprintf(_('Unknown auth_type: %s'), htmlspecialchars($ldapserver->auth_type)));
error(sprintf(_('Unknown auth_type: %s'),htmlspecialchars($ldapserver->auth_type)),'error','index.php');
system_message(array(
'title'=>_('Logout'),

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/mass_delete.php,v 1.17.2.2 2008/01/13 05:37:01 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/mass_delete.php,v 1.17.2.3 2008/12/12 12:20:22 wurley Exp $
/**
* Enables user to mass delete multiple entries using checkboxes.
@@ -19,23 +19,23 @@
require './common.php';
if( $ldapserver->isReadOnly() )
pla_error(_('Unable to delete, server is in READY-ONLY mode.'));
if ($ldapserver->isReadOnly())
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete', 'mass_delete'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete mass entries')));
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete','mass_delete'))
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete mass entries')),'error','index.php');
$confirmed = isset($_POST['confirmed']) ? true : false;
isset($_POST['mass_delete']) or
pla_error(_('Error calling mass_delete.php. Missing mass_delete in POST vars.'));
error(_('Error calling mass_delete.php. Missing mass_delete in POST vars.'),'error','index.php');
$mass_delete = $_POST['mass_delete'];
is_array($mass_delete) or
pla_error(_('mass_delete POST var is not an array.'));
error(_('mass_delete POST var is not an array.'),'error','index.php');
$ldapserver->isMassDeleteEnabled() or
pla_error(_('Mass deletion is not enabled. Please enable it in config.php before proceeding.'));
error(_('Mass deletion is not enabled. Please enable it in config.php before proceeding.'),'error','index.php');
printf('<h3 class="title">%s</h3>',_('Mass Deleting'));
@@ -48,7 +48,7 @@ if ($confirmed == true) {
$failed_dns = array();
if (! is_array($mass_delete))
pla_error(_('Malformed mass_delete array.'));
error(_('Malformed mass_delete array.'),'error','index.php');
if (count($mass_delete) == 0) {
echo '<br />';

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/modify_member_form.php,v 1.5.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/modify_member_form.php,v 1.5.2.6 2008/12/12 12:20:22 wurley Exp $
/**
* Displays a form to allow the user to modify group members.
@@ -18,12 +18,12 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
if (! $ldapserver->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
error(_('Not enough information to login to server. Please check your configuration.'),'error','index.php');
$attr = $_GET['attr'];
$dn = isset($_GET['dn']) ? $_GET['dn'] : null;
$attr = get_request('attr','GET');
$dn = get_request('dn','GET');
$encoded_dn = rawurlencode($dn);
$encoded_attr = rawurlencode($attr);
@@ -39,7 +39,7 @@ if ($current_members)
else
$num_current_members = 0;
sort($current_members);
usort($current_members,'pla_compare_dns');
# Loop through all base dn's and search possible member entries
foreach ($ldapserver->getBaseDN() as $base_dn) {
@@ -74,6 +74,7 @@ printf('<h3 class="subtitle">%s <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>'
printf('%s <b>%s</b> %s <b>%s</b>:',
_('There are'),$num_current_members,_('members in group'),htmlspecialchars($rdn));
$possible_members = array();
for ($i=0; $i<count($possible_values); $i++) {
if (preg_match("/^$attr$/i",$_SESSION[APPCONFIG]->GetValue('modify_member','posixgroupattr')))
$possible_members[$i] = $possible_values[$i][$_SESSION[APPCONFIG]->GetValue('modify_member','posixattr')];
@@ -81,7 +82,7 @@ for ($i=0; $i<count($possible_values); $i++) {
$possible_members[$i] = $possible_values[$i][$_SESSION[APPCONFIG]->GetValue('modify_member','attr')];
}
sort($possible_members);
usort($possible_members,'pla_compare_dns');
/*
* Show only user that are not already in group.
@@ -110,8 +111,8 @@ echo '<input type="hidden" name="cmd" value="update_confirm" />';
echo '<table class="modify_members">';
echo '<tr>';
printf('<td><img src="images/user.png" alt="Users" /> %s</td>',_('Available members'));
printf('<td><img src="images/uniquegroup.png" alt="Members" /> %s</td>',_('Group members'));
printf('<td><img src="%s/user.png" alt="Users" /> %s</td>',IMGDIR,_('Available members'));
printf('<td><img src="%s/uniquegroup.png" alt="Members" /> %s</td>',IMGDIR,_('Group members'));
echo '</tr>';
# Generate select box from all possible members

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/password_checker.php,v 1.10.2.1 2008/01/13 05:37:01 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/password_checker.php,v 1.10.2.3 2008/12/12 12:20:22 wurley Exp $
/**
* @package phpLDAPadmin
@@ -11,6 +11,7 @@ require './common.php';
include HTDOCDIR.'header.php';
echo '<body>';
$entry = array();
$entry['hash'] = get_request('hash','REQUEST');
$entry['password'] = get_request('check_password','REQUEST');
$entry['action'] = get_request('action','REQUEST');
@@ -34,7 +35,7 @@ echo '<table class="forminput" width=100% border=0>';
echo '<tr>';
printf('<td class="heading">%s</td>',_('Compare'));
printf('<td><input type="%s" name="hash" id="hash" value="%s" /></td>',
$entry['enc_type'] ? 'text' : 'password',htmlspecialchars($entry['hash']));
(obfuscate_password_display($entry['enc_type']) ? 'password' : 'text'),htmlspecialchars($entry['hash']));
echo '</tr>';
echo '<tr>';

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/purge_cache.php,v 1.9.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/purge_cache.php,v 1.9.2.2 2008/12/12 12:20:22 wurley Exp $
/**
* @package phpLDAPadmin
@@ -10,7 +10,7 @@
require './common.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('purge'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('purge')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('purge')),'error','index.php');
$purge_session_keys = array('cache');

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rdelete.php,v 1.28.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rdelete.php,v 1.28.2.3 2008/12/12 12:20:22 wurley Exp $
/**
* Recursively deletes the specified DN and all of its children
@@ -15,17 +15,18 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete', 'simple_delete'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete entry')));
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete','simple_delete'))
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete entry')),'error','index.php');
$entry['dn'] = $_POST['dn'];
$entry = array();
$entry['dn'] = get_request('dn');
if (! $entry['dn'])
pla_error(_('You must specify a DN'));
error(_('You must specify a DN'),'error','index.php');
if (! $ldapserver->dnExists($entry['dn']))
pla_error(sprintf(_('No such entry: %s'),htmlspecialchars($entry['dn'])));
error(sprintf('%s (%s)',_('No such entry.'),htmlspecialchars($entry['dn'])),'error','index.php');
printf('<h3 class="title">'._('Deleting %s').'</h3>',htmlspecialchars(get_rdn($entry['dn'])));
printf('<h3 class="subtitle">%s</h3>',_('Recursive delete progress'));
@@ -42,8 +43,10 @@ if ($result) {
printf(_('Entry %s and sub-tree deleted successfully.'),'<b>'.htmlspecialchars($entry['dn']).'</b>');
} else {
pla_error(sprintf(_('Could not delete the entry: %s'),htmlspecialchars($entry['dn'])),
$ldapserver->error(),$ldapserver->errno());
system_message(array(
'title'=>_('Could not delete the entry.').sprintf(' (%s)',pretty_print_dn($entry['dn'])),
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
'type'=>'error'));
}
function pla_rdelete($ldapserver,$dn) {
@@ -60,8 +63,10 @@ function pla_rdelete($ldapserver,$dn) {
return true;
} else {
pla_error(sprintf(_('Failed to delete entry %s'),htmlspecialchars($dn)),
$ldapserver->error(),$ldapserver->errno());
system_message(array(
'title'=>_('Could not delete the entry.').sprintf(' (%s)',pretty_print_dn($entry['dn'])),
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
'type'=>'error'));
}
} else {
@@ -77,8 +82,10 @@ function pla_rdelete($ldapserver,$dn) {
return true;
} else {
pla_error(sprintf(_('Failed to delete entry %s'),htmlspecialchars($dn)),
$ldapserver->error(),$ldapserver->errno());
system_message(array(
'title'=>_('Could not delete the entry.').sprintf(' (%s)',pretty_print_dn($entry['dn'])),
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
'type'=>'error'));
}
}
}

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/refresh.php,v 1.18.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/refresh.php,v 1.18.2.2 2008/12/12 12:20:22 wurley Exp $
/**
* This script alters the session variable 'tree', by re-querying
@@ -14,7 +14,7 @@
require './common.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('server_refresh'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('refresh server')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('refresh server')),'error','index.php');
unset($_SESSION['cache'][$ldapserver->server_id]['tree']);

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename.php,v 1.33.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename.php,v 1.33.2.3 2008/12/12 12:20:22 wurley Exp $
/**
* Renames a DN to a different name.
@@ -18,25 +18,25 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_rename'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('rename entry')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('rename entry')),'error','index.php');
$dn = ($_POST['dn']);
$dn = get_request('dn');
if (! $ldapserver->isBranchRenameEnabled()) {
# we search all children, not only the visible children in the tree
$children = $ldapserver->getContainerContents($dn);
if (count($children) > 0)
pla_error(_('You cannot rename an entry which has children entries (eg, the rename operation is not allowed on non-leaf entries)'));
error(_('You cannot rename an entry which has children entries (eg, the rename operation is not allowed on non-leaf entries)'),'error','index.php');
}
$new_rdn = ($_POST['new_rdn']);
$new_rdn = get_request('new_rdn');
$container = get_container($dn);
$new_dn = sprintf('%s,%s',$new_rdn,$container);
if ($new_dn == $dn)
pla_error(_('You did not change the RDN'));
error(_('You did not change the RDN'),'error','index.php');
$old_dn_attr = explode('=',$dn);
$old_dn_attr = $old_dn_attr[0];
@@ -44,7 +44,7 @@ $old_dn_attr = $old_dn_attr[0];
$new_dn_value = explode('=',$new_rdn,2);
if (count($new_dn_value) != 2 || ! isset($new_dn_value[1]))
pla_error(_('Invalid RDN value'));
error(_('Invalid RDN value'),'error','index.php');
$new_dn_attr = $new_dn_value[0];
$new_dn_value = $new_dn_value[1];
@@ -58,7 +58,7 @@ if ($success) {
$success = $ldapserver->rename($dn,$new_rdn,$container,$deleteoldrdn);
} else {
pla_error(_('Could not rename the entry') );
error(_('Could not rename the entry'),'error','index.php');
}
if ($success) {

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename_form.php,v 1.11.2.1 2008/01/13 05:37:01 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename_form.php,v 1.11.2.2 2008/12/12 12:20:22 wurley Exp $
/**
* Displays a form for renaming an LDAP entry.
@@ -17,9 +17,9 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
if (! $ldapserver->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
error(_('Not enough information to login to server. Please check your configuration.'),'error','index.php');
$dn = $_GET['dn'];
$rdn = get_rdn($dn);

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/schema.php,v 1.67.2.4 2008/01/28 20:58:08 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/schema.php,v 1.67.2.7 2008/12/12 12:20:22 wurley Exp $
/**
* Displays the schema for the specified server_id
@@ -17,8 +17,9 @@
require './common.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('schema'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('view schema')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('view schema')),'error','index.php');
$entry = array();
$entry['view'] = get_request('view','GET','false','objectClasses');
$entry['value'] = get_request('viewvalue','GET');
@@ -63,7 +64,7 @@ echo '<br />';
switch($entry['view']) {
case 'syntaxes':
$highlight_oid = isset($_GET['highlight_oid']) ? $_GET['highlight_oid'] : false;
$highlight_oid = get_request('highlight_oid','GET',false,false);
echo '<center>';
print '<table class="result_table" border=0>';
@@ -73,7 +74,7 @@ switch($entry['view']) {
$schema_syntaxes = $ldapserver->SchemaSyntaxes(null,true);
if (! $schema_syntaxes)
pla_error($schema_error_str);
error($schema_error_str,'error','index.php');
foreach ($schema_syntaxes as $syntax) {
$counter++;
@@ -108,14 +109,15 @@ switch($entry['view']) {
'usage' => _('Usage'),
'maximum_length' => _('Maximum Length'),
'aliases' => _('Aliases'),
'used_by_objectclasses' => _('Used by objectClasses')
'used_by_objectclasses' => _('Used by objectClasses'),
'force_as_may' => _('Force as MAY by config')
);
$schema_attrs = $ldapserver->SchemaAttributes();
$schema_object_classes = $ldapserver->SchemaObjectClasses();
if (! $schema_attrs || ! $schema_object_classes)
pla_error($schema_error_str);
error($schema_error_str,'error','index.php');
printf('<small>%s:</small>',_('Jump to an attribute type'));
echo '<form action="cmd.php" method="get">';
@@ -279,6 +281,10 @@ switch($entry['view']) {
print '</td>';
break;
case 'force_as_may':
printf('<td>%s</td>',$attr->forced_as_may ? _('Yes') : _('No'));
break;
}
print '</tr>';
}
@@ -292,7 +298,7 @@ switch($entry['view']) {
case 'matching_rules':
$schema_matching_rules = $ldapserver->MatchingRules(null,true);
if (! $schema_matching_rules)
pla_error($schema_error_str);
error($schema_error_str,'error','index.php');
printf('<small>%s</small><br />',_('Jump to a matching rule'));
@@ -371,7 +377,7 @@ switch($entry['view']) {
case 'objectClasses':
$schema_oclasses = $ldapserver->SchemaObjectClasses();
if (! $schema_oclasses)
pla_error($schema_error_str);
error($schema_error_str,'error','index.php');
printf('<small>%s:</small>',_('Jump to an objectClass'));
@@ -485,6 +491,11 @@ switch($entry['view']) {
$href = htmlspecialchars(sprintf($entry['href']['objectClasses'],strtolower($attr->getSource())));
printf('<small>(%s <a href="%s">%s</a>)</small>',_('Inherited from'),$href,$attr->getSource());
}
if ($oclass->isForceMay($attr->getName())) {
echo '<br />';
printf('<small>%s</small>',_('This attribute has been forced as a MAY attribute by the configuration'));
}
echo '</li>';
}
echo '</ul>';
@@ -502,5 +513,5 @@ switch($entry['view']) {
}
if (! is_null($entry['value']) && ! $entry['viewed'])
pla_error(sprintf(_('No such schema item: "%s"'),htmlspecialchars($entry['value'])));
error(sprintf(_('No such schema item: "%s"'),htmlspecialchars($entry['value'])),'error','index.php');
?>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/search.php,v 1.78.2.6 2008/01/27 11:57:38 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/search.php,v 1.78.2.8 2008/12/12 12:20:22 wurley Exp $
/**
* Perform LDAP searches and draw the advanced/simple search forms
@@ -24,6 +24,7 @@ define('SIZE_LIMIT_EXCEEDED',4);
$result_formats = array('list','table');
# Our incoming variables
$entry = array();
$entry['format'] = get_request('format','GET','false',$_SESSION[APPCONFIG]->GetValue('search','display'));
$entry['form'] = get_request('form','GET',false,get_request('form','SESSION'));
@@ -117,15 +118,15 @@ echo '<br />';
if ($entry['search']) {
if ($entry['form'] == 'advanced') {
if (! $_SESSION[APPCONFIG]->isCommandAvailable('search','advanced_search'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('advanced search')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('advanced search')),'error','index.php');
} elseif ($entry['form'] == 'predefined') {
if (! $_SESSION[APPCONFIG]->isCommandAvailable('search','predefined_search'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('predefined search')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('predefined search')),'error','index.php');
} elseif ($entry['form'] == 'simple') {
if (! $_SESSION[APPCONFIG]->isCommandAvailable('search','simple_search'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('simple search')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('simple search')),'error','index.php');
}
if ($entry['form'] == 'advanced') {
@@ -247,7 +248,10 @@ if ($entry['search']) {
$entry['scope'],$entry['orderby']['array'],$_SESSION[APPCONFIG]->GetValue('deref','search'));
if ((! $results) && $ldapserver->errno())
pla_error(_('Encountered an error while performing search.'),$ldapserver->error(),$ldapserver->errno());
system_message(array(
'title'=>_('Encountered an error while performing search.'),
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
'type'=>'error'));
$errno = $ldapserver->errno();
@@ -269,11 +273,11 @@ if ($entry['search']) {
$href = htmlspecialchars(sprintf('cmd.php?cmd=export_form&server_id=%s&scope=%s&dn=%s&filter=%s&attributes=%s',
$ldapserver->server_id,$entry['scope'],$base_dn,rawurlencode($entry['filter']['clean']),rawurlencode(join(', ',$search_result_attributes))));
printf('<td style="text-align: right"><small>[ <a href="%s"><img src="images/save.png" alt="Save" /> %s</a> ]',
$href,_('export results'));
printf('<td style="text-align: right"><small>[ <a href="%s"><img src="%s/save.png" alt="Save" /> %s</a> ]',
$href,IMGDIR,_('export results'));
}
printf('[ <img src="images/rename.png" alt="rename" /> %s%s',_('Format'),_(':'));
printf('[ <img src="%s/rename.png" alt="rename" /> %s%s',IMGDIR,_('Format'),_(':'));
foreach ($result_formats as $f) {
echo '&nbsp;';
@@ -380,7 +384,7 @@ if ($entry['search']) {
elseif ($entry['format'] == 'table')
require LIBDIR.'search_results_table.php';
else
pla_error(sprintf(_('Unrecognized search result format: %s'),htmlspecialchars($entry['format'])));
error(sprintf(_('Unrecognized search result format: %s'),htmlspecialchars($entry['format'])),'error','index.php');
echo '<br />';
if (trim($pager_html))

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/server_info.php,v 1.27.2.2 2008/01/13 05:37:01 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/server_info.php,v 1.27.2.4 2008/12/12 12:20:22 wurley Exp $
/**
* Fetches and displays all information that it can from the specified server
@@ -13,7 +13,7 @@
*/
if (! $_SESSION[APPCONFIG]->isCommandAvailable('server_info'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('view server informations')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('view server information')),'error','index.php');
# The attributes we'll examine when searching the LDAP server's RootDSE
$root_dse_attributes = array(
@@ -94,8 +94,8 @@ foreach ($attrs as $attr => $values) {
print '<tr>';
if (preg_match('/^[0-9]+\.[0-9]+/',$value)) {
printf('<td width=5%%><img src="images/rfc.png" title="%s" alt="%s" /></td>',
htmlspecialchars($value), htmlspecialchars($value));
printf('<td width=5%%><img src="%s/rfc.png" title="%s" alt="%s" /></td>',
IMGDIR,htmlspecialchars($value), htmlspecialchars($value));
if ($oidtext = support_oid_to_text($value))
if (isset($oidtext['ref']))

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/show_cache.php,v 1.3.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/show_cache.php,v 1.3.2.3 2008/12/12 12:20:22 wurley Exp $
/**
* This script shows the contents of the cache for debugging purposes
@@ -11,6 +11,7 @@
require './common.php';
$entry = array();
$entry['key'] = get_request('key','REQUEST');
$entry['index'] = get_request('index','REQUEST');
@@ -80,7 +81,7 @@ if (! $_SESSION[APPCONFIG]->GetValue('appearance','hide_debug_info')) {
poststr += "&index=" + encodeURI(xx);
}
obj.innerHTML = '<img src="images/ajax-spinner.gif" /> Loading...';
obj.innerHTML = '<img src="<?php echo IMGDIR ?>/ajax-spinner.gif" /> Loading...';
makePOSTRequest('cmd.php',poststr,'alertCacheContents','cancelCacheContents');
}

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/template_engine.php,v 1.45.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/template_engine.php,v 1.45.2.2 2008/12/12 12:20:22 wurley Exp $
/**
* Template render engine.
@@ -15,6 +15,7 @@
require_once './common.php';
$entry = array();
$entry['dn']['encode'] = get_request('dn','REQUEST');
$entry['dn']['string'] = rawurldecode($entry['dn']['encode']);
$entry['template'] = get_request('template','REQUEST',false,'');
@@ -22,7 +23,7 @@ $entry['template'] = get_request('template','REQUEST',false,'');
# If we have a DN, then this is to edit the entry.
if ($entry['dn']['string']) {
$ldapserver->dnExists($entry['dn']['string'])
or pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($entry['dn']['string'])));
or error(sprintf('%s (%s)',_('No such entry'),pretty_print_dn($entry['dn']['string'])),'error','index.php');
$tree = get_cached_item($ldapserver->server_id,'tree');
@@ -51,7 +52,7 @@ if ($entry['dn']['string']) {
} else {
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
# Create a new empty entry
$entryfactoryclass = $_SESSION[APPCONFIG]->GetValue('appearance','entry_factory');

View File

@@ -1,41 +0,0 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/timeout.php,v 1.5.2.1 2007/12/21 12:11:55 wurley Exp $
/**
* Time out page to be displayed on the right frame
*
* Variables that come in as GET vars:
* - server_id
*
* @package phpLDAPadmin
*/
/**
*/
require './common.php';
if (! isset($ldapserver)) {
header("Location: index.php");
die();
}
include './header.php';
# If $session_timeout not defined, use ( session_cache_expire() - 1 )
$session_timeout = $ldapserver->session_timeout ? $ldapserver->session_timeout : session_cache_expire()-1;
?>
<h3 class="title"><?php echo $ldapserver->name; ?></h3>
<br />
<br />
<center>
<b><?php printf('%s %s %s',_('Your Session timed out after'),$session_timeout,_('min. of inactivity. You have been automatically logged out.')); ?></b>
<br />
<br />
<?php echo _('To log back in please click on the following link:'); ?><br />
<a href="cmd.php?cmd=login_form&server_id=<?php echo $ldapserver->server_id; ?>"><?php echo _('Login...'); ?></a>
</center>
</body>
</html>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update.php,v 1.29.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update.php,v 1.29.2.3 2008/12/12 12:20:22 wurley Exp $
/**
* Updates or deletes a value from a specified attribute for a specified dn.
@@ -26,24 +26,25 @@
require './common.php';
$entry = array();
$entry['dn']['string'] = get_request('dn');
$entry['dn']['encode'] = rawurlencode($entry['dn']['string']);
# If cancel was submited, got back to the edit display.
if (isset($_REQUEST['cancel'])) {
if (get_request('cancel','REQUEST')) {
header(sprintf('Location: cmd.php?cmd=template_engine&server_id=%s&dn=%s',$ldapserver->server_id,$entry['dn']['encode']));
die();
}
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
$entry['update'] = get_request('update_array','POST',false,array());
$entry['skip'] = get_request('skip_array','POST',false,array());
$failed_attrs = array();
if (! is_array($entry['update']))
pla_error(_('update_array is malformed. This might be a phpLDAPadmin bug. Please report it.'));
error(_('update_array is malformed. This might be a phpLDAPadmin bug. Please report it.'),'error','index.php');
run_hook ('pre_update',
array('server_id'=>$ldapserver->server_id,'dn'=>$entry['dn']['string'],'update_array'=>$entry['update']));
@@ -58,13 +59,14 @@ foreach ($entry['update'] as $attr => $val) {
$entry['update'][$attr] = array();
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_delete'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete attribute')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete attribute')),'error','index.php');
} else { # Skip change
$entry['update'][$attr] = $val;
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add_value')
&& ! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_delete_value'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('modify attribute values')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('modify attribute values')),'error','index.php');
}
} else {
@@ -77,7 +79,7 @@ foreach ($entry['update'] as $attr => $val) {
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add_value')
&& ! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_delete_value'))
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('modify attribute values')));
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('modify attribute values')),'error','index.php');
}
}
}
@@ -89,8 +91,8 @@ foreach ($entry['update'] as $attr_name => $val) {
$href['search'] = sprintf('cmd.php?cmd=search&search=true&form=advanced&server_id=%s&filter=%s=%s',
$ldapserver->server_id,$attr_name,$badattr);
pla_error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href="%s">search</a> for that entry.'),
$attr_name,$badattr,$entry['dn']['string'],$href['search']));
error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href="%s">search</a> for that entry.'),
$attr_name,$badattr,$entry['dn']['string'],$href['search']),'error','index.php');
}
if (run_hook('pre_attr_modify',
@@ -100,8 +102,9 @@ foreach ($entry['update'] as $attr_name => $val) {
$failed_attrs[$attr_name] = $val;
} elseif ($ldapserver->isAttrReadOnly($attr)) {
pla_error(sprintf(_('The attribute "%s" is flagged as read-only in the phpLDAPadmin configuration.'),
htmlspecialchars($attr_name)));
error(sprintf(_('The attribute "%s" is flagged as read-only in the phpLDAPadmin configuration.'),
htmlspecialchars($attr_name)),'error','index.php');
} else {
// binary values
if (isset($_SESSION['submitform'][$attr_name])) {
@@ -175,6 +178,9 @@ if ($result) {
die();
} else {
pla_error(_('Could not perform ldap_modify operation.'),$ldapserver->error(),$ldapserver->errno());
system_message(array(
'title'=>_('Could not perform ldap_modify operation.'),
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
'type'=>'error'));
}
?>

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update_confirm.php,v 1.49.2.3 2008/01/13 05:37:01 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update_confirm.php,v 1.49.2.4 2008/12/12 12:20:22 wurley Exp $
/**
* Takes the results of clicking "Save" in template_engine.php and determines which
@@ -16,17 +16,18 @@
require './common.php';
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
/***************/
/* get entry */
/***************/
$entry = array();
$entry['dn']['string'] = get_request('dn');
$entry['dn']['encode'] = rawurlencode($entry['dn']['string']);
if (! $entry['dn']['string'] || ! $ldapserver->dnExists($entry['dn']['string']))
pla_error(sprintf(_('The entry (%s) does not exist.'),htmlspecialchars($entry['dn']['string'])),null,-1,true);
error(sprintf(_('The entry (%s) does not exist.'),htmlspecialchars($entry['dn']['string'])),'error','index.php');
$tree = get_cached_item($ldapserver->server_id,'tree');
$entry['ldap'] = null;
@@ -40,7 +41,7 @@ if ($tree) {
}
if (! $entry['ldap'] || $entry['ldap']->isReadOnly())
pla_error(sprintf(_('The entry (%s) is in readonly mode.'),htmlspecialchars($entry['dn']['string'])),null,-1,true);
error(sprintf(_('The entry (%s) is in readonly mode.'),htmlspecialchars($entry['dn']['string'])),'error','index.php');
/***************/
/* old values */
@@ -96,9 +97,9 @@ $attr_to_delete = array();
// if objectClass attribute is modified
if (isset($entry['values']['new']['objectClass'])) {
if (!isset($entry['values']['old']['objectClass'])) {
pla_error(_('An entry should have one structural objectClass.'));
}
if (!isset($entry['values']['old']['objectClass']))
error(_('An entry should have one structural objectClass.'),'error','index.php');
// deleted objectClasses
foreach ($entry['values']['old']['objectClass'] as $oldOC) {
if (!in_array($oldOC, $entry['values']['new']['objectClass'])) {

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/view_jpeg_photo.php,v 1.11.2.1 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/view_jpeg_photo.php,v 1.11.2.3 2008/12/12 12:20:22 wurley Exp $
/**
* @package phpLDAPadmin
@@ -9,27 +9,29 @@
require './common.php';
$file = array();
$file['name'] = get_request('file','GET');
/* Security check (we don't want anyone tryting to get at /etc/passwd or something)
* Slashes and dots are not permitted in these names.
*/
if (! preg_match('/^pla/',$file['name']) || preg_match('/[\.\/\\\\]/',$file['name']))
pla_error(sprintf('%s: %s',_('Unsafe file name'),htmlspecialchars($file['name'])));
error(sprintf('%s: %s',_('Unsafe file name'),htmlspecialchars($file['name'])),'error','index.php');
/* Little security measure here (prevents users from accessing
files, like /etc/passwd for example).*/
$file['name'] = basename(addcslashes($file['name'],'/\\'));
$file['name'] = sprintf('%s/%s',$_SESSION[APPCONFIG]->GetValue('jpeg','tmpdir'),$file['name']);
if (! file_exists($file['name']))
pla_error(sprintf('%s%s %s',_('No such file'),_(':'),htmlspecialchars($file['name'])));
error(sprintf('%s%s %s',_('No such file'),_(':'),htmlspecialchars($file['name'])),'error','index.php');
$file['handle'] = fopen($file['name'],'r');
$file['data'] = fread($file['handle'],filesize($file['name']));
fclose($file['handle']);
if (ob_get_level())
ob_clean();
$obStatus = ob_get_status();
if (isset($obStatus['type']) && $obStatus['type'] && $obStatus['status'])
ob_end_clean();
Header('Content-type: image/jpeg');
Header('Content-disposition: inline; filename=jpeg_photo.jpg');

View File

@@ -1,5 +1,5 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/welcome.php,v 1.26.2.2 2007/12/26 09:26:32 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/welcome.php,v 1.26.2.4 2008/12/12 08:41:30 wurley Exp $
/**
* @package phpLDAPadmin
@@ -13,7 +13,7 @@ require './common.php';
echo '<center>';
echo '<br /><br />';
printf('<img src="images/logo.jpg" title="%s" alt="%s" />',_('phpLDAPadmin logo'),_('phpLDAPadmin logo'));
printf('<img src="%s/logo.png" title="%s" alt="%s" />',IMGDIR,_('phpLDAPadmin logo'),_('phpLDAPadmin logo'));
echo '<br /><br />';
echo _('Use the menu to the left to navigate');
echo '<br /><br />';