Joaogl Posted August 11, 2014 Report Share Posted August 11, 2014 Hello guys, I know there was once a topic about automatic register on the phpbb forum from the phpvms register but that's the small part of my problem and I'm here trying to find the awnser for rest of it. I don't consider myself a very good php programmer so please don't expect too much... So what I'm trying to do is to get a few things done like, registration, login, logout, account activation and finally but not least, a last posts page. Registration is done and working. Login is giving me an error that I will post in a few. Logout, don't know yet how to do it. Account activation, I thought I only had to remove the users actkey from the database but it didn't work... Last posts page... well... no Idea... haven't started yet. My code: <?php class ForumManager extends CodonModule { public function __construct() { CodonEvent::addListener('ForumManager'); } public function EventListener($eventinfo) { if($eventinfo[0] == 'registration_complete') self::RegisterAccount($eventinfo[2]); else if($eventinfo[0] == 'login_success') self::LoginAccount($eventinfo[2]); else if($eventinfo[0] == 'logout_success') self::LogoutAccount(); else if($eventinfo[0] == 'account_activated') self::ActivateAccount($eventinfo[2]); } public function RegisterAccount($userinfo) { $fname = $userinfo['firstname']; $lname = $userinfo['lastname']; $pass = $userinfo['password1']; $email = $userinfo['email']; $code = $userinfo['code']; $uinfo = PilotData::GetPilotByEmail($userinfo['email']); $code = PilotData::GetPilotCode($uinfo->code, $uinfo->pilotid); $pilot_id = $fname.' '.$lname; $pilot_id_klein = strtolower($pilot_id); $passMD5 = md5($pass); $tm = time(); DB::query("INSERT INTO phpbb_users (username, username_clean, user_password, user_email, group_id, user_timezone, user_dst, user_rank, user_lang, user_colour, user_type, user_actkey, user_dateformat, user_style, user_regdate) VALUES ('".$pilot_id."', '".$pilot_id_klein."', '".$passMD5."', '".$email."', '9','0.0', '0', '2','en','0099FF','1','5BN4938HB2','D M d, Y g:i a', '2', '".$tm."')"); } public function LoginAccount($userinfo) { define('IN_PHPBB', true); include('/public_html/forum/commons.php'); $user->session_begin(); $auth->acl($user->data); $user->setup(); if($user->data['is_registered']) { //User is already logged in } else { $username = $userinfo['pilotid']; $password = $userinfo['password']; echo "usuario: " . $username . " ; password: " . $password; $result = $auth->login($username, $password); if ($result['status'] == LOGIN_SUCCESS) { //User was successfully logged into phpBB echo "Login correcto"; if ($ref !=""){ header("location:$ref"); }else{ header("location:index.php"); } } else { //User's login failed echo "Login incorrecto: " . $result['status']; } } } public function LogoutAccount() { define('IN_PHPBB', true); include('/public_html/forum/common.php'); } public function ActivateAccount($userinfo) { } } ?> The login error: Warning: include(/public_html/forum/commons.php): failed to open stream: No such file or directory in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 37 Warning: include(): Failed opening '/public_html/forum/commons.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 37 Fatal error: Call to a member function session_begin() on a non-object in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 39 I've checked and the commons file is indeed there... Maybe to keep the topic organized we should start with the login and then move to the next topic? What am I doing wrong to get this error? Thanks for your time, hope I help someone else with this topic, Joao Lourenco. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted August 12, 2014 Report Share Posted August 12, 2014 By looking at it, here is an issue that needs fixed. In the root of phpBB3 there is a common.php file. check this part of your error out /public_html/forum/commons.php Note the S after the word common. Try loosing the S on the word commons in your module and it may come to life. 1 Quote Link to comment Share on other sites More sharing options...
Joaogl Posted August 12, 2014 Author Report Share Posted August 12, 2014 Don't know how I missed that but it doesn't work anyway... Warning: include(/public_html/forum/common.php): failed to open stream: No such file or directory in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 37 Warning: include(): Failed opening '/public_html/forum/common.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 37 Fatal error: Call to a member function session_begin() on a non-object in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 39 Thank you for the awnser, Joao Lourenco Quote Link to comment Share on other sites More sharing options...
Tom Posted August 12, 2014 Report Share Posted August 12, 2014 You'll probably want to use either a full path or relative path for including: include('/home/tigersor/public_html/forum/common.php'); // or include('../../../../forum/common.php'); Quote Link to comment Share on other sites More sharing options...
Joaogl Posted August 12, 2014 Author Report Share Posted August 12, 2014 Did it, now it gives me this error: Warning: require(includes/startup.): failed to open stream: No such file or directory in /home/tigersor/public_html/forum/common.php on line 19 Warning: require(includes/startup.): failed to open stream: No such file or directory in /home/tigersor/public_html/forum/common.php on line 19 Fatal error: require(): Failed opening required 'includes/startup.' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tigersor/public_html/forum/common.php on line 19 so I tried this: include('/home/tigersor/public_html/forum/include/startup.php'); include('/home/tigersor/public_html/forum/common.php'); and then this happed: Warning: include(/home/tigersor/public_html/forum/include/startup.php): failed to open stream: No such file or directory in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 37 Warning: include(): Failed opening '/home/tigersor/public_html/forum/include/startup.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tigersor/public_html/site/core/modules/ForumManager/ForumManager.php on line 37 Warning: require(includes/startup.): failed to open stream: No such file or directory in /home/tigersor/public_html/forum/common.php on line 19 Warning: require(includes/startup.): failed to open stream: No such file or directory in /home/tigersor/public_html/forum/common.php on line 19 Fatal error: require(): Failed opening required 'includes/startup.' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tigersor/public_html/forum/common.php on line 19 Quote Link to comment Share on other sites More sharing options...
Joaogl Posted August 18, 2014 Author Report Share Posted August 18, 2014 I did managed to fix all of that know I just got a question... How can I make the logins and log out's if both phpvms and phpbb have similar classes? (Auth, Templates, Session) how can I get arround with that? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.