aboutsummaryrefslogtreecommitdiff
path: root/cli/update-user.php
blob: 8067dadd3c12494f2f20206dc82c64db30f68c67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/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'],
	empty($options['api_password']) ? '' : $options['api_password'],
	$values);

if (!$ok) {
	fail('FreshRSS could not update user!');
}

invalidateHttpCache($username);

accessRights();

done($ok);