Database integration with phpBB3

Please post here if you have problems in using Wing FTP Server.
chaosnature
Posts: 16
Joined: Thu Sep 09, 2010 1:32 am

Database integration with phpBB3

Post by chaosnature »

Hi,

i read in the help section that it is possible for users to create an account in phpbb3 and be able to login to wingftp, provided you have setup your database which i have , but it dont seem to be working, can you outline how this is archived?

this below code i added to my php code
In this example, we use PHPBB version 3.0, and you would look for, in the source file "includes/ucp/ucp_register.php", the code:



$user_id = user_add($user_row, $cp_data);



then add the below code directly after it.



//Wing FTP Server MOD start

$ftp_dbname = "wftp_database"; //Wing FTP Server's mysql database name, assume in the same server.

$ftp_domain_name = "default"; //ftp's domain name.

$ftp_dirpath = "D:/ftp_data/".$data['username'];//user's directory path

$ftp_upload_limit = TRUE; //whether to limit the quota size

$ftp_maxuoload_size = 1024*1024*100; //if $ftp_upload_limit = TRUE, this value means the max quota bytes.

$db->sql_query("USE ".$ftp_dbname.";");

$db->sql_query("INSERT INTO `wftp_mysqltable_user` VALUES ('".$ftp_domain_name."','".$data['username']."',1,1,'".md5($data['new_password'])."',63,0,NULL,0,0,0,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0,0,'0',NULL,0,0,0,".intval($ftp_upload_limit).",0,".$ftp_maxuoload_size.",0,0,0);");

$mkdir_result = @mkdir($ftp_dirpath);

if($mkdir_result == TRUE)

$db->sql_query("INSERT INTO `wftp_mysqltable_dir` VALUES ('".$ftp_domain_name."','".$data['username']."','".$ftp_dirpath."','/',1,1,1,1,1,1,1,1,1);");

$db->sql_query("USE ".$db->dbname.";");

//Wing FTP Server end


Thanks in advance
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Database integration with phpBB3

Post by FTP »

Did you see any record inserted into the database?
chaosnature
Posts: 16
Joined: Thu Sep 09, 2010 1:32 am

Re: Database integration with phpBB3

Post by chaosnature »

Many Thanks for your quick response,

no there was no records, however when i populate the wftp_database database i can see it apearing within the wftp database console,

prior to that to answer your quoestion , no it was blank..

i was expecting it would automatically replicate the user information from the phpbb3 into wftp_database,
but it is not the case..

any ideas?

i want users to be able to register on phpbb3 forums and use the same details to log on to wftp server...

thanks in advance
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Database integration with phpBB3

Post by FTP »

Sorry, its our fault, database schema has changed, but help manual doesn't update.

Please modify the sql query like this:

Code: Select all

$db->sql_query("INSERT INTO `wftp_mysqltable_user` VALUES ('".$ftp_domain_name."','".$data['username']."',1,1,'".md5($data['new_password'])."',63,0,NULL,0,0,0,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0,0,'0',NULL,0,0,0,".intval($ftp_upload_limit).",0,".$ftp_maxuoload_size.",0,0,0,'');");

if($mkdir_result == TRUE)
    $db->sql_query("INSERT INTO `wftp_mysqltable_dir` VALUES ('".$ftp_domain_name."','".$data['username']."','".$ftp_dirpath."','/',1,1,1,1,1,1,1,1,1,1,1,1);");
chaosnature
Posts: 16
Joined: Thu Sep 09, 2010 1:32 am

Re: Database integration with phpBB3

Post by chaosnature »

Many Thanks i will give this a try and give you feed back...

is this the only code i insert

$db->sql_query("INSERT INTO `wftp_mysqltable_user` VALUES ('".$ftp_domain_name."','".$data['username']."',1,1,'".md5($data['new_password'])."',63,0,NULL,0,0,0,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0,0,'0',NULL,0,0,0,".intval($ftp_upload_limit).",0,".$ftp_maxuoload_size.",0,0,0,'');");

if($mkdir_result == TRUE)
$db->sql_query("INSERT INTO `wftp_mysqltable_dir` VALUES ('".$ftp_domain_name."','".$data['username']."','".$ftp_dirpath."','/',1,1,1,1,1,1,1,1,1,1,1,1);");



i notice you left out :

//Wing FTP Server MOD start

$ftp_dbname = "wftp_database"; //Wing FTP Server's mysql database name, assume

in the same server.

$ftp_domain_name = "default"; //ftp's domain name.

$ftp_dirpath = "D:/ftp_data/".$data['username'];//user's directory path

$ftp_upload_limit = TRUE; //whether to limit the quota size

$ftp_maxuoload_size = 1024*1024*100; //if $ftp_upload_limit = TRUE, this value

means the max quota bytes.

$db->sql_query("USE ".$ftp_dbname.";");

also we i i dont see a difference after playing spot the difference on the code please confirm and varify the difference , Thanks
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Database integration with phpBB3

Post by FTP »

Yes, that's modified part.
chaosnature
Posts: 16
Joined: Thu Sep 09, 2010 1:32 am

Re: Database integration with phpBB3

Post by chaosnature »

Hi,

now i get error when i post this code
//Wing FTP Server MOD start

$ftp_dbname = "wftp_database"; //Wing FTP Server's mysql database name, assume

in the same server.

$ftp_domain_name = "default"; //ftp's domain name.

$ftp_dirpath = "D:/ftp_data/".$data['username'];//user's directory path

$ftp_upload_limit = TRUE; //whether to limit the quota size

$ftp_maxuoload_size = 1024*1024*100; //if $ftp_upload_limit = TRUE, this value

means the max quota bytes.

$db->sql_query("USE ".$ftp_dbname.";");

$db->sql_query("INSERT INTO `wftp_mysqltable_user` VALUES ('".$ftp_domain_name."','".$data['username']."',1,1,'".md5($data['new_password'])."',63,0,NULL,0,0,0,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0,0,'0',NULL,0,0,0,".intval($ftp_upload_limit).",0,".$ftp_maxuoload_size.",0,0,0,'');");

if($mkdir_result == TRUE)
$db->sql_query("INSERT INTO `wftp_mysqltable_dir` VALUES ('".$ftp_domain_name."','".$data['username']."','".$ftp_dirpath."','/',1,1,1,1,1,1,1,1,1,1,1,1);");

//Wing FTP Server end

what am i doing wrong, can you post the full cold as it should appear under
$user_id = user_add($user_row, $cp_data);
Thanks In Advance......
chaosnature
Posts: 16
Joined: Thu Sep 09, 2010 1:32 am

Re: Database integration with phpBB3

Post by chaosnature »

just to update you ,
i enter the below code , no errors, but i only have users created within the wing ftp server,
//Wing FTP Server MOD start

$ftp_dbname = "wftp_database"; //Wing FTP Server's mysql database name, assume in the same server.

$ftp_domain_name = "default"; //ftp's domain name.

$ftp_dirpath = "D:/ftp_data/".$data['username'];//user's directory path

$ftp_upload_limit = TRUE; //whether to limit the quota size

$ftp_maxuoload_size = 1024*1024*100; //if $ftp_upload_limit = TRUE, this value means the max quota bytes.

$db->sql_query("USE ".$ftp_dbname.";");
$db->sql_query("INSERT INTO `wftp_mysqltable_user` VALUES ('".$ftp_domain_name."','".$data['username']."',1,1,'".md5($data['new_password'])."',63,0,NULL,0,0,0,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,0,0,0,'0',NULL,0,0,0,".intval($ftp_upload_limit).",0,".$ftp_maxuoload_size.",0,0,0,'');");

if($mkdir_result == TRUE)
$db->sql_query("INSERT INTO `wftp_mysqltable_dir` VALUES ('".$ftp_domain_name."','".$data['username']."','".$ftp_dirpath."','/',1,1,1,1,1,1,1,1,1,1,1,1);");

//Wing FTP Server end
i thought it was surppose to populate the user panel with the phpBB3 data base
i have a succesful connection to the phpBB3 database from the ftp server...

regards
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Database integration with phpBB3

Post by FTP »

Thanks for your info! We will update the help manual in next version.
chaosnature
Posts: 16
Joined: Thu Sep 09, 2010 1:32 am

Re: Database integration with phpBB3

Post by chaosnature »

Thanks for your info! We will update the help manual in next version.
lol the issue is still not resolved, like i said in my last post, i am still not able to get the database to populate the ftp server from the phpBB3 yet with that code,

can you look into it for me please..

thanks in advance.....
Locked