TeamSpeak複製用戶組權限到新組(Copy permissions to new group)

一、先在TS客戶端裏添加新組
二、將ts3server.sqlitedb複製一個,作備份
三、使用SQLite Developer等工具打開復制後的ts3server.sqlitedb或中止服務直接編輯ts3server.sqlitedb
四、將普通組的權限複製給新組,普通組ID爲7,新組ID爲9
先將ID1爲9的新組的數據刪了,ID號在客戶端管理裏能夠看,組名後面的數字就是
delete from perm_server_group WHERE id1 in (9)
將普通組ID爲7的數據插入數據庫,插入時ID1設置9,也就是新組的ID
insert into perm_server_group SELECT server_id,9 as id1,id2,perm_id,perm_value,perm_negated,perm_skip FROM perm_server_group WHERE id1=7
 
五、中止TS服務,將ts3server.sqlitedb覆蓋原數據庫
六、重啓TS服務
 
 
如下爲TS官網論壇轉載,操做沒我這個方便。解釋得仍是挺詳細的。
==================================
Copy permissions to new group
 
The only way I know is editing the ts3server.sqlitedb SQLite database, so you must have access to the TS3-Folder to do this.

You can use any tool supporting SQLite, but here´s a little tutorial using SQLiteman(freeware):

1. BackUp your ts3server.sqlitedb, you can find it in your ts3-directory and copy it somewhere else(so you´ve got it three times: one used by the TS3, one BackUp and one to work with)
2. Start SQLiteman and open your copied ts3server.sqlitedb
=== To create a new group (this can be done in TS3 as well) ===
3. Doubleclick on groups_server which you can find under tables in the Tree-View on the window´s left side
4. You can see your groups and their IDs in the lower right part of the window, dont mind Group 1-5(1&2 are for ServerQuery logins and 3-5 are templates, I suppose)
5. Add a new row(=> group) using the Add a row button above the Groups
6. Fill the row (server_id should be 1, assuming you haven´t got a license yet, and type also 1; group_id is the highest existing group_id +1 and name ... your own decision)
7. Save the changes by clicking the "save the current transaction..."-button above the grid
=== To copy permissions from a Group to another ===
8. Now you must use some (easy) SQL
9. Select all permissions you want to copy
e.G: You want to copy all permissions of the normal-group, which has the id 7(you can find it in the groups_server-table) So write "SELECT * FROM perm_server_group WHERE id1=7" in the SQL-Window in the upper right part of the window and click the green arrow above it("Run SQL") Now you have all Permissions you want to copy in the lower right list
10. Click the "Export Data"-Button above the list (don´t worry, it´s not grayed out) 11. Save the file anywhere using the "SQL inserts"-Format (without headers) 12. Open the file using any Text-Editor and replace all original id1 in the insert statements with the id of your new group(you can use a find&replace function, but watch out it replaces nothing exept the id1s) 13. Save the file and import it to SQLitemans SQL window(the thing in the upper right corner) using the Open button(if it asks you if you "all you changes... ", say yes) 14 You should see some/many SQL statements 15 Click the first line and the "Run multiple SQL-statements"-button (the one with two green arrows) 16 It should import some things 17 Close SQLite 18 Stop the TS3-Server 19 Replace the ts3server.sqlitedb with your edited one 20 Start the TS3-Server and be happy You can do steps 3-7 in TS3 as well (but you must copy the ts3server.sqlitedb AFTER doing this)
相關文章
相關標籤/搜索