sites_ftp_user_update.php 915 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. error_reporting(0);
  3. require('soap_config.php');
  4. $client = new SoapClient(null, array('location' => $soap_location,
  5. 'uri' => $soap_uri,
  6. 'trace' => 1,
  7. 'exceptions' => 1));
  8. $session_id = $client->login($username,$password);
  9. $client_id = 0;
  10. chdir('ftp_users');
  11. $username = $_GET['username'];
  12. $ftp_user_id = file_get_contents($username);
  13. //* Get the ftp user record
  14. $ftp_user_record = $client->sites_ftp_user_get($session_id, $ftp_user_id);
  15. if(isset($_GET['type']) AND $_GET['type'] == "password")
  16. {
  17. $ftp_user_record['password'] = $_GET['password'];
  18. }
  19. else
  20. {
  21. $settings = explode("\n",$_GET['password']);
  22. foreach($settings as $setting)
  23. {
  24. list($key,$value) = explode("\t",$setting);
  25. $ftp_user_record[$key] = $value;
  26. }
  27. }
  28. $client->sites_ftp_user_update($session_id, $client_id, $ftp_user_id, $ftp_user_record);
  29. $client->logout($session_id);
  30. ?>