Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Private Profiles.

edited November 2007 in Vanilla 1.0 Help
I was wondering how I could have the profiles so that other users CAN NOT acces it.

There is ONE user/ role we do not wish to grant access to other peoples profiles.

I hope someone can help. Thanks.


  • Options
    <?php /* Extension Name: Private Accounts Extension Url: Description: Blocks users from a particular role from browsing user accounts. Version: 1.0 Author: Nathan Wheatley Author Url: */ if ($Context->SelfUrl == 'account.php' && $Context->Session->RoleID == xx) { if ($AccountUser->UserID == $Context->Session->UserID) { } else { header('location:'.GetUrl($Configuration, 'index.php')); die(); } } ?>

    I worked it out. You will need to change the RoleID on the first line of the first if statement.
  • Options
    edited September 2006
    or something like that:
    <?php /* Extension Name: Private Accounts Extension Url: Description: Blocks unauthenticated users from browsing user accounts on a public forum. Version: 1.0 Author: Mark O'Sullivan Author Url: */ $Context->Configuration['PERMISSION_SEE_OTHER_ACCOUNTS'] = '0'; $Context->Dictionary['PERMISSION_SEE_OTHER_ACCOUNTS'] = 'Can see other account profiles'; if ($Context->SelfUrl == 'account.php' && ($Context->Session->UserID == 0 || ( $AccountUser->UserID != $Context->Session->UserID && !$Context->Session->User->Permission("PERMISSION_SEE_OTHER_ACCOUNTS") ))) { header('location:'.GetUrl($Configuration, 'index.php')); die(); } ?>
  • Options
    MarkMark Vanilla Staff
    That's more like it, Dinoboff :)
  • Options
    Thank you.

    I really had no idea what I was doing, and what I did seemed to work.

    I'll use the new one now.
  • Options
    'Can see other account profiles;

    should be...

    'Can see other account profiles';

    (missing end ' )
  • Options
    Thanks for that.

    I have to ask. What's with the green text man?
  • Options
    edited August 2006
    Green? Egads, I thought it was blue! Damned color-blindness!
    Seriously though, no reason, none that come to mind except that I like being creative...
  • Options
    Fair enough. :P
  • Options
    I think that green text triggered a minor styling bug.

    The text which says something like 1 to 10 of 10 in the lefthand corner just below the last comment has obviously turned green on my screen. (It use to be gray.) This error only seem to show up here...
  • Options
    There's nothing wrong with chaning your text colour!
  • Options
    edited August 2006
    Wanderer needs to change his </green> to an </font>
  • Options
     Quote: WallPhone  Wanderer needs to change his </green> to an </font>
    Oops, fixed, [embarrassed]
  • Options
    is that code above correct ? I just copied and pasted and it results in error
    parse error, unexpected '{'
  • Options
    There was some missing ')'; I just added them
  • Options
    edited November 2007

    is this extension, 1.1.4 friendly? because i could'nt see any effect or parameters in user roles
    only that guests being redirected to the discussions-overview page.

    or is this how it should be?

    if yes, is there a way to define a url? for example a 404 page or a custom page with pagemanager.
    i'm talking about a interface solution/admin settings solution like add any url into this textfield,
    and not really about the text editor way.

This discussion has been closed.