How to hide subpage if not my own profile

Zoltan M. Posted in Beginning Developers 9 years ago

im try to make a component, i have take the component 'about user' rewrited a little and it works.(so so) but it appears in ever profile, i want it only in logedin users owned profile page.

Replies
German Zoltan M. Replied 9 years ago

thx, didnt see it before

this helps a lot

Indonesian Arsalan Shah Replied 9 years ago

Please note that this file has been edited/modified version of aboutuser

German Zoltan M. Replied 9 years ago

i use this file editet but its shown in the menue of every user, that what i do not want

Indonesian Arsalan Shah Replied 9 years ago

You can replace the ossn_com.php of your component with following file:

https://gist.github.com/lianglee/43d6acbf290779f8610db636ac217edf

German Zoltan M. Replied 9 years ago

yes

Indonesian Arsalan Shah Replied 9 years ago

Do you wanted to hide About User menu ?

German Zoltan M. Replied 9 years ago

i have this

 if($params['user']->fullname == ossn_loggedin_user()->fullname){
blablavbla
}  else {
echo 'keine Berechtigung';
}

 in actionfile 

but i want to hide the menue, so no one can see the link only profile owner. and if some one gose direct to u/xxx/subsite he got "echo 'keine Berechtigung';'

Indonesian Arsalan Shah Replied 9 years ago

You can use the condition to check if loggedin user is the profile owner

if(ossn_isLoggedin()->guid == $user->guid){
    //show my stuff
}