Advertisement
Guest User

Untitled

a guest
Jan 17th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <?php
  2. namespace App\Http\Controllers\Services;
  3. use App\Http\Controllers\Mainframe;
  4. use Redirect;
  5. use Input;
  6. use Auth;
  7. use Hash;
  8. class Account extends Mainframe {
  9.  
  10. public static function update() {
  11. $user = Auth::user();
  12. $user->motto = Input::get('motto');
  13. $user->block_newfriends = Input::get('block_friends');
  14. $user->hide_online = Input::get('hide_online');
  15. $user->trading_locked = Input::get('trade_allow');
  16. $user->save();
  17.  
  18. if (strlen(Input::get('password_old')) > 4 && strlen(Input::get('password_new')) > 4) {
  19. if (Input::get('password_new') == Input::get('password_new_rep')) {
  20. if (Hash::check(Input::get('password_old'), Auth::user()->password)) {
  21. $user = Auth::user();
  22. $user->password = Hash::make(Input::get('password_new'));
  23. $user->save();
  24. }
  25. }
  26. }
  27. return Redirect::back();
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement