Skip to content

Commit

Permalink
Change password and update user functions
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonscott committed May 15, 2014
1 parent 4cc84a7 commit bfc093b
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions app/controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,30 @@ public function getSubscriptions($id)
}));
}

public function updateSubscription($id, $subId)
public function updateUser($id)
{
$subscription = Subscription::find($subId);
$subscription->text = Input::get('text');
$subscription->phonecall = Input::get('phonecall');
$subscription->save;
$user = User::find($id);

$user->email = Input::get("email");
$user->first_name = Input::get("first_name");
$user->last_name = Input::get("last_name");
$user->mobile_number = Input::get("mobile_number");

$user->save();

return Response::json($subscription);
return Response::json($user);
}

public function changePassword()
{
$user = Auth::user();
$user->password = Hash::make(Input::get("newpassword"));

$user->save();

return Response::json(array("success" => true));
}

public function getUser($id)
{
return Response::json(User::find($id));
Expand Down

0 comments on commit bfc093b

Please sign in to comment.