We highly recommend you stay up to date for the latest security fixes.
This looks more like a cacheing issue though. You can try running a rebuild and restart, that should reset the cache buster.
I would like to check, if user is logged in from Javascript in Custom JS, like this:
$(window).bind("load", function() {
if (/* the current user is logged in */) {
$(".myclass").css("display", "none")
}
})
How can I accomplish this?
if (app.uid) {
console.log('logged in')
}
@baris said:
if (app.uid) { console.log('logged in') }
For some reason is the app.uid
always null
if called in $(window).bind("load", ...)
.
Ahh yeah it will be null until the client receives event:connect
. So you might try
socket.on('event:connect', function(data) {
if (data.uid) {}
});
Ok, thanks, this works. Now related question, how can I hide a whole category for registered users? (I know how to do it for non-registered users)
You can do it from ACP>manage>categories>access control.
You need to give the find
privilege to the groups that you want to see the category, in this case give to all groups except registered-users.
@baris said:
You can do it from ACP>manage>categories>access control.
You need to give the
find
privilege to the groups that you want to see the category, in this case give to all groups except registered-users.
It does not work, it seems that if I set some privileges to "guest" group, than every one get this privileges.
@3malG said:
@baris said:
You can do it from ACP>manage>categories>access control.
You need to give the
find
privilege to the groups that you want to see the category, in this case give to all groups except registered-users.It does not work, it seems that if I set some privileges to "guest" group, than every one get this privileges.
Now, it simply do not work for administrators, it is seems not to be possible to remove "find" privilege from administrator group.
@3malG said:
Now, it simply do not work for administrators, it is seems not to be possible to remove "find" privilege from administrator group.
That would stop you being able to see that category. May as well not have the category.
@joes Yes app.uid
got removed quite a while ago, the user data is stored in app.user