undefined class property

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lawrence

    undefined class property

    I've got this $user class that has a variable called $userIsSuperRoo t.
    When I just set error_reporting to ALL I got an error on the last line
    that I'm showing of my code down below. It says this property is
    undefined. Why? Just because it tests false? Why should that be an
    error? You can see that I've declared it correctly. What does PHP want
    here?











    class McUser {

    var $userName;
    var $password;
    var $userId;

    var $dbUserId;
    var $dbUserName;
    var $dbPassword;
    var $dbUserSecurity Level;
    var $dbIsLoggedIn;

    // 06-21-03 - it would be better if this was called
    $dbWhenLastCall edAPage. It keeps track
    // of the most recent time this user called a page - more than 20
    minutes and they are logged out.
    var $dbWhenLoggedIn ;
    var $date;

    var $userExists;
    var $userIsSuperRoo t;
    var $userIsRoot;
    var $userIsAssociat e;
    var $userIsJustTest ingTheSite;
    var $userIsVerified ;
    var $userIsMember;

    var $sql;
    var $io;




    function McUser(&$sql, &$io, &$config) {
    $this->sql= &$sql;
    $this->io= &$io;

    // 06-22-03 - these are the values from the config file. These are
    the root level values.
    $mcPassword = $config["mcPassword "];
    $mcUserName = $config["mcUserName "];

    // 06-21-03 - these next 3 values are being retrieved from COOKIES
    or POST information.
    $this->username = getVar("usernam e");
    $this->password = getVar("passwor d");
    $this->userId = getVar("userId" );

    // 07-11-03 - wasteful of resources - here we have two lines and we
    make two calls to the database for the same entry.
    $entry = $this->sql->getEntryWith2C onditions("cbPa ssword",
    $this->password, "cbUserName ", $this->username);
    if ($entry) extract($rwArra y=$this->sql->putEntryIntoNa medArray($entry ));

    // 06-21-03 - these next values are the ones in the database. They
    need to match the ones
    // the user has given or we must suspect the user is a hacker trying
    to break in. Or they mistyped.
    $this->userId = $cbId;
    $this->dbUserId = $cbId;
    $this->dbUserName = $cbUserName;
    $this->dbPassword = $cbPassword;
    $this->dbUserSecurity Level = $cbUserSecurity Level;
    $this->dbIsLoggedIn = $cbIsLoggedIn;
    $this->dbWhenLogged In = $cbWhenLoggedIn ;

    if ($this->password == $mcPassword && $this->username ==
    $mcUserName) $this->userIsSuperRoo t = true;
    if ($this->dbUserSecurity Level == "root") $this->userIsRoot = true;
    if ($this->dbUserSecurity Level == "associate" )
    $this->userIsAssociat e = true;
    if ($this->dbUserSecurity Level == "justTestingThe Site")
    $this->userIsJustTest ingTheSite = true;
    if ($this->dbUserSecurity Level == "verified") $this->userIsVerifi ed
    = true;
    if ($this->dbUserSecurity Level == "member") $this->userIsMember =
    true;
    if (is_integer($th is->dbUserId) || $this->userIsRoot) $userExists =
    true;

    // 06-22-03 - this is a bit of a cheat. The SQL class needs to put
    someone is as the user on
    // every INSERT, and root has no database value. So if the root user
    is logged in, here we put
    // those values in.
    if ($this->userIsSuperRoo t) {
Working...