mirror of https://github.com/MISP/MISP
Fix for the routing problem on admin-privileged users.
All links that need to be routed to admin-prefixed method have to have 'admin' => true in the parameterspull/61/head
parent
faffe87ea6
commit
69fef3f6fa
|
@ -31,4 +31,10 @@ App::uses('Helper', 'View');
|
|||
* @package app.View.Helper
|
||||
*/
|
||||
class AppHelper extends Helper {
|
||||
function url($url = null, $full = false) {
|
||||
if(is_array($url) && !isset($url['admin'])){
|
||||
$url['admin'] = false;
|
||||
}
|
||||
return parent::url($url, $full);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,26 +15,26 @@
|
|||
<?php
|
||||
foreach ($users as $user): ?>
|
||||
<tr>
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('admin' => true, 'action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<?php echo h($user['User']['id']); ?> </td>
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('admin' => true, 'action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<?php echo h($user['User']['org']); ?> </td>
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('admin' => true, 'action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<?php echo h($user['User']['email']); ?> </td>
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('admin' => true, 'action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<?php echo $user['User']['autoalert']? 'Yes' : 'No'; ?> </td>
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('admin' => true, 'action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<?php echo $user['User']['gpgkey']? 'Yes' : 'No'; ?> </td>
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('admin' => true, 'action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<?php echo h($user['User']['nids_sid']); ?> </td>
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('admin' => true, 'action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<?php echo h($user['User']['termsaccepted']); ?> </td>
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('admin' => true, 'action' => 'view', $user['User']['id']), true) ;?>';">
|
||||
<?php echo h($user['User']['newsread']); ?> </td>
|
||||
<td class="actions">
|
||||
<?php echo $this->Html->link(__('View'), array('action' => 'view', $user['User']['id'])); ?>
|
||||
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $user['User']['id'])); ?>
|
||||
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $user['User']['id']), null, __('Are you sure you want to delete # %s?', $user['User']['id'])); ?>
|
||||
<?php echo $this->Html->link(__('View'), array('admin' => true, 'action' => 'view', $user['User']['id'])); ?>
|
||||
<?php echo $this->Html->link(__('Edit'), array('admin' => true, 'action' => 'edit', $user['User']['id'])); ?>
|
||||
<?php echo $this->Form->postLink(__('Delete'), array('admin' => true, 'action' => 'delete', $user['User']['id']), null, __('Are you sure you want to delete # %s?', $user['User']['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="users view">
|
||||
<div class="actions" style="float:right;">
|
||||
<ul><li><?php echo $this->Html->link(__('Edit Profile', true), array('action' => 'edit', $user['User']['id'])); ?> </li></ul>
|
||||
<ul><li><?php echo $this->Html->link(__('Edit Profile', true), array('admin' => true, 'action' => 'edit', $user['User']['id'])); ?> </li></ul>
|
||||
</div>
|
||||
<h2><?php echo __('User');?></h2>
|
||||
<dl>
|
||||
|
@ -66,10 +66,10 @@
|
|||
<div class="actions">
|
||||
<h3><?php echo __('Actions'); ?></h3>
|
||||
<ul>
|
||||
<li><?php echo $this->Html->link(__('Edit User'), array('action' => 'edit', $user['User']['id'])); ?> </li>
|
||||
<li><?php echo $this->Form->postLink(__('Delete User'), array('action' => 'delete', $user['User']['id']), null, __('Are you sure you want to delete # %s?', $user['User']['id'])); ?> </li>
|
||||
<li><?php echo $this->Html->link(__('List Users'), array('action' => 'index')); ?> </li>
|
||||
<li><?php echo $this->Html->link(__('New User'), array('action' => 'add')); ?> </li>
|
||||
<li><?php echo $this->Html->link(__('Edit User'), array('admin' => true, 'action' => 'edit', $user['User']['id'])); ?> </li>
|
||||
<li><?php echo $this->Form->postLink(__('Delete User'), array('admin' => true, 'action' => 'delete', $user['User']['id']), null, __('Are you sure you want to delete # %s?', $user['User']['id'])); ?> </li>
|
||||
<li><?php echo $this->Html->link(__('List Users'), array('admin' => true, 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $this->Html->link(__('New User'), array('admin' => true, 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $this->Html->link(__('List Events'), array('controller' => 'events', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $this->Html->link(__('New Event'), array('controller' => 'events', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
|
|
Loading…
Reference in New Issue