/[drupal]/contributions/modules/workflow_ng/workflow_ng/modules/workflow_ng_user.inc
ViewVC logotype

Diff of /contributions/modules/workflow_ng/workflow_ng/modules/workflow_ng_user.inc

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

revision 1.1.2.2.2.11, Fri Jul 11 08:19:46 2008 UTC revision 1.1.2.2.2.12, Thu Feb 19 10:37:09 2009 UTC
# Line 1  Line 1 
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
# Line 72  function workflow_ng_events_global_user_ Line 72  function workflow_ng_events_global_user_
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'
# Line 88  function workflow_ng_user($op, $edit, &$ Line 88  function workflow_ng_user($op, $edit, &$
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    

Legend:
Removed from v.1.1.2.2.2.11  
changed lines
  Added in v.1.1.2.2.2.12

  ViewVC Help
Powered by ViewVC 1.1.2