class_simplePlugin.inc 76.14 KiB
<?php
/*
  This code is part of FusionDirectory (http://www.fusiondirectory.org/)
  Copyright (C) 2012-2019  FusionDirectory
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
/*!
 * \file class_simplePlugin.inc
 * Source code for the class simplePlugin
/*! \brief This class is made for easy plugin creation for editing LDAP attributes
class simplePlugin implements SimpleTab
  /*! \brief This attribute store all information about attributes */
  public $attributesInfo;
  /*! \brief This attribute store references toward attributes
   * associative array that stores attributeLdapName => reference on object
  public $attributesAccess = [];
  /*!
    \brief Mark plugin as account
    Defines whether this plugin is defined as an account or not.
    This has consequences for the plugin to be saved from tab
    mode. If it is set to 'FALSE' the tab will call the delete
    function, else the save function. Should be set to 'TRUE' if
    the construtor detects a valid LDAP object.
    \sa simplePlugin::is_this_account()
  public $is_account            = FALSE;
  public $initially_was_account = FALSE;
  protected $ignore_account     = FALSE;
  public $acl_category = '';
  /*! \brief dn of the opened object */
  public $dn = '';
  /*! \brief original dn of the opened object */
  public $orig_dn = '';
  /*!
   * \brief Reference to parent object
   * This variable is used when the plugin is included in tabs
   * and keeps reference to the tab class. Communication to other
   * tabs is possible by 'name'. So the 'fax' plugin can ask the
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
* 'userinfo' plugin for the fax number. * * \sa simpleTabs */ public $parent = NULL; /*! \brief Mark plugin as template Defines whether we are editing a template or a normal object. Has consequences on the way execute() shows the formular and how save() puts the data to LDAP. */ public $is_template = FALSE; /*! \brief Represent temporary LDAP data This should only be used internally. */ public $attrs = []; /*! \brief The objectClasses set by this tab */ protected $objectclasses = []; /*! \brief The state of the attributes when we opened the object */ protected $saved_attributes = []; /*! \brief Do we want a header allowing to able/disable this plugin */ protected $displayHeader = FALSE; /*! \brief Is this plugin the main tab, the one that handle the object itself */ protected $mainTab = FALSE; protected $header = ""; protected $templatePath; protected $dialog = FALSE; /*! \brief Are we executed in a edit-mode environment? (this is FALSE if we're called from management, TRUE if we're called from a main.inc) */ protected $needEditMode = FALSE; /*! \brief Attributes that needs to be initialized before the others */ protected $preInitAttributes = []; /*! \brief FALSE to disable inheritance. Array like array ('objectClass' => 'attribute') to specify oc of the groups it might be inherited from */ protected $inheritance = FALSE; protected $member_of_group = FALSE; protected $editing_group = NULL; protected $group_attrs = []; /*! \brief Used when the entry is opened as "readonly" due to locks */ protected $read_only = FALSE; /*! \brief Last LDAP error (used by logging calls from post_* methods) */ protected $ldap_error; /*! * \brief Object entry CSN * * If an entry was edited while we have edited the entry too, * an error message will be shown. * To configure this check correctly read the FAQ. */ protected $entryCSN = ''; private $hadSubobjects = FALSE;