473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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
here?



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 =
true;
if (is_integer($this->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->userIsSuperRoot) {
Jul 16 '05 #1
0 2976

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

Similar topics

7
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: ...
0
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...
1
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...
49
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...
0
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,...
17
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>
22
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...
45
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...
13
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.