mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update ParentalControlsController
This commit is contained in:
parent
71c148c61e
commit
c7ed684a5c
1 changed files with 6 additions and 0 deletions
|
@ -5,6 +5,7 @@ namespace App\Http\Controllers;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Models\ParentalControls;
|
use App\Models\ParentalControls;
|
||||||
use App\Models\UserRoles;
|
use App\Models\UserRoles;
|
||||||
|
use App\Profile;
|
||||||
use App\User;
|
use App\User;
|
||||||
use App\Http\Controllers\Auth\RegisterController;
|
use App\Http\Controllers\Auth\RegisterController;
|
||||||
use Illuminate\Auth\Events\Registered;
|
use Illuminate\Auth\Events\Registered;
|
||||||
|
@ -65,6 +66,11 @@ class ParentalControlsController extends Controller
|
||||||
$pc->save();
|
$pc->save();
|
||||||
|
|
||||||
$roles = UserRoleService::mapActions($pc->child_id, $ff);
|
$roles = UserRoleService::mapActions($pc->child_id, $ff);
|
||||||
|
if(isset($roles['account-force-private'])) {
|
||||||
|
$c = Profile::whereUserId($pc->child_id)->first();
|
||||||
|
$c->is_private = $roles['account-force-private'];
|
||||||
|
$c->save();
|
||||||
|
}
|
||||||
UserRoles::whereUserId($pc->child_id)->update(['roles' => $roles]);
|
UserRoles::whereUserId($pc->child_id)->update(['roles' => $roles]);
|
||||||
return redirect($pc->manageUrl() . '?permissions');
|
return redirect($pc->manageUrl() . '?permissions');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue