@@ -29,7 +29,7 @@ |
||
29 | 29 | ]); |
30 | 30 | |
31 | 31 | // Check if password is correct |
32 | - if (! Hash::check($validated['current_password'], Auth::user()->password)) { |
|
32 | + if (!Hash::check($validated['current_password'], Auth::user()->password)) { |
|
33 | 33 | if ($request->expectsJson() || $request->ajax()) { |
34 | 34 | return response()->json([ |
35 | 35 | 'success' => false, |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | public function disable2fa(Disable2faPasswordSecurityRequest $request): \Illuminate\Routing\Redirector|RedirectResponse|\Illuminate\Contracts\Foundation\Application |
89 | 89 | { |
90 | - if (! (Hash::check($request->get('current-password'), $request->user()->password))) { |
|
90 | + if (!(Hash::check($request->get('current-password'), $request->user()->password))) { |
|
91 | 91 | // Password doesn't match |
92 | 92 | if ($request->has('redirect_to_profile') || $request->has('from_profile')) { |
93 | 93 | return redirect()->to('profileedit#security')->with('error_2fa', 'Your password does not match with your account password. Please try again.'); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | ]); |
120 | 120 | |
121 | 121 | // Get the user ID from session |
122 | - if (! $request->session()->has('2fa:user:id')) { |
|
122 | + if (!$request->session()->has('2fa:user:id')) { |
|
123 | 123 | return redirect()->route('login') |
124 | 124 | ->with('message', 'The two-factor authentication session has expired. Please login again.') |
125 | 125 | ->with('message_type', 'danger'); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $userId = $request->session()->get('2fa:user:id'); |
129 | 129 | $user = \App\Models\User::find($userId); |
130 | 130 | |
131 | - if (! $user || ! $user->passwordSecurity) { |
|
131 | + if (!$user || !$user->passwordSecurity) { |
|
132 | 132 | $request->session()->forget('2fa:user:id'); |
133 | 133 | |
134 | 134 | return redirect()->route('login') |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $request->input('one_time_password') |
143 | 143 | ); |
144 | 144 | |
145 | - if (! $valid) { |
|
145 | + if (!$valid) { |
|
146 | 146 | return redirect()->route('2fa.verify') |
147 | 147 | ->with('message', 'Invalid authentication code. Please try again.') |
148 | 148 | ->with('message_type', 'danger'); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | public function getVerify2fa(Request $request) |
176 | 176 | { |
177 | 177 | // Check if user ID is stored in the session |
178 | - if (! $request->session()->has('2fa:user:id')) { |
|
178 | + if (!$request->session()->has('2fa:user:id')) { |
|
179 | 179 | return redirect()->route('login') |
180 | 180 | ->withErrors(['msg' => 'The two-factor authentication session has expired. Please login again.']); |
181 | 181 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | |
186 | 186 | // Get the user |
187 | 187 | $user = \App\Models\User::find($userId); |
188 | - if (! $user) { |
|
188 | + if (!$user) { |
|
189 | 189 | $request->session()->forget('2fa:user:id'); |
190 | 190 | |
191 | 191 | return redirect()->route('login') |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | 'current-password' => 'required', |
213 | 213 | ]); |
214 | 214 | |
215 | - if (! (Hash::check($request->get('current-password'), $request->user()->password))) { |
|
215 | + if (!(Hash::check($request->get('current-password'), $request->user()->password))) { |
|
216 | 216 | return redirect()->to('profileedit#security')->with('error_2fa', 'Your password does not match with your account password. Please try again.'); |
217 | 217 | } |
218 | 218 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $privateProfiles = config('nntmux_settings.private_profiles'); |
32 | 32 | $publicView = false; |
33 | 33 | |
34 | - if ($privileged || ! $privateProfiles) { |
|
34 | + if ($privileged || !$privateProfiles) { |
|
35 | 35 | $altID = ($request->has('id') && (int) $request->input('id') >= 0) ? (int) $request->input('id') : false; |
36 | 36 | $altUsername = ($request->has('name') && $request->input('name') !== '') ? $request->input('name') : false; |
37 | 37 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | // Check if the user selected a theme. |
64 | - if (! isset($this->userdata->style) || $this->userdata->style === 'None') { |
|
64 | + if (!isset($this->userdata->style) || $this->userdata->style === 'None') { |
|
65 | 65 | $this->userdata->style = 'Using the admin selected theme.'; |
66 | 66 | } |
67 | 67 | $this->smarty->assign( |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $action = $request->input('action') ?? 'view'; |
113 | 113 | |
114 | 114 | $userid = $this->userdata->id; |
115 | - if (! $this->userdata) { |
|
115 | + if (!$this->userdata) { |
|
116 | 116 | $this->show404('No such user!'); |
117 | 117 | } |
118 | 118 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | // Generate 2FA QR code URL if 2FA is set up but not enabled |
124 | 124 | $google2fa_url = ''; |
125 | - if ($this->userdata->passwordSecurity()->exists() && ! $this->userdata->passwordSecurity->google2fa_enable) { |
|
125 | + if ($this->userdata->passwordSecurity()->exists() && !$this->userdata->passwordSecurity->google2fa_enable) { |
|
126 | 126 | $google2fa_url = \Google2FA::getQRCodeInline( |
127 | 127 | config('app.name'), |
128 | 128 | $this->userdata->email, |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | 'None', |
164 | 164 | ); |
165 | 165 | |
166 | - if ((int) $request->input('viewconsole') === 1 && $this->userdata->can('view console') && ! $this->userdata->hasDirectPermission('view console')) { |
|
166 | + if ((int) $request->input('viewconsole') === 1 && $this->userdata->can('view console') && !$this->userdata->hasDirectPermission('view console')) { |
|
167 | 167 | $this->userdata->givePermissionTo('view console'); |
168 | 168 | } elseif ((int) $request->input('viewconsole') === 0 && $this->userdata->can('view console') && $this->userdata->hasDirectPermission('view console')) { |
169 | 169 | $this->userdata->revokePermissionTo('view console'); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $this->userdata->revokePermissionTo('view console'); |
172 | 172 | } |
173 | 173 | |
174 | - if ((int) $request->input('viewmovies') === 1 && $this->userdata->can('view movies') && ! $this->userdata->hasDirectPermission('view movies')) { |
|
174 | + if ((int) $request->input('viewmovies') === 1 && $this->userdata->can('view movies') && !$this->userdata->hasDirectPermission('view movies')) { |
|
175 | 175 | $this->userdata->givePermissionTo('view movies'); |
176 | 176 | } elseif ((int) $request->input('viewmovies') === 0 && $this->userdata->can('view movies') && $this->userdata->hasDirectPermission('view movies')) { |
177 | 177 | $this->userdata->revokePermissionTo('view movies'); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $this->userdata->revokePermissionTo('view movies'); |
180 | 180 | } |
181 | 181 | |
182 | - if ((int) $request->input('viewaudio') === 1 && $this->userdata->can('view audio') && ! $this->userdata->hasDirectPermission('view audio')) { |
|
182 | + if ((int) $request->input('viewaudio') === 1 && $this->userdata->can('view audio') && !$this->userdata->hasDirectPermission('view audio')) { |
|
183 | 183 | $this->userdata->givePermissionTo('view audio'); |
184 | 184 | } elseif ((int) $request->input('viewaudio') === 0 && $this->userdata->can('view audio') && $this->userdata->hasDirectPermission('view audio')) { |
185 | 185 | $this->userdata->revokePermissionTo('view audio'); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $this->userdata->revokePermissionTo('view audio'); |
188 | 188 | } |
189 | 189 | |
190 | - if ((int) $request->input('viewpc') === 1 && $this->userdata->can('view pc') && ! $this->userdata->hasDirectPermission('view pc')) { |
|
190 | + if ((int) $request->input('viewpc') === 1 && $this->userdata->can('view pc') && !$this->userdata->hasDirectPermission('view pc')) { |
|
191 | 191 | $this->userdata->givePermissionTo('view pc'); |
192 | 192 | } elseif ((int) $request->input('viewpc') === 0 && $this->userdata->can('view pc') && $this->userdata->hasDirectPermission('view pc')) { |
193 | 193 | $this->userdata->revokePermissionTo('view pc'); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $this->userdata->revokePermissionTo('view pc'); |
196 | 196 | } |
197 | 197 | |
198 | - if ((int) $request->input('viewtv') === 1 && $this->userdata->can('view tv') && ! $this->userdata->hasDirectPermission('view tv')) { |
|
198 | + if ((int) $request->input('viewtv') === 1 && $this->userdata->can('view tv') && !$this->userdata->hasDirectPermission('view tv')) { |
|
199 | 199 | $this->userdata->givePermissionTo('view tv'); |
200 | 200 | } elseif ((int) $request->input('viewtv') === 0 && $this->userdata->can('view tv') && $this->userdata->hasDirectPermission('view tv')) { |
201 | 201 | $this->userdata->revokePermissionTo('view tv'); |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | $this->userdata->revokePermissionTo('view tv'); |
204 | 204 | } |
205 | 205 | |
206 | - if ((int) $request->input('viewadult') === 1 && $this->userdata->can('view adult') && ! $this->userdata->hasDirectPermission('view adult')) { |
|
206 | + if ((int) $request->input('viewadult') === 1 && $this->userdata->can('view adult') && !$this->userdata->hasDirectPermission('view adult')) { |
|
207 | 207 | $this->userdata->givePermissionTo('view adult'); |
208 | 208 | } elseif ((int) $request->input('viewadult') === 0 && $this->userdata->can('view adult') && $this->userdata->hasDirectPermission('view adult')) { |
209 | 209 | $this->userdata->revokePermissionTo('view adult'); |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $this->userdata->revokePermissionTo('view adult'); |
212 | 212 | } |
213 | 213 | |
214 | - if ((int) $request->input('viewbooks') === 1 && $this->userdata->can('view books') && ! $this->userdata->hasDirectPermission('view books')) { |
|
214 | + if ((int) $request->input('viewbooks') === 1 && $this->userdata->can('view books') && !$this->userdata->hasDirectPermission('view books')) { |
|
215 | 215 | $this->userdata->givePermissionTo('view books'); |
216 | 216 | } elseif ((int) $request->input('viewbooks') === 0 && $this->userdata->can('view books') && $this->userdata->hasDirectPermission('view books')) { |
217 | 217 | $this->userdata->revokePermissionTo('view books'); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $this->userdata->revokePermissionTo('view books'); |
220 | 220 | } |
221 | 221 | |
222 | - if ((int) $request->input('viewother') === 1 && $this->userdata->can('view other') && ! $this->userdata->hasDirectPermission('view other')) { |
|
222 | + if ((int) $request->input('viewother') === 1 && $this->userdata->can('view other') && !$this->userdata->hasDirectPermission('view other')) { |
|
223 | 223 | $this->userdata->givePermissionTo('view other'); |
224 | 224 | } elseif ((int) $request->input('viewother') === 0 && $this->userdata->can('view other') && $this->userdata->hasDirectPermission('view other')) { |
225 | 225 | $this->userdata->revokePermissionTo('view other'); |
@@ -227,12 +227,12 @@ discard block |
||
227 | 227 | $this->userdata->revokePermissionTo('view other'); |
228 | 228 | } |
229 | 229 | |
230 | - if ($request->has('password') && ! empty($request->input('password'))) { |
|
230 | + if ($request->has('password') && !empty($request->input('password'))) { |
|
231 | 231 | User::updatePassword($userid, $request->input('password')); |
232 | 232 | } |
233 | 233 | |
234 | - if (! $this->userdata->hasRole('Admin')) { |
|
235 | - if (! empty($request->input('email')) && $this->userdata->email !== $request->input('email')) { |
|
234 | + if (!$this->userdata->hasRole('Admin')) { |
|
235 | + if (!empty($request->input('email')) && $this->userdata->email !== $request->input('email')) { |
|
236 | 236 | $this->userdata->email = $request->input('email'); |
237 | 237 | |
238 | 238 | $verify_user = $this->userdata; |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | $this->setPreferences(); |
285 | 285 | $userId = $request->input('id'); |
286 | 286 | |
287 | - if ($userId !== null && (int) $userId === $this->userdata->id && ! $this->userdata->hasRole('Admin')) { |
|
287 | + if ($userId !== null && (int) $userId === $this->userdata->id && !$this->userdata->hasRole('Admin')) { |
|
288 | 288 | $user = User::find($userId); |
289 | 289 | SendAccountDeletedEmail::dispatch($user); |
290 | 290 | Auth::logout(); |