mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-26 03:19:05 +02:00
Merge branch '1082-some-modifications-in-change-pass-feature-dev' into 'develop'
Added some fixes to reset pass feature See merge request !677
This commit is contained in:
commit
9a791dc0a5
@ -1351,6 +1351,16 @@ CREATE TABLE IF NOT EXISTS `tcontainer` (
|
|||||||
|
|
||||||
INSERT INTO `tcontainer` SET `name` = 'Default graph container';
|
INSERT INTO `tcontainer` SET `name` = 'Default graph container';
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
-- Table `treset_pass_history`
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS `treset_pass_history` (
|
||||||
|
`id` int(10) unsigned NOT NULL auto_increment,
|
||||||
|
`id_user` varchar(60) NOT NULL,
|
||||||
|
`reset_moment` date default NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `tcontainer_item`
|
-- Table `tcontainer_item`
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
|
@ -584,6 +584,13 @@ if (! isset ($config['id_user'])) {
|
|||||||
$res = update_user_password ($id_user, $pass1);
|
$res = update_user_password ($id_user, $pass1);
|
||||||
if ($res) {
|
if ($res) {
|
||||||
$correct_reset_pass_process = __('Password changed successfully');
|
$correct_reset_pass_process = __('Password changed successfully');
|
||||||
|
|
||||||
|
$values = array();
|
||||||
|
$values['id_user'] = $id_user;
|
||||||
|
$reset_pass_moment = new DateTime('now');
|
||||||
|
$reset_pass_moment = $reset_pass_moment->format("Y-m-d H:i:s");
|
||||||
|
$values['reset_moment'] = $reset_pass_moment;
|
||||||
|
db_process_sql_insert('treset_pass_history', $values);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$process_error_message = __('Failed to change password');
|
$process_error_message = __('Failed to change password');
|
||||||
@ -641,7 +648,7 @@ if (! isset ($config['id_user'])) {
|
|||||||
|
|
||||||
if (!$check_user) {
|
if (!$check_user) {
|
||||||
$reset = false;
|
$reset = false;
|
||||||
$error = __('User doesn\'t exist in database');
|
$error = __('Error in reset password request');
|
||||||
$show_error = true;
|
$show_error = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1143,6 +1143,16 @@ CREATE TABLE IF NOT EXISTS `tuser_double_auth` (
|
|||||||
FOREIGN KEY (`id_user`) REFERENCES tusuario(`id_user`) ON DELETE CASCADE
|
FOREIGN KEY (`id_user`) REFERENCES tusuario(`id_user`) ON DELETE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
-- Table `treset_pass_history`
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS `treset_pass_history` (
|
||||||
|
`id` int(10) unsigned NOT NULL auto_increment,
|
||||||
|
`id_user` varchar(60) NOT NULL,
|
||||||
|
`reset_moment` datetime not null default 0,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
-- ----------------------------------------------------------------------
|
-- ----------------------------------------------------------------------
|
||||||
-- Table `tnews`
|
-- Table `tnews`
|
||||||
-- ----------------------------------------------------------------------
|
-- ----------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user