CodeIgniter Forums
Redirect advice - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Redirect advice (/showthread.php?tid=74475)



Redirect advice - Mekaboo - 09-28-2019

Hey folks! 

I added this forum script to my site:

http://www.phpcmsframework.com/2014/05/cibb-basic-forum-with-codeigniter-and.html

The issues I have with it is:
1. It comes with login/register but I have those already implemented..how do fix or redirect so that folks can easily go into forum when they are within the site(no second logging or registering)

2. I want to make myself and another person admin..how to give ourselves admin privileges not only for the forum but in general? I have 90% of the site done so is it too late to place admin privileges within the site?

If these are stupid questions I'm sorry..thank ya kindly

Heart Heart ,
Mekaboo


RE: Redirect advice - Wouter60 - 09-29-2019

CIBB redirects to 'user/join' if the user isn't logged in. I.e. if $this->session->cibb_user_id is not set.
You can create a route in application/config/routes.php to route requests for 'user/join' to your own controller/method for the user to log in.
Example:
PHP Code:
$route['user/join'] = 'myapp/login'
In your own login script, you'll have to set the cibb_user_id in the session, on succesful login.

To give yourself and other users the administrator role, look at how CCIB is doing this. Check the ccib.sql file. You will find a table named "ccib_roles". In the "ccib_users" table, each user has a role_id. On login, the application loads the privileges for the user's role into the session. If a privilege is set to 1, it is active.


RE: Redirect advice - Mekaboo - 09-29-2019

(09-29-2019, 06:12 AM)Wouter60 Wrote: CIBB redirects to 'user/join' if the user isn't logged in. I.e. if $this->session->cibb_user_id is not set.
You can create a route in application/config/routes.php to route requests for 'user/join' to your own controller/method for the user to log in.
Example:
PHP Code:
$route['user/join'] = 'myapp/login'
In your own login script, you'll have to set the cibb_user_id in the session, on succesful login.

To give yourself and other users the administrator role, look at how CCIB is doing this. Check the ccib.sql file. You will find a table named "ccib_roles". In the "ccib_users" table, each user has a role_id. On login, the application loads the privileges for the user's role into the session. If a privilege is set to 1, it is active.
Thank ya so much for this great info Heart