Closed tilman-schieber closed 12 years ago
Hello,
I understand as you said above "the usertypeID can be found in the userdata variable usertype" this:
//for normal user. if($this -> session -> userdata('usertype') == 1)
Is it correct?
yes but first check if userdata has the key usertype otherwise the controller will abort with an error if noone is logged in.
Your function now loads the navigation bar two times for unregistered users you should test changes before you commit!
look at the logic of your if statements... especially try to find out what this evaluates to:
($this -> session -> userdata('usertype'))
if usertype=0 this statement will evaluate to FALSE why is this a problem?
I solve the problem now the view for unconfirmed user is in else part
the commited version still had the problem I mentioned two days ago. Please make sure to submit your changes in time. But it's working now, so
extend the _loadviews() function so it loads a different sidebar, depending what kind of user is logged in (not logged in, admin, editor or normal user). Create view/leftnav/user.php view/leftnav/editor.php view/leftnav/admin.php
You can make these views just copies of view/leftnav/default.php but make sure the correct one is loaded. Optional: put different dummy links in the sidebars depending on the type of user
the usertypeID can be found in the userdata variable usertype. Look at the table in the database or the wiki documentation to find out which ID is which type of user.
P.S.: this is a long explanation but the task is easy nonetheless