0

I have two subdomains for a school's website - 1. staffmail.domainname.com and 2. studentmail.domainname.com. Currently all email users of the website can access both mail portals... Both subdomains run RoundCube mail software.

When a student user enters staffmail.domainname.com, it should prompt for login details. The student user enters his email address and password and then clicks on the login button. Thereafter the login gives an error. If a staff user enters their username and password and clicks on login the login works and the staff user will be taken to the mail application designed for the staff.

Is there any way I can do this? Our website runs on cPanel with Softaculous apps.

Julian E.
  • 4,687
  • 6
  • 32
  • 49

1 Answers1

0

If the login or user data table contains a field like role or position, you could query on that. Add it to the session and with each request check if they are in the appropriate section or subdomain.

After login you could refer them to the appropriate section all together with a location header.

Roles could be staff and student. Or employee and trainee or something like that.

You could add that to your table if it is not there, with a default value of student. Then you only need to update the staff user data and your done.

sillysicko
  • 126
  • 7
  • In Cpanel you can open a phpmyadmin instance and add that to the table. – sillysicko Dec 08 '15 at 17:16
  • Okay, and how do I prompt the user for their usernames and passwords when accessing the domain? – user2625790 Dec 08 '15 at 17:18
  • You could make a general login page before going to staffmail or studentmail subdomain. There you could show a login form, and based on the data refer them to the staff or student section. – sillysicko Dec 08 '15 at 17:20