summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/App.php2
-rw-r--r--app/Controller/Auth.php6
-rw-r--r--app/Controller/Base.php85
-rw-r--r--app/Controller/Board.php4
-rw-r--r--app/Controller/Budget.php4
-rw-r--r--app/Controller/Column.php8
-rw-r--r--app/Controller/Currency.php4
-rw-r--r--app/Controller/File.php10
-rw-r--r--app/Controller/Hourlyrate.php4
-rw-r--r--app/Controller/Link.php6
-rw-r--r--app/Controller/Subtask.php8
-rw-r--r--app/Controller/Task.php4
-rw-r--r--app/Controller/Tasklink.php8
-rw-r--r--app/Controller/Timetableday.php4
-rw-r--r--app/Controller/Timetableoff.php4
-rw-r--r--app/Controller/Timetableweek.php4
-rw-r--r--app/Controller/Twofactor.php10
-rw-r--r--app/Controller/User.php2
-rw-r--r--app/Controller/Webhook.php2
19 files changed, 50 insertions, 129 deletions
diff --git a/app/Controller/App.php b/app/Controller/App.php
index e4a97f8e..8a97e8c7 100644
--- a/app/Controller/App.php
+++ b/app/Controller/App.php
@@ -90,7 +90,7 @@ class App extends Base
$this->response->html('<p>'.t('Nothing to preview...').'</p>');
}
- $this->response->html($this->template->markdown($payload['text']));
+ $this->response->html($this->helper->text->markdown($payload['text']));
}
/**
diff --git a/app/Controller/Auth.php b/app/Controller/Auth.php
index c1859304..24e6e242 100644
--- a/app/Controller/Auth.php
+++ b/app/Controller/Auth.php
@@ -18,7 +18,7 @@ class Auth extends Base
public function login(array $values = array(), array $errors = array())
{
if ($this->userSession->isLogged()) {
- $this->response->redirect($this->helper->url('app', 'index'));
+ $this->response->redirect($this->helper->url->to('app', 'index'));
}
$this->response->html($this->template->layout('auth/index', array(
@@ -47,7 +47,7 @@ class Auth extends Base
$this->response->redirect('?'.urldecode($redirect_query));
}
- $this->response->redirect($this->helper->url('app', 'index'));
+ $this->response->redirect($this->helper->url->to('app', 'index'));
}
$this->login($values, $errors);
@@ -62,6 +62,6 @@ class Auth extends Base
{
$this->authentication->backend('rememberMe')->destroy($this->userSession->getId());
$this->session->close();
- $this->response->redirect($this->helper->url('auth', 'login'));
+ $this->response->redirect($this->helper->url->to('auth', 'login'));
}
}
diff --git a/app/Controller/Base.php b/app/Controller/Base.php
index 30d0b4e4..19de6a93 100644
--- a/app/Controller/Base.php
+++ b/app/Controller/Base.php
@@ -16,67 +16,8 @@ use Symfony\Component\EventDispatcher\Event;
*
* @package controller
* @author Frederic Guillot
- *
- * @property \Core\Helper $helper
- * @property \Core\Session $session
- * @property \Core\Template $template
- * @property \Core\Paginator $paginator
- * @property \Integration\GithubWebhook $githubWebhook
- * @property \Integration\GitlabWebhook $gitlabWebhook
- * @property \Integration\BitbucketWebhook $bitbucketWebhook
- * @property \Integration\PostmarkWebhook $postmarkWebhook
- * @property \Integration\SendgridWebhook $sendgridWebhook
- * @property \Integration\MailgunWebhook $mailgunWebhook
- * @property \Model\Acl $acl
- * @property \Model\Authentication $authentication
- * @property \Model\Action $action
- * @property \Model\Board $board
- * @property \Model\Category $category
- * @property \Model\Color $color
- * @property \Model\Comment $comment
- * @property \Model\Config $config
- * @property \Model\DateParser $dateParser
- * @property \Model\File $file
- * @property \Model\HourlyRate $hourlyRate
- * @property \Model\LastLogin $lastLogin
- * @property \Model\Notification $notification
- * @property \Model\Project $project
- * @property \Model\ProjectPermission $projectPermission
- * @property \Model\ProjectDuplication $projectDuplication
- * @property \Model\ProjectAnalytic $projectAnalytic
- * @property \Model\ProjectActivity $projectActivity
- * @property \Model\ProjectDailySummary $projectDailySummary
- * @property \Model\ProjectIntegration $projectIntegration
- * @property \Model\Subtask $subtask
- * @property \Model\SubtaskForecast $subtaskForecast
- * @property \Model\Swimlane $swimlane
- * @property \Model\Task $task
- * @property \Model\Link $link
- * @property \Model\TaskCreation $taskCreation
- * @property \Model\TaskModification $taskModification
- * @property \Model\TaskDuplication $taskDuplication
- * @property \Model\TaskHistory $taskHistory
- * @property \Model\TaskExport $taskExport
- * @property \Model\TaskFinder $taskFinder
- * @property \Model\TaskFilter $taskFilter
- * @property \Model\TaskPosition $taskPosition
- * @property \Model\TaskPermission $taskPermission
- * @property \Model\TaskStatus $taskStatus
- * @property \Model\Timetable $timetable
- * @property \Model\TimetableDay $timetableDay
- * @property \Model\TimetableWeek $timetableWeek
- * @property \Model\TimetableExtra $timetableExtra
- * @property \Model\TimetableOff $timetableOff
- * @property \Model\TaskValidator $taskValidator
- * @property \Model\TaskLink $taskLink
- * @property \Model\CommentHistory $commentHistory
- * @property \Model\SubtaskHistory $subtaskHistory
- * @property \Model\SubtaskTimeTracking $subtaskTimeTracking
- * @property \Model\User $user
- * @property \Model\UserSession $userSession
- * @property \Model\Webhook $webhook
*/
-abstract class Base
+abstract class Base extends \Core\Base
{
/**
* Request instance
@@ -95,14 +36,6 @@ abstract class Base
protected $response;
/**
- * Container instance
- *
- * @access private
- * @var \Pimple\Container
- */
- private $container;
-
- /**
* Constructor
*
* @access public
@@ -134,18 +67,6 @@ abstract class Base
}
/**
- * Load automatically models
- *
- * @access public
- * @param string $name Model name
- * @return mixed
- */
- public function __get($name)
- {
- return $this->container[$name];
- }
-
- /**
* Send HTTP headers
*
* @access private
@@ -201,7 +122,7 @@ abstract class Base
$this->response->text('Not Authorized', 401);
}
- $this->response->redirect($this->helper->url('auth', 'login', array('redirect_query' => urlencode($this->request->getQueryString()))));
+ $this->response->redirect($this->helper->url->to('auth', 'login', array('redirect_query' => urlencode($this->request->getQueryString()))));
}
}
@@ -220,7 +141,7 @@ abstract class Base
$this->response->text('Not Authorized', 401);
}
- $this->response->redirect($this->helper->url('twofactor', 'code'));
+ $this->response->redirect($this->helper->url->to('twofactor', 'code'));
}
}
diff --git a/app/Controller/Board.php b/app/Controller/Board.php
index 07c99a96..2b633d82 100644
--- a/app/Controller/Board.php
+++ b/app/Controller/Board.php
@@ -295,7 +295,7 @@ class Board extends Base
$this->session->flashError(t('Unable to update your task.'));
}
- $this->response->redirect($this->helper->url('board', 'show', array('project_id' => $values['project_id'])));
+ $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $values['project_id'])));
}
/**
@@ -333,7 +333,7 @@ class Board extends Base
$this->session->flashError(t('Unable to update your task.'));
}
- $this->response->redirect($this->helper->url('board', 'show', array('project_id' => $values['project_id'])));
+ $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $values['project_id'])));
}
/**
diff --git a/app/Controller/Budget.php b/app/Controller/Budget.php
index 2c56c79d..45dad7fb 100644
--- a/app/Controller/Budget.php
+++ b/app/Controller/Budget.php
@@ -88,7 +88,7 @@ class Budget extends Base
if ($this->budget->create($values['project_id'], $values['amount'], $values['comment'], $values['date'])) {
$this->session->flash(t('The budget line have been created successfully.'));
- $this->response->redirect($this->helper->url('budget', 'create', array('project_id' => $project['id'])));
+ $this->response->redirect($this->helper->url->to('budget', 'create', array('project_id' => $project['id'])));
}
else {
$this->session->flashError(t('Unable to create the budget line.'));
@@ -130,6 +130,6 @@ class Budget extends Base
$this->session->flashError(t('Unable to remove this budget line.'));
}
- $this->response->redirect($this->helper->url('budget', 'create', array('project_id' => $project['id'])));
+ $this->response->redirect($this->helper->url->to('budget', 'create', array('project_id' => $project['id'])));
}
}
diff --git a/app/Controller/Column.php b/app/Controller/Column.php
index 69ca5dd2..89c495a6 100644
--- a/app/Controller/Column.php
+++ b/app/Controller/Column.php
@@ -57,7 +57,7 @@ class Column extends Base
if ($this->board->addColumn($project['id'], $data['title'], $data['task_limit'], $data['description'])) {
$this->session->flash(t('Board updated successfully.'));
- $this->response->redirect($this->helper->url('column', 'index', array('project_id' => $project['id'])));
+ $this->response->redirect($this->helper->url->to('column', 'index', array('project_id' => $project['id'])));
}
else {
$this->session->flashError(t('Unable to update this board.'));
@@ -102,7 +102,7 @@ class Column extends Base
if ($this->board->updateColumn($values['id'], $values['title'], $values['task_limit'], $values['description'])) {
$this->session->flash(t('Board updated successfully.'));
- $this->response->redirect($this->helper->url('column', 'index', array('project_id' => $project['id'])));
+ $this->response->redirect($this->helper->url->to('column', 'index', array('project_id' => $project['id'])));
}
else {
$this->session->flashError(t('Unable to update this board.'));
@@ -128,7 +128,7 @@ class Column extends Base
$this->board->{'move'.$direction}($project['id'], $column_id);
}
- $this->response->redirect($this->helper->url('column', 'index', array('project_id' => $project['id'])));
+ $this->response->redirect($this->helper->url->to('column', 'index', array('project_id' => $project['id'])));
}
/**
@@ -165,6 +165,6 @@ class Column extends Base
$this->session->flashError(t('Unable to remove this column.'));
}
- $this->response->redirect($this->helper->url('column', 'index', array('project_id' => $project['id'])));
+ $this->response->redirect($this->helper->url->to('column', 'index', array('project_id' => $project['id'])));
}
}
diff --git a/app/Controller/Currency.php b/app/Controller/Currency.php
index fac34a30..10fb90da 100644
--- a/app/Controller/Currency.php
+++ b/app/Controller/Currency.php
@@ -57,7 +57,7 @@ class Currency extends Base
if ($this->currency->create($values['currency'], $values['rate'])) {
$this->session->flash(t('The currency rate have been added successfully.'));
- $this->response->redirect($this->helper->url('currency', 'index'));
+ $this->response->redirect($this->helper->url->to('currency', 'index'));
}
else {
$this->session->flashError(t('Unable to add this currency rate.'));
@@ -84,6 +84,6 @@ class Currency extends Base
$this->session->flashError(t('Unable to save your settings.'));
}
- $this->response->redirect($this->helper->url('currency', 'index'));
+ $this->response->redirect($this->helper->url->to('currency', 'index'));
}
}
diff --git a/app/Controller/File.php b/app/Controller/File.php
index 39032abc..f0367537 100644
--- a/app/Controller/File.php
+++ b/app/Controller/File.php
@@ -24,10 +24,10 @@ class File extends Base
$this->session->flash(t('Screenshot uploaded successfully.'));
if ($this->request->getStringParam('redirect') === 'board') {
- $this->response->redirect($this->helper->url('board', 'show', array('project_id' => $task['project_id'])));
+ $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id'])));
}
- $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
+ $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
}
$this->response->html($this->taskLayout('file/screenshot', array(
@@ -64,7 +64,7 @@ class File extends Base
$this->session->flashError(t('Unable to upload the file.'));
}
- $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
+ $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
}
/**
@@ -83,7 +83,7 @@ class File extends Base
$this->response->binary(file_get_contents($filename));
}
- $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
+ $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
}
/**
@@ -164,7 +164,7 @@ class File extends Base
$this->session->flashError(t('Unable to remove this file.'));
}
- $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
+ $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
}
/**
diff --git a/app/Controller/Hourlyrate.php b/app/Controller/Hourlyrate.php
index 8d96e5ca..19650ede 100644
--- a/app/Controller/Hourlyrate.php
+++ b/app/Controller/Hourlyrate.php
@@ -42,7 +42,7 @@ class Hourlyrate extends User
if ($this->hourlyRate->create($values['user_id'], $values['rate'], $values['currency'], $values['date_effective'])) {
$this->session->flash(t('Hourly rate created successfully.'));
- $this->response->redirect($this->helper->url('hourlyrate', 'index', array('user_id' => $values['user_id'])));
+ $this->response->redirect($this->helper->url->to('hourlyrate', 'index', array('user_id' => $values['user_id'])));
}
else {
$this->session->flashError(t('Unable to save the hourly rate.'));
@@ -84,6 +84,6 @@ class Hourlyrate extends User
$this->session->flash(t('Unable to remove this rate.'));
}
- $this->response->redirect($this->helper->url('hourlyrate', 'index', array('user_id' => $user['id'])));
+ $this->response->redirect($this->helper->url->to('hourlyrate', 'index', array('user_id' => $user['id'])));
}
}
diff --git a/app/Controller/Link.php b/app/Controller/Link.php
index 4a29a3e2..8eac8494 100644
--- a/app/Controller/Link.php
+++ b/app/Controller/Link.php
@@ -73,7 +73,7 @@ class Link extends Base
if ($this->link->create($values['label'], $values['opposite_label'])) {
$this->session->flash(t('Link added successfully.'));
- $this->response->redirect($this->helper->url('link', 'index'));
+ $this->response->redirect($this->helper->url->to('link', 'index'));
}
else {
$this->session->flashError(t('Unable to create your link.'));
@@ -115,7 +115,7 @@ class Link extends Base
if ($valid) {
if ($this->link->update($values)) {
$this->session->flash(t('Link updated successfully.'));
- $this->response->redirect($this->helper->url('link', 'index'));
+ $this->response->redirect($this->helper->url->to('link', 'index'));
}
else {
$this->session->flashError(t('Unable to update your link.'));
@@ -157,6 +157,6 @@ class Link extends Base
$this->session->flashError(t('Unable to remove this link.'));
}
- $this->response->redirect($this->helper->url('link', 'index'));
+ $this->response->redirect($this->helper->url->to('link', 'index'));
}
}
diff --git a/app/Controller/Subtask.php b/app/Controller/Subtask.php
index 5eff1575..5baa6004 100644
--- a/app/Controller/Subtask.php
+++ b/app/Controller/Subtask.php
@@ -252,11 +252,11 @@ class Subtask extends Base
{
switch ($redirect) {
case 'board':
- $this->response->redirect($this->helper->url('board', 'show', array('project_id' => $task['project_id'])));
+ $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id'])));
case 'dashboard':
- $this->response->redirect($this->helper->url('app', 'index'));
+ $this->response->redirect($this->helper->url->to('app', 'index'));
default:
- $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
+ $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
}
}
@@ -275,6 +275,6 @@ class Subtask extends Base
$method = $direction === 'up' ? 'moveUp' : 'moveDown';
$this->subtask->$method($task_id, $subtask_id);
- $this->response->redirect($this->helper->url('task', 'show', array('project_id' => $project_id, 'task_id' => $task_id)).'#subtasks');
+ $this->response->redirect($this->helper->url->to('task', 'show', array('project_id' => $project_id, 'task_id' => $task_id)).'#subtasks');
}
}
diff --git a/app/Controller/Task.php b/app/Controller/Task.php
index c2e66245..dc83f7b1 100644
--- a/app/Controller/Task.php
+++ b/app/Controller/Task.php
@@ -288,10 +288,10 @@ class Task extends Base
}
if ($redirect === 'board') {
- $this->response->redirect($this->helper->url('board', 'show', array('project_id' => $task['project_id'])));
+ $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id'])));
}
- $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
+ $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
}
if ($this->request->isAjax()) {
diff --git a/app/Controller/Tasklink.php b/app/Controller/Tasklink.php
index eccf149f..dd076802 100644
--- a/app/Controller/Tasklink.php
+++ b/app/Controller/Tasklink.php
@@ -77,10 +77,10 @@ class Tasklink extends Base
$this->session->flash(t('Link added successfully.'));
if ($ajax) {
- $this->response->redirect($this->helper->url('board', 'show', array('project_id' => $task['project_id'])));
+ $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id'])));
}
- $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])).'#links');
+ $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])).'#links');
}
$errors = array('title' => array(t('The exact same link already exists')));
@@ -132,7 +132,7 @@ class Tasklink extends Base
if ($this->taskLink->update($values['id'], $values['task_id'], $values['opposite_task_id'], $values['link_id'])) {
$this->session->flash(t('Link updated successfully.'));
- $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])).'#links');
+ $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])).'#links');
}
$this->session->flashError(t('Unable to update your link.'));
@@ -174,6 +174,6 @@ class Tasklink extends Base
$this->session->flashError(t('Unable to remove this link.'));
}
- $this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])).'#links');
+ $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])).'#links');
}
}
diff --git a/app/Controller/Timetableday.php b/app/Controller/Timetableday.php
index eea44ae1..c8f7ac8a 100644
--- a/app/Controller/Timetableday.php
+++ b/app/Controller/Timetableday.php
@@ -41,7 +41,7 @@ class Timetableday extends User
if ($this->timetableDay->create($values['user_id'], $values['start'], $values['end'])) {
$this->session->flash(t('Time slot created successfully.'));
- $this->response->redirect($this->helper->url('timetableday', 'index', array('user_id' => $values['user_id'])));
+ $this->response->redirect($this->helper->url->to('timetableday', 'index', array('user_id' => $values['user_id'])));
}
else {
$this->session->flashError(t('Unable to save this time slot.'));
@@ -83,6 +83,6 @@ class Timetableday extends User
$this->session->flash(t('Unable to remove this time slot.'));
}
- $this->response->redirect($this->helper->url('timetableday', 'index', array('user_id' => $user['id'])));
+ $this->response->redirect($this->helper->url->to('timetableday', 'index', array('user_id' => $user['id'])));
}
}
diff --git a/app/Controller/Timetableoff.php b/app/Controller/Timetableoff.php
index 19a6fab1..585014a3 100644
--- a/app/Controller/Timetableoff.php
+++ b/app/Controller/Timetableoff.php
@@ -60,7 +60,7 @@ class Timetableoff extends User
$values['comment'])) {
$this->session->flash(t('Time slot created successfully.'));
- $this->response->redirect($this->helper->url($this->controller_url, 'index', array('user_id' => $values['user_id'])));
+ $this->response->redirect($this->helper->url->to($this->controller_url, 'index', array('user_id' => $values['user_id'])));
}
else {
$this->session->flashError(t('Unable to save this time slot.'));
@@ -102,6 +102,6 @@ class Timetableoff extends User
$this->session->flash(t('Unable to remove this time slot.'));
}
- $this->response->redirect($this->helper->url($this->controller_url, 'index', array('user_id' => $user['id'])));
+ $this->response->redirect($this->helper->url->to($this->controller_url, 'index', array('user_id' => $user['id'])));
}
}
diff --git a/app/Controller/Timetableweek.php b/app/Controller/Timetableweek.php
index 829f4402..b8ce00e7 100644
--- a/app/Controller/Timetableweek.php
+++ b/app/Controller/Timetableweek.php
@@ -52,7 +52,7 @@ class Timetableweek extends User
if ($this->timetableWeek->create($values['user_id'], $values['day'], $values['start'], $values['end'])) {
$this->session->flash(t('Time slot created successfully.'));
- $this->response->redirect($this->helper->url('timetableweek', 'index', array('user_id' => $values['user_id'])));
+ $this->response->redirect($this->helper->url->to('timetableweek', 'index', array('user_id' => $values['user_id'])));
}
else {
$this->session->flashError(t('Unable to save this time slot.'));
@@ -94,6 +94,6 @@ class Timetableweek extends User
$this->session->flash(t('Unable to remove this time slot.'));
}
- $this->response->redirect($this->helper->url('timetableweek', 'index', array('user_id' => $user['id'])));
+ $this->response->redirect($this->helper->url->to('timetableweek', 'index', array('user_id' => $user['id'])));
}
}
diff --git a/app/Controller/Twofactor.php b/app/Controller/Twofactor.php
index c21729ba..a8b0351f 100644
--- a/app/Controller/Twofactor.php
+++ b/app/Controller/Twofactor.php
@@ -76,7 +76,7 @@ class Twofactor extends User
$_SESSION['user']['twofactor_activated'] = false;
$this->session->flash(t('User updated successfully.'));
- $this->response->redirect($this->helper->url('twofactor', 'index', array('user_id' => $user['id'])));
+ $this->response->redirect($this->helper->url->to('twofactor', 'index', array('user_id' => $user['id'])));
}
/**
@@ -99,7 +99,7 @@ class Twofactor extends User
$this->session->flashError(t('The two factor authentication code is not valid.'));
}
- $this->response->redirect($this->helper->url('twofactor', 'index', array('user_id' => $user['id'])));
+ $this->response->redirect($this->helper->url->to('twofactor', 'index', array('user_id' => $user['id'])));
}
/**
@@ -118,11 +118,11 @@ class Twofactor extends User
if (! empty($values['code']) && $otp->checkTotp(Base32::decode($user['twofactor_secret']), $values['code'])) {
$this->session['2fa_validated'] = true;
$this->session->flash(t('The two factor authentication code is valid.'));
- $this->response->redirect($this->helper->url('app', 'index'));
+ $this->response->redirect($this->helper->url->to('app', 'index'));
}
else {
$this->session->flashError(t('The two factor authentication code is not valid.'));
- $this->response->redirect($this->helper->url('twofactor', 'code'));
+ $this->response->redirect($this->helper->url->to('twofactor', 'code'));
}
}
@@ -157,7 +157,7 @@ class Twofactor extends User
'twofactor_secret' => '',
));
- $this->response->redirect($this->helper->url('user', 'show', array('user_id' => $user['id'])));
+ $this->response->redirect($this->helper->url->to('user', 'show', array('user_id' => $user['id'])));
}
$this->response->html($this->layout('twofactor/disable', array(
diff --git a/app/Controller/User.php b/app/Controller/User.php
index c8496418..b049c926 100644
--- a/app/Controller/User.php
+++ b/app/Controller/User.php
@@ -268,7 +268,7 @@ class User extends Base
$this->session->flashError(t('Unable to update this user.'));
}
- $this->response->redirect($this->helper->url('user', 'share', array('user_id' => $user['id'])));
+ $this->response->redirect($this->helper->url->to('user', 'share', array('user_id' => $user['id'])));
}
$this->response->html($this->layout('user/share', array(
diff --git a/app/Controller/Webhook.php b/app/Controller/Webhook.php
index 667c5087..c79b4ed6 100644
--- a/app/Controller/Webhook.php
+++ b/app/Controller/Webhook.php
@@ -96,7 +96,7 @@ class Webhook extends Base
$this->bitbucketWebhook->setProjectId($this->request->getIntegerParam('project_id'));
- $result = $this->bitbucketWebhook->parsePayload(json_decode(@$_POST['payload'], true));
+ $result = $this->bitbucketWebhook->parsePayload(json_decode(@$_POST['payload'], true) ?: array());
echo $result ? 'PARSED' : 'IGNORED';
}