~ubuntu-branches/debian/jessie/phpldapadmin/jessie

« back to all changes in this revision

Viewing changes to htdocs/add_oclass.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/add_oclass.php,v 1.19 2007/12/15 07:50:30 wurley Exp $
 
2
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/add_oclass.php,v 1.19.2.1 2008/12/12 12:20:22 wurley Exp $
3
3
 
4
4
/**
5
5
 * Adds an objectClass to the specified dn.
20
20
require './common.php';
21
21
 
22
22
if ($ldapserver->isReadOnly())
23
 
        pla_error(_('You cannot perform updates while server is in read-only mode'));
 
23
        error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
24
24
 
25
25
if ($ldapserver->isAttrReadOnly('objectClass'))
26
 
        pla_error(_('ObjectClasses are flagged as read only in the phpLDAPadmin configuration.'));
 
26
        error(_('ObjectClasses are flagged as read only in the phpLDAPadmin configuration.'),'error','index.php');
27
27
 
 
28
$entry = array();
28
29
$entry['dn']['encode'] = get_request('dn');
29
30
$entry['dn']['string'] = urldecode($entry['dn']['encode']);
30
31
 
42
43
                        $href['search'] = htmlspecialchars(sprintf('cmd.php?cmd=search&search=true&form=advanced&server_id=%s&filter=%s=%s',
43
44
                                $ldapserver->server_id,$attr,$badattr));
44
45
 
45
 
                        pla_error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'),$attr,$badattr,$entry['dn']['string'],$href['search']));
 
46
                        error(sprintf(_('Your attempt to add <b>%s</b> (<i>%s</i>) to <br><b>%s</b><br> is NOT allowed. That attribute/value belongs to another entry.<p>You might like to <a href=\'%s\'>search</a> for that entry.'),$attr,$badattr,$entry['dn']['string'],$href['search']),'error','index.php');
46
47
                }
47
48
 
48
49
                $new_entry[$attr] = $val;
51
52
$result = $ldapserver->attrModify($entry['dn']['string'],$new_entry);
52
53
 
53
54
if (! $result)
54
 
        pla_error(_('Could not perform ldap_mod_add operation.'),$ldapserver->error(),$ldapserver->errno());
 
55
        system_message(array(
 
56
                'title'=>_('Could not perform ldap_mod_add operation.'),
 
57
                'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
 
58
                'type'=>'error'));
55
59
 
56
60
else {
57
61
        $modified_attrs = array_keys($entry['new']['attrs']);