Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ErrorException (E_NOTICE) when user with master role request /home #208

Closed
stardigits opened this issue Oct 20, 2019 · 6 comments
Closed

Comments

@stardigits
Copy link

stardigits commented Oct 20, 2019

Describe the bug
ErrorException (E_NOTICE) happen when user with master role request /home

To Reproduce
Steps to reproduce the behavior:

  1. Login as master
  2. Request using url /home

Expected behavior
It should redirect to /masters (master homepage)

Screenshots
ErrorException (E_NOTICE)
Trying to get property 'id' of non-object

\app\Http\Controllers\HomeController.php
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}

/**
 * Show the application dashboard.
 *
 * @return \Illuminate\Http\Response
 */
public function index()
{
    $minutes = 1440;// 24 hours = 1440 minutes
    $school_id = \Auth::user()->school->id;
@changeweb
Copy link
Owner

Please see Auth\LoginController.php -> public function redirectTo(){}

@changeweb
Copy link
Owner

@qq690712575 @stardigits Can you please share any screenshots with error messages?

@stardigits
Copy link
Author

@changeweb, Error description is clear. This error happens when 'master' entering url /home.
I did modify the HomeController.php as follows:

    public function index()
    {
      if (\Auth::user()->role != 'master') {
        $minutes = 1440;// 24 hours = 1440 minutes
        /* codes for non master users */
      } else {
        return redirect('/masters');
      }
    }

It's resolved.

@changeweb
Copy link
Owner

@stardigits It would be great if you make a PR.

@changeweb changeweb pinned this issue Oct 27, 2019
changeweb added a commit that referenced this issue Oct 31, 2019
#208 issue. Master was not redirecting to `/masters` page after login in some cases. #208 (comment) this patch is made in this commit.
@vyrral
Copy link

vyrral commented Jul 4, 2021

what function is used to promote student from one class/section/academic year to another, cant seem to find it
54187741-6c2ca280-44d8-11e9-871a-51148b27c2b4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@changeweb @stardigits @vyrral and others