update-user.php 659 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env 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. $values);
  12. if (!$ok) {
  13. fail('FreshRSS could not update user!');
  14. }
  15. if (!empty($options['api_password'])) {
  16. $error = FreshRSS_api_Controller::updatePassword($options['api_password']);
  17. if ($error) {
  18. fail($error);
  19. }
  20. }
  21. invalidateHttpCache($username);
  22. accessRights();
  23. done($ok);