对于应该非常简单的事情,我找不到解决方案或正确示例:在创建用户时为其分配角色,这就是我正在尝试的:
$edit = array(
'name' => $_POST['name'],
'pass' => $password,
'mail' => $_POST['email'],
'status' => 0,
'language' => 'es',
'init' => $_POST['email'],
array(2 =>'authenticated', 4=>'my custom role') //as id and named in role db table
);
user_save(NULL, $edit);
没有创建用户,我该怎么做?
谢谢