zfcuser

How to disallow multiple parallel user sessions per login in ZF2?

感情迁移 提交于 2020-12-06 11:32:47
问题 I'm currently facing the situation, that the ZendFramework2 ZFCuser-Module does not have any options to prevent a user from logging in from two devices at the same time. We recently had a case, that two people were "account-sharing" and accidentally deleted each others data. Since I did not build the application to account for this kind of resource conflicts, I need to prevent this behaviour now. Is there any module or easy possibility out there to prevent account-sharing in Zend Framework 2

Disable default zfcUser routes?

北城余情 提交于 2020-01-04 06:46:08
问题 I'm using zfcUser and I was wondering if its possible to disable the default routes, such as zfcUser/login , zfcUser/register , etc because I do not want to expose them. I looked at the zfcuser.global.php but there seems to be no such option? Thanks 回答1: You can simply override the configuration by setting a null controller or an unmatchable routing configuration. Solution 1: override the zfcuser controller invokable: // YourApp\Module#getConfig() or config/autoload/zfcuser.override.global

How to adapt modules ZfcUser/ zfcuserDoctrineORM in my project with doctrine 2 using annotations?

丶灬走出姿态 提交于 2020-01-01 00:48:10
问题 I’m writing from Argentina, forgive my English little. I’m having some problems with modules ZfcUser and zfcuserDoctrineORM . I need to integrate them into my project. I’m working with Zend framework 2 , doctrine 2.3 and postgreSQL and this is the first time I work with these tools. For that reason, there are many things that I don’t dominate well, I have all the modules included in my /config/application.config.php and my connection is configured in my database in /config/autoload/local.php

Zend2, Zfcuser - automatic logout

柔情痞子 提交于 2019-12-25 10:57:08
问题 I'm working with Zend Framework 2, ZfcUser and BjyAuthorize. Logging in and access control works, but under certain circumstances users get logged out: When they try to navigate to a different page while an on the current page an AJAX call is still running. In Chrome's Network window it shows the AJAX call as cancelled, followed by a call to the page you tried to navigate to, where the following code checks if you're logged in, finds that you're not ( $auth->hasIdentity() returns false ), and

Apply a module layout to zfcuser

佐手、 提交于 2019-12-24 08:51:33
问题 i'm working on zf2 and try to use 2 differents layouts. 1 layout for a public module and another one (private layout") for all the others. Its works pretty well but my zfcuser module in the public module use the other layout :/ i tried this : 'template_map' => array( 'zfc-user/user/login' => __DIR__ . '/../view/layout/blank.phtml', // blank is my public layout ), Instead of get the form in my layout, i get my form in the public layout AND in the "private" layout ... Does someone can help me ?

Zend Framework 2 - ZFCUser - How to exclude landing page from auth

≡放荡痞女 提交于 2019-12-24 08:24:58
问题 I'm using ZF2 in combination with ZFCUser and bjyauthorize . I have a landing page which should be globally accessable. All other pages need to be behind a login. At first I blamed bjyauthorize for not letting guest users access my landing page. But after some discussions it seems that ZFCUser is blocking the way. My question is: How can I tell ZFCUser not to block one page/action? Edit: My Application/Module.php looks like in this post. When I add my app myApp to the whitlist, I can access

How to attach custom styles into zf2 forms

喜夏-厌秋 提交于 2019-12-24 03:07:32
问题 Maybe its obvious problem but could you please tell me how can I add custom css styles to forms created by standard view helpers in zend framework 2? Im trying to attach some styles to forms created by ZfcUser 回答1: Assign the class-attribute :) $this->add(array( 'name' => 'element_name', 'options' => array( 'label' => 'element_label' ), 'attributes' => array( 'type' => 'element_type', 'class' => 'testing' ) )); Since you want to extend an existing form, you could either grab the Form and then

How to forward to another route at Module.php without redirect?

主宰稳场 提交于 2019-12-23 05:19:21
问题 I wish to show login form at page being accessed without url redirection. Is it possible to forward route at Module.php, i.e. if client accesses /stations/ forward it to "user/login" route? Without external redirect, I just want to see login form at private pages. public function onBootstrap(MvcEvent $e){ # .... other $eventManager->attach(MvcEvent::EVENT_ROUTE, array($this, 'checkAuth'), -100); } public function checkAuth(MvcEvent $e){ # ... get auth service if (!$auth->hasIdentity()) { #

Give permission for bjyauthorize to run mvc application of ZF2 from CLI

拟墨画扇 提交于 2019-12-22 08:55:06
问题 I have a completely running mvc application on ZF2. I want to run some actions from command line. I have properly set up my console routes and other environments. When I run my app from CLI, I got Permission denied exception like this: 'You are not authorized to access GeneratePdf\Controller\GeneratePdf\GeneratePdf:generate-all' in /var/www/zf2-reporting/module/BjyAuthorize/src/BjyAuthorize/Guard/Controller.php‌​:172 I already have some user in my database. How can I use those credentials to

What exactly is the user state in ZfcUser?

妖精的绣舞 提交于 2019-12-21 12:27:16
问题 Can anybody tell me, what the "user state" in the ZfcUser is doing exactly and why we may need it? What does this user state mean (I assume it's not the role meant by it)? 回答1: Basically it's a flag to indicate the state of a user. Sometimes you need to be able to disable users, or otherwise affect their 'state' without actually deleting them from the table. That's what the state column is intended for if you use such a system. As a simple example, think of a temporarily banned user on a