I don't know if there is an interface between Serv-U ftp. This type of information, because I don't know how the Serv-U is encrypted, there is no way to use the encrypted password, if someone knows the algorithm, please tell me a $ filepath is serv- U The installation address, $ ftppath is the main mode you want to open FTP's folder address to read the servudaemon.ini file as an array, then operate an array element to the purpose of modifying the configuration file. Beginning PHP, not writing Class, prawn A lot of points
php ///// Copyright (c) 2003 drunken rainwate all rights reserved. //// Powered by drunken rainwate //// http://btyz.51web.cn/ //// Winterfire @ 163 .com ////// Function add_ftp_user ($ user, $ pws) // Add users to the user list of Serv-U {Global $ FilePath, $ ftppath; @copy ($ FilePath, $ FilePath. ". Bak "); // Backup file $ servu_config = file ($ filepath."); for ($ I = 0; $ 10; $ I ) {IF (Substr ($ servu_config) I], 0, 4) == "User") {$ user_num [0] = SUBSTR ($ servu_config [$ I], 4, 1) 1; // Judgment How many users do now $ user_num [1] = $ i 1; // Judgment the position added by the new user}} for ($ I = count ($ servu_config); $ I -) {$ servu_config [$ I] = $ servu_config [$ I-1]; // Put the new user later} $ servu_config [$ user_num [1]] = "USER". $ user_num [0]. "= $ user | 1 | 0"; / / Add new users to the list Del_nl ($ servu_config); // Delete blank line $ INIFILE = FOPEN ($ FilePath, "W"); FPUTS ($ INIFILE, IMPLODE ("/ N", $ servu_config); // The configuration file is written to Servudaemon.inifclose ($ INIFILE);
// User detailed configuration $ config = "/ n [user = $ user | 1] password = $ pwshomedir = g: / my documents / http / Webspace //" = 1diskquota = 1 | 10240000 | 0MAXUSERSERSLOGINPERIP = 1SpeedLimitUp = 51200SpeedLimitDown = 51200TimeOut = 60SessionTimeOut = 600MaxNrUsers = 1Access1 = G: / My Documents / http / webspace //".$ user "| RWAMLCDP"; $ inifile = fopen ($ filepath, "a"); // open. New file pointer FPUTS ($ INIFILE, $ config) OR DIE ("Unwind file"); // Add new user profile Fclose ($ inIfile); // Close the file pointer MKDIR ($ ftppath. "// ". $ user); // Establish FTP folder} Function Change_PWS ($ USER, $ PWS) // Change Password {Global $ FilePath; $ servu_config = file ($ filepath); DEL_NL ($ servu_config); // Remove Dark line for ($ I = 0; $ I