mirror of https://github.com/MISP/MISP
Corrected redirections
See the following for an explanation: https://stackoverflow.com/questions/6836990/how-to-get-complete-current-url-for-cakephp#comment11184149_6875310pull/5974/head
parent
8e9cbbd5fb
commit
8207be22ba
|
@ -111,9 +111,12 @@ if (!$relativePaths) {
|
|||
* Configure base URL for CakePHP
|
||||
*/
|
||||
if (Configure::read('MISP.baseurl')) {
|
||||
$regex = "%^(?<proto>https?)://(?<host>(?:(?:\w|-)+\.)+[a-z]{2,5})(?::(?<port>[0-9]+))?(?<base>/[a-z0-9_\-\.]+)?$%i";
|
||||
$regex = "%^(?<fullBaseUrl>(?<proto>https?)://(?<host>(?:(?:\w|-)+\.)+[a-z]{2,5})(?::(?<port>[0-9]+))?)(?<base>/[a-z0-9_\-\.]+)?$%i";
|
||||
if (preg_match($regex, Configure::read('MISP.baseurl'), $matches)) {
|
||||
if (isset($matches['base'])) Configure::write('App.base', $matches['base']);
|
||||
if (isset($matches['base'])) {
|
||||
Configure::write('App.base', $matches['base']);
|
||||
Configure::write('App.fullBaseUrl', $matches['fullBaseUrl']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -257,7 +257,7 @@ class AppController extends Controller
|
|||
'email' => $user['User']['email'],
|
||||
'action' => 'auth',
|
||||
'title' => 'Successful authentication using API key',
|
||||
'change' => 'HTTP method: ' . $_SERVER['REQUEST_METHOD'] . PHP_EOL . 'Target: ' . $this->here,
|
||||
'change' => 'HTTP method: ' . $_SERVER['REQUEST_METHOD'] . PHP_EOL . 'Target: ' . Router::url(null, true),
|
||||
);
|
||||
$this->Log->save($log);
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ class AppController extends Controller
|
|||
}
|
||||
if ($this->params['controller'] !== 'users' || !in_array($this->params['action'], $pre_auth_actions)) {
|
||||
if (!$this->request->is('ajax')) {
|
||||
$this->Session->write('pre_login_requested_url', $this->here);
|
||||
$this->Session->write('pre_login_requested_url', Router::url(null, true));
|
||||
}
|
||||
$this->_redirectToLogin();
|
||||
}
|
||||
|
@ -1105,7 +1105,7 @@ class AppController extends Controller
|
|||
'email' => $user['User']['email'],
|
||||
'action' => 'auth',
|
||||
'title' => 'Successful authentication using ' . $authName . ' key',
|
||||
'change' => 'HTTP method: ' . $_SERVER['REQUEST_METHOD'] . PHP_EOL . 'Target: ' . $this->here,
|
||||
'change' => 'HTTP method: ' . $_SERVER['REQUEST_METHOD'] . PHP_EOL . 'Target: ' . Router::url(null, true),
|
||||
);
|
||||
$this->Log->save($log);
|
||||
}
|
||||
|
|
|
@ -809,7 +809,7 @@ class FeedsController extends AppController
|
|||
$result = $this->__toggleEnable($id, true);
|
||||
$this->set('name', $result['message']);
|
||||
$this->set('message', $result['message']);
|
||||
$this->set('url', $this->here);
|
||||
$this->set('url', Router::url(null, true));
|
||||
if ($result) {
|
||||
$this->set('_serialize', array('name', 'message', 'url'));
|
||||
} else {
|
||||
|
@ -823,7 +823,7 @@ class FeedsController extends AppController
|
|||
$result = $this->__toggleEnable($id, false);
|
||||
$this->set('name', $result['message']);
|
||||
$this->set('message', $result['message']);
|
||||
$this->set('url', $this->here);
|
||||
$this->set('url', Router::url(null, true));
|
||||
if ($result['result']) {
|
||||
$this->set('_serialize', array('name', 'message', 'url'));
|
||||
} else {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
$urlHere = $this->here;
|
||||
$urlHere = Router::url(null, true);
|
||||
$urlHere = explode('/', $urlHere);
|
||||
foreach ($urlHere as $k => $v) {
|
||||
$urlHere[$k] = urlencode($v);
|
||||
|
|
|
@ -441,7 +441,7 @@
|
|||
?>
|
||||
<span>
|
||||
<?php echo __('This event has ');?><span class="bold"><?php echo h($event['Event']['FeedCount']); ?></span>
|
||||
<?php echo __('correlations with data contained within the various feeds, however, due to the large number of attributes the actual feed correlations are not shown. Click <a href="%s\/overrideLimit:1">here</a> to refresh the page with the feed data loaded.', h($this->here));?>
|
||||
<?php echo __('correlations with data contained within the various feeds, however, due to the large number of attributes the actual feed correlations are not shown. Click <a href="%s\/overrideLimit:1">here</a> to refresh the page with the feed data loaded.', h(Router::url(null, true)));?>
|
||||
</span>
|
||||
<?php
|
||||
endif;
|
||||
|
@ -476,7 +476,7 @@
|
|||
?>
|
||||
<span>
|
||||
<?php echo __('This event has ');?><span class="bold"><?php echo h($event['Event']['FeedCount']); ?></span>
|
||||
<?php echo __('correlations with data contained within the various feeds, however, due to the large number of attributes the actual feed correlations are not shown. Click <a href="%s\/overrideLimit:1">here</a> to refresh the page with the feed data loaded.', h($this->here));?>
|
||||
<?php echo __('correlations with data contained within the various feeds, however, due to the large number of attributes the actual feed correlations are not shown. Click <a href="%s\/overrideLimit:1">here</a> to refresh the page with the feed data loaded.', h(Router::url(null, true)));?>
|
||||
</span>
|
||||
<?php
|
||||
endif;
|
||||
|
|
Loading…
Reference in New Issue