Complex User Registration System


I’m new to Yii, and also frameworks in general. It’s been very fun learning about it.

I already have a Yii Skeleton application with the yii-user extension. I’m using this extension as a diving board - something to use as a guide to how things work, but at the same time I’m going to be turning it into something completely different to suit my needs. Granted, my needs are probably a little too complex for this to be my first project, but hey, where’s the fun in printing “Hellow World!”?

A bit of background: I play an online MMO called EVE Online. The developers of the game have released an API that can access character data in-game. I’m developing an application that takes that data and manipulated it in various ways. But it all starts with user registration.

Please note that most of the database itself is managed by a 3rd party application, and I can’t modify the tables of that, which is why some of my proposed tables are the way they are and not combined.

I’m not looking for just a simple registration system. That would be too simple. My registration system needs to do the following:

  1. Take some general data, such as email and password (no usernames for this application - players will login with either their email or character name). This is the ‘basic’ registration. This information will go into a database table titled users (which also has fields for last login, etc)

  2. Have the user enter their API details. This is where it gets tricky: players can have multiple API keys, but they only need one to sign up. I can manage more of them at a later date. When they put in their API details, I need to fetch data from the EVE Online servers (specifically, which characters are on that account). This information will be entered into the RegisteredKeys table. This is one of those tables that I absolutely cannot modify

  3. Once the characters are fetched (can be up to 3 characters returned), the user will pick the default character. That character info will be put into another database table labeled RegisteredChars. Again, this is one of the tables that I absolutely cannot modify.

There will also be a user2api table that links the user tables (the one that will store user info such as email and passwords) and the RegisteredKeys table (the one that I cannot modify). So, in total, registration will utilize 4 tables, 2 of which I cannot change the structure of, and one of which is a helper table. I’m sure relationships between the models will help me out a lot.

Now, as you can see (hopefully, if I haven’t lost you yet ;)), the registration is basically split into two parts: the initial info, and the info that is fetched after the user enters API info. I don’t plan on making two separate forms if I don’t have to - I would like to do this all on the page with AJAX. However, I am not sure how I would go about designing something like this. How should the controllers be laid out? Would it be possible to have Yii do an AJAX request with user input like this? Are there any classes in Yii that will help me a lot (I know the basics of things like CActiveForm, but the more advanced stuff I probably have not even touched yet.) Does anyone have any ideas that can point me in the right direction?

Thanks for reading the wall of text. ;)