mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-10-31 19:25:04 +03:00
Update admin.js
This commit is contained in:
parent
13d3e3f553
commit
a2d5056b8f
1 changed files with 3 additions and 3 deletions
|
@ -9,7 +9,7 @@ app.get("/", (req, res) => {
|
||||||
if (!req.session.loggedin) return res.redirect('/login');
|
if (!req.session.loggedin) return res.redirect('/login');
|
||||||
const user = new User().getId(req.session.userid)
|
const user = new User().getId(req.session.userid)
|
||||||
|
|
||||||
if (!user.admin) return error(res, 404, "You have not got permissions for view to this page.");
|
if (!user.admin) return error(res, 403, "You have not got permissions for view to this page.");
|
||||||
|
|
||||||
res.render("admin", { user, user2: false })
|
res.render("admin", { user, user2: false })
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ app.post("/", (req, res) => {
|
||||||
|
|
||||||
const user = new User().getId(req.session.userid)
|
const user = new User().getId(req.session.userid)
|
||||||
|
|
||||||
if (!user.admin) return error(res, 404, "You have not got permissions for view to this page.");
|
if (!user.admin) return error(res, 403, "You have not got permissions for view to this page.");
|
||||||
const user2 = new User().getId(req.body.userid)
|
const user2 = new User().getId(req.body.userid)
|
||||||
|
|
||||||
if (!user2)
|
if (!user2)
|
||||||
|
@ -36,4 +36,4 @@ app.post("/", (req, res) => {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = app;
|
module.exports = app;
|
||||||
|
|
Loading…
Reference in a new issue