zend-auth

Refactoring a Zend_Auth implementation

笑着哭i 提交于 2019-12-13 02:30:23
问题 I am working on an existing project that has two areas that can be logged into. An admin section and the front end. Currently the admin section has a login action and the front end has its own login action. Admin logs in using a database table specifically for admin accounts, the front end is logged in using a different table all together. If the admin is logged in and tries to then log into the front end they are prompted to log in as a front end user (needed because front end users get

Zend Auth locked session

折月煮酒 提交于 2019-12-12 15:36:57
问题 i nearly frustrated with how Zend handling session. here is my case. i write a auth plugin that always check the the user credential utilize Zend_Auth. and when invoke hasIdentity function from zend auth, it will automatically start the session. and the problem come when i have a long process that i need to execute. the session will lock the request until request completed. i try to release the lock by invoke Zend_Session::writeClose(false), so another request can be executed. but no way for

Is there any way to force authentication with Zend_Auth?

雨燕双飞 提交于 2019-12-12 10:04:54
问题 I am working with Zend_Auth and cookie/session persistence. I can't seem to figure out how to force an authentication with this class. Is there any way to force Zend_Auth to believe it has authenticated as a user? 回答1: Zend_Auth::getInstance()->getStorage()->write($identity); Where $identity would contain the same type of structure/data that's generated when the user logs in through the standard mechanism. For instance, given this sample code in the login action: $adapter = $this-

In Zend Framework Zend_Db_Table::getDefaultAdapter() returns Null

此生再无相见时 提交于 2019-12-12 03:13:57
问题 after serching up and down the internets, finding no proper answer, I am asking you: I want to implement a getAuthAdapter(array $form) private function getAuthAdapter(array $form) { $authAdapter = new Zend_Auth_Adapter_DbTable( Zend_Db_Table::getDefaultAdapter(), 'user', 'email', 'password', 'MD5(?) AND hidden = "FALSE"'); $authAdapter->setIdentity($form['email']) ->setCredential($form['password']); return $authAdapter; } To establish a database connection, I added following lines to my

Zend_Auth login using either username or email as identityColumn

怎甘沉沦 提交于 2019-12-11 15:32:19
问题 I'm using Zend_Auth with a "Database Table Authentication". What I want to do is allow the user to login with either a username or email address as the "identityColumn". How would I allow both. I'm stuck. 回答1: Extend and implement your own Auth Adapter and use query like "WHERE username = ? or email = ?" to get Auth result :) 回答2: Authenticate twice (if needed) with 2 different Zend_Auth_Adapter_DbTable objects and add some logic to determine if the login is username or email by guessing if

ZF3 MVC Zend\Authentication as a Service Factory

我的梦境 提交于 2019-12-11 06:35:55
问题 I'm trying to adapt my ZF2 User module to ZF3 MVC. It has an authentication service manager that is called in the onBootsrap function inside the Module class for every request (i.e. page loading) to check if the user is authenticated. As serviceLocator and ServiceAware are not available anymore I'm trying to create an AuthenticationServiceFactory but I do not succeed yet. Would you have any ideas on what I'm doing wrong and how I could do it with ZF3 ? Here is a simplified version of my

Zend_Auth identity versioning

坚强是说给别人听的谎言 提交于 2019-12-11 04:07:58
问题 There is a situation: I store some structured data (e.g. array or object, or even string) as a Zend_Auth identity. From version to version the structure of identity could be changed thus identity from one version could (or could not) be compatible with application code of another version. I'd like to have an ability to validate whether the stored identity data conform to current version requirements. As I see from the manual, the verification of whether the identity exists is performed like:

Zend_Auth fails to write to storage

谁说我不能喝 提交于 2019-12-10 19:02:00
问题 I have yet another weird annoying thing going on with Zend. Basically, I have the following code after creating a user domain: $this->auth = Zend_Auth::getInstance(); $this->view->user = $this->user = $this->auth->getIdentity(); $this->user->idSite = $idSite; $this->user->urlSite = $urlSite; $this->auth->getStorage()->write($this->user); What FURIOUSLY annoys me is that the auth->getIdentity() just moments after that: [idSite] => 0 [urlSite] => So from here it gets worse: If I REFRESH or if

Zend Auth - Using two tables

北战南征 提交于 2019-12-10 12:05:01
问题 I'm currently developing a website in Zend Framework wich uses Zend_Auth. The current design of the database is the following: users - id / email users_props - id - user_id - prop_name - prop_value However, the current Zend_Auth_Adapter_DbTable uses only one table, as where I have to tables and need to join them. How on earth can I do this? As far as i'm concerned, there are three options: I somehow create a (mysql) view I change the design so the users table contains both username/password I

Android save user session

徘徊边缘 提交于 2019-12-06 09:37:11
问题 I'm new in android I'm trying to save login session and send it with every time I send request to server, My web service is PHP (Zend framework 2). This code to identify user: $auth = Zend_Auth::getInstance(); $IdentityObj = $auth->getIdentity(); It's possible save session and send it like I use web browser without make any change in my web service. 回答1: Yes, it is. You just have to store the session using SharedPreferences. The idea is, after you login, I guess you return some kind of