老外们把精力都放在了怎样做通用性上面了。

Doku后台有切换授权方式的选项,改成mysql。

注:如下修改mysql.conf.php后,要把分组和权限设置结合起来,还需要配置dokuwiki的分组,zentao默认有一些角色分组:

acl.auth.php

# acl.auth.php
# <?php exit()?>
# Don't modify the lines above
#
# Access Control Lists
#
# Auto-generated by install script
# Date: Mon, 05 Jan 2015 13:09:23 +0000
* @ALL 1
* @admin 8
* @user 8
* @dev 8
* @qa 8
* @pm 8
* @po 8
* @td 8
* @pd 8
* @top 8
* @guest 1

conf/mysql.conf.php

<?php
/*
* This is an example configuration for the mysql auth plugin.
*
* This SQL statements are optimized for following table structure.
* If you use a different one you have to change them accordingly.
* See comments of every statement for details.
*
* TABLE users
* uid login pass firstname lastname email
*
* TABLE groups
* gid name
*
* TABLE usergroup
* uid gid
*
* To use this configuration you have to copy them to local.protected.php
* or at least include this file in local.protected.php.
*/ /* Options to configure database access. You need to set up this
* options carefully, otherwise you won't be able to access you
* database.
*/
$conf['plugin']['authmysql']['server'] = 'localhost';
$conf['plugin']['authmysql']['user'] = 'zentaoxx';
$conf['plugin']['authmysql']['password'] = 'xxxxx';
$conf['plugin']['authmysql']['database'] = 'zentaoxx'; /* This option enables debug messages in the mysql plugin. It is
* mostly useful for system admins.
*/
$conf['plugin']['authmysql']['debug'] = 0; /* Normally password encryption is done by DokuWiki (recommended) but for
* some reasons it might be usefull to let the database do the encryption.
* Set 'forwardClearPass' to '1' and the cleartext password is forwarded to
* the database, otherwise the encrypted one.
*/
$conf['plugin']['authmysql']['forwardClearPass'] = 1; /* Multiple table operations will be protected by locks. This array tolds
* the plugin which tables to lock. If you use any aliases for table names
* these array must also contain these aliases. Any unamed alias will cause
* a warning during operation. See the example below.
*/
$conf['plugin']['authmysql']['TablesToLock']= array();//"users", "users AS u","groups", "groups AS g", "usergroup", "usergroup AS ug" /***********************************************************************/
/* Basic SQL statements for user authentication (required) */
/***********************************************************************/ /* This statement is used to grant or deny access to the wiki. The result
* should be a table with exact one line containing at least the password
* of the user. If the result table is empty or contains more than one
* row, access will be denied.
*
* The plugin accesses the password as 'pass' so a alias might be necessary.
*
* Following patters will be replaced:
* %{user} user name
* %{pass} encrypted or clear text password (depends on 'encryptPass')
* %{dgroup} default group name
*/
$conf['plugin']['authmysql']['checkPass'] = "SELECT password
FROM zt_usergroup AS ug
JOIN zt_user AS u ON u.account=ug.account
JOIN zt_group AS g ON g.id=ug.group
WHERE account='%{user}'
AND name='%{dgroup}'"; /* This statement should return a table with exact one row containing
* information about one user. The field needed are:
* 'pass' containing the encrypted or clear text password
* 'name' the user's full name
* 'mail' the user's email address
*
* Keep in mind that Dokuwiki will access thise information through the
* names listed above so aliasses might be neseccary.
*
* Following patters will be replaced:
* %{user} user name
*/
$conf['plugin']['authmysql']['getUserInfo'] = "SELECT password, realname AS name, email AS mail
FROM zt_user
WHERE account='%{user}'"; /* This statement is used to get all groups a user is member of. The
* result should be a table containing all groups the given user is
* member of. The plugin accesses the group name as 'group' so an alias
* might be nessecary.
*
* Following patters will be replaced:
* %{user} user name
*/
$conf['plugin']['authmysql']['getGroups'] = "SELECT name as `group`
FROM zt_group g, zt_user u, zt_usergroup ug
WHERE u.account = ug.account
AND g.id = ug.group
AND u.account='%{user}'"; /***********************************************************************/
/* Additional minimum SQL statements to use the user manager */
/***********************************************************************/ /* This statement should return a table containing all user login names
* that meet certain filter criteria. The filter expressions will be added
* case dependend by the plugin. At the end a sort expression will be added.
* Important is that this list contains no double entries fo a user. Each
* user name is only allowed once in the table.
*
* The login name will be accessed as 'user' to a alias might be neseccary.
* No patterns will be replaced in this statement but following patters
* will be replaced in the filter expressions:
* %{user} in FilterLogin user's login name
* %{name} in FilterName user's full name
* %{email} in FilterEmail user's email address
* %{group} in FilterGroup group name
*/
$conf['plugin']['authmysql']['getUsers'] = "SELECT DISTINCT account AS user
FROM zt_user AS u
LEFT JOIN zt_usergroup AS ug ON u.account=ug.account
LEFT JOIN zt_group AS g ON ug.group=g.id";
$conf['plugin']['authmysql']['FilterLogin'] = "account LIKE '%{user}'";
$conf['plugin']['authmysql']['FilterName'] = "realname LIKE '%{name}'";
$conf['plugin']['authmysql']['FilterEmail'] = "email LIKE '%{email}'";
$conf['plugin']['authmysql']['FilterGroup'] = "name LIKE '%{group}'";
$conf['plugin']['authmysql']['SortOrder'] = "ORDER BY login"; /***********************************************************************/
/* Additional SQL statements to add new users with the user manager */
/***********************************************************************/ /* This statement should add a user to the database. Minimum information
* to store are: login name, password, email address and full name.
*
* Following patterns will be replaced:
* %{user} user's login name
* %{pass} password (encrypted or clear text, depends on 'encryptPass')
* %{email} email address
* %{name} user's full name
*/
$conf['plugin']['authmysql']['addUser'] = ""; /* This statement should add a group to the database.
* Following patterns will be replaced:
* %{group} group name
*/
$conf['plugin']['authmysql']['addGroup'] = ""; /* This statement should connect a user to a group (a user become member
* of that group).
* Following patterns will be replaced:
* %{user} user's login name
* %{uid} id of a user dataset
* %{group} group name
* %{gid} id of a group dataset
*/
$conf['plugin']['authmysql']['addUserGroup']= ""; /* This statement should remove a group fom the database.
* Following patterns will be replaced:
* %{group} group name
* %{gid} id of a group dataset
*/
$conf['plugin']['authmysql']['delGroup'] = ""; /* This statement should return the database index of a given user name.
* The plugin will access the index with the name 'id' so a alias might be
* necessary.
* following patters will be replaced:
* %{user} user name
*/
$conf['plugin']['authmysql']['getUserID'] = ""; /***********************************************************************/
/* Additional SQL statements to delete users with the user manager */
/***********************************************************************/ /* This statement should remove a user fom the database.
* Following patterns will be replaced:
* %{user} user's login name
* %{uid} id of a user dataset
*/
$conf['plugin']['authmysql']['delUser'] = ""; /* This statement should remove all connections from a user to any group
* (a user quits membership of all groups).
* Following patterns will be replaced:
* %{uid} id of a user dataset
*/
$conf['plugin']['authmysql']['delUserRefs'] = ""; /***********************************************************************/
/* Additional SQL statements to modify users with the user manager */
/***********************************************************************/ /* This statements should modify a user entry in the database. The
* statements UpdateLogin, UpdatePass, UpdateEmail and UpdateName will be
* added to updateUser on demand. Only changed parameters will be used.
*
* Following patterns will be replaced:
* %{user} user's login name
* %{pass} password (encrypted or clear text, depends on 'encryptPass')
* %{email} email address
* %{name} user's full name
* %{uid} user id that should be updated
*/
$conf['plugin']['authmysql']['updateUser'] = "UPDATE zt_user SET";
$conf['plugin']['authmysql']['UpdateLogin'] = "account='%{user}'";
$conf['plugin']['authmysql']['UpdatePass'] = "password='%{pass}'";
$conf['plugin']['authmysql']['UpdateEmail'] = "email='%{email}'";
$conf['plugin']['authmysql']['UpdateName'] = "";
$conf['plugin']['authmysql']['UpdateTarget']= "WHERE id=%{uid}"; /* This statement should remove a single connection from a user to a
* group (a user quits membership of that group).
*
* Following patterns will be replaced:
* %{user} user's login name
* %{uid} id of a user dataset
* %{group} group name
* %{gid} id of a group dataset
*/
$conf['plugin']['authmysql']['delUserGroup']= ""; /* This statement should return the database index of a given group name.
* The plugin will access the index with the name 'id' so a alias might
* be necessary.
*
* Following patters will be replaced:
* %{group} group name
*/
$conf['plugin']['authmysql']['getGroupID'] = "SELECT id
FROM zt_group
WHERE name='%{group}'";

DokuWiki整合Zentao的用户授权及分组体系的更多相关文章

  1. 动手实验01-----vCenter 微软AD认证配置与用户授权

    环境说明: AD域->   centaline.net 阅读目录: 1. 配置与AD认证源 2.权限角色 1. 配置与AD认证源 登陆vCenter后,在 系统管理 -> 配置 -> ...

  2. 【Java EE 学习 76 上】【数据采集系统第八天】【角色授权】【用户授权】【权限的粗粒度控制】【权限的细粒度控制】

    一.角色管理 单击导航栏上的"角色管理"超链接,跳转到角色管理界面,在该界面上显示所有角色,并提供角色的增加和删除.修改超链接. 1.增加新角色(角色授权) 流程:单击增加新角色超 ...

  3. 七天学会ASP.NET MVC (四)——用户授权认证问题

    小编应各位的要求,快马加鞭,马不停蹄的终于:七天学会 Asp.Net MVC 第四篇出炉,在第四天的学习中,我们主要了学习如何在MVC中如何实现认证授权等问题,本节主要讲了验证错误时的错误值,客户端验 ...

  4. Lind.DDD.Authorization用户授权介绍

    回到目录 Lind.DDD.Authorization是Lind.DDD框架的组成部分,之所以把它封装到框架里,原因就是它的通用性,几乎在任何一个系统中,都少不了用户授权功能,用户授权对于任何一个系统 ...

  5. iOS 获取用户授权的用户隐私保护-地图定位

    获取用户授权的用户隐私保护地图定位示例://导入定位框架#import<CoreLocation/CoreLocation.h>@interfaceViewController()< ...

  6. MySQL新建用户,授权,删除用户,修改密码

    首先要声明一下:一般情况下,修改MySQL密码,授权,是需要有mysql里的root权限的.注:本操作是在WIN命令提示符下,phpMyAdmin同样适用.    用户:phplamp  用户数据库: ...

  7. 即时聊天IM之二 openfire 整合现有系统用户

    合肥程序员群:49313181.    合肥实名程序员群:128131462 (不愿透露姓名和信息者勿加入) Q  Q:408365330     E-Mail:egojit@qq.com  综述: ...

  8. Oracle表空间,用户,用户授权

    一:Oracle表空间 1,Oracle表空间与SQL Server文件组对比 SQL Server的文件组(文件组包括若干MDF,NDF数据文件)对我们来说并不陌生,前段时间我在博客“怎样玩转千万级 ...

  9. MySql中添加用户,新建数据库,用户授权,删除用户,修改密码

    1.新建用户 登录MYSQL: @>mysql -u root -p @>密码 创建用户: mysql> insert into mysql.user(Host,User,Passw ...

随机推荐

  1. jsp模仿QQ空间说说的发表

    1.在文本域中输入文字(可以不添加) 2.点击添加图片(可以不添加) 3.点击发表 4.发表成功,文字和图片是超链接,点击就可以查看全部内容 5.点击图片查看原图,没有图片则不显示查看原图的超链接 主 ...

  2. Ext2.x学习笔记

    Ext2.X学习笔记一 一.ExtJS简介  1.1 什么是Ext JS? · Ext JS是一个Ajax框架,可以用来开发富客户端的Ajax应用,是一个用javascript写的,主要用于创建前端用 ...

  3. C# 开发2048小游戏

    这应该是几个月前,闲的手痒,敲了一上午代码搞出来的,随之就把它丢弃了,当时让别人玩过,提过几条更改建议,但是时至今日,我也没有进行过优化和更改(本人只会作案,不会收场,嘎嘎),下面的建议要给代码爱好的 ...

  4. JavaScript 对象的基本知识

    js对象和属性的基本定义 (function(){ $(document).ready(function(){ return "object define"; //创建对象实例 v ...

  5. CCNA网络工程师学习进程(3)常规网络设计模型与基本的网络协议

        本节介绍分层的网络设计模型与基本的网络协议,包括ARP协议,ICMP协议和IP协议.     (1)三层网络架构: 一个好的园区网设计应该是一个分层的设计.一般分为接入层.汇聚层(分布层).核 ...

  6. Java 线程 — AbstractQueuedSynchronizer

    锁 锁就是一种状态,比如互斥锁:同一时间只能有一个线程拥有,可以使用一个整型值来标志当前的状态 0:表示没有现成占有锁 1:表示锁已经被占用 AbstractQueuedSynchronizer 实现 ...

  7. MySQL(四) 数据表的插入、更新、删除数据

    序言 数据表的插入.更新.删除非常简单,但是简单的也要学习,细节决定成败. ---WH 一.插入数据 格式:INSERT INTO 表名(字段名...)VALUES(值...); 创建环境 使用per ...

  8. Windows 系统下Git安装图解

    简单来说Git是一个免费的.开源的版本控制软件,从功能上讲,跟我们比较熟悉的Subversion(SVN)这类版本控制软件没什么两样.由于工作的需求,需要在WinXP下安装git配合团队完成相应的工作 ...

  9. Mysql存储过程语法

    一口气弄完了! 一.条件语句if-then-else: create procedure demo_1(in param int) begin declare var int; ; then inse ...

  10. 《BI那点儿事》Microsoft 决策树算法——找出三国武将特性分布,献给广大的三国爱好者们

    根据游戏<三国志11>武将数据,利用决策树分析,找出三国武将特性分布.其中变量包括统率.武力.智力.政治.魅力.身分.变量说明:统率:武将带兵出征时的部队防御力.统帅越高受到普通攻击与兵法 ...