HOR-4133
This commit is contained in:
committed by
Paula Quispe
parent
50ab4cb5f0
commit
d1f6a3126c
@@ -9,11 +9,12 @@ $rbacUser = new RbacUsers();
|
|||||||
$user = new Users();
|
$user = new Users();
|
||||||
$data['USR_USERNAME'] = strip_tags($data['USR_USERNAME']);
|
$data['USR_USERNAME'] = strip_tags($data['USR_USERNAME']);
|
||||||
$userData = $rbacUser->getByUsername($data['USR_USERNAME']);
|
$userData = $rbacUser->getByUsername($data['USR_USERNAME']);
|
||||||
|
$userExists = $userData === false ? false : true;
|
||||||
|
|
||||||
if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'] && ($userData['USR_AUTH_TYPE'] === '' || $userData['USR_AUTH_TYPE'] == 'MYSQL') ) {
|
if ($userExists && $userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'] && ($userData['USR_AUTH_TYPE'] === '' || $userData['USR_AUTH_TYPE'] == 'MYSQL')) {
|
||||||
$aSetup = System::getEmailConfiguration();
|
$aSetup = System::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");
|
||||||
G::header('location: forgotPassword');
|
G::header('location: forgotPassword');
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
@@ -28,17 +29,13 @@ if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'
|
|||||||
$aUserPropertyData['USR_LOGGED_NEXT_TIME'] = 1;
|
$aUserPropertyData['USR_LOGGED_NEXT_TIME'] = 1;
|
||||||
$oUserProperty = $oUserProperty->update($aUserPropertyData);
|
$oUserProperty = $oUserProperty->update($aUserPropertyData);
|
||||||
}
|
}
|
||||||
/* **Save after sending the mail
|
|
||||||
$rbacUser->update($aData);
|
|
||||||
$user->update($aData);
|
|
||||||
*/
|
|
||||||
|
|
||||||
$sFrom = G::buildFrom($aSetup, $sFrom);
|
$sFrom = G::buildFrom($aSetup, $sFrom);
|
||||||
|
|
||||||
$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>';
|
||||||
$msg .='<p>'.G::LoadTranslation('ID_YOUR_USERMANE_IS').' : <strong>'.$userData['USR_USERNAME'].'</strong></p>';
|
$msg .= '<p>' . G::LoadTranslation('ID_YOUR_USERMANE_IS') . ' : <strong>' . $userData['USR_USERNAME'] . '</strong></p>';
|
||||||
$msg .='<p>'.G::LoadTranslation('ID_YOUR_PASSWORD_IS').' : <strong>'.$newPass.'</strong></p>';
|
$msg .= '<p>' . G::LoadTranslation('ID_YOUR_PASSWORD_IS') . ' : <strong>' . $newPass . '</strong></p>';
|
||||||
switch ($aSetup['MESS_ENGINE']) {
|
switch ($aSetup['MESS_ENGINE']) {
|
||||||
case 'MAIL':
|
case 'MAIL':
|
||||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_1');
|
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_1');
|
||||||
@@ -53,10 +50,10 @@ if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'
|
|||||||
|
|
||||||
$sBody = "
|
$sBody = "
|
||||||
<table style=\"background-color: white; font-family: Arial,Helvetica,sans-serif; color: black; font-size: 11px; text-align: left;\" cellpadding='10' cellspacing='0' width='100%'>
|
<table style=\"background-color: white; font-family: Arial,Helvetica,sans-serif; color: black; font-size: 11px; text-align: left;\" cellpadding='10' cellspacing='0' width='100%'>
|
||||||
<tbody><tr><td><img id='logo' src='http://".$_SERVER['SERVER_NAME']."/images/processmaker.logo.jpg' /></td></tr>
|
<tbody><tr><td><img id='logo' src='http://" . $_SERVER['SERVER_NAME'] . "/images/processmaker.logo.jpg' /></td></tr>
|
||||||
<tr><td style='font-size: 14px;'>$msg</td></tr>
|
<tr><td style='font-size: 14px;'>$msg</td></tr>
|
||||||
<tr><td style='vertical-align:middel;'>
|
<tr><td style='vertical-align:middel;'>
|
||||||
<br /><hr><b>This Business Process is powered by ProcessMaker ver. ".System::getVersion().".<b><br />
|
<br /><hr><b>This Business Process is powered by ProcessMaker ver. " . System::getVersion() . ".<b><br />
|
||||||
<a href='http://www.processmaker.com' style='color:#c40000;'>www.processmaker.com</a><br /></td>
|
<a href='http://www.processmaker.com' style='color:#c40000;'>www.processmaker.com</a><br /></td>
|
||||||
</tr></tbody></table>";
|
</tr></tbody></table>";
|
||||||
|
|
||||||
@@ -64,20 +61,20 @@ if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'
|
|||||||
|
|
||||||
$oSpool->setConfig($aSetup);
|
$oSpool->setConfig($aSetup);
|
||||||
$oSpool->create(array(
|
$oSpool->create(array(
|
||||||
'msg_uid' => '',
|
'msg_uid' => '',
|
||||||
'app_uid' => '',
|
'app_uid' => '',
|
||||||
'del_index' => 0,
|
'del_index' => 0,
|
||||||
'app_msg_type' => 'TEST',
|
'app_msg_type' => 'TEST',
|
||||||
'app_msg_subject' => $sSubject,
|
'app_msg_subject' => $sSubject,
|
||||||
'app_msg_from' => $sFrom,
|
'app_msg_from' => $sFrom,
|
||||||
'app_msg_to' => $data['USR_EMAIL'],
|
'app_msg_to' => $data['USR_EMAIL'],
|
||||||
'app_msg_body' => $sBody,
|
'app_msg_body' => $sBody,
|
||||||
'app_msg_cc' => '',
|
'app_msg_cc' => '',
|
||||||
'app_msg_bcc' => '',
|
'app_msg_bcc' => '',
|
||||||
'app_msg_attach' => '',
|
'app_msg_attach' => '',
|
||||||
'app_msg_template' => '',
|
'app_msg_template' => '',
|
||||||
'app_msg_status' => 'pending',
|
'app_msg_status' => 'pending',
|
||||||
'app_msg_attach'=>''
|
'app_msg_attach' => ''
|
||||||
));
|
));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -94,12 +91,12 @@ if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'
|
|||||||
G::SendTemporalMessage($e->getMessage(), "warning", 'string');
|
G::SendTemporalMessage($e->getMessage(), "warning", 'string');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($userData['USR_AUTH_TYPE'] === '' || $userData['USR_AUTH_TYPE'] === 'MYSQL') {
|
if ($userExists === false || $userData['USR_AUTH_TYPE'] === '' || $userData['USR_AUTH_TYPE'] === 'MYSQL') {
|
||||||
$msg = G::LoadTranslation('ID_USER') . ' ' . htmlentities($data['USR_USERNAME'], ENT_QUOTES, 'UTF-8') . ' '. G::LoadTranslation('ID_IS_NOT_REGISTERED');
|
$msg = G::LoadTranslation('ID_USER') . ' ' . htmlentities($data['USR_USERNAME'], ENT_QUOTES, 'UTF-8') . ' ' . G::LoadTranslation('ID_IS_NOT_REGISTERED');
|
||||||
} else {
|
} else {
|
||||||
$msg = G::LoadTranslation('ID_USER_NOT_FUNCTIONALITY');
|
$msg = G::LoadTranslation('ID_USER_NOT_FUNCTIONALITY');
|
||||||
}
|
}
|
||||||
G::SendTemporalMessage ($msg, "warning", 'string');
|
G::SendTemporalMessage($msg, "warning", 'string');
|
||||||
G::header('location: forgotPassword');
|
G::header('location: forgotPassword');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user