~ubuntu-branches/debian/sid/phpldapadmin/sid

« back to all changes in this revision

Viewing changes to htdocs/rdelete.php

  • Committer: Bazaar Package Importer
  • Author(s): Fabio Tranchitella
  • Date: 2009-03-16 14:54:15 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090316145415-7dsvj319dd02h83j
Tags: 1.1.0.6-1
* New upstream release. (Closes: #518578)
* debian/rules: removed "-m 644" from the dh_install call. (Closes: #518847)
* debian/postrm: remove config.php at purge time. (Closes: #519086)
* debian/patches/hungarian.dpatch: fixed a hungarian translation.
  (Closes: #505559)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
 
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rdelete.php,v 1.28.2.1 2007/12/26 09:26:32 wurley Exp $
 
2
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rdelete.php,v 1.28.2.3 2008/12/12 12:20:22 wurley Exp $
3
3
 
4
4
/**
5
5
 * Recursively deletes the specified DN and all of its children
15
15
require './common.php';
16
16
 
17
17
if ($ldapserver->isReadOnly())
18
 
        pla_error(_('You cannot perform updates while server is in read-only mode'));
19
 
 
20
 
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete', 'simple_delete'))
21
 
        pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete entry')));
22
 
 
23
 
$entry['dn'] = $_POST['dn'];
 
18
        error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
 
19
 
 
20
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete','simple_delete'))
 
21
        error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete entry')),'error','index.php');
 
22
 
 
23
$entry = array();
 
24
$entry['dn'] = get_request('dn');
24
25
if (! $entry['dn'])
25
 
        pla_error(_('You must specify a DN'));
 
26
        error(_('You must specify a DN'),'error','index.php');
26
27
 
27
28
if (! $ldapserver->dnExists($entry['dn']))
28
 
        pla_error(sprintf(_('No such entry: %s'),htmlspecialchars($entry['dn'])));
 
29
        error(sprintf('%s (%s)',_('No such entry.'),htmlspecialchars($entry['dn'])),'error','index.php');
29
30
 
30
31
printf('<h3 class="title">'._('Deleting %s').'</h3>',htmlspecialchars(get_rdn($entry['dn'])));
31
32
printf('<h3 class="subtitle">%s</h3>',_('Recursive delete progress'));
42
43
        printf(_('Entry %s and sub-tree deleted successfully.'),'<b>'.htmlspecialchars($entry['dn']).'</b>');
43
44
 
44
45
} else {
45
 
        pla_error(sprintf(_('Could not delete the entry: %s'),htmlspecialchars($entry['dn'])),
46
 
                $ldapserver->error(),$ldapserver->errno());
 
46
        system_message(array(
 
47
                'title'=>_('Could not delete the entry.').sprintf(' (%s)',pretty_print_dn($entry['dn'])),
 
48
                'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
 
49
                'type'=>'error'));
47
50
}
48
51
 
49
52
function pla_rdelete($ldapserver,$dn) {
60
63
                                return true;
61
64
 
62
65
                        } else {
63
 
                                pla_error(sprintf(_('Failed to delete entry %s'),htmlspecialchars($dn)),
64
 
                                        $ldapserver->error(),$ldapserver->errno());
 
66
                                system_message(array(
 
67
                                        'title'=>_('Could not delete the entry.').sprintf(' (%s)',pretty_print_dn($entry['dn'])),
 
68
                                        'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
 
69
                                        'type'=>'error'));
65
70
                        }
66
71
 
67
72
        } else {
77
82
                                return true;
78
83
 
79
84
                        } else {
80
 
                                pla_error(sprintf(_('Failed to delete entry %s'),htmlspecialchars($dn)),
81
 
                                        $ldapserver->error(),$ldapserver->errno());
 
85
                                system_message(array(
 
86
                                        'title'=>_('Could not delete the entry.').sprintf(' (%s)',pretty_print_dn($entry['dn'])),
 
87
                                        'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
 
88
                                        'type'=>'error'));
82
89
                        }
83
90
        }
84
91
}