HOR-3221 improvement

This commit is contained in:
Roly Rudy Gutierrez Pinto
2017-09-19 11:19:45 -04:00
parent 0df3a018c4
commit 59fc56265a
3 changed files with 281 additions and 318 deletions

View File

@@ -451,17 +451,24 @@ class RBAC
$plugin->sSystem = $this->sSystem;
//search the usersRolesObj
//create the users in ProcessMaker
try {
$res = $plugin->automaticRegister($aRow, $strUser, $strPass);
if ($res == 1) {
return $res;
}
} catch (Exception $e) {
$context = Bootstrap::getDefaultContextLog();
$context["action"] = "ldapSynchronize";
$context["authSource"] = $aRow;
Bootstrap::registerMonolog("ldapSynchronize", 400, $e->getMessage(), $context, $context["workspace"], "processmaker.log");
}
}
$oDataset->next();
$aRow = $oDataset->getRow();
}
}
}
return $result;
}
/**

View File

@@ -1180,7 +1180,7 @@ class LdapAdvanced
}
if ($validUserPass == 1) {
$this->log($ldapcnn, "sucessful login user " . $verifiedUser["sDN"]);
$this->log($ldapcnn, "sucessful login user " . $userDn);
} else {
$this->log($ldapcnn, "failure authentication for user $strUser");
}

View File

@@ -71,7 +71,7 @@ class ldapadvancedClassCron
foreach ($arrayAuthenticationSource as $value) {
$arrayAuthenticationSourceData = $value;
try {
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$arrayAuthenticationSourceData ---->\n" . print_r($arrayAuthenticationSourceData, true));
$plugin->sAuthSource = $arrayAuthenticationSourceData["AUTH_SOURCE_UID"];
@@ -141,17 +141,6 @@ class ldapadvancedClassCron
foreach ($aRegisteredDepts as $registeredDept) {
$count++;
//(D) Update Users
//if (!isset($arrayDepartmentUserAd[$registeredDept["DEP_UID"]])) {
// $arrayDepartmentUserAd[$registeredDept["DEP_UID"]] = array(); //Current users in department based in Active Directory
//}
//
//$arrayAux = $this->departmentSynchronizeUsers($plugin, $numDepartments, $count, $registeredDept);
//$arrayAux = array_merge($arrayDepartmentUserAd[$registeredDept["DEP_UID"]], $arrayAux);
//
//$arrayDepartmentUserAd[$registeredDept["DEP_UID"]] = array_unique($arrayAux);
$arrayAux = $this->departmentSynchronizeUsers($plugin, $numDepartments, $count, $registeredDept);
}
@@ -177,17 +166,6 @@ class ldapadvancedClassCron
foreach ($aRegisteredGroups as $registeredGroup) {
$count++;
//(G) Update Users
//if (!isset($arrayGroupUserAd[$registeredGroup["GRP_UID"]])) {
// $arrayGroupUserAd[$registeredGroup["GRP_UID"]] = array(); //Current users in group based in Active Directory
//}
//
//$arrayAux = $this->groupSynchronizeUsers($plugin, $numGroups, $count, $registeredGroup);
//$arrayAux = array_merge($arrayGroupUserAd[$registeredGroup["GRP_UID"]], $arrayAux);
//
//$arrayGroupUserAd[$registeredGroup["GRP_UID"]] = array_unique($arrayAux);
$arrayAux = $this->groupSynchronizeUsers($plugin, $numGroups, $count, $registeredGroup);
}
@@ -386,37 +364,15 @@ class ldapadvancedClassCron
//Update Users data based on the LDAP Server
$plugin->usersUpdateData($arrayAuthenticationSourceData["AUTH_SOURCE_UID"]);
} catch (Exception $e) {
$context = Bootstrap::getDefaultContextLog();
$context["action"] = "ldapSynchronize";
$context["authSource"] = $arrayAuthenticationSourceData;
Bootstrap::registerMonolog("ldapSynchronize", 400, $e->getMessage(), $context, $context["workspace"], "processmaker.log");
}
}
$plugin->frontEndShow("END");
//(D) Update Users
////Department //Upgrade users in departments
//foreach ($arrayDepartmentUserAd as $departmentUid => $arrayUserAd) {
// $plugin->setArrayDepartmentUsers($departmentUid); //INITIALIZE DATA
//
// $arrayAux = array_diff(array_keys($plugin->arrayDepartmentUsersByUid), $arrayUserAd);
//
// $this->departmentRemoveUsers($departmentUid, $arrayAux);
//}
//(G) Update Users
////Group //Upgrade users in groups
//foreach ($arrayGroupUserAd as $groupUid => $arrayUserAd) {
// $plugin->setArrayGroupUsers($groupUid); //INITIALIZE DATA
//
// $arrayAux = array_diff(array_keys($plugin->arrayGroupUsersByUid), $arrayUserAd);
//
// $this->groupRemoveUsers($groupUid, $arrayAux);
//}
//// Developed by Gary and Ronald
//$usersInfo = $plugin->ASUpdateInfo('');
//if (isset($usersInfo) && $usersInfo > 0) {
// $this->dMoved = $usersInfo;
//}
//// End Developed by Gary and Ronald
$plugin->debugLog("END");
}