Add patch to rename user_roles_id to roles_id, update related classes

This commit is contained in:
DariusIII
2018-08-01 10:46:21 +02:00
parent f80408a50e
commit 00f09c4a6e
10 changed files with 22 additions and 17 deletions
@@ -62,7 +62,7 @@ class RegisterController extends Controller
'email' => $data['email'],
'password' => User::hashPassword($data['password']),
'host' => $data['host'] ?? '',
'user_roles_id' => $data['user_roles_id'],
'roles_id' => $data['roles_id'],
'notes' => $data['notes'],
'invites' => $data['defaultinvites'],
'api_token' => md5(Password::getRepository()->createNewToken()),
@@ -135,7 +135,7 @@ class RegisterController extends Controller
'password' => $password,
'email' => $email,
'host' => $request->ip(),
'user_roles_id' => $userDefault !== null ? $userDefault['id'] : User::ROLE_USER,
'roles_id' => $userDefault !== null ? $userDefault['id'] : User::ROLE_USER,
'notes' => '',
'defaultinvites' => $userDefault !== null ? $userDefault['defaultinvites'] : Invitation::DEFAULT_INVITES,
]
+3 -3
View File
@@ -225,7 +225,7 @@ class BasePageController extends Controller
protected function setUserPreferences(): void
{
$this->userdata['categoryexclusions'] = User::getCategoryExclusion(Auth::id());
$this->userdata['rolecategoryexclusions'] = RoleExcludedCategory::getRoleCategoryExclusion($this->userdata['user_roles_id']);
$this->userdata['rolecategoryexclusions'] = RoleExcludedCategory::getRoleCategoryExclusion($this->userdata['roles_id']);
// Change the theme to user's selected theme if they selected one, else use the admin one.
if ((int) Settings::settingValue('site.main.userselstyle') === 1) {
@@ -256,7 +256,7 @@ class BasePageController extends Controller
if ($sab->integratedBool !== false && $sab->url !== '' && $sab->apikey !== '') {
$this->smarty->assign('sabapikeytype', $sab->apikeytype);
}
switch ((int) $this->userdata['user_roles_id']) {
switch ((int) $this->userdata['roles_id']) {
case User::ROLE_ADMIN:
$this->smarty->assign('isadmin', 'true');
break;
@@ -272,7 +272,7 @@ class BasePageController extends Controller
$role = User::ROLE_USER;
if (! empty($this->userdata)) {
$role = $this->userdata['user_roles_id'];
$role = $this->userdata['roles_id'];
}
$content = new Contents();
+1 -1
View File
@@ -179,7 +179,7 @@ class ProfileController extends BasePageController
$data['username'],
$request->input('email'),
$data['grabs'],
$data['user_roles_id'],
$data['roles_id'],
$data['notes'],
$data['invites'],
$request->has('movieview') ? 1 : 0,