Style fixes.
This commit is contained in:
parent
a7a59b690a
commit
be4950ff88
43 changed files with 187 additions and 149 deletions
|
|
@ -59,7 +59,7 @@ class ApiController extends ControllerBase
|
|||
*/
|
||||
public function activationLinkAction($id)
|
||||
{
|
||||
$link = UserActivation::findFirst(['activation_key = ?0', 'bind' => [ $id ]]);
|
||||
$link = UserActivation::findFirst(['activation_key = ?0', 'bind' => [$id]]);
|
||||
|
||||
if ($link) {
|
||||
if ($link->isValid()) {
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ class AuthController extends ControllerBase
|
|||
} else {
|
||||
$msg = '<ul>';
|
||||
|
||||
foreach($form->getMessages() as $message) {
|
||||
$msg .= '<li><strong>' . $message->getField() . '</strong> '. $message->getMessage() . '</li>';
|
||||
foreach ($form->getMessages() as $message) {
|
||||
$msg .= '<li><strong>' . $message->getField() . '</strong> ' . $message->getMessage() . '</li>';
|
||||
}
|
||||
|
||||
$msg .= '</ul>';
|
||||
|
|
@ -47,7 +47,7 @@ class AuthController extends ControllerBase
|
|||
|
||||
public function oauthAction($provider_name)
|
||||
{
|
||||
$client = $this->getDI()->get('oauth', [ $provider_name ]);
|
||||
$client = $this->getDI()->get('oauth', [$provider_name]);
|
||||
|
||||
$code = $this->request->get('code');
|
||||
$state = $this->request->get('state');
|
||||
|
|
@ -92,7 +92,7 @@ class AuthController extends ControllerBase
|
|||
// User is logged in.
|
||||
$this->response->redirect('/');
|
||||
}
|
||||
} catch(\Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
$this->flash->message('error', 'Failed to authenticate.');
|
||||
if ($this->auth->getUser()) {
|
||||
|
|
@ -118,8 +118,11 @@ class AuthController extends ControllerBase
|
|||
}
|
||||
|
||||
$user = new User();
|
||||
$user->assign($data->toArray(), null,
|
||||
[ 'email', 'username', 'firstname', 'lastname' ]);
|
||||
$user->assign(
|
||||
$data->toArray(),
|
||||
null,
|
||||
['email', 'username', 'firstname', 'lastname']
|
||||
);
|
||||
|
||||
$form = new RegistrationForm($user);
|
||||
|
||||
|
|
|
|||
|
|
@ -55,24 +55,23 @@ class CallbackController extends ControllerBase
|
|||
|
||||
return $this->response->redirect(array(
|
||||
'for' => 'cb-created',
|
||||
'id' => $callback->getPublicId()));
|
||||
'id' => $callback->getPublicId()
|
||||
));
|
||||
} else {
|
||||
foreach($callback->getMessages() as $msg) {
|
||||
foreach ($callback->getMessages() as $msg) {
|
||||
$this->flash->error($msg);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$msg = '<ul>';
|
||||
|
||||
foreach($form->getMessages() as $message) {
|
||||
$msg .= '<li><strong>' . $message->getField() . '</strong>: '. $message->getMessage() . '</li>';
|
||||
foreach ($form->getMessages() as $message) {
|
||||
$msg .= '<li><strong>' . $message->getField() . '</strong>: ' . $message->getMessage() . '</li>';
|
||||
}
|
||||
|
||||
$msg .= '</ul>';
|
||||
$this->flash->message('error', $msg);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$this->view->form = $form;
|
||||
|
|
@ -85,7 +84,6 @@ class CallbackController extends ControllerBase
|
|||
{
|
||||
$row = CallbackModel::get($id);
|
||||
if (!$row) {
|
||||
|
||||
}
|
||||
$this->view->id = $id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,4 +15,3 @@ class IndexController extends ControllerBase
|
|||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,8 +44,11 @@ class UserController extends ControllerBase
|
|||
]);
|
||||
|
||||
// Send the email.
|
||||
$this->di->getMail()->send('Httpcb password activation',
|
||||
$user->getEmail(), $content);
|
||||
$this->di->getMail()->send(
|
||||
'Httpcb password activation',
|
||||
$user->getEmail(),
|
||||
$content
|
||||
);
|
||||
|
||||
$msg = "For security reasons. Before a password can be created "
|
||||
. "a email has been sent to <strong>{$user->getEmail()}</strong> with "
|
||||
|
|
@ -137,7 +140,7 @@ class UserController extends ControllerBase
|
|||
|
||||
$msg = '<p>You are about to unlink the last OAuth provider.'
|
||||
. ' Your <strong>only</strong> login option will be <strong>password</strong> if you do this.</p>'
|
||||
. '<p>Are you sure? <a class="alert-link" href="' . $url .'">Yes</a></p>';
|
||||
. '<p>Are you sure? <a class="alert-link" href="' . $url . '">Yes</a></p>';
|
||||
|
||||
$this->flash->message('warning', $msg);
|
||||
$this->response->redirect('/settings');
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class UserController extends \Phalcon\Mvc\Controller
|
|||
*/
|
||||
public function indexAction($page = 1)
|
||||
{
|
||||
$paginator = User::getPaginationList($page,15);
|
||||
$paginator = User::getPaginationList($page, 15);
|
||||
|
||||
$this->view->pagination_url = '/admin/user/list/';
|
||||
$this->view->page = $paginator->paginate();
|
||||
|
|
|
|||
Reference in a new issue