| Conditions | 1 |
| Paths | 1 |
| Total Lines | 40 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | // Importers should always start with this |
||
| 4 | (function(window, $, PassmanImporter) { |
||
|
1 ignored issue
–
show
|
|||
| 5 | 'use strict'; |
||
| 6 | |||
| 7 | // Define the importer |
||
| 8 | PassmanImporter.zohoCsv = { |
||
| 9 | info: { |
||
| 10 | name: 'ZOHO csv', |
||
| 11 | id: 'zohoCsv', |
||
| 12 | description: 'Create an csv export. Go to Tools -> Export secrets -> Select "General CSV" and click "Export Secrets"' |
||
| 13 | } |
||
| 14 | }; |
||
| 15 | |||
| 16 | PassmanImporter.zohoCsv.readFile = function (file_data) { |
||
| 17 | return new C_Promise(function(){ |
||
| 18 | var parsed_csv = PassmanImporter.readCsv(file_data, false); |
||
| 19 | var credential_list = []; |
||
| 20 | for (var i = 0; i < parsed_csv.length; i++) { |
||
| 21 | var row = parsed_csv[i]; |
||
| 22 | var _credential = PassmanImporter.newCredential(); |
||
| 23 | _credential.label = row[0]; |
||
| 24 | _credential.username = row[3]; |
||
| 25 | _credential.password = row[4]; |
||
| 26 | _credential.url = row[1]; |
||
| 27 | _credential.description = row[2]; |
||
| 28 | if(_credential.label){ |
||
| 29 | credential_list.push(_credential); |
||
| 30 | } |
||
| 31 | |||
| 32 | var progress = { |
||
| 33 | percent: i/parsed_csv.length*100, |
||
| 34 | loaded: i, |
||
| 35 | total: parsed_csv.length |
||
| 36 | }; |
||
| 37 | |||
| 38 | this.call_progress(progress); |
||
| 39 | } |
||
| 40 | this.call_then(credential_list); |
||
| 41 | }) |
||
| 42 | }; |
||
| 43 | })(window, $, PassmanImporter); |
||
| 44 |