Comparing version 0.0.56 to 0.0.57
@@ -35,3 +35,3 @@ var path = require('path'); | ||
name: '/unifile-assets', | ||
path: path.join(__dirname, '/../../unifile-assets/') | ||
path: path.join(__dirname, '/../unifile-assets/') | ||
} | ||
@@ -38,0 +38,0 @@ ]; |
@@ -69,3 +69,3 @@ /** | ||
//response.send(401, '<html><head>'+exports.config.AUTH_ERROR_FORM_HEAD_HTML+'</head><body>'+exports.config.AUTH_ERROR_FORM_BODY_HTML.replace('$username', request.param('username'))+exports.config.AUTH_FORM_BODY_HTML+'</body></html>'); | ||
utils.displayLoginForm(401, response, options.ftp.LOGIN_TEMPLATE_PATH, options.ftp.LOGIN_CSS_PATH, {error: true}); | ||
utils.displayLoginForm(401, response, options.ftp.LOGIN_TEMPLATE_PATH, options.ftp.LOGIN_CSS_PATH, {error: true, host: request.param('host'), username: request.param('username'), port: request.param('port') }); | ||
} | ||
@@ -347,9 +347,43 @@ }); | ||
else { | ||
ftpClientsArray[request.session.ftpClientId].delete(path, function (err) { | ||
if (err){ | ||
console.error(err); | ||
var parentDir = pathModule.dirname(path); | ||
ftpClientsArray[request.session.ftpClientId].list(parentDir, function(err, filesArray) { | ||
if(err) | ||
{ | ||
cbk({success:false, message: err}); | ||
} | ||
else | ||
cbk({success:true}); | ||
{ | ||
var filename = pathModule.basename(path); | ||
var item = filesArray.filter(function(x){ return x.name ===filename; }); | ||
// path not found | ||
if(item.length===0) | ||
{ | ||
cbk({success:false, message: 'path not found'}); | ||
} | ||
// path is a directory | ||
else if(item[0].type=='d') | ||
{ | ||
ftpClientsArray[request.session.ftpClientId].rmdir(path, true, function (err) { | ||
if (err){ | ||
cbk({success:false, message: err}); | ||
} | ||
else | ||
{ | ||
cbk({success:true}); | ||
} | ||
}); | ||
} | ||
// path is a file | ||
else | ||
{ | ||
ftpClientsArray[request.session.ftpClientId].delete(path, function (err) { | ||
if (err){ | ||
cbk({success:false, message: err}); | ||
} | ||
else | ||
cbk({success:true}); | ||
}); | ||
} | ||
} | ||
}); | ||
@@ -356,0 +390,0 @@ } |
{ | ||
"name": "unifile", | ||
"description": "Express middleware to provide a common API for cloud storage services. ", | ||
"version": "0.0.56", | ||
"author": { | ||
"name": "Alex Hoyau aka lexoyo" | ||
}, | ||
"version": "0.0.57", | ||
"contributors": [ | ||
{ | ||
"name": "Thomas Fetiveau aka zabojad" | ||
} | ||
{"name": "@lexoyo"}, | ||
{"name": "@JbIPS"}, | ||
{"name": "@zabojad"}, | ||
{"name": "@tfeserver"} | ||
], | ||
@@ -13,0 +11,0 @@ "dependencies": { |
@@ -15,3 +15,3 @@ #Unifile, unified access to cloud storage services. | ||
* local web server: auth and browse a given folder on the server where unifile is running | ||
* self hosting mode (we call it "open pages"): auth with [Mozilla persona](https://www.mozilla.org/en-US/persona/), choose a name and brose a folder on the server where unifile is installed and which is served as `http(s)://the-unifile-server.com/chosen-name/` - this is an experimental feature which still has to be fine tuned | ||
* self hosting mode (we call it "open pages"): auth with [Mozilla persona](https://www.mozilla.org/en-US/persona/), choose a name and browse a folder on the server where unifile is installed and which is served as `http(s)://the-unifile-server.com/chosen-name/` - this is an experimental feature which still has to be fine tuned | ||
* extend unifile: see instructions bellow to add a service | ||
@@ -166,3 +166,3 @@ | ||
* add your .js file in lib/services/ (duplicate the lib/services/dropbox.js file in order to have all the required methods) | ||
* edit core/router.js to make your service reachable | ||
* edit lib/default-config.js to make your service reachable | ||
* if you use an external node.js library, add the dependency in package.json | ||
@@ -169,0 +169,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
165457
22
39
3719