mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-26 13:20:41 +03:00
12 lines
435 B
JavaScript
12 lines
435 B
JavaScript
const { User } = require("../../classes/index");
|
|
const { get } = require("quick.db");
|
|
const error = require("../../errors/error.js");
|
|
|
|
module.exports = (req, res) => {
|
|
if (!req.session.loggedin) return res.redirect('/login');
|
|
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.");
|
|
|
|
res.render("admin", { user })
|
|
}
|