Skip to content

Commit

Permalink
2.1.27
Browse files Browse the repository at this point in the history
Fix for #1850, #1856, #1857, #1862
  • Loading branch information
nilsteampassnet committed Aug 14, 2017
1 parent 4d23830 commit 77e75c9
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ VOLUME ${VOL}
# Configure nginx-php-fpm image to use this dir.
ENV WEBROOT ${VOL}/www

RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing gnu-libiconv
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php

RUN echo && \
# Install and configure missing PHP requirements
/usr/local/bin/docker-php-ext-configure bcmath && \
Expand Down
8 changes: 7 additions & 1 deletion api/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function teampass_connect()
require_once("../includes/config/settings.php");
require_once('../includes/libraries/Database/Meekrodb/db.class.php');
$pass = defuse_return_decrypted($pass);
DB::$host = $server;
DB::$host = $server;
DB::$user = $user;
DB::$password = $pass;
DB::$dbName = $database;
Expand Down Expand Up @@ -916,6 +916,9 @@ function rest_get()
if (empty($params[4])) {
$params[4] = 0;
}
if (empty($params[2])) {
rest_error('NO_DESTINATION_FOLDER');
}
if ($params[2] < 0) {
rest_error('NO_DATA_EXIST');
}
Expand Down Expand Up @@ -2099,6 +2102,9 @@ function rest_error($type, $detail = 'N/A')
case 'NO_DATA_EXIST':
$message = array('err' => 'No data exists');
break;
case 'NO_DESTINATION_FOLDER':
$message = array('err' => 'No destination folder provided');
break;
case 'PASSWORDTOOLONG':
$message = array('err' => 'Password is too long');
break;
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
Database password is encrypted in settings.php file
PHPMailer library updated to 5.2.23
Configuration variables are not set in SESSION anymore. Now read from tp.config.php file.
#1862 Import from Keepass.xml to Personalfolder no access to Item
#1857 API: Folders created at level 0 instead of correct level
#1856 Robustified tp.config.php creation in case of upgrade
#1851 Fix ldap suffix
#1850 Missing iconv in Docker
#1840 Added the "download" attribute
#1837 JSON error in Find page when user has no folders to browse
#1834 Typo in sources/main.functions.php
Expand Down
20 changes: 13 additions & 7 deletions install/upgrade_run_2.1.27.php
Original file line number Diff line number Diff line change
Expand Up @@ -680,23 +680,29 @@ function replace_a_line($data)
$config_text = "<?php
global \$SETTINGS;
\$SETTINGS = array (";
$any_settings = false;

$result = mysqli_query($db_link, "SELECT * FROM `".$pre."misc` WHERE type = 'admin'");
while ($row = mysqli_fetch_assoc($result)) {
// append new setting in config file
$config_text .= "
'".$row['intitule']."' => '".$row['valeur']."',";
if ($any_settings === false) {
$any_settings = true;
}
}
mysqli_free_result($result);

// write to config file
$result = fwrite(
$file_handler,
utf8_encode(
substr_replace($config_text, "", -1)."
);"
)
);
if ($any_settings === true) {
$result = fwrite(
$file_handler,
utf8_encode(
substr_replace($config_text, "", -1)."
);"
)
);
}
fclose($file_handler);


Expand Down
2 changes: 1 addition & 1 deletion items.import.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ function ImportKEEPASS(file)
{
type : "import_file_format_keepass",
file : file,
destination : $("#import_keepass_items_to").val()
destination : $("#import_keepass_items_to").val()
},
function(data) {
$("#kp_import_information").html(data[0].message + "<?php echo '<br><br><b>'.$LANG['alert_page_will_reload'].'</b>'; ?>");
Expand Down
7 changes: 6 additions & 1 deletion sources/import.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,12 @@ function recursiveKeepassXML($xmlRoot, $xmlLevel = 0)
$numItems.'<br /><br />';
$post_destination = filter_input(INPUT_POST, 'destination', FILTER_SANITIZE_STRING);

//if destination is not ROOT then get the complexity level
// If personal folder, then remove the suffix in ID
if (substr_count($post_destination, '-perso') > 0) {
$post_destination = str_replace('-perso', '', $post_destination);
}

// If destination is not ROOT then get the complexity level
if (strpos($post_destination, "perso") !== 0) {
$levelPwComplexity = 50;
$startPathLevel = 1;
Expand Down

0 comments on commit 77e75c9

Please sign in to comment.