Enable users public profile page by default when profile pages are enabled

This commit is contained in:
Andy Heathershaw 2019-07-28 08:17:17 +01:00
parent 24f2155a35
commit c8952a8ac1
3 changed files with 5 additions and 3 deletions

View File

@ -6,10 +6,9 @@ use App\Facade\Theme;
use App\Facade\UserConfig;
use App\Group;
use App\Helpers\PermissionsHelper;
use App\User;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Http\Requests;
use App\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Auth;
@ -89,6 +88,7 @@ class UserController extends Controller
$user->password = bcrypt($user->password);
$user->is_activated = true;
$user->is_admin = (strtolower($request->get('is_admin')) == 'on');
$user->enable_profile_page = UserConfig::get('social_user_profiles');
$user->save();
return redirect(route('users.index'));

View File

@ -98,6 +98,7 @@ class RegisterController extends Controller
$data['password'] = bcrypt($data['password']);
$data['is_admin'] = false;
$data['enable_profile_page'] = UserConfig::get('social_user_profiles');
unset($data['password_confirmation']);
return User::create($data);

View File

@ -41,6 +41,7 @@ class InstallController extends Controller
$user->password = bcrypt($request->get('password'));
$user->is_admin = true;
$user->is_activated = true;
$user->enable_profile_page = true;
$user->save();
return $this->completeSetup();