display galleries if logged in

richmanrichman Registered Users Posts: 20 Big grins
Hello.

Is there a function in javascript that will return whether or not I'm logged in?

For example, the following code is in my footer in the control panel to prevent hidden galleries from displaying:

for (i = 0; i < oList.length; i++) {
if (re.test(oList.getElementsByTagName('a')[0].href))
oList.parentNode.removeChild(oList);
}

But this also prevents these galleries from being listed when I'm logged into my control panel. The only way I know how to display these galleries is to comment out the script when I log in.

Is there a function I can use in an 'if' statement that will return whether or not I'm logged in so they will display in my control panel when I'm logged in?


Thanks,
Rich

Comments

  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited March 11, 2008
    Rich,

    You can use...
    if (YD.hasClass(document.body, 'LoggedIn')) {
      //Logged in
    }
    else {
      //Not logged in
    }
    

    But this needs to be used from the footer javascript section.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
Sign In or Register to comment.