~ubuntu-branches/ubuntu/oneiric/phpldapadmin/oneiric-security

« back to all changes in this revision

Viewing changes to htdocs/delete_form.php

  • Committer: Bazaar Package Importer
  • Author(s): Fabio Tranchitella
  • Date: 2006-05-13 22:04:36 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060513220436-rasikdyi9diovfsf
Tags: 0.9.8.3-1
* New upstream release.
* Fixes multiple xss vulnerabilities. (Closes: #365313)
* pla_error: now the bug report button is really below the message.
  (Closes: #35722)
* The bug report form is not inside phpldapadmin: it is just a link
  to sourceforge. This is not a real bug, let's close it. (Closes: #357219)
* Standards-Version: 3.7.2, no changes necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
 
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_form.php,v 1.20.4.5 2005/12/11 08:21:03 wurley Exp $
 
2
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_form.php,v 1.20.4.6 2006/04/29 04:05:14 wurley Exp $
3
3
 
4
4
/**
5
5
 * delete_form.php
31
31
echo '<body>';
32
32
printf('<h3 class="title">'._('Delete %s').'</h3>',htmlspecialchars(get_rdn($dn)));
33
33
printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',
34
 
        _('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars(($dn)));
 
34
        _('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars($dn));
 
35
echo "\n";
 
36
 
 
37
echo '<center>';
35
38
 
36
39
if ($has_children) {
37
 
        echo '<center>';
38
40
        printf('<b>%s</b><br /><br />',_('Permanently delete all children also?'));
39
41
        flush();
40
42
 
41
43
        # get the total number of child objects (whole sub-tree)
42
44
        $s = $ldapserver->search(null,dn_escape($dn),'objectClass=*',array('dn'));
43
45
        $sub_tree_count = count($s);
 
46
 
 
47
        echo '<table class="delete_confirm">';
 
48
        echo '<tr>';
 
49
        echo '<td><p>';
 
50
        printf(_('This entry is the root of a sub-tree containing %s entries.'),$sub_tree_count);
 
51
        printf('<small>(<a href="search.php?search=true&amp;server_id=%s&amp;filter=%s&amp;base_dn=%s&amp;form=advanced&amp;scope=sub">%s</a>)</small>',
 
52
                $ldapserver->server_id,rawurlencode('objectClass=*'),rawurlencode($dn),_('view entries'));
 
53
        echo '<br /><br />';
 
54
 
 
55
        printf(_('phpLDAPadmin can recursively delete this entry and all %s of its children. See below for a list of all the entries that this action will delete. Do you want to do this?'),($sub_tree_count-1));
 
56
        echo '<br /><br />';
 
57
 
 
58
        printf('<small>%s</small>',
 
59
                _('Note: this is potentially very dangerous and you do this at your own risk. This operation cannot be undone. Take into consideration aliases, referrals, and other things that may cause problems.'));
 
60
        echo '<br /><br />';
 
61
        echo "\n";
 
62
 
 
63
        echo '<table width="100%">';
 
64
        echo '<tr>';
 
65
        echo '<td><center>';
 
66
        echo '<form action="rdelete.php" method="post">';
 
67
        printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($dn));
 
68
        printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
 
69
        printf('<input type="submit" class="scary" value="%s" />',sprintf(_('Delete all %s objects'),$sub_tree_count));
 
70
        echo '</form>';
 
71
        echo '</center></td>';
 
72
 
 
73
        echo '<td><center>';
 
74
        echo '<form action="template_engine.php" method="get">';
 
75
        printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($dn));
 
76
        printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
 
77
        printf('<input type="submit" name="submit" value="%s" class="cancel" />',_('Cancel'));
 
78
        echo '</form>';
 
79
        echo '</center></td>';
 
80
        echo '</tr>';
 
81
        echo '</table>';
 
82
        echo "\n";
 
83
 
 
84
        echo '</td>';
 
85
        echo '</tr>';
 
86
        echo '</table>';
 
87
        echo "\n";
 
88
 
 
89
        flush();
 
90
 
 
91
        echo '<br /><br />';
 
92
        echo _('List of entries to be deleted:');
 
93
        echo '<br />';
 
94
 
 
95
        printf('<select size="%s" multiple disabled style="background:white; color:black;width:500px" >',min(10,$sub_tree_count));
 
96
        $i=0;
 
97
        foreach ($s as $dn => $junk) {
 
98
                $i++;
 
99
                printf('<option>%s. %s</option>',$i,htmlspecialchars(dn_unescape($dn)));
 
100
        }
 
101
        echo '</select>';
 
102
        echo "\n";
 
103
 
 
104
} else {
 
105
        echo '<table class="delete_confirm">';
 
106
        echo '<tr>';
 
107
 
 
108
        echo '<td nowrap>';
 
109
        echo _('Are you sure you want to permanently delete this object?');
 
110
        echo '<br /><br />';
 
111
 
 
112
        printf('<acronym title="%s">%s</acronym>: <b>%s</b>',_('Distinguished Name'),_('DN'),pretty_print_dn($dn));
 
113
        echo '<br />';
 
114
        printf('%s: <b>%s</b>',_('Server'),htmlspecialchars($ldapserver->name));
 
115
        echo '<br /><br />';
 
116
        echo "\n";
 
117
 
 
118
        echo '<table width="100%">';
 
119
        echo '<tr>';
 
120
 
 
121
        echo '<td><center>';
 
122
        echo '<form action="delete.php" method="post">';
 
123
        printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($dn));
 
124
        printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
 
125
        printf('<input type="submit" name="submit" value="%s" class="scary" />',_('Delete'));
 
126
        echo '</form>';
 
127
 
 
128
        echo '</center></td>';
 
129
 
 
130
        echo '<td><center>';
 
131
        echo '<form action="template_engine.php" method="get">';
 
132
        printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($dn));
 
133
        printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
 
134
        printf('<input type="submit" name="submit" value="%s" class="cancel" />',_('Cancel'));
 
135
        echo '</form>';
 
136
 
 
137
        echo '</center></td>';
 
138
        echo '</tr>';
 
139
        echo '</table>';
 
140
        echo "\n";
 
141
 
 
142
        echo '</td>';
 
143
        echo '</tr>';
 
144
        echo '</table>';
 
145
        echo "\n";
 
146
 
 
147
}
 
148
 
 
149
echo '</center>';
 
150
echo '<br />';
 
151
echo '</body>';
 
152
echo '</html>';
44
153
?>
45
 
 
46
 
<table class="delete_confirm">
47
 
<tr>
48
 
        <td>
49
 
        <p>
50
 
        <?php printf(_('This entry is the root of a sub-tree containing %s entries.'),$sub_tree_count); ?>
51
 
        <small>(<a href="search.php?search=true&amp;server_id=<?php echo $ldapserver->server_id; ?>&amp;filter=<?php echo rawurlencode('objectClass=*'); ?>&amp;base_dn=<?php echo rawurlencode($dn); ?>&amp;form=advanced&amp;scope=sub"><?php echo _('view entries'); ?></a>)</small>
52
 
        <br />
53
 
        <br />
54
 
 
55
 
        <?php printf(_('phpLDAPadmin can recursively delete this entry and all %s of its children. See below for a list of all the entries that this action will delete. Do you want to do this?'),($sub_tree_count-1)); ?><br />
56
 
        <br />
57
 
        <small><?php echo _('Note: this is potentially very dangerous and you do this at your own risk. This operation cannot be undone. Take into consideration aliases, referrals, and other things that may cause problems.'); ?></small>
58
 
 
59
 
        <br />
60
 
        <br />
61
 
        <table width="100%">
62
 
        <tr>
63
 
                <td>
64
 
                <center>
65
 
                        <form action="rdelete.php" method="post">
66
 
                        <input type="hidden" name="dn" value="<?php echo $dn; ?>" />
67
 
                        <input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
68
 
                        <input type="submit" class="scary" value="<?php printf(_('Delete all %s objects'),$sub_tree_count); ?>" />
69
 
                        </form>
70
 
                </center>
71
 
                </td>
72
 
 
73
 
                <td>
74
 
                <center>
75
 
                        <form action="template_engine.php" method="get">
76
 
                        <input type="hidden" name="dn" value="<?php echo htmlspecialchars($dn); ?>" />
77
 
                        <input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
78
 
                        <input type="submit" name="submit" value="<?php echo _('Cancel'); ?>" class="cancel" />
79
 
                        </form>
80
 
                </center>
81
 
                </td>
82
 
        </tr>
83
 
        </table>
84
 
        </td>
85
 
</tr>
86
 
</table>
87
 
 
88
 
<?php flush(); ?>
89
 
<br />
90
 
<br />
91
 
<?php echo _('List of entries to be deleted:'); ?><br />
92
 
 
93
 
<select size="<?php echo min(10,$sub_tree_count);?>" multiple disabled style="background:white; color:black;width:500px" >
94
 
        <?php $i=0;
95
 
        foreach ($s as $dn => $junk) {
96
 
                $i++; ?>
97
 
 
98
 
        <option><?php echo $i; ?>. <?php echo htmlspecialchars((dn_unescape($dn))); ?></option>
99
 
        <?php } ?>
100
 
</select>
101
 
</center>
102
 
 
103
 
<br />
104
 
 
105
 
<?php } else { ?>
106
 
 
107
 
<center>
108
 
<table class="delete_confirm">
109
 
<tr>
110
 
        <td>
111
 
        <?php echo _('Are you sure you want to permanently delete this object?'); ?><br />
112
 
        <br />
113
 
        <nobr><acronym title="<?php echo _('Distinguished Name'); ?>"><?php echo _('DN'); ?></acronym>:  <b><?php echo pretty_print_dn($dn); ?></b></nobr><br />
114
 
        <nobr><?php echo _('Server'); ?>: <b><?php echo htmlspecialchars($ldapserver->name); ?></b></nobr><br />
115
 
        <br />
116
 
 
117
 
        <table width="100%">
118
 
        <tr>
119
 
                <td>
120
 
                        <center>
121
 
                        <form action="delete.php" method="post">
122
 
                        <input type="hidden" name="dn" value="<?php echo htmlspecialchars($dn); ?>" />
123
 
                        <input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
124
 
                        <input type="submit" name="submit" value="<?php echo _('Delete'); ?>" class="scary" />
125
 
                        </form>
126
 
                        </center>
127
 
                </td>
128
 
 
129
 
                <td>
130
 
                        <center>
131
 
                        <form action="template_engine.php" method="get">
132
 
                        <input type="hidden" name="dn" value="<?php echo $dn; ?>" />
133
 
                        <input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
134
 
                        <input type="submit" name="submit" value="<?php echo _('Cancel'); ?>" class="cancel" />
135
 
                        </form>
136
 
                        </center>
137
 
                </td>
138
 
        </tr>
139
 
        </table>
140
 
        </td>
141
 
</tr>
142
 
</table>
143
 
</center>
144
 
 
145
 
<?php } ?>
146
 
 
147
 
</body>
148
 
</html>