0

I am new to bonfire, I am developing a system that incorporates three users

  1. Admin
  2. Clients
  3. Agents

I have changed login destination for each above mentioned users in bf_roles table in database, but the issue is that the SITEAREA constant defined in constant.php file under application folder,is set to admin i.e

define('SITE_AREA', 'admin');

I want to define sitearea according to the respective users i.e for clients it should be

define('SITE_AREA',clients);

now with the default site area set to admin, I get this address whenever I login using clients credentials

http://localhost/pbx/index.php/admin/

How to dynamically change the site area for each user?

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

0

Since SITE_AREA is a view related constant. i.e. It's used only in views. It's definition can be moved to a later time in the application lifecycle, to a time before a view is rendered.e.g in your base controller:

  • Define a variable in your base controller that references the value of which SITE_AREA to use.

  • Selectively rename references to SITE_AREA in your view templates to the new variable name. ✌️

Oluwafemi Sule
  • 36,144
  • 1
  • 56
  • 81
  • sir thanks for showing the concern...i am still confused,my site area is defined in constant.php and is set to admin panel – Muhammad Talha Oct 02 '17 at 10:38
  • Sir btw can you help me in understanding the bonfire..?as i am new to bonfire development – Muhammad Talha Oct 02 '17 at 10:42
  • Bonfire provides a list of libraries, modules, helpers and templates to build CodeIgniter projects faster. You want to begin with understanding request-response flow in CodeIgniter. – Oluwafemi Sule Oct 02 '17 at 11:44