diff options
author | Michael Francis <edude03@gmail.com> | 2011-06-20 19:02:01 -0400 |
---|---|---|
committer | Michael Francis <edude03@gmail.com> | 2011-06-20 19:02:01 -0400 |
commit | b36745e2187bf369d135fc787d252c531b97664d (patch) | |
tree | 37ccb814850be892e46aaa3117b65209c0eeff03 /controllers/UsersController.php | |
parent | 4dd797ca029ca5d0486c24395c2bf6133f5f3d39 (diff) | |
download | otakuhub-b36745e2187bf369d135fc787d252c531b97664d.tar.xz |
Settings page for users
Diffstat (limited to 'controllers/UsersController.php')
-rw-r--r-- | controllers/UsersController.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/controllers/UsersController.php b/controllers/UsersController.php index c168066..8ee5079 100644 --- a/controllers/UsersController.php +++ b/controllers/UsersController.php @@ -374,6 +374,28 @@ class UsersController extends \lithium\action\Controller { } } + public function settings() + { + //Get the user using their login information (from auth) + $user = Auth::check('default'); + $user = User::find($user['_id']); + + //If the request isn't empty + if(!empty($this->request->data)) { + //Foreach key/value pair in the request data + foreach($this->request->data as $key => $value) + { + //TODO: Make sure to lock the schema to prevent wierd values + $user->$key = $value; + } + + //Save the user. + $user->save(null, array('validate' => false)); + } + + return compact('user'); + } + public function requestFriend($username) { //If the user isn't blocking this user, |