Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^7: global var

by Anonymous Monk
on Apr 06, 2017 at 23:48 UTC ( #1187362=note: print w/replies, xml ) Need Help??

in reply to Re^6: global var
in thread global var

Why does your code ask "managerusers" module to exports a "LoggedOn_user_id" function?

Replies are listed 'Best First'.
Re^8: global var
by tultalk (Monk) on Apr 07, 2017 at 22:24 UTC

    Answer his and one above.

    Manageusers is the "main" unit in the sense that everything get funneled back to that unit for accessing database tables and all the login /logout functions. I consider it the "main" unit to which manage_users.cgi interfaces between thr web pages and the guts of the program.

    The loggedonuser the ID of the user far accessing various other pieces of data such a database records "owned" by the user.

    The change from LoggedOn_user_id to GetLoggedOn... and back again was a result of trying an exported function result to pass the id vs a scalar variable. Neither worked.

    Other functions/.scalars are exported just fine. Not this one!!!

      ...Other functions/.scalars are exported just fine. Not this one!!!

      Then it shouldn't be too hard to duplicate that error in 20 lines, and post it here, right?

        A previous comment posted code as you suggest. It worked fine when I tested it. I have something screwed up somehow and I can't see it.

        Posting question here was hoping for some insight as to why something like this may be occurring.

        These are two declarations (same location in manageusers just before first function definition.

        our $adminaccess = 0; our $LoggedOn_user_id = 0;

        As I said in an earlier response, I can grab $adminaccess in javascript in html page.

        <script type="text/javascript"> var adminflag = $manageusers::adminaccess; </script>

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1187362]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2021-06-20 19:11 GMT
Find Nodes?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)

    Results (95 votes). Check out past polls.