Skip to content

Commit

Permalink
3.0.0.12
Browse files Browse the repository at this point in the history
Fix empty page after user password change
Fix user first connection with no items in DB
  • Loading branch information
nilsteampassnet committed Mar 3, 2022
1 parent b89b344 commit b78fc7e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion includes/config/include.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @see http://www.teampass.net
*/
define('TP_VERSION', '3.0.0');
define('TP_VERSION_FULL', TP_VERSION.'.11');
define('TP_VERSION_FULL', TP_VERSION.'.12');
define('TP_TOOL_NAME', 'Teampass');
define('TP_ONE_DAY_SECONDS', 86400);
define('TP_ONE_WEEK_SECONDS', 604800);
Expand Down
2 changes: 1 addition & 1 deletion includes/core/load.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ function(data) {
);
$("#dialog-user-change-password-progress").html('');
$('#dialog-user-change-password').addClass('hidden');
$('.content-header, .content').removelass('hidden');
$('.content-header, .content').removeClass('hidden');
}
}
);
Expand Down
2 changes: 1 addition & 1 deletion pages/items.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
<span class="ml-2 col-md-1 clear-me-html" id="form-item-icon-show"></span>
</div>
<small class='form-text text-muted'>
<?php echo langHdl('icon_tip'); ?>
<?php echo langHdl('folder_icon_tip'); ?>
</small>
</div>

Expand Down
20 changes: 17 additions & 3 deletions sources/main.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,20 @@ function isUserPasswordCorrect(
$post_user_id
);

if (DB::count() === 0) {
// This user has no items
// let's consider no items in DB
return prepareExchangedData(
$SETTINGS['cpassman_dir'],
array(
'error' => false,
'message' => '',
'debug' => '',
),
'encode'
);
}

// Get itemKey from current user
$currentUserKey = DB::queryFirstRow(
'SELECT share_key, increment_id
Expand All @@ -1256,7 +1270,7 @@ function isUserPasswordCorrect(
if (empty(base64_decode($itemKey)) === false) {
// GOOD password
return prepareExchangedData(
$SETTINGS['cpassman_dir'],
$SETTINGS['cpassman_dir'],
array(
'error' => false,
'message' => '',
Expand All @@ -1276,7 +1290,7 @@ function isUserPasswordCorrect(
if ($pwdlib->verifyPasswordHash(htmlspecialchars_decode($post_user_password), $userInfo['pw']) === true) {
// GOOD password
return prepareExchangedData(
$SETTINGS['cpassman_dir'],
$SETTINGS['cpassman_dir'],
array(
'error' => false,
'message' => '',
Expand All @@ -1293,7 +1307,7 @@ function isUserPasswordCorrect(
array(
'error' => true,
'message' => langHdl('password_is_not_correct'),
'debug' => isset($itemKey) === true ? base64_decode($itemKey) : '',
//'debug' => isset($itemKey) === true ? base64_decode($itemKey) : '',
),
'encode'
);
Expand Down

0 comments on commit b78fc7e

Please sign in to comment.