mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-01-09 22:07:48 -05:00
* Fix CLI api_password #fix https://github.com/FreshRSS/FreshRSS/issues/3177 Fix regression from https://github.com/FreshRSS/FreshRSS/pull/2675 * Update cli/_update-or-create-user.php Co-authored-by: oupala <oupala@users.noreply.github.com> Co-authored-by: oupala <oupala@users.noreply.github.com>
32 lines
659 B
PHP
Executable File
32 lines
659 B
PHP
Executable File
#!/usr/bin/env php
|
|
<?php
|
|
$isUpdate = true;
|
|
require(__DIR__ . '/_update-or-create-user.php');
|
|
|
|
$username = cliInitUser($options['user']);
|
|
|
|
echo 'FreshRSS updating user “', $username, "”…\n";
|
|
|
|
$ok = FreshRSS_user_Controller::updateUser(
|
|
$username,
|
|
empty($options['mail_login']) ? null : $options['mail_login'],
|
|
empty($options['password']) ? '' : $options['password'],
|
|
$values);
|
|
|
|
if (!$ok) {
|
|
fail('FreshRSS could not update user!');
|
|
}
|
|
|
|
if (!empty($options['api_password'])) {
|
|
$error = FreshRSS_api_Controller::updatePassword($options['api_password']);
|
|
if ($error) {
|
|
fail($error);
|
|
}
|
|
}
|
|
|
|
invalidateHttpCache($username);
|
|
|
|
accessRights();
|
|
|
|
done($ok);
|