• Côme Chilliet's avatar
    :sparkles: feat(core) Big refactor of dialog system · 94eaa6ba
    Côme Chilliet authored
    This replaces save_object and execute methods by 3 methods:
    readPost - Reads POST data
    update - Update object state
    render - Render HTML UI
    
    The point is to avoid reading POST and rendering HTML when this is not
     needed (when doing stuff through the webservice for instance).
    
    It’s also more consisent across FD with all classes handling some kind
     of dialog implementing the new interface FusionDirectoryDialog which
     makes sure these 3 methods are implemented.
    
    issue #6072
    Unverified
    94eaa6ba
class_acl.inc 8.64 KiB
<?php
/*
  This code is part of FusionDirectory (http://www.fusiondirectory.org/)
  Copyright (C) 2003-2010  Cajus Pollmeier
  Copyright (C) 2011-2015  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_acl.inc
 * Source code for Class ACL
/*!
 * \brief This class contains all the function needed to manage acl
 * \see class_plugin
class acl extends plugin
  /* attribute list for save action */
  var $attributes     = array('gosaAclEntry');
  var $objectclasses  = array('gosaAcl');
  /* Helpers */
  var $dialogState      = "head";
  var $gosaAclEntry     = array();
  var $aclType          = "";
  var $aclObject        = "";
  var $aclContents      = array();
  var $aclFilter        = "";
  var $aclMyObjects     = array();
  var $roles            = array();
  var $recipients       = array();
  var $currentIndex     = 0;
  var $wasNewEntry      = FALSE;
  var $savedAclContents = array();
  var $acl_category     = "acl/";
  /*!
   * \brief Acl contructor
   * \param String $config Configuration file for ACL
   * \param String $parent
   * \param String $dn The DN
  function acl (&$config, $dn = NULL, $baseobject = NULL)
    /* Include config object */
    parent::__construct($config, $dn, $baseobject);
    /* Load ACL's */
    $this->gosaAclEntry = array();
    if (isset($this->attrs['gosaAclEntry'])) {
      for ($i = 0; $i < $this->attrs['gosaAclEntry']['count']; $i++) {
        $acl = $this->attrs['gosaAclEntry'][$i];