@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public function update($id, Request $request) |
31 | 31 | { |
32 | - $this->validate($request, [ 'value' => 'required' ]); |
|
32 | + $this->validate($request, ['value' => 'required']); |
|
33 | 33 | |
34 | 34 | $move = Base::getSettingsRepository()->findOrFail($id); |
35 | 35 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | $after = $move->value; |
41 | 41 | |
42 | - Base::Log('Website settings changed. Changed "' . $move->friendly_name . '" value from "' . $before . '" to "' . $after . '"'); |
|
42 | + Base::Log('Website settings changed. Changed "'.$move->friendly_name.'" value from "'.$before.'" to "'.$after.'"'); |
|
43 | 43 | |
44 | 44 | return redirect('admin/settings'); |
45 | 45 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | public function getForgotPasswordConfirm($userId, $passwordResetCode) |
95 | 95 | { |
96 | 96 | // Find the user using the password reset code |
97 | - if(!$user = Sentinel::findById($userId)) |
|
97 | + if (!$user = Sentinel::findById($userId)) |
|
98 | 98 | { |
99 | 99 | // Redirect to the forgot password page |
100 | 100 | return Redirect::route('forgot-password')->with('error', Lang::get('base.auth.forgot_password_confirm.error')); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | // Find the user using the password reset code |
136 | - if(!$user = Sentinel::findById($userId)) |
|
136 | + if (!$user = Sentinel::findById($userId)) |
|
137 | 137 | { |
138 | 138 | // Redirect to the forgot password page |
139 | 139 | return Redirect::route('login')->with('error', Lang::get('base.auth.activate.error')); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | return back()->withInput()->withErrors($validator); |
186 | 186 | } |
187 | 187 | try { |
188 | - foreach(Sentinel::createModel()->getLoginNames() as $loginName) |
|
188 | + foreach (Sentinel::createModel()->getLoginNames() as $loginName) |
|
189 | 189 | { |
190 | 190 | $data = array( |
191 | 191 | $loginName => Input::only('email')["email"], |
@@ -193,11 +193,11 @@ discard block |
||
193 | 193 | ); |
194 | 194 | |
195 | 195 | // Try to log the user in |
196 | - if(Sentinel::authenticate($data, Input::get('remember-me', false))) |
|
196 | + if (Sentinel::authenticate($data, Input::get('remember-me', false))) |
|
197 | 197 | { |
198 | 198 | $user = Sentinel::check(); |
199 | 199 | $user->update(['ip' => Request::ip()]); |
200 | - Base::Log($user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') logged in with IP ' . Request::ip() ); |
|
200 | + Base::Log($user->username.' ('.$user->first_name.' '.$user->last_name.') logged in with IP '.Request::ip()); |
|
201 | 201 | |
202 | 202 | // Redirect to the dashboard page |
203 | 203 | return Redirect::route("home")->with('success', Lang::get('base.auth.signin.success')); |
@@ -209,9 +209,9 @@ discard block |
||
209 | 209 | $this->messageBag->add('email', Lang::get('base.auth.account.not_activated')); |
210 | 210 | } catch (ThrottlingException $e) { |
211 | 211 | $delay = $e->getDelay(); |
212 | - $this->messageBag->add('email', Lang::get('base.auth.account.suspended', compact('delay' ))); |
|
212 | + $this->messageBag->add('email', Lang::get('base.auth.account.suspended', compact('delay'))); |
|
213 | 213 | } |
214 | - Base::Log('Login attempt registred for ' . Input::only('email')["email"] . ' from IP ' . Request::ip() ); |
|
214 | + Base::Log('Login attempt registred for '.Input::only('email')["email"].' from IP '.Request::ip()); |
|
215 | 215 | |
216 | 216 | // Ooops.. something went wrong |
217 | 217 | return back()->withInput()->withErrors($this->messageBag); |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | $rules = array(); |
246 | 246 | |
247 | 247 | // Declare the rules for the form validation |
248 | - foreach(Sentinel::createModel()->getRegisterFields() as $fieldid => $field) |
|
248 | + foreach (Sentinel::createModel()->getRegisterFields() as $fieldid => $field) |
|
249 | 249 | $rules[$fieldid] = $field['validator']; |
250 | 250 | |
251 | 251 | $rules['g-recaptcha-response'] = 'required'; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | $data = array(); |
269 | 269 | |
270 | 270 | // Set the data to the user from the User class |
271 | - foreach(Sentinel::createModel()->getRegisterFields() as $fieldid => $field) |
|
271 | + foreach (Sentinel::createModel()->getRegisterFields() as $fieldid => $field) |
|
272 | 272 | $data[$fieldid] = Input::get($fieldid); |
273 | 273 | |
274 | 274 | // Set the standard data to the user |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | $testing = Sentinel::createModel()->getRegisterFields(); |
289 | 289 | $user = Sentinel::findById($user->id); |
290 | 290 | |
291 | - foreach($data as $fieldid => $field) |
|
291 | + foreach ($data as $fieldid => $field) |
|
292 | 292 | if (!isset($testing[$fieldid]) || $testing[$fieldid]['save'] == true) |
293 | 293 | $user[$fieldid] = $field; |
294 | 294 | |
@@ -314,18 +314,18 @@ discard block |
||
314 | 314 | ); |
315 | 315 | |
316 | 316 | // Send the activation code through email |
317 | - Mail::queue('emails.auth.register-activate', $data, function ($m) use ($user) { |
|
318 | - $m->to($user->email, $user->first_name . ' ' . $user->last_name); |
|
319 | - $m->subject(Lang::get('base.mails.welcome') . ' ' . $user->first_name); |
|
317 | + Mail::queue('emails.auth.register-activate', $data, function($m) use ($user) { |
|
318 | + $m->to($user->email, $user->first_name.' '.$user->last_name); |
|
319 | + $m->subject(Lang::get('base.mails.welcome').' '.$user->first_name); |
|
320 | 320 | }); |
321 | 321 | } |
322 | 322 | |
323 | 323 | // If the administrator needs to activate the account send the user a warning saying that |
324 | 324 | if ($adminActivation) |
325 | 325 | { |
326 | - Mail::queue('emails.auth.register-admin-activate', ['user' => $user], function ($m) use ($user) { |
|
327 | - $m->to($user->email, $user->first_name . ' ' . $user->last_name); |
|
328 | - $m->subject(Lang::get('base.mails.welcome') . ' ' . $user->first_name); |
|
326 | + Mail::queue('emails.auth.register-admin-activate', ['user' => $user], function($m) use ($user) { |
|
327 | + $m->to($user->email, $user->first_name.' '.$user->last_name); |
|
328 | + $m->subject(Lang::get('base.mails.welcome').' '.$user->first_name); |
|
329 | 329 | }); |
330 | 330 | } |
331 | 331 | |
@@ -337,22 +337,22 @@ discard block |
||
337 | 337 | if (Activation::complete($user, $activation->code)) { |
338 | 338 | Sentinel::login($user, false); |
339 | 339 | |
340 | - Mail::queue('emails.auth.activated', ['user' => $user], function ($m) use ($user) { |
|
341 | - $m->to($user->email, $user->first_name . ' ' . $user->last_name); |
|
342 | - $m->subject(Lang::get('base.mails.welcome') . ' ' . $user->first_name); |
|
340 | + Mail::queue('emails.auth.activated', ['user' => $user], function($m) use ($user) { |
|
341 | + $m->to($user->email, $user->first_name.' '.$user->last_name); |
|
342 | + $m->subject(Lang::get('base.mails.welcome').' '.$user->first_name); |
|
343 | 343 | }); |
344 | 344 | } |
345 | 345 | } |
346 | 346 | |
347 | - Base::Log('New account registred for ' . $user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') from IP ' . Request::ip() ); |
|
347 | + Base::Log('New account registred for '.$user->username.' ('.$user->first_name.' '.$user->last_name.') from IP '.Request::ip()); |
|
348 | 348 | |
349 | 349 | // Redirect to the home page with success menu |
350 | - return Redirect::to("login")->with('success', Lang::get('base.auth.signup.success') . $adminActivation ? Lang::get('base.auth.signup.admin') : $userActivation ? Lang::get('base.auth.signup.self') : Lang::get('base.auth.signup.ready')); |
|
350 | + return Redirect::to("login")->with('success', Lang::get('base.auth.signup.success').$adminActivation ? Lang::get('base.auth.signup.admin') : $userActivation ? Lang::get('base.auth.signup.self') : Lang::get('base.auth.signup.ready')); |
|
351 | 351 | } catch (UserExistsException $e) { |
352 | 352 | $this->messageBag->add('email', Lang::get('base.auth.account.already_exists')); |
353 | 353 | } |
354 | 354 | |
355 | - Base::Log('New account registration attempt from IP ' . Request::ip() ); |
|
355 | + Base::Log('New account registration attempt from IP '.Request::ip()); |
|
356 | 356 | |
357 | 357 | // Ooops.. something went wrong |
358 | 358 | return Redirect::back()->withInput()->withErrors($this->messageBag); |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | // Get the user password recovery code |
383 | 383 | $user = Sentinel::findByCredentials(['email' => Input::get('email')]); |
384 | 384 | |
385 | - if($user) |
|
385 | + if ($user) |
|
386 | 386 | { |
387 | 387 | //get reminder for user |
388 | 388 | $reminder = Reminder::exists($user) ?: Reminder::create($user); |
@@ -390,14 +390,14 @@ discard block |
||
390 | 390 | // Data to be used on the email view |
391 | 391 | $data = array( |
392 | 392 | 'user' => $user, |
393 | - 'forgotPasswordUrl' => URL::route('forgot-password-confirm',[$user->id, $reminder->code]), |
|
393 | + 'forgotPasswordUrl' => URL::route('forgot-password-confirm', [$user->id, $reminder->code]), |
|
394 | 394 | ); |
395 | 395 | |
396 | - Base::Log('Forgot password request for ' . $user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') from IP ' . Request::ip() ); |
|
396 | + Base::Log('Forgot password request for '.$user->username.' ('.$user->first_name.' '.$user->last_name.') from IP '.Request::ip()); |
|
397 | 397 | |
398 | 398 | // Send the activation code through email |
399 | - Mail::queue('emails.auth.forgot-password', $data, function ($m) use ($user) { |
|
400 | - $m->to($user->email, $user->first_name . ' ' . $user->last_name); |
|
399 | + Mail::queue('emails.auth.forgot-password', $data, function($m) use ($user) { |
|
400 | + $m->to($user->email, $user->first_name.' '.$user->last_name); |
|
401 | 401 | $m->subject(Lang::get('base.mails.recovery')); |
402 | 402 | }); |
403 | 403 | } |
@@ -427,26 +427,26 @@ discard block |
||
427 | 427 | // If validation fails, we'll exit the operation now. |
428 | 428 | if ($validator->fails()) { |
429 | 429 | // Ooops.. something went wrong |
430 | - return Redirect::route('forgot-password-confirm', compact(['userId','passwordResetCode']))->withInput()->withErrors($validator); |
|
430 | + return Redirect::route('forgot-password-confirm', compact(['userId', 'passwordResetCode']))->withInput()->withErrors($validator); |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | // Find the user using the password reset code |
434 | 434 | $user = Sentinel::findById($userId); |
435 | - if(!$reminder = Reminder::complete($user, $passwordResetCode, Input::get('password'))) |
|
435 | + if (!$reminder = Reminder::complete($user, $passwordResetCode, Input::get('password'))) |
|
436 | 436 | { |
437 | - Base::Log('Forgot password confirm failed for ' . $user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') from IP ' . Request::ip() ); |
|
437 | + Base::Log('Forgot password confirm failed for '.$user->username.' ('.$user->first_name.' '.$user->last_name.') from IP '.Request::ip()); |
|
438 | 438 | |
439 | 439 | // Ooops.. something went wrong |
440 | 440 | return Redirect::route('login')->with('error', Lang::get('base.auth.forgot_password_confirm.error')); |
441 | 441 | } else { |
442 | 442 | // Send the activation code through email |
443 | - Mail::queue('emails.auth.password-changed', [ 'user' => $user], function ($m) use ($user) { |
|
444 | - $m->to($user->email, $user->first_name . ' ' . $user->last_name); |
|
443 | + Mail::queue('emails.auth.password-changed', ['user' => $user], function($m) use ($user) { |
|
444 | + $m->to($user->email, $user->first_name.' '.$user->last_name); |
|
445 | 445 | $m->subject(Lang::get('base.mails.password_changed')); |
446 | 446 | }); |
447 | 447 | } |
448 | 448 | |
449 | - Base::Log('Forgot password confirmed for ' . $user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') from IP ' . Request::ip() ); |
|
449 | + Base::Log('Forgot password confirmed for '.$user->username.' ('.$user->first_name.' '.$user->last_name.') from IP '.Request::ip()); |
|
450 | 450 | |
451 | 451 | // Password successfully reseted |
452 | 452 | return Redirect::route('login')->with('success', Lang::get('base.auth.forgot_password_confirm.success')); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | // Do we want to update the user password? |
139 | 139 | if ($password = Input::get('password')) |
140 | 140 | { |
141 | - if (Sentinel::validateCredentials($user, [ 'email' => $email, 'password' => Input::get('old-password')])) |
|
141 | + if (Sentinel::validateCredentials($user, ['email' => $email, 'password' => Input::get('old-password')])) |
|
142 | 142 | { |
143 | 143 | $passwordChanged = true; |
144 | 144 | $user->password = Hash::make($password); |
@@ -157,18 +157,18 @@ discard block |
||
157 | 157 | if ($file = Input::file('pic')) { |
158 | 158 | $extension = $file->getClientOriginalExtension() ?: 'png'; |
159 | 159 | $folderName = '/uploads/users/'; |
160 | - $destinationPath = public_path() . $folderName; |
|
161 | - $safeName = str_random(10) . '.' . $extension; |
|
160 | + $destinationPath = public_path().$folderName; |
|
161 | + $safeName = str_random(10).'.'.$extension; |
|
162 | 162 | $file->move($destinationPath, $safeName); |
163 | 163 | |
164 | 164 | //delete old pic if exists |
165 | - if (File::exists(public_path() . $folderName . $user->pic)) |
|
166 | - File::delete(public_path() . $folderName . $user->pic); |
|
165 | + if (File::exists(public_path().$folderName.$user->pic)) |
|
166 | + File::delete(public_path().$folderName.$user->pic); |
|
167 | 167 | |
168 | 168 | //save new file path into db |
169 | 169 | $user->pic = $safeName; |
170 | 170 | |
171 | - Base::Log($user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') changed its profile photo. '); |
|
171 | + Base::Log($user->username.' ('.$user->first_name.' '.$user->last_name.') changed its profile photo. '); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | // Was the user updated? |
@@ -178,14 +178,14 @@ discard block |
||
178 | 178 | |
179 | 179 | if ($passwordChanged) |
180 | 180 | { |
181 | - Base::Log($user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') changed its password. '); |
|
182 | - Mail::queue('emails.account.password-changed', [ 'user' => $user ], function ($m) use ($user) { |
|
183 | - $m->to($user->email, $user->first_name . ' ' . $user->last_name); |
|
181 | + Base::Log($user->username.' ('.$user->first_name.' '.$user->last_name.') changed its password. '); |
|
182 | + Mail::queue('emails.account.password-changed', ['user' => $user], function($m) use ($user) { |
|
183 | + $m->to($user->email, $user->first_name.' '.$user->last_name); |
|
184 | 184 | $m->subject(Lang::get('base.mails.password_changed')); |
185 | 185 | }); |
186 | 186 | } |
187 | 187 | |
188 | - Base::Log($user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') updated the profile. '); |
|
188 | + Base::Log($user->username.' ('.$user->first_name.' '.$user->last_name.') updated the profile. '); |
|
189 | 189 | |
190 | 190 | // Redirect to the user page |
191 | 191 | return Redirect::route('profile')->with('success', $success); |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | // Do we want to update the user password? |
235 | 235 | $password = Input::get('password'); |
236 | 236 | |
237 | - if (Sentinel::validateCredentials($user, [ 'email' => $user->email, 'password' => Input::get('old-password')])) |
|
237 | + if (Sentinel::validateCredentials($user, ['email' => $user->email, 'password' => Input::get('old-password')])) |
|
238 | 238 | { |
239 | 239 | $user->password = Hash::make($password); |
240 | 240 | $redirect = 'change-password'; |
@@ -251,12 +251,12 @@ discard block |
||
251 | 251 | // Prepare the success message |
252 | 252 | $success = Lang::get('base.auth.account.changed'); |
253 | 253 | |
254 | - Mail::queue('emails.account.password-changed', [ 'user' => $user ], function ($m) use ($user) { |
|
255 | - $m->to($user->email, $user->first_name . ' ' . $user->last_name); |
|
254 | + Mail::queue('emails.account.password-changed', ['user' => $user], function($m) use ($user) { |
|
255 | + $m->to($user->email, $user->first_name.' '.$user->last_name); |
|
256 | 256 | $m->subject(Lang::get('base.mails.password_changed')); |
257 | 257 | }); |
258 | 258 | |
259 | - Base::Log($user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') changed its password account. '); |
|
259 | + Base::Log($user->username.' ('.$user->first_name.' '.$user->last_name.') changed its password account. '); |
|
260 | 260 | |
261 | 261 | // Redirect to the user page |
262 | 262 | return Redirect::route($redirect)->with('success', $success); |
@@ -353,13 +353,13 @@ discard block |
||
353 | 353 | $activation = Activation::exists($user); |
354 | 354 | } |
355 | 355 | |
356 | - if($activation) |
|
356 | + if ($activation) |
|
357 | 357 | Activation::complete($user, $activation->code); |
358 | 358 | |
359 | - Base::TargettedLog($user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') account was accepted. ', $user->id); |
|
359 | + Base::TargettedLog($user->username.' ('.$user->first_name.' '.$user->last_name.') account was accepted. ', $user->id); |
|
360 | 360 | |
361 | - Mail::queue('emails.account.accepted-by-admin', [ 'user' => $user ], function ($m) use ($user) { |
|
362 | - $m->to($user->email, $user->first_name . ' ' . $user->last_name); |
|
361 | + Mail::queue('emails.account.accepted-by-admin', ['user' => $user], function($m) use ($user) { |
|
362 | + $m->to($user->email, $user->first_name.' '.$user->last_name); |
|
363 | 363 | $m->subject(Lang::get('base.mails.account_accepted')); |
364 | 364 | }); |
365 | 365 | |
@@ -399,11 +399,11 @@ discard block |
||
399 | 399 | |
400 | 400 | if ($user->save()) |
401 | 401 | { |
402 | - Base::TargettedLog($user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') account was refused. ', $user->id); |
|
402 | + Base::TargettedLog($user->username.' ('.$user->first_name.' '.$user->last_name.') account was refused. ', $user->id); |
|
403 | 403 | |
404 | 404 | if (Base::getSetting('SEND_EMAIL_ON_REFUSE')) |
405 | - Mail::queue('emails.account.refused-by-admin', [ 'user' => $user ], function ($m) use ($user) { |
|
406 | - $m->to($user->email, $user->first_name . ' ' . $user->last_name); |
|
405 | + Mail::queue('emails.account.refused-by-admin', ['user' => $user], function($m) use ($user) { |
|
406 | + $m->to($user->email, $user->first_name.' '.$user->last_name); |
|
407 | 407 | $m->subject(Lang::get('base.mails.account_accepted')); |
408 | 408 | }); |
409 | 409 | |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | } |
485 | 485 | |
486 | 486 | // Check if we are not trying to delete ourselves |
487 | - if ($user->id === Sentinel::getUser()->id) { |
|
487 | + if ($user->id === Sentinel::getUser()->id) { |
|
488 | 488 | // Prepare the error message |
489 | 489 | $error = Lang::get('base.base.error'); |
490 | 490 | |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | public function getAdminEdit($id = null) |
576 | 576 | { |
577 | 577 | // Get the user information |
578 | - if($user = Sentinel::findById($id)) |
|
578 | + if ($user = Sentinel::findById($id)) |
|
579 | 579 | { |
580 | 580 | // Get this user groups |
581 | 581 | $userRoles = $user->getRoles()->lists('name', 'id')->all(); |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | |
641 | 641 | try { |
642 | 642 | // Update the user |
643 | - $user->gender = Input::get('gender'); |
|
643 | + $user->gender = Input::get('gender'); |
|
644 | 644 | $user->first_name = Input::get('first_name'); |
645 | 645 | $user->last_name = Input::get('last_name'); |
646 | 646 | $user->username = Input::get('username'); |
@@ -673,16 +673,16 @@ discard block |
||
673 | 673 | if ($extension == 'png' || $extension == 'PNG' || $extension == 'JGP' || $extension == 'jpg' || $extension == 'gif') |
674 | 674 | { |
675 | 675 | $folderName = '/uploads/users/'; |
676 | - $destinationPath = public_path() . $folderName; |
|
676 | + $destinationPath = public_path().$folderName; |
|
677 | 677 | $safeName = str_random(10).'.'.$extension; |
678 | 678 | $file->move($destinationPath, $safeName); |
679 | 679 | |
680 | 680 | //delete old pic if exists |
681 | - if(File::exists(public_path() . $folderName . $user->pic)) |
|
682 | - File::delete(public_path() . $folderName . $user->pic); |
|
681 | + if (File::exists(public_path().$folderName.$user->pic)) |
|
682 | + File::delete(public_path().$folderName.$user->pic); |
|
683 | 683 | |
684 | 684 | //save new file path into db |
685 | - $user->pic = $safeName; |
|
685 | + $user->pic = $safeName; |
|
686 | 686 | } |
687 | 687 | } |
688 | 688 | |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | $status = $activation = Activation::completed($user); |
718 | 718 | $currentStatus = Input::get('status'); |
719 | 719 | |
720 | - if($currentStatus != $status) |
|
720 | + if ($currentStatus != $status) |
|
721 | 721 | { |
722 | 722 | if ($currentStatus == 0) |
723 | 723 | // Remove existing activation record |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | $activation = Activation::exists($user); |
734 | 734 | } |
735 | 735 | |
736 | - if($activation) |
|
736 | + if ($activation) |
|
737 | 737 | Activation::complete($user, $activation->code); |
738 | 738 | } |
739 | 739 | |
@@ -747,16 +747,16 @@ discard block |
||
747 | 747 | { |
748 | 748 | if ($password_changed && Input::get('send_new_password_email')) |
749 | 749 | { |
750 | - Mail::queue('emails.account.password-changed-by-admin', [ 'user' => $user, 'new_password' => $password ], function ($m) use ($user) { |
|
751 | - $m->to($user->email, $user->first_name . ' ' . $user->last_name); |
|
750 | + Mail::queue('emails.account.password-changed-by-admin', ['user' => $user, 'new_password' => $password], function($m) use ($user) { |
|
751 | + $m->to($user->email, $user->first_name.' '.$user->last_name); |
|
752 | 752 | $m->subject(Lang::get('base.mails.password_changed')); |
753 | 753 | }); |
754 | 754 | } |
755 | 755 | |
756 | 756 | if ($password_changed) |
757 | - Base::TargettedLog($user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') password was changed by an admin. ', $user->id); |
|
757 | + Base::TargettedLog($user->username.' ('.$user->first_name.' '.$user->last_name.') password was changed by an admin. ', $user->id); |
|
758 | 758 | |
759 | - Base::TargettedLog($user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') profile was changed by an admin. ', $user->id); |
|
759 | + Base::TargettedLog($user->username.' ('.$user->first_name.' '.$user->last_name.') profile was changed by an admin. ', $user->id); |
|
760 | 760 | |
761 | 761 | // Prepare the success message |
762 | 762 | $success = Lang::get('base.auth.user_changed'); |
@@ -848,36 +848,36 @@ discard block |
||
848 | 848 | if ($extension == 'png' || $extension == 'PNG' || $extension == 'JGP' || $extension == 'jpg' || $extension == 'gif') |
849 | 849 | { |
850 | 850 | $folderName = '/uploads/users/'; |
851 | - $destinationPath = public_path() . $folderName; |
|
851 | + $destinationPath = public_path().$folderName; |
|
852 | 852 | $safeName = str_random(10).'.'.$extension; |
853 | 853 | $file->move($destinationPath, $safeName); |
854 | 854 | |
855 | 855 | //delete old pic if exists |
856 | - if(File::exists(public_path() . $folderName . $user->pic)) |
|
857 | - File::delete(public_path() . $folderName . $user->pic); |
|
856 | + if (File::exists(public_path().$folderName.$user->pic)) |
|
857 | + File::delete(public_path().$folderName.$user->pic); |
|
858 | 858 | |
859 | 859 | //save new file path into db |
860 | - $user->pic = $safeName; |
|
860 | + $user->pic = $safeName; |
|
861 | 861 | } |
862 | 862 | } |
863 | 863 | |
864 | 864 | $user->save(); |
865 | 865 | |
866 | - Base::TargettedLog($user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') account was created by an admin. ', $user->id); |
|
866 | + Base::TargettedLog($user->username.' ('.$user->first_name.' '.$user->last_name.') account was created by an admin. ', $user->id); |
|
867 | 867 | |
868 | 868 | if (Input::get('send_new_password_email')) |
869 | 869 | { |
870 | 870 | if ($activate) |
871 | 871 | { |
872 | - Mail::queue('emails.account.account-created-by-admin', [ 'user' => $user, 'new_password' => Input::get('password') ], function ($m) use ($user) { |
|
873 | - $m->to($user->email, $user->first_name . ' ' . $user->last_name); |
|
872 | + Mail::queue('emails.account.account-created-by-admin', ['user' => $user, 'new_password' => Input::get('password')], function($m) use ($user) { |
|
873 | + $m->to($user->email, $user->first_name.' '.$user->last_name); |
|
874 | 874 | $m->subject(Lang::get('base.mails.account_created')); |
875 | 875 | }); |
876 | 876 | } |
877 | 877 | else |
878 | 878 | { |
879 | - Mail::queue('emails.account.account-created-by-admin-inactive', [ 'user' => $user, 'new_password' => Input::get('password') ], function ($m2) use ($user) { |
|
880 | - $m2->to($user->email, $user->first_name . ' ' . $user->last_name); |
|
879 | + Mail::queue('emails.account.account-created-by-admin-inactive', ['user' => $user, 'new_password' => Input::get('password')], function($m2) use ($user) { |
|
880 | + $m2->to($user->email, $user->first_name.' '.$user->last_name); |
|
881 | 881 | $m2->subject(Lang::get('base.mails.account_created')); |
882 | 882 | }); |
883 | 883 | |
@@ -890,9 +890,9 @@ discard block |
||
890 | 890 | ); |
891 | 891 | |
892 | 892 | // Send the activation code through email |
893 | - Mail::queue('emails.auth.register-activate', $data, function ($m) use ($user) { |
|
894 | - $m->to($user->email, $user->first_name . ' ' . $user->last_name); |
|
895 | - $m->subject(Lang::get('base.mails.welcome') . ' ' . $user->first_name); |
|
893 | + Mail::queue('emails.auth.register-activate', $data, function($m) use ($user) { |
|
894 | + $m->to($user->email, $user->first_name.' '.$user->last_name); |
|
895 | + $m->subject(Lang::get('base.mails.welcome').' '.$user->first_name); |
|
896 | 896 | }); |
897 | 897 | |
898 | 898 | } |
@@ -179,7 +179,7 @@ |
||
179 | 179 | 'BlogPost.contents' => 1, |
180 | 180 | ], |
181 | 181 | 'joins' => [ |
182 | - 'BlogPost' => [ 'User.id', 'BlogPost.author' ], |
|
182 | + 'BlogPost' => ['User.id', 'BlogPost.author'], |
|
183 | 183 | ], |
184 | 184 | ]; |
185 | 185 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | if ($value > 0) |
39 | 39 | if ($user = Sentinel::findUserById($value)) |
40 | 40 | if ($user != null) |
41 | - return $user->first_name . ' ' . $user->last_name . ' (ID: ' . $user->id . ')'; |
|
41 | + return $user->first_name.' '.$user->last_name.' (ID: '.$user->id.')'; |
|
42 | 42 | |
43 | 43 | return $value; |
44 | 44 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | if ($value > 0) |
55 | 55 | if ($user = Sentinel::findUserById($value)) |
56 | 56 | if ($user != null) |
57 | - return $user->first_name . ' ' . $user->last_name . ' (ID: ' . $user->id . ')'; |
|
57 | + return $user->first_name.' '.$user->last_name.' (ID: '.$user->id.')'; |
|
58 | 58 | |
59 | 59 | return $value; |
60 | 60 | } |
@@ -28,13 +28,13 @@ |
||
28 | 28 | $str = explode("* ", $this->description); |
29 | 29 | $choices = array(); |
30 | 30 | |
31 | - foreach($str as $st) |
|
31 | + foreach ($str as $st) |
|
32 | 32 | { |
33 | 33 | preg_match('/(?P<digit>\d+) - (?P<name>\w+)/', $st, $matches); |
34 | 34 | if (sizeof($matches) > 0) { |
35 | - $st = str_replace("*/","",$st); |
|
36 | - $st = str_replace("/*","",$st); |
|
37 | - $choices[$matches[1]] = explode($matches[1] . ' - ', $st)[1]; |
|
35 | + $st = str_replace("*/", "", $st); |
|
36 | + $st = str_replace("/*", "", $st); |
|
37 | + $choices[$matches[1]] = explode($matches[1].' - ', $st)[1]; |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | public function up() |
15 | 15 | { |
16 | 16 | |
17 | - Schema::create('User', function (Blueprint $table) { |
|
17 | + Schema::create('User', function(Blueprint $table) { |
|
18 | 18 | $table->increments('id'); |
19 | 19 | $table->string('username', 25)->nullable()->unique(); |
20 | 20 | $table->string('password', 60)->nullable(); |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | $table->creation(); |
38 | 38 | }); |
39 | 39 | |
40 | - Schema::table('User', function (Blueprint $table) { |
|
40 | + Schema::table('User', function(Blueprint $table) { |
|
41 | 41 | $table->creationRelation(); |
42 | 42 | }); |
43 | 43 | |
44 | - Schema::create('Visits', function (Blueprint $table) { |
|
44 | + Schema::create('Visits', function(Blueprint $table) { |
|
45 | 45 | $table->increments('id'); |
46 | 46 | $table->string('url')->nullable(); |
47 | 47 | $table->string('ip', 15)->nullable(); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $table->timestamps(); |
61 | 61 | }); |
62 | 62 | |
63 | - Schema::create('Logs', function (Blueprint $table) { |
|
63 | + Schema::create('Logs', function(Blueprint $table) { |
|
64 | 64 | $table->increments('id'); |
65 | 65 | $table->text('log'); |
66 | 66 | $table->integer('target')->nullable(); |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | $table->creation(); |
70 | 70 | }); |
71 | 71 | |
72 | - Schema::table('Logs', function (Blueprint $table) { |
|
72 | + Schema::table('Logs', function(Blueprint $table) { |
|
73 | 73 | $table->creationRelation(); |
74 | 74 | }); |
75 | 75 | |
76 | - Schema::create('Settings', function (Blueprint $table) { |
|
76 | + Schema::create('Settings', function(Blueprint $table) { |
|
77 | 77 | $table->increments('id'); |
78 | 78 | $table->string('friendly_name', 25); |
79 | 79 | $table->string('name', 25); |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | $table->creation(); |
84 | 84 | }); |
85 | 85 | |
86 | - Schema::table('Settings', function (Blueprint $table) { |
|
86 | + Schema::table('Settings', function(Blueprint $table) { |
|
87 | 87 | $table->creationRelation(); |
88 | 88 | }); |
89 | 89 | |
90 | - Schema::create('Group', function (Blueprint $table) { |
|
90 | + Schema::create('Group', function(Blueprint $table) { |
|
91 | 91 | $table->increments('id'); |
92 | 92 | $table->string('name', 25); |
93 | 93 | $table->string('description', 250)->nullable(); |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | $table->unique('slug'); |
102 | 102 | }); |
103 | 103 | |
104 | - Schema::table('Group', function (Blueprint $table) { |
|
104 | + Schema::table('Group', function(Blueprint $table) { |
|
105 | 105 | $table->creationRelation(); |
106 | 106 | }); |
107 | 107 | |
108 | - Schema::create('Group_User', function (Blueprint $table) { |
|
108 | + Schema::create('Group_User', function(Blueprint $table) { |
|
109 | 109 | $table->increments('id'); |
110 | 110 | $table->integer('user')->unsigned(); |
111 | 111 | $table->integer('group')->unsigned(); |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | $table->foreign('group')->references('id')->on('Group'); |
119 | 119 | }); |
120 | 120 | |
121 | - Schema::table('Group_User', function (Blueprint $table) { |
|
121 | + Schema::table('Group_User', function(Blueprint $table) { |
|
122 | 122 | $table->creationRelation(); |
123 | 123 | }); |
124 | 124 | |
125 | - Schema::create('ActivityFeed', function (Blueprint $table) { |
|
125 | + Schema::create('ActivityFeed', function(Blueprint $table) { |
|
126 | 126 | $table->increments('id'); |
127 | 127 | $table->string('added_by', 150); |
128 | 128 | $table->text('activity'); |
@@ -253,7 +253,7 @@ |
||
253 | 253 | $platform = $agent->platform(); |
254 | 254 | $pversion = $agent->version($platform); |
255 | 255 | |
256 | - $browserString = $browser . ' version ' . $version . ' | ' . $platform . ' version ' . $pversion; |
|
256 | + $browserString = $browser.' version '.$version.' | '.$platform.' version '.$pversion; |
|
257 | 257 | |
258 | 258 | |
259 | 259 | $visit = $this->getVisitsRepository()->create(['url' => Request::url(), 'ip' => Request::ip(), 'browser' => $browserString]); |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * All the "restricted area" routes |
6 | 6 | * are defined here. |
7 | 7 | */ |
8 | -Route::group(array('prefix' => '/', 'middleware' => 'webPublic'), function () |
|
8 | +Route::group(array('prefix' => '/', 'middleware' => 'webPublic'), function() |
|
9 | 9 | { |
10 | 10 | |
11 | 11 | /** |
@@ -32,23 +32,23 @@ discard block |
||
32 | 32 | /* POST */ Route::post('login', 'jlourenco\base\Controllers\AuthController@postSignin'); |
33 | 33 | |
34 | 34 | /* GET */ Route::get('register', array('as' => 'register', 'uses' => 'jlourenco\base\Controllers\AuthController@getSignup')); |
35 | - /* POST */ Route::post('register', array('as' => 'register','uses' => 'jlourenco\base\Controllers\AuthController@postSignup')); |
|
35 | + /* POST */ Route::post('register', array('as' => 'register', 'uses' => 'jlourenco\base\Controllers\AuthController@postSignup')); |
|
36 | 36 | |
37 | 37 | /* GET */ Route::get('forgot-password', array('as' => 'forgot-password', 'uses' => 'jlourenco\base\Controllers\AuthController@getLostPassword')); |
38 | - /* POST */ Route::post('forgot-password', array('as' => 'forgot-password','uses' => 'jlourenco\base\Controllers\AuthController@postForgotPassword')); |
|
38 | + /* POST */ Route::post('forgot-password', array('as' => 'forgot-password', 'uses' => 'jlourenco\base\Controllers\AuthController@postForgotPassword')); |
|
39 | 39 | |
40 | 40 | # Forgot Password Confirmation |
41 | 41 | Route::get('forgot-password/{userId}/{passwordResetCode}', array('as' => 'forgot-password-confirm', 'uses' => 'jlourenco\base\Controllers\AuthController@getForgotPasswordConfirm')); |
42 | 42 | Route::post('forgot-password/{userId}/{passwordResetCode}', 'jlourenco\base\Controllers\AuthController@postForgotPasswordConfirm'); |
43 | 43 | |
44 | 44 | # Logout |
45 | - Route::get('logout', array('as' => 'logout','uses' => 'jlourenco\base\Controllers\AuthController@getLogout')); |
|
45 | + Route::get('logout', array('as' => 'logout', 'uses' => 'jlourenco\base\Controllers\AuthController@getLogout')); |
|
46 | 46 | |
47 | 47 | # Account Activation |
48 | 48 | Route::get('activate/{userId}/{activationCode}', array('as' => 'activate', 'uses' => 'jlourenco\base\Controllers\AuthController@getActivate')); |
49 | 49 | |
50 | 50 | # User account |
51 | - Route::group(array('middleware' => 'SentinelUser'), function () { |
|
51 | + Route::group(array('middleware' => 'SentinelUser'), function() { |
|
52 | 52 | Route::get('my-account', array('as' => 'my-account', 'uses' => 'jlourenco\base\Controllers\UsersController@myAccount')); |
53 | 53 | Route::post('my-account', 'jlourenco\base\Controllers\UsersController@updateAccount'); |
54 | 54 | }); |