Commit 471ba40d authored by profix898's avatar profix898

- feature: separate permission to view gallery profiles

parent 1db6ca01
......@@ -5,6 +5,13 @@
* gallery_profile.module
*/
/**
* Implementation of hook_perm().
*/
function gallery_profile_perm() {
return array('access gallery profile');
}
/**
* Implementation of hook_menu().
*/
......@@ -34,7 +41,7 @@ function gallery_profile_menu() {
* Implementation of hook_profile_alter().
*/
function gallery_profile_profile_alter(&$account) {
if (isset($account->content['gallery2'])) {
if (isset($account->content['gallery2']) && user_access('access gallery profile')) {
$profile = &$account->content['gallery2'];
// Set custom title
$profile['#title'] = variable_get('gallery_user_profile_title', 'Gallery2');
......@@ -172,5 +179,5 @@ function _gallery_profile_useralbum($uid) {
$params['link'] = variable_get('gallery_user_profile_useralbum_link', '');
$block = gallery_get_block($params, 'ImageBlock', array('num_cols' => $num_cols));
return $block['content'];
return isset($block['content']) ? $block['content'] : '';
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment