An error occurred while loading the file. Please try again.
-
Côme Bernigaud authoredb8d270f4
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2007 Fabian Hickert
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.
*/
/****************
* FUNCTIONS
Step_Migrate - Constructor.
update_strings - Used to update the displayed step informations.
initialize_checks - Initialize migration steps.
check_ldap_permissions - Check if the used admin account has full access to the ldap database.
check_gosaAccounts - Check if there are users without the required objectClasses.
migrate_gosaAccounts - Migrate selected users to FusionDirectory user accounts.
check_organizationalUnits - Check if there are departments, that are not visible for FusionDirectory
migrate_organizationalUnits - Migrate selected departments
check_administrativeAccount - Check if there is at least one acl entry available
get_user_list - Get list of available users
get_group_list - Get list of groups
create_admin
create_admin_user
execute - Generate html output of this plugin
save_object - Save posts
array_to_ldif - Create ldif output of an ldap result array
****************/
class Step_Migrate extends setup_step
{
var $languages = array();
var $attributes = array('valid_admin');
var $header_image = 'geticon.php?context=applications&icon=utilities-system-monitor&size=48';
var $checks = array();
/* Department migration attributes */
var $dep_migration_dialog = FALSE;
var $deps_to_migrate = array();
var $show_details = FALSE;
/* Department migration attributes */
var $users_migration_dialog = FALSE;
var $users_to_migrate = array();
/* Create Acl attributes */
var $acl_create_dialog = FALSE;
var $acl_create_selected = ""; // Currently selected element, that should receive admin rights
var $acl_create_changes = ""; // Contains ldif information about changes
var $acl_create_confirmed = FALSE;
/* Checks initialised ? */
var $checks_initialised = FALSE;
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
/* Users outside to people ou */
var $outside_users = array();
var $outside_users_dialog = FALSE;
/* Users outside to groups ou */
var $outside_groups = array();
var $outside_groups_dialog = FALSE;
/* Device migration */
var $device_dialog = FALSE;
var $device = array();
/* Service migration */
var $service_dialog = FALSE;
var $service = array();
/* Group menus */
var $menu_dialog = FALSE;
var $menu = array();
/* check for multiple use of same uidNumber */
var $check_uidNumbers = array();
var $check_uidNumbers_dialog = FALSE;
/* check for multiple use of same gidNumber */
var $check_gidNumbers = array();
var $check_gidNumbers_dialog = FALSE;
var $group_list = array();
/* Migrable users */
var $migrate_users = array();
var $acl_migrate_dialog = FALSE;
var $migrate_acl_base_entry = "";
/* Root object classes */
var $rootOC_migrate_dialog = FALSE;
var $rootOC_details = array();
/* One valid admin dn */
var $valid_admin = FALSE;
/* Defaults ACL roles */
var $defaultRoles;
function __construct()
{
$this->update_strings();
$this->fill_defaultRoles();
}
function update_strings()
{
$this->s_title = _("LDAP inspection");
$this->s_title_long = _("LDAP inspection");
$this->s_info = _("Analyze your current LDAP for FusionDirectory compatibility");
}
function fill_defaultRoles()
{
$this->defaultRoles = array(
array(
'cn' => 'manager',
'description' => _('Give all rights on users in the given branch'),
'objectclass' => array('top', 'gosaRole'),
'gosaAclTemplate' => '0:user/password;cmdrw,user/user;cmdrw,user/posixAccount;cmdrw'
),
array(
'cn' => 'editowninfos',