| 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 |
| 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) { |
| 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 |