BUG 0000 Forgot passwod feature (finished)
This commit is contained in:
@@ -45,7 +45,7 @@ if ($RBAC->userCanAccess('PM_SETUP') == 1)
|
||||
$G_TMP_MENU->AddIdRawOption('ADDITIONAL_TABLES', '../additionalTables/additionalTablesList', G::LoadTranslation('ID_ADDITIONAL_TABLES'), 'icon-tables.png','', 'settings');
|
||||
$G_TMP_MENU->AddIdRawOption('WEBSERVICES', 'webServices', G::LoadTranslation('ID_WEB_SERVICES'), 'icon-webservices.png', '', 'settings');
|
||||
$G_TMP_MENU->AddIdRawOption('LOG_CASE_SCHEDULER', '../cases/cases_Scheduler_Log', G::LoadTranslation('ID_LOG_CASE_SCHEDULER'), "icon-logs-list.png",'', 'settings');
|
||||
|
||||
$G_TMP_MENU->AddIdRawOption('LOGIN', 'loginSettings', G::LoadTranslation('LOGIN'), "",'', 'settings');
|
||||
|
||||
//tools options
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1)
|
||||
|
||||
@@ -1,25 +1,31 @@
|
||||
<?php
|
||||
$data=$_POST['form'];
|
||||
$data = $_POST['form'];
|
||||
global $RBAC;
|
||||
require_once PATH_RBAC."model/RbacUsers.php";
|
||||
$oUser = new RbacUsers();
|
||||
$aFields=$oUser->getByUsername($data['USR_USERNAME']);
|
||||
if($aFields['USR_EMAIL']==$data['USR_EMAIL'])
|
||||
{
|
||||
require_once ( "classes/class.pmFunctions.php" );
|
||||
require_once ( "classes/class.pmFunctions.php" );
|
||||
require_once 'classes/model/Users.php';
|
||||
G::LoadClass("system");
|
||||
|
||||
$rbacUser = new RbacUsers();
|
||||
$user = new Users();
|
||||
|
||||
$userData = $rbacUser->getByUsername($data['USR_USERNAME']);
|
||||
|
||||
if($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']) {
|
||||
|
||||
$aSetup = getEmailConfiguration();
|
||||
// generate a new password
|
||||
$newPass=G::generate_password();
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$aData['USR_UID'] = $aFields['USR_UID'];
|
||||
$newPass = G::generate_password();
|
||||
|
||||
$aData['USR_UID'] = $userData['USR_UID'];
|
||||
$aData['USR_PASSWORD'] = md5($newPass);
|
||||
$RBAC->updateUser($aData,'PROCESSMAKER_ADMIN');
|
||||
G::LoadClass("system");
|
||||
|
||||
$rbacUser->update($aData);
|
||||
$user->update($aData);
|
||||
|
||||
$sFrom = ($aSetup['MESS_ACCOUNT'] != '' ? $aSetup['MESS_ACCOUNT'] . ' ' : '') . '<' . $aSetup['MESS_ACCOUNT'] . '>';
|
||||
$sSubject = G::LoadTranslation('ID_RESET_PASSWORD').' - ProcessMaker' ;
|
||||
$msg = '<h3>'.G::LoadTranslation('ID_THANKS_USE_SERVICES').'.</h3>';
|
||||
$msg .='<p>'.G::LoadTranslation('ID_YOUR_USERMANE_IS').' : <strong>'.$aFields['USR_USERNAME'].'</strong></p>';
|
||||
$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_PASSWORD_IS').' : <strong>'.$newPass.'</strong></p>';
|
||||
switch ($aSetup['MESS_ENGINE']) {
|
||||
case 'MAIL':
|
||||
@@ -74,11 +80,9 @@ if($aFields['USR_EMAIL']==$data['USR_EMAIL'])
|
||||
|
||||
$oSpool->sendMail();
|
||||
G::header ("location: login.html");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$msg=G::LoadTranslation('ID_USER_NOT_REGISTER');
|
||||
G::SendTemporalMessage ('ID_NEW_PASSWORD_SENT', "info");
|
||||
} else {
|
||||
$msg = G::LoadTranslation('ID_USER') . ' ' . $data['USR_USERNAME'] . ' '. G::LoadTranslation('ID_USER_NOT_REGISTERED');
|
||||
G::SendTemporalMessage ($msg, "warning");
|
||||
$G_PUBLISH = new Publisher ();
|
||||
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'login/forgotPassword', '','', SYS_URI . 'login/authentication.php' );
|
||||
|
||||
@@ -44,17 +44,7 @@ switch($request){
|
||||
);
|
||||
}
|
||||
}
|
||||
if($_GET['menu'] == 'settings' ){
|
||||
$items[] = Array(
|
||||
'id' => 'login',
|
||||
'url' => 'loginSettings',
|
||||
'text' => 'Login',
|
||||
'loaded' => true,
|
||||
'leaf' => true,
|
||||
'cls' => 'pm-tree-node',
|
||||
'iconCls'=> 'ICON_'
|
||||
);
|
||||
}
|
||||
|
||||
if( isset($_SESSION['DEV_FLAG']) && $_SESSION['DEV_FLAG'] && $_GET['menu'] == 'settings' ){
|
||||
$items[] = Array(
|
||||
'id' => 'translations',
|
||||
@@ -71,4 +61,4 @@ switch($request){
|
||||
echo G::json_encode($items);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -755,6 +755,13 @@ antes funcionaba.
|
||||
background-position:0 -14833px !important;
|
||||
}
|
||||
|
||||
.ICON_LOGIN{
|
||||
/*ss_key*/
|
||||
background-image:url( /images/icons_silk/sprites.png) !important;
|
||||
background-position:0 -8929px !important;
|
||||
}
|
||||
|
||||
|
||||
/* Language Support module styles*/
|
||||
.upload-icon {
|
||||
background: url('/images/cases-documents.png') no-repeat 0 0 !important;
|
||||
|
||||
41
workflow/engine/xmlform/login/forgotPassword.html
Normal file
41
workflow/engine/xmlform/login/forgotPassword.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<form id="{$form_id}" name="{$form_name}" action="{$form_action}" class="{$form_className}" method="post" encType="multipart/form-data" style="margin:0px;" onsubmit="return validateForm('{$form_objectRequiredFields}');"> <div class="borderForm" style="width:{$form_width}; padding-left:0; padding-right:0; border-width:{$form_border};">
|
||||
<div class="boxTop"><div class="a"></div><div class="b"></div><div class="c"></div></div>
|
||||
<div class="content" style="height:{$form_height};" >
|
||||
<table width="99%">
|
||||
<tr>
|
||||
<td valign='top'>
|
||||
<input type="hidden" class="notValidateThisFields" name="__notValidateThisFields__" id="__notValidateThisFields__" value="{$form_objectRequiredFields}" />
|
||||
<input type="hidden" name="DynaformRequiredFields" id="DynaformRequiredFields" value="{$form_objectRequiredFields}" />
|
||||
<table cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class='FormTitle' colspan="2" align="">{$form.TITLE}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='FormLabel' width="{$form_labelWidth}"><font color="red">* </font>{$USR_USERNAME}</td>
|
||||
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.USR_USERNAME}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='FormLabel' width="{$form_labelWidth}"><font color="red">* </font>{$USR_EMAIL}</td>
|
||||
<td class='FormFieldContent' width='{$form_fieldContentWidth}' >{$form.USR_EMAIL}</td>
|
||||
</tr>
|
||||
<tr style="display: none">
|
||||
<td colspan="2">{$form.URL}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='FormButton' colspan="2" align="center">{$form.BSUBMIT} {$form.BCANCEL}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="boxBottom"><div class="a"></div><div class="b"></div><div class="c"></div></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
{$form.JS}
|
||||
</script>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
try {literal}{{/literal} dynaformSetFocus();}catch(e){literal}{{/literal}}
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm name="login" version="1.0" basedir="" xmlform_type="NORMAL" width="400px">
|
||||
<dynaForm name="login" version="1.0" basedir="" xmlform_type="NORMAL" width="400px" enabletemplate="1">
|
||||
<TITLE type="title">
|
||||
<en>I forgot my password</en>
|
||||
</TITLE>
|
||||
@@ -14,6 +14,9 @@
|
||||
<BSUBMIT type="submit">
|
||||
<en>Send Request</en>
|
||||
</BSUBMIT>
|
||||
<BCANCEL type="button" onclick="history.back()">
|
||||
<en>Cancel</en>
|
||||
</BCANCEL>
|
||||
<JS type="javascript"><![CDATA[
|
||||
var panel;
|
||||
|
||||
|
||||
@@ -609,11 +609,7 @@ $startingTime = array_sum(explode(' ',microtime()));
|
||||
}
|
||||
if ($bRedirect) {
|
||||
if (empty($_POST)) {
|
||||
//if(SYS_TARGET != 'forgotPassword')
|
||||
header('location: ' . SYS_URI . 'login/login?u=' . urlencode($_SERVER['REQUEST_URI']));
|
||||
//else
|
||||
//header('location: ' . SYS_URI . 'login/forgotPassword');
|
||||
|
||||
}
|
||||
else {
|
||||
header('location: ' . SYS_URI . 'login/login');
|
||||
|
||||
Reference in New Issue
Block a user