Can the Viewer be a User object?
Just trying to work out why the following doesn't seem to be saving the users password.
* Update ['pwd'] in Viewer object and save object
* @return object $this
protected function saveNewPassword()
$this->email = $this->Registry->Viewer['email'];
$this->username = $this->Registry->Viewer['username'];
$this->newPwd = $this->Request['pwd1'];
$this->Registry->Viewer['pwd'] = String::hashPassword($this->newPwd);
The Changepwd controller is extending the Resetpwd controller, and wondering why the Changepwd controller can't use the Resetpwd 'savePassword()' instead?
Forgive me if I'm way off base here, trying hard to get my head around it all.
Yes, Viewer is the User object.
We call it Viewer to indicate that it represents the User who is currently viewing the page. It can be logged in user or a non-logged in guest user.
The reason for calling the user "Viewer" is to differentiate it from just any registered user. For example when you viewing someone's profile or when you following/unfollowing another user we would refer to that other user as "User" but you are a "Viewer" which is also a user.
I did not invent this terminology. I first saw it on some Google's API and I liked the idea.
Anyway, a Viewer is a User and User extends MongoDoc.
If you need help in debugging something you can always add new logging line anywhere in the script.
d("new password is: ".$this->newPassword);
The d() function means debug-level logging. It will work only in debug mode and only when you configured the logging (path to log) in !config.ini properly.