Go to entry/signin after logged in

vanilla 2.1.3 ozone 2.1

Is it normal when you go to entry/signin after u logged in, you can login another time?

Shouldnt there be a message saying: Already logged in, or just a redirect to /discussions/?

And if not, is it possible to send them when logged in to /discussions/?

Asking this, cause i have a link added to my menu within a pocket that redirects to entry/signin/, but this link in the menu stays when u already logged in....

Thanks

Tagged:

Best Answers

  • edited October 2014 Answer ✓

    To make a link change to sign out from sign in , you need to add the session part to it.

     $Session = Gdn::Session();
    if ($this->Menu) {
    
    $Authenticator = Gdn::Authenticator();
                        if ($Session->IsValid()) {
    $this->Menu->AddLink('SignOut', T('Sign Out'), $Authenticator->SignOutUrl(), FALSE, array('class' => 'NonTab SignOut'));
                            } else {
                                $Attribs = array();
                                if (C('Garden.SignIn.Popup') && strpos(Gdn::Request()->Url(), 'entry') === FALSE)
                                    $Attribs['class'] = 'SignInPopup';
    
                                $this->Menu->AddLink('Entry', T('Sign In'), $Authenticator->SignInUrl($this->SelfUrl), FALSE, array('class' => 'NonTab'), $Attribs);
    
    }
    
  • hgtonighthgtonight MVP
    edited October 2014 Answer ✓

    You can sign in as someone else. If you want a message to be displayed, hook into the view and add a message if there is a valid session.

    EDIT - Crosspost with @vrijvlinder

Answers

  • edited October 2014 Answer ✓

    To make a link change to sign out from sign in , you need to add the session part to it.

     $Session = Gdn::Session();
    if ($this->Menu) {
    
    $Authenticator = Gdn::Authenticator();
                        if ($Session->IsValid()) {
    $this->Menu->AddLink('SignOut', T('Sign Out'), $Authenticator->SignOutUrl(), FALSE, array('class' => 'NonTab SignOut'));
                            } else {
                                $Attribs = array();
                                if (C('Garden.SignIn.Popup') && strpos(Gdn::Request()->Url(), 'entry') === FALSE)
                                    $Attribs['class'] = 'SignInPopup';
    
                                $this->Menu->AddLink('Entry', T('Sign In'), $Authenticator->SignInUrl($this->SelfUrl), FALSE, array('class' => 'NonTab'), $Attribs);
    
    }
    
  • hgtonighthgtonight MVP
    edited October 2014 Answer ✓

    You can sign in as someone else. If you want a message to be displayed, hook into the view and add a message if there is a valid session.

    EDIT - Crosspost with @vrijvlinder

Sign In or Register to comment.