summaryrefslogtreecommitdiffstats
path: root/controllers/UsersController.php
diff options
context:
space:
mode:
Diffstat (limited to 'controllers/UsersController.php')
-rw-r--r--controllers/UsersController.php22
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,