Refresh auth on dashboard

pull/953/head
Iglocska 2016-02-16 01:04:43 +01:00
parent e7e8798254
commit 5cc9655f11
3 changed files with 8 additions and 1 deletions

View File

@ -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()) {

View File

@ -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'])));

View File

@ -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() {