BUG 000 Add hook for the SSO plugin
This commit is contained in:
@@ -64,6 +64,8 @@ class RBAC
|
|||||||
var $aRbacPlugins = array();
|
var $aRbacPlugins = array();
|
||||||
var $sSystem = '';
|
var $sSystem = '';
|
||||||
|
|
||||||
|
var $singleSignOn = false;
|
||||||
|
|
||||||
static private $instance = NULL;
|
static private $instance = NULL;
|
||||||
|
|
||||||
private function __construct() {
|
private function __construct() {
|
||||||
|
|||||||
@@ -23,15 +23,9 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
if (!isset($_POST['form']) ) {
|
|
||||||
G::SendTemporalMessage ('ID_USER_HAVENT_RIGHTS_SYSTEM', "error");
|
|
||||||
G::header ("location: login.html");die;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
if (!$RBAC->singleSignOn) {
|
||||||
$frm = $_POST['form'];
|
$frm = $_POST['form'];
|
||||||
$usr = '';
|
$usr = '';
|
||||||
$pwd = '';
|
$pwd = '';
|
||||||
@@ -125,9 +119,16 @@ try {
|
|||||||
$loginInfo = new loginInfo ($usr, $pwd, $lSession );
|
$loginInfo = new loginInfo ($usr, $pwd, $lSession );
|
||||||
$oPluginRegistry->executeTriggers ( PM_LOGIN , $loginInfo );
|
$oPluginRegistry->executeTriggers ( PM_LOGIN , $loginInfo );
|
||||||
}
|
}
|
||||||
|
|
||||||
$_SESSION['USER_LOGGED'] = $uid;
|
$_SESSION['USER_LOGGED'] = $uid;
|
||||||
$_SESSION['USR_USERNAME'] = $usr;
|
$_SESSION['USR_USERNAME'] = $usr;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$uid = $RBAC->userObj->fields['USR_UID'];
|
||||||
|
$usr = $RBAC->userObj->fields['USR_USERNAME'];
|
||||||
|
$_SESSION['USER_LOGGED'] = $uid;
|
||||||
|
$_SESSION['USR_USERNAME'] = $usr;
|
||||||
|
}
|
||||||
|
|
||||||
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
|
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
|
||||||
$RBAC->loadUserRolePermission($RBAC->sSystem, $_SESSION['USER_LOGGED']);
|
$RBAC->loadUserRolePermission($RBAC->sSystem, $_SESSION['USER_LOGGED']);
|
||||||
//$rol = $RBAC->rolesObj->load($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_UID']);
|
//$rol = $RBAC->rolesObj->load($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_UID']);
|
||||||
@@ -204,6 +205,7 @@ try {
|
|||||||
/* Check password using policy - Start */
|
/* Check password using policy - Start */
|
||||||
require_once 'classes/model/UsersProperties.php';
|
require_once 'classes/model/UsersProperties.php';
|
||||||
$oUserProperty = new UsersProperties();
|
$oUserProperty = new UsersProperties();
|
||||||
|
if (!$RBAC->singleSignOn) {
|
||||||
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($_SESSION['USER_LOGGED'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($currentPwd)))));
|
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($_SESSION['USER_LOGGED'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($currentPwd)))));
|
||||||
$aErrors = $oUserProperty->validatePassword($_POST['form']['USR_PASSWORD'], $aUserProperty['USR_LAST_UPDATE_DATE'], $aUserProperty['USR_LOGGED_NEXT_TIME']);
|
$aErrors = $oUserProperty->validatePassword($_POST['form']['USR_PASSWORD'], $aUserProperty['USR_LAST_UPDATE_DATE'], $aUserProperty['USR_LOGGED_NEXT_TIME']);
|
||||||
|
|
||||||
@@ -247,6 +249,11 @@ try {
|
|||||||
else {
|
else {
|
||||||
$sLocation = $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang);
|
$sLocation = $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
G::header('Location: ' . $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang));
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
$oHeadPublisher =& headPublisher::getSingleton();
|
$oHeadPublisher =& headPublisher::getSingleton();
|
||||||
$oHeadPublisher->extJsInit = true;
|
$oHeadPublisher->extJsInit = true;
|
||||||
|
|||||||
@@ -82,6 +82,18 @@
|
|||||||
session_start ();
|
session_start ();
|
||||||
session_regenerate_id ();
|
session_regenerate_id ();
|
||||||
|
|
||||||
|
// Execute SSO trigger - Start
|
||||||
|
$pluginRegistry =& PMPluginRegistry::getSingleton();
|
||||||
|
if (defined('PM_SINGLE_SIGN_ON')) {
|
||||||
|
if ($pluginRegistry->existsTrigger(PM_SINGLE_SIGN_ON)) {
|
||||||
|
if ($pluginRegistry->executeTriggers(PM_SINGLE_SIGN_ON, null)) {
|
||||||
|
require_once 'authentication.php';
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Execute SSO trigger - End
|
||||||
|
|
||||||
if (strlen ( $msg ) > 0) {
|
if (strlen ( $msg ) > 0) {
|
||||||
$_SESSION ['G_MESSAGE'] = $msg;
|
$_SESSION ['G_MESSAGE'] = $msg;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user