diff --git a/INSTALL b/INSTALL
index 2f150fe..e079b12 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,5 +1,5 @@
For install instructions in non-English languages, see the wiki:
- http://phpldapadmin.wiki.sourceforge.net
+ http://phpldapadmin.sourceforge.net
* Requirements
@@ -17,7 +17,7 @@ For install instructions in non-English languages, see the wiki:
* For additional help
See the wiki:
- http://phpldapadmin.wiki.sourceforge.net
+ http://phpldapadmin.sourceforge.net
Join our mailing list:
https://lists.sourceforge.net/lists/listinfo/phpldapadmin-devel
diff --git a/VERSION b/VERSION
index ab8bba9..09636ab 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-$Name: RELEASE-1_1_0_5 $
+$Name: RELEASE-1_1_0_6 $
diff --git a/config/config.php.example b/config/config.php.example
index faa0be0..f8d1d4e 100644
--- a/config/config.php.example
+++ b/config/config.php.example
@@ -134,11 +134,17 @@ $config->custom->commands['all'] = array(
An AttributeFactory defines which class to use to represent a given attribute */
// $config->custom->appearance['attribute_factory'] = "AttributeFactory";
+/* Just show your custom templates. */
+// $config->custom->appearance['custom_templates_only'] = false;
+
+/* Disable the default template. */
+// $config->custom->appearance['disable_default_template'] = false;
+
/* Configure what objects are shown in left hand tree */
// $config->custom->appearance['tree_filter'] = '(objectclass=*)';
/* The height and width of the tree. If these values are not set, then
- no tree scroll bars are provided.
+ no tree scroll bars are provided. */
// $config->custom->appearance['tree_height'] = null;
# $config->custom->appearance['tree_height'] = 600;
// $config->custom->appearance['tree_width'] = null;
@@ -270,7 +276,8 @@ $ldapservers->SetValue($i,'server','name','My LDAP Server');
authentication with dn.
This is useful, when users should be able to log in with their uid, but
the ldap administrator wants to log in with his root-dn, that does not
- necessarily have the uid attribute. */
+ necessarily have the uid attribute.
+ When using this feature, login_class is ignored. */
// $ldapservers->SetValue($i,'login','fallback_dn',false);
/* If you specified 'cookie' or 'session' as the auth_type above, and you
@@ -314,7 +321,7 @@ $ldapservers->SetValue($i,'server','name','My LDAP Server');
// $ldapservers->SetValue($i,'auto_number','min','1000');
/* The DN of the uidPool entry when 'uidpool' mechanism is used above. */
-# $servers[$i]['auto_uid_number_uid_pool_dn'] = 'cn=uidPool,dc=example,dc=com';
+// $ldapservers->SetValue($i,'auto_number','uidpool_dn','cn=uidPool,dc=example,dc=com');
/* If you set this, then phpldapadmin will bind to LDAP with this user ID when
searching for the uidnumber. The idea is, this user id would have full
@@ -364,6 +371,25 @@ $ldapservers->SetValue($i,'server','name','My LDAP Server');
has children. Certain servers are known to allow it, certain are not */
// $ldapservers->SetValue($i,'server','branch_rename',false);
+/* If you set this, then phpldapadmin will show these attributes as
+ internal attributes, even if they are not defined in your schema. */
+// $ldapservers->SetValue($i,'server','custom_sys_attrs',array(''));
+# $ldapservers->SetValue($i,'server','custom_sys_attrs',array('passwordExpirationTime','passwordAllowChangeTime'));
+
+/* If you set this, then phpldapadmin will show these attributes on
+ objects, even if they are not defined in your schema. */
+// $ldapservers->SetValue($i,'server','custom_attrs',array(''));
+# $ldapservers->SetValue($i,'server','custom_attrs',array('nsRoleDN','nsRole','nsAccountLock'));
+
+/* These attributes will be forced to MAY attributes and become option in the
+ templates. If they are not defined in the templates, then they wont appear
+ as per normal template processing. You may want to do this becuase your LDAP
+ server may automatically calculate a default value.
+ In Fedora Directory Server using the DNA Plugin one could ignore uidNumber,
+ gidNumber and sambaSID. */
+// $ldapservers->SetValue($i,'force_may','attrs',array(''));
+# $ldapservers->SetValue($i,'force_may','attrs',array('uidNumber','gidNumber','sambaSID'));
+
/**************************************************************************
* If you want to configure additional LDAP servers, do so below. *
* Remove the commented lines and use this section as a template for all *
@@ -494,7 +520,7 @@ $friendly_attrs['uid'] = 'User Name';
/*********************************************/
/* Add "modify group members" link to the attribute. */
-// $config->custom->modify_member['groupattr'] = array('member','uniqueMember','memberUid')
+// $config->custom->modify_member['groupattr'] = array('member','uniqueMember','memberUid');
/* Configure filter for member search. This only applies to "modify group members" feature */
// $config->custom->modify_member['filter'] = '(objectclass=Person)';
diff --git a/doc/uidpool.schema b/doc/uidpool.schema
new file mode 100755
index 0000000..7154740
--- /dev/null
+++ b/doc/uidpool.schema
@@ -0,0 +1,11 @@
+##
+## Used for storing the next gid and next uid in the the directory
+##
+objectclass ( 1.3.6.1.4.1.7165.1.2.2.3 NAME 'uidPool' SUP top AUXILIARY
+ DESC 'Pool for allocating UNIX uids'
+ MUST ( uidNumber $ cn ) )
+
+
+objectclass ( 1.3.6.1.4.1.7165.1.2.2.4 NAME 'gidPool' SUP top AUXILIARY
+ DESC 'Pool for allocating UNIX gids'
+ MUST ( gidNumber $ cn ) )
diff --git a/htdocs/add_attr.php b/htdocs/add_attr.php
index 6bb205f..574e4f1 100644
--- a/htdocs/add_attr.php
+++ b/htdocs/add_attr.php
@@ -1,5 +1,5 @@
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 %s (%s) to
%s
is NOT allowed. That attribute/value belongs to another entry.
You might like to search for that entry.'),$entry['attr']['string'],$badattr,$entry['dn']['string'],$href));
+ error(sprintf(_('Your attempt to add %s (%s) to
%s
is NOT allowed. That attribute/value belongs to another entry.
You might like to search 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')); } /** diff --git a/htdocs/add_attr_form.php b/htdocs/add_attr_form.php index 76feae6..4455163 100644 --- a/htdocs/add_attr_form.php +++ b/htdocs/add_attr_form.php @@ -1,5 +1,5 @@ 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('
You might like to search for that entry.'),$attr,$badattr,$entry['dn']['string'],$href['search']));
+ error(sprintf(_('Your attempt to add %s (%s) to
%s
is NOT allowed. That attribute/value belongs to another entry.
You might like to search 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']);
diff --git a/htdocs/add_oclass_form.php b/htdocs/add_oclass_form.php
index eafd013..22490f4 100644
--- a/htdocs/add_oclass_form.php
+++ b/htdocs/add_oclass_form.php
@@ -1,5 +1,5 @@
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',
diff --git a/htdocs/add_value.php b/htdocs/add_value.php
index de1fa4b..e75608f 100644
--- a/htdocs/add_value.php
+++ b/htdocs/add_value.php
@@ -1,5 +1,5 @@
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 %s (%s) to
%s
is NOT allowed. That attribute/value belongs to another entry.
You might like to search for that entry.'),$entry['attr']['string'],$badattr,$entry['dn']['string'],$href));
+ error(sprintf(_('Your attempt to add %s (%s) to
%s
is NOT allowed. That attribute/value belongs to another entry.
You might like to search 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)); diff --git a/htdocs/add_value_form.php b/htdocs/add_value_form.php index ec12e65..e77792e 100644 --- a/htdocs/add_value_form.php +++ b/htdocs/add_value_form.php @@ -1,5 +1,5 @@ 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 ''; if ($_SESSION[APPCONFIG]->GetValue('appearance','show_hints')) - printf('
'; - $writer->draw('BlankValue', $ldap['attr'], $ldap['count']); + $writer->draw('BlankValue',$ldap['attr'],$ldap['count'],$reader); echo ' |
';
if ($ldap['schema']->getDescription())
diff --git a/htdocs/compare.php b/htdocs/compare.php
index ede7d83..24a4e4a 100644
--- a/htdocs/compare.php
+++ b/htdocs/compare.php
@@ -1,5 +1,5 @@
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(' %s(%s) ',$href,$i,_('download value'),$i); + printf(' %s(%s) ',$href,$i,_('download value'),IMGDIR,$i); else - printf(' %s ',$href,_('download value')); + printf(' %s ',$href,IMGDIR,_('download value')); if ($side == 'dst' && ! $ldapserver_dst->isReadOnly() && ! $ldapserver->isAttrReadOnly($attr)) - printf(' %s',$attr,_('delete attribute')); + printf(' %s',$attr,IMGDIR,_('delete attribute')); echo ''; echo ' | ';
@@ -322,8 +323,7 @@ foreach ($attrs_all as $attr) {
if ($side == 'dst') {
printf('',htmlspecialchars($user_password));
- echo enc_type_select_list($enc_type);
-
+ echo enc_type_select_list($enc_type,'enc','userpassword',0);
}
echo '
You might like to search for that entry.'),$attr,$badattr,$new_dn,$search_href));
+ error(sprintf(_('Your attempt to add %s (%s) to
%s
is NOT allowed. That attribute/value belongs to another entry.
You might like to search 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')); } ?> diff --git a/htdocs/css/style.css b/htdocs/css/style.css index cd5751b..3ddc2ab 100644 --- a/htdocs/css/style.css +++ b/htdocs/css/style.css @@ -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 */ diff --git a/htdocs/delete.php b/htdocs/delete.php index 37017ff..277e0a2 100644 --- a/htdocs/delete.php +++ b/htdocs/delete.php @@ -1,5 +1,5 @@ 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'),''.pretty_print_dn($entry['dn']).'')); + error(sprintf('%s (%s)',_('No such entry.'),''.pretty_print_dn($entry['dn']).''),'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'),''.pretty_print_dn($entry['dn']).'')); + error(sprintf(_('Could not delete the entry: %s'),''.pretty_print_dn($entry['dn']).''),'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'),''.pretty_print_dn($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')); } ?> diff --git a/htdocs/delete_attr.php b/htdocs/delete_attr.php index cbce0d2..94f364f 100644 --- a/htdocs/delete_attr.php +++ b/htdocs/delete_attr.php @@ -1,5 +1,5 @@ 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')); } ?> diff --git a/htdocs/delete_form.php b/htdocs/delete_form.php index bb73667..9e27481 100644 --- a/htdocs/delete_form.php +++ b/htdocs/delete_form.php @@ -1,5 +1,5 @@ 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']); diff --git a/htdocs/download_binary_attr.php b/htdocs/download_binary_attr.php index 2acd2f3..bdbf7a2 100644 --- a/htdocs/download_binary_attr.php +++ b/htdocs/download_binary_attr.php @@ -1,5 +1,5 @@ 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 diff --git a/htdocs/draw_tree_node.php b/htdocs/draw_tree_node.php index 7839d0a..edbe477 100644 --- a/htdocs/draw_tree_node.php +++ b/htdocs/draw_tree_node.php @@ -1,41 +1,42 @@ 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(); ?> diff --git a/htdocs/entry_chooser.php b/htdocs/entry_chooser.php index a788095..09dbf73 100644 --- a/htdocs/entry_chooser.php +++ b/htdocs/entry_chooser.php @@ -1,5 +1,5 @@ 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 '
Please install PCRE support before using phpLDAPadmin.
(Dont forget to restart your web server afterwards)
Your install of PHP appears to be missing php-session support.
Please install php-session support before using phpLDAPadmin.
(Dont forget to restart your web server afterwards)
Your install of PHP appears to be missing GETTEXT support.
GETTEXT is used for language translation.
Please install GETTEXT support before using phpLDAPadmin.
(Dont forget to restart your web server afterwards)
GETTEXT is used for language translation.
Please install GETTEXT support before using phpLDAPadmin.
(Dont forget to restart your web server afterwards)',
+ '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.
Please install LDAP support before using phpLDAPadmin.
(Dont forget to restart your web server afterwards)',
+ '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.
Please install XML support before using phpLDAPadmin.
(Dont forget to restart your web server afterwards)',
+ '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';
?>
diff --git a/htdocs/ldif_import.php b/htdocs/ldif_import.php
index 4d08d70..50d6b40 100644
--- a/htdocs/ldif_import.php
+++ b/htdocs/ldif_import.php
@@ -1,5 +1,5 @@
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 '
'; + printf(' |
',IMGDIR); echo ' | ';
printf('%s'; diff --git a/htdocs/ldif_import_form.php b/htdocs/ldif_import_form.php index 006dd90..ab883c0 100644 --- a/htdocs/ldif_import_form.php +++ b/htdocs/ldif_import_form.php @@ -1,5 +1,5 @@ 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(' %s',_('Import LDIF File')); printf('%s: %s',_('Server'),htmlspecialchars($ldapserver->name)); @@ -38,7 +38,7 @@ printf(' |
%s %s | |
%s | |
%s |