-
-
Notifications
You must be signed in to change notification settings - Fork 776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow admin user to reset passwords #1765
Conversation
0f8f3fb
to
81df712
Compare
app/i18n/en/feedback.php
Outdated
@@ -101,6 +101,10 @@ | |||
'_' => 'User %s has been deleted', | |||
'error' => 'User %s cannot be deleted', | |||
), | |||
'updated' => array( | |||
'_' => 'The user %s has been updated', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with the other strings (see a couple of lines above) that should be "User %s…"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
81df712
to
1f1eb3f
Compare
app/views/user/manage.phtml
Outdated
<label class="group-name" for="current_user"><?php echo _t('admin.user.selected'); ?></label> | ||
<div class="group-controls"> | ||
<select id="current_user" class="select-change" name="username"> | ||
<option selected="selected"> </option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, and could you please do the same thing (i.e. empty first option) for the next list of users a bit further down?
Detail: I would prefer a simple space, or Unicode non-breaking space, as I am not so found of entities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No pbs for the space.
On the other hand, I've tried to replicate the same thing for the other list but there is JS involved in that one. It's not that easy and I didn't take the time to dig into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've found a way :)
At a first glance, it looks very good to me 👍 |
My initial idea was to split things between updating and deleting to avoid confusion. |
86d7c99
to
f3d3479
Compare
$username = Minz_Session::param('currentUser'); | ||
} | ||
$this->view->current_user = $username; | ||
$this->view->current_user = Minz_Request::param('u'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When simply browsing to ?c=user&a=manage
, $this->view->current_user
seems to be null, and I get the following error:
<br />
<b>Fatal error</b>: Uncaught Error: Call to a member function execute() on boolean in ./FreshRSS/app/Models/EntryDAO.php:879
Stack trace:
#0 ./FreshRSS/app/Controllers/userController.php(142): FreshRSS_EntryDAO->count()
#1 ./FreshRSS/lib/Minz/Dispatcher.php(118): FreshRSS_user_Controller->manageAction()
#2 ./FreshRSS/lib/Minz/Dispatcher.php(47): Minz_Dispatcher->launchAction('manageAction')
#3 ./FreshRSS/lib/Minz/FrontController.php(84): Minz_Dispatcher->run()
#4 ./FreshRSS/p/i/index.php(46): Minz_FrontController->run()
#5 {main}
thrown in <b>./FreshRSS/app/Models/EntryDAO.php</b> on line <b>879</b><br />
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things seem to work fine with the previous code, for this little section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Alkarex That's weird. I cannot reproduce.
My error_reporting is set to E_ALL. My user doesn't have authentication. I cannot think of something else that could break that.
Any ideas ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When landing on the page the first time, Minz_Request::param('u')
is not defined, is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not defined but set automatically to false
.
By the way, I am using mysql. Maybe you're using something different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with SQLite, not tested yet with MySQL - but it would be an error if it does not fail :-P
Anyway, $entryDAO->count()
(as well as $databaseDAO->size()
probably) should not be called with an undefined (or false) username.
So I suggest to either keep the previous code, which loaded the default user (seems like the easiest), or move the count elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Alkarex I've kept what I was doing previously but I've added a validation on the user. This way, we don't have an error.
I've tried on Sqlite but I couldn't make frss work :'(
f3d3479
to
718d0cc
Compare
Damn, a bit too fast:
|
Oups, should I make a new PR or update the previous one? |
New one please :-) |
👍 |
See #960
Comments are welcomed.