开发者

How to make session to allow different project?

开发者 https://www.devze.com 2022-12-10 23:08 出处:网络
I am planning to make a project management with PHP/MySQL/Codeigniter. It will have 10 - 20 users and 20 - 30 projects going on at the same time.

I am planning to make a project management with PHP/MySQL/Codeigniter.

It will have 10 - 20 users and 20 - 30 projects going on at the same time.

Let's say John is a member of project A, B and C. Cindy is in A, D, F G etc.

I want to make it only members of project can access the project.

Now I am not sure how to approach this.

W开发者_如何学Pythonhat do you suggest in terms of DB-design and session.

Any resources will be appreciated.


If you don't want to use a framework solution:

  1. Have User, Project, and UserProject tables.

  2. For every project a user is on, the UserProject table will have the UserID and the Project ID in a row.

  3. When creating the session, you can pull from the UserProject table to find what projects are allowable (and for example, put them in an array that can be searched when navigation is shown).

  4. Additionally, Each project could have a user set as admin that can add other users.


You can use Zend_Acl with Codeigniter or you could try EzAuth


As for session storage, I can recommend memcached. There is a PHP function that enables you to set your own session handler. Do not save sessions into a real database. It would add unncessary overhead.

I cannot tell you much about the database design as your post is lacking substantial information. Therefore I would just say, create two tables, "User" and "Project". "user" is made up of the columns ID, Name and E-Mail. Project consists of the columns ID, User ID (foreign key if supported by DBMS), Name etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消