How to use login_db in auth_db.php?

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Post Reply
Stomper
Registered User
Posts: 1
Joined: Thu Feb 28, 2008 6:33 pm

How to use login_db in auth_db.php?

Post by Stomper »

Hi,

I am using phpBB3 on my site.
My users mainly use the Board, but I want to provide some extra pages with content, witch should only be accessible for users.

I thought I can use the login_db fuction in the auth_db.php file.

I included with

Code: Select all

define('IN_PHPBB',0); // only that IN_PHPBB is defined and the include is working
include ("forum/includes/auth/auth_db.php");
That is working so far... but by calling the function like this
$user="Test";
$pass="password";
$status = login_db($user,$pass);
echo $status['status'];
I get following error:
Call to a member function on a non-object in /.../forum/includes/auth/auth_db.php on line 42

So how can I use this function?
I want just use it to verify the users to view the pages (my extra pages) with their own username from the board and welcome them with their names.

Please can you help me?

User avatar
Prince of area51
Registered User
Posts: 133
Joined: Mon Jun 27, 2005 8:46 pm
Location: Manchester, UK
Contact:

Re: How to use login_db in auth_db.php?

Post by Prince of area51 »

Actually there is a bit more than that. The header should be something like:

Code: Select all

/**
* @ignore
*/
define('IN_PHPBB', true);
// Specify the path to you phpBB3 installation directory.
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
// The common.php file is required.
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);

$user->setup();
For more detailed guide, have a look at Adding pages - Olympus

Post Reply