 |
 |
 |
 |
#312808 - 01/19/07 07:03 PM
Re: User Authentication Class
[Re: Ian Spence]
|
Power User
Registered: 12/17/02
Posts: 71
|
Hi, thanks for the code! As usual, I'm trying to do something weird with things and have a little prob: I get this error message: Fatal error: Cannot instantiate non-existent class: userauth in /home/XXXX/public_html/wiki/extensions/ubbt_auth_mod.php on line 24I have tow domains set up like this: www.hairfacts.comwww.hairtell.com (which is actually located at www.hairfacts.com/hairtell) I'm trying to make people have to be logged into the forum at www.hairtell.com/forum before they can access an editing page at www.hairfacts.com/wikiI know usually this wouldn't work cross-domain, but since hairtell.com is actually a folder inside hairfacts.com, I thought it might work. It actually includes the files, and recognizes the sql class, but dies on the "userauth" class. I also don't know why it's showing "userauth" in lowercase letters in the error message, since it's declared and called like "UserAuth" Any thoughts? =)
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#315115 - 08/08/07 07:13 PM
Re: User Authentication Class
[Re: Ian Spence]
|
Power User
Registered: 11/15/03
Posts: 85
Loc: UK
|
Now here is a surprise ! Its not working for me? It seems that its not picking up on $userob. File saved and uploaded into forums/includes folder as user_auth.inc.php <yes> Paths updated <yes> New file with simple test code <yes>
file test-auth.php
<?php
include ('forums/includes/user_auth.inc.php');
echo "test auth <br />";
$userob = new user_auth();
if( $userob->is_logged_in ) {
echo "you are logged in";
}
?>
Out put only my first test echo of test auth <br /> If i'm logged in or not the result is the same? ive tried full paths and relative paths  If they are wrong i do get the php error so they are correct. Humm what could be wrong? Help << i'm stuck. Aso if i run the file with all of the examples in the first post, i get this error which made me use the test text. $userob = new user_auth();
// Am I logged in? if( $userob->is_logged_in ) { // I am logged in }
// Am I in group 3? if( $userob->in_group( 3 ) ) { // Why, yes we are }
// Who cares what group I'm in! I wanna know // if I can read a topic from forum 7 if( $userob->check_access( 7, "read" ) ) { // Apparently I can }
// What if I want to know if I'm an administrator if( $userob->fields['USER_MEMBERSHIP_LEVEL'] == "Administrator" ) { // That means I'm teh uber user }
// Want to create a welcome message? if( $userob->is_logged_in ) { if( $userob->is_banned ) { echo "Go away, " . $userob->fields['USER_DISPLAY_NAME']; } else { echo "Welcome, " . $userob->fields['USER_DISPLAY_NAME']; } } else { echo "Please register"; } Warning: in_array() [function.in-array]: Wrong datatype for second argument in forums/includes/user_auth.inc.php on line 202 Whats wrong ? Thanks for any help as always 
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#315151 - 08/10/07 02:01 PM
Re: User Authentication Class
[Re: AllenAyres]
|
Power User
Registered: 11/15/03
Posts: 85
Loc: UK
|
PHP Version 5.2.2 im using full paths in all instances  ive chopped out the full path in my example /home/cwcom/domains/xxxxx.co.uk/public_html/forums include ('/home/xxxxx/domains/xxxxxxxx.co.uk/public_html/forums/includes/user_auth.inc.php'); the 2 paths in the /includes folder are also correct. require_once( "/home/xxxxx/domains/xxxxxxx.co.uk/public_html/forums/includes/config.inc.php" ); require_once( "/home/xxxxx/domains/xxxxxx.co.uk/public_html/forums/libs/mysql.inc.php" );
Edited by Mark_S (08/10/07 02:02 PM)
|
|
Top
|
|
|
|
 |
 |
 |
 |
|
|