php change password "FileZilla Server.exe" /reload-config

Need help with FileZilla Server? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
User avatar
mario.q
500 Command not understood
Posts: 4
Joined: 2009-03-27 13:07
First name: Mario
Last name: Quagliana
Location: ITALIA

php change password "FileZilla Server.exe" /reload-config

#1 Post by mario.q » 2009-04-08 11:15

I created a php page through a form that updates the user's password.
The file "FileZilla server.xml " is written with the updated password, but the FileZilla server does not reload the new configuration

I searched in this forum a way to refresh the configuration file "FileZilla Server.xml"
http://forum.filezilla-project.org/sear ... mit=Search

from the prompt the command work
"FileZilla Server.exe" /reload-config

but through a php page the command not work.
passthru('"C:\Programmi\FileZilla server\FileZilla Server.exe" /reload-config');
system('"C:\Programmi\FileZilla server\FileZilla Server.exe" /reload-config');

someone has a solution??

I am sorry for my bad English.
but the code is international
below my code
note:
the web user and the computer user are not the same,
for update the "FileZilla Server.xml" the web user must have write permission on the xml file.

Code: Select all

<div name="" align="center">
<form name="form_FileZillaServer_change_user_pass" onload="clean_form()">
  <table border="0" width="300" cellpadding="5" cellspacing="5">
    <tr>
      <td width="100%" colspan="2" align="center">cambia la tua password</td>
    </tr>
    <tr>
      <td width="50%">nome utente</td>
      <td width="50%"><input type="text" name="username" size="20" value="" onfocus="form.username.value=''";></td>
    </tr>
    <tr>
      <td width="50%">password corrente</td>
      <td width="50%"><input type="password" name="password" size="20" value=""></td>
    </tr>
    <tr>
      <td width="50%">nuova password</td>
      <td width="50%"><input type="password" name="new_password" size="20" value=""></td>
    </tr>	
    <tr>
      <td width="50%">riscrivi la nuova password</td>
      <td width="50%"><input type="password" name="ceck_new_password" size="20" value=""></td>
    </tr>	
    <tr>
      <td width="100%" colspan="2" align="center">
	  <input type="button" value="Invia" name="" onclick="ceck_form();"> - <input type="button" value="Reimposta" name="" onclick="clean_form();"></td>
    </tr>
  </table>
</form>
<script>
form=document.form_FileZillaServer_change_user_pass;
function ceck_form(){

	if(form.username.value == '' ){
	alert('inserisci il nome utente');
	form.username.focus();
	return;
	}
	
	if(form.password.value == ''){
	alert('inserisci la tua password');
	form.password.focus();
	return;
	}
	
	if(form.new_password.value == '' ){
	alert('inserisci la nuova password');
	form.new_password.focus();
	return;
	}

	if(form.ceck_new_password.value == ''){
	alert('riscrivi la nuova password');
	form.ceck_new_password.focus();
	return;
	}
	
	if(form.ceck_new_password.value != form.new_password.value){
	alert('controllo della nuova password fallito\n\nreinserisci i valori');
	form.ceck_new_password.value = '';
	form.new_password.value = '';
	form.new_password.focus();
	return;
	}
	
	if(form.ceck_new_password.value == form.new_password.value && form.password.value == form.new_password.value){
	alert('la password che desideri modificare e\' uguale alla password da modificare\n\n controlla i valori');
	form.password.value = '';
	form.ceck_new_password.value = '';
	form.new_password.value = '';
	form.password.focus();
	return;
	}

send_form();
}

function clean_form(){
	form.username.value = '';
	form.password.value = '';
	form.new_password.value = '';
	form.ceck_new_password.value = '';
	form.method.value = '';
	form.action.value = '';
}

function send_form(){
	form.method='POST';
	form.action='<?php echo $_SERVER['PHP_SELF']; ?>';
	form.submit();
}

</script>
<?php

echo '<hr><hr>';
$xmlfile = 'C:\Programmi\FileZilla Server\FileZilla Server.xml';

if(isset($_POST['username']) &&
	isset($_POST['password']) &&
	isset($_POST['new_password']) &&
	isset($_POST['ceck_new_password']))
{
	$username = $_POST['username'];
	$password = $_POST['password'];
	$new_password = $_POST['new_password'];
	$ceck_new_password = $_POST['ceck_new_password'];
	echo 'user name'.$username.' - pass '.md5($password).' - new pass'.md5($new_password) ;
	ceck_user_pass($username,$password,$new_password,$xmlfile);
}elseif(isset($_GET['user']) && $_GET['user']=='0'){
    unset($username);unset($password);unset($new_password);unset($ceck_new_password);
    echo '<font color="red" size="+2">nome utente o password errati</font><br>inserisci nome e password corrente<br>ed i valori della nuova password';
}elseif(isset($_GET['user']) && $_GET['user']=='1'){
	echo '<font color="blue" size="+2">operazione riuscita<br>password aggiornata</font>';
}else{
	echo 'inserisci nome e password corrente<br>ed i valori della nuova password';
}

function ceck_user_pass($username,$password,$new_password,$xmlfile){
$url='http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
echo '<br>'.$username.' - '.$password;
$xml = simplexml_load_file($xmlfile);
$stored_user_pass = $xml->xpath('Users/User[@Name="'.$username.'"]/Option[@Name="Pass"]');
$stored_user_pass = $stored_user_pass[0];
	if ($stored_user_pass == true && md5($password)==$stored_user_pass){
		change_pass($username,$new_password,$xmlfile);
		//echo '<br>stored_user_pass->'.$stored_user_pass;
	}else{
		Header("Location:$url?user=0");
		//echo '<br>nome utente o password errati';
	}
}

function change_pass($username,$new_password,$xmlfile){
$doc = new DOMDocument;

$doc->Load($xmlfile);

$xpath = new DOMXPath($doc);

$query = '//Users/User[@Name="'.$username.'"]/Option[@Name="Pass"]';

$entries = $xpath->query($query);

	foreach ($entries as $entry) {
	   $entry->nodeValue=md5($new_password);
	}

$doc->save($xmlfile);

/*
this not work
the server does not reload the new configuration "FileZilla Server.xml"
*/
//passthru('"C:\Programmi\FileZilla server\FileZilla Server.exe" /reload-config');
//system('"C:\Programmi\FileZilla server\FileZilla Server.exe" /reload-config');
passthru('"C:\Programmi\FileZilla server\FileZilla Server.exe" -reload-config');

$url='http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
Header("Location:$url?user=1");
}
echo '<hr><hr>';
?>
</div end form>
if you want to use this code
update the value for $xmlfile="C:\..path...\FileZilla Server.xml"
and the path for passthru or system function.

ciao
Mario

jdratlif
226 Transfer OK
Posts: 392
Joined: 2008-12-30 10:30
First name: John
Last name: Ratliff
Location: In a small white padded room.
Contact:

Re: php change password "FileZilla Server.exe" /reload-config

#2 Post by jdratlif » 2009-04-09 06:31

Off the top of my head, you haven't double-escaped the back-slashes in your path. You need c:\\Program Files\\... etc.
http://jdrrant.blogspot.com/ - CODEpendent Blog

User avatar
mario.q
500 Command not understood
Posts: 4
Joined: 2009-03-27 13:07
First name: Mario
Last name: Quagliana
Location: ITALIA

Re: php change password "FileZilla Server.exe" /reload-config

#3 Post by mario.q » 2009-04-11 14:39

jdratlif wrote:Off the top of my head, you haven't double-escaped the back-slashes in your path. You need c:\\Program Files\\... etc.
not work.

my conclusion is that through a web interface is not possible interact with filezilla server

ciao
Mario

kontumenin
500 Syntax error
Posts: 16
Joined: 2009-04-15 21:32
First name: Juan Carlos
Last name: Monteagudo

Re: php change password "FileZilla Server.exe" /reload-config

#4 Post by kontumenin » 2009-04-15 21:44

Works perfect for me. Rename the .exe and check open_basedir and safe_mode_exec_dir

passthru("C:\\php\\exec\\intranet\\FileZillaserver.exe /reload-config",$retorno);

praetorian46
500 Command not understood
Posts: 1
Joined: 2011-05-17 05:10
First name: Cody
Last name: Hill

Re: php change password "FileZilla Server.exe" /reload-confi

#5 Post by praetorian46 » 2011-05-17 05:23

Translated to English(Google Translate FTW) and fixed FileZilla reload with spaces in DIR path.
Just Update:
$xmlfile
$Reload_CMD
to your own proper paths.

Code: Select all

<div name="" align="center">
<form name="form_FileZillaServer_change_user_pass" onload="clean_form()">
  <table border="0" width="300" cellpadding="5" cellspacing="5">
    <tr>
      <td width="100%" colspan="2" align="center">Change Password</td>
    </tr>
    <tr>
      <td width="50%">Username: </td>
      <td width="50%"><input type="text" name="username" size="20" value="" onfocus="form.username.value=''";></td>
    </tr>
    <tr>
      <td width="50%">Current Password: </td>
      <td width="50%"><input type="password" name="password" size="20" value=""></td>
    </tr>
    <tr>
      <td width="50%">New Password: </td>
      <td width="50%"><input type="password" name="new_password" size="20" value=""></td>
    </tr>   
    <tr>
      <td width="50%" nowrap>Retype New Password: </td>
      <td width="50%"><input type="password" name="ceck_new_password" size="20" value=""></td>
    </tr>   
    <tr>
      <td width="100%" colspan="2" align="center">
     <input type="button" value="Change Password" name="" onclick="ceck_form();"> - <input type="button" value="Clear" name="" onclick="clean_form();"></td>
    </tr>
  </table>
</form>
<script>
form=document.form_FileZillaServer_change_user_pass;
function ceck_form(){

   if(form.username.value == '' ){
   alert('"Username:  " is blank.');
   form.username.focus();
   return;
   }
   
   if(form.password.value == ''){
   alert('"Current Password:  " is blank.');
   form.password.focus();
   return;
   }
   
   if(form.new_password.value == '' ){
   alert('"New Password:  " is blank.');
   form.new_password.focus();
   return;
   }

   if(form.ceck_new_password.value == ''){
   alert('"Retpe New Password:  " is blank.');
   form.ceck_new_password.focus();
   return;
   }
   
   if(form.ceck_new_password.value != form.new_password.value){
   alert('The passwords you entered do not match.\n\Please retype the passwords.');
   form.ceck_new_password.value = '';
   form.new_password.value = '';
   form.new_password.focus();
   return;
   }
   
   if(form.ceck_new_password.value == form.new_password.value && form.password.value == form.new_password.value){
   alert('Your current password and new password are the same.\n\n Please retype the passwords.');
   form.password.value = '';
   form.ceck_new_password.value = '';
   form.new_password.value = '';
   form.password.focus();
   return;
   }

send_form();
}

function clean_form(){
   form.username.value = '';
   form.password.value = '';
   form.new_password.value = '';
   form.ceck_new_password.value = '';
   form.method.value = '';
   form.action.value = '';
}

function send_form(){
   form.method='POST';
   form.action='<?php echo $_SERVER['PHP_SELF']; ?>';
   form.submit();
}

</script>
<?php

echo '<hr><hr>';
$xmlfile = 'C:\Program Files (x86)\FileZilla Server\FileZilla Server.xml';
$Reload_CMD = "\"C:\\Program Files (x86)\\FileZilla Server\\FileZilla server.exe\" /reload-config";

if(isset($_POST['username']) &&
   isset($_POST['password']) &&
   isset($_POST['new_password']) &&
   isset($_POST['ceck_new_password']))
{
   $username = $_POST['username'];
   $password = $_POST['password'];
   $new_password = $_POST['new_password'];
   $ceck_new_password = $_POST['ceck_new_password'];
   echo 'user name'.$username.' - pass '.md5($password).' - new pass'.md5($new_password) ;
   ceck_user_pass($username,$password,$new_password,$xmlfile);
}elseif(isset($_GET['user']) && $_GET['user']=='0'){
    unset($username);unset($password);unset($new_password);unset($ceck_new_password);
    echo '<font color="red" size="+2">Bad username or password!</font><br>Enter the username and current password. <br>Then enter your new password.';
}elseif(isset($_GET['user']) && $_GET['user']=='1'){
   echo '<font color="blue" size="+2">Password update was successful!</font>';
}else{
   echo 'Enter the username and current password. <br>Then enter your new password.';
}

function ceck_user_pass($username,$password,$new_password,$xmlfile){
$url='http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
echo '<br>'.$username.' - '.$password;
$xml = simplexml_load_file($xmlfile);
$stored_user_pass = $xml->xpath('Users/User[@Name="'.$username.'"]/Option[@Name="Pass"]');
$stored_user_pass = $stored_user_pass[0];
   if ($stored_user_pass == true && md5($password)==$stored_user_pass){
      change_pass($username,$new_password,$xmlfile);
   }else{
      Header("Location:$url?user=0");
   }
}

function change_pass($username,$new_password,$xmlfile){
$doc = new DOMDocument;

$doc->Load($xmlfile);

$xpath = new DOMXPath($doc);

$query = '//Users/User[@Name="'.$username.'"]/Option[@Name="Pass"]';

$entries = $xpath->query($query);

   foreach ($entries as $entry) {
      $entry->nodeValue=md5($new_password);
   }

$doc->save($xmlfile);

exec($Reload_CMD);

$url='http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
Header("Location:$url?user=1");
}
echo '<hr><hr>';
?>
</div end form>

davidsarver
500 Command not understood
Posts: 1
Joined: 2011-08-08 16:46
First name: David
Last name: Sarver

Re: php change password "FileZilla Server.exe" /reload-confi

#6 Post by davidsarver » 2011-08-08 16:54

Hey, great code!
Just adding a couple of fixes from praetorian's revision
The header function was being called after the page was being sent
There was also a problem with the $Reload_CMD variable scope

Code: Select all

<?php

output('<hr><hr>');
$xmlfile = 'C:\Program Files\FileZilla Server\FileZilla Server.xml';
$Reload_CMD = "\"C:\\Program Files\\FileZilla Server\\FileZilla server.exe\" /reload-config";

if(isset($_POST['username']) &&
   isset($_POST['password']) &&
   isset($_POST['new_password']) &&
   isset($_POST['ceck_new_password']))
{
   $username = $_POST['username'];
   $password = $_POST['password'];
   $new_password = $_POST['new_password'];
   $ceck_new_password = $_POST['ceck_new_password'];
   output ( 'user name'.$username.' - pass '.md5($password).' - new pass'.md5($new_password) );
   ceck_user_pass($username,$password,$new_password,$xmlfile);
}elseif(isset($_GET['user']) && $_GET['user']=='0'){
    unset($username);unset($password);unset($new_password);unset($ceck_new_password);
    output( '<font color="red" size="+2">Bad username or password!</font><br>Enter the username and current password. <br>Then enter your new password.');
}elseif(isset($_GET['user']) && $_GET['user']=='1'){
   output( '<font color="blue" size="+2">Password update was successful!</font>');
}else{
   output( 'Enter the username and current password. <br>Then enter your new password.');
}

function output($text) {
global $output;
	if (isset($output)) {
		$output = $output . $text;
	}
	else {
		$output = $text;
	}
}

function ceck_user_pass($username,$password,$new_password,$xmlfile){
$url='http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
//echo '<br>'.$username.' - '.$password;
$xml = simplexml_load_file($xmlfile);
$stored_user_pass = $xml->xpath('Users/User[@Name="'.$username.'"]/Option[@Name="Pass"]');
$stored_user_pass = $stored_user_pass[0];
   if ($stored_user_pass == true && md5($password)==$stored_user_pass){
      change_pass($username,$new_password,$xmlfile);
   }else{
      Header("Location:$url?user=0");
   }
}

function change_pass($username,$new_password,$xmlfile){
global $Reload_CMD;
$doc = new DOMDocument;

$doc->Load($xmlfile);

$xpath = new DOMXPath($doc);

$query = '//Users/User[@Name="'.$username.'"]/Option[@Name="Pass"]';

$entries = $xpath->query($query);

   foreach ($entries as $entry) {
      $entry->nodeValue=md5($new_password);
   }

$doc->save($xmlfile);

exec($Reload_CMD);

$url='http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
Header("Location:$url?user=1");
}
output('<hr><hr>');

?>
<div name="" align="center">
<form name="form_FileZillaServer_change_user_pass" onload="clean_form()">
  <table border="0" width="300" cellpadding="5" cellspacing="5">
    <tr>
      <td width="100%" colspan="2" align="center">Change Password</td>
    </tr>
    <tr>
      <td width="50%">Username: </td>
      <td width="50%"><input type="text" name="username" size="20" value="" onfocus="form.username.value=''";></td>
    </tr>
    <tr>
      <td width="50%">Current Password: </td>
      <td width="50%"><input type="password" name="password" size="20" value=""></td>
    </tr>
    <tr>
      <td width="50%">New Password: </td>
      <td width="50%"><input type="password" name="new_password" size="20" value=""></td>
    </tr>   
    <tr>
      <td width="50%" nowrap>Retype New Password: </td>
      <td width="50%"><input type="password" name="ceck_new_password" size="20" value=""></td>
    </tr>   
    <tr>
      <td width="100%" colspan="2" align="center">
     <input type="button" value="Change Password" name="" onclick="ceck_form();"> - <input type="button" value="Clear" name="" onclick="clean_form();"></td>
    </tr>
  </table>
</form>
<script>
form=document.form_FileZillaServer_change_user_pass;
function ceck_form(){

   if(form.username.value == '' ){
   alert('"Username:  " is blank.');
   form.username.focus();
   return;
   }
   
   if(form.password.value == ''){
   alert('"Current Password:  " is blank.');
   form.password.focus();
   return;
   }
   
   if(form.new_password.value == '' ){
   alert('"New Password:  " is blank.');
   form.new_password.focus();
   return;
   }

   if(form.ceck_new_password.value == ''){
   alert('"Retpe New Password:  " is blank.');
   form.ceck_new_password.focus();
   return;
   }
   
   if(form.ceck_new_password.value != form.new_password.value){
   alert('The passwords you entered do not match.\n\Please retype the passwords.');
   form.ceck_new_password.value = '';
   form.new_password.value = '';
   form.new_password.focus();
   return;
   }
   
   if(form.ceck_new_password.value == form.new_password.value && form.password.value == form.new_password.value){
   alert('Your current password and new password are the same.\n\n Please retype the passwords.');
   form.password.value = '';
   form.ceck_new_password.value = '';
   form.new_password.value = '';
   form.password.focus();
   return;
   }

send_form();
}

function clean_form(){
   form.username.value = '';
   form.password.value = '';
   form.new_password.value = '';
   form.ceck_new_password.value = '';
   form.method.value = '';
   form.action.value = '';
}

function send_form(){
   form.method='POST';
   form.action='<?php echo $_SERVER['PHP_SELF']; ?>';
   form.submit();
}

</script>
<?php
echo $output;
?>
</div end form>

mtzero
500 Command not understood
Posts: 1
Joined: 2011-12-09 03:15
First name: mark
Last name: Taylor

Re: php change password "FileZilla Server.exe" /reload-confi

#7 Post by mtzero » 2011-12-09 03:28

Just thought I'd post the code I made for adding another FTP User...just to save someone else having to do it as I couldn't find much out there on the net about it.

You might note that I use a batch file to reload the config...you can quite easily use exec method as above just as effectively.

Code: Select all

function CreateDOM_FTPUSER($ftpdir,$ftpuser,$ftpuserpswd){
    /*
     * - <Users>
- <User Name="a_user">
  <Option Name="Pass">henckfgkkgiwo949567</Option> 
  <Option Name="Group" /> 
  <Option Name="Bypass server userlimit">1</Option> 
  <Option Name="User Limit">100</Option> 
  <Option Name="IP Limit">0</Option> 
  <Option Name="Enabled">1</Option> 
  <Option Name="Comments" /> 
  <Option Name="ForceSsl">0</Option> 
- <IpFilter>
  <Disallowed /> 
  <Allowed /> 
  </IpFilter>
- <Permissions>
- <Permission Dir="M:\web_hosting">
  <Option Name="FileRead">1</Option> 
  <Option Name="FileWrite">1</Option> 
  <Option Name="FileDelete">1</Option> 
  <Option Name="FileAppend">1</Option> 
  <Option Name="DirCreate">1</Option> 
  <Option Name="DirDelete">1</Option> 
  <Option Name="DirList">1</Option> 
  <Option Name="DirSubdirs">1</Option> 
  <Option Name="IsHome">1</Option> 
  <Option Name="AutoCreate">0</Option> 
  </Permission>
  </Permissions>
- <SpeedLimits DlType="1" DlLimit="10" ServerDlLimitBypass="1" UlType="1" UlLimit="10" ServerUlLimitBypass="1">
  <Download /> 
  <Upload /> 
  </SpeedLimits>
  </User>

     */

    $ftpuserpswd=md5($ftpuserpswd);
    $dom=new DOMDocument();
    $dom->formatOutput = true;
    $dom->preserveWhiteSpace = false;
    $dom->load("C:\\Program Files\\FileZilla Server\\FileZilla Server.xml");


 $user = $dom->createElement('User');
 $user -> setAttribute('Name',$ftpuser);
 
 $option = $dom-> createElement('Option',$ftpuserpswd); 
 $option -> setAttribute('Name',"Pass");
 $user->appendChild($option); 
 
$option = $dom-> createElement('Option'); 
$option -> setAttribute('Name',"Group");
$user->appendChild($option); 

$option = $dom-> createElement('Option',0); 
$option -> setAttribute('Name',"Bypass server userlimit");
$user->appendChild($option); 

$option = $dom-> createElement('Option',0); 
$option -> setAttribute('Name',"User Limit");
$user->appendChild($option);

$option = $dom-> createElement('Option',0); 
$option -> setAttribute('Name',"IP Limit");
$user->appendChild($option); 
 
$option = $dom-> createElement('Option',1); 
$option -> setAttribute('Name',"Enabled");
 $user->appendChild($option); 
  
 $option = $dom-> createElement('Option'); 
 $option -> setAttribute('Name',"Comments");
 $user->appendChild($option);
 
 $option = $dom-> createElement('Option',0); 
 $option -> setAttribute('Name',"ForceSsl");
 $user->appendChild($option); 
  
 $ipfilter=$dom->createElement('IpFilter');
 $disallowed=$dom->createElement('Disallowed');
 $ipfilter->appendChild($disallowed);
 $disallowed=$dom->createElement('Allowed');
 $ipfilter->appendChild($disallowed);
  
 $user->appendChild($ipfilter); 
 $permissions=$dom->createElement('Permissions');
 $perm=$dom->createElement('Permission');
 $perm->setAttribute('Dir', $ftpdir);
 $option = $dom-> createElement('Option',1); 
 $option -> setAttribute('Name',"FileRead");
 $perm->appendChild($option); 
 $option = $dom-> createElement('Option',1); 
 $option -> setAttribute('Name',"FileWrite");
 $perm->appendChild($option);
 $option = $dom-> createElement('Option',1); 
 $option -> setAttribute('Name',"FileDelete");
 $perm->appendChild($option);
 $option = $dom-> createElement('Option',1); 
 $option -> setAttribute('Name',"FileAppend");
 $perm->appendChild($option);
 $option = $dom-> createElement('Option',1); 
 $option -> setAttribute('Name',"DirCreate");
 $perm->appendChild($option);
 $option = $dom-> createElement('Option',1); 
 $option -> setAttribute('Name',"DirDelete");
 $perm->appendChild($option);
 $option = $dom-> createElement('Option',1); 
 $option -> setAttribute('Name',"DirList");
 $perm->appendChild($option);
 $option = $dom-> createElement('Option',1); 
 $option -> setAttribute('Name',"DirSubdirs");
 $perm->appendChild($option);
 $option = $dom-> createElement('Option',1); 
 $option -> setAttribute('Name',"IsHome");
 $perm->appendChild($option);
 $option = $dom-> createElement('Option',0); 
 $option -> setAttribute('Name',"AutoCreate");
 $perm->appendChild($option);
 $permissions->appendChild($perm);
 $user->appendChild($permissions);
  
 $speedlimits=$dom->createElement('SpeedLimits');
 $speedlimits->setAttribute('DIType', 1);
 $speedlimits->setAttribute('DlLimit', 10);
 $speedlimits->setAttribute('ServerDlLimitBypass', 1);
 $speedlimits->setAttribute('UlType', 1);
 $speedlimits->setAttribute('UlLimit', 10);
 $speedlimits->setAttribute('ServerUlLimitBypass', 1);
 $option = $dom-> createElement('Download'); 
 $speedlimits->appendChild($option);
 $option = $dom-> createElement('Upload'); 
 $speedlimits->appendChild($option);
 
 $user->appendChild($speedlimits);
  

 $dom->getElementsByTagName('Users')->item(0)->appendChild($user);

 
 $dom->save('C:\\Program Files\\FileZilla Server\\FileZilla Server.xml');

 system("\"c:\\WINDOWS\\system32\\cmd.exe\" /c C:\\scripts\\filezillareload.bat");

}
The contents of filezillareload.bat is:

Code: Select all

pushd %~dp0
"C:\Program Files\FileZilla Server\FileZilla server.exe" -reload-config
popd
exit
May the filezilla force be with you.

Post Reply