欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

drupal 用户导入 user_import 模块

shiping1 的头像
由于 user_import 对中文不太友好  我们到    http://shipingzhong.cn/node/1119 可以导中文 (它导节点 导用户都可以)
1)安装 启用 User Import   https://drupal.org/project/user_import
2)https://drupal.org/node/137653 里面有详细的说明
3)admin/user/user_import 到这里
4)上传如相格式的csv文件 csv文件为utf-8的格式
张三,zhangsan,zhangsan@gg.com
李四,lishi,lishi@gg.com
王五,wangwu,wangwu@gg.com
赵六,zhaoliu,zhaoliu@gg.com




模块介绍:
用csv档案(或逗号分隔数据的档案)汇入用户到 Drupal
特点包含:
* 为每个使用者的建立账号
* 由浏览器上传CSV档案,或是把档案用FTP上传到模块在的文件夹都可以
* 可以把两个字段合并变成账号名称
如: "John" + "Smith" => "JohnSmith"
* 也可以只取字段的头一个字变成缩写合并成账号
如: "John" + "Smith" => "JSmith"
* 可以随机产生"口语化"的账号 (应该指可以看出单字的那种吧!!)
* 可以为每个账号产生随机密码
* 可以由在CSV档案中决定每个账号的密码(和汇入一般数据无异)
* 可以在产生账号的同时,加入成为某角色
* 可以对应到profile模块(个人信息)的字段
* 可以寄发定制的欢迎信给每个新使用者
* 欢迎信内容可以包含个人的信息
* 可以设定汇入所有账号为启用状态
* 和Organic Groups模块整合(这个我没测过...不晓得怎么用)
* 可以在汇入前测试有没有设定错误
* 可以被cron或是由管理者手动执行(个人没找到和cron相关设定)
* 可以分批汇入资料,这样就不会出现短时间寄发大量邮件出去
* 多个档案可以同时汇入、测试
* 被设计可以无限延伸 (猜测是指可以很有弹性的对应到无限多个字段 or 人数)
* 汇入时字段对应可以记起来,留到下次使用

来自 http://www.drupalla.com/project/user_import

 


1. To set permissions of who can import users into the site, navigate to:

'Administer'
    -- 'User management'
        -- 'Access control' (admin/user/access)
    

2. To import users, navigate to:

'Administer'
    -- 'User management'
        -- 'User imports'  (admin/user/user_import)
        
3. Select 'Import' tab (admin/user/user_import/add)

4. Press the 'browse' button to select a file to import,
    or select a file already added through FTP.

5. Click on Next.

6. Under CSV file you should see the name of the file you just uploaded.

7. Under Options you should see Ignore First Line ( use if the first row are labels ),
    
    Contact, and Send Email.  Select whichever is appropiate.

8. Under Field Match you should see the various columns from your profile page.

9. For each csv column select a Drupal field to map.

10. Under username select 'No', if the field is not to be used to generate the username, or select '1' - '4'
    for the order to use the field in generating username.

    Example: 'LastName' and 'FirstName' are fields to be used as username.  So under the username
    selection chose '1' for 'FirstName' and '2' for 'Lastname', and the username generated will be in
    the form 'FirstNameLastName'.

11. Under Role Assign select the roles the imported users will be assigned.

12. Under Save Settings, you can save your settings for use on future imports.

13. Click "Test" to do an import without committing changes to the database.  Fix any errors that are generated.

14. Click "Import" to complete the import.


普通分类: