~ubuntu-branches/debian/wheezy/phpldapadmin/wheezy

« back to all changes in this revision

Viewing changes to htdocs/rename_form.php

  • Committer: Bazaar Package Importer
  • Author(s): Fabio Tranchitella
  • Date: 2010-04-10 10:12:22 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100410101222-3xyuhy4a7usewxla
Tags: 1.2.0.5-1
* New upstream release. (Closes: #571672, #549464)
* debian/po/ru.po: added. (Closes: #536402)
* applied patch to fix lintian warnings. (Closes: #531649)
* Removed debian/patches that have been merged upstream.
* Do not build-depend anymore on dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
 
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rename_form.php,v 1.11.2.2 2008/12/12 12:20:22 wurley Exp $
3
 
 
4
2
/**
5
3
 * Displays a form for renaming an LDAP entry.
6
4
 *
7
 
 * Variables that come in via common.php
8
 
 *  - server_id
9
 
 * Variables that come in as GET vars:
10
 
 *  - dn (rawurlencoded)
11
 
 *
12
5
 * @package phpLDAPadmin
 
6
 * @subpackage Page
13
7
 */
 
8
 
14
9
/**
15
10
 */
16
11
 
17
12
require './common.php';
18
13
 
19
 
if ($ldapserver->isReadOnly())
20
 
        error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
21
 
if (! $ldapserver->haveAuthInfo())
22
 
        error(_('Not enough information to login to server. Please check your configuration.'),'error','index.php');
23
 
 
24
 
$dn = $_GET['dn'];
25
 
$rdn = get_rdn($dn);
26
 
 
27
 
printf('<h3 class="title">%s <b>%s</b></h3>',_('Rename Entry'),htmlspecialchars($rdn));
28
 
printf('<h3 class="subtitle">%s: <b>%s</b> &nbsp;&nbsp;&nbsp; %s: <b>%s</b></h3>',
29
 
        _('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars($dn));
30
 
 
31
 
echo '<br /><center><form action="cmd.php?cmd=rename" method="post" />';
32
 
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
33
 
printf('<input type="hidden" name="dn" value="%s" />',htmlspecialchars($dn));
34
 
printf('<input type="text" name="new_rdn" size="30" value="%s" />',htmlspecialchars($rdn));
 
14
# The DN we are working with
 
15
$request = array();
 
16
$request['dn'] = get_request('dn','GET');
 
17
$request['template'] = get_request('template','GET');
 
18
 
 
19
$request['page'] = new PageRender($app['server']->getIndex(),get_request('template','REQUEST',false,'none'));
 
20
$request['page']->setDN($request['dn']);
 
21
$request['page']->accept();
 
22
 
 
23
# Render the form
 
24
$request['page']->drawTitle(sprintf('%s <b>%s</b>',_('Rename'),get_rdn($request['dn'])));
 
25
$request['page']->drawSubTitle();
 
26
 
 
27
echo '<center>';
 
28
printf('%s <b>%s</b> %s:<br /><br />',_('Rename'),get_rdn($request['dn']),_('to a new object'));
 
29
 
 
30
echo '<form action="cmd.php?cmd=rename" method="post" />';
 
31
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
 
32
printf('<input type="hidden" name="dn" value="%s" />',rawurlencode($request['dn']));
 
33
printf('<input type="hidden" name="template" value="%s" />',$request['template']);
 
34
printf('<input type="text" name="new_rdn" size="30" value="%s" />',get_rdn($request['dn']));
35
35
printf('<input type="submit" value="%s" />',_('Rename'));
36
 
echo '</form></center>';
 
36
echo '</form>';
 
37
 
 
38
echo '</center>';
 
39
echo "\n";
37
40
?>