Support

  1. kennethefford
  2. General
  3. Wednesday, February 26 2014, 05:42 AM
Hi,

I am wondering if there is a way to manage user access privileges using EasyProfile. I am wanting to include a new group under EasyProfile called MyAccess under which the current access the user has is displayed along with a means be which he can easily request or activate additional access privileges. I am thinking this must be possible for this product, but I am finding the documentation to be very light, or should I say non existent.

On my site I am managing additional access levels like these, Administrator, Buyer, Seller, and Subscriber, over and above the normal access levels. These have very specific access privileges and I would like to inform the user of his current access privileges in the Profile (where I think it makes perfect sense to) as well as allow him to activate, request or otherwise obtain additional access privileges. Additional access may require approval from an administrator or simply he review and accept an additional Terms of Use agreement.

I am really open to ideas and hope to implement the best way possible for the users. Any suggestions you can offer me would be greatly appreciated and welcome. I would think this is a question you may have seen a few times before based on the kind of product you have in EasyProfile.

Sincerely,

Ken
admin Accepted Answer
Admin
Hi,

Display current access information
to display current access privileges you can use the delimiter field:
example:
- Create a delimiter field with Buyer access, insert in description you text or image for Buyer
- Create a delimiter field with Seller access, insert in description you text or image for Seller
- .......

Allow user to manage their access
You can create a speficic plugin to do this:
- Create a field of with this parameter:
title: Access Request
alias: accessrequest
type: Select
option:
buyer|Buyer
seller|Seller (require approval)

- go to our documentation at http://www.easy-profile.com/docs/44-triggers.html and download skeleton plugin
- Install and enable it
- edit /plugins/jsn/skeleton/skeleton.php
delete triggerFieldAvatarUpdate function
delete triggerProfileUpdate function
add this function:
public function triggerFieldAccessrequestUpdate($user,$data,$changed,$isNew)
{
$app=JFactory::getApplication();
// Buyer not require approval
if($data['accessrequest']=='buyer')
{
JUserHelper::addUserToGroup($user->id,3); // 3 is Id of group
$app->enqueueMessage('Now you are Buyer','warning'); // Message to display after save
}

// Seller require approval
if($data['accessrequest']=='seller')
{
JFactory::getMailer()->sendMail(
$user->email, // Sender Mail
$user->name, // Sender Name
'administrator_mail@domain.com', // Receiver Mail
'Request Seller', // Subject Mail
$user->name.' asks to become a Seller' // Body Mail
);
$app->enqueueMessage('Your request is pending approval','warning'); // Message to display after save
}
}


With this plugin:
- if user select 'Buyer' go in group 3
- If user select 'Seller' send email to administrator_mail@domain.com with request to became seller
  1. more than a month ago
  2. General
  3. # 1
kennethefford Accepted Answer
Pro
Content Protected
  1. more than a month ago
  2. General
  3. # 2
kennethefford Accepted Answer
Pro
Content Protected
  1. more than a month ago
  2. General
  3. # 3
admin Accepted Answer
Admin
Hi,
sorry for late reply,

I do not know if I understand.:(

if you want Terms of use on request do this
- create a field with this parameter:
title: Terms of request
type: checkbox
options:
1|Accept
set Required on yes
- create a field with this parameter
type: delimeter
title: Terms of use rule
description: insert your terms of use
- Set condition for access request field
if equal to custom value (leave empty custom value) hide Terms of request,and Terms of use rule fields

Now when user choose request the fields for terms are visible.

When user send request the field access request and Term of request must be initialized, So add this to the end of function triggerFieldAccessrequestUpdate of plugin skeleton:
$data('accessrequest')='';
$data('alias_of_term_of_request')='';


Does EasyProfile support a button field

If you want add button you can add a delimiter field with your code (or link).
  1. more than a month ago
  2. General
  3. # 4
kennethefford Accepted Answer
Pro
Content Protected
  1. more than a month ago
  2. General
  3. # 5
admin Accepted Answer
Admin
Hi,
sorry for late reply, it was night for us.

Delimeter fields not hiding because there is a small bug.

in file /administrator/components/com_jsn/models/fields/delimeter.php at line 49 replace this:
$html[] = $text;

with this
$html[] = '<div id="'.$this->id.'" >';
$html[] = $text;
$html[] = '</div>';


We will fix in the next release.
  1. more than a month ago
  2. General
  3. # 6
kennethefford Accepted Answer
Pro
Content Protected
  1. more than a month ago
  2. General
  3. # 7
admin Accepted Answer
Admin
Sorry
the correct is:
$data['accessrequest']='';
$data['alias_of_term_of_request']='';


replace ( with [
  1. more than a month ago
  2. General
  3. # 8
kennethefford Accepted Answer
Pro
If i disable the first only the second then causes the same crash. I put them at the end of the function you said, but made sure they were inside the function. That is what I interpreted your message to mean.

Ken
  1. more than a month ago
  2. General
  3. # 9
kennethefford Accepted Answer
Pro
Another question, with all the delimiter fields the layout looks quite bad. Is there a way to reduce the space between delimiter fields?

Ken
  1. more than a month ago
  2. General
  3. # 10
kennethefford Accepted Answer
Pro
Thanks, for the correction. That works much better. No problem.

Ken
  1. more than a month ago
  2. General
  3. # 11
kennethefford Accepted Answer
Pro
Let me re-state my other question. With all the delimiter fields the layout looks quite bad. Is there a way to reduce the space between delimiter fields? Also, the delimiter fields show up on the profile as having "no information entered", when there is no place to enter info. Is there a way to get rid of the indicator about value and just show the title?

Ken
  1. more than a month ago
  2. General
  3. # 12
admin Accepted Answer
Admin
Is there a way to reduce the space between delimiter fields?

Yes with some css line.

Send me your site url, we can help you. But tomorrow. It's night for us.
  1. more than a month ago
  2. General
  3. # 13
kennethefford Accepted Answer
Pro
Wait, I suppose i could just enter a NULL or a space!
  1. more than a month ago
  2. General
  3. # 14
kennethefford Accepted Answer
Pro
Tomorrow is fine. I will try some other things and send site details later. What details you need?
  1. more than a month ago
  2. General
  3. # 15
kennethefford Accepted Answer
Pro
Actually, let me leave the spacing for now and get everything else done the way I want. Then we can adjust spacing when all else is done, if needed. Thanks.

Ken
  1. more than a month ago
  2. General
  3. # 16
admin Accepted Answer
Admin
no problem!
if you need support for the layout, just send me only the url of your site via private message.
  1. more than a month ago
  2. General
  3. # 17
kennethefford Accepted Answer
Pro
Content Protected
  1. more than a month ago
  2. General
  3. # 18
admin Accepted Answer
Admin
None of the fields are hiding

Because condition have to way (if condition is respect hide else show
You can work with not equal condition.
example:
select have this option
1|Seller
2|buyer
set condition 1
if select not equal to custom value 1 hide Seller Fields
set condition 2
if select not equal to custom value 2 hide Buyer Fields

Now if select is empty all condition are respected and hide Seller and Buyer Fields

I am also noticing now that I am getting randomly logged out, after logging in

Not is Easy Profile. the login process is the same of joomla.

the accessrequest field is NOT empty

the last two line that i send you not works, we have released 1.1.6 to fix this issue. But you must reset this field on user that have choose access request field.

EasyProfile is far from easy

I do not agree!
We're trying to help you to make Easy Profile as Form request component. Easy Profile is not made for this
  1. more than a month ago
  2. General
  3. # 19
kennethefford Accepted Answer
Pro
Also, how do I get rid of the "no information entered" being displayed on the profile for a delimiter field? there is no information to enter for a delimiter field, why is this even there?

Ken
  1. more than a month ago
  2. General
  3. # 20
admin Accepted Answer
Admin
Have you set description for delimeter?
  1. more than a month ago
  2. General
  3. # 21
kennethefford Accepted Answer
Pro
Content Protected
  1. more than a month ago
  2. General
  3. # 22
admin Accepted Answer
Admin
Delimeter field show html code in description(editor). Probably you have not set description
  1. more than a month ago
  2. General
  3. # 23
admin Accepted Answer
Admin
the English is too broken to follow

Yes, sorry here are the 20:40 and my office is closed. I write from a smartphone.
The access request field don't reset because before version 1.1.6 the $data var is passed by value not by reference.
Now. You have some user with access request field set to some value. You must manually reset this value for this users.
---------
The conditions are all performed:

example of wrong configuration
select have this option
1|Seller
2|Buyer
set condition 1
if select equal to custom value 1 hide Buyer Fields
set condition 2
if select equal to custom value 2 hide Seller Fields
set condition 3
if select equal to custom value empty hide Seller and Buyer Fields

Now if select value is equal to 1 this happens:
Condition 1 hide Buyer Field
Condition 2 show Seller
Condition 3 show Seller and Buyer
----------
We know that the conditions are not perfect, in fact we wrote in the features list: Basic Conditions
----------
Another way to use the condition is to create hidden fields:
Create hidden field with default value set to 1
and condition 1: if hidden equal to accessrequest select hide Buyer fields
Create hidden field with default value set to 2
and condition 1: if hidden equal to accessrequest select hide Select fields
in accessrequest select set condition 1: if equal to custom value empty hide Seller and Buyer Fields

Now if select value is equal to 1 this happens:
condition of hidden 1 hide Buyer fields
condition of hidden 2 do nothing
condition of select do nothing
The result is that are show only Seller fields
  1. more than a month ago
  2. General
  3. # 24
kennethefford Accepted Answer
Pro
Thanks, for the reply, sorry for the lateness. I will respond with some things and please these can wait until tomorrow.

No, I have not currently got anything set for the description. I tried setting it to something that will not show, like a space, but that did not work. It is a delimiter, which by definition is a separator, something used only to show division between elements.

What can I put in the description that will both NOT show in the profile page and prevent the "no information entered" from showing? If I can do that then problem solved.

Ken
  1. more than a month ago
  2. General
  3. # 25
kennethefford Accepted Answer
Pro
regarding the explanation as to how the conditions work, thanks for that. This should enable me to get this working how I need it.

Honestly, with how you have described conditions operation, why even have more than one condition for each field? It could only be useful in the rare case where you might need more than one completely independent condition, never referencing the same fields.

Anyway, I will try the hidden fields and following your summary I am sure it will work and solve the problem. Thanks.

Sorry, but I am not trying to be difficult or critical, I am only trying to get to the end result. How this is structured in code is quite strange for me. But I am sure I can get it to work as required, now that I know.

Ken
  1. more than a month ago
  2. General
  3. # 26
admin Accepted Answer
Admin
For "delimeter" you're right, we have taken this terminology from Community Builder.

Solution 1
Add in description this code: <p style="display: none;">---</p>

Solution 2
Copy name of field in description and set hide title parameter to yes

Solution 3
Use css to hide the message

Conditions example of usage 1
Select called how many pets with this option:
1|1 pet
2|2 pets
3|3 pets
Conditions
If this field > 0 show name of first pet
If this field > 1 show name of second pet
If this > 2 show name...

Condition example of usage 2
Select with this option:
1|val 1
2|val 2
32| val 3
13|val 4
Conditions
If select contain 1 hide field 1
If select contain 2 hide field 2
If select .....
You can set the fields to hide by value of option
  1. more than a month ago
  2. General
  3. # 27
kennethefford Accepted Answer
Pro
Content Protected
  1. more than a month ago
  2. General
  3. # 28
kennethefford Accepted Answer
Pro
Ok, on the hunch that order perhaps affects the logic I tested the affect of order. It clearly does affect the logic, which again make absolutely no sense. Why on earth would order matter?

With what I described above in my earlier post, that was with the hidden field below the selector. When i select the buyer in the selector it then hides the seller and displays the buyer. Ok, for when a selection is made, but wrong when no selector is made.

When I move the hidden field above the selector, the page loads correctly with all fields hidden as expected. But when I select option 1 it shows both buyer and seller fields. I get that from the perspective of the selector (no longer empty so all should unhide). But it is like the hidden field isn't even checked. It has default of 1 and should hide seller fields. Why does it not?

Ken
  1. more than a month ago
  2. General
  3. # 29
admin Accepted Answer
Admin
Unfortunately I can not tell you what does not work without seeing.

1. Post me your site details with admin credentials (you can use the form below in Site Details tab).
2. Describe what you would like them to do with the conditions.
3. We do for you ;)
4. After the surgery I'll explain what I've done

But, we will work on Monday.
  1. more than a month ago
  2. General
  3. # 30
kennethefford Accepted Answer
Pro
Content Protected
  1. more than a month ago
  2. General
  3. # 31
admin Accepted Answer
Admin
The order is the same of fields.

Why not use what I wrote earlier?
You can work with not equal condition.
example:
select have this option
1|Seller
2|buyer
set condition 1
if select not equal to custom value 1 hide Seller Fields
set condition 2
if select not equal to custom value 2 hide Buyer Fields


try it at http://j32.easy-profile.com/index.php/component/users/?view=registration
  1. more than a month ago
  2. General
  3. # 32
admin Accepted Answer
Admin
I am not convinced what you wrote

a selector field with options 1|Buyer, 2|Seller and 3|Subscriber
this field has condition 1 set to hide both buyer and seller fields (4x fields in total) if selector is empty. This works fine by itself.

I also have a hidden field with default value=1 and condition 1 set to hide only the seller fields if equal to the selector field. I am thinking this should leave the buyer fields as the only thing visible when I choose option=1 in the selector for requesting Buyer access . Well no, only the seller fields are shown, and this makes absolutely no sense. Why? How does the logic of these conditions equate to Seller being visible?

Strange... or your error or bug...but i need to investigate

When I move the hidden field above the selector, the page loads correctly with all fields hidden as expected. But when I select option 1 it shows both buyer and seller fields.

It's ok, condition on select show all fields if not empty.
  1. more than a month ago
  2. General
  3. # 33
kennethefford Accepted Answer
Pro
Yes, I get that because of the selector setting all fields should UNHIDE, and it does. But what about the hidden field, why is that ignored? if you read my message I stated that both scenarios (hidden field above and hidden field below) work in one of the two states (empty selector or selector=1), but not both. They should work in both if there is any hope for this.

Honestly, I never tried the NOT EQUAL option only because your suggestion of the hidden field made more sense to me and I do not have endless hours to test multiple options for simple functions that should be working reliably, no matter which option is used. No product should ever require this level of massaging and tweaking to get working how it is supposed to.

I will try the NOT EQUAL, but after that I am done spending time on this. If I cannot get it to work reliably I will continue to use the SocialConnect, that seems to work great, but I will switch to RSForms or another profile product. Sorry, but it really should not be this difficult.

Ken
  1. more than a month ago
  2. General
  3. # 34
kennethefford Accepted Answer
Pro
Ok, thanks, I am having much better luck now. I have it working, for the most part, using the NOT EQUAL suggestion. I have a few more adjustments to make and I will let you know tomorrow if all is good. I think it will yield the results I am seeking.

Ken
  1. more than a month ago
  2. General
  3. # 35
admin Accepted Answer
Admin
a selector field with options 1|Buyer, 2|Seller and 3|Subscriber
this field has condition 1 set to hide both buyer and seller fields (4x fields in total) if selector is empty. This works fine by itself.

I also have a hidden field with default value=1 and condition 1 set to hide only the seller fields if equal to the selector field. I am thinking this should leave the buyer fields as the only thing visible when I choose option=1 in the selector for requesting Buyer access . Well no, only the seller fields are shown, and this makes absolutely no sense. Why? How does the logic of these conditions equate to Seller being visible?

I have tested and for me work! You have made ​​some mistakes

Hidden after Select
On select:
condition 1 if select is empty hide Seller,Buyer,Subscriber fields
On hidden (In demo I use readonly text)
condition 1 if hidden is equal to select hide seller,subscriber fields

Case 1. select is empty
condition 1 on select hide all
condition 1 on hidden show Seller and Subscriber Fields
Result: you have Seller and Subscriber shown

Case 2 select equal to 1
condition 1 on select show all
condition 1 on hidden hide Seller and Subscriber Fields
Result: You have Buyer Field shown

I know that's not good, but it makes sense!
What you described is not correct, maybe you forgot something. See at http://j32.easy-profile.com/index.php/component/users/?view=registration

-------------------------

When I move the hidden field above the selector, the page loads correctly with all fields hidden as expected. But when I select option 1 it shows both buyer and seller fields. I get that from the perspective of the selector (no longer empty so all should unhide). But it is like the hidden field isn't even checked. It has default of 1 and should hide seller fields. Why does it not?


Hidden before Select
On select:
condition 1 if select is empty hide Seller,Buyer,Subscriber fields
On hidden (In demo I use readonly text)
condition 1 if hidden is equal to select hide seller,subscriber fields

Case 1. select is empty
condition 1 on hidden show Seller and Subscriber Fields
condition 1 on select hide all
Result: you have Buyer, Seller and Subscriber hidden

Case 2 select equal to 1
condition 1 on hidden hide Seller and Subscriber Fields
condition 1 on select show all
Result: You have Buyer, Seller and Subscriber shown

I know that's not good, but it makes sense!

-----------------------

For me, it all makes sense.
the only rules that may not be clear is that the conditions are two way.


It seems clear that the conditions order work with the order of the fields.
  1. more than a month ago
  2. General
  3. # 36
kennethefford Accepted Answer
Pro
Hi,

I just wanted to let you know that I have my profile page working now, pretty much the way i wanted, but using the NOT EQUAL conditions as you suggested. Thanks for all your help.

I will get back to you shortly regarding how to decrease the space between delimiter fields, but for now that is not a critical issue and can wait.

As always, your support is top notch!

Sincerely,

Ken
  1. more than a month ago
  2. General
  3. # 37
admin Accepted Answer
Admin
Hi Ken,
we have released new version with Conditions improve!
Now you can choose to show or hide the target fields (not only hide). it should now be easier to understand.

In addition, you can now also choose the user groups in the conditions
  1. more than a month ago
  2. General
  3. # 38
kennethefford Accepted Answer
Pro
Thank you, and i will install and test. As before, should I keep manually re-installing the specific SOCIALCONNECT.PHP you customized for me? Or, were there any changes made in recent releases to that file?

Ken
  1. more than a month ago
  2. General
  3. # 39
admin Accepted Answer
Admin
wait 20 minute, we reloaded the version
  1. more than a month ago
  2. General
  3. # 40
kennethefford Accepted Answer
Pro
Ok, thank you. Again, do I manually copy the custom SocialConnect.PHP file, or not?

Ken
  1. more than a month ago
  2. General
  3. # 41
admin Accepted Answer
Admin
Hi,
Yes, but the 'add to usergroups' feature on social registration will not work.

Tomorrow I will send you a new code.
  1. more than a month ago
  2. General
  3. # 42
kennethefford Accepted Answer
Pro
Ok, as long as I know. Thanks, and I await the new file when ready.

Ken
  1. more than a month ago
  2. General
  3. # 43
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.

Request Support

Support is currently Offline

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.

Guidelines

Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Search Users

Easy Profile® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.