mirror of https://github.com/MISP/MISP
Refresh auth on dashboard
parent
e7e8798254
commit
5cc9655f11
|
@ -585,6 +585,12 @@ class UsersController extends AppController {
|
|||
$this->Session->setFlash(__('User was not deleted'));
|
||||
$this->redirect(array('action' => 'index'));
|
||||
}
|
||||
|
||||
public function updateLoginTime() {
|
||||
if (!$this->request->is('post')) throw new MethodNotAllowedException('This feature is only accessible via POST requests');
|
||||
$this->_refreshAuth();
|
||||
$this->redirect(array('Controller' => 'User', 'action' => 'dashboard'));
|
||||
}
|
||||
|
||||
public function login() {
|
||||
if ($this->Auth->login()) {
|
||||
|
|
|
@ -1825,7 +1825,7 @@ class Event extends AppModel {
|
|||
unset($this->Attribute->validate['value']['uniqueValue']); // unset this - we are saving a new event, there are no values to compare against and event_id is not set in the attributes
|
||||
}
|
||||
unset ($data['Event']['id']);
|
||||
if (isset($data['Event']['published']) && $data['Event']['published'] && !$user['Role']['perm_publish']) $data['Event']['published'] = false;
|
||||
if (isset($data['Event']['published']) && $data['Event']['published'] && $user['Role']['perm_publish'] == false) $data['Event']['published'] = false;
|
||||
if (isset($data['Event']['uuid'])) {
|
||||
// check if the uuid already exists
|
||||
$existingEventCount = $this->find('count', array('conditions' => array('Event.uuid' => $data['Event']['uuid'])));
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<b>Events updated: </b><span class="bold <?php echo $events['changed'] ? 'red' : 'green'; ?>"><?php echo h($events['changed']);?></span> (<a href="<?php echo $baseurl;?>/events/index">View</a>)<br />
|
||||
<b>Events published: </b><span class="bold <?php echo $events['published'] ? 'red' : 'green'; ?>"><?php echo h($events['published']);?></span> (<a href="<?php echo $baseurl;?>/events/index">View</a>)<br />
|
||||
</p>
|
||||
<?php echo $this->Form->postLink('Reset', $baseurl . '/users/updateLoginTime', array('div' => false));?>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
|
Loading…
Reference in New Issue