Page 1 of 3

Database integration with phpBB3

Posted: Thu Sep 09, 2010 1:37 am
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

Re: Database integration with phpBB3

Posted: Thu Sep 09, 2010 4:13 am
by FTP
Did you see any record inserted into the database?

Re: Database integration with phpBB3

Posted: Thu Sep 09, 2010 4:58 pm
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

Re: Database integration with phpBB3

Posted: Fri Sep 10, 2010 4:12 am
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);");

Re: Database integration with phpBB3

Posted: Fri Sep 10, 2010 5:37 pm
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

Re: Database integration with phpBB3

Posted: Fri Sep 10, 2010 6:19 pm
by FTP
Yes, that's modified part.

Re: Database integration with phpBB3

Posted: Sat Sep 11, 2010 12:17 pm
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......

Re: Database integration with phpBB3

Posted: Sat Sep 11, 2010 12:41 pm
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

Re: Database integration with phpBB3

Posted: Sat Sep 11, 2010 3:03 pm
by FTP
Thanks for your info! We will update the help manual in next version.

Re: Database integration with phpBB3

Posted: Sat Sep 11, 2010 11:54 pm
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.....