Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
Doc blocks and translation domain corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Krämer committed Feb 16, 2016
1 parent fab2998 commit 6f9a839
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
21 changes: 15 additions & 6 deletions src/Controller/Component/UserToolComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ public function mapAction() {
return $this->_mapAction($action);
}

/**
* @param string $action
* @return \Cake\Network\Response A response object containing the rendered view.
*/
protected function _directMapping($action) {
if (!method_exists($this, $action)) {
return false;
Expand All @@ -375,6 +379,12 @@ protected function _directMapping($action) {
return $this->_controller->render($action);
}

/**
* Maps an action of the controller to the component
*
* @param string $action
* @return bool|\Cake\Network\Response
*/
protected function _mapAction($action) {
$actionMap = $this->config('actionMap');
if (isset($actionMap[$action]) && method_exists($this, $actionMap[$action]['method'])) {
Expand Down Expand Up @@ -545,19 +555,18 @@ protected function _getUserEntity($userId) {
* Logout
*
* @param array $options Options array.
* @return void
* @return \Cake\Network\Response
*/
public function logout($options = []) {
$options = Hash::merge($this->config('logout'), $options);
$Auth = $this->_getAuthObject();
$user = $Auth->user();

if (empty($user)) {
$this->_controller->redirect($this->_controller->referer());
return;
return $this->_controller->redirect($this->_controller->referer());
}
$this->handleFlashAndRedirect('success', $options);
$this->_controller->redirect($Auth->logout());
return;

return $this->handleFlashAndRedirect('success', $options);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Behavior/UserBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ protected function validationOldPassword($validator) {
$validator->provider('userTable', $this->_table);
$validator->add('old_password', 'notBlank', [
'rule' => 'notBlank',
'message' => __d('userTools', 'Enter your old password.')
'message' => __d('user_tools', 'Enter your old password.')
]);
$validator->add('old_password', 'oldPassword', [
'rule' => ['validateOldPassword', 'password'],
Expand Down
12 changes: 6 additions & 6 deletions src/Template/UserTools/view.ctp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<h2><?= h($user->username) ?></h2>
<dl>
<dt><?= __('Username') ?></dt>
<dt><?= __d('user_tools', 'Username') ?></dt>
<dd><?= h($user->username) ?></dd>
<dt><?= __('Email') ?></dt>
<dt><?= __d('user_tools', 'Email') ?></dt>
<dd><?= h($user->email) ?></dd>
<dt><?= __('Active') ?></dt>
<dt><?= __d('user_tools', 'Active') ?></dt>
<dd><?= h($user->active) ?></dd>
<dt><?= __('Email Verified') ?></dt>
<dt><?= __d('user_tools', 'Email Verified') ?></dt>
<dd><?= h($user->email_verified) ?></dd>
<dt><?= __('Created') ?></dt>
<dt><?= __d('user_tools', 'Created') ?></dt>
<dd><?= h($user->created) ?></dd>
</dl>
</dl>

0 comments on commit 6f9a839

Please sign in to comment.