Permalink
Browse files

some stuff

  • Loading branch information...
root
root committed Nov 19, 2012
1 parent 458e408 commit 8335ef8dcab5253b190e3969de595148f13605f4
Showing with 12 additions and 5 deletions.
  1. +2 −2 app.js
  2. +6 −0 config.js
  3. +4 −3 routes/index.js
View
4 app.js
@@ -1,12 +1,12 @@
try {
- process.setgid("node");
+ process.setgid("prismabox");
}
catch (err) {
console.log("Setting Group failed");
}
try {
- process.setuid("node");
+ process.setuid("prismabox");
}
catch (err) {
console.log("Setting User failed");
View
@@ -16,6 +16,12 @@ module.exports = {
'00185650f586' : {
uploadkey: 'f3bc423f3bda7247e0807e844baebdcc', // required
},
+ '001856519041' : {
+ uploadkey: '2c19819f8a9d9516af55d8f4567a4ce1'
+ ,
+ '001856519041' : {
+ uploadkey: '2c19819f8a9d9516af55d8f4567a4ce1'
+ }}
},
// If you need help finding a bug just turn on debugging.
View
@@ -35,7 +35,7 @@ exports.index = function(req, res){
exports.upload = function(req, res) {
var renderUpload = function(err, data) {
- var obj = data["SOAP-ENV:Body"]["ns1:UploadPhoto"];
+ var obj = data["SOAP-ENV:Envelope"]["SOAP-ENV:Body"][0]["ns1:UploadPhoto"][0];
var folder = config.folder;
if(config.cards[obj.macaddress].folder) {
folder = config.cards[obj.macaddress].folder;
@@ -133,15 +133,16 @@ exports.soap = function(req, res) {
//StartSession
//GetCardSettings
var renderStartSession = function(err, data) {
- var obj = data["SOAP-ENV:Body"]["ns1:StartSession"];
+ var obj = data["SOAP-ENV:Envelope"]["SOAP-ENV:Body"][0]["ns1:StartSession"][0];
+ console.log(obj.macaddress);
if(config.cards[obj.macaddress]) {
var credential = md5HexDigest(obj.macaddress + obj.cnonce + config.cards[obj.macaddress].uploadkey);
res.render('startSession', {layout:false, "credential": credential, "snonce":"d7eda40e374e8a34ee97554ebbfea0b5", "transfermodetimestamp": obj.transfermodetimestamp});
}
};
var renderGetPhotoStatus = function(err, data) {
- var obj = data["SOAP-ENV:Body"]["ns1:GetPhotoStatus"];
+ var obj = data["SOAP-ENV:Envelope"]["SOAP-ENV:Body"][0]["ns1:GetPhotoStatus"][0];
if(config.cards[obj.macaddress]) {
var credential = md5HexDigest(obj.macaddress + config.cards[obj.macaddress].uploadkey + "d7eda40e374e8a34ee97554ebbfea0b5");
res.render('getPhotoStatus', {layout:false});

0 comments on commit 8335ef8

Please sign in to comment.