Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Using and ACCESS_ADMIN check in pnuser.php?
  • Posted: 20.03.2005, 23:01
     
    alarconcepts
    rank:
    Professional Professional
    registered:
     April 2004
    Status:
    offline
    last visit:
    21.01.08
    Posts:
    2723
    I've got the pnuser.php displaying words/definitions for my upcoming dictionary module, and what I'd like to do is have it so that if the viewer has admin status, they can have extra controls (edit/remove) displayed with each entry...so, I've used the following check for access, but it doesn't work. I've verified my access level and it's admin, so I was wondering if maybe I couldn't use an ACCESS_ADMIN check in pnuser.php, being a user file.

    Code

    if (!pnSecAuthAction(0, 'AlarDictionary::', '::', ACCESS_ADMIN))
    {
         // Outout links for edit/remove here
    }


    I've also verified that the output of the admin links works by commenting out the check and seeing the links magically appear on page-refresh.

    Any thoughts on this?

    Thanks,

    alar

    --
    Photography | PHP | Other
  • Posted: 20.03.2005, 23:06
     
    alarconcepts
    rank:
    Professional Professional
    registered:
     April 2004
    Status:
    offline
    last visit:
    21.01.08
    Posts:
    2723
    If it's any help, I'm using a pnModURL as such to print the link...

    Code

    $output->URL(pnVarPrepForDisplay(pnModURL('ModName','admin','edit',array('tid'=>$match['startnum']))),_EDIT);


    --
    Photography | PHP | Other
  • Posted: 21.03.2005, 05:00
     
    jediping
    rank:
    Helper Helper
    registered:
     November 2004
    Status:
    offline
    last visit:
    12.03.07
    Posts:
    387
    Erm, just a guess, but I think you want to take out the ! at the beginning of the if statement. ;)
  • Posted: 21.03.2005, 05:08
     
    alarconcepts
    rank:
    Professional Professional
    registered:
     April 2004
    Status:
    offline
    last visit:
    21.01.08
    Posts:
    2723
    DOH!

    icon_redface

    --
    Photography | PHP | Other
  • Posted: 21.03.2005, 05:49
     
    alarconcepts
    rank:
    Professional Professional
    registered:
     April 2004
    Status:
    offline
    last visit:
    21.01.08
    Posts:
    2723
    ...um...I forgot...

    THANKS!

    --
    Photography | PHP | Other
  • Posted: 21.03.2005, 09:36
     
    mhalbrook
    rank:
    Legend Legend
    registered:
     December 1969
    Status:
    offline
    last visit:
    04.12.08
    Posts:
    6540
    Yeah, cuz it's definitly possible, because I do that in PrayerPost and my as yet unreleased module
  • Posted: 21.03.2005, 20:25
     
    jediping
    rank:
    Helper Helper
    registered:
     November 2004
    Status:
    offline
    last visit:
    12.03.07
    Posts:
    387
    You're welcome! :)

    I tend to make mistakes like that, especially when I'm copying and pasting code where I know what it does, but not why necessarily. And then there are the silly little typos. If I had a dime for every time I forgot a semicolon.... :)

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula