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

« back to all changes in this revision

Viewing changes to lib/EntryWriter.php

  • Committer: Bazaar Package Importer
  • Author(s): Cody A.W. Somerville
  • Date: 2008-07-12 05:45:57 UTC
  • mfrom: (1.1.7 upstream) (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20080712054557-5u4hizg2b1u4f1f3
Tags: 1.1.0.5-3ubuntu1
* Merge from debian unstable. (closes lp: #192034)
  - dropped superflous removal of unused dpatch system and e-mailed 
     Debian maintainer to please make the change in Debian.
  - install groupOfNames template to templates/creation/ instead of
     templates/additional-templates/ so that users will be able to use it.
* Remaining Ubuntu changes:
  - debian/additional-templates/*:
    . added groupOfNames.xml (a commonly used object, see lp: #72779)
  - debian/rules:
    . added call to dh_install to install debian/additional-templates/* 
  - debian/control: Maintainer fields updated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
 
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/EntryWriter.php,v 1.2 2007/12/15 07:50:32 wurley Exp $
 
2
// $Header: /cvsroot/phpldapadmin/phpldapadmin/lib/EntryWriter.php,v 1.2.2.1 2008/01/27 06:48:59 wurley Exp $
3
3
 
4
4
define('ENTRY_WRITER_CREATION_CONTEXT', '1');
5
5
define('ENTRY_WRITER_EDITING_CONTEXT', '2');
13
13
 */
14
14
class EntryWriter extends Visitor {
15
15
        # Ldapserver from context
16
 
        protected $ldapserver;
 
16
        protected $index;
17
17
 
18
18
        # Context : creation or editing
19
19
        protected $context;
27
27
        protected $visit_attributes;
28
28
 
29
29
        public function __construct($ldapserver) {
30
 
                $this->ldapserver = $ldapserver;
 
30
                $this->index = $ldapserver->server_id;
31
31
                $this->visit_attributes = true;
32
32
                $this->context = 0;
33
33
        }
34
34
 
 
35
        public function getLDAPServer() {
 
36
                static $CACHE;
 
37
 
 
38
                if (! isset($CACHE[$this->index]))
 
39
                        $CACHE[$this->index] = $_SESSION[APPCONFIG]->ldapservers->Instance($this->index);
 
40
 
 
41
                return $CACHE[$this->index];
 
42
        }
 
43
 
35
44
        /**************************/
36
45
        /* Paint an Entry         */
37
46
        /**************************/