CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • "Website Profile" link on search page...what triggers it?
Pages: [1]

Author Topic: "Website Profile" link on search page...what triggers it?  (Read 2820 times)

ccweaver

  • Guest
"Website Profile" link on search page...what triggers it?
July 10, 2007, 07:09:28 pm
So, I'm trying to properly trigger the "Website Profile" link on search pages for authenticated users. However, I can only seem to have it show up when, in the CiviCRM ACL permissions, I allow "Athenticated Users" to "edit" "group" data. But, I don't want authenticated users to be able to edit data, I just want them to be able to view the profile link (setting it to "view" instead of "edit" doesn't work).

Any ideas what's going on or how to get this to work properly?

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: "Website Profile" link on search page...what triggers it?
July 11, 2007, 01:13:25 am
In profile search listing edit link is optional. We show edit link on if it is selected for that particular profile.

Check : CiviCRM Profile  Your Profile ->Settings - Advanced Settings >> Include profile link.

kurund
Found this reply helpful? Support CiviCRM

ccweaver

  • Guest
Re: "Website Profile" link on search page...what triggers it?
July 11, 2007, 04:58:53 am
Right...but even when that option is enabled (which it was in my system), the link still won't appear unless I have the edit contacts permission set to true for authenticated users. Any idea what's going on?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: "Website Profile" link on search page...what triggers it?
July 11, 2007, 10:17:41 am
I've tested this functionality on the 1.7 demo quite a bit - and it's working as expected. The display of the "Website Profile" link works for both authenticated and anonymous users:

http://demo.civicrm.org/drupal/civicrm/profile?gid=1&reset=1

I created a separate login for you to use that is only assigned the default Authenticated User role - and this login both gives you the Website Profile link as well as allows you to navigate to the Drupal user profile pages from those links.

User = authuser
PW = authuser

Note that you must check the "access user profiles" permission under Drupal Access Control - or you get Access Denied page. (A side note is that Drupal apparently gives non-admin users a "Page not Found" error if they try to view the user profile page for a user who has never logged in. (For example, this link from the profile listings: http://demo.civicrm.org/drupal/user/111 )

Please see if you can recreate the problem you're experiencing on the demo site - and if so, post an issue on the bug tracker with exact steps to replicate it.
Protect your investment in CiviCRM by  becoming a Member!

ccweaver

  • Guest
Re: "Website Profile" link on search page...what triggers it?
July 11, 2007, 11:02:25 am
I can't seem to reproduce the errors on the online site you gave me. I followed your directions on my own site (authenticated users can "access user profiles", the profile search I'm doing has the "website profile link" enabled), and still nothing. That link will not pop up unless I add ACL rules to allow authenticated users to edit contacts...or unless, in drupal's access control, I allow authenticated users to edit contacts.

Could it be possible that, somehow, my civicrm installation didn't go as planned and some connections are backwards are something? Because this isn't the only problem that I've had about features that doesn't work properly on my installation.


I wanted to try to reinstall civicrm. However, the site won't properly run the data backup (in fact, your demo site doesn't run it correctly either). The backup produced is a gz file of a sql file. But when I try to open it up and look at the sql, I get a message saying that the file is corrupt or something. Any ideas what's going on with that issue too?

ccweaver

  • Guest
Re: "Website Profile" link on search page...what triggers it?
July 11, 2007, 12:15:28 pm
---MAJOR UPDATE---


Alright, so, I went through the core to find out what's going on and pinpointed what I think is the problem area.

In Action.php (\crm\core\action.php), line 246, there's the mask function.

The mask works with the self::permission_variables (i.e. self::EXPORT, self::PROFILE, self::MAP, etc)

Notice how in line 248, even when the user is granted the "view" permission, "self::PROFILE" is not added to that. But in line 249/250, if the user is granted the "edit" permission, "self::MAX_ACTION" is applied to the user, which grants him the right to view the website profile (along with all the other permissions that I don't want to grant the user)

I traced all the way through the code here. The "View website profile" option is working properly, but when it hits the mask function for permissions, the lack of "self::PROFILE" here knocks out the ability to view the website profile. When I add in "self::PROFILE" onto the end of line 248 (under the view permission mask specification), then the link will properly.


So, is this a bug or what's going on here? And why doesn't the demo version of your install have this same problem?

Thanks so much for your help.

 - Cyrus

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: "Website Profile" link on search page...what triggers it?
July 24, 2007, 12:49:40 pm
What your CiviCRM v1.7 rev ? 

Demo http://demo.civicrm.org/drupal/civicrm/dashboard?reset=1 is running on rev 10206.

Lets chat on IRC channel, it will be faster to debug and solve. (ping dlobo or kurund )

kurund
Found this reply helpful? Support CiviCRM

greenmachine

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 6
Re: "Website Profile" link on search page...what triggers it?
August 23, 2007, 12:31:08 pm
I am getting the same behavior as reported by ccweaver, except on CiviCRM 1.8.10954. Changing line 264 of the file mentioned (action.php) from:

Code: [Select]
return CRM_CORE_ACTION_VIEW| CRM_CORE_ACTION_EXPORT| CRM_CORE_ACTION_BASIC| CRM_CORE_ACTION_ADVANCED| CRM_CORE_ACTION_BROWSE| CRM_CORE_ACTION_MAP;

to

Code: [Select]
return CRM_CORE_ACTION_VIEW| CRM_CORE_ACTION_EXPORT| CRM_CORE_ACTION_BASIC| CRM_CORE_ACTION_ADVANCED| CRM_CORE_ACTION_BROWSE| CRM_CORE_ACTION_MAP| CRM_CORE_ACTION_PROFILE;
Makes the "Website profile" links available to Drupal users who have both the Drupal "view user profiles" permission, the Drupal/CiviCRM "view profile listings and forms" permission, and for good measure a CiviCRM ACL to "view" the CiviCRM Profile in question. The "show Drupal user profile link" option is turned on for the profile.

If I don't make that change, then the "Website profile" links do not show up for those users.

Is there any negative consequences to adding CRM_CORE_ACTION_PROFILE to the "view" permission mask? Kurund/ccweaver, was there any resolution to the discrepancy between ccweaver's install and the CiviCRM demo?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: "Website Profile" link on search page...what triggers it?
August 23, 2007, 02:18:22 pm

I looked at the code and am not very sure how and why demo works :(

Can you please file an issue against 1.8 and we'll take a look and review the code etc

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: "Website Profile" link on search page...what triggers it?
August 26, 2007, 01:51:08 am

Kurund was nice enough to file an issue for this. This is now fixed and will be part of the next 1.8 release

http://issues.civicrm.org/jira/browse/CRM-2235

The reason it works on demo is because the demo user has "edit all contacts" permission, which gives the demo user the all privileges permission

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • "Website Profile" link on search page...what triggers it?

This forum was archived on 2017-11-26.