| 1 |
<?php |
<?php |
| 2 |
// $Id: signup.module,v 1.131 2008/05/23 10:18:32 dww Exp $ |
// $Id: signup.module,v 1.132 2008/07/28 05:59:31 dww Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @defgroup signup_core Core drupal hooks |
* @defgroup signup_core Core drupal hooks |
| 331 |
} |
} |
| 332 |
|
|
| 333 |
/** |
/** |
| 334 |
|
* Implementatiion of hook_user(). |
| 335 |
|
* |
| 336 |
|
* When a user is deleted, cancel all of that user's signups to remove all |
| 337 |
|
* instances of that user from the {signup_log} table, free up space in events |
| 338 |
|
* with signup limits, etc. |
| 339 |
|
* |
| 340 |
|
* @ingroup signup_core |
| 341 |
|
*/ |
| 342 |
|
function signup_user($type, &$edit, &$user, $category = NULL) { |
| 343 |
|
switch ($type) { |
| 344 |
|
case 'delete': |
| 345 |
|
$uids = array(); |
| 346 |
|
if (is_array($edit['accounts'])) { |
| 347 |
|
// A multi-user delete from Admin > User management > Users. |
| 348 |
|
$uids = $edit['accounts']; |
| 349 |
|
} |
| 350 |
|
else { |
| 351 |
|
// A single-user delete from the edit tab on the user's profile. |
| 352 |
|
$uids[] = $edit['uid']; |
| 353 |
|
} |
| 354 |
|
foreach ($uids as $uid) { |
| 355 |
|
$nids = db_query("SELECT nid FROM {signup_log} WHERE uid = %d", $uid); |
| 356 |
|
while ($data = db_fetch_object($nids)) { |
| 357 |
|
signup_cancel_signup($uid, $data->nid); |
| 358 |
|
} |
| 359 |
|
} |
| 360 |
|
break; |
| 361 |
|
} |
| 362 |
|
|
| 363 |
|
// If we're not using views, we need to support additional user |
| 364 |
|
// operations, for example, to add the user's current signup |
| 365 |
|
// schedule to their user profile page. |
| 366 |
|
if (!module_exists('views')) { |
| 367 |
|
$signup_path = './'. drupal_get_path('module', 'signup'); |
| 368 |
|
require_once($signup_path .'/signup_no_views.inc'); |
| 369 |
|
return _signup_user_no_views($type, $edit, $user, $category); |
| 370 |
|
} |
| 371 |
|
} |
| 372 |
|
|
| 373 |
|
|
| 374 |
|
/** |
| 375 |
* Implementation of hook_form_alter(). |
* Implementation of hook_form_alter(). |
| 376 |
* @ingroup signup_core |
* @ingroup signup_core |
| 377 |
*/ |
*/ |