1

我需要将 user.module 中的 user_save 函数修改为如下所示:

if (empty($account->uid)) {
 // if we have a designated id, put that one in.
    if ($uww_uid){
  $account->uid =$uww_uid;
}else{
   $account->uid = db_next_id(db_query('SELECT MAX(uid) FROM {users}')->fetchField());
} 
 }

' 我怎样才能在核心之外做到这一点呢?谢谢

4

1 回答 1

0

您应该能够在 hook_user_insert() http://api.drupal.org/api/drupal/modules%21user%21user.api.php/function/hook_user_insert/7中完成此操作

只需检查 $account->uid 并将其设置为您上面的 $uww_uid。

于 2012-11-29T01:48:02.730 回答