We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Dashboard widget error | Forum

TECHNEO GmbH
TECHNEO GmbH Jan 29 '17

Hello


I have a new widget (text / html) added and under "Visible for user roles"

Only Visible for free account activated. 


Still displayed with GOLD and TEAM.

The Forum post is edited by TECHNEO GmbH Jan 29 '17
Attachments:
  screenshot.png (80Kb)
Darryl B Leader
Darryl B Jan 29 '17
This is curious. Does it do the same with regular widgets, or just the custom html widgets?

I am guessing that the "Gold", and "Team" members have been assigned to that specific role, and as admin, you will probably still be able to see it yourself.
gami
gami Jan 29 '17
I have the same problem. With me also shows with GOLD / VIP members what is meant only for free member


But the problem has been around for ages. Makes no sense free user select and see it all

The Forum post is edited by gami Jan 29 '17
Darryl B Leader
Darryl B Jan 29 '17
I have a thought that with the "Free" role being the Oxwall default role for members that all of the added roles still play off it. I haven't tested it out. My guess is that if you created another role for free members to be assigned to it may work then, but since on sign up everyone gets the default role until they are assigned a new one, that wouldn't help. Unless there was a plugin to automatically assign a role based on account type. That would be the only way I can think of to bypass the default role. Of course this is just a thought.
TECHNEO GmbH
TECHNEO GmbH Jan 29 '17
No, I have tried everything with a test account which is no admin or moderator. I use only the text / HTML widget!
TECHNEO GmbH
TECHNEO GmbH Jan 29 '17
Is not that an error from Oxwall and user roles?
Darryl B Leader
Darryl B Jan 29 '17
Have you tried creating a new role? Say you call it "Basic", and check the box for viewable for that role, and uncheck "Guest","Free", "Gold", and "Team". That would just be to see if the default role is the problem. If it is, the bypassing it by assigning a role by account type could be a solution.
TECHNEO GmbH
TECHNEO GmbH Jan 29 '17

So I have to test a role Basic and a user.

If a user needs to purchase a membership, the check mark will be removed free of charge, as the error will be. Or, the "Basic" role may overlap to prevent the widget from being displayed.


The widget has to check which role the user has and then check if it is activated in the widget.

The Forum post is edited by TECHNEO GmbH Jan 29 '17
Attachments:
  screenshot.png (135Kb)
Darryl B Leader
Darryl B Jan 29 '17
Not sure I'm following the translation. Did adding the additional role prevent the Gold, and Team members from being able to see the widget?
TECHNEO GmbH
TECHNEO GmbH Jan 30 '17
Can not you test it yourself on your system? Everything I test does not work.
Darryl B Leader
Darryl B Jan 30 '17
Just did a check. I added two roles "Basic", and "Gold".
1. If Free is left selected on the widget, everyone can see the widget.
2. In the widget, if I deselect everything but the basic role, only the basic role can see the widget.
3. If I try to view it as a "Gold", I can't see it since the widget is set for "Basic" only.
From all of this it looks like I am right in thinking the default role applies to every registered member, especially since you can't deselect the "Free" role, but only add the user to another role,
The only way I see to get around this is to use account types, and be able to assign a role by account type, but this would need a plugin, or mandatory approval with the admin putting "Free" members in a particular role.
I've seen where there use to be a plugin that did this before my time here, but it has long since been gone.
The Forum post is edited by Darryl B Jan 30 '17
TECHNEO GmbH
TECHNEO GmbH Jan 31 '17
My goal is to create a widget which only the free members can see. But since the Gold and Basic members are still present in Free Rule, it is not.


How do we solve the problem?

The Forum post is edited by TECHNEO GmbH Jan 31 '17
Darryl B Leader
Darryl B Jan 31 '17
The only work around is to set regular members to the "Basic" role. On the custom html widget privacy deselect "Guest", "Free", "Gold", and "Team". Leave only "Basic" selected in the custom html widget. Having the "Free" role at sign up would allow them to see the widget, but the "Gold", and "Team" should not be able to, but new members would have to be assigned to the "Basic" role in order to see the widget.

At present all members carry the "Free" role as registered members. What should happen  when you assign them to another role; it should drip the "Free" role, and just carry the new role that they are assigned to, but I guess the system is designed to allow a member to carry more than one role "i.e. Female, and moderator"
The Forum post is edited by Darryl B Jan 31 '17
TECHNEO GmbH
TECHNEO GmbH Feb 1 '17
This is a good idea, how do I get all the free members in the Basic I have 7000 members! How can I set the new members automatically into the Basic?
Darryl B Leader
Darryl B Feb 1 '17
This is where a plugin is needed, if you aren't using mandatory approval, and set them to the role before approving them.

I am thinking it would have to work off account types. Let's say you set up the following account types.  "Basic", "Gold", and "Team".  These can be anything; even just "Free", and "paid".
And the following roles "Basic", "Gold", and "Team"
A plugin could allow you to assign a role to any of the account types. There is one in the store that allows you to set a role based on gender. It would seem that the Dev would be able to make one to use account type instead of gender.
Darryl B Leader
Darryl B Feb 1 '17
Actually I don't even think now that a plugin will do it since the default role would still remain. I found this post as a work around. It was the same thing I figured out while playing around. You can set "Basic" as the default role, and everyone will be assigned to that role on registration, but to remove that role, you will have to move another role into the default position in admin / users / user roles. When you do that all of the roles can be selected, or deselected when changing the role. Then go back to admin / users / user roles, and drag the role you want to be the default role back to the top position, and click Save at the bottom of the page. This is the only work around that I found. From reading; the role structure in Oxwall is based on each additional role having more permission than the previous one with the initial role having the least permission. It would appear that widget visibility wasn't taken into account.

Maybe the team members will see this, and brainstorm on a better way of dealing with roles, as, I'm sure, most create roles with the same permission as the lesser role with additional permissions. Having to move the default role could pose an issue, if you had someone registering while you were changing the role of another user.

http://www.oxwall.org/forum/topic/7897?page=2#post-39324
The Forum post is edited by Darryl B Feb 1 '17
TECHNEO GmbH
TECHNEO GmbH Feb 2 '17

So all the tests did not work.

If a member buys an account, it still remains in the default rule. The rule that the user has received during registration. So the widget can not work.


One way would be to turn the widget around.

"Only visible at" in "Not visible at"


This means: I select all rules where the widget should not be shown.

Thus, "Free" is not marked - all others like "Gold" or "Team" are marked.

So we can solve the problem.


what do I have to do?

Darryl B Leader
Darryl B Feb 2 '17
There's no easy way. I've even tried using js to change the disabled state of the default role, and can't find a functional method since the form is loaded from a floatbox. There may be a js solution out there to make all of the checkboxes clickable. If there is, you could easily change the roles.
The default role is the only one with a disabled attribute on the input.  I'm no sure why Oxwall set this that way. It would seem they could still have it as default, and still leave it clickable.
Darryl B Leader
Darryl B Feb 4 '17
I have found the file where the default role gets the disabled attribute.

Line 76 in ow_system_plugins/base/components/give_user_role.php

$field->addAttribute('disabled', 'disabled');

If you change it to this $field->addAttribute(' '); The checkbox will be selectable when you go to the users profile to change their role.

Based on this; you should then be able to set "Basic" as the default role, and all new registered members will get that role, and see the widget. Once they upgrade you will simply go to their profile, uncheck the "Basic" role, and check the new role, and click save.

Things to remember.
1. You will need to set dev mode to true in the  inludes / config php file, and refresh a page on your site for the changes to take affect.
2. You will need to apply this after each update since the platform update will overwrite the changes.
TECHNEO GmbH
TECHNEO GmbH Feb 5 '17

So it works great! Widget is no longer displayed. 


1. What happens when a user buys gold is then removed?

2. How does the SQL command look to remove all the gold members' rule free of charge?

3. What happens when the gold ends after 365 days, then the user has to go back to the rule for free.

The Forum post is edited by TECHNEO GmbH Feb 5 '17
Pages: 1 2 »