mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-23 08:14:56 +00:00
Correct CLI password clearing
This commit is contained in:
parent
54be5997d1
commit
9c61f967e3
3 changed files with 12 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Version 0.8.0 (2019-??-??)
|
||||||
|
==========================
|
||||||
|
|
||||||
|
New features:
|
||||||
|
- Support for the Fever protocol (see README.md for details)
|
||||||
|
- Command line functionality for clearing a password, disabling the account
|
||||||
|
- Command line options for dealing with Fever passwords
|
||||||
|
|
||||||
Version 0.7.1 (2019-03-25)
|
Version 0.7.1 (2019-03-25)
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ USAGE_TEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function userManage($args): int {
|
protected function userManage($args): int {
|
||||||
switch ($this->command(["add", "remove", "set-pass", "list", "auth"], $args)) {
|
switch ($this->command(["add", "remove", "set-pass", "unset-pass", "list", "auth"], $args)) {
|
||||||
case "add":
|
case "add":
|
||||||
return $this->userAddOrSetPassword("add", $args["<username>"], $args["<password>"]);
|
return $this->userAddOrSetPassword("add", $args["<username>"], $args["<password>"]);
|
||||||
case "set-pass":
|
case "set-pass":
|
||||||
|
@ -130,7 +130,7 @@ USAGE_TEXT;
|
||||||
}
|
}
|
||||||
case "unset-pass":
|
case "unset-pass":
|
||||||
if ($args['--fever']) {
|
if ($args['--fever']) {
|
||||||
$this->getFever()->unegister($args["<username>"]);
|
$this->getFever()->unregister($args["<username>"]);
|
||||||
} else {
|
} else {
|
||||||
Arsse::$user->passwordUnset($args["<username>"], $args["--oldpass"]);
|
Arsse::$user->passwordUnset($args["<username>"], $args["--oldpass"]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,9 +261,9 @@ class TestCLI extends \JKingWeb\Arsse\Test\AbstractTest {
|
||||||
};
|
};
|
||||||
// FIXME: Phake is somehow unable to mock the User class correctly, so we use PHPUnit's mocks instead
|
// FIXME: Phake is somehow unable to mock the User class correctly, so we use PHPUnit's mocks instead
|
||||||
Arsse::$user = $this->createMock(User::class);
|
Arsse::$user = $this->createMock(User::class);
|
||||||
Arsse::$user->method("passwordUnet")->will($this->returnCallback($passwordChange));
|
Arsse::$user->method("passwordUnset")->will($this->returnCallback($passwordClear));
|
||||||
$fever = \Phake::mock(FeverUser::class);
|
$fever = \Phake::mock(FeverUser::class);
|
||||||
\Phake::when($fever)->unregister->thenReturnCallback($passwordChange);
|
\Phake::when($fever)->unregister->thenReturnCallback($passwordClear);
|
||||||
\Phake::when($this->cli)->getFever->thenReturn($fever);
|
\Phake::when($this->cli)->getFever->thenReturn($fever);
|
||||||
$this->assertConsole($this->cli, $cmd, $exitStatus, $output);
|
$this->assertConsole($this->cli, $cmd, $exitStatus, $output);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue