Hi,

Awesome module!... :)

1) IMO the admin should be exempt from the T&C and shouldn't be displayed in its profile?

I did this for now:

.page-user-1 fieldset#edit-legal {
	display:none;
}

2) The "Scroll Box" should also be used inside the Edit page of the profile.

Comments

Vc Developer’s picture

Issue summary: View changes

additional info.

Vc Developer’s picture

Issue summary: View changes

more info..

dev18.addweb’s picture

Issue summary: View changes
StatusFileSize
new959 bytes
new60.96 KB
new84.39 KB

PFA patch for your solution.

dev18.addweb’s picture

Status: Active » Needs review
abarpetia’s picture

Attached patch in #1, hided T&C block from all user profile. In the if condition, $user->roles look for the current logged in users (in this case admin) but admin also has access to edit all other users profile. So, if admin access any other user profile this code hide T&C block from that profile.

I have attached the updated patch which check for individual accounts rather than logged in user.

safallia joseph’s picture

The patch in #3 hardcodes the user role, there are chances that other user roles gets permission to edit user profile, in that case terms and conditions does not needs to be displayed. The attached patch provides a settings option to set user roles to which the terms and conditions needs to be unset and for those user roles the T&C will not be displayed.

riddhi.addweb’s picture

Status: Needs review » Needs work
StatusFileSize
new73.54 KB

There is warning when module is enabled & we redirect to module configuration page: “Warning: Invalid argument supplied for foreach() in form_type_checkboxes_value() (line 2390 of /home/r17yu/www/includes/form.inc).”

There is also an issue: if "authenticated user" is check from "Except legal" block and I edit that user with admin login, then terms & condition block is displayed, which should ideally be hidden. However it is hidden when I check by loggin in with "authenticated user".

PFA screenshot.

  • Robert Castelo committed 7d03ef6 on 7.x-1.x
    Issue #1703336 by naresh.addweb, abarpetia, Safallia Joseph, Jigar....
Reuben Unruh’s picture

Status: Needs work » Needs review
StatusFileSize
new2.53 KB
  • Rerolled the patch from #4 since the dev branch has been updated and now exempts user 1 from T&C
  • ... But changes the language on the config page from 'Except' to 'Exempt' to match the feature request
  • Fixes errors when no exempt roles have been chosen #5
  • Removes the T&C based on whether the account being viewed is exempt rather than whether the current user is exempt #5
abarpetia’s picture

I am not sure but from #6 seems this issue is already fixed for user 1.

Reuben Unruh’s picture

StatusFileSize
new2.75 KB
new2.9 KB

@abarpetia, you are correct. The current dev version exempts user 1 from T&C. The patches in this issue either exempt anyone with the administrator role or allow a choice of which roles are exempt.

Also in the current dev version is a new config tab. This patch is the same as #7 but it moves the configuration to the config tab. This way, you can change which roles are exempt without increasing the T&C version and forcing everyone to re-sign the same document.

Reuben Unruh’s picture

StatusFileSize
new3.45 KB
new2.63 KB

The previous patch only hides T&C on the profile edit form. New users will still see the T&C page that comes up at log in.

This patch checks for exempt users at login.

Reuben Unruh’s picture

StatusFileSize
new3.38 KB
new475 bytes

Fixes a bad comment in #10

  • Robert Castelo committed 7d03ef6 on legal_admin_exempt-1703336-11.patch
    Issue #1703336 by naresh.addweb, abarpetia, Safallia Joseph, Jigar....
  • Robert Castelo committed 0be8ac0 on legal_admin_exempt-1703336-11.patch
    Issue #1703336 by Reuben Unruh, naresh.addweb, Safallia Joseph: Admin...

  • Robert Castelo committed 0be8ac0 on 7.x-1.x
    Issue #1703336 by Reuben Unruh, naresh.addweb, Safallia Joseph: Admin...
robert castelo’s picture

Status: Needs review » Fixed

Reuben Unruh thanks for improving on this feature!

I'm committing it to the 7.x-1.x-dev branch.

Made a small adjustment to exclude Anonymous and Authenticated from the choice of roles as they would make the option confusing ;-)

robert castelo’s picture

I also just made another amendment that will affect this feature:

* Namespaced the variable to begin with 'legal_' to avoid clashes with other modules
* Unset the variable in module uninstal function

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

smitty’s picture

Unfortunately, this seems not to work. In my case, the admin (uid=1) is asked to accept the new version of the terms ...

It seems that $account->uid in function legal_user_is_exempt is not an integer (don't ask me why).

When I change

if ($account->uid === 1) {

to

if ((int) $account->uid === 1) {

or to

if ((int) $account->uid == 1) {

everything is fine.