Skip to content

Commit 302f647

Browse files
committed
Integration description
1 parent f872cb8 commit 302f647

1 file changed

Lines changed: 45 additions & 15 deletions

File tree

README.md

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ Name | Description | Details
5151
**Allow password change** | Can user change its password. The password change is propagated to the database. See [Hash algorithms](#Hash algorithms). | Optional.<br/>Default: false.
5252
**Use cache** | Use database query results cache. The cache can be cleared any time with the *Clear cache* button click. | Optional.<br/>Default: false.
5353
**Hashing algorithm** | How users passwords are stored in the database. See [Hash algorithms](#Hash algorithms). | Mandatory.
54-
**Email sync** | Sync e-mail address with the Nextcloud.<br/>- *None* - Disables this feature. This is the default option.<br/>- *Synchronise only once* - Copy the e-mail address to the Nextcloud storage if its not set.<br/>- *Nextcloud always wins* - Always copy the e-mail address to the database. This updates the user table.<br/>- *SQL always wins* - Always copy the e-mail address to the Nextcloud storage. | Optional.<br/>Default: *None*. Requires user's *Email* column.
54+
**Email sync** | Sync e-mail address with the Nextcloud.<br/>- *None* - Disables this feature. This is the default option.<br/>- *Synchronise only once* - Copy the e-mail address to the Nextcloud storage if its not set.<br/>- *Nextcloud always wins* - Always copy the e-mail address to the database. This updates the user table.<br/>- *SQL always wins* - Always copy the e-mail address to the Nextcloud storage. | Optional.<br/>Default: *None*.<br/>Requires user's *Email* column.
5555
**Home mode** | User storage path.<br/>- *Default* - Let the Nextcloud manage this. The default option.<br/>- *Query* - Use location from the user table pointed by the *home* column.<br/>- *Static* - Use static location. The `%u` variable is replaced with the username of the user. | Optional<br/>Default: *Default*.
5656
**Home Location** | User storage path for the `static` *home mode*. | Mandatory if the *Home mode* is set to `Static`.
5757

58-
## User table
58+
### User table
5959

6060
The definition of user table. The table containing user accounts.
6161

@@ -69,7 +69,7 @@ Name | Description | Details
6969
**Display name** | Display name column. | Optional.
7070
**Can change avatar** | Flag indicating if user can change its avatar. | Optional.<br/>Default: false.
7171

72-
## Group table
72+
### Group table
7373

7474
Group definitions table.
7575

@@ -80,7 +80,7 @@ Name | Description | Details
8080
**Display name** | Display name column. | Optional.
8181
**Group name** | Group name column. | Mandatory for group backend.
8282

83-
## User group table
83+
### User group table
8484

8585
Associative table which maps users to groups.
8686

@@ -90,21 +90,51 @@ Name | Description | Details
9090
**Username** | Username column. | Mandatory for group backend.
9191
**Group name** | Group name column. | Mandatory for group backend.
9292

93+
## Integrations
9394

95+
The basic functionality requires only one database table: [User table](#User table).
9496

97+
For all options to work three tables are required:
98+
- [User table](#User table),
99+
- [Group table](#Group table),
100+
- [User group table](#User group table).
95101

102+
If you already have an existing database you can always create database views which fits this model,
103+
but be aware that some functionalities requires data changes (update queries).
96104

97-
98-
99-
100-
101-
102-
103-
104-
105-
106-
107-
## Integrations
105+
If you don't have any database model yet you can use below tables (MySQL):
106+
```
107+
CREATE TABLE sql_users
108+
(
109+
id INT AUTO_INCREMENT PRIMARY KEY,
110+
username VARCHAR(16) NOT NULL,
111+
display_name TEXT NULL,
112+
email TEXT NULL,
113+
home TEXT NULL,
114+
password TEXT NOT NULL,
115+
can_change_avatar BOOLEAN NOT NULL DEFAULT FALSE,
116+
CONSTRAINT users_username_uindex UNIQUE (username)
117+
);
118+
119+
CREATE TABLE sql_group
120+
(
121+
id INT AUTO_INCREMENT PRIMARY KEY,
122+
name VARCHAR(16) NOT NULL,
123+
display_name TEXT NULL,
124+
admin BOOLEAN NOT NULL DEFAULT FALSE,
125+
CONSTRAINT group_name_uindex UNIQUE (name)
126+
);
127+
128+
CREATE TABLE sql_user_group
129+
(
130+
id INT AUTO_INCREMENT PRIMARY KEY,
131+
group_name VARCHAR(16) NOT NULL,
132+
username VARCHAR(16) NOT NULL,
133+
CONSTRAINT user_group_group_name_username_uindex UNIQUE (group_name, username),
134+
INDEX user_group_group_name_index (group_name),
135+
INDEX user_group_username_index (username)
136+
);
137+
```
108138

109139
### WordPress
110140
Thanks to this app, Nextcloud can easily integrate with Wordpress.

0 commit comments

Comments
 (0)