Drupal 7我需要使用代碼創建新用戶(不是通過面板手動)。Drupal 7新用戶以編程方式創建?
當我與這個塊的示例代碼我GOOGLE了測試,在Drupal的:
$form_state = array();
$form_state['values']['name'] = 'robo-user';
$form_state['values']['mail'] = '[email protected]';
$form_state['values']['pass']['pass1'] = 'password';
$form_state['values']['pass']['pass2'] = 'password';
$form_state['values']['op'] = t('Create new account');
drupal_execute('user_register', $form_state);
它顯示:Fatal error: Call to undefined function drupal_execute() in ......
我怎樣才能使它發揮作用或任何其他簡單的方法像上面?