Add hosting_signup_domains for controlling which users see the hosting signup dialog
This commit is contained in:
parent
48fefa0d3e
commit
54b22290e7
1 changed files with 13 additions and 6 deletions
|
@ -315,6 +315,12 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
||||||
const hostingSignupIFrame = SdkConfig.get().hosting_signup_iframe;
|
const hostingSignupIFrame = SdkConfig.get().hosting_signup_iframe;
|
||||||
let hostingIFrame;
|
let hostingIFrame;
|
||||||
if (hostingSignupIFrame) {
|
if (hostingSignupIFrame) {
|
||||||
|
// If hosting_signup_domains is set to a non-empty array, only show
|
||||||
|
// dialog if the user is on the domain or a subdomain.
|
||||||
|
const hostingSignupDomains = SdkConfig.get().hosting_signup_domains || [];
|
||||||
|
const mxDomain = MatrixClientPeg.get().getDomain();
|
||||||
|
const validDomains = hostingSignupDomains.filter(d => (d === mxDomain || mxDomain.endsWith(`.${d}`)));
|
||||||
|
if (!hostingSignupDomains || validDomains.length > 0) {
|
||||||
hostingIFrame = <div
|
hostingIFrame = <div
|
||||||
className="mx_UserMenu_contextMenu_header mx_UserMenu_contextMenu_hostingLink"
|
className="mx_UserMenu_contextMenu_header mx_UserMenu_contextMenu_hostingLink"
|
||||||
onClick={this.onCloseMenu}
|
onClick={this.onCloseMenu}
|
||||||
|
@ -322,6 +328,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
||||||
<HostingProviderTrigger />
|
<HostingProviderTrigger />
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let homeButton = null;
|
let homeButton = null;
|
||||||
if (this.hasHomePage) {
|
if (this.hasHomePage) {
|
||||||
|
|
Loading…
Reference in a new issue