瀏覽代碼

Mongo fixes

Michael Francis 14 年之前
父節點
當前提交
e735c32bd4
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      controllers/UsersController.php

+ 3 - 3
controllers/UsersController.php

@@ -170,7 +170,7 @@ class UsersController extends \lithium\action\Controller {
 		{
 			$user = Auth::check('default');
 			if ($user) {
-				$user = User::find($user['_id']);
+				$user = User::find($user['id']);
 				$user->post($this->request->data);
 			}
 
@@ -235,7 +235,7 @@ class UsersController extends \lithium\action\Controller {
 			if ($user)
 			{
 				$user = User::find('first', array('conditions' => array('username' => $user['username'])));
-				$user->lastLogin = new MongoDate();
+				$user->lastLogin = date('Y-m-d H:i:s', time());
 				$user->save(null, array('validate' => false));
 				
 
@@ -327,7 +327,7 @@ class UsersController extends \lithium\action\Controller {
 	{
 		//Get the user using their login information (from auth)
 		$user = Auth::check('default');
-		$user = User::find($user['_id']);
+		$user = User::find($user['id']);
 
 		//If the request isn't empty
 		if(!empty($this->request->data)) {