where is the class user?

where is the class user?

by errol zantua -
Number of replies: 3

pardon me for this newbie question but on which php file could i see the USER class? tnx

Average of ratings: -
In reply to errol zantua

Re: where is the class user?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It is of no particular class. (Or, to be precise it is the stdClass class, which is built in to PHP).

If you want to see what $USER looks like, just make a test script that does

print_object($USER);

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: where is the class user?

by errol zantua -

thank you for you reply. sorry, but i am very noob in PHP.

this is what i wrote in my test.php

<?php

require_once ("/moodle/lib/datalib.php");

print_object($USER); ?>

 

it printed an undefined variable error. how do I do this? sorry for the troubles.

In reply to errol zantua

Re: where is the class user?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

<?php

require_once ("/moodle/config.php");

print_object($USER); ?>

Average of ratings: Useful (1)