Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

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

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    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);
    
    }
    
  • Options
    hgtonighthgtonight ∞ · New 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

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Answers

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    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);
    
    }
    
  • Options
    hgtonighthgtonight ∞ · New 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

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.