Im sure this is simple but what is the code to determine if a teacher is logged in? I cant find any info on how to do it?
Thanks for your help.
Skeep
Where are you trying to determine if it is a teacher?
The usual way is to use has_capability() to check for a specific capabilty related to why you are checking
Mike
The usual way is to use has_capability() to check for a specific capabilty related to why you are checking
Mike
Just want to check it on the front page and display some teacher specific links. Is this possible?
Yes, sounds v.similar to a block I wrote.
You will need to assign system roles for staff (if you assign them as global teachers they will be listed as a teacher for every course) with at least 1 capability that students won't have. Then you can use has_capability on that capabilty
Mike
You will need to assign system roles for staff (if you assign them as global teachers they will be listed as a teacher for every course) with at least 1 capability that students won't have. Then you can use has_capability on that capabilty
Mike
If your policy is that students never become teachers at your site - like we do - you could use:
another approach is giving teachers and students different email-tails and then filter on that item. We use this:
..@mail.hetstedelijk.nl = student
..@stedelijk.nl = teacher
(we guard emailadresses with ldap)
ifisteacherinanycourse() {show what you wish;}
another approach is giving teachers and students different email-tails and then filter on that item. We use this:
..@mail.hetstedelijk.nl = student
..@stedelijk.nl = teacher
(we guard emailadresses with ldap)
$string = 'a_student@mail.hetstedelijk.nl';
if (eregi('@mail.hetstedelijk.nl', $string)) {
echo "a student!";
}