Skip to content

If the user is logged out, present login link instead of user menu #56

Closed

Description

@iangilman
No description provided.

Activity

  1. iangilman commented on Oct 2, 2018

    @iangilman
    MemberAuthor

    BTW, it appears that this isn't an issue on the production site, since it redirects the user to an entirely different login page. We ran into some trouble related to this on the local site, though, so it seems worth fixing.

  2. iangilman commented on Oct 2, 2018

    @iangilman
    MemberAuthor

    For reference, here's how you mix PHP if statements with HTML:

    <?php if($condition) : ?>
        <a href="http://yahoo.com">This will only display if $condition is true</a>
    <?php elseif($anotherCondition) : ?>
        more html
    <?php else : ?>
        even more html
    <?php endif; ?>
    

    Though in this case you are already inside a large PHP block, so the beginning and ending PHP tags are already taking care of you. Also you don't need the elseif in this case. So, your new code would end up looking more like:

    if($condition) : ?>
        <a href="http://yahoo.com">This will only display if $condition is true</a>
    <?php else : ?>
        even more html
    <?php endif; 
    
  3. rgilman commented on Oct 2, 2018

    @rgilman
    Member

    The dev site bfn.context.org is using a plugin called Restricted Site Access.

    Doing our own re-direct sounds like a good step. I see this as part of the bigger picture in #47 since we will eventually want to send:

    • not-logged-in users to a page that includes a login form and likely some public description of the site
    • explorers and guests to their respective groups
    • graduates (regular users) to their personal home page.

    I support doing whatever you feel is a useful next step in this direction.

  4. iangilman commented on Oct 3, 2018

    @iangilman
    MemberAuthor

    Cool. Good to have the context. I think for starters just being able to know whether you're logged in (and present a different UI then) is a good start.

  5. rgilman commented on Oct 3, 2018

    @rgilman
    Member

    Works for me.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions