Fix the simple ACL configuration

This commit is contained in:
Deon George
2009-07-26 01:17:47 +10:00
parent 196aa00218
commit 5938302012
20 changed files with 134 additions and 234 deletions

View File

@@ -31,13 +31,6 @@ $request['template'] = $request['page']->getTemplate();
/*
if ($request['attribute']->isReadOnly())
error(sprintf(_('The attribute (%s) is in readonly mode.'),$request['attr']),'error','index.php');
# Check our permissions
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add_value'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('add attribute value')),'error','index.php');
if (($request['attribute']->getValueCount() == 0) && ! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('add attribute')),'error','index.php');
*/
# Render the form

View File

@@ -23,9 +23,6 @@ $ldap['SRC'] = $_SESSION[APPCONFIG]->getServer(get_request('server_id_src'));
$ldap['DST'] = $_SESSION[APPCONFIG]->getServer(get_request('server_id_dst'));
# Error checking
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_move'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('copy entry')),'error','index.php');
if (! trim($request['dnDST']))
error(_('You left the destination DN blank.'),'error','index.php');

View File

@@ -19,9 +19,6 @@ if (get_request('cancel','REQUEST')) {
die();
}
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_create'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('create entry')),'error','index.php');
$request = array();
$request['redirect'] = get_request('redirect','POST',false,false);

View File

@@ -13,9 +13,6 @@
require './common.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_create'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('create entry')),'error','index.php');
$request = array();
$request['redirect'] = get_request('redirect','POST',false,false);

View File

@@ -20,9 +20,6 @@ $request['dn'] = get_request('dn','REQUEST',true);
if (! $app['server']->dnExists($request['dn']))
error(sprintf('%s (%s)',_('No such entry.'),'<b>'.pretty_print_dn($request['dn']).'</b>'),'error','index.php');
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete','simple_delete'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('delete entry')),'error','index.php');
# Delete the entry.
$result = $app['server']->delete($request['dn']);

View File

@@ -13,9 +13,6 @@
require './common.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_delete'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('delete attribute')),'error','index.php');
$request = array();
$request['dn'] = get_request('dn','REQUEST',true);
$request['attr'] = get_request('attr','REQUEST',true);

View File

@@ -14,9 +14,6 @@
require './common.php';
require LIBDIR.'export_functions.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('export'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('export')),'error','index.php');
# Prevent script from bailing early for long search
@set_time_limit(0);

View File

@@ -14,9 +14,6 @@
require './common.php';
require LIBDIR.'import_functions.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('import'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('import')),'error','index.php');
$request = array();
$request['importer'] = new Importer($app['server']->getIndex(),'LDIF');
$request['import'] = $request['importer']->getTemplate();

View File

@@ -13,9 +13,6 @@
require './common.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete','simple_delete'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('delete entry')),'error','index.php');
$request = array();
$request['dn'] = get_request('dn','REQUEST',true);

View File

@@ -20,9 +20,6 @@ $request['rdnDST'] = get_request('new_rdn','REQUEST');
$request['container'] = $app['server']->getContainer($request['dnSRC']);
# Error checking
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_rename'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('rename entry')),'error','index.php');
if (! $app['server']->isBranchRenameEnabled()) {
# We search all children, not only the visible children in the tree
$children = $app['server']->getContainerContents($request['dnSRC'],null,0,'(objectClass=*)',LDAP_DEREF_NEVER);

View File

@@ -20,23 +20,10 @@ echo '<br /><br />';
echo _('Use the menu to the left to navigate');
echo '<br /><br />';
$links = '';
if ($_SESSION[APPCONFIG]->isCommandAvailable('external_links','credits'))
$links .= sprintf('<a href="%s" target="_blank">%s</a>',get_href('credits'),_('Credits'));
if ($_SESSION[APPCONFIG]->isCommandAvailable('external_links','help')) {
if ($links) $links .= ' | ';
$links .= sprintf('<a href="%s" target="_blank">%s</a>',get_href('documentation'),_('Documentation'));
}
if ($_SESSION[APPCONFIG]->isCommandAvailable('external_links','donation')) {
if ($links) $links .= ' | ';
$links .= sprintf('<a href="%s" target="_blank">%s</a>',get_href('donate'),_('Donate'));
}
if ($links) {
echo $links;
if ($_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks')) {
printf('<a href="%s" target="_blank">%s</a>',get_href('credits'),_('Credits'));
printf(' | <a href="%s" target="_blank">%s</a>',get_href('documentation'),_('Documentation'));
printf(' | <a href="%s" target="_blank">%s</a>',get_href('donate'),_('Donate'));
echo '<br /><br />';
}