Hello everyone! I’m working on my first Yii project and have run into my first major problem. I’m using the advanced template for my project (in case this makes a difference at all).
I know that the framework already has signup and login functionality built in, however, I want to modify it a bit for my purposes. I’m trying to implement an email confirmation step. This by itself I’ve been able to figure out but I’m trying to think long term and database management. So here’s what I’m doing/thinking.
I’ve created 2 user tables: user and pend_user. When a person signs up, their information is placed in the “pend_user” table. Once they confirm their email, their information is removed from “pend_user” and added to “user”. What I want to happen is that, when they log in BEFORE confirming their email, they’re taken to a page that tells them they must confirm their email. The problem arises because Yii only looks in the “user” table for user information.
Now, at this point, you’re probably asking, why am I using 2 separate tables for pending members and activated members? The reason is because I don’t want to maintain accounts that haven’t been activated. Ultimately, I’d like the “pend_user” table to be purged on a regular basis. This would undoubtedly be faster than running a scheduler that routinely scans the entire “user” table and deletes accounts who haven’t confirmed their email in a certain amount of time. A simple purge of an entire table would obviously be much faster.
Having said all that, how can I teach/modify Yii to look into both tables for user identity? Or is there another, simpler way to do this that I’m not thinking about?
Also, I’m very new to Yii and programming in general, so please let me know if what I’m asking for here is overly complicated to achieve.
Thanks.