472,958 Members | 2,017 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

undefined class property

I've got this $user class that has a variable called $userIsSuperRoot.
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

class McUser {

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

var $dbUserId;
var $dbUserName;
var $dbPassword;
var $dbUserSecurityLevel;
var $dbIsLoggedIn;

// 06-21-03 - it would be better if this was called
$dbWhenLastCalledAPage. 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 $userIsSuperRoot;
var $userIsRoot;
var $userIsAssociate;
var $userIsJustTestingTheSite;
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("username");
$this->password = getVar("password");
$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->getEntryWith2Conditions("cbPassword",
$this->password, "cbUserName", $this->username);
if ($entry) extract($rwArray=$this->sql->putEntryIntoNamedArray($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->dbUserSecurityLevel = $cbUserSecurityLevel;
$this->dbIsLoggedIn = $cbIsLoggedIn;
$this->dbWhenLoggedIn = $cbWhenLoggedIn;

if ($this->password == $mcPassword && $this->username ==
$mcUserName) $this->userIsSuperRoot = true;
if ($this->dbUserSecurityLevel == "root") $this->userIsRoot = true;
if ($this->dbUserSecurityLevel == "associate")
$this->userIsAssociate = true;
if ($this->dbUserSecurityLevel == "justTestingTheSite")
$this->userIsJustTestingTheSite = true;
if ($this->dbUserSecurityLevel == "verified") $this->userIsVerified
= true;
if ($this->dbUserSecurityLevel == "member") $this->userIsMember =
if (is_integer($this->dbUserId) || $this->userIsRoot) $userExists =

// 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->userIsSuperRoot) {
Jul 16 '05 #1
0 2963

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Coder Droid | last post by:
I decided to run some code with errors set to E_ALL, just to see what I would run across. It caught a few things, but 90% or better of the messages were of the 'undefined' kind: PHP Notice: ...
by: Dave | last post by:
Hi everyone, (I already posted this to the VS.NET IDE news group without any responses, so I'm attempting one more time in this group) The issue I'm having is occuring in the IDE of VS.NET...
by: Pavils Jurjans | last post by:
Hello, I am building custom hashtable class, and thinking about value retrieval issues. The thing is, that sometimes the hashtable value may contain value null. If someone is reading this value...
by: matty | last post by:
Hi, I recently got very confused (well that's my life) about the "undefined" value. I looked in the FAQ and didn't see anything about it. On...
by: Michael R | last post by:
Here's one that's got me stumped... I have a class with a member variable. I set it in a member method. In the debugger, it shows up as <undefined> before AND AFTER it is set. However,...
by: yb | last post by:
Hi, Looking for clarification of undefined variables vs. error in JavaScript code. e.g. <script> alert( z ); // this will be an error, i.e. an exception </script>
by: Saul | last post by:
I have a set of radio buttons that are created dynamically, after rendered I try loop thru this set by getting the length of the set, but I keep getting an error stating the element is undefined. I...
by: VK | last post by:
(see the post by ASM in the original thread; can be seen at <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/3716384d8bfa1b0b> as an option) As that is not in relevance to...
by: Oleg Konovalov | last post by:
Hi, I am working on a web application which among other things uses DHTML, Java and Javascript. It populates web page based on the contents of the database (resultset), and next to each row...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.