473,549 Members | 2,615 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

Similar topics

7
2802
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: Undefined variable PHP Notice: Undefined index PHP Notice: Undefined property I'd like to go back and fix what I can, but I'm wondering: how good...
0
1850
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 2003, although I'm not sure what is actually causing the problem. I can't summarize the issue, so please read on to find out more. I've created a...
1
3098
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 like this value = myHashtable; then, is the value of "myKey" key is null, then the result is the same, as
49
14438
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 http://www.webreference.com/programming/javascript/gr/column9/ they say: <snip> The undefined property A relatively recent addition to JavaScript is the undefined property.
0
1166
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, after it is set, I set a property of the newly initialized member. Even though the debugger says that the value is undefined, there is no run-time...
17
3330
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
7928
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 am using getElelementsByName since these are radio buttons, but it seems that the dynamic element is not seen!!! This is my code... please let...
45
4786
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 "new Array() vs " question or to the array performance, I dared to move it to a new thread. Gecko takes undefined value strictly as per Book 4,...
13
39414
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 there is a checkbox (v1) allowing to select that row for changes (e.g. delete, update, etc.) So we are creating an array of checkbox, correct ? Of...
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7959
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7473
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7810
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6044
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5369
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
764
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.