/[drupal]/contributions/modules/notify/notify.module
ViewVC logotype

Diff of /contributions/modules/notify/notify.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 2.74, Tue Feb 3 01:52:57 2009 UTC revision 2.75, Fri Mar 13 02:32:27 2009 UTC
# Line 1  Line 1 
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    
# Line 185  function notify_menu() { Line 185  function notify_menu() {
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(
# Line 200  function notify_menu() { Line 200  function notify_menu() {
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
# Line 220  function notify_menu() { Line 234  function notify_menu() {
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    }    }

Legend:
Removed from v.2.74  
changed lines
  Added in v.2.75

  ViewVC Help
Powered by ViewVC 1.1.2