goalio / goaliorememberme Goto Github PK
View Code? Open in Web Editor NEWA Zend Framework 2 (ZF2) Module offering remember me functionality to ZfcUser
License: BSD 3-Clause "New" or "Revised" License
A Zend Framework 2 (ZF2) Module offering remember me functionality to ZfcUser
License: BSD 3-Clause "New" or "Revised" License
I followed the readme. But no juice.
Deprecated: ServiceManagerAwareInterface is deprecated and will be removed in version 3.0, along with the ServiceManagerAwareInitializer. Please update your class GoalioRememberMe\Authentication\Adapter\Cookie to remove the implementation, and start injecting your dependencies via factory instead. in /vagrant/personal/vendor/zendframework/zend-mvc/src/Service/ServiceManagerConfig.php on line 127
How it correctly to fix?
I am wondering how to use this plugin for ZfcUser when Doctrine is used as primary ORM. Is there any progress on this issue?
If the cache is flushed, and the 'remember_me' cookie is set, I receive this error:
http://jsfiddle.net/ds4f8geq/
The affected row is this: https://github.com/goalio/GoalioRememberMe/blob/master/src/GoalioRememberMe/Module.php#L45
If I manually remove the 'remember_me' cookie, everything result as normal.
Somebody knows why it can't find that Service?
Thanks
This module isn't (yet) compatible with the lastets dev master of zfc-user(3.0)
If the cookie fails to authenticate, remove it, otherwise a new login request will not work
Yes its true. When, this module is used with ScnSocialAuth, user is not remembered.
There will be a zfcUser 2 release in the near future thats is the same as zfcUser 1 but with support for zf3
When running the schema.sql
https://github.com/goalio/GoalioRememberMe/blob/master/data/schema.sql
in phpMyAdmin it successfully creates the table user_remember_me
but the ALTER command ends with the following error:
MySQL: Can't create table (errno: 150)
According to MySQL doc this means:
If you re-create a table that was dropped, it must have a definition that conforms to the foreign key constraints referencing it. It must have the right column names and types, and it must have indexes on the referenced keys, as stated earlier. If these are not satisfied, MySQL returns error number 1005 and refers to error 150 in the error message.
My table user
and its column user_id
exists. Is this a privilege problem or a conflict with the ZfcUser structure?
How can I customize login template? Simple overwrite like in zfc-user doesn't works.
Module working fine on /user/login route after install&configure.
In my project that route is excluded, using zfcUserLoginWidget instead on all pages when no user logged in.
Unfortunately the "Stay logged in" checkbox is missing from widget.
Found that user_login_widget_view_template
should be changed to use goalio-rememberme/view/zfc-user/user/login.phtml
, but not sure how to do this.
Also readed Issue #7, but did not help too much.
Issue:
To fix:
Add to Adapter/Cookie.php:
public function logout() {
//...
$this->getStorage() and $this->getStorage()->clear();
}
There hasn't been maintenance on this package for quite a while. I'll take admin access, or I may end up forking this into a new packagist package to maintain myself.
It happens on login with checkbox checked:
Here's the error:
[Thu Jun 27 11:49:58 2013] [error] [client 10.200.201.99] PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1 near "&": syntax error' in /var/www/project/revisions/rev1/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Statement.php:187\nStack trace:\n#0 /var/www/project/revisions/rev1/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Statement.php(187): PDO->prepare('UPDATE "user_re...')\n#1 /var/www/project/revisions/rev1/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Statement.php(213): Zend\\Db\\Adapter\\Driver\\Pdo\\Statement->prepare()\n#2 /var/www/project/revisions/rev1/vendor/zf-commons/zfc-base/src/ZfcBase/Mapper/AbstractDbMapper.php(165): Zend\\Db\\Adapter\\Driver\\Pdo\\Statement->execute()\n#3 /var/www/project/revisions/rev1/vendor/goalio/goalio-rememberme/src/GoalioRememberMe/Mapper/RememberMe.php(35): ZfcBase\\Mapper\\AbstractDbMapper->update(Object(GoalioRememberMe\\Entity\\RememberMe), 'user_id = 1 && ...', 'user_remember_m...', Object(GoalioRememberMe\\Mapper\\RememberMeHydr in /var/www/project/revisions/rev1/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Statement.php on line 187
sqlite> .read schema.sqlite.sql
Error: near line 1: near "KEY": syntax error
Hi, could you do that work like zfcUser login widget (zfcUserLoginWidget()) or how could i use login form on my homepage (application/index)?
Is this module compatible with ZfcUser 1.0?
Hi All,
In some occasions the cookie is not set on the client browser (e.g : on chrome when the domain doesn't have a tld part - leaving the domain empty solves the issue), in some other occasions the cookie is deleted by the browser itself (expired cookie / browsing data set to be cleared on browser exit... ).
In such situations, the matching object in the db will never be deleted, leaving soon, a lot of orphans in the rememberme table (which will keep growing overtime...)
I think you should add the expiration date of the cookie to the RememberMe entity. Then, it would be easy to have a cron job or a db function running everyday to remove the expired rows.
My 2 cents :-)
PS1 : btw, for consistency reasons and to avoid issues linked to domain, I think the removeCookie function of the rememberme service should be modified from :
setcookie("remember_me", "", time() - 3600, '/');
to
setcookie("remember_me", "", time() - 3600, '/', $cookieDomain, null, true);
PS2 : What's the purpose of requesting the remember entity from the mapper in RememberMeService::updateSerie ? There is no modification of the object between when we request it in CookieAdapter::authenticate and when we pass it as a parameter of the updateSerie function. Am I missing something or is it a useless call to the db?
Hi,
I found another bug: the cookie is not removed well.
This comes from tha fact that the path is not defined when calling the function setCookie() in the method removeCookie() of the RememberMe service (l.70).
It is:
setcookie("remember_me", "", time() - 3600);
It should be:
setcookie("remember_me", "", time() - 3600, '/');
This feature was definitely not tested...
Cheers
After updating ZF to 2.4.1 this module stop working. The problem caused by new cookie value check (till now it must be RFC 7230 compatible). Module genereates cookie value with \n symbol and it raises exception on application start. To solve this problem symbol \n must be replaced with something else (like ::: or |||)
I could not find if this module removes all the data associated with cookies when user changes his password. I guess you should listen to the event, 'changePassword' and remove all the data associated with the user from table, user_remember_me
. Optionally, you can add a check box in the changepassword form if all the cookie data are to be removed.
Hi,
I believe the condition in Module.php l.73 is wrong:
if(isset($cookie['remember_me']) && $cookieLogin == false)
When the user login normally with the form (and check 'Stay logged in'), it first creates a new cookie + serie, and then, on the next page load (on the page redirection after login), the condition is passed and the serie is updated. The condition should not be passed once the user is logged in. The update is useless and should not be done at that moment.
To avoid this and correct this bug, I propose the following condition:
if(isset($cookie['remember_me']) && !$userIsLoggedIn)
With that condition, the autologin will be tried only if the user is not already connected. It is easy to know if the user is logged in or not by calling:
$userIsLoggedIn = $e->getApplication()->getServiceManager()->get('zfcuser_auth_service')->hasIdentity();
Cheers
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for zf-commons/zfc-base dev-master -> satisfiable by zf-commons/zfc-base[dev-master].
- zf-commons/zfc-user dev-master requires zf-commons/zfc-base 0.* -> satisfiable by zf-commons/zfc-base[0.0.1, 0.1.0, 0.1.1, v0.1.2].
- Can only install one of: zf-commons/zfc-base[dev-master, 0.0.1].
- Can only install one of: zf-commons/zfc-base[dev-master, 0.1.0].
- Can only install one of: zf-commons/zfc-base[dev-master, 0.1.1].
- Can only install one of: zf-commons/zfc-base[v0.1.2, dev-master].
- Installation request for zf-commons/zfc-user dev-master -> satisfiable by zf-commons/zfc-user[dev-master].
Why not to use primary key for sid (sid,token,user_id)
instead of unique key?
Hi, I tried setting up your module on a basic skeleton application with ZfcBase, ZfcUser, and GoalioRememberMe loaded...I have my database.local.php file in the autoload directory, as well as your goaliorememberme.global.php file. When I go to user/login, I get your form with the "Stay logged in" check box. When I login with an existing user account however, it returns "Authentication failed. Please try again." When I go into your global config and disable your zfcuser auth_adapter line, I can login fine, but obviously your adapter isnt being used and the cookie isnt being persisted. Any guidance on what I'm doing wrong in this basic setup? Thanks for any help!
namespace GoalioRemeberMe\Entity;
=>
namespace GoalioRememberMe\Entity;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.