Skip to content

Commit

Permalink
hf3
Browse files Browse the repository at this point in the history
  • Loading branch information
veresspeter committed Nov 4, 2017
1 parent 2120674 commit 7d8adfe
Show file tree
Hide file tree
Showing 32 changed files with 668 additions and 1 deletion.
28 changes: 27 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
var express = require('express');
var app = express();

app.use(express.static('static'));
//app.use(express.static('static'));

/**
* Create .error and .tpl on res
*/
app.use(function(req, res, next){
res.error = [];
res.tpl = {};
return next();
});

/**
* Include all route
*/
require('./routes/apps')(app);
require('./routes/judges')(app);
require('./routes/news')(app);
require('./routes/user')(app);

/**
* Error handler
*/
app.use(function(err, req, res, next){
res.status(500).send("Error"); // sends a http err msg
console.error(err.stack); // write the err to std:err
});

var server = app.listen(3000, function () {
console.log("On :3000")
});
11 changes: 11 additions & 0 deletions middlewares/apps/general/deleteapp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Deletes the app, than redirects to the apps page (/apps)
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/apps/general/getactiveapplist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Lists all the applications that are currently active
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/apps/general/getapp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Gets the app with the given id
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/apps/general/getapplist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Lists all the applications
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/apps/general/updateapp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Creates/Updates the app, than redirects to the apps page (/apps)
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/apps/scores/deletescore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Deletes the score, than redirects to the app's page (/apps/app/:id)
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/apps/scores/updatescore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Creates/Updates the score, than redirects to the app's page (/apps/app/:id)
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
12 changes: 12 additions & 0 deletions middlewares/general/auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Checks the user's permission and store it for other middlewares
* if access denied for this page, redirects to the root page (/)
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/general/render.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Creates the html page from templates and given parameters for the response
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/news/deletenews.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Deletes the news with the given id
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
10 changes: 10 additions & 0 deletions middlewares/news/getnewslist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Lists and store the list of the news'
*/
module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/news/updatenews.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Creates / updates the news with the given id with the given datas
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/users/admin/changepermission.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Changes the user's permission to admin or to normal user
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/users/admin/filteradmins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* From a list of users, the function deletes all user with only normal permission
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/users/admin/getuserlist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Lists all the portal's users
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/users/admin/getuserlistpermission.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* The function completes a user list with the permissions of the users in it.
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/users/apps/deleteapp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Deletes the application recieved from the user for the given app id
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/users/apps/getapplist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Lists and stores the applications received from the user
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/users/apps/updateapp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Creates / updates the application received from the user for the given app id
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/users/data/createpw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Creates a new password
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/users/data/getuserbyemail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Lists the user whose email has been given
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/users/data/updatedata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Creates / updates the user profile
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/users/data/updatepw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Updates the user's password
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
12 changes: 12 additions & 0 deletions middlewares/users/general/login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Logging in
* in case of any problem, log out the user and redirects to the root page (/)
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
12 changes: 12 additions & 0 deletions middlewares/users/general/logout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Logging out
* in case of any problem, the log out is failed and redirects to the root page (/)
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
11 changes: 11 additions & 0 deletions middlewares/users/general/sendemail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Sends an email for the user with the given text
*/

module.exports = function () {

return function (req, res, next) {
return next();
};

};
Loading

0 comments on commit 7d8adfe

Please sign in to comment.