Skip to content

Commit

Permalink
* [FIX] Fixed issue when importing accounts from CSV file, the passwo…
Browse files Browse the repository at this point in the history
…rd wasn't encrypted. Solves #373
  • Loading branch information
nuxsmin committed Jan 19, 2017
1 parent fba9b9c commit bbe68a1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 32 deletions.
9 changes: 1 addition & 8 deletions inc/SP/Import/CsvImportBase.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function processAccounts()

foreach ($this->file->getFileContent() as $data) {
$line++;
$fields = str_getcsv($data, $this->ImportParams->getCsvDelimiter());
$fields = str_getcsv($data, $this->ImportParams->getCsvDelimiter(), '"');
$numfields = count($fields);

// Comprobar el número de campos de la línea
Expand All @@ -94,13 +94,6 @@ protected function processAccounts()
);
}

// Eliminar las " del principio/fin de los campos
// array_walk($fields,
// function (&$value, $key) {
// $value = trim($value, '"');
// }
// );

// Asignar los valores del array a variables
list($accountName, $customerName, $categoryName, $url, $login, $password, $notes) = $fields;

Expand Down
24 changes: 10 additions & 14 deletions js/app-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,23 +322,19 @@ sysPass.Main = function () {

// Función para habilitar la subida de archivos en una zona o formulario
var fileUpload = function ($obj) {
var requestData = function () {
return {
actionId: $obj.data("action-id"),
itemId: $obj.data("item-id"),
sk: sk.get()
};
var requestData = {
actionId: $obj.data("action-id"),
itemId: $obj.data("item-id"),
sk: sk.get()
};

var options = {
requestDoneAction: "",
setRequestData: function (data) {
var req = requestData();

$.extend(req, data);
$.extend(requestData, data);
},
getRequestData: function () {
return requestData();
return requestData;
},
beforeSendAction: "",
url: ""
Expand All @@ -355,10 +351,10 @@ sysPass.Main = function () {
fd.append("inFile", file);
fd.append("isAjax", 1);

var req = requestData();
requestData.sk = sk.get();

Object.keys(req).forEach(function (key) {
fd.append(key, req[key]);
Object.keys(requestData).forEach(function (key) {
fd.append(key, requestData[key]);
});

var opts = appRequests.getRequestOpts();
Expand All @@ -367,7 +363,7 @@ sysPass.Main = function () {
opts.contentType = false;
opts.data = fd;

appRequests.getActionPromise(opts, function (json) {
appRequests.getActionCall(opts, function (json) {
var status = json.status;
var description = json.description;

Expand Down
20 changes: 10 additions & 10 deletions js/app-main.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bbe68a1

Please sign in to comment.