user_pic_perm.info
; $Id: user_pic_perm.info,v 1.2 2009/08/13 17:29:33 mtndan Exp $
name = User Picture Access
description = Allows setting permissions for users to add/change/delete pictures in user profiles.
core = 7.x
; Information added by drupal.org packaging script on 2009-08-13
version = "7.x-1.0"
core = "7.x"
project = "user_pic_perm"
datestamp = "1250186826"
user_pic_perm.module
<?php
// $Id: user_pic_perm.module,v 1.2 2009/08/13 17:29:33 mtndan Exp $
/**
* @file
* Allows setting permissions for users to add/change/delete
* pictures in user profiles.
*/
/**
* Implementation of hook_permission().
* Add access permission for administering user's picture
*/
function user_pic_perm_permission() {
return array(
'administer user pictures' => array(
'title' => t('Administer user pictures'),
'description' => t('Allow administration of user profile pictures'),
),
);
}
/**
* Implementation of hook_form_alter().
* Remove user picture field if user doesn't have correct permission
*/
function user_pic_perm_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'user_profile_form' && user_access('administer user pictures') == FALSE) {
$form['picture'] = FALSE;
}
}
Comments
Comment #1
star-szrThanks @kylebcooke! I would use this instead though:
@mtndan - I'd be willing to help maintain this module and release a 7.x version.
Comment #2
arnaud.dabouis commentedUpdated your version by splitting permissions to add /edit. Tarball attached.
A 7.x release would be nice.
Comment #3
arnaud.dabouis commentedI added a new permission to view the user picture, and compatibility with the User Picture Field module.
Comment #4
arnaud.dabouis commentedTarball attached.
Comment #5
arnaud.dabouis commentedComment #6
arnaud.dabouis commentedComment #7
arnaud.dabouis commentedAdded a wrapper around the rendered image to make theming easier.
Comment #8
arnaud.dabouis commentedComment #9
mtndan commentedSorry for the delayed response all. I will get a 7.x branch setup this evening.
Comment #10
mtndan commentedHi all. Sorry for dropping off the face of the Earth! I have created and pushed a 7.x branch. Any requests for collaboration will be appreciated!
Comment #11
mtndan commentedComment #12
star-szrThanks @mtndan, I am no longer available to help maintain this module but happy to see the activity here :)
Comment #13
arnaud.dabouis commentedI am currently actively working on this module, if you gave me access to the git repository I could push my work in progress to the 7.x branch.
Thanks in advance.
Comment #14
arnaud.dabouis commentedComment #15
sense-designCould you publish the DEV-Version to the project page for downloading or maybe publish a 7.x-1.0 stable version?