OD STYLE Formating workflow/engine/methods/login/
Change format files in workflow/engine/methods/login/
This commit is contained in:
@@ -24,37 +24,40 @@ require_once 'classes/model/UsersProperties.php';
|
|||||||
$oUserProperty = new UsersProperties();
|
$oUserProperty = new UsersProperties();
|
||||||
$aUserProperty = $oUserProperty->load($_SESSION['USER_LOGGED']);
|
$aUserProperty = $oUserProperty->load($_SESSION['USER_LOGGED']);
|
||||||
$aHistory = unserialize($aUserProperty['USR_PASSWORD_HISTORY']);
|
$aHistory = unserialize($aUserProperty['USR_PASSWORD_HISTORY']);
|
||||||
|
|
||||||
if (!is_array($aHistory)) {
|
if (!is_array($aHistory)) {
|
||||||
$aHistory = array();
|
$aHistory = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined('PPP_PASSWORD_HISTORY')) {
|
if (!defined('PPP_PASSWORD_HISTORY')) {
|
||||||
define('PPP_PASSWORD_HISTORY', 0);
|
define('PPP_PASSWORD_HISTORY', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PPP_PASSWORD_HISTORY > 0) {
|
if (PPP_PASSWORD_HISTORY > 0) {
|
||||||
if (count($aHistory) >= PPP_PASSWORD_HISTORY) {
|
if (count($aHistory) >= PPP_PASSWORD_HISTORY) {
|
||||||
array_shift($aHistory);
|
array_shift($aHistory);
|
||||||
}
|
}
|
||||||
$aHistory[] = $_POST['form']['USR_PASSWORD'];
|
$aHistory[] = $_POST['form']['USR_PASSWORD'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
$aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||||
$aUserProperty['USR_LOGGED_NEXT_TIME'] = 0;
|
$aUserProperty['USR_LOGGED_NEXT_TIME'] = 0;
|
||||||
$aUserProperty['USR_PASSWORD_HISTORY'] = serialize($aHistory);
|
$aUserProperty['USR_PASSWORD_HISTORY'] = serialize($aHistory);
|
||||||
$oUserProperty->update($aUserProperty);
|
$oUserProperty->update($aUserProperty);
|
||||||
if ( class_exists('redirectDetail')) {
|
|
||||||
//falta validar...
|
|
||||||
if(isset($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE']))
|
|
||||||
$userRole = $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'];
|
|
||||||
|
|
||||||
|
if (class_exists('redirectDetail')) {
|
||||||
|
//falta validar...
|
||||||
|
if (isset($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'])) {
|
||||||
|
$userRole = $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'];
|
||||||
|
}
|
||||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||||
//$oPluginRegistry->showArrays();
|
//$oPluginRegistry->showArrays();
|
||||||
$aRedirectLogin = $oPluginRegistry->getRedirectLogins();
|
$aRedirectLogin = $oPluginRegistry->getRedirectLogins();
|
||||||
if(isset($aRedirectLogin))
|
if (isset($aRedirectLogin)) {
|
||||||
{ if(is_array($aRedirectLogin))
|
if (is_array($aRedirectLogin)) {
|
||||||
{
|
foreach ($aRedirectLogin as $key => $detail) {
|
||||||
foreach ( $aRedirectLogin as $key=>$detail ) {
|
if (isset($detail->sPathMethod)) {
|
||||||
if(isset($detail->sPathMethod))
|
if ($detail->sRoleCode == $userRole) {
|
||||||
{
|
|
||||||
if ( $detail->sRoleCode == $userRole ) {
|
|
||||||
G::header('location: /sys' . SYS_TEMP . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $detail->sPathMethod );
|
G::header('location: /sys' . SYS_TEMP . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $detail->sPathMethod );
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
@@ -65,22 +68,18 @@ if ( class_exists('redirectDetail')) {
|
|||||||
}
|
}
|
||||||
//end plugin
|
//end plugin
|
||||||
|
|
||||||
|
if (isset($frm['USER_LANG'])) {
|
||||||
if (isset($frm['USER_LANG'])) {
|
|
||||||
if ($frm['USER_LANG'] != '') {
|
if ($frm['USER_LANG'] != '') {
|
||||||
$lang = $frm['USER_LANG'];
|
$lang = $frm['USER_LANG'];
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (defined('SYS_LANG')) {
|
if (defined('SYS_LANG')) {
|
||||||
$lang = SYS_LANG;
|
$lang = SYS_LANG;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$lang = 'en';
|
$lang = 'en';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sLocation = $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang);
|
$sLocation = $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang);
|
||||||
G::header('Location: ' . $sLocation);
|
G::header('Location: ' . $sLocation);
|
||||||
die;
|
die;
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -24,14 +24,17 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function lookup( $target ) {
|
function lookup ($target)
|
||||||
|
{
|
||||||
global $ntarget;
|
global $ntarget;
|
||||||
$msg = $target . ' => ';
|
$msg = $target . ' => ';
|
||||||
//if (eregi ( '[a-zA-Z]', $target ))
|
//if (eregi ( '[a-zA-Z]', $target ))
|
||||||
if (preg_match( '[a-zA-Z]', $target )) //Made compatible to PHP 5.3
|
if (preg_match( '[a-zA-Z]', $target )) {
|
||||||
|
//Made compatible to PHP 5.3
|
||||||
$ntarget = gethostbyname ( $target );
|
$ntarget = gethostbyname ( $target );
|
||||||
else
|
} else {
|
||||||
$ntarget = gethostbyaddr ( $target );
|
$ntarget = gethostbyaddr ( $target );
|
||||||
|
}
|
||||||
$msg .= $ntarget;
|
$msg .= $ntarget;
|
||||||
return ($msg);
|
return ($msg);
|
||||||
}
|
}
|
||||||
@@ -40,12 +43,10 @@ G::LoadClass("system");
|
|||||||
|
|
||||||
if (getenv ( 'HTTP_CLIENT_IP' )) {
|
if (getenv ( 'HTTP_CLIENT_IP' )) {
|
||||||
$ip = getenv ( 'HTTP_CLIENT_IP' );
|
$ip = getenv ( 'HTTP_CLIENT_IP' );
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (getenv ( 'HTTP_X_FORWARDED_FOR' )) {
|
if (getenv ( 'HTTP_X_FORWARDED_FOR' )) {
|
||||||
$ip = getenv ( 'HTTP_X_FORWARDED_FOR' );
|
$ip = getenv ( 'HTTP_X_FORWARDED_FOR' );
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$ip = getenv ( 'REMOTE_ADDR' );
|
$ip = getenv ( 'REMOTE_ADDR' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,21 +65,17 @@ if (defined ( "DB_HOST" )) {
|
|||||||
G::LoadClass ( 'dbConnections' );
|
G::LoadClass ( 'dbConnections' );
|
||||||
$dbNetView = new NET ( DB_HOST );
|
$dbNetView = new NET ( DB_HOST );
|
||||||
$dbNetView->loginDbServer ( DB_USER, DB_PASS );
|
$dbNetView->loginDbServer ( DB_USER, DB_PASS );
|
||||||
|
|
||||||
$dbConns = new dbConnections ( '' );
|
$dbConns = new dbConnections ( '' );
|
||||||
$availdb = '';
|
$availdb = '';
|
||||||
foreach ( $dbConns->getDbServicesAvailables () as $key => $val ) {
|
foreach ($dbConns->getDbServicesAvailables () as $key => $val) {
|
||||||
if ($availdb != '')
|
if ($availdb != '') {
|
||||||
$availdb .= ', ';
|
$availdb .= ', ';
|
||||||
|
}
|
||||||
$availdb .= $val ['name'];
|
$availdb .= $val ['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$sMySQLVersion = $dbNetView->getDbServerVersion ( DB_ADAPTER );
|
$sMySQLVersion = $dbNetView->getDbServerVersion ( DB_ADAPTER );
|
||||||
|
} catch (Exception $oException) {
|
||||||
}
|
|
||||||
catch ( Exception $oException ) {
|
|
||||||
$sMySQLVersion = '?????';
|
$sMySQLVersion = '?????';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -89,17 +86,16 @@ if (defined ( "DB_HOST" )) {
|
|||||||
$Fields ['DATABASE_SERVER'] = DB_HOST;
|
$Fields ['DATABASE_SERVER'] = DB_HOST;
|
||||||
$Fields ['DATABASE_NAME'] = DB_NAME;
|
$Fields ['DATABASE_NAME'] = DB_NAME;
|
||||||
$Fields ['AVAILABLE_DB'] = $availdb;
|
$Fields ['AVAILABLE_DB'] = $availdb;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$Fields ['DATABASE'] = "Not defined";
|
$Fields ['DATABASE'] = "Not defined";
|
||||||
$Fields ['DATABASE_SERVER'] = "Not defined";
|
$Fields ['DATABASE_SERVER'] = "Not defined";
|
||||||
$Fields ['DATABASE_NAME'] = "Not defined";
|
$Fields ['DATABASE_NAME'] = "Not defined";
|
||||||
$Fields ['AVAILABLE_DB'] = "Not defined";
|
$Fields ['AVAILABLE_DB'] = "Not defined";
|
||||||
}
|
}
|
||||||
$eeT="";
|
$eeT="";
|
||||||
if(class_exists('pmLicenseManager')){
|
if (class_exists('pmLicenseManager')) {
|
||||||
$eeT=" - Enterprise Edition";
|
$eeT=" - Enterprise Edition";
|
||||||
}
|
}
|
||||||
$Fields ['PHP'] = phpversion ();
|
$Fields ['PHP'] = phpversion ();
|
||||||
$Fields ['FLUID'] = System::getVersion() . $eeT;
|
$Fields ['FLUID'] = System::getVersion() . $eeT;
|
||||||
$Fields ['IP'] = lookup ( $ip );
|
$Fields ['IP'] = lookup ( $ip );
|
||||||
@@ -113,8 +109,9 @@ $Fields ['SERVER_ADDR'] = getenv ( 'SERVER_ADDR' );
|
|||||||
$Fields ['HTTP_USER_AGENT'] = getenv ( 'HTTP_USER_AGENT' );
|
$Fields ['HTTP_USER_AGENT'] = getenv ( 'HTTP_USER_AGENT' );
|
||||||
$Fields ['TIME_ZONE'] = (defined('TIME_ZONE')) ? TIME_ZONE : "Unknown";
|
$Fields ['TIME_ZONE'] = (defined('TIME_ZONE')) ? TIME_ZONE : "Unknown";
|
||||||
|
|
||||||
if (! defined ( 'SKIP_RENDER_SYSTEM_INFORMATION' )) {
|
if (!defined( 'SKIP_RENDER_SYSTEM_INFORMATION')) {
|
||||||
$G_PUBLISH = new Publisher ( );
|
$G_PUBLISH = new Publisher ( );
|
||||||
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/dbInfo', '', $Fields, 'appNew2' );
|
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/dbInfo', '', $Fields, 'appNew2' );
|
||||||
G::RenderPage ( 'publish', 'raw' );
|
G::RenderPage ( 'publish', 'raw' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$G_PUBLISH = new Publisher ();
|
$G_PUBLISH = new Publisher ();
|
||||||
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/forgotPassword', '', array(), 'retrivePassword.php');
|
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/forgotPassword', '', array(), 'retrivePassword.php');
|
||||||
G::RenderPage ( "publish" );
|
G::RenderPage ( "publish" );
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$newFile = str_replace ( 'index.php', 'login.php' , __FILE__ ) ;
|
$newFile = str_replace ( 'index.php', 'login.php' , __FILE__ );
|
||||||
return $newFile;
|
return $newFile;
|
||||||
|
|
||||||
|
|
||||||
@@ -23,14 +23,13 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
|
|
||||||
G::LoadInclude ( 'ajax' );
|
G::LoadInclude ( 'ajax' );
|
||||||
if (isset ( $_POST ['form'] )) {
|
if (isset ( $_POST ['form'] )) {
|
||||||
$_POST = $_POST ['form'];
|
$_POST = $_POST ['form'];
|
||||||
}
|
}
|
||||||
$_POST ['function'] = get_ajax_value ( 'function' );
|
$_POST ['function'] = get_ajax_value ( 'function' );
|
||||||
switch ($_POST ['function']) {
|
switch ($_POST ['function']) {
|
||||||
case 'getStarted_save' :
|
case 'getStarted_save':
|
||||||
require_once 'classes/model/Configuration.php';
|
require_once 'classes/model/Configuration.php';
|
||||||
$aData ['CFG_UID'] = 'getStarted';
|
$aData ['CFG_UID'] = 'getStarted';
|
||||||
$aData ['OBJ_UID'] = '';
|
$aData ['OBJ_UID'] = '';
|
||||||
@@ -38,13 +37,11 @@ try {
|
|||||||
$aData ['PRO_UID'] = '';
|
$aData ['PRO_UID'] = '';
|
||||||
$aData ['USR_UID'] = '';
|
$aData ['USR_UID'] = '';
|
||||||
$aData ['APP_UID'] = '';
|
$aData ['APP_UID'] = '';
|
||||||
|
|
||||||
$oConfig = new Configuration ( );
|
$oConfig = new Configuration ( );
|
||||||
|
|
||||||
$oConfig->create ( $aData );
|
$oConfig->create ( $aData );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} catch ( Exception $oException ) {
|
||||||
catch ( Exception $oException ) {
|
|
||||||
die ( $oException->getMessage () );
|
die ( $oException->getMessage () );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ $G_SUB_MENU = "empty";
|
|||||||
$referer = $_SERVER ['HTTP_REFERER'];
|
$referer = $_SERVER ['HTTP_REFERER'];
|
||||||
$dbc = new DBConnection ( );
|
$dbc = new DBConnection ( );
|
||||||
$G_PUBLISH = new Publisher ( );
|
$G_PUBLISH = new Publisher ( );
|
||||||
$G_PUBLISH->AddContent ( "xmlform", "xmlform", "login/noViewPage", "", NULL );
|
$G_PUBLISH->AddContent ( "xmlform", "xmlform", "login/noViewPage", "", null );
|
||||||
|
|
||||||
G::RenderPage ( "publish" );
|
G::RenderPage ( "publish" );
|
||||||
?>
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ $user = new Users();
|
|||||||
|
|
||||||
$userData = $rbacUser->getByUsername($data['USR_USERNAME']);
|
$userData = $rbacUser->getByUsername($data['USR_USERNAME']);
|
||||||
|
|
||||||
if($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']) {
|
if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']) {
|
||||||
$aSetup = getEmailConfiguration();
|
$aSetup = getEmailConfiguration();
|
||||||
if (count($aSetup) == 0 || !isset($aSetup['MESS_ENGINE'])) {
|
if (count($aSetup) == 0 || !isset($aSetup['MESS_ENGINE'])) {
|
||||||
G::SendTemporalMessage ('ID_EMAIL_ENGINE_IS_NOT_ENABLED', "warning");
|
G::SendTemporalMessage ('ID_EMAIL_ENGINE_IS_NOT_ENABLED', "warning");
|
||||||
@@ -23,10 +23,10 @@ if($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']
|
|||||||
|
|
||||||
$aData['USR_UID'] = $userData['USR_UID'];
|
$aData['USR_UID'] = $userData['USR_UID'];
|
||||||
$aData['USR_PASSWORD'] = md5($newPass);
|
$aData['USR_PASSWORD'] = md5($newPass);
|
||||||
/* **Save after sending the mail
|
/* **Save after sending the mail
|
||||||
$rbacUser->update($aData);
|
$rbacUser->update($aData);
|
||||||
$user->update($aData);
|
$user->update($aData);
|
||||||
*/
|
*/
|
||||||
$sFrom = ($aSetup['MESS_ACCOUNT'] != '' ? $aSetup['MESS_ACCOUNT'] . ' ' : '') . '<' . $aSetup['MESS_ACCOUNT'] . '>';
|
$sFrom = ($aSetup['MESS_ACCOUNT'] != '' ? $aSetup['MESS_ACCOUNT'] . ' ' : '') . '<' . $aSetup['MESS_ACCOUNT'] . '>';
|
||||||
$sSubject = G::LoadTranslation('ID_RESET_PASSWORD').' - ProcessMaker' ;
|
$sSubject = G::LoadTranslation('ID_RESET_PASSWORD').' - ProcessMaker' ;
|
||||||
$msg = '<h3>ProcessMaker Forgot password Service</h3>';
|
$msg = '<h3>ProcessMaker Forgot password Service</h3>';
|
||||||
@@ -77,6 +77,7 @@ if($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']
|
|||||||
$passwd = implode('', $auxPass);
|
$passwd = implode('', $auxPass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$oSpool->config['MESS_PASSWORD'] = $passwd;
|
$oSpool->config['MESS_PASSWORD'] = $passwd;
|
||||||
|
|
||||||
$oSpool->create(array(
|
$oSpool->create(array(
|
||||||
@@ -97,55 +98,21 @@ if($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']
|
|||||||
));
|
));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$oSpool->sendMail();
|
$oSpool->sendMail();
|
||||||
|
|
||||||
$rbacUser->update($aData);
|
$rbacUser->update($aData);
|
||||||
$user->update($aData);
|
$user->update($aData);
|
||||||
|
|
||||||
G::header ("location: login.html");
|
G::header ("location: login.html");
|
||||||
G::SendTemporalMessage ('ID_NEW_PASSWORD_SENT', "info");
|
G::SendTemporalMessage ('ID_NEW_PASSWORD_SENT', "info");
|
||||||
}
|
} catch (phpmailerException $e) {
|
||||||
catch (phpmailerException $e) {
|
|
||||||
G::header ("location: login.html");
|
G::header ("location: login.html");
|
||||||
G::SendTemporalMessage (G::LoadTranslation('MISSING_OR_NOT_CONFIGURED_SMTP'), "warning", 'string');
|
G::SendTemporalMessage (G::LoadTranslation('MISSING_OR_NOT_CONFIGURED_SMTP'), "warning", 'string');
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch (Exception $e) {
|
|
||||||
G::header ("location: login.html");
|
G::header ("location: login.html");
|
||||||
G::SendTemporalMessage ($e->getMessage(), "warning", 'string');
|
G::SendTemporalMessage ($e->getMessage(), "warning", 'string');
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$msg = G::LoadTranslation('ID_USER') . ' ' . $data['USR_USERNAME'] . ' '. G::LoadTranslation('ID_IS_NOT_REGISTERED');
|
$msg = G::LoadTranslation('ID_USER') . ' ' . $data['USR_USERNAME'] . ' '. G::LoadTranslation('ID_IS_NOT_REGISTERED');
|
||||||
G::SendTemporalMessage ($msg, "warning", 'string');
|
G::SendTemporalMessage ($msg, "warning", 'string');
|
||||||
G::header('location: forgotPassword');
|
G::header('location: forgotPassword');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (! isset ( $_POST ))
|
if (! isset ( $_POST )) {
|
||||||
G::header ( 'location: /sys/' . $lang . '/' . SYS_SKIN . '/' . 'login/login' );
|
G::header ( 'location: /sys/' . $lang . '/' . SYS_SKIN . '/' . 'login/login' );
|
||||||
|
}
|
||||||
if (isset ( $_SESSION ['sysLogin'] ))
|
if (isset ( $_SESSION ['sysLogin'] )) {
|
||||||
$_POST ['form'] = $_SESSION ['sysLogin'];
|
$_POST ['form'] = $_SESSION ['sysLogin'];
|
||||||
|
}
|
||||||
require_once ('authentication.php');
|
require_once ('authentication.php');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user