Skip to content

Commit

Permalink
added server side validation for input fields
Browse files Browse the repository at this point in the history
  • Loading branch information
cubettech committed Feb 18, 2014
1 parent be51441 commit c6e67be
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 170 deletions.
4 changes: 2 additions & 2 deletions application/controllers/admin/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var userController = {
system.loadView(res, path.join('','admin/user/add'));
},
addUsersPost: function(req, res){
if(req.body.username && req.body.password && (req.body.password == req.body.password_r)){
if(req.body.username && req.body.password && req.body.email && (req.body.password == req.body.password_r)){

var crypto = require('crypto');
var user_pass = req.body.password + pass_salt;
Expand Down Expand Up @@ -84,7 +84,7 @@ var userController = {
}
},
updateUsersPost: function(req,res){
if(req.body.id){
if(req.body.id && req.body.email && req.body.name){
var data = {
"name": req.body.name,
"email": req.body.email
Expand Down
Loading

0 comments on commit c6e67be

Please sign in to comment.