         else
             callback list
 
-    updateUser : (req, res, next) =>
-        console.log "update user"
+    updateUserPassword : (req, res, next) =>
+        param = req.body
+        if param? and req.params.id?
+            if param.password? and param.passwordconfirm?
+                if param.password is param.passwordconfirm
+                    Db.update 'user', req.params.id, {password:md5(param.password)}, () =>
+                        res.send 200
+                else
+                    res.send 400
+            else
+                res.send 400
+        else
+            res.send 400
+
+    updateUserMail : (req, res, next) =>
+        param = req.body
+        if param? and req.params.id?
+            if param.mail?
+                Db.find 'user', {'mail': param.mail}, (body) =>
+                    if not body? or body.length is 0
+                        Db.update 'user', req.params.id, {mail:param.mail}, () =>
+                            res.send 200
+                    else
+                        res.send 400
+            else
+                res.send 400
+        else
+            res.send 400
 
     deleteFriend : (req, res, next) =>
         console.log "delete friend"

                    else
                        res.send 400
            else
                console.log 'bad_id'
                res.send 400
        else
            console.log 'bad_params'
            res.send 400

    requestUser : (friends, offset, infos, callback) =>

        param   = req.body
        err     = []
        if param.name?
            Db.getBy 'user', {name : param.name}, (docs) =>
                if docs.length == 0
                    res.send 400 # Change to render a proper page TODO
                else
                    if param._id?
                        Db.get 'user', param._id, (user) =>
                            if !user?
                                res.send 400 # Change to render a proper page TODO
                            else
                                if !user.friends?
                                    user.friends = []
                                else
                                    for friend of user.friends
                                        if friend.name == param.name
                                            res.send 400 # Change to render a proper page TODO
                                            return
                                user.friends.push {_id : docs[0]._id, name : param.name}
                                Db.update 'user', user._id, user, () =>
                                    res.send 200 # Change to render a proper page TODO
                    else
                        res.send 400 # Change to render a proper page TODO
        else
            err.push 'bad_name'
