diff --git a/gosa-core/setup/class_setupStep_Migrate.inc b/gosa-core/setup/class_setupStep_Migrate.inc
index 1001e877029a755c385754e8aa27b87176139405..7e45ca33e28fff923493f83bb731d1d925d16bbc 100644 (file)
*/
function check_uidNumber()
{
*/
function check_uidNumber()
{
+ /* Establish ldap connection */
$cv = $this->parent->captured_values;
$cv = $this->parent->captured_values;
- $ldap = new LDAP($cv['admin'],
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
$ldap->cd($cv['base']);
$res = $ldap->search("uidNumber=*",array("dn","uidNumber"));
if(!$res){
$ldap->cd($cv['base']);
$res = $ldap->search("uidNumber=*",array("dn","uidNumber"));
if(!$res){
*/
function check_gidNumber()
{
*/
function check_gidNumber()
{
+ /* Establish ldap connection */
$cv = $this->parent->captured_values;
$cv = $this->parent->captured_values;
- $ldap = new LDAP($cv['admin'],
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
$ldap->cd($cv['base']);
$res = $ldap->search("(&(objectClass=posixGroup)(gidNumber=*))",array("dn","gidNumber"));
if(!$res){
$ldap->cd($cv['base']);
$res = $ldap->search("(&(objectClass=posixGroup)(gidNumber=*))",array("dn","gidNumber"));
if(!$res){
*/
function search_outside_winstations()
{
*/
function search_outside_winstations()
{
+ /* Establish ldap connection */
$cv = $this->parent->captured_values;
$cv = $this->parent->captured_values;
- $ldap = new LDAP($cv['admin'],
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
/* Get winstation ou */
if($cv['generic_settings']['wws_ou_active']) {
$winstation_ou = $cv['generic_settings']['ws_ou'];
/* Get winstation ou */
if($cv['generic_settings']['wws_ou_active']) {
$winstation_ou = $cv['generic_settings']['ws_ou'];
*/
function search_outside_groups()
{
*/
function search_outside_groups()
{
+ /* Establish ldap connection */
$cv = $this->parent->captured_values;
$cv = $this->parent->captured_values;
- $ldap = new LDAP($cv['admin'],
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
$group_ou = $cv['groupou'];
$ldap->cd($cv['base']);
$group_ou = $cv['groupou'];
$ldap->cd($cv['base']);
*/
function search_outside_users()
{
*/
function search_outside_users()
{
+ /* Establish ldap connection */
$cv = $this->parent->captured_values;
$cv = $this->parent->captured_values;
- $ldap = new LDAP($cv['admin'],
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
$ldap->cd($cv['base']);
$ldap->cd($cv['base']);
*/
function check_ldap_permissions()
{
*/
function check_ldap_permissions()
{
+ /* Establish ldap connection */
$cv = $this->parent->captured_values;
$cv = $this->parent->captured_values;
- $ldap = new LDAP($cv['admin'],
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
/* Create dummy entry
*/
$name = "GOsa_setup_text_entry_".session_id().rand(0,999999);
/* Create dummy entry
*/
$name = "GOsa_setup_text_entry_".session_id().rand(0,999999);
$old = $this->users_to_migrate;
$this->users_to_migrate = array();
$old = $this->users_to_migrate;
$this->users_to_migrate = array();
- /* Get collected configuration settings */
- $cv = $this->parent->captured_values;
-
/* Establish ldap connection */
/* Establish ldap connection */
- $ldap = new LDAP($cv['admin'],
+ $cv = $this->parent->captured_values;
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
/* Get all invisible users
*/
$ldap->cd($cv['base']);
/* Get all invisible users
*/
$ldap->cd($cv['base']);
{
$this->show_details= $only_ldif;
{
$this->show_details= $only_ldif;
- /* Get collected configuration settings */
- $cv = $this->parent->captured_values;
-
/* Establish ldap connection */
/* Establish ldap connection */
- $ldap = new LDAP($cv['admin'],
+ $cv = $this->parent->captured_values;
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
/* Add gosaAccount objectClass to the selected users
*/
foreach($this->users_to_migrate as $key => $dep){
/* Add gosaAccount objectClass to the selected users
*/
foreach($this->users_to_migrate as $key => $dep){
$old = $this->deps_to_migrate;
$this->deps_to_migrate = array();
$old = $this->deps_to_migrate;
$this->deps_to_migrate = array();
- /* Get collected configuration settings */
- $cv = $this->parent->captured_values;
-
/* Establish ldap connection */
/* Establish ldap connection */
- $ldap = new LDAP($cv['admin'],
+ $cv = $this->parent->captured_values;
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
/* Skip GOsa internal departments */
$skip_dns = array("/".$cv['peopleou']."/","/".$cv['groupou']."/","/^ou=people,/","/^ou=groups,/",
"/(,|)ou=configs,/","/(,|)ou=systems,/",
/* Skip GOsa internal departments */
$skip_dns = array("/".$cv['peopleou']."/","/".$cv['groupou']."/","/^ou=people,/","/^ou=groups,/",
"/(,|)ou=configs,/","/(,|)ou=systems,/",
{
$this->show_details= $only_ldif;
{
$this->show_details= $only_ldif;
- /* Get collected configuration settings */
- $cv = $this->parent->captured_values;
-
/* Establish ldap connection */
/* Establish ldap connection */
- $ldap = new LDAP($cv['admin'],
+ $cv = $this->parent->captured_values;
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
/* Add gosaDepartment objectClass to each selected entry
*/
foreach($this->deps_to_migrate as $key => $dep){
/* Add gosaDepartment objectClass to each selected entry
*/
foreach($this->deps_to_migrate as $key => $dep){
{
/* Establish ldap connection */
$cv = $this->parent->captured_values;
{
/* Establish ldap connection */
$cv = $this->parent->captured_values;
- $ldap = new LDAP($cv['admin'],
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
- /* Search for gosaAcls */
+ $ldap = new ldapMultiplexer($ldap_l);
$ldap->cd($cv['base']);
$res = $ldap->cat($cv['base']);
$ldap->cd($cv['base']);
$res = $ldap->cat($cv['base']);
/* Get collected configuration settings */
$cv = $this->parent->captured_values;
/* Get collected configuration settings */
$cv = $this->parent->captured_values;
- /* Establish ldap connection */
- $ldap = new LDAP($cv['admin'],
+ /* On first call check for rid/sid base */
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
/* Get current base attributes */
$ldap->cd($cv['base']);
$ldap->cat($cv['base'],array("dn","objectClass","gosaAclEntry"));
$attrs = $ldap->fetch();
/* Add acls for the selcted user to the base */
/* Get current base attributes */
$ldap->cd($cv['base']);
$ldap->cat($cv['base'],array("dn","objectClass","gosaAclEntry"));
$attrs = $ldap->fetch();
/* Add acls for the selcted user to the base */
+ $attrs_new = array();
$attrs_new['objectClass'] = array("gosaACL");
for($i = 0; $i < $attrs['objectClass']['count']; $i ++){
$attrs_new['objectClass'] = array("gosaACL");
for($i = 0; $i < $attrs['objectClass']['count']; $i ++){
return false;
}
return false;
}
-
- /* Establish ldap connection */
+ /* On first call check for rid/sid base */
$cv = $this->parent->captured_values;
$cv = $this->parent->captured_values;
- $ldap = new LDAP($cv['admin'],
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
/* Get current base attributes */
$ldap->cd($cv['base']);
/* Get current base attributes */
$ldap->cd($cv['base']);
}
if($cv['peopledn'] == "cn"){
}
if($cv['peopledn'] == "cn"){
- $dn = "cn=System Administrator,".$people_ou.$cv['base'];
+ $dn = "cn=System Administrator-".$uid.",".$people_ou.$cv['base'];
}else{
$dn = "uid=".$uid.",".$people_ou.$cv['base'];
}
}else{
$dn = "uid=".$uid.",".$people_ou.$cv['base'];
}
- $methods = @passwordMethod::get_available_methods();
- $p_m = $methods[$cv['encryption']];
- $p_c = new $p_m(array());
- $hash = $p_c->generate_hash($pw2);
+ $hash = passwordMethod::make_hash($pw2, $cv['encryption']);
$new_user=array();
$new_user['objectClass']= array("top","person","gosaAccount","organizationalPerson","inetOrgPerson");
$new_user['givenName'] = "System";
$new_user['sn'] = "Administrator";
$new_user=array();
$new_user['objectClass']= array("top","person","gosaAccount","organizationalPerson","inetOrgPerson");
$new_user['givenName'] = "System";
$new_user['sn'] = "Administrator";
- $new_user['cn'] = "System Administrator";
+ $new_user['cn'] = "System Administrator-".$uid;
$new_user['uid'] = $uid;
$new_user['userPassword'] = $hash;
$new_user['uid'] = $uid;
$new_user['userPassword'] = $hash;
{
/* Establish ldap connection */
$cv = $this->parent->captured_values;
{
/* Establish ldap connection */
$cv = $this->parent->captured_values;
- $ldap = new LDAP($cv['admin'],
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
$ldap->cd($cv['base']);
/* Check if there was a destination department posted */
$ldap->cd($cv['base']);
/* Check if there was a destination department posted */
{
/* Establish ldap connection */
$cv = $this->parent->captured_values;
{
/* Establish ldap connection */
$cv = $this->parent->captured_values;
- $ldap = new LDAP($cv['admin'],
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
$ldap->cd($cv['base']);
/* Check if there was a destination department posted */
$ldap->cd($cv['base']);
/* Check if there was a destination department posted */
{
/* Establish ldap connection */
$cv = $this->parent->captured_values;
{
/* Establish ldap connection */
$cv = $this->parent->captured_values;
- $ldap = new LDAP($cv['admin'],
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
$ldap->cd($cv['base']);
/* Check if there was a destination department posted */
$ldap->cd($cv['base']);
/* Check if there was a destination department posted */
*/
function checkBase($just_check = TRUE)
{
*/
function checkBase($just_check = TRUE)
{
- /* Get collected setup informations */
- $cv = $this->parent->captured_values;
-
/* Establish ldap connection */
/* Establish ldap connection */
- $ldap = new LDAP($cv['admin'],
+ $cv = $this->parent->captured_values;
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
/* Check if root object exists */
$ldap->cd($cv['base']);
$res = $ldap->search("(objectClass=*)");
/* Check if root object exists */
$ldap->cd($cv['base']);
$res = $ldap->search("(objectClass=*)");
function get_user_list()
{
function get_user_list()
{
- /* Get collected configuration settings */
- $cv = $this->parent->captured_values;
-
/* Establish ldap connection */
/* Establish ldap connection */
- $ldap = new LDAP($cv['admin'],
+ $cv = $this->parent->captured_values;
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
-
+
+ $ldap = new ldapMultiplexer($ldap_l);
$ldap->cd($cv['base']);
$ldap->search("(objectClass=gosaAccount)",array("dn"));
$ldap->cd($cv['base']);
$ldap->search("(objectClass=gosaAccount)",array("dn"));
$people_ou = trim($cv['peopleou']);
/* Establish ldap connection */
$people_ou = trim($cv['peopleou']);
/* Establish ldap connection */
- $ldap = new LDAP($cv['admin'],
+ $cv = $this->parent->captured_values;
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
/*****************
* If people ou is NOT empty
/*****************
* If people ou is NOT empty
function get_all_winstation_ous()
{
function get_all_winstation_ous()
{
- /* Get collected configuration settings */
- $cv = $this->parent->captured_values;
-
/* Establish ldap connection */
/* Establish ldap connection */
- $ldap = new LDAP($cv['admin'],
+ $cv = $this->parent->captured_values;
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
/* Get winstation ou */
if($cv['generic_settings']['wws_ou_active']) {
$winstation_ou = $cv['generic_settings']['ws_ou'];
/* Get winstation ou */
if($cv['generic_settings']['wws_ou_active']) {
$winstation_ou = $cv['generic_settings']['ws_ou'];
function get_all_group_ous()
{
function get_all_group_ous()
{
- /* Get collected configuration settings */
- $cv = $this->parent->captured_values;
-
/* Establish ldap connection */
/* Establish ldap connection */
- $ldap = new LDAP($cv['admin'],
+ $cv = $this->parent->captured_values;
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
$group_ou = trim($cv['groupou']);
if(!empty($group_ou)){
$group_ou = trim($group_ou);
$group_ou = trim($cv['groupou']);
if(!empty($group_ou)){
$group_ou = trim($group_ou);
function get_group_list()
{
function get_group_list()
{
- /* Get collected configuration settings */
- $cv = $this->parent->captured_values;
-
/* Establish ldap connection */
/* Establish ldap connection */
- $ldap = new LDAP($cv['admin'],
+ $cv = $this->parent->captured_values;
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+
+ $ldap = new ldapMultiplexer($ldap_l);
$ldap->cd($cv['base']);
$ldap->search("(objectClass=posixGroup)",array("dn"));
$ldap->cd($cv['base']);
$ldap->search("(objectClass=posixGroup)",array("dn"));
function move($source,$destination)
{
function move($source,$destination)
{
- /* Get collected configuration settings */
- $cv = $this->parent->captured_values;
-
/* Establish ldap connection */
/* Establish ldap connection */
- $ldap = new LDAP($cv['admin'],
+ $cv = $this->parent->captured_values;
+ $ldap_l = new LDAP($cv['admin'],
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
$cv['password'],
$cv['connection'],
FALSE,
$cv['tls']);
+ $ldap = new ldapMultiplexer($ldap_l);
+
/* Update object references in gosaGroupOfNames */
$ogs_to_fix = array();
$ldap->cd($cv['base']);
/* Update object references in gosaGroupOfNames */
$ogs_to_fix = array();
$ldap->cd($cv['base']);