RELEASE 1.1.0.2
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr.php,v 1.20 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr.php,v 1.20.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Adds an attribute/value pair to an object
|
||||
@@ -21,7 +21,7 @@ require './common.php';
|
||||
if ($ldapserver->isReadOnly())
|
||||
pla_error(_('You cannot perform updates while server is in read-only mode'));
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('attribute_add'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute')));
|
||||
|
||||
$entry['val'] = get_request('val','POST');
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr_form.php,v 1.16 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_attr_form.php,v 1.16.2.2 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Displays a form for adding an attribute/value to an LDAP entry.
|
||||
@@ -85,9 +85,9 @@ if (is_array($ldap['attrs']['avail']) && count($ldap['attrs']['avail']) > 0) {
|
||||
foreach ($ldap['attrs']['avail'] as $a) {
|
||||
|
||||
# is there a user-friendly translation available for this attribute?
|
||||
if (isset($_SESSION['plaConfig']->friendly_attrs[strtolower($a)])) {
|
||||
if ($_SESSION[APPCONFIG]->haveFriendlyName($a)) {
|
||||
$attr_display = sprintf('%s (%s)',
|
||||
htmlspecialchars($_SESSION['plaConfig']->friendly_attrs[strtolower($a)]),
|
||||
htmlspecialchars($_SESSION[APPCONFIG]->getFriendlyName($a)),
|
||||
htmlspecialchars($a));
|
||||
|
||||
} else {
|
||||
@@ -129,9 +129,9 @@ if (count($ldap['binattrs']['avail']) > 0) {
|
||||
foreach ($ldap['binattrs']['avail'] as $a) {
|
||||
|
||||
# is there a user-friendly translation available for this attribute?
|
||||
if (isset($_SESSION['plaConfig']->friendly_attrs[strtolower($a)])) {
|
||||
if ($_SESSION[APPCONFIG]->haveFriendlyName($a)) {
|
||||
$attr_display = sprintf('%s (%s)',
|
||||
htmlspecialchars($_SESSION['plaConfig']->friendly_attrs[strtolower($a)]),
|
||||
htmlspecialchars($_SESSION[APPCONFIG]->getFriendlyName($a)),
|
||||
htmlspecialchars($a));
|
||||
|
||||
} else {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value.php,v 1.21 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value.php,v 1.21.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Adds a value to an attribute for a given dn.
|
||||
@@ -20,7 +20,7 @@
|
||||
if ($ldapserver->isReadOnly())
|
||||
pla_error(_('You cannot perform updates while server is in read-only mode'));
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('attribute_add_value'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add_value'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute value')));
|
||||
|
||||
# The DN and ATTR we are working with.
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value_form.php,v 1.39 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_value_form.php,v 1.39.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Displays a form to allow the user to enter a new value to add
|
||||
@@ -48,7 +48,7 @@ if ($tree) {
|
||||
}
|
||||
|
||||
// define the template of the entry if possible
|
||||
eval('$reader = new '.$_SESSION['plaConfig']->GetValue('appearance','entry_reader').'($ldapserver);');
|
||||
eval('$reader = new '.$_SESSION[APPCONFIG]->GetValue('appearance','entry_reader').'($ldapserver);');
|
||||
$reader->visit('Start', $entry['ldap']);
|
||||
|
||||
if (! $entry['ldap'] || $entry['ldap']->isReadOnly())
|
||||
@@ -58,12 +58,12 @@ if (! $entry['ldap'] || $entry['ldap']->isReadOnly())
|
||||
/* attribute values */
|
||||
/*********************/
|
||||
|
||||
eval('$writer = new '.$_SESSION['plaConfig']->GetValue('appearance','entry_writer').'($ldapserver);');
|
||||
eval('$writer = new '.$_SESSION[APPCONFIG]->GetValue('appearance','entry_writer').'($ldapserver);');
|
||||
|
||||
$ldap['attr'] = $entry['ldap']->getAttribute($entry['attr']['string']);
|
||||
if (!$ldap['attr']) {
|
||||
// define a new attribute for the entry
|
||||
$attributefactoryclass = $_SESSION['plaConfig']->GetValue('appearance','attribute_factory');
|
||||
$attributefactoryclass = $_SESSION[APPCONFIG]->GetValue('appearance','attribute_factory');
|
||||
eval('$attribute_factory = new '.$attributefactoryclass.'();');
|
||||
$ldap['attr'] = $attribute_factory->newAttribute($entry['attr']['string'], array());
|
||||
$ldap['attr']->setEntry($entry['ldap']);
|
||||
@@ -72,9 +72,9 @@ $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);
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('attribute_add_value'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add_value'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('add attribute value')));
|
||||
if (($ldap['attr']->getValueCount() == 0) && ! $_SESSION['plaConfig']->isCommandAvailable('attribute_add'))
|
||||
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')));
|
||||
|
||||
/*
|
||||
@@ -197,7 +197,7 @@ if ($entry['attr']['oclass']) {
|
||||
echo '</td></tr></table>';
|
||||
echo '<br />';
|
||||
|
||||
if ($_SESSION['plaConfig']->GetValue('appearance','show_hints'))
|
||||
if ($_SESSION[APPCONFIG]->GetValue('appearance','show_hints'))
|
||||
printf('<small><br /><img src="images/light.png" alt="Hint" /><span class="hint">%s</span></small>',
|
||||
_('Note: You may be required to enter new attributes that these objectClass(es) require'));
|
||||
echo '</form>';
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/cmd.php,v 1.3.2.1 2007/12/21 12:11:55 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/cmd.php,v 1.3.2.2 2007/12/24 10:45:57 wurley Exp $
|
||||
|
||||
/**
|
||||
* @package phpLDAPadmin
|
||||
@@ -7,47 +7,48 @@
|
||||
|
||||
require_once './common.php';
|
||||
|
||||
$body = new block();
|
||||
$file = '';
|
||||
$cmd = get_request('cmd','REQUEST');
|
||||
$meth = get_request('meth','REQUEST');
|
||||
$www['cmd'] = get_request('cmd','REQUEST');
|
||||
$www['meth'] = get_request('meth','REQUEST');
|
||||
|
||||
ob_start();
|
||||
|
||||
if (is_null($cmd)) {
|
||||
$cmd = 'welcome';
|
||||
}
|
||||
if (is_null($www['cmd']))
|
||||
$www['cmd'] = 'welcome';
|
||||
|
||||
switch ($cmd) {
|
||||
switch ($www['cmd']) {
|
||||
case '_debug' :
|
||||
debug_dump($_REQUEST,1);
|
||||
$file = '';
|
||||
break;
|
||||
|
||||
default :
|
||||
if (file_exists(HOOKSDIR.$cmd.'.php'))
|
||||
$file = HOOKSDIR.$cmd.'.php';
|
||||
elseif (file_exists(HTDOCDIR.$cmd.'.php'))
|
||||
$file = HTDOCDIR.$cmd.'.php';
|
||||
if (defined('HOOKSDIR') && file_exists(HOOKSDIR.$www['cmd'].'.php'))
|
||||
$file = HOOKSDIR.$www['cmd'].'.php';
|
||||
|
||||
elseif (defined('HTDOCDIR') && file_exists(HTDOCDIR.$www['cmd'].'.php'))
|
||||
$file = HTDOCDIR.$www['cmd'].'.php';
|
||||
|
||||
else
|
||||
$file = 'welcome.php';
|
||||
}
|
||||
|
||||
if ($file) {
|
||||
include $file;
|
||||
}
|
||||
if (DEBUG_ENABLED)
|
||||
debug_log('Ready to render page for command [%s,%s].',128,__FILE__,__LINE__,__METHOD__,$www['cmd'],$file);
|
||||
|
||||
$body->SetBody(ob_get_contents());
|
||||
# Create page.
|
||||
$www['page'] = new page($ldapserver->server_id);
|
||||
|
||||
if ($file)
|
||||
include $file;
|
||||
|
||||
# Capture the output and put into the body of the page.
|
||||
$www['body'] = new block();
|
||||
$www['body']->SetBody(ob_get_contents());
|
||||
$www['page']->block_add('body',$www['body']);
|
||||
ob_end_clean();
|
||||
|
||||
if (DEBUG_ENABLED)
|
||||
debug_log('Ready to render page for command [%s,%s].',128,__FILE__,__LINE__,__METHOD__,$cmd,$file);
|
||||
|
||||
$www = new page($ldapserver->server_id);
|
||||
$www->block_add('body',$body);
|
||||
|
||||
if ($meth == 'get_body')
|
||||
$www->body(true);
|
||||
if ($www['meth'] == 'get_body')
|
||||
$www['page']->body(true);
|
||||
else
|
||||
$www->display();
|
||||
$www['page']->display();
|
||||
?>
|
||||
|
@@ -1,10 +1,12 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/common.php,v 1.3.2.1 2007/12/21 12:11:55 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/common.php,v 1.3.2.3 2007/12/26 08:21:10 wurley Exp $
|
||||
|
||||
/**
|
||||
* @package phpLDAPadmin
|
||||
*/
|
||||
|
||||
@define('LIBDIR',sprintf('%s/',realpath('../lib/')));
|
||||
# This is just here to provide a convenient link back to the proper common.php
|
||||
if (! defined('LIBDIR'))
|
||||
define('LIBDIR',sprintf('%s/',realpath('../lib/')));
|
||||
require_once LIBDIR.'common.php';
|
||||
?>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare.php,v 1.16 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/compare.php,v 1.16.2.2 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Compare two DNs - the destination DN is editable.
|
||||
@@ -20,11 +20,11 @@ $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'] : '');
|
||||
|
||||
$ldapserver_src = $_SESSION['plaConfig']->ldapservers->Instance($server_id_src);
|
||||
$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.'));
|
||||
|
||||
$ldapserver_dst = $_SESSION['plaConfig']->ldapservers->Instance($server_id_dst);
|
||||
$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.'));
|
||||
|
||||
@@ -33,10 +33,8 @@ if (! $ldapserver_src->dnExists($dn_src))
|
||||
if (! $ldapserver_dst->dnExists($dn_dst))
|
||||
pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($dn_dst)));
|
||||
|
||||
$_SESSION['plaConfig']->friendly_attrs = process_friendly_attr_table();
|
||||
|
||||
$attrs_src = $ldapserver_src->getDNAttrs($dn_src,false,$_SESSION['plaConfig']->GetValue('deref','view'));
|
||||
$attrs_dst = $ldapserver_dst->getDNAttrs($dn_dst,false,$_SESSION['plaConfig']->GetValue('deref','view'));
|
||||
$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'));
|
||||
|
||||
# Get a list of all attributes.
|
||||
$attrs_all = array_keys($attrs_src);
|
||||
@@ -118,13 +116,13 @@ foreach ($attrs_all as $attr) {
|
||||
$required_note = '';
|
||||
|
||||
# is there a user-friendly translation available for this attribute?
|
||||
if (isset($_SESSION['plaConfig']->friendly_attrs[strtolower($attr)])) {
|
||||
$attr_display = $_SESSION['plaConfig']->friendly_attrs[strtolower($attr)];
|
||||
$attr_note = sprintf('<acronym title="%s">alias</acronym>',sprintf(_('Note: \'%s\' is an alias for \'%s\''),$attr_display,$attr));
|
||||
if ($_SESSION[APPCONFIG]->haveFriendlyName($attr)) {
|
||||
$attr_display = $_SESSION[APPCONFIG]->getFriendlyName($attr);
|
||||
$attr_note = sprintf('<acronym title="%s: \'%s\' %s \'%s\'">%s</acronym>',_('Note'),$attr_display,_('is an alias for'),$attr,_('alias'));
|
||||
|
||||
} else {
|
||||
$attr_note = '';
|
||||
$attr_display = $attr;
|
||||
$attr_note = '';
|
||||
}
|
||||
|
||||
# is this attribute required by an objectClass?
|
||||
@@ -311,7 +309,7 @@ foreach ($attrs_all as $attr) {
|
||||
if (trim($val) == "")
|
||||
echo "<span style=\"color:red\">[" . _('empty') . "]</span><br />\n";
|
||||
|
||||
elseif (0 == strcasecmp($attr,'userPassword') && $_SESSION['plaConfig']->GetValue('appearance','obfuscate_password_display'))
|
||||
elseif (0 == strcasecmp($attr,'userPassword') && $_SESSION[APPCONFIG]->GetValue('appearance','obfuscate_password_display'))
|
||||
echo preg_replace('/./','*',$val) . "<br />";
|
||||
|
||||
else
|
||||
@@ -320,7 +318,7 @@ foreach ($attrs_all as $attr) {
|
||||
|
||||
// @todo: redundant - $vals is always an array.
|
||||
} else {
|
||||
if (0 == strcasecmp($attr,'userPassword') && $_SESSION['plaConfig']->GetValue('appearance','obfuscate_password_display'))
|
||||
if (0 == strcasecmp($attr,'userPassword') && $_SESSION[APPCONFIG]->GetValue('appearance','obfuscate_password_display'))
|
||||
echo preg_replace('/./','*',$vals) . "<br />";
|
||||
else
|
||||
echo $vals . "<br />";
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy.php,v 1.44 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy.php,v 1.44.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Copies a given object to create a new one.
|
||||
@@ -16,14 +16,14 @@
|
||||
|
||||
require './common.php';
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('entry_move'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_move'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('copy entry')));
|
||||
|
||||
$entry['src']['id'] = get_request('server_id');
|
||||
$entry['dst']['id'] = get_request('dest_server_id');
|
||||
|
||||
$entry['src']['ldapserver'] = $_SESSION['plaConfig']->ldapservers->Instance($entry['src']['id']);
|
||||
$entry['dst']['ldapserver'] = $_SESSION['plaConfig']->ldapservers->Instance($entry['dst']['id']);
|
||||
$entry['src']['ldapserver'] = $_SESSION[APPCONFIG]->ldapservers->Instance($entry['src']['id']);
|
||||
$entry['dst']['ldapserver'] = $_SESSION[APPCONFIG]->ldapservers->Instance($entry['dst']['id']);
|
||||
|
||||
if ($entry['dst']['ldapserver']->isReadOnly())
|
||||
pla_error(_('Destination server is currently READ-ONLY.'));
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy_form.php,v 1.30 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy_form.php,v 1.30.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Copies a given object to create a new one.
|
||||
@@ -98,7 +98,7 @@ echo "\n";
|
||||
echo '</table></form>';
|
||||
echo "\n";
|
||||
|
||||
if ($_SESSION['plaConfig']->GetValue('appearance','show_hints'))
|
||||
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'));
|
||||
|
||||
echo '</center>';
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/create.php,v 1.48 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/create.php,v 1.48.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Creates a new object.
|
||||
@@ -21,16 +21,16 @@ require './common.php';
|
||||
if ($ldapserver->isReadOnly())
|
||||
pla_error(_('You cannot perform updates while server is in read-only mode'), null, -1, true);
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('entry_create'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_create'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('create entry')));
|
||||
|
||||
$rdn_attr = isset($_POST['rdn_attribute']) ? $_POST['rdn_attribute'] : null;
|
||||
|
||||
$entryfactoryclass = $_SESSION['plaConfig']->GetValue('appearance','entry_factory');
|
||||
$entryfactoryclass = $_SESSION[APPCONFIG]->GetValue('appearance','entry_factory');
|
||||
eval('$entry_factory = new '.$entryfactoryclass.'();');
|
||||
$entry = $entry_factory->newCreatingEntry('');
|
||||
|
||||
eval('$reader = new '.$_SESSION['plaConfig']->GetValue('appearance', 'entry_reader').'($ldapserver);');
|
||||
eval('$reader = new '.$_SESSION[APPCONFIG]->GetValue('appearance', 'entry_reader').'($ldapserver);');
|
||||
$entry->accept($reader);
|
||||
|
||||
$container = $entry->getContainer();
|
||||
@@ -94,7 +94,7 @@ if (run_hook('pre_entry_create',array('server_id'=>$ldapserver->server_id,'dn'=>
|
||||
if ($add_result) {
|
||||
run_hook('post_entry_create',array('server_id'=>$ldapserver->server_id,'dn'=>$new_dn,'attrs'=>$new_entry));
|
||||
|
||||
$action_number = $_SESSION['plaConfig']->GetValue('appearance', 'action_after_creation');
|
||||
$action_number = $_SESSION[APPCONFIG]->GetValue('appearance', 'action_after_creation');
|
||||
|
||||
$container = get_container($new_dn,false);
|
||||
//$container_container = get_container($container);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/css/style.css,v 1.48 2007/12/15 07:50:30 wurley Exp $ */
|
||||
/* $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/css/style.css,v 1.48.2.1 2007/12/24 06:41:51 wurley Exp $ */
|
||||
|
||||
/* Global Page */
|
||||
table.page {
|
||||
@@ -82,9 +82,13 @@ table.page table.control a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
table.page table.control tr td.spacer {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
table.page table.control tr td.logo {
|
||||
text-align: right;
|
||||
width: 20%;
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
table.control td.logo img.logo {
|
||||
@@ -706,6 +710,19 @@ table.login {
|
||||
background-color: #ddddff;
|
||||
}
|
||||
|
||||
#generic {
|
||||
background-color: #fafaff;
|
||||
padding-left: 17px;
|
||||
}
|
||||
#generic:focus {
|
||||
background-color: #ffffba;
|
||||
}
|
||||
|
||||
#generic:disabled {
|
||||
background-color: #ddddff;
|
||||
}
|
||||
|
||||
|
||||
/* Search Box */
|
||||
table.search {
|
||||
background-color: #eeeeff;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete.php,v 1.27 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete.php,v 1.27.2.2 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Deletes a DN and presents a "job's done" message.
|
||||
@@ -17,7 +17,7 @@ require './common.php';
|
||||
if ($ldapserver->isReadOnly())
|
||||
pla_error(_('You cannot perform updates while server is in read-only mode'));
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('entry_delete', 'simple_delete'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete', 'simple_delete'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete entry')));
|
||||
|
||||
$entry['dn'] = get_request('dn');
|
||||
@@ -43,7 +43,7 @@ if ($result) {
|
||||
'title'=>_('Delete DN'),
|
||||
'body'=>_('Successfully deleted DN ').sprintf('<b>%s</b>',$entry['dn']),
|
||||
'type'=>'info'),
|
||||
'index.php');
|
||||
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>'),
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_attr.php,v 1.16 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_attr.php,v 1.16.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Deletes an attribute from an entry with NO confirmation.
|
||||
@@ -17,7 +17,7 @@ require './common.php';
|
||||
if ($ldapserver->isReadOnly())
|
||||
pla_error(_('You cannot perform updates while server is in read-only mode'));
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('attribute_delete'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_delete'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete attribute')));
|
||||
|
||||
$entry['dn']['string'] = get_request('dn');
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/download_binary_attr.php,v 1.15 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/download_binary_attr.php,v 1.15.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* @package phpLDAPadmin
|
||||
@@ -25,7 +25,7 @@ $value_num = isset($_GET['value_num']) ? $_GET['value_num'] : null;
|
||||
if (! $ldapserver->dnExists($dn))
|
||||
pla_error(sprintf(_('No such entry: %s'),pretty_print_dn($dn)));
|
||||
|
||||
$search = $ldapserver->search(null,$dn,'(objectClass=*)',array($attr),'base',false,$_SESSION['plaConfig']->GetValue('deref','view'));
|
||||
$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();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/entry_chooser.php,v 1.31 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/entry_chooser.php,v 1.31.2.2 2007/12/29 08:24:10 wurley Exp $
|
||||
|
||||
/**
|
||||
* Display a selection (popup window) to pick a DN.
|
||||
@@ -40,12 +40,12 @@ if (isset($ldapserver) && ! is_null($entry['container'])) {
|
||||
if (! $ldapserver->haveAuthInfo())
|
||||
pla_error(_('Not enough information to login to server. Please check your configuration.'));
|
||||
|
||||
$entry['children'] = $ldapserver->getContainerContents($entry['container'],0,'(objectClass=*)',$_SESSION['plaConfig']->GetValue('deref','tree'));
|
||||
$entry['children'] = $ldapserver->getContainerContents($entry['container'],0,'(objectClass=*)',$_SESSION[APPCONFIG]->GetValue('deref','tree'));
|
||||
sort($entry['children']);
|
||||
|
||||
foreach ($ldapserver->getBaseDN() as $base_dn) {
|
||||
if (DEBUG_ENABLED)
|
||||
debug_log('entry_chooser.php: Comparing BaseDN [%s] with container [%s]',64,$base_dn,$entry['container']);
|
||||
debug_log('Comparing BaseDN [%s] with container [%s]',64,__FILE__,__LINE__,__METHOD__,$base_dn,$entry['container']);
|
||||
|
||||
if (! pla_compare_dns($entry['container'],$base_dn)) {
|
||||
$parent_container = false;
|
||||
@@ -85,9 +85,9 @@ if (isset($ldapserver) && ! is_null($entry['container'])) {
|
||||
|
||||
/* draw the root of the selection tree (ie, list all the servers) */
|
||||
} else {
|
||||
foreach ($_SESSION['plaConfig']->ldapservers->GetServerList() as $id) {
|
||||
foreach ($_SESSION[APPCONFIG]->ldapservers->GetServerList() as $id) {
|
||||
|
||||
$ldapserver = $_SESSION['plaConfig']->ldapservers->Instance($id);
|
||||
$ldapserver = $_SESSION[APPCONFIG]->ldapservers->Instance($id);
|
||||
|
||||
if ($ldapserver->isVisible()) {
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export.php,v 1.18 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export.php,v 1.18.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* @package phpLDAPadmin
|
||||
@@ -14,7 +14,7 @@ ini_set('session.cache_limiter','');
|
||||
|
||||
require LIBDIR.'export_functions.php';
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('export'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('export'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('export')));
|
||||
|
||||
$entry['base_dn'] = get_request('dn');
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/header.php,v 1.27 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/header.php,v 1.27.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* @package phpLDAPadmin
|
||||
@@ -9,7 +9,7 @@ require_once LIBDIR.'./common.php';
|
||||
|
||||
/* We want to get $language into scope in case we were included
|
||||
from within a function */
|
||||
$language = isset($_SESSION['plaConfig']) ? $language = $_SESSION['plaConfig']->GetValue('appearance','language') : 'auto';
|
||||
$language = isset($_SESSION[APPCONFIG]) ? $language = $_SESSION[APPCONFIG]->GetValue('appearance','language') : 'auto';
|
||||
|
||||
# text/xml won't work with MSIE, but is very useful for debugging xhtml code.
|
||||
# header('Content-type: text/xml; charset="UTF-8"');
|
||||
@@ -26,13 +26,13 @@ echo "\n\n";
|
||||
|
||||
echo '<head>';
|
||||
|
||||
if (isset($_SESSION['plaConfig']) && $pagetitle = $_SESSION['plaConfig']->GetValue('appearance','page_title'))
|
||||
if (isset($_SESSION[APPCONFIG]) && $pagetitle = $_SESSION[APPCONFIG]->GetValue('appearance','page_title'))
|
||||
printf('<title>phpLDAPadmin - %s</title>',$pagetitle);
|
||||
else
|
||||
echo '<title>phpLDAPadmin</title>';
|
||||
|
||||
if (isset($_SESSION['plaConfig']))
|
||||
$css = $_SESSION['plaConfig']->GetValue('appearance','stylesheet');
|
||||
if (isset($_SESSION[APPCONFIG]))
|
||||
$css = $_SESSION[APPCONFIG]->GetValue('appearance','stylesheet');
|
||||
else
|
||||
$css = 'style.css';
|
||||
printf('<link type="text/css" rel="stylesheet" href="%s%s" media="screen" />','../htdocs/'.CSSDIR,$css);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/index.php,v 1.49 2007/12/15 13:17:43 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/index.php,v 1.49.2.3 2007/12/30 02:06:15 wurley Exp $
|
||||
|
||||
/**
|
||||
* @package phpLDAPadmin
|
||||
@@ -14,9 +14,9 @@ PHP is not installed on your web server!!!
|
||||
</pre>
|
||||
*******************************************/
|
||||
|
||||
/*
|
||||
/**
|
||||
* We will perform some sanity checking here, since this file is normally loaded first when users
|
||||
* first setup PLA.
|
||||
* first access the application.
|
||||
*/
|
||||
define('LIBDIR',sprintf('%s/',realpath('../lib/')));
|
||||
ini_set('display_errors',1);
|
||||
@@ -33,64 +33,72 @@ if (! is_readable(LIBDIR.'functions.php')) {
|
||||
if (ob_get_level()) ob_end_clean();
|
||||
die(sprintf("Cannot read the file '<b>%sfunctions.php</b>' its permissions may be too strict.",LIBDIR));
|
||||
}
|
||||
if (ob_get_level()) ob_end_clean();
|
||||
|
||||
if (ob_get_level())
|
||||
ob_end_clean();
|
||||
|
||||
require LIBDIR.'functions.php';
|
||||
$config_file = CONFDIR.'config.php';
|
||||
|
||||
# Define the path to our configuration file.
|
||||
if (defined('CONFDIR'))
|
||||
$app['config_file'] = CONFDIR.'config.php';
|
||||
else
|
||||
$app['config_file'] = 'config.php';
|
||||
|
||||
# Make sure this PHP install has gettext, we use it for language translation
|
||||
if (! extension_loaded('gettext'))
|
||||
pla_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>');
|
||||
|
||||
/*
|
||||
/**
|
||||
* Helper functions.
|
||||
* Our required helper functions are defined in functions.php
|
||||
*/
|
||||
foreach ($pla_function_files as $file_name ) {
|
||||
if (! file_exists($file_name))
|
||||
pla_error(sprintf('Fatal error: Required file "%s" does not exist.',$file_name));
|
||||
if (isset($app['function_files']) && is_array($app['function_files']))
|
||||
foreach ($app['function_files'] as $file_name ) {
|
||||
if (! file_exists($file_name))
|
||||
pla_error(sprintf('Fatal error: Required file "%s" does not exist.',$file_name));
|
||||
|
||||
if (! is_readable($file_name))
|
||||
pla_error(sprintf('Fatal error: Cannot read the file "%s", its permissions may be too strict.',$file_name));
|
||||
if (! is_readable($file_name))
|
||||
pla_error(sprintf('Fatal error: Cannot read the file "%s", its permissions may be too strict.',$file_name));
|
||||
|
||||
ob_start();
|
||||
require $file_name;
|
||||
if (ob_get_level()) ob_end_clean();
|
||||
}
|
||||
ob_start();
|
||||
require $file_name;
|
||||
if (ob_get_level()) ob_end_clean();
|
||||
}
|
||||
|
||||
# Configuration File check
|
||||
if (! file_exists($config_file)) {
|
||||
if (! file_exists($app['config_file'])) {
|
||||
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"';
|
||||
echo '"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">';
|
||||
|
||||
echo '<html>';
|
||||
echo '<head>';
|
||||
printf('<title>phpLDAPadmin - %s</title>',pla_version());
|
||||
printf('<title>%s - %s</title>','phpLDAPadmin',pla_version());
|
||||
echo '<link type="text/css" rel="stylesheet" href="css/style.css" />';
|
||||
echo '</head>';
|
||||
|
||||
echo '<body>';
|
||||
echo '<h3 class="title">Configure phpLDAPadmin</h3>';
|
||||
printf('<h3 class="title">Configure %s</h3>','phpLDAPadmin');
|
||||
echo '<br /><br />';
|
||||
|
||||
echo '<center>';
|
||||
printf(_('You need to configure phpLDAPadmin. Edit the file "%s" to do so. An example config file is provided in "%s.example".'),$config_file,$config_file);
|
||||
printf(_('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']);
|
||||
echo '</center>';
|
||||
|
||||
echo '</body>';
|
||||
echo '</html>';
|
||||
die();
|
||||
|
||||
} elseif (! is_readable($config_file)) {
|
||||
pla_error(sprintf('Fatal error: Cannot read your configuration file "%s", its permissions may be too strict.',$config_file));
|
||||
} elseif (! is_readable($app['config_file'])) {
|
||||
pla_error(sprintf('Fatal error: Cannot read your configuration file "%s", its permissions may be too strict.',$app['config_file']));
|
||||
}
|
||||
|
||||
# If our config file fails the sanity check, then stop now.
|
||||
if (! check_config($config_file)) {
|
||||
$www = new page();
|
||||
$body = new block();
|
||||
$www->block_add('body',$body);
|
||||
$www->display();
|
||||
if (! check_config($app['config_file'])) {
|
||||
$www['page'] = new page();
|
||||
$www['body'] = new block();
|
||||
$www['page']->block_add('body',$www['body']);
|
||||
$www['page']->display();
|
||||
|
||||
exit;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import.php,v 1.35 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import.php,v 1.35.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Imports an LDIF file to the specified server_id.
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
require './common.php';
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('import'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('import'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('import')));
|
||||
|
||||
$entry['continuous_mode'] = get_request('continuous_mode') ? true : false;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login.php,v 1.56 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login.php,v 1.56.2.2 2007/12/29 08:24:10 wurley Exp $
|
||||
|
||||
/**
|
||||
* For servers whose auth_type is set to 'cookie' or 'session'. Pass me the
|
||||
@@ -13,30 +13,29 @@
|
||||
|
||||
require './common.php';
|
||||
|
||||
$dn = get_request('login_dn');
|
||||
$pass = get_request('login_pass');
|
||||
$uid = get_request('uid');
|
||||
$login['val'] = get_request($ldapserver->getLoginAttr());
|
||||
$login['pass'] = get_request('login_pass');
|
||||
|
||||
if ($ldapserver->isAnonBindAllowed())
|
||||
$anon_bind = get_request('anonymous_bind') == 'on' ? true : false;
|
||||
else
|
||||
$anon_bind = false;
|
||||
|
||||
if (! $anon_bind && ! strlen($pass))
|
||||
if (! $anon_bind && ! strlen($login['pass']))
|
||||
system_message(array(
|
||||
'title'=>_('Authenticate to server'),
|
||||
'body'=>_('You left the password blank.'),
|
||||
'type'=>'warn'),
|
||||
'cmd.php?cmd=login_form');
|
||||
sprintf('cmd.php?cmd=login_form&server_id=%s',$ldapserver->server_id));
|
||||
|
||||
$save_auth_type = $ldapserver->auth_type;
|
||||
|
||||
if ($anon_bind) {
|
||||
if (DEBUG_ENABLED)
|
||||
debug_log('Anonymous Login was posted [%s].',64,$anon_bind);
|
||||
debug_log('Anonymous Login was posted [%s].',64,__FILE__,__LINE__,__METHOD__,$anon_bind);
|
||||
|
||||
$dn = null;
|
||||
$pass = null;
|
||||
$login['dn'] = null;
|
||||
$login['pass'] = null;
|
||||
|
||||
/* Checks if the login_attr option is enabled for this host,
|
||||
which allows users to login with a simple username like 'jdoe' rather
|
||||
@@ -45,10 +44,10 @@ if ($anon_bind) {
|
||||
|
||||
# Is this a login string (printf-style)
|
||||
if ($ldapserver->isLoginStringEnabled()) {
|
||||
$dn = str_replace('<username>',$uid,$ldapserver->getLoginString());
|
||||
$login['dn'] = str_replace('<username>',$ldapserver->getLoginAttr(),$ldapserver->getLoginString());
|
||||
|
||||
if (DEBUG_ENABLED)
|
||||
debug_log('LoginStringDN: [%s]',64,$dn);
|
||||
debug_log('LoginStringDN: [%s]',64,__FILE__,__LINE__,__METHOD__,$login['dn']);
|
||||
|
||||
} else {
|
||||
# This is a standard login_attr
|
||||
@@ -63,36 +62,36 @@ if ($anon_bind) {
|
||||
$ldapserver->connect(true,'anonymous');
|
||||
|
||||
if (! empty($ldapserver->login_class))
|
||||
$filter = sprintf('(&(objectClass=%s)(%s=%s))',$ldapserver->login_class,$ldapserver->login_attr,$uid);
|
||||
$filter = sprintf('(&(objectClass=%s)(%s=%s))',$ldapserver->login_class,$ldapserver->getLoginAttr(),$login['val']);
|
||||
else
|
||||
$filter = sprintf('%s=%s',$ldapserver->login_attr,$uid);
|
||||
$filter = sprintf('%s=%s',$ldapserver->getLoginAttr(),$login['val']);
|
||||
|
||||
# Got through each of the BASE DNs and test the login.
|
||||
foreach ($ldapserver->getBaseDN() as $base_dn) {
|
||||
if (DEBUG_ENABLED)
|
||||
debug_log('Searching LDAP with base [%s]',64,$base_dn);
|
||||
debug_log('Searching LDAP with base [%s]',64,__FILE__,__LINE__,__METHOD__,$base_dn);
|
||||
|
||||
$result = $ldapserver->search(null,$base_dn,$filter,array('dn'));
|
||||
$result = array_pop($result);
|
||||
$dn = $result['dn'];
|
||||
$login['dn'] = $result['dn'];
|
||||
|
||||
if ($dn) {
|
||||
if ($login['dn']) {
|
||||
if (DEBUG_ENABLED)
|
||||
debug_log('Got DN [%s] for user ID [%s]',64,$dn,$uid);
|
||||
debug_log('Got DN [%s] for user ID [%s]',64,__FILE__,__LINE__,__METHOD__,$login['dn'],$login['val']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
# If we got here then we werent able to find a DN for the login filter.
|
||||
if (! $dn)
|
||||
if (! $login['dn'])
|
||||
if ($ldapserver->login_fallback_dn)
|
||||
$dn = $uid;
|
||||
$login['dn'] = $login['val'];
|
||||
else
|
||||
system_message(array(
|
||||
'title'=>_('Authenticate to server'),
|
||||
'body'=>_('Bad username or password. Please try again.'),
|
||||
'type'=>'error'),
|
||||
'cmd.php?cmd=login_form');
|
||||
sprintf('cmd.php?cmd=login_form&server_id=%s',$ldapserver->server_id));
|
||||
|
||||
# Restore the original auth_type
|
||||
$ldapserver->auth_type = $save_auth_type;
|
||||
@@ -101,32 +100,32 @@ if ($anon_bind) {
|
||||
|
||||
# We fake a 'config' server auth_type to omit duplicated code
|
||||
if (DEBUG_ENABLED)
|
||||
debug_log('Setting login type to CONFIG with DN [%s]',64,$dn);
|
||||
debug_log('Setting login type to CONFIG with DN [%s]',64,__FILE__,__LINE__,__METHOD__,$login['dn']);
|
||||
|
||||
$save_auth_type = $ldapserver->auth_type;
|
||||
$ldapserver->auth_type = 'config';
|
||||
$ldapserver->login_dn = $dn;
|
||||
$ldapserver->login_pass = $pass;
|
||||
$ldapserver->login_dn = $login['dn'];
|
||||
$ldapserver->login_pass = $login['pass'];
|
||||
|
||||
# Verify that dn is allowed to login
|
||||
if (! $ldapserver->userIsAllowedLogin($dn))
|
||||
if (! $ldapserver->userIsAllowedLogin($login['dn']))
|
||||
system_message(array(
|
||||
'title'=>_('Authenticate to server'),
|
||||
'body'=>_('Sorry, you are not allowed to use phpLDAPadmin with this LDAP server.'),
|
||||
'type'=>'error'),
|
||||
'cmd.php?cmd=login_form');
|
||||
sprintf('cmd.php?cmd=login_form&server_id=%s',$ldapserver->server_id));
|
||||
|
||||
if (DEBUG_ENABLED)
|
||||
debug_log('User is not prohibited from logging in - now bind with DN [%s]',64,$dn);
|
||||
debug_log('User is not prohibited from logging in - now bind with DN [%s]',64,__FILE__,__LINE__,__METHOD__,$login['dn']);
|
||||
|
||||
# Verify that the login is good
|
||||
if (is_null($dn) && is_null($pass))
|
||||
if (is_null($login['dn']) && is_null($login['pass']))
|
||||
$ds = $ldapserver->connect(false,'anonymous',true);
|
||||
else
|
||||
$ds = $ldapserver->connect(false,'user',true);
|
||||
|
||||
if (DEBUG_ENABLED)
|
||||
debug_log('Connection returned [%s]',64,$ds);
|
||||
debug_log('Connection returned [%s]',64,__FILE__,__LINE__,__METHOD__,$ds);
|
||||
|
||||
if (! is_resource($ds)) {
|
||||
if ($anon_bind)
|
||||
@@ -134,24 +133,24 @@ if (! is_resource($ds)) {
|
||||
'title'=>_('Authenticate to server'),
|
||||
'body'=>_('Could not bind anonymously to server.'),
|
||||
'type'=>'error'),
|
||||
'cmd.php?cmd=login_form');
|
||||
sprintf('cmd.php?cmd=login_form&server_id=%s',$ldapserver->server_id));
|
||||
|
||||
else
|
||||
system_message(array(
|
||||
'title'=>_('Authenticate to server'),
|
||||
'body'=>_('Bad username or password. Please try again.'),
|
||||
'type'=>'error'),
|
||||
'cmd.php?cmd=login_form');
|
||||
sprintf('cmd.php?cmd=login_form&server_id=%s',$ldapserver->server_id));
|
||||
|
||||
syslog_notice("Authentification FAILED for $dn");
|
||||
syslog_notice(sprintf('Authentification FAILED for %s',$login['dn']));
|
||||
}
|
||||
|
||||
$ldapserver->auth_type = $save_auth_type;
|
||||
$ldapserver->setLoginDN($dn,$pass,$anon_bind) or pla_error(_('Could not set cookie.'));
|
||||
$ldapserver->setLoginDN($login['dn'],$login['pass'],$anon_bind) or pla_error(_('Could not set cookie.'));
|
||||
set_lastactivity($ldapserver);
|
||||
|
||||
if (! $anon_bind) {
|
||||
syslog_notice("Authentification successful for $dn");
|
||||
syslog_notice(sprintf('Authentification successful for %s',$login['dn']));
|
||||
}
|
||||
|
||||
# Since we were successful, clear the cache so that it will be refreshed with the new creditentials.
|
||||
@@ -161,5 +160,5 @@ system_message(array(
|
||||
'title'=>_('Authenticate to server'),
|
||||
'body'=>_('Successfully logged into server.').($anon_bind ? sprintf(' (%s)',_('Anonymous Bind')) : ''),
|
||||
'type'=>'info'),
|
||||
'index.php');
|
||||
sprintf('index.php?server_id=%s',$ldapserver->server_id));
|
||||
?>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login_form.php,v 1.29 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/login_form.php,v 1.29.2.2 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Displays the login form for a server for users who specify 'cookie' or 'session' for their auth_type.
|
||||
@@ -42,11 +42,12 @@ if (isset($_GET['redirect']))
|
||||
echo '<center>';
|
||||
echo '<table class="login">';
|
||||
|
||||
printf('<tr><td><b>%s:</b></td></tr>',$ldapserver->isLoginAttrEnabled() ? _('Login Name') : _('Login DN'));
|
||||
printf('<tr><td><b>%s:</b></td></tr>',
|
||||
$ldapserver->login_attr == 'dn' ? _('Login DN') : $_SESSION[APPCONFIG]->getFriendlyName($ldapserver->login_attr));
|
||||
|
||||
printf('<tr><td><input type="text" id="pla_login" name="%s" size="40" value="%s" /></td></tr>',
|
||||
$ldapserver->isLoginAttrEnabled() ? 'uid' : 'login_dn',
|
||||
$ldapserver->isLoginAttrEnabled() ? '' : $ldapserver->login_dn);
|
||||
$ldapserver->login_attr,
|
||||
$ldapserver->login_attr == 'dn' ? $ldapserver->login_dn : '');
|
||||
|
||||
echo '<tr><td colspan=2> </td></tr>';
|
||||
printf('<tr><td><b>%s:</b></td></tr>',_('Password'));
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/logout.php,v 1.20 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/logout.php,v 1.20.2.1 2007/12/26 03:25:38 wurley Exp $
|
||||
|
||||
/**
|
||||
* For servers whose auth_type is set to 'cookie' or 'session'. Pass me
|
||||
@@ -33,5 +33,5 @@ system_message(array(
|
||||
'title'=>_('Logout'),
|
||||
'body'=>('Logged out successfully from server.'),
|
||||
'type'=>'info'),
|
||||
'index.php');
|
||||
sprintf('index.php?server_id=%s',$ldapserver->server_id));
|
||||
?>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/mass_delete.php,v 1.17 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/mass_delete.php,v 1.17.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Enables user to mass delete multiple entries using checkboxes.
|
||||
@@ -22,7 +22,7 @@ require './common.php';
|
||||
if( $ldapserver->isReadOnly() )
|
||||
pla_error(_('Unable to delete, server is in READY-ONLY mode.'));
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('entry_delete', 'mass_delete'))
|
||||
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')));
|
||||
|
||||
$confirmed = isset($_POST['confirmed']) ? true : false;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/modify_member_form.php,v 1.5 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/modify_member_form.php,v 1.5.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Displays a form to allow the user to modify group members.
|
||||
@@ -46,14 +46,14 @@ foreach ($ldapserver->getBaseDN() as $base_dn) {
|
||||
|
||||
# Get all entries that can be added to the group
|
||||
|
||||
if (preg_match("/^$attr$/i",$_SESSION['plaConfig']->GetValue('modify_member','posixgroupattr')))
|
||||
if (preg_match("/^$attr$/i",$_SESSION[APPCONFIG]->GetValue('modify_member','posixgroupattr')))
|
||||
$possible_values = array_merge($ldapserver->search(null,$base_dn,
|
||||
$_SESSION['plaConfig']->GetValue('modify_member','posixfilter'),
|
||||
array($_SESSION['plaConfig']->GetValue('modify_member','posixattr'))));
|
||||
$_SESSION[APPCONFIG]->GetValue('modify_member','posixfilter'),
|
||||
array($_SESSION[APPCONFIG]->GetValue('modify_member','posixattr'))));
|
||||
else
|
||||
$possible_values = array_merge($ldapserver->search(null,$base_dn,
|
||||
$_SESSION['plaConfig']->GetValue('modify_member','filter'),
|
||||
array($_SESSION['plaConfig']->GetValue('modify_member','attr'))));
|
||||
$_SESSION[APPCONFIG]->GetValue('modify_member','filter'),
|
||||
array($_SESSION[APPCONFIG]->GetValue('modify_member','attr'))));
|
||||
}
|
||||
|
||||
if ($possible_values)
|
||||
@@ -75,10 +75,10 @@ printf('%s <b>%s</b> %s <b>%s</b>:',
|
||||
_('There are'),$num_current_members,_('members in group'),htmlspecialchars($rdn));
|
||||
|
||||
for ($i=0; $i<count($possible_values); $i++) {
|
||||
if (preg_match("/^$attr$/i",$_SESSION['plaConfig']->GetValue('modify_member','posixgroupattr')))
|
||||
$possible_members[$i] = $possible_values[$i][$_SESSION['plaConfig']->GetValue('modify_member','posixattr')];
|
||||
if (preg_match("/^$attr$/i",$_SESSION[APPCONFIG]->GetValue('modify_member','posixgroupattr')))
|
||||
$possible_members[$i] = $possible_values[$i][$_SESSION[APPCONFIG]->GetValue('modify_member','posixattr')];
|
||||
else
|
||||
$possible_members[$i] = $possible_values[$i][$_SESSION['plaConfig']->GetValue('modify_member','attr')];
|
||||
$possible_members[$i] = $possible_values[$i][$_SESSION[APPCONFIG]->GetValue('modify_member','attr')];
|
||||
}
|
||||
|
||||
sort($possible_members);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/purge_cache.php,v 1.9 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/purge_cache.php,v 1.9.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* @package phpLDAPadmin
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
require './common.php';
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('purge'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('purge'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('purge')));
|
||||
|
||||
$purge_session_keys = array('cache');
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rdelete.php,v 1.28 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rdelete.php,v 1.28.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Recursively deletes the specified DN and all of its children
|
||||
@@ -17,7 +17,7 @@ require './common.php';
|
||||
if ($ldapserver->isReadOnly())
|
||||
pla_error(_('You cannot perform updates while server is in read-only mode'));
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('entry_delete', 'simple_delete'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete', 'simple_delete'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete entry')));
|
||||
|
||||
$entry['dn'] = $_POST['dn'];
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/refresh.php,v 1.18 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/refresh.php,v 1.18.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* This script alters the session variable 'tree', by re-querying
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
require './common.php';
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('server_refresh'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('server_refresh'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('refresh server')));
|
||||
|
||||
unset($_SESSION['cache'][$ldapserver->server_id]['tree']);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename.php,v 1.33 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename.php,v 1.33.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Renames a DN to a different name.
|
||||
@@ -20,7 +20,7 @@ require './common.php';
|
||||
if ($ldapserver->isReadOnly())
|
||||
pla_error(_('You cannot perform updates while server is in read-only mode'));
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('entry_rename'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_rename'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('rename entry')));
|
||||
|
||||
$dn = ($_POST['dn']);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/schema.php,v 1.67 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/schema.php,v 1.67.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Displays the schema for the specified server_id
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
require './common.php';
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('schema'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('schema'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('view schema')));
|
||||
|
||||
$entry['view'] = get_request('view','GET','false','objectClasses');
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/search.php,v 1.78 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/search.php,v 1.78.2.4 2007/12/29 08:24:10 wurley Exp $
|
||||
|
||||
/**
|
||||
* Perform LDAP searches and draw the advanced/simple search forms
|
||||
@@ -24,7 +24,7 @@ define('SIZE_LIMIT_EXCEEDED',4);
|
||||
$result_formats = array('list','table');
|
||||
|
||||
# Our incoming variables
|
||||
$entry['format'] = get_request('format','GET','false',$_SESSION['plaConfig']->GetValue('search','display'));
|
||||
$entry['format'] = get_request('format','GET','false',$_SESSION[APPCONFIG]->GetValue('search','display'));
|
||||
$entry['form'] = get_request('form','GET',false,get_request('form','SESSION'));
|
||||
|
||||
$entry['orderby']['raw'] = get_request('orderby','GET');
|
||||
@@ -81,9 +81,9 @@ if ($entry['base_dn']['string']) {
|
||||
printf('<script type="text/javascript" src="%ssearch_util.js"></script>','../htdocs/'.JSDIR);
|
||||
echo '<center>';
|
||||
|
||||
$entry['command']['as'] = $_SESSION['plaConfig']->isCommandAvailable('search','advanced_search');
|
||||
$entry['command']['ps'] = $_SESSION['plaConfig']->isCommandAvailable('search','predefined_search');
|
||||
$entry['command']['ss'] = $_SESSION['plaConfig']->isCommandAvailable('search','simple_search');
|
||||
$entry['command']['as'] = $_SESSION[APPCONFIG]->isCommandAvailable('search','advanced_search');
|
||||
$entry['command']['ps'] = $_SESSION[APPCONFIG]->isCommandAvailable('search','predefined_search');
|
||||
$entry['command']['ss'] = $_SESSION[APPCONFIG]->isCommandAvailable('search','simple_search');
|
||||
|
||||
if ($entry['form'] == 'advanced') {
|
||||
if ($entry['command']['as'])
|
||||
@@ -116,15 +116,15 @@ echo '<br />';
|
||||
|
||||
if ($entry['search']) {
|
||||
if ($entry['form'] == 'advanced') {
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('search','advanced_search'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('search','advanced_search'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('advanced search')));
|
||||
|
||||
} elseif ($entry['form'] == 'predefined') {
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('search','predefined_search'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('search','predefined_search'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('predefined search')));
|
||||
|
||||
} elseif ($entry['form'] == 'simple') {
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('search','simple_search'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('search','simple_search'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('simple search')));
|
||||
}
|
||||
|
||||
@@ -132,10 +132,10 @@ if ($entry['search']) {
|
||||
if ($entry['display'])
|
||||
$search_result_attributes = $entry['display']['array'];
|
||||
else
|
||||
$search_result_attributes = $_SESSION['plaConfig']->GetValue('search','result_attributes');
|
||||
$search_result_attributes = $_SESSION[APPCONFIG]->GetValue('search','result_attributes');
|
||||
|
||||
} else {
|
||||
$search_result_attributes = $_SESSION['plaConfig']->GetValue('search','result_attributes');
|
||||
$search_result_attributes = $_SESSION[APPCONFIG]->GetValue('search','result_attributes');
|
||||
}
|
||||
|
||||
# do we have enough authentication information for the specified server_id
|
||||
@@ -148,7 +148,7 @@ if ($entry['search']) {
|
||||
'title'=>_('Search'),
|
||||
'body'=>_('You have not logged into the selected server yet, so you cannot perform searches on it.'),
|
||||
'type'=>'warn'),
|
||||
'cmd.php?cmd=login_form');
|
||||
$login_url);
|
||||
}
|
||||
|
||||
if (is_numeric($entry['predefined'])) {
|
||||
@@ -214,14 +214,14 @@ if ($entry['search']) {
|
||||
'title'=>_('Unrecognized criteria option: ').htmlspecialchars($entry['criterion']),
|
||||
'body'=>_('If you want to add your own criteria to the list. Be sure to edit search.php to handle them. Quitting.'),
|
||||
'type'=>'warn'),
|
||||
'cmd.php?cmd=search');
|
||||
sprintf('cmd.php?cmd=search&server_id=%s',$ldapserver->server_id));
|
||||
}
|
||||
}
|
||||
|
||||
# prevent script from bailing early on a long delete
|
||||
@set_time_limit(0);
|
||||
|
||||
$size_limit = $_SESSION['plaConfig']->GetValue('search','size_limit');
|
||||
$size_limit = $_SESSION[APPCONFIG]->GetValue('search','size_limit');
|
||||
|
||||
# Sanity check
|
||||
if ($size_limit < 1)
|
||||
@@ -233,18 +233,18 @@ if ($entry['search']) {
|
||||
foreach ($base_dns as $base_dn) {
|
||||
if (! $ldapserver->dnExists($base_dn)) {
|
||||
if (DEBUG_ENABLED)
|
||||
debug_log('BaseDN [%s] skipped as it doesnt exist in [%s].',64,
|
||||
debug_log('BaseDN [%s] skipped as it doesnt exist in [%s].',64,__FILE__,__LINE__,__METHOD__,
|
||||
$base_dn,$ldapserver->server_id);
|
||||
|
||||
continue;
|
||||
|
||||
} else {
|
||||
if (DEBUG_ENABLED)
|
||||
debug_log('Search with base DN [%s]',64,$base_dn);
|
||||
debug_log('Search with base DN [%s]',64,__FILE__,__LINE__,__METHOD__,$base_dn);
|
||||
}
|
||||
|
||||
$results = $ldapserver->search(null,dn_escape($base_dn),$entry['filter']['clean'],$search_result_attributes,
|
||||
$entry['scope'],$entry['orderby']['array'],$_SESSION['plaConfig']->GetValue('deref','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());
|
||||
@@ -265,7 +265,7 @@ if ($entry['search']) {
|
||||
printf('<td>%s%s <b>%s</b> <small>(%s %s)</small></td>',_('Entries found'),_(':'),
|
||||
number_format($count),$time_elapsed,_('seconds'));
|
||||
|
||||
if ($_SESSION['plaConfig']->isCommandAvailable('export')) {
|
||||
if ($_SESSION[APPCONFIG]->isCommandAvailable('export')) {
|
||||
$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))));
|
||||
|
||||
@@ -290,7 +290,7 @@ if ($entry['search']) {
|
||||
|
||||
echo ' ]</small>';
|
||||
|
||||
if ($_SESSION['plaConfig']->isCommandAvailable('schema')) {
|
||||
if ($_SESSION[APPCONFIG]->isCommandAvailable('schema')) {
|
||||
echo '<br />';
|
||||
printf('<small>%s%s <b>%s</b></small>',_('Base DN'),_(':'),htmlspecialchars($base_dn));
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/server_info.php,v 1.27 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/server_info.php,v 1.27.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Fetches and displays all information that it can from the specified server
|
||||
@@ -12,7 +12,7 @@
|
||||
/**
|
||||
*/
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('server_info'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('server_info'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('view server informations')));
|
||||
|
||||
# The attributes we'll examine when searching the LDAP server's RootDSE
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/show_cache.php,v 1.3 2007/12/15 11:33:27 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/show_cache.php,v 1.3.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* This script shows the contents of the cache for debugging purposes
|
||||
@@ -21,7 +21,7 @@ if (isset($entry['index']) && isset($entry['key'])) {
|
||||
if ($entry['key'])
|
||||
debug_dump($_SESSION[$entry['key']],1);
|
||||
|
||||
if (! $_SESSION['plaConfig']->GetValue('appearance','hide_debug_info')) {
|
||||
if (! $_SESSION[APPCONFIG]->GetValue('appearance','hide_debug_info')) {
|
||||
echo '<div style="font-size: 11px"><ul>';
|
||||
foreach (array_keys($_SESSION) as $key) {
|
||||
if (($key == 'cache') && is_array($_SESSION[$key]))
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/template_engine.php,v 1.45 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/template_engine.php,v 1.45.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Template render engine.
|
||||
@@ -41,10 +41,10 @@ if ($entry['dn']['string']) {
|
||||
}
|
||||
|
||||
if ($entry['dn']['tree']) {
|
||||
eval('$reader = new '.$_SESSION['plaConfig']->GetValue('appearance', 'entry_reader').'($ldapserver);');
|
||||
eval('$reader = new '.$_SESSION[APPCONFIG]->GetValue('appearance', 'entry_reader').'($ldapserver);');
|
||||
$entry['dn']['tree']->accept($reader);
|
||||
|
||||
eval('$writer = new '.$_SESSION['plaConfig']->GetValue('appearance', 'entry_writer').'($ldapserver);');
|
||||
eval('$writer = new '.$_SESSION[APPCONFIG]->GetValue('appearance', 'entry_writer').'($ldapserver);');
|
||||
$entry['dn']['tree']->accept($writer);
|
||||
}
|
||||
}
|
||||
@@ -54,16 +54,16 @@ if ($entry['dn']['string']) {
|
||||
pla_error(_('You cannot perform updates while server is in read-only mode'));
|
||||
|
||||
# Create a new empty entry
|
||||
$entryfactoryclass = $_SESSION['plaConfig']->GetValue('appearance','entry_factory');
|
||||
$entryfactoryclass = $_SESSION[APPCONFIG]->GetValue('appearance','entry_factory');
|
||||
eval('$entry_factory = new '.$entryfactoryclass.'();');
|
||||
$entry['dn']['tree'] = $entry_factory->newCreatingEntry('');
|
||||
|
||||
# Init the entry with incoming data
|
||||
eval('$reader = new '.$_SESSION['plaConfig']->GetValue('appearance', 'entry_reader').'($ldapserver);');
|
||||
eval('$reader = new '.$_SESSION[APPCONFIG]->GetValue('appearance', 'entry_reader').'($ldapserver);');
|
||||
$entry['dn']['tree']->accept($reader);
|
||||
|
||||
# Display the creating entry
|
||||
eval('$writer = new '.$_SESSION['plaConfig']->GetValue('appearance', 'entry_writer').'($ldapserver);');
|
||||
eval('$writer = new '.$_SESSION[APPCONFIG]->GetValue('appearance', 'entry_writer').'($ldapserver);');
|
||||
$entry['dn']['tree']->accept($writer);
|
||||
}
|
||||
?>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update.php,v 1.29 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update.php,v 1.29.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Updates or deletes a value from a specified attribute for a specified dn.
|
||||
@@ -57,13 +57,13 @@ foreach ($entry['update'] as $attr => $val) {
|
||||
} elseif ($val == '') {
|
||||
$entry['update'][$attr] = array();
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('attribute_delete'))
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_delete'))
|
||||
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete attribute')));
|
||||
} else { # Skip change
|
||||
$entry['update'][$attr] = $val;
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('attribute_add_value')
|
||||
&& ! $_SESSION['plaConfig']->isCommandAvailable('attribute_delete_value'))
|
||||
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')));
|
||||
}
|
||||
|
||||
@@ -75,8 +75,8 @@ foreach ($entry['update'] as $attr => $val) {
|
||||
foreach ($val as $i => $v)
|
||||
$entry['update'][$attr][$i] = $v;
|
||||
|
||||
if (! $_SESSION['plaConfig']->isCommandAvailable('attribute_add_value')
|
||||
&& ! $_SESSION['plaConfig']->isCommandAvailable('attribute_delete_value'))
|
||||
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')));
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update_confirm.php,v 1.49 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/update_confirm.php,v 1.49.2.2 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* Takes the results of clicking "Save" in template_engine.php and determines which
|
||||
@@ -61,7 +61,7 @@ foreach ($entry['ldap']->getAttributes() as $old_attr) {
|
||||
/* new values */
|
||||
/***************/
|
||||
|
||||
eval('$reader = new '.$_SESSION['plaConfig']->GetValue('appearance','entry_reader').'($ldapserver);');
|
||||
eval('$reader = new '.$_SESSION[APPCONFIG]->GetValue('appearance','entry_reader').'($ldapserver);');
|
||||
$entry['ldap']->accept($reader);
|
||||
|
||||
$entry['values']['new'] = array();
|
||||
@@ -171,7 +171,7 @@ if (isset($entry['values']['new']['objectClass'])) {
|
||||
/* update array */
|
||||
/****************/
|
||||
|
||||
eval('$writer = new '.$_SESSION['plaConfig']->GetValue('appearance','entry_writer').'($ldapserver);');
|
||||
eval('$writer = new '.$_SESSION[APPCONFIG]->GetValue('appearance','entry_writer').'($ldapserver);');
|
||||
$writer->draw('Title',$entry['ldap']);
|
||||
$writer->draw('Subtitle',$entry['ldap']);
|
||||
|
||||
@@ -204,18 +204,12 @@ if (count($entry['values']['new']) > 0) {
|
||||
echo "\n\n";
|
||||
$counter = 0;
|
||||
|
||||
$friendly_attrs = $_SESSION['plaConfig']->friendly_attrs;
|
||||
foreach ($entry['values']['new'] as $attr => $new_val) {
|
||||
$counter++;
|
||||
|
||||
printf('<tr class="%s">',$counter%2 ? 'even' : 'odd');
|
||||
echo '<td><b>';
|
||||
$attr_display = isset($friendly_attrs[strtolower($attr)]) ? $friendly_attrs[strtolower($attr)] : $attr;
|
||||
if (strcmp($attr,$attr_display) && $_SESSION['plaConfig']->isCommandAvailable('schema')) {
|
||||
printf('<acronym title="Alias for %s">%s</acronym>',$attr,htmlspecialchars($attr_display));
|
||||
} else {
|
||||
echo htmlspecialchars($attr_display);
|
||||
}
|
||||
echo $_SESSION[APPCONFIG]->getFriendlyHTML($attr);
|
||||
echo '</b></td>';
|
||||
echo '<td><span style="white-space: nowrap;">';
|
||||
|
||||
@@ -329,12 +323,7 @@ if (count($entry['values']['new']) > 0) {
|
||||
$i = 0;
|
||||
foreach ($attr_to_delete as $attr) {
|
||||
if ($i++ != 0) echo '</b>, <b>';
|
||||
$attr_display = isset($friendly_attrs[strtolower($attr)]) ? $friendly_attrs[strtolower($attr)] : $attr;
|
||||
if (strcmp($attr,$attr_display) && $_SESSION['plaConfig']->isCommandAvailable('schema')) {
|
||||
printf('<acronym title="Alias for %s">%s</acronym>',$attr,htmlspecialchars($attr_display));
|
||||
} else {
|
||||
echo htmlspecialchars($attr_display);
|
||||
}
|
||||
echo $_SESSION[APPCONFIG]->getFriendlyHTML($attr);
|
||||
}
|
||||
echo '</b></td></tr></table>';
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/view_jpeg_photo.php,v 1.11 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/view_jpeg_photo.php,v 1.11.2.1 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* @package phpLDAPadmin
|
||||
@@ -20,7 +20,7 @@ if (! preg_match('/^pla/',$file['name']) || preg_match('/[\.\/\\\\]/',$file['nam
|
||||
/* 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['plaConfig']->GetValue('jpeg','tmpdir'),$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'])));
|
||||
|
||||
|
@@ -1,38 +1,36 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/welcome.php,v 1.26 2007/12/15 07:50:30 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/welcome.php,v 1.26.2.2 2007/12/26 09:26:32 wurley Exp $
|
||||
|
||||
/**
|
||||
* @package phpLDAPadmin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Show a simple welcome page.
|
||||
*/
|
||||
|
||||
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="images/logo.jpg" title="%s" alt="%s" />',_('phpLDAPadmin logo'),_('phpLDAPadmin logo'));
|
||||
echo '<br /><br />';
|
||||
echo _('Use the menu to the left to navigate');
|
||||
echo '<br /><br />';
|
||||
|
||||
$links = '';
|
||||
|
||||
if ($_SESSION['plaConfig']->isCommandAvailable('external_links')) {
|
||||
if ($_SESSION['plaConfig']->isCommandAvailable('external_links', 'credits')) {
|
||||
if ($_SESSION[APPCONFIG]->isCommandAvailable('external_links')) {
|
||||
if ($_SESSION[APPCONFIG]->isCommandAvailable('external_links', 'credits')) {
|
||||
$links .= sprintf('<a href="%s" target="new">%s</a>',get_href('credits'),_('Credits'));
|
||||
}
|
||||
|
||||
if ($_SESSION['plaConfig']->isCommandAvailable('external_links', 'help')) {
|
||||
if ($_SESSION[APPCONFIG]->isCommandAvailable('external_links', 'help')) {
|
||||
if ($links) $links .= ' | ';
|
||||
$links .= sprintf('<a href="%s" target="new">%s</a>',get_href('documentation'),_('Documentation'));
|
||||
}
|
||||
|
||||
if ($_SESSION['plaConfig']->isCommandAvailable('external_links', 'donation')) {
|
||||
if ($_SESSION[APPCONFIG]->isCommandAvailable('external_links', 'donation')) {
|
||||
if ($links) $links .= ' | ';
|
||||
$links .= sprintf('<a href="%s" target="new">%s</a>',get_href('donate'),_('Donate'));
|
||||
}
|
||||
|
Reference in New Issue
Block a user