Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add last login refresh request event listener #55

Merged
merged 3 commits into from
Mar 13, 2017

Conversation

alexander-schranz
Copy link
Member

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
License MIT

What's in this PR?

Add posibility to refresh last login every 10 minutes.

@alexander-schranz alexander-schranz force-pushed the feature/last-login-refresh branch from e5d881d to 1f6870d Compare March 13, 2017 08:21
@@ -79,6 +83,12 @@ public function getConfigTreeBuilder()

$rootNode
->children()
->arrayNode(self::LAST_LOGIN)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would use canBeEnabled and set a default value to refresh_interval

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;

class LastLoginListener
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpdoc

*
* @param FilterControllerEvent $event
*/
public function onCoreController(FilterControllerEvent $event)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not on kernel.terminate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wachterjohannes if I remember it correctly we did that if a query based on active users dont return 0 users when 1 user is online and the last login will be refreshed.

*/
public function isActiveNow(BaseUser $user)
{
$delay = new \DateTime($this->interval . ' minutes ago');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you configure this string? 10 minutes or 10 seconds you could then configure it more accuate for your application. 10 minutes seems a good default - but some faster applications maybe want to configure that in seconds or in hours for very slow apps.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wachterjohannes only want an integer value in the configuration but can set it to seconds so it like the cacheLifetime. ok?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok (:

UPGRADE.md Outdated
### Parameter `sulu_community.config` was removed

The whole config as parameter is not longer available the webspaces config
you can get over the `sulu_community.webspaces` parameter.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calling it sulu_community.webspace_config maybe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wachterjohannes it is not a single webspace it contains all webspaces

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sulu_community.webspaces_config?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@alexander-schranz
Copy link
Member Author

@wachterjohannes ready

@wachterjohannes
Copy link
Member

@alexander-schranz will wait for tests and then merging it.

@wachterjohannes wachterjohannes merged commit 4b54b02 into develop Mar 13, 2017
@wachterjohannes wachterjohannes deleted the feature/last-login-refresh branch March 13, 2017 16:24
@alexander-schranz alexander-schranz mentioned this pull request Apr 18, 2017
alexander-schranz pushed a commit to alexander-schranz/SuluCommunityBundle that referenced this pull request Dec 4, 2017
* Fixed dynamic list factory with hidden fields
alexander-schranz added a commit to alexander-schranz/SuluCommunityBundle that referenced this pull request Dec 4, 2017
# Changelog

 - FEATURE     sulu#59   Added correct composer dependencies
 - FEATURE     sulu#57    Added basic theme for dynamic forms
 - FEATURE     sulu#56    Added daterange to csv export overlay for sulu 1.5
 - BUGFIX      sulu#55    Fixed dynamic list factory with hidden fields
 - BUGFIX      sulu#54    Fixed date type default value
 - ENHANCEMENT sulu#52    Update sulu from `alexander-schranz/sulu-form-bundle` from commit `c110e72e44a58a0f53428c153e405124695506f6`
 - BUGFIX      sulu#52    Fixed form preview request analyzer
 - BUGFIX      sulu#52    Fixed second date field type
 - BUGFIX      sulu#52    Fixed missing translation and documentation
 - ENHANCEMENT sulu#52    Added missing documentation
 - BUGFIX      sulu#52    Fixed success email not sent to email in data json
 - BUGFIX      sulu#52    Fixed missing uniqueness in form fields table
 - BUGFIX      sulu#52    Fixed permission denied on fields action
 - FEATURE     sulu#52    Added toggler to set email as replyTo
 - BUGFIX      sulu#52    Fixed exception controller redirect
 - BUGFIX      sulu#52    Fixed form select by using native select
 - FEATURE     sulu#52    Added media collection strategy tree
 - FEATURE     sulu#52    Added support to add dynamic list to article bundle
 - BUGFIX      sulu#52    Fixed csv export for bool values
 - ENHANCEMENT sulu#52    Fixed sort on dynamic list and removed search
 - FEATURE     sulu#52    Added dynamic form list and export
 - FEATURE     sulu#20    Added additional receivers for sending notification as CC or BCC
 - ENHANCEMENT sulu#23    Fixed composer json links and description
 - BUGFIX      sulu#16    Fixed setting of entity value in dynamic which represents an array
 - ENHANCEMENT sulu#13    Added dynamic type pool service for enabling custom form field types
 - ENHANCEMENT sulu#10    Update sulu from `alexander-schranz/sulu-form-bundle` from commit `c16a04b15fe320c039064de05ddaef9d087dbc6f`
 - BUGFIX      sulu#10    Fixed permission problem on false locale
 - BUGFIX      sulu#10    Fixed limitation of content type select
 - FEATURE     sulu#10    Added options for attachment validation
 - BUGFIX      sulu#10    Fixed multiple choices to text type columns
 - BUGFIX      sulu#10    Fixed naming of mailchimp parameters
 - FEATURE     sulu#3     Added short title to fields
 - FEATURE     sulu#2     Changed title field for labels to texteditor
 - ENHANCEMENT #-     Updated namespaces and rename table names
 - ENHANCEMENT #-     Forked from `alexander-schranz/sulu-form-bundle` from commit `36a7cd11562ed0c9f64752b37707cc2771e0baca`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants