Code: Select all
//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,1,1,1);");
$db->sql_query("USE ".$db->dbname.";");
//Wing FTP Server end
I think the above code is OK, please make sure there exists database "wftp_database" in the same DB server. And the folder "D:/ftp_data/" already exists.