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.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | interdiff.txt | 475 bytes | Reuben Unruh |
| #11 | legal_admin_exempt-1703336-11.patch | 3.38 KB | Reuben Unruh |
| #10 | interdiff.txt | 2.63 KB | Reuben Unruh |
| #10 | legal_admin_exempt-1703336-10.patch | 3.45 KB | Reuben Unruh |
| #9 | interdiff.txt | 2.9 KB | Reuben Unruh |
Comments
Comment #0.0
Vc Developer commentedadditional info.
Comment #0.1
Vc Developer commentedmore info..
Comment #1
dev18.addweb commentedPFA patch for your solution.
Comment #2
dev18.addweb commentedComment #3
abarpetia commentedAttached 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.
Comment #4
safallia joseph commentedThe 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.
Comment #5
riddhi.addweb commentedThere 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.
Comment #7
Reuben Unruh commentedComment #8
abarpetia commentedI am not sure but from #6 seems this issue is already fixed for user 1.
Comment #9
Reuben Unruh commented@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.
Comment #10
Reuben Unruh commentedThe 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.
Comment #11
Reuben Unruh commentedFixes a bad comment in #10
Comment #14
robert castelo commentedReuben 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 ;-)
Comment #15
robert castelo commentedI 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
Comment #17
smitty commentedUnfortunately, 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.