| 1 |
<?php |
<?php |
| 2 |
// $Id: notify.module,v 2.68.2.13 2008/12/17 22:00:06 matt2000 Exp $ |
// $Id: notify.module,v 2.74 2009/02/03 01:52:57 matt2000 Exp $ |
| 3 |
|
|
| 4 |
define('NOTIFY_NODE_TYPE', 'notify_node_type_'); |
define('NOTIFY_NODE_TYPE', 'notify_node_type_'); |
| 5 |
|
|
| 185 |
'title' => 'Notification settings', |
'title' => 'Notification settings', |
| 186 |
'page callback' => 'drupal_get_form', |
'page callback' => 'drupal_get_form', |
| 187 |
'page arguments' => array('notify_user_settings_form', 1), |
'page arguments' => array('notify_user_settings_form', 1), |
| 188 |
'access callback' => 'user_access', |
'access callback' => 'notify_user_access', |
| 189 |
'access arguments' => array('access notify'), |
'access arguments' => array(1), |
| 190 |
'type' => MENU_LOCAL_TASK |
'type' => MENU_LOCAL_TASK |
| 191 |
); |
); |
| 192 |
$items['admin/user/user/notify'] = array( |
$items['admin/user/user/notify'] = array( |
| 200 |
|
|
| 201 |
return $items; |
return $items; |
| 202 |
} |
} |
| 203 |
|
|
| 204 |
|
/** |
| 205 |
|
* Checks access to notifications settings tab |
| 206 |
|
*/ |
| 207 |
|
function notify_user_access($account = NULL) |
| 208 |
|
{ |
| 209 |
|
return $account->uid && |
| 210 |
|
( |
| 211 |
|
// Always let users view their own profile. |
| 212 |
|
($GLOBALS['user']->uid == $account->uid && user_access('access notify')) || |
| 213 |
|
// Administrators can view all accounts. |
| 214 |
|
user_access('administer notify') |
| 215 |
|
); |
| 216 |
|
} |
| 217 |
|
|
| 218 |
/** |
/** |
| 219 |
* Register the themeing the form data into a table at |
* Register the themeing the form data into a table at |
| 220 |
* admin/user/user/notify |
* admin/user/user/notify |
| 234 |
*/ |
*/ |
| 235 |
function notify_user_settings_form(&$form_state, $arg) { |
function notify_user_settings_form(&$form_state, $arg) { |
| 236 |
global $user; |
global $user; |
| 237 |
if ($user->uid != $arg->uid && $user->uid != 1) { |
if ($user->uid != $arg->uid && !user_access('administer notify') ) { |
| 238 |
drupal_access_denied(); |
drupal_access_denied(); |
| 239 |
return; |
return; |
| 240 |
} |
} |