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

Diff of /contributions/modules/signup/signup.module

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

revision 1.74.2.40, Fri May 23 10:18:37 2008 UTC revision 1.74.2.41, Fri Aug 1 04:16:10 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: signup.module,v 1.74.2.39 2008/05/16 19:21:13 dww Exp $  // $Id: signup.module,v 1.74.2.40 2008/05/23 10:18:37 dww Exp $
3    
4  /**  /**
5   * @defgroup signup_core Core drupal hooks   * @defgroup signup_core Core drupal hooks
# Line 227  function signup_perm() { Line 227  function signup_perm() {
227    
228  /**  /**
229   * Implementation of hook_user().   * Implementation of hook_user().
230     *
231     * When viewing a user profile page, display their current signup schedule.
232     *
233     * When a user is deleted, cancel all of that user's signups to remove all
234     * instances of that user from the {signup_log} table, free up space in events
235     * with signup limits, etc.
236     *
237   * @ingroup signup_core   * @ingroup signup_core
238   */   */
239  function signup_user($op, &$edit, &$user, $category = NULL) {  function signup_user($op, &$edit, &$user, $category = NULL) {
# Line 240  function signup_user($op, &$edit, &$user Line 247  function signup_user($op, &$edit, &$user
247        if (isset($output)) {        if (isset($output)) {
248          return array(t('Signup information') => array(array('value' => $output, 'class' => 'user')));          return array(t('Signup information') => array(array('value' => $output, 'class' => 'user')));
249        }        }
250          break;
251    
252        case 'delete':
253          $uids = array();
254          if (is_array($edit['accounts'])) {
255            // A multi-user delete from Admin > User management > Users.
256            $uids = $edit['accounts'];
257          }
258          else {
259            // A single-user delete from the edit tab on the user's profile.
260            $uids[] = $edit['uid'];
261          }
262          foreach ($uids as $uid) {
263            $nids = db_query("SELECT nid FROM {signup_log} WHERE uid = %d", $uid);
264            while ($data = db_fetch_object($nids)) {
265              signup_cancel_signup($uid, $data->nid);
266            }
267          }
268          break;
269    
270    }    }
271  }  }
272    
273    
274  /**  /**
275   * Implementation of hook_form_alter().   * Implementation of hook_form_alter().
276   * @ingroup signup_core   * @ingroup signup_core

Legend:
Removed from v.1.74.2.40  
changed lines
  Added in v.1.74.2.41

  ViewVC Help
Powered by ViewVC 1.1.2