diff --git a/controllers/account.go b/controllers/account.go
index f7aed5bc..c92a5c01 100644
--- a/controllers/account.go
+++ b/controllers/account.go
@@ -249,6 +249,10 @@ func (c *ApiController) Signup() {
user.Groups = []string{invitation.SignupGroup}
}
+ if application.DefaultGroup != "" && user.Groups == nil {
+ user.Groups = []string{application.DefaultGroup}
+ }
+
affected, err := object.AddUser(user)
if err != nil {
c.ResponseError(err.Error())
diff --git a/object/application.go b/object/application.go
index d4a8c553..dfd5eb9d 100644
--- a/object/application.go
+++ b/object/application.go
@@ -71,6 +71,7 @@ type Application struct {
Description string `xorm:"varchar(100)" json:"description"`
Organization string `xorm:"varchar(100)" json:"organization"`
Cert string `xorm:"varchar(100)" json:"cert"`
+ DefaultGroup string `xorm:"varchar(100)" json:"defaultGroup"`
HeaderHtml string `xorm:"mediumtext" json:"headerHtml"`
EnablePassword bool `json:"enablePassword"`
EnableSignUp bool `json:"enableSignUp"`
diff --git a/web/src/ApplicationEditPage.js b/web/src/ApplicationEditPage.js
index 3ca515fe..62f31f2d 100644
--- a/web/src/ApplicationEditPage.js
+++ b/web/src/ApplicationEditPage.js
@@ -13,8 +13,8 @@
// limitations under the License.
import React from "react";
-import {Button, Card, Col, ConfigProvider, Input, InputNumber, Popover, Radio, Result, Row, Select, Switch, Upload} from "antd";
-import {CopyOutlined, LinkOutlined, UploadOutlined} from "@ant-design/icons";
+import {Button, Card, Col, ConfigProvider, Input, InputNumber, Popover, Radio, Result, Row, Select, Space, Switch, Upload} from "antd";
+import {CopyOutlined, HolderOutlined, LinkOutlined, UploadOutlined, UsergroupAddOutlined} from "@ant-design/icons";
import * as ApplicationBackend from "./backend/ApplicationBackend";
import * as CertBackend from "./backend/CertBackend";
import * as Setting from "./Setting";
@@ -36,6 +36,7 @@ import ThemeEditor from "./common/theme/ThemeEditor";
import SigninTable from "./table/SigninTable";
import Editor from "./common/Editor";
+import * as GroupBackend from "./backend/GroupBackend";
const {Option} = Select;
@@ -116,6 +117,7 @@ class ApplicationEditPage extends React.Component {
UNSAFE_componentWillMount() {
this.getApplication();
this.getOrganizations();
+ this.getGroups();
}
getApplication() {
@@ -167,6 +169,17 @@ class ApplicationEditPage extends React.Component {
});
}
+ getGroups() {
+ GroupBackend.getGroups(this.state.organizationName)
+ .then((res) => {
+ if (res.status === "ok") {
+ this.setState({
+ groups: res.data,
+ });
+ }
+ });
+ }
+
getCerts(application) {
let owner = application.organization;
if (application.isShared) {
@@ -469,6 +482,31 @@ class ApplicationEditPage extends React.Component {
}} />
+
+
+ {Setting.getLabel(i18next.t("ldap:Default group"), i18next.t("ldap:Default group - Tooltip"))} :
+
+
+
+
+
{Setting.getLabel(i18next.t("application:Enable signup"), i18next.t("application:Enable signup - Tooltip"))} :