Added importer for universal password manager csv format
This commit is contained in:
parent
b5b706fe06
commit
9405be03b0
|
@ -38,6 +38,9 @@
|
|||
case 'firefoxpasswordexportercsvxml':
|
||||
importFirefoxPasswordExporterCsvXml(file, success, error);
|
||||
break;
|
||||
case 'upmcsv':
|
||||
importUpmCsv(file, success, error);
|
||||
break;
|
||||
default:
|
||||
error();
|
||||
break;
|
||||
|
@ -749,5 +752,33 @@
|
|||
}
|
||||
}
|
||||
|
||||
function importUpmCsv(file, success, error) {
|
||||
Papa.parse(file, {
|
||||
encoding: 'UTF-8',
|
||||
complete: function (results) {
|
||||
parseCsvErrors(results);
|
||||
|
||||
var folders = [],
|
||||
sites = [],
|
||||
siteRelationships = [];
|
||||
|
||||
angular.forEach(results.data, function (value, key) {
|
||||
if (value.length === 5) {
|
||||
sites.push({
|
||||
favorite: false,
|
||||
uri: value[3] && value[3] !== '' ? trimUri(value[3]) : null,
|
||||
username: value[1] && value[1] !== '' ? value[1] : null,
|
||||
password: value[2] && value[2] !== '' ? value[2] : null,
|
||||
notes: value[4] && value[4] !== '' ? value[4] : null,
|
||||
name: value[0] && value[0] !== '' ? value[0] : '--',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
success(folders, sites, siteRelationships);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return _service;
|
||||
});
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<option value="keypassxml">KeyPass (xml)</option>
|
||||
<option value="padlockcsv">Padlock (csv)</option>
|
||||
<option value="1password1pif">1Password (1pif)</option>
|
||||
<option value="upmcsv">Universal Password Manager (csv)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
Loading…
Reference in New Issue