Skip to content

Commit

Permalink
3.0.0.13
Browse files Browse the repository at this point in the history
Several fixes after tests
  • Loading branch information
nilsteampassnet committed Mar 6, 2022
1 parent 596b792 commit 7f8c79d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
4 changes: 2 additions & 2 deletions install/install.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,8 @@ function encryptFollowingDefuse($message, $ascii_key)
`bloquer_modification` tinyint(1) NOT null DEFAULT '0',
`personal_folder` tinyint(1) NOT null DEFAULT '0',
`renewal_period` int(5) NOT null DEFAULT '0',
`fa_icon` VARCHAR(100) NOT NULL DEFAULT 'fa-folder',
`fa_icon_selected` VARCHAR(100) NOT NULL DEFAULT 'fa-folder-open',
`fa_icon` VARCHAR(100) NOT NULL DEFAULT 'fas fa-folder',
`fa_icon_selected` VARCHAR(100) NOT NULL DEFAULT 'fas fa-folder-open',
PRIMARY KEY (`id`),
KEY `nested_tree_parent_id` (`parent_id`),
KEY `nested_tree_nleft` (`nleft`),
Expand Down
18 changes: 14 additions & 4 deletions install/upgrade_run_3.0.0.php
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@
$res = addColumnIfNotExist(
$pre . 'nested_tree',
'fa_icon',
"VARCHAR(100) NOT NULL DEFAULT 'fa-folder'"
"VARCHAR(100) NOT NULL DEFAULT 'fas fa-folder'"
);
if ($res === false) {
echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field fa_icon to table NESTED_TREE! ' . mysqli_error($db_link) . '!"}]';
Expand All @@ -614,7 +614,7 @@
$res = addColumnIfNotExist(
$pre . 'nested_tree',
'fa_icon_selected',
"VARCHAR(100) NOT NULL DEFAULT 'fa-folder-open'"
"VARCHAR(100) NOT NULL DEFAULT 'fas fa-folder-open'"
);
if ($res === false) {
echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field fa_icon_selected to table NESTED_TREE! ' . mysqli_error($db_link) . '!"}]';
Expand Down Expand Up @@ -645,8 +645,18 @@


//---> 3.0.0.13
mysqli_num_rows(mysqli_query($db_link, "UPDATE `" . $pre . "nested_tree` SET `fa_icon` = 'fas fa-folder' WHERE fa_icon = 'fa-folder'"));
mysqli_num_rows(mysqli_query($db_link, "UPDATE `" . $pre . "nested_tree` SET `fa_icon_selected` = 'fas fa-folder-open' WHERE fa_icon_selected = 'fa-folder-open'"));
mysqli_query($db_link, "UPDATE `" . $pre . "nested_tree` SET `fa_icon` = 'fas fa-folder' WHERE fa_icon = 'fa-folder'");
mysqli_query($db_link, "UPDATE `" . $pre . "nested_tree` SET `fa_icon_selected` = 'fas fa-folder-open' WHERE fa_icon_selected = 'fa-folder-open'");

// Alter table nested_tree
mysqli_query(
$db_link,
"ALTER TABLE `" . $pre . "nested_tree` CHANGE `fa_icon` `fa_icon` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'fas fa-folder';"
);
mysqli_query(
$db_link,
"ALTER TABLE `" . $pre . "nested_tree` CHANGE `fa_icon_selected` `fa_icon_selected` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'fas fa-folder-open';"
);
//---<


Expand Down
7 changes: 6 additions & 1 deletion pages/items.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,9 @@ function(teampassApplication) {
if (selectedFolder.parent !== undefined && selectedFolder.parent !== '') {
$('#form-folder-add-parent').val(selectedFolder.parent.split('_')[1]).change();
}

$('#form-folder-add-label, #form-folder-add-parent').prop('disabled', false);

$('#form-folder-add-label')
.val('')
.focus();
Expand Down Expand Up @@ -526,7 +529,9 @@ function(teampassApplication) {
.val(store.get('teampassApplication').selectedFolderParentTitle)
.focus();
// is PF 1st level
if (store.get('teampassApplication').selectedFolderIsPF === 1 || store.get('teampassApplication').userCanEdit === 0) {
if (store.get('teampassApplication').selectedFolderIsPF === 1 && store.get('teampassApplication').selectedFolderParentId !== 0) {
$('#form-folder-add-label, #form-folder-add-parent').prop('disabled', false);
} else if (store.get('teampassApplication').userCanEdit === 0) {
$('#form-folder-add-label, #form-folder-add-parent').prop('disabled', true);
} else {
$('#form-folder-add-label, #form-folder-add-parent').prop('disabled', false);
Expand Down
4 changes: 2 additions & 2 deletions sources/import.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
fclose($fp);
} else {
echo prepareExchangedData(
$SETTINGS['cpassman_dir'],
$SETTINGS['cpassman_dir'],
array(
'error' => true,
'message' => langHdl('cannot_open_file'),
Expand Down Expand Up @@ -272,7 +272,7 @@

// Show results to user.
echo prepareExchangedData(
$SETTINGS['cpassman_dir'],
$SETTINGS['cpassman_dir'],
array(
'error' => false,
'message' => '',
Expand Down
2 changes: 1 addition & 1 deletion sources/items.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -5975,7 +5975,7 @@
// Build array
$arr_data['folders'][$inc]['id'] = intval($folder->id);
$arr_data['folders'][$inc]['level'] = intval($folder->nlevel);
$arr_data['folders'][$inc]['title'] = ($folder->title === $_SESSION['user_id'] && (int) $folder->nlevel === 1) ? htmlspecialchars_decode($_SESSION['login']) : htmlspecialchars_decode($folder->title, ENT_QUOTES);
$arr_data['folders'][$inc]['title'] = ((int) $folder->title === (int) $_SESSION['user_id'] && (int) $folder->nlevel === 1) ? htmlspecialchars_decode($_SESSION['login']) : htmlspecialchars_decode($folder->title, ENT_QUOTES);
$arr_data['folders'][$inc]['disabled'] = $disabled;
$arr_data['folders'][$inc]['parent_id'] = intval($folder->parent_id);
$arr_data['folders'][$inc]['perso'] = intval($folder->personal_folder);
Expand Down
2 changes: 2 additions & 0 deletions sources/users.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -2686,6 +2686,8 @@
'bloquer_creation' => '0',
'bloquer_modification' => '0',
'personal_folder' => '1',
'fa_icon' => 'fas fa-folder',
'fa_icon_selected' => 'fas fa-folder-open',
)
);

Expand Down

0 comments on commit 7f8c79d

Please sign in to comment.