Support

Support is part of Event Gallery Extended.

Please get a subscription if you need support. Feel free to use the ticket system or the contact form for reporting defects or pre-sale questions. Make sure you're logged in in order to be able to create a new ticket.

For general information you can also jump to the manual.

Subscribe now!

#2580 Ideas to apply user restriction access to events

Posted in ‘Event Gallery Extended’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by sbluege on Thursday, 02 March 2017 21:37 UTC

jonikaites
 Hello .. Good evening.

I have two problems:

First, I need to create a link called "my events" in the main menu, which when the user accesses, only view the events that he has access to. I made an event with a defined group, but when I log in with a user that is not part of that group, the event appears to me in this list (event - list menu). When I access this event, then the system gives a message that I do not have permissions. I would like events that were not in my group not to appear in the listing.

Second, I would like to see if this is possible: I made a gallery, I defined a group to access it and a password. The idea is that when creating the event, a group with the same name of the event is created so that when the user receives the link to access the gallery (mysite.com/mymenu/event/nameofmyevent), if it is logged in, Request the event password. If it is not logged in, then it logs into the site, logs in and then enters the page asking for the event password (this breadcrumbs already exists, even for a non-group user). If the user has the link to access the event and has the password, he can see the event. The step would be that after it enters the password, if it is not part of the group defined in the event, then it is added to this group, through the command JUserHelper :: addUserToGroup ($ user_id, $ group_id);

Sorry for the horrible translation of Google Translator. I'm Brazilian and I do not write English very well.

sbluege
Hi,

1)

did you tried to use the component option to hide events? The option is names "Show User Group Specific Events in List"
https://www.svenbluege.de/joomla-event-gallery/event-gallery-manual/configuration-option#general

2)

That is not possible. You want to assign all user groups to a user so he does not has to enter the password again, right? What about a plain password link? That already works so you can send over a link which provides direct access. Of course the user has to enter the password again if his session expires.

jonikaites
1) The value in my site is "On", but the events still appears in event list for not authorized users.

2)

In my head, I wanted to create a group of users for each event, so if the user opens the event, he knows the password, it means that he can access that event. If the user who entered the password is not in the user group for that event, then he is added to the user group (if he knows the password, he can see the photos). This will also allow the list of "my events" to show only the events that it belongs to the user group. The main purpose is to allow any user to register, access the link, type the password and then be part of that group of users and then be able to see their events.

The reason is that I have for example a client that is in more than 5 events today: one of the photos of the gestation party (where she has more than 20 friends who also want to buy the photos), one of the photos of pregnant (She has her, her father and mother and the godfather of the baptism), one of the baptized photos (where she has her, her father and mother, two aunts, and the godfather of the Baptism), and a wedding that she was godmother and wants to see the photos to be able to buy the ones she liked.

This scenario is repeated with at least 6 clients. If everyone has their "my events" menu, and to add the events in this menu simply access them with the password, it would be perfect, as it allows any client at any time to create their user and choose their photos, without depending on I create the users manually and add them to a user group.

Another feature is that if the logged-in user is part of the user's group of the event, it does not need to enter the password.

sbluege
1) what about setting the value to "no". This would hide events where the current user is not in a matching user group

2) I get that use case. I don't want to make any promises here since this feature is kind of very special. Did you thought about a "user group managing"-component which might be able to handle that assignment stuff? I'm not aware of any but on the other hand I did not searched for one so far. In the end such a component just needs to be able to assign users to a user group by a special link.

3) I don't get why one wants to protect an event with both a password and a user group. The password would be useless in this case since the user can't enter a password for something he can't see. If one does not combine password and user group this already works.

jonikaites
The idea of ​​the password is because until I pass the link to the client, I do not know which users will have access to that event. It can be 1 client as can be 30 clients (in the case of a graduation, for example), with each client making an independent request for revelation, digital download or album. The password would only allow anyone who actually has access to that event to see it, and prevent people who can not see the photos, see them.

I have not thoroughly researched this demand, as I am finishing layout and CSS adjustments, and for now I would use the system by registering user groups and users manually, but in the long run this may take more time than necessary . I researched google superficially how to create groups via source code and assign users to groups, apparently it would be easy to do and just create some options in the component configuration menu to activate this rule. My plans would be to apply these changes after finishing the translations into Portuguese (Brazil) and the CSS and layout adjustments.

I like these two links:
http://joomla.stackexchange.com/questions/17606/how-to-create-user-group-programmatically/17607

https://docs.joomla.org/API16:JUserHelper/addUserToGroup

sbluege
You can try to do this :) But I recommend to not touch Event Gallery for this. You would not be able to install updates any longer. I suggest to create a dedicated component for this which can:

- create/delete user groups for events as a batch operation including the assignment
- assign users to a user group based on a link
- create those assignment links
- handle the additional password magic

Having this should do the trick. There is already a small component in the download section which allows to show an event by just entering a password in a field. Your component is just a little bit more complicated.

jonikaites
Your idea is good. Create a component or plugin that using cron check and create user groups already partially solves the problem.

As for the updates, I will document the files that I will change and when there are updates, manually change these files.

Do you have any suggestions for what to do to assign the user to the user group? All the ways I thought of doing involve involving changing the source of the component.

sbluege
As I said, you don't need to touch Event Gallery. I'm pretty sure you don't want to apply those changes manually with every update.

You component can create a link like https://foo.com/your_component/assign?token=foobar by creating a random password, a token and saving that together with the user group to the database.

This link opens a page where a user enters a password. You can use the token and the password to check a database table. If both match you assign the user to a user group defined by the given token.