| 1 |
<?php |
<?php |
| 2 |
// $Id$ |
// $Id: workflow_ng_user.inc,v 1.1.2.2.2.11 2008/07/11 08:19:46 fago Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file Workflow-ng integration for the user module |
* @file Workflow-ng integration for the user module |
| 72 |
* Implementation of hook_user |
* Implementation of hook_user |
| 73 |
* As user_user exists already, we implement workflow_ng_user() |
* As user_user exists already, we implement workflow_ng_user() |
| 74 |
*/ |
*/ |
| 75 |
function workflow_ng_user($op, $edit, &$account, $category = NULL) { |
function workflow_ng_user($op, &$edit, &$account, $category = NULL) { |
| 76 |
static $account_unchanged; |
static $account_unchanged; |
| 77 |
|
|
| 78 |
//we don't support updates for other categories than 'account' |
//we don't support updates for other categories than 'account' |
| 88 |
} |
} |
| 89 |
else if (in_array($op, array('insert', 'login', 'logout', 'view', 'delete'))) { |
else if (in_array($op, array('insert', 'login', 'logout', 'view', 'delete'))) { |
| 90 |
workflow_ng_invoke_event('user_'. $op, array('account' => &$account)); |
workflow_ng_invoke_event('user_'. $op, array('account' => &$account)); |
| 91 |
|
|
| 92 |
|
// Allow adding user roles during registration |
| 93 |
|
if ($op == 'insert' && isset($account->roles)) { |
| 94 |
|
$edit += array('roles' => array()); |
| 95 |
|
$edit['roles'] += $account->roles; |
| 96 |
|
} |
| 97 |
} |
} |
| 98 |
} |
} |
| 99 |
|
|