From 09bc893680e6967729f6ccbd652c6531e84dc386 Mon Sep 17 00:00:00 2001 From: konekoneko Date: Fri, 16 Nov 2012 19:50:12 +0900 Subject: [PATCH] =?utf8?q?=E7=AE=A1=E7=90=86=E3=83=A2=E3=83=BC=E3=83=89?= =?utf8?q?=E3=81=A7=E8=A9=B3=E7=B4=B0=E7=94=BB=E9=9D=A2=E3=82=92=E9=96=8B?= =?utf8?q?=E3=81=84=E3=81=9F=E3=81=A8=E3=81=8D=E3=81=AF=E3=83=91=E3=82=B9?= =?utf8?q?=E3=83=AF=E3=83=BC=E3=83=89=E3=81=AE=E5=85=A5=E5=8A=9B=E3=82=92?= =?utf8?q?=E6=B1=82=E3=82=81=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= =?utf8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- profile.js | 12 +++++++++--- public/profile/detail.ejs | 4 +++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/profile.js b/profile.js index 8fef58b..2960b83 100644 --- a/profile.js +++ b/profile.js @@ -139,7 +139,7 @@ function detail_proc(req, res) else if(result.length == 0) RenderMessage(res,$notfound_name,req.session.items); else{ - res.render("profile\\detail",{list:result,token:req.session.items.token}); + res.render("profile\\detail",{list:result,token:req.session.items.token,admin:req.session.items.admin}); } }); } @@ -153,7 +153,10 @@ function detail_postproc(req, res) if(typeof(req.body.remove) != "undefined"){ async.waterfall([ function(cb){ - collection.AuthAsync(req.body.name,req.body.password,cb); + if(typeof(req.session.items) != "undefined" && req.session.items.admin) + cb(null,true); + else + collection.AuthAsync(req.body.name,req.body.password,cb); }, function(result,cb){ if(result) @@ -172,7 +175,10 @@ function detail_postproc(req, res) }else if(typeof(req.body.edit) != "undefined"){ async.waterfall([ function(cb){ - collection.AuthAsync(req.body.name,req.body.password,cb); + if(typeof(req.session.items) != "undefined" && req.session.items.admin) + cb(null,true); + else + collection.AuthAsync(req.body.name,req.body.password,cb); }, function(result,cb){ if(result) diff --git a/public/profile/detail.ejs b/public/profile/detail.ejs index 60aee8c..923b988 100644 --- a/public/profile/detail.ejs +++ b/public/profile/detail.ejs @@ -48,7 +48,9 @@ $(function(){ - + <% if(!admin){ %> + + <% } %> -- 2.11.0