forked from dmolchanenko/RedwoodHQ
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed git-ls, fixed modify user bug, added javascript support
- Loading branch information
1 parent
d66d350
commit 42f7699
Showing
14 changed files
with
115 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,6 @@ | |
, "optimist" : "0.5.2" | ||
, "forever-monitor" : "1.1.0" | ||
, "xml-writer" : "1.4.0" | ||
, "nodemailer" : "0.5.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
exports.Get = function(req, res){ | ||
var app = require('../common'); | ||
var db = app.getDB(); | ||
|
||
db.collection('emailsettings', function(err, collection) { | ||
collection.findOne({}, {}, function(err, settings) { | ||
if(settings == null){ | ||
res.contentType('json'); | ||
res.json({}); | ||
} | ||
else{ | ||
if (settings.password) settings.password = "**********************"; | ||
res.contentType('json'); | ||
res.json(settings); | ||
} | ||
}) | ||
}) | ||
|
||
}; | ||
|
||
exports.Post = function(req, res){ | ||
var app = require('../common'); | ||
var db = app.getDB(); | ||
var data = req.body; | ||
db.collection('emailsettings', function(err, collection) { | ||
collection.findOne({}, {}, function(err, settings) { | ||
if(settings == null){ | ||
collection.insert(data,{safe:true},function(err,returnData){ | ||
res.contentType('json'); | ||
res.json({success:true}); | ||
}) | ||
} | ||
else{ | ||
data._id = settings._id; | ||
if (data.password == "**********************") data.password = settings.password; | ||
collection.save(data,{safe:true},function(err){ | ||
res.contentType('json'); | ||
res.json({success:true}); | ||
}); | ||
} | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
var fs = require('fs'); | ||
Grid = require('mongodb').Grid; | ||
MongoDB = require('mongodb'); | ||
|
||
exports.Post = function(req, res){ | ||
var db = require('../common').getDB(); | ||
var tmp_path = req.files.file.path; | ||
var id = req.files.file.name; | ||
var gridStore = new Grid(db, id, 'w'); | ||
|
||
gridStore.writeFile(tmp_path,function(err, doc){ | ||
fs.unlink(tmp_path); | ||
res.contentType('json'); | ||
res.json({ | ||
success: true | ||
}); | ||
}); | ||
|
||
}; | ||
|
||
exports.Get = function(req, res){ | ||
var db = require('../common').getDB(); | ||
|
||
Grid.read(db, id, function(err, data) { | ||
if(data){ | ||
res.contentType("application/octet-stream"); | ||
res.end(data, "binary"); | ||
} | ||
else{ | ||
res.end("Error: file not found.", "utf8"); | ||
} | ||
|
||
}); | ||
db.collection('screenshots', function(err, collection) { | ||
collection.findOne({_id:req.params.id}, {},function(err,file){ | ||
if(file != null){ | ||
res.contentType("image/png"); | ||
res.end(file.file.buffer, "binary"); | ||
} | ||
else{ | ||
res.end("Error: file not found.", "utf8"); | ||
} | ||
//fs.writeFile("c:/tmp/image.png",file.file.buffer,{encoding:"binary"},function(){ | ||
// console.log("all done") | ||
//}) | ||
}) | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters