Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Http\Controllers\Services;
- use App\Http\Controllers\Mainframe;
- use Redirect;
- use Input;
- use Auth;
- use Hash;
- class Account extends Mainframe {
- public static function update() {
- $user = Auth::user();
- $user->motto = Input::get('motto');
- $user->block_newfriends = Input::get('block_friends');
- $user->hide_online = Input::get('hide_online');
- $user->trading_locked = Input::get('trade_allow');
- $user->save();
- if (strlen(Input::get('password_old')) > 4 && strlen(Input::get('password_new')) > 4) {
- if (Input::get('password_new') == Input::get('password_new_rep')) {
- if (Hash::check(Input::get('password_old'), Auth::user()->password)) {
- $user = Auth::user();
- $user->password = Hash::make(Input::get('password_new'));
- $user->save();
- }
- }
- }
- return Redirect::back();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement