Merged in paulis/processmaker/PM-1060 (pull request #2361)
PM-1060: LdapAdvanced Feature in core
This commit is contained in:
167
workflow/engine/bin/ldapcron.php
Normal file
167
workflow/engine/bin/ldapcron.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
try {
|
||||
//Set variables
|
||||
$osIsLinux = strtoupper(substr(PHP_OS, 0, 3)) != "WIN";
|
||||
|
||||
//Defines constants
|
||||
define("PATH_SEP", ($osIsLinux)? "/" : "\\");
|
||||
|
||||
$arrayPathToCron = array();
|
||||
$flagPathToCron = false;
|
||||
|
||||
if (!$flagPathToCron) {
|
||||
//Path to CRON by __FILE__
|
||||
$arrayAux = explode(PATH_SEP, str_replace("engine" . PATH_SEP . "bin", "", dirname(__FILE__)));
|
||||
|
||||
array_pop($arrayAux);
|
||||
|
||||
if (count($arrayAux) > 0 && $arrayAux[count($arrayAux) - 1] == "workflow") {
|
||||
$arrayPathToCron = $arrayAux;
|
||||
$flagPathToCron = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$flagPathToCron) {
|
||||
throw new Exception("Error: Unable to execute the LDAP Advanced CRON, the path is incorrect");
|
||||
}
|
||||
|
||||
$pathHome = implode(PATH_SEP, $arrayPathToCron) . PATH_SEP;
|
||||
|
||||
array_pop($arrayPathToCron);
|
||||
|
||||
$pathTrunk = implode(PATH_SEP, $arrayPathToCron) . PATH_SEP;
|
||||
|
||||
array_pop($arrayPathToCron);
|
||||
|
||||
$pathOutTrunk = implode(PATH_SEP, $arrayPathToCron) . PATH_SEP;
|
||||
|
||||
define("PATH_HOME", $pathHome);
|
||||
define("PATH_TRUNK", $pathTrunk);
|
||||
define("PATH_OUTTRUNK", $pathOutTrunk);
|
||||
|
||||
//Check deprecated files
|
||||
$fileBinDeprecated = PATH_HOME . "engine" . PATH_SEP . "bin" . PATH_SEP . "plugins" . PATH_SEP . "ldapadvanced.php";
|
||||
|
||||
if (file_exists($fileBinDeprecated)) {
|
||||
@unlink($fileBinDeprecated);
|
||||
|
||||
if (file_exists($fileBinDeprecated)) {
|
||||
throw new Exception("Error: LDAP Advanced CRON requires that the \"$fileBinDeprecated\" file has been deleted.");
|
||||
}
|
||||
}
|
||||
|
||||
//Include files
|
||||
require_once(PATH_HOME . "engine" . PATH_SEP . "config" . PATH_SEP . "paths.php");
|
||||
|
||||
G::LoadClass("system");
|
||||
|
||||
$config = System::getSystemConfiguration();
|
||||
|
||||
ini_set("date.timezone", $config["time_zone"]);
|
||||
|
||||
//CRON command options
|
||||
$arrayCommandOption = array(
|
||||
"force" => "+force",
|
||||
"debug" => "+debug"
|
||||
);
|
||||
|
||||
//CRON status
|
||||
$flagIsRunning = false;
|
||||
$lastExecution = "";
|
||||
$processcTimeProcess = 0;
|
||||
$processcTimeStart = 0;
|
||||
|
||||
$force = in_array($arrayCommandOption["force"], $argv);
|
||||
$debug = in_array($arrayCommandOption["debug"], $argv);
|
||||
|
||||
if (!$force && file_exists(PATH_DATA . "ldapcron")) {
|
||||
//Windows flag
|
||||
//Get data of CRON file
|
||||
$arrayCron = unserialize(trim(file_get_contents(PATH_DATA . "ldapcron")));
|
||||
|
||||
$flagIsRunning = (boolean)($arrayCron["flagIsRunning"]);
|
||||
$lastExecution = $arrayCron["lastExecution"];
|
||||
$processcTimeProcess = (isset($arrayCron["processcTimeProcess"]))? (int)($arrayCron["processcTimeProcess"]) : 10; //Minutes
|
||||
$processcTimeStart = (isset($arrayCron["processcTimeStart"]))? $arrayCron["processcTimeStart"] : 0;
|
||||
}
|
||||
|
||||
if (!$force && $osIsLinux) {
|
||||
//Linux flag
|
||||
//Check if CRON it's running
|
||||
exec("ps -fea | grep ldapcron.php | grep -v grep", $arrayOutput);
|
||||
|
||||
//This validation is when the CRON is called from a symlink
|
||||
$count = 0;
|
||||
|
||||
foreach ($arrayOutput as $value) {
|
||||
if (preg_match("/^.*ldapcron\.php.*$/", $value)) {
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($count > 1) {
|
||||
$flagIsRunning = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($force || !$flagIsRunning) {
|
||||
//Start CRON
|
||||
$arrayCron = array("flagIsRunning" => "1", "lastExecution" => date("Y-m-d H:i:s"));
|
||||
file_put_contents(PATH_DATA . "ldapcron", serialize($arrayCron));
|
||||
|
||||
try {
|
||||
$ldapCronSinglePath = PATH_HOME . "engine" . PATH_SEP . "bin" . PATH_SEP . "ldapcron_single.php";
|
||||
|
||||
$workspace = "";
|
||||
|
||||
for ($i = 1; $i <= count($argv) - 1; $i++) {
|
||||
if (preg_match("/^\+w(.+)$/", $argv[$i], $arrayMatch)) {
|
||||
$workspace = $arrayMatch[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$countw = 0;
|
||||
|
||||
if ($workspace == "") {
|
||||
$d = dir(PATH_DB);
|
||||
|
||||
while (($entry = $d->read()) !== false) {
|
||||
if ($entry != "" && $entry != "." && $entry != "..") {
|
||||
if (is_dir(PATH_DB . $entry)) {
|
||||
if (file_exists(PATH_DB . $entry . PATH_SEP . "db.php")) {
|
||||
$countw++;
|
||||
|
||||
passthru("php -f \"$ldapCronSinglePath\" " . (($debug)? 1 : 0) . " $entry \"" . base64_encode(PATH_HOME) . "\" \"" . base64_encode(PATH_TRUNK) . "\" \"" . base64_encode(PATH_OUTTRUNK) . "\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!is_dir(PATH_DB . $workspace) || !file_exists(PATH_DB . $workspace . PATH_SEP . "db.php")) {
|
||||
throw new Exception("Error: The workspace \"$workspace\" does not exist");
|
||||
}
|
||||
|
||||
$countw++;
|
||||
|
||||
passthru("php -f \"$ldapCronSinglePath\" " . (($debug)? 1 : 0) . " $workspace \"" . base64_encode(PATH_HOME) . "\" \"" . base64_encode(PATH_TRUNK) . "\" \"" . base64_encode(PATH_OUTTRUNK) . "\"");
|
||||
}
|
||||
|
||||
eprintln("Finished $countw workspaces processed");
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
//End CRON
|
||||
$arrayCron = array("flagIsRunning" => "0", "lastExecution" => date("Y-m-d H:i:s"));
|
||||
file_put_contents(PATH_DATA . "ldapcron", serialize($arrayCron));
|
||||
} else {
|
||||
eprintln("The LDAP Advanced CRON is running, please wait for it to finish\nStarted in $lastExecution");
|
||||
eprintln("If do you want force the execution use the option \"" . $arrayCommandOption["force"] . "\", example: php -f ldapcron.php +wworkflow " . $arrayCommandOption["force"] ,"green");
|
||||
}
|
||||
|
||||
echo "Done!\n";
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
489
workflow/engine/bin/ldapcron_single.php
Normal file
489
workflow/engine/bin/ldapcron_single.php
Normal file
File diff suppressed because it is too large
Load Diff
2963
workflow/engine/classes/class.ldapAdvanced.php
Executable file
2963
workflow/engine/classes/class.ldapAdvanced.php
Executable file
File diff suppressed because it is too large
Load Diff
@@ -197,6 +197,40 @@ class PMLicensedFeatures
|
||||
"type" => "features",
|
||||
"url" => "",
|
||||
"version" => ""
|
||||
),
|
||||
10 => array(
|
||||
"description" => "This plugin will synchronize ProcessMaker with an LDAP or Active Directory server for user authentication.",
|
||||
"enabled" => false,
|
||||
"id" => "ldapAdvanced",
|
||||
"latest_version" => "",
|
||||
"log" => null,
|
||||
"name" => "ldapAdvanced",
|
||||
"nick" => "ldapAdvanced",
|
||||
"progress" => 0,
|
||||
"publisher" => "Colosa",
|
||||
"release_type" => "localRegistry",
|
||||
"status" => "ready",
|
||||
"store" => "00000000000000000000000000010010",
|
||||
"type" => "features",
|
||||
"url" => "",
|
||||
"version" => ""
|
||||
),
|
||||
11 => array(
|
||||
"description" => "SSO with an LDAP provider.",
|
||||
"enabled" => false,
|
||||
"id" => "windowsSSO",
|
||||
"latest_version" => "",
|
||||
"log" => null,
|
||||
"name" => "windowsSSO",
|
||||
"nick" => "windowsSSO",
|
||||
"progress" => 0,
|
||||
"publisher" => "Colosa",
|
||||
"release_type" => "localRegistry",
|
||||
"status" => "ready",
|
||||
"store" => "00000000000000000000000000010011",
|
||||
"type" => "features",
|
||||
"url" => "",
|
||||
"version" => ""
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
61
workflow/engine/methods/authSources/authSourcesSynchronize.php
Executable file
61
workflow/engine/methods/authSources/authSourcesSynchronize.php
Executable file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* authSourcesSynchronize.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
**/
|
||||
|
||||
global $RBAC;
|
||||
|
||||
switch ($RBAC->userCanAccess("PM_USERS")) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage("ID_USER_HAVENT_RIGHTS_SYSTEM", "error", "labels");
|
||||
G::header("location: ../login/login");
|
||||
die;
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage("ID_USER_HAVENT_RIGHTS_PAGE", "error", "labels");
|
||||
G::header("location: ../login/login");
|
||||
die;
|
||||
break;
|
||||
case -3:
|
||||
G::SendTemporalMessage("ID_USER_HAVENT_RIGHTS_PAGE", "error", "labels");
|
||||
G::header("location: ../login/login");
|
||||
die;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST["tab"])) {
|
||||
$_REQUEST["tab"] = "synchronizeDepartments";
|
||||
}
|
||||
|
||||
$authenticationSource = array("AUTH_SOURCE_UID" => $_REQUEST["authUid"], "CURRENT_TAB" => ($_REQUEST["tab"] == "synchronizeDepartments" ? 0 : 1));
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript("authSources/authSourcesSynchronize", false);
|
||||
$oHeadPublisher->addContent("authSources/authSourcesSynchronize");
|
||||
$oHeadPublisher->assign("AUTHENTICATION_SOURCE", $authenticationSource);
|
||||
|
||||
global $G_PUBLISH;
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
G::RenderPage("publish", "extJs");
|
||||
|
||||
472
workflow/engine/methods/authSources/authSourcesSynchronizeAjax.php
Executable file
472
workflow/engine/methods/authSources/authSourcesSynchronizeAjax.php
Executable file
File diff suppressed because it is too large
Load Diff
@@ -158,17 +158,15 @@ try {
|
||||
if (($sObject != '.') && ($sObject != '..') && ($sObject != '.svn') && ($sObject != 'ldap')) {
|
||||
if (is_file( PATH_RBAC . 'plugins' . PATH_SEP . $sObject )) {
|
||||
$sType = trim(str_replace(array("class.", ".php"), "", $sObject));
|
||||
|
||||
$statusPlugin = $pluginRegistry->getStatusPlugin($sType);
|
||||
$flagAdd = false;
|
||||
|
||||
if (preg_match("/^(?:enabled|disabled)$/", $statusPlugin)) {
|
||||
if ($statusPlugin == "enabled") {
|
||||
$flagAdd = true;
|
||||
}
|
||||
} else {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (PMLicensedFeatures
|
||||
::getSingleton()
|
||||
->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=')) {
|
||||
$flagAdd = true;
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
if ($flagAdd) {
|
||||
$arr[] = array("sType" => $sType, "sLabel" => $sType);
|
||||
|
||||
@@ -83,17 +83,8 @@ if ($fields['AUTH_SOURCE_PROVIDER'] == 'ldap') {
|
||||
$oHeadPublisher->assign( 'sUID', $_GET['sUID'] );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
} else {
|
||||
if (file_exists( PATH_PLUGINS . $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) {
|
||||
$pluginEnabled = 0;
|
||||
|
||||
if (file_exists(PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . ".php")) {
|
||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$pluginDetail = $pluginRegistry->getPluginDetails($fields["AUTH_SOURCE_PROVIDER"] . ".php");
|
||||
|
||||
if ($pluginDetail && $pluginDetail->enabled) {
|
||||
$pluginEnabled = 1;
|
||||
}
|
||||
}
|
||||
if (file_exists( PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) {
|
||||
$pluginEnabled = 1;
|
||||
|
||||
if ($pluginEnabled == 1) {
|
||||
//The attributes the users
|
||||
@@ -110,17 +101,17 @@ if ($fields['AUTH_SOURCE_PROVIDER'] == 'ldap') {
|
||||
}
|
||||
|
||||
$fields["AUTH_SOURCE_ATTRIBUTE_IDS"] = $attributes;
|
||||
if (file_exists(PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . $fields["AUTH_SOURCE_PROVIDER"] . 'Flag')) {
|
||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Flag')) {
|
||||
$oHeadPublisher = & headPublisher::getSingleton ();
|
||||
|
||||
$oHeadPublisher->assign("Fields", $fields);
|
||||
$oHeadPublisher->addExtJsScript (PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . 'js' . PATH_SEP . 'library', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . 'js' . PATH_SEP . 'ldapAdvancedForm', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . 'js' . PATH_SEP . 'ldapAdvancedList', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/library', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/ldapAdvancedForm', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/ldapAdvancedList', false, true );
|
||||
G::RenderPage ('publish', 'extJs');
|
||||
die();
|
||||
}
|
||||
$G_PUBLISH->AddContent("xmlform", "xmlform", $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . $fields["AUTH_SOURCE_PROVIDER"] . "Edit", "", $fields, "../authSources/authSources_Save");
|
||||
$G_PUBLISH->AddContent("xmlform", "xmlform", 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
||||
} else {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => G::LoadTranslation( 'ID_AUTH_SOURCE_MISSING' )
|
||||
) );
|
||||
|
||||
@@ -33,16 +33,21 @@ G::LoadClass( 'configuration' );
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration( 'authSourcesList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'authSources/authSourcesList', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addExtJsScript( 'authSources/authSourcesList', false ); //adding a javascript file .js
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($licensedFeatures->verifyfeature('sywN09PSzh1MVdOajZBdnhMbFhCSnpNT1lLTEFwVklmOTE=')) {
|
||||
$oHeadPublisher->addExtJsScript( 'authSources/authSourcesListSyn', false ); //adding a javascript file .js
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$oHeadPublisher->addContent( 'authSources/authSourcesList' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||
$oHeadPublisher->assign( 'CONFIG', $Config );
|
||||
|
||||
@@ -37,19 +37,8 @@ $G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
$fields = array ('AUTH_SOURCE_PROVIDER' => $_REQUEST['AUTH_SOURCE_PROVIDER']);
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
if (file_exists( PATH_PLUGINS . $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) {
|
||||
$pluginEnabled = 0;
|
||||
|
||||
if (file_exists(PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . ".php")) {
|
||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$pluginDetail = $pluginRegistry->getPluginDetails($fields["AUTH_SOURCE_PROVIDER"] . ".php");
|
||||
|
||||
if ($pluginDetail && $pluginDetail->enabled) {
|
||||
$pluginEnabled = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists( PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) {
|
||||
$pluginEnabled = 1;
|
||||
if ($pluginEnabled == 1) {
|
||||
//The attributes the users
|
||||
G::LoadClass("pmFunctions");
|
||||
@@ -64,17 +53,17 @@ if (file_exists( PATH_PLUGINS . $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fi
|
||||
}
|
||||
}
|
||||
$fields["AUTH_SOURCE_ATTRIBUTE_IDS"] = $attributes;
|
||||
if (file_exists(PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . $fields["AUTH_SOURCE_PROVIDER"] . 'Flag')) {
|
||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Flag')) {
|
||||
$oHeadPublisher = & headPublisher::getSingleton ();
|
||||
|
||||
|
||||
$oHeadPublisher->assign("Fields", $fields);
|
||||
$oHeadPublisher->addExtJsScript (PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . 'js' . PATH_SEP . 'library', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . 'js' . PATH_SEP . 'ldapAdvancedForm', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . 'js' . PATH_SEP . 'ldapAdvancedList', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/library', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/ldapAdvancedForm', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/ldapAdvancedList', false, true );
|
||||
G::RenderPage ('publish', 'extJs');
|
||||
die();
|
||||
}
|
||||
$G_PUBLISH->AddContent("xmlform", "xmlform", $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . $fields["AUTH_SOURCE_PROVIDER"] . "Edit", "", $fields, "../authSources/authSources_Save");
|
||||
$G_PUBLISH->AddContent("xmlform", "xmlform", 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
||||
} else {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => G::LoadTranslation( 'ID_AUTH_SOURCE_MISSING' )) );
|
||||
}
|
||||
|
||||
@@ -35,20 +35,16 @@ $G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$fields = $RBAC->getAuthSource( $_GET['sUID'] );
|
||||
if (file_exists( PATH_PLUGINS . $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) {
|
||||
if (file_exists( PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) {
|
||||
$pluginEnabled = 0;
|
||||
|
||||
if (file_exists(PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . ".php")) {
|
||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$pluginDetail = $pluginRegistry->getPluginDetails($fields["AUTH_SOURCE_PROVIDER"] . ".php");
|
||||
|
||||
if ($pluginDetail && $pluginDetail->enabled) {
|
||||
$pluginEnabled = 1;
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('sywN09PSzh1MVdOajZBdnhMbFhCSnpNT1lLTEFwVklmOTE=')) {
|
||||
$pluginEnabled = 1;
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($pluginEnabled == 0) {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => G::LoadTranslation( 'ID_AUTH_SOURCE_MISSING' ) ) );
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => G::LoadTranslation( 'ID_AUTH_SOURCE_FEATURE_MISSING' ) ) );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
} else {
|
||||
G::LoadClass('configuration');
|
||||
@@ -61,12 +57,12 @@ if (file_exists( PATH_PLUGINS . $fields['AUTH_SOURCE_PROVIDER'] . PATH_SEP . $fi
|
||||
$oHeadPublisher->assign("FORMATS", $c->getFormats());
|
||||
$oHeadPublisher->assign("CONFIG", $Config);
|
||||
|
||||
if (file_exists(PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . $fields["AUTH_SOURCE_PROVIDER"] . 'Flag')) {
|
||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Flag')) {
|
||||
$oHeadPublisher = & headPublisher::getSingleton ();
|
||||
|
||||
$oHeadPublisher->assign("Fields", $fields);
|
||||
$oHeadPublisher->addExtJsScript (PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . 'js' . PATH_SEP . 'library', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_PLUGINS . $fields["AUTH_SOURCE_PROVIDER"] . PATH_SEP . 'js' . PATH_SEP . 'ldapAdvancedSearch', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/library', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/ldapAdvancedSearch', false, true );
|
||||
G::RenderPage ('publish', 'extJs');
|
||||
die();
|
||||
}
|
||||
|
||||
348
workflow/engine/methods/authSources/ldapAdvancedProxy.php
Executable file
348
workflow/engine/methods/authSources/ldapAdvancedProxy.php
Executable file
File diff suppressed because it is too large
Load Diff
651
workflow/engine/methods/services/ldapadvanced.php
Executable file
651
workflow/engine/methods/services/ldapadvanced.php
Executable file
File diff suppressed because it is too large
Load Diff
46
workflow/engine/templates/authSources/authSourcesListSyn.js
Normal file
46
workflow/engine/templates/authSources/authSourcesListSyn.js
Normal file
@@ -0,0 +1,46 @@
|
||||
var synchronizeDepartmentsLDAPADV = function() {
|
||||
iGrid = Ext.getCmp('infoGrid');
|
||||
rowSelected = iGrid.getSelectionModel().getSelected();
|
||||
if (rowSelected) {
|
||||
location.href = 'authSourcesSynchronize?authUid=' + rowSelected.data.AUTH_SOURCE_UID + '&tab=synchronizeDepartments';
|
||||
}
|
||||
};
|
||||
|
||||
var synchronizeGroupsLDAPADV = function() {
|
||||
iGrid = Ext.getCmp('infoGrid');
|
||||
rowSelected = iGrid.getSelectionModel().getSelected();
|
||||
if (rowSelected) {
|
||||
location.href = 'authSourcesSynchronize?authUid=' + rowSelected.data.AUTH_SOURCE_UID + '&tab=synchronizeGroups';
|
||||
}
|
||||
};
|
||||
|
||||
var synchronizeDepartmentsButtonLDAPADV = new Ext.Action({
|
||||
text: 'Synchronize Departments',
|
||||
iconCls: 'ICON_DEPARTAMENTS',
|
||||
disabled: true,
|
||||
handler: synchronizeDepartmentsLDAPADV
|
||||
});
|
||||
|
||||
var synchronizeGroupsButtonLDAPADV = new Ext.Action({
|
||||
text: 'Synchronize Groups',
|
||||
iconCls: 'ICON_GROUPS',
|
||||
disabled: true,
|
||||
handler: synchronizeGroupsLDAPADV
|
||||
});
|
||||
|
||||
var _rowselectLDAPADV = function(sm, index, record) {
|
||||
if (record.get('AUTH_SOURCE_PROVIDER') == 'ldapAdvanced') {
|
||||
synchronizeDepartmentsButtonLDAPADV.enable();
|
||||
synchronizeGroupsButtonLDAPADV.enable();
|
||||
}
|
||||
};
|
||||
|
||||
var _rowdeselectLDAPADV = function(sm, index, record) {
|
||||
synchronizeDepartmentsButtonLDAPADV.disable();
|
||||
synchronizeGroupsButtonLDAPADV.disable();
|
||||
};
|
||||
|
||||
_rowselect.push(_rowselectLDAPADV);
|
||||
_rowdeselect.push(_rowdeselectLDAPADV);
|
||||
_pluginActionButtons.push(synchronizeDepartmentsButtonLDAPADV);
|
||||
_pluginActionButtons.push(synchronizeGroupsButtonLDAPADV);
|
||||
3
workflow/engine/templates/authSources/authSourcesSynchronize.html
Executable file
3
workflow/engine/templates/authSources/authSourcesSynchronize.html
Executable file
@@ -0,0 +1,3 @@
|
||||
<div style="padding: 15px">
|
||||
<div id="list-panel"></div>
|
||||
</div>
|
||||
229
workflow/engine/templates/authSources/authSourcesSynchronize.js
Executable file
229
workflow/engine/templates/authSources/authSourcesSynchronize.js
Executable file
@@ -0,0 +1,229 @@
|
||||
var viewPort;
|
||||
var backButton;
|
||||
var northPanel;
|
||||
var tabsPanel;
|
||||
var departmentsPanel;
|
||||
var groupsPanel;
|
||||
var treeDepartments;
|
||||
var treeGroups;
|
||||
var isSaved = true;
|
||||
var isFirstTime = true;
|
||||
|
||||
Ext.onReady(function() {
|
||||
nodeChangeCheck = function (node, check)
|
||||
{
|
||||
if (node) {
|
||||
if (node.hasChildNodes()) {
|
||||
node.eachChild(function (n) { nodeChangeCheck(n, check); });
|
||||
}
|
||||
|
||||
//node.expand();
|
||||
node.getUI().toggleCheck(check);
|
||||
}
|
||||
}
|
||||
|
||||
nodeChangeCheckStart = function (node, check)
|
||||
{
|
||||
treeDepartments.removeListener("checkchange", nodeChangeCheckStart, this);
|
||||
|
||||
nodeChangeCheck(node, check);
|
||||
|
||||
treeDepartments.addListener("checkchange", nodeChangeCheckStart, this);
|
||||
}
|
||||
|
||||
try {
|
||||
Ext.Ajax.timeout = 300000;
|
||||
|
||||
backButton = new Ext.Action({
|
||||
text : _('ID_BACK'),
|
||||
iconCls: "button_menu_ext ss_sprite ss_arrow_left",
|
||||
handler: function() {
|
||||
location.href = '../authSources/authSources_List';
|
||||
}
|
||||
});
|
||||
|
||||
northPanel = new Ext.Panel({
|
||||
region: 'north',
|
||||
xtype: 'panel',
|
||||
tbar: ['<b>'+ 'Authentication Sources' + '</b>', {xtype: 'tbfill'}, backButton]
|
||||
});
|
||||
|
||||
treeDepartments = new Ext.tree.TreePanel({
|
||||
title: 'Departments List',
|
||||
defaults: {flex: 1},
|
||||
useArrows: true,
|
||||
autoScroll: true,
|
||||
animate: true,
|
||||
enableDD: true,
|
||||
containerScroll: true,
|
||||
rootVisible: false,
|
||||
frame: true,
|
||||
root: {
|
||||
nodeType: 'async'
|
||||
},
|
||||
maskDisabled: false,
|
||||
dataUrl: 'authSourcesSynchronizeAjax?m=loadDepartments&authUid=' + AUTHENTICATION_SOURCE.AUTH_SOURCE_UID,
|
||||
requestMethod: 'POST',
|
||||
buttons: [{
|
||||
text: 'Save Changes',
|
||||
handler: function() {
|
||||
isSaved = false;
|
||||
var msg = '', selNodes = treeDepartments.getChecked();
|
||||
treeDepartments.disabled = true;
|
||||
var departments = [];
|
||||
Ext.each(selNodes, function(node) {
|
||||
departments.push(node.id);
|
||||
});
|
||||
Ext.Ajax.request({
|
||||
url: 'authSourcesSynchronizeAjax',
|
||||
params: {m: 'saveDepartments', authUid: AUTHENTICATION_SOURCE.AUTH_SOURCE_UID, departmentsDN: departments.join('|')},
|
||||
success: function(r) {
|
||||
var response = Ext.util.JSON.decode(r.responseText);
|
||||
if (response.status == 'OK') {
|
||||
treeDepartments.getLoader().load(treeDepartments.root);
|
||||
}
|
||||
else {
|
||||
alert(response.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}],
|
||||
|
||||
listeners: {
|
||||
checkchange: nodeChangeCheckStart
|
||||
}
|
||||
});
|
||||
|
||||
treeDepartments.loader.on('load', function() {
|
||||
treeDepartments.getRootNode().expand(true);
|
||||
if (!isSaved) {
|
||||
isSaved = true;
|
||||
treeDepartments.disabled = false;
|
||||
Ext.Msg.show({
|
||||
title: 'Changes saved.',
|
||||
msg: 'All changes have been saved.',
|
||||
icon: Ext.Msg.INFO,
|
||||
minWidth: 200,
|
||||
buttons: Ext.Msg.OK
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
treeGroups = new Ext.tree.TreePanel({
|
||||
title: 'Groups List',
|
||||
defaults: {flex: 1},
|
||||
useArrows: true,
|
||||
autoScroll: true,
|
||||
animate: true,
|
||||
enableDD: true,
|
||||
containerScroll: true,
|
||||
rootVisible: false,
|
||||
frame: true,
|
||||
root: {
|
||||
nodeType: 'async'
|
||||
},
|
||||
dataUrl: 'authSourcesSynchronizeAjax?m=loadGroups&authUid=' + AUTHENTICATION_SOURCE.AUTH_SOURCE_UID,
|
||||
requestMethod: 'POST',
|
||||
buttons: [{
|
||||
text: 'Save Changes',
|
||||
handler: function() {
|
||||
isSaved = false;
|
||||
var msg = '', selNodes = treeGroups.getChecked();
|
||||
treeGroups.disabled = true;
|
||||
this.disabled = true;
|
||||
var Groups = [];
|
||||
Ext.each(selNodes, function(node) {
|
||||
Groups.push(node.id);
|
||||
});
|
||||
Ext.Ajax.request({
|
||||
url: 'authSourcesSynchronizeAjax',
|
||||
params: {m: 'saveGroups', authUid: AUTHENTICATION_SOURCE.AUTH_SOURCE_UID, groupsDN: Groups.join('|')},
|
||||
success: function(r) {
|
||||
var response = Ext.util.JSON.decode(r.responseText);
|
||||
if (response.status == 'OK') {
|
||||
treeGroups.getLoader().load(treeGroups.root);
|
||||
}
|
||||
else {
|
||||
alert(response.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
||||
treeGroups.loader.on('load', function() {
|
||||
treeGroups.getRootNode().expand(true);
|
||||
if (!isSaved) {
|
||||
isSaved = true;
|
||||
treeGroups.disabled = false;
|
||||
treeGroups.buttons[0].disabled = false;
|
||||
Ext.Msg.show({
|
||||
title: 'Changes saved.',
|
||||
msg: 'All changes have been saved.',
|
||||
icon: Ext.Msg.INFO,
|
||||
minWidth: 200,
|
||||
buttons: Ext.Msg.OK
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
departmentsPanel = new Ext.Panel({
|
||||
title: 'Synchronize Departments',
|
||||
autoWidth: true,
|
||||
layout: 'hbox',
|
||||
defaults: {flex: 1},
|
||||
layoutConfig: {align: 'stretch'},
|
||||
items: [treeDepartments],
|
||||
viewConfig: {forceFit: true}
|
||||
});
|
||||
|
||||
groupsPanel = new Ext.Panel({
|
||||
title: 'Synchronize Groups',
|
||||
autoWidth: true,
|
||||
layout: 'hbox',
|
||||
defaults: {flex: 1},
|
||||
layoutConfig: {align: 'stretch'},
|
||||
items: [treeGroups],
|
||||
viewConfig: {forceFit: true}
|
||||
});
|
||||
|
||||
tabsPanel = new Ext.TabPanel({
|
||||
region: 'center',
|
||||
activeTab: AUTHENTICATION_SOURCE.CURRENT_TAB,
|
||||
items:[departmentsPanel, groupsPanel],
|
||||
listeners:{
|
||||
beforetabchange: function(p, t, c) {
|
||||
if (typeof(t.body) == 'undefined') {
|
||||
isFirstTime = true;
|
||||
}
|
||||
},
|
||||
tabchange: function(p, t) {
|
||||
if (!isFirstTime) {
|
||||
switch(t.title){
|
||||
case 'Synchronize Departments':
|
||||
treeDepartments.getLoader().load(treeDepartments.root);
|
||||
break;
|
||||
case 'Synchronize Groups':
|
||||
treeGroups.getLoader().load(treeGroups.root);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
isFirstTime = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
viewport = new Ext.Viewport({
|
||||
layout: 'border',
|
||||
items: [northPanel, tabsPanel]
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
alert('->' + error + '<-');
|
||||
}
|
||||
});
|
||||
|
||||
237
workflow/engine/templates/ldapAdvanced/ldapAdvancedForm.js
Executable file
237
workflow/engine/templates/ldapAdvanced/ldapAdvancedForm.js
Executable file
@@ -0,0 +1,237 @@
|
||||
var ldapFormAnonymousOnChange = function (combo, arrayObject)
|
||||
{
|
||||
var flagAnonymous = (combo.getValue() == "1")? true : false;
|
||||
|
||||
arrayObject["ldapFormSearchUser"].allowBlank = flagAnonymous;
|
||||
arrayObject["ldapFormPassword"].allowBlank = flagAnonymous;
|
||||
|
||||
arrayObject["ldapFormSearchUser"].setVisible(!flagAnonymous);
|
||||
arrayObject["ldapFormPassword"].setVisible(!flagAnonymous);
|
||||
};
|
||||
|
||||
var ldapFormId = new Ext.form.Hidden({
|
||||
name: 'AUTH_SOURCE_UID',
|
||||
id: 'AUTH_SOURCE_UID'
|
||||
});
|
||||
|
||||
var ldapFormName = new Ext.form.TextField({
|
||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_NAME'),
|
||||
name: 'AUTH_SOURCE_NAME',
|
||||
id: 'AUTH_SOURCE_NAME',
|
||||
autoCreate: {tag: 'input', type: 'text', maxlength: '50'},
|
||||
allowBlank: false,
|
||||
width: 210
|
||||
});
|
||||
|
||||
var ldapFormProvider = new Ext.form.Hidden({
|
||||
name: 'AUTH_SOURCE_PROVIDER',
|
||||
id: 'AUTH_SOURCE_PROVIDER'
|
||||
});
|
||||
|
||||
var ldapFormType = new Ext.form.ComboBox({
|
||||
valueField: 'ID',
|
||||
displayField: 'VALUE',
|
||||
value: 'ldap',
|
||||
|
||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_TYPE'),
|
||||
typeAhead: true,
|
||||
forceSelection: true,
|
||||
triggerAction: 'all',
|
||||
editable: true,
|
||||
name: 'LDAP_TYPE',
|
||||
id: 'LDAP_TYPE',
|
||||
width: 130,
|
||||
allowBlank: false,
|
||||
store: [["ldap", "OpenLDAP"], ["ad", "Active Directory"], ["ds", "389 DS"]],
|
||||
listeners:{
|
||||
select: function(combo, record) {
|
||||
ldapFormIdentifier.setValue((combo.getValue() == "ad")? "samaccountname" : "uid");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var ldapFormAutoRegister = new Ext.form.ComboBox({
|
||||
valueField: 'ID',
|
||||
displayField: 'VALUE',
|
||||
value: '0',
|
||||
|
||||
fieldLabel: '<span style="color: red">*</span>' + "Enable automatic register",
|
||||
typeAhead: true,
|
||||
forceSelection: true,
|
||||
triggerAction: 'all',
|
||||
editable: true,
|
||||
name: 'AUTH_SOURCE_AUTO_REGISTER',
|
||||
id: 'AUTH_SOURCE_AUTO_REGISTER',
|
||||
width: 130,
|
||||
allowBlank: false,
|
||||
store: [['0',_('ID_NO')],['1',_('ID_YES')]]
|
||||
});
|
||||
|
||||
var ldapFormServerName = new Ext.form.TextField({
|
||||
fieldLabel: '<span style="color: red">*</span>' + "Server Address",
|
||||
name: 'AUTH_SOURCE_SERVER_NAME',
|
||||
id: 'AUTH_SOURCE_SERVER_NAME',
|
||||
autoCreate: {tag: 'input', type: 'text', maxlength: '50'},
|
||||
allowBlank: false,
|
||||
width: 210
|
||||
});
|
||||
|
||||
var ldapFormPort = new Ext.form.NumberField({
|
||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_PORT'),
|
||||
name: 'AUTH_SOURCE_PORT',
|
||||
id: 'AUTH_SOURCE_PORT',
|
||||
allowBlank: true,
|
||||
width: 130,
|
||||
value: '389',
|
||||
autoCreate: {tag: 'input', type: 'text', maxlength: '5'}
|
||||
});
|
||||
|
||||
var ldapFormTls = new Ext.form.ComboBox({
|
||||
valueField: 'ID',
|
||||
displayField: 'VALUE',
|
||||
|
||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_ENABLED_TLS'),
|
||||
typeAhead: true,
|
||||
forceSelection: true,
|
||||
triggerAction: 'all',
|
||||
editable: true,
|
||||
name: 'AUTH_SOURCE_ENABLED_TLS',
|
||||
id: 'AUTH_SOURCE_ENABLED_TLS',
|
||||
width: 130,
|
||||
allowBlank: false,
|
||||
value: '0',
|
||||
store: [['0',_('ID_NO')],['1',_('ID_YES')]]
|
||||
});
|
||||
|
||||
var ldapFormBaseDN = new Ext.form.TextField({
|
||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_BASE_DN'),
|
||||
name: 'AUTH_SOURCE_BASE_DN',
|
||||
id: 'AUTH_SOURCE_BASE_DN',
|
||||
autoCreate: {tag: 'input', type: 'text', maxlength: '128'},
|
||||
allowBlank: false,
|
||||
width: 210
|
||||
});
|
||||
|
||||
var ldapFormAnonymous = new Ext.form.ComboBox({
|
||||
valueField: 'ID',
|
||||
displayField: 'VALUE',
|
||||
|
||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_ANONYMOUS'),
|
||||
typeAhead: true,
|
||||
forceSelection: true,
|
||||
triggerAction: 'all',
|
||||
editable: true,
|
||||
name: 'AUTH_ANONYMOUS',
|
||||
id: 'AUTH_ANONYMOUS',
|
||||
width: 130,
|
||||
allowBlank: false,
|
||||
value: '0',
|
||||
store: [['0',_('ID_NO')],['1',_('ID_YES')]],
|
||||
listeners:{
|
||||
select: function(combo, record) {
|
||||
var arrayObject = [];
|
||||
arrayObject["ldapFormSearchUser"] = ldapFormSearchUser;
|
||||
arrayObject["ldapFormPassword"] = ldapFormPassword;
|
||||
|
||||
ldapFormAnonymousOnChange(combo, arrayObject);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var ldapFormSearchUser = new Ext.form.TextField({
|
||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_USERNAME'),
|
||||
name: 'AUTH_SOURCE_SEARCH_USER',
|
||||
id: 'AUTH_SOURCE_SEARCH_USER',
|
||||
autoCreate: {tag: 'input', type: 'text', maxlength: '128'},
|
||||
allowBlank: false,
|
||||
width: 210
|
||||
});
|
||||
|
||||
var ldapFormPassword = new Ext.form.TextField({
|
||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_PASSWORD'),
|
||||
inputType: 'password',
|
||||
name: 'AUTH_SOURCE_PASSWORD',
|
||||
id: 'AUTH_SOURCE_PASSWORD',
|
||||
autoCreate: {tag: 'input', type: 'text', maxlength: '32'},
|
||||
allowBlank: false,
|
||||
width: 210
|
||||
});
|
||||
|
||||
var ldapFormIdentifier = new Ext.form.TextField({
|
||||
fieldLabel: '<span style="color: red">*</span>' + "User Identifier",
|
||||
name: 'AUTH_SOURCE_IDENTIFIER_FOR_USER',
|
||||
id: 'AUTH_SOURCE_IDENTIFIER_FOR_USER',
|
||||
autoCreate: {tag: 'input', type: 'text', maxlength: '20'},
|
||||
allowBlank: false,
|
||||
width: 210,
|
||||
value: 'uid'
|
||||
});
|
||||
|
||||
var ldapFormUsersFilter = new Ext.form.TextField({
|
||||
fieldLabel: "Filter to search users",
|
||||
name: 'AUTH_SOURCE_USERS_FILTER',
|
||||
id: 'AUTH_SOURCE_USERS_FILTER',
|
||||
autoCreate: {tag: 'input', type: 'text', maxlength: '200'},
|
||||
allowBlank: true,
|
||||
width: 210
|
||||
});
|
||||
|
||||
var ldapFormRetiredEmployees = new Ext.form.TextField({
|
||||
fieldLabel: "OU for Retired Employees OU",
|
||||
name: 'AUTH_SOURCE_RETIRED_OU',
|
||||
id: 'AUTH_SOURCE_RETIRED_OU',
|
||||
autoCreate: {tag: 'input', type: 'text', maxlength: '128'},
|
||||
allowBlank: true,
|
||||
width: 210
|
||||
});
|
||||
|
||||
var ldapFormAttrinuteIds = new Ext.form.Hidden({
|
||||
name: 'AUTH_SOURCE_ATTRIBUTE_IDS',
|
||||
id: 'AUTH_SOURCE_ATTRIBUTE_IDS'
|
||||
});
|
||||
|
||||
var ldapFormShowGrid = new Ext.form.Hidden({
|
||||
name: 'AUTH_SOURCE_SHOWGRID',
|
||||
id: 'AUTH_SOURCE_SHOWGRID'
|
||||
});
|
||||
|
||||
var ldapFormGridText = new Ext.form.Hidden({
|
||||
name: 'AUTH_SOURCE_GRID_TEXT',
|
||||
id: 'AUTH_SOURCE_GRID_TEXT'
|
||||
});
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var ldapFormData = new Ext.form.FieldSet({
|
||||
style: {
|
||||
border: "0px"
|
||||
},
|
||||
|
||||
labelWidth : 170,
|
||||
items :[
|
||||
ldapFormId, ldapFormName, ldapFormProvider, ldapFormType, ldapFormAutoRegister, ldapFormServerName,
|
||||
ldapFormPort, ldapFormTls, ldapFormBaseDN, ldapFormAnonymous, ldapFormSearchUser, ldapFormPassword,
|
||||
ldapFormIdentifier, ldapFormUsersFilter, ldapFormRetiredEmployees,
|
||||
{
|
||||
xtype: 'label',
|
||||
fieldLabel: ' ',
|
||||
id:'passwordReview',
|
||||
width: 300,
|
||||
style: 'font: 9px tahoma,arial,helvetica,sans-serif;',
|
||||
text: "(Default set to (&(!(objectClass=organizationalUnit))))",
|
||||
labelSeparator: ''
|
||||
}, ldapFormAttrinuteIds, ldapFormShowGrid, ldapFormGridText
|
||||
]
|
||||
});
|
||||
|
||||
var pnlData = new Ext.Panel({
|
||||
height: 425,
|
||||
|
||||
bodyStyle: "border-top: 0px; padding-top: 10px;",
|
||||
|
||||
title: "<div style=\"height: 20px;\">" + _("ID_INFORMATION") + "</div>",
|
||||
|
||||
items: [ldapFormData]
|
||||
});
|
||||
|
||||
486
workflow/engine/templates/ldapAdvanced/ldapAdvancedList.js
Executable file
486
workflow/engine/templates/ldapAdvanced/ldapAdvancedList.js
Executable file
File diff suppressed because it is too large
Load Diff
317
workflow/engine/templates/ldapAdvanced/ldapAdvancedSearch.js
Normal file
317
workflow/engine/templates/ldapAdvanced/ldapAdvancedSearch.js
Normal file
File diff suppressed because it is too large
Load Diff
15
workflow/engine/templates/ldapAdvanced/library.js
Executable file
15
workflow/engine/templates/ldapAdvanced/library.js
Executable file
@@ -0,0 +1,15 @@
|
||||
function redirectPage(page){
|
||||
window.location = page;
|
||||
}
|
||||
|
||||
function randomNum(inf, sup){
|
||||
numPos = sup - inf;
|
||||
aleat = Math.random() * numPos;
|
||||
aleat = Math.round(aleat);
|
||||
return parseInt(inf) + aleat;
|
||||
}
|
||||
|
||||
function renderStatus (data, metadata, record, rowIndex, columnIndex, store) {
|
||||
return "<span style=\"color: " + ((record.data.IMPORT == 1)? "#005E20" : "#FF0000") + ";\">" + record.data.STATUS.toUpperCase() + "</span>";
|
||||
}
|
||||
|
||||
180
workflow/engine/templates/ldapAdvanced/searchSummary.js
Executable file
180
workflow/engine/templates/ldapAdvanced/searchSummary.js
Executable file
@@ -0,0 +1,180 @@
|
||||
var caseData = '';
|
||||
var appTitle = new Ext.form.Label({
|
||||
fieldLabel: "Case Title",
|
||||
labelStyle: 'font-weight:bold;padding-right:30px;'
|
||||
});
|
||||
|
||||
var process = new Ext.form.Label({
|
||||
fieldLabel: "Process Uid",
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var processTitle = new Ext.form.Label({
|
||||
fieldLabel: "Process",
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var appUid = new Ext.form.Label({
|
||||
fieldLabel: "App Uid",
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var caseNumber = new Ext.form.Label({
|
||||
fieldLabel: "Case number",
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var initUser = new Ext.form.Label({
|
||||
fieldLabel: "Init user",
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var finishUser = new Ext.form.Label({
|
||||
fieldLabel: "Finish user",
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var createDate = new Ext.form.Label({
|
||||
fieldLabel: "Create date",
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var finishDate = new Ext.form.Label({
|
||||
fieldLabel: "Finish date",
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var fileName = new Ext.form.Label({
|
||||
fieldLabel: "File Name",
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var statusCaseWin = new Ext.form.Label({
|
||||
fieldLabel: "Status",
|
||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
||||
});
|
||||
|
||||
var formCase = new Ext.FormPanel({
|
||||
labelWidth : 120,
|
||||
labelAlign : 'right',
|
||||
autoScroll: true,
|
||||
frame: true,
|
||||
bodyStyle : 'padding-top:20px;padding-left:20px;',
|
||||
items:[
|
||||
appTitle,
|
||||
caseNumber,
|
||||
processTitle,
|
||||
initUser,
|
||||
finishUser,
|
||||
createDate,
|
||||
finishDate,
|
||||
fileName,
|
||||
statusCaseWin
|
||||
],
|
||||
buttons:[{
|
||||
text : "Restore case",
|
||||
id: 'BUTTON_UNARCHIVE_CASE',
|
||||
iconCls: 'button_menu_ext ss_sprite ss_folder_go',
|
||||
formBind : true,
|
||||
handler : function(){
|
||||
if (caseData!='') {
|
||||
Ext.MessageBox.confirm("Confirm", "Are you sure you want to restore the case?", function (val) {
|
||||
if (val == 'yes') {
|
||||
dataCase = caseData;
|
||||
Ext.MessageBox.show({
|
||||
msg: "Restoring case" + ' ' + dataCase.CASE_NUMBER + ' ...',
|
||||
progressText: 'Saving...',
|
||||
width:300,
|
||||
wait:true,
|
||||
waitConfig: {interval:200},
|
||||
animEl: 'mb7'
|
||||
});
|
||||
Ext.Ajax.request({
|
||||
params: {
|
||||
'APP_UID': dataCase.APP_UID,
|
||||
'FILENAME_TAR': dataCase.FILENAME_TAR,
|
||||
'functionExecute': 'unarchiveCase'
|
||||
},
|
||||
url : 'controllers/searchListProxy.php',
|
||||
success: function (returnData) {
|
||||
Ext.MessageBox.hide();
|
||||
|
||||
var resp = Ext.decode(returnData.responseText);
|
||||
if (resp.success) {
|
||||
Ext.MessageBox.show({
|
||||
title: 'Case Unarhive',
|
||||
msg: "Case" + ' ' + dataCase.CASE_NUMBER + ' ' + "Restored sucessfully",
|
||||
buttons: Ext.MessageBox.OK,
|
||||
animEl: 'mb9',
|
||||
icon: Ext.MessageBox.INFO
|
||||
});
|
||||
} else {
|
||||
Ext.MessageBox.show({
|
||||
title: "Error",
|
||||
msg: resp.message,
|
||||
buttons: Ext.MessageBox.OK,
|
||||
animEl: 'mb9',
|
||||
icon: Ext.MessageBox.ERROR
|
||||
});
|
||||
}
|
||||
|
||||
storeGridSearch.load();
|
||||
},
|
||||
failure: function () {
|
||||
Ext.MessageBox.alert("Error", "Error in server");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
text : _('ID_CLOSE'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_folder_delete',
|
||||
formBind : true,
|
||||
handler : function(){
|
||||
summaryWindow.hide();
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
||||
var summaryWindow = new Ext.Window({
|
||||
title: "Detail Case",
|
||||
layout: 'fit',
|
||||
width: 500,
|
||||
height: 320,
|
||||
resizable: true,
|
||||
closable: true,
|
||||
closeAction : 'hide',
|
||||
modal: true,
|
||||
autoScroll:true,
|
||||
constrain: true,
|
||||
items: [formCase]
|
||||
});
|
||||
|
||||
function showCaseSummary(dataCase) {
|
||||
if (dataCase) {
|
||||
caseData = dataCase;
|
||||
|
||||
if(dataCase.STATUS == 'RESTORED'){
|
||||
Ext.getCmp('BUTTON_UNARCHIVE_CASE').disable();
|
||||
} else {
|
||||
Ext.getCmp('BUTTON_UNARCHIVE_CASE').enable();
|
||||
}
|
||||
|
||||
appTitle.setText(dataCase.APP_TITLE, false);
|
||||
process.setText(dataCase.PRO_UID, false);
|
||||
processTitle.setText(dataCase.PRO_TITLE, false);
|
||||
appUid.setText(dataCase.APP_UID, false);
|
||||
caseNumber.setText(dataCase.CASE_NUMBER, false);
|
||||
initUser.setText(dataCase.INIT_USER_NAME, false);
|
||||
finishUser.setText(dataCase.FINISH_USER_NAME, false);
|
||||
createDate.setText(renderDate(dataCase.CREATE_DATE, false));
|
||||
finishDate.setText(renderDate(dataCase.FINISH_DATE, false));
|
||||
fileName.setText(dataCase.FILENAME_TAR+'.tar', false);
|
||||
statusCaseWin.setText(dataCase.STATUS, false);
|
||||
|
||||
summaryWindow.show();
|
||||
}
|
||||
}
|
||||
11
workflow/engine/xmlform/ldapAdvanced/gridAttribute.xml
Executable file
11
workflow/engine/xmlform/ldapAdvanced/gridAttribute.xml
Executable file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm type="grid" name="ldapAdvanced/gridAttribute" enabletemplate="0" mode="">
|
||||
<attributeLdap type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" btn_cancel="Cancel">
|
||||
<en><![CDATA[LDAP Field]]></en>
|
||||
<pt-BR><![CDATA[Campo LDAP]]></pt-BR>
|
||||
</attributeLdap>
|
||||
<attributeUser type="dropdown" required="0" readonly="0" mode="edit" options="Array" btn_cancel="Cancel">
|
||||
<en><![CDATA[User Field]]></en>
|
||||
<pt-BR><![CDATA[Campo de Usuário]]></pt-BR>
|
||||
</attributeUser>
|
||||
</dynaForm>
|
||||
11
workflow/engine/xmlform/ldapAdvanced/ldapAdvanced.xml
Executable file
11
workflow/engine/xmlform/ldapAdvanced/ldapAdvanced.xml
Executable file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm name="Ldap Setup Form" type="xmlform" width="550">
|
||||
<TITLE type="title" group="1">
|
||||
<en><![CDATA[Ldap Advance Plugin]]></en>
|
||||
<pt-BR><![CDATA[Ldap Plugin Adiantamento]]></pt-BR>
|
||||
</TITLE>
|
||||
<HelpText type="subtitle" maxlength="100" size="60">
|
||||
<en><![CDATA[Please check the User Section in order to Synchronize or Import users from an authentication source using this plugin. There is no further configuration needed.]]></en>
|
||||
<pt-BR><![CDATA[Por favor verifique a seção do usuário, a fim de sincronizar ou importar usuários a partir de uma fonte de autenticação usando este plugin. Não há nenhuma configuração adicional necessário.]]></pt-BR>
|
||||
</HelpText>
|
||||
</dynaForm>
|
||||
215
workflow/engine/xmlform/ldapAdvanced/ldapAdvancedEdit.xml
Executable file
215
workflow/engine/xmlform/ldapAdvanced/ldapAdvancedEdit.xml
Executable file
@@ -0,0 +1,215 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm name="authSources/ldap_Edit" type="xmlform" width="650" enabletemplate="0" mode="">
|
||||
<title type="title">
|
||||
<en><![CDATA[Authentication Source Information]]></en>
|
||||
<pt-BR><![CDATA[Informações de fonte de autenticação]]></pt-BR>
|
||||
</title>
|
||||
<AUTH_SOURCE_UID type="hidden"/>
|
||||
<AUTH_SOURCE_NAME type="text" size="50" maxlength="50" required="1">
|
||||
<en><![CDATA[Name]]></en>
|
||||
<pt-BR><![CDATA[Nome]]></pt-BR>
|
||||
</AUTH_SOURCE_NAME>
|
||||
<AUTH_SOURCE_PROVIDER type="hidden" defaultValue="ldap"/>
|
||||
<LDAP_TYPE type="dropdown" required="0">
|
||||
<en><![CDATA[Type]]><option name="ldap"><![CDATA[OpenLDAP]]></option><option name="ad"><![CDATA[Active Directory]]></option><option name="ds"><![CDATA[389 DS]]></option></en>
|
||||
<pt-BR><![CDATA[Tipo]]><option name="ldap"><![CDATA[OpenLDAP]]></option><option name="ad"><![CDATA[Active Directory]]></option><option name="ds"><![CDATA[389 DS]]></option></pt-BR>
|
||||
</LDAP_TYPE>
|
||||
<AUTH_SOURCE_AUTO_REGISTER type="dropdown">
|
||||
<en><![CDATA[Enable automatic register]]><option name="0"><![CDATA[No]]></option><option name="1"><![CDATA[Yes]]></option></en>
|
||||
<pt-BR><![CDATA[Ativado automatic registrar]]><option name="0"><![CDATA[Não]]></option><option name="1"><![CDATA[Sim]]></option></pt-BR>
|
||||
</AUTH_SOURCE_AUTO_REGISTER>
|
||||
<AUTH_SOURCE_SERVER_NAME type="text" size="50" maxlength="50" required="1">
|
||||
<en><![CDATA[Server Address]]></en>
|
||||
<pt-BR><![CDATA[Endereço do Servidor]]></pt-BR>
|
||||
</AUTH_SOURCE_SERVER_NAME>
|
||||
<AUTH_SOURCE_PORT type="text" size="5" maxlength="5" required="1" defaultValue="389" validate="Int">
|
||||
<en><![CDATA[Port]]></en>
|
||||
<pt-BR><![CDATA[Porto]]></pt-BR>
|
||||
</AUTH_SOURCE_PORT>
|
||||
<AUTH_SOURCE_ENABLED_TLS type="dropdown">
|
||||
<en><![CDATA[Enabled TLS]]><option name="0"><![CDATA[No]]></option><option name="1"><![CDATA[Yes]]></option></en>
|
||||
<pt-BR><![CDATA[Ativado TLS]]><option name="0"><![CDATA[Não]]></option><option name="1"><![CDATA[Sim]]></option></pt-BR>
|
||||
</AUTH_SOURCE_ENABLED_TLS>
|
||||
<AUTH_SOURCE_BASE_DN type="text" size="50" maxlength="128" required="1">
|
||||
<en><![CDATA[Base DN]]></en>
|
||||
<pt-BR><![CDATA[Base DN]]></pt-BR>
|
||||
</AUTH_SOURCE_BASE_DN>
|
||||
<AUTH_ANONYMOUS type="dropdown">
|
||||
<en><![CDATA[Anonymous]]><option name="0"><![CDATA[No]]></option><option name="1"><![CDATA[Yes]]></option></en>
|
||||
<pt-BR><![CDATA[anônimo]]><option name="0"><![CDATA[Não]]></option><option name="1"><![CDATA[Sim]]></option></pt-BR>
|
||||
</AUTH_ANONYMOUS>
|
||||
<AUTH_SOURCE_SEARCH_USER type="text" size="50" maxlength="128" required="0">
|
||||
<en><![CDATA[Username]]></en>
|
||||
<pt-BR><![CDATA[Usuário]]></pt-BR>
|
||||
</AUTH_SOURCE_SEARCH_USER>
|
||||
<AUTH_SOURCE_PASSWORD type="password" size="20" maxlength="32" required="0">
|
||||
<en><![CDATA[Password]]></en>
|
||||
<pt-BR><![CDATA[Senha]]></pt-BR>
|
||||
</AUTH_SOURCE_PASSWORD>
|
||||
<AUTH_SOURCE_IDENTIFIER_FOR_USER type="text" size="20" maxlength="20" required="1" defaultValue="uid">
|
||||
<en><![CDATA[User Identifier]]></en>
|
||||
<pt-BR><![CDATA[Identificador de usuário]]></pt-BR>
|
||||
</AUTH_SOURCE_IDENTIFIER_FOR_USER>
|
||||
<AUTH_SOURCE_USERS_FILTER type="text" size="50" maxlength="200" required="0" defaultValue="">
|
||||
<en><![CDATA[Filter to search users (Default set to (&(!(objectClass=organizationalUnit))))]]></en>
|
||||
<pt-BR><![CDATA[Filtro para os usuários de busca (Default set to (&(!(objectClass=organizationalUnit))))]]></pt-BR>
|
||||
</AUTH_SOURCE_USERS_FILTER>
|
||||
<AUTH_SOURCE_RETIRED_OU type="text" size="50" maxlength="128" required="0">
|
||||
<en><![CDATA[OU for Retired Employees OU]]></en>
|
||||
<pt-BR><![CDATA[OU ao Aposentado UO]]></pt-BR>
|
||||
</AUTH_SOURCE_RETIRED_OU>
|
||||
<AUTH_SOURCE_ATTRIBUTE_IDS type="hidden"/>
|
||||
<AUTH_SOURCE_SHOWGRID_FLAG type="hidden"/>
|
||||
<AUTH_SOURCE_GRID_TEXT type="hidden"/>
|
||||
<AUTH_SOURCE_ATTRIBUTE_SUBTITLE type="subtitle" enablehtml="1" btn_cancel="Cancel" required="0" readonly="0" savelabel="0">
|
||||
<en><![CDATA[<input type="checkbox" name="form[AUTH_SOURCE_SHOWGRID]" id="form[AUTH_SOURCE_SHOWGRID]"> Match attributes to sync]]></en>
|
||||
<pt-BR><![CDATA[<input type="checkbox" name="form[AUTH_SOURCE_SHOWGRID]" id="form[AUTH_SOURCE_SHOWGRID]"> Combinar atributos para sincronizar]]></pt-BR>
|
||||
</AUTH_SOURCE_ATTRIBUTE_SUBTITLE>
|
||||
<AUTH_SOURCE_GRID_ATTRIBUTE type="grid" xmlgrid="ldapAdvanced/gridAttribute" addrow="1" deleterow="1" btn_cancel="Cancel"/>
|
||||
<SUBTITLETESTCONNECTION type="subtitle">
|
||||
<en><![CDATA[Minimum data required to run the "Test Connection": "Server Address, Port, Enabled TLS, Anonymous, Username, Password"]]></en>
|
||||
<pt-BR><![CDATA[Dados mínimos necessários para executar o "Test Connection": "Server Address, Port, TLS Habilitado, Anonymous, Nome de usuário, Senha"]]></pt-BR>
|
||||
</SUBTITLETESTCONNECTION>
|
||||
<btnSave type="submit">
|
||||
<en><![CDATA[Save]]></en>
|
||||
<pt-BR><![CDATA[Salvar]]></pt-BR>
|
||||
</btnSave>
|
||||
<BTNTESTCONNECTION type="button" onclick="testConnection();">
|
||||
<en><![CDATA[Test connection]]></en>
|
||||
<pt-BR><![CDATA[Teste de conexão]]></pt-BR>
|
||||
</BTNTESTCONNECTION>
|
||||
<btnCancel type="button" onclick="history.go(-1);">
|
||||
<en><![CDATA[Cancel]]></en>
|
||||
<pt-BR><![CDATA[Cancel]]></pt-BR>
|
||||
</btnCancel>
|
||||
<JS type="javascript"><![CDATA[
|
||||
|
||||
var dynaformOnload = function() {
|
||||
getField('AUTH_SOURCE_SHOWGRID').checked = (getField('AUTH_SOURCE_SHOWGRID_FLAG').value == 1) ? true : false;
|
||||
var fieldGridTd = getField('AUTH_SOURCE_GRID_ATTRIBUTE').parentNode.parentNode.parentNode;
|
||||
fieldGridTd.style.display = 'none';
|
||||
leimnud.event.add(getField('AUTH_ANONYMOUS'), 'change', hideShowSearchUser);
|
||||
leimnud.event.add(getField('LDAP_TYPE'), 'change', hideShowSuggest);
|
||||
leimnud.event.add(getField('AUTH_SOURCE_SHOWGRID'), 'click', showGrid);
|
||||
hideShowSearchUser();
|
||||
hideShowSuggest();
|
||||
showGrid();
|
||||
|
||||
var valuesDrop = getField('AUTH_SOURCE_ATTRIBUTE_IDS').value;
|
||||
valuesDropArray = valuesDrop.split('|');
|
||||
|
||||
for (var i = 0 ; i < valuesDropArray.length ; i++) {
|
||||
if (valuesDropArray[i] != '') {
|
||||
var iRows = Number_Rows_Grid('AUTH_SOURCE_GRID_ATTRIBUTE','attributeLdap');
|
||||
for (cont=1 ; cont<=iRows ; cont=cont+1) {
|
||||
eval(" var newOption = document.createElement('option'); newOption.text = valuesDropArray[i]; newOption.value = valuesDropArray[i]; try { getField('AUTH_SOURCE_GRID_ATTRIBUTE][" + cont + "][attributeUser').add(newOption, null);} catch(ex) { getField('AUTH_SOURCE_GRID_ATTRIBUTE][" + cont + "][attributeUser').add(newOption);}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var valuesGrid = getField('AUTH_SOURCE_GRID_TEXT').value;
|
||||
valuesGridArray = valuesGrid.split('|');
|
||||
var fil = 1;
|
||||
for (var i = 0 ; i < valuesGridArray.length ; i++) {
|
||||
if(valuesGridArray[i] != '')
|
||||
{
|
||||
var valuesFielddGrid = valuesGridArray[i].split("/");
|
||||
getField('AUTH_SOURCE_GRID_ATTRIBUTE][' + fil + '][attributeUser').value = valuesFielddGrid['1'];
|
||||
fil++;
|
||||
}
|
||||
}
|
||||
|
||||
function showGrid() {
|
||||
if (getField('AUTH_SOURCE_SHOWGRID').checked == true) {
|
||||
fieldGridTd.style.display = 'block';
|
||||
fieldGridTd.removeAttribute("style",0);
|
||||
} else {
|
||||
fieldGridTd.style.display = 'none';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var hideShowSearchUser = function() {
|
||||
if (getField('AUTH_ANONYMOUS').value == '1') {
|
||||
hideRowById('AUTH_SOURCE_SEARCH_USER');
|
||||
hideRowById('AUTH_SOURCE_PASSWORD');
|
||||
}
|
||||
else {
|
||||
showRowById('AUTH_SOURCE_SEARCH_USER');
|
||||
showRowById('AUTH_SOURCE_PASSWORD');
|
||||
}
|
||||
};
|
||||
|
||||
var hideShowSuggest = function ()
|
||||
{
|
||||
getField("AUTH_SOURCE_IDENTIFIER_FOR_USER").value = (getField("LDAP_TYPE").value == "ad")? "samaccountname" : "uid";
|
||||
};
|
||||
|
||||
var testConnection = function ()
|
||||
{
|
||||
var strArgs = "functionAccion=ldapTestConnection&";
|
||||
strArgs += "AUTH_SOURCE_SERVER_NAME=" + getField("AUTH_SOURCE_SERVER_NAME").value + "&";
|
||||
strArgs += "AUTH_SOURCE_PORT=" + getField("AUTH_SOURCE_PORT").value + "&";
|
||||
strArgs += "AUTH_SOURCE_ENABLED_TLS=" + getField("AUTH_SOURCE_ENABLED_TLS").value + "&";
|
||||
strArgs += "AUTH_ANONYMOUS=" + getField("AUTH_ANONYMOUS").value + "&";
|
||||
strArgs += "AUTH_SOURCE_SEARCH_USER=" + getField("AUTH_SOURCE_SEARCH_USER").value + "&";
|
||||
strArgs += "AUTH_SOURCE_PASSWORD=" + getField("AUTH_SOURCE_PASSWORD").value + "&";
|
||||
strArgs += "AUTH_SOURCE_VERSION=3";
|
||||
|
||||
var rpcAjax = new leimnud.module.rpc.xmlhttp({
|
||||
url: "../ldapAdvanced/controllers/ldapAdvancedProxy.php",
|
||||
method: "POST",
|
||||
args: strArgs
|
||||
});
|
||||
|
||||
rpcAjax.callback = function (rpc)
|
||||
{
|
||||
var dataResponse = rpc.xmlhttp.responseText.parseJSON();
|
||||
|
||||
if (dataResponse.status) {
|
||||
var panel = new leimnud.module.panel();
|
||||
|
||||
panel.options = {
|
||||
statusBarButtons: [{value: _("ID_ACCEPT")}],
|
||||
position: {center: true},
|
||||
size: {
|
||||
w: 400,
|
||||
h: 125
|
||||
},
|
||||
control: {
|
||||
close: true,
|
||||
resize: false
|
||||
},
|
||||
fx: {modal: true}
|
||||
};
|
||||
|
||||
panel.setStyle = {
|
||||
content:{
|
||||
padding: 10,
|
||||
paddingLeft: 50,
|
||||
textAlign: "left",
|
||||
background: "url(/images/" + ((dataResponse.status == "OK")? "dialog-ok-apply" : "error") + ".png)",
|
||||
backgroundRepeat: "no-repeat",
|
||||
backgroundPosition: "2% 10%",
|
||||
backgroundColor: "transparent",
|
||||
borderWidth: 0
|
||||
}
|
||||
};
|
||||
|
||||
panel.make();
|
||||
panel.addContent((dataResponse.status == "OK")? "Successfully connected" : dataResponse.message);
|
||||
panel.fixContent();
|
||||
panel.elements.statusBarButtons[0].onmouseup = function ()
|
||||
{
|
||||
panel.remove();
|
||||
|
||||
return false;
|
||||
}.extend(this);
|
||||
}
|
||||
}.extend(this);
|
||||
|
||||
rpcAjax.make();
|
||||
};
|
||||
]]></JS>
|
||||
</dynaForm>
|
||||
|
||||
1
workflow/engine/xmlform/ldapAdvanced/ldapAdvancedFlag
Executable file
1
workflow/engine/xmlform/ldapAdvanced/ldapAdvancedFlag
Executable file
@@ -0,0 +1 @@
|
||||
Bandera para habilitar nueva interfaz extjs
|
||||
Reference in New Issue
Block a user