update-user.php 567 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/php
  2. <?php
  3. $isUpdate = true;
  4. require(__DIR__ . '/_update-or-create-user.php');
  5. $username = cliInitUser($options['user']);
  6. echo 'FreshRSS updating user “', $username, "”…\n";
  7. $ok = FreshRSS_user_Controller::updateUser(
  8. $username,
  9. empty($options['mail_login']) ? null : $options['mail_login'],
  10. empty($options['password']) ? '' : $options['password'],
  11. empty($options['api_password']) ? '' : $options['api_password'],
  12. $values);
  13. if (!$ok) {
  14. fail('FreshRSS could not update user!');
  15. }
  16. invalidateHttpCache($username);
  17. accessRights();
  18. done($ok);