Jump to content
Sovereign

PHPVMS and WBB4 Forum

Recommended Posts

Hello

Unfortunately I did not know in which category this belongs, so off topic.

I'm trying to pass password changes and registrations to the WBB4 forum. I have already created a new function in "RegistrationData.class.php"
 

public static function ChangePasswordForum($pilotid, $newpassword) {
		
		#Find Firstname in phpvms DB
		$sql = 'SELECT firstname 
                FROM `'.TABLE_PREFIX.'pilots` WHERE pilotid =\'' . $pilotid . '\'';
		$firstname = DB::get_results($sql);
				
		#load Forum Stuff
		require_once '../../forum-new.skyline-va.de/global.php';
		
		#Prepare Forum DB Search and execute
		$newpilotid = sprintf('%03d',$pilotid);
		$forumname = '{$newpilotid}_{$firstname}';
		$sql = "SELECT userid FROM `wcf1_user` WHERE username = '$forumname'";
		$statement = wcf\system\WCF::getDB()->prepareStatement($sql);
		$statement->execute();
		$row = $statement->fetchArray();
		$userid = $row['userid'];
		$userAction = new \wcf\data\user\UserAction(array($userid), 'update', array(
					'data' => array(
					'password' => '$newpassword',
					)
		));
		$userAction->executeAction();
	}

 

in the Module Profile.php i have added the follow code above "RegistrationData::ChangePassword(Auth::$pilotid, $_POST['password1']);"
 

RegistrationData::ChangePasswordForum(Auth::$pilotid, $_POST['password1']);

 

Now the Problem:
When i now change my Password in phpvms i have an error from WBB4:
 

<<<<<<<<d57dc542d6dc2d59ed543ea4a58252dd09aa1ae3<<<<
Sun, 14 Oct 2018 01:43:03 +0000
Message: PHP notice in file /var/www/vhosts/skyline-va.de/httpdocs/iCrew/core/common/PilotData.class.php (856): Trying to get property of non-object
File: /var/www/vhosts/skyline-va.de/forum-new.skyline-va.de/wcf/lib/system/WCF.class.php (309)
PHP version: 5.5.38
WCF version: 2.1.10 (Typhoon)
Request URI: /index.php/profile
Referrer: https://icrew.skyline-va.de/index.php/Profile/editprofile
User-Agent: Mozilla/5.0 (Linux; Android 8.0.0; SM-N950F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36
Information: ""
Stacktrace: 
  #0 /var/www/vhosts/skyline-va.de/httpdocs/iCrew/core/common/PilotData.class.php(856): wcf\system\WCF::handleError(8, 'Trying to get p...', '/var/www/vhosts...', 856, Array)
  #1 /var/www/vhosts/skyline-va.de/httpdocs/iCrew/lib/skins/iCrew/profile_main.php(70): PilotData::getFieldValue('87', 'Profile Style')
  #2 /var/www/vhosts/skyline-va.de/httpdocs/iCrew/core/classes/TemplateSet.class.php(238): include('/var/www/vhosts...')
  #3 /var/www/vhosts/skyline-va.de/httpdocs/iCrew/core/classes/TemplateSet.class.php(181): TemplateSet->getTemplate('profile_main.ph...', false, true, false)
  #4 /var/www/vhosts/skyline-va.de/httpdocs/iCrew/core/classes/Template.class.php(82): TemplateSet->showTemplate('profile_main.ph...')
  #5 /var/www/vhosts/skyline-va.de/httpdocs/iCrew/core/classes/CodonModule.class.php(92): Template::show('profile_main.ph...')
  #6 /var/www/vhosts/skyline-va.de/httpdocs/iCrew/core/modules/Profile/Profile.php(66): CodonModule->render('profile_main.ph...')
  #7 [internal function]: Profile->index()
  #8 /var/www/vhosts/skyline-va.de/httpdocs/iCrew/core/classes/MainController.class.php(218): call_user_func_array(Array, Array)
  #9 /var/www/vhosts/skyline-va.de/httpdocs/iCrew/index.php(70): MainController::RunAllActions()
  #10 {main}
<<<<

 

I have Create a new php file on my Webserver to test the WBB4 Code:
 

<?php
  
require_once '../forum-new.skyline-va.de/global.php';


$username = 'XXXX';

		$sql = "SELECT userid FROM `wcf1_user` WHERE username = '$username'";
		$statement = wcf\system\WCF::getDB()->prepareStatement($sql);
		$statement->execute();
		$row = $statement->fetchArray();
		$userid = $row['userid'];
		$userAction = new \wcf\data\user\UserAction(array($userid), 'update', array(
					'data' => array(
					'password' => 'XXXXX',
					)
		));
		$userAction->executeAction();
		echo $userid, $username;
?>

This Code works perfect to change the Password.

 

I don't find the error in my code or I'm too stupid to find him :)

is someone here who can help me with this and assist me with the existing registration and password changes to the WBB4?

I am also willing to pay something for the work.

 

Edit: PHPVMS version is 5.5 from Simpilot, WBB4 with WCF 2.1

 

Best Regards,
Jan

Edited by Sovereign

Share this post


Link to post
Share on other sites

Are you trying to get username/password from phpvms working in wbb or the other way around? I'm not familiar with WBB

Share this post


Link to post
Share on other sites

exactly. my goal is that after the registration in the phpvms automatically the user in the forum is created with pilot number, first name and password. Password changes which should then be made in the phpvms then forwarded to WBB.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×