import { RegExpUtility } from "../../browser/text/RegExpUtitlity"; export class UserManagementServerSettings { // Server settings url:string; port:number = 8084; corsURLs:string[] = []; // Paths rootPath:string; userDBPath:string; rolesPath:string; // Geo-Lite Lib geoLocationPath:string; geoAccountID:string; geoLicenseKey:string; // Email emailFrom:string; // User settings maxLogins:number = 5; static makeAllPathsAbsolute( settings:UserManagementServerSettings ) { settings.userDBPath = this._makePathAbsolute( settings.userDBPath, settings.rootPath ); settings.rolesPath = this._makePathAbsolute( settings.rolesPath, settings.rootPath ); settings.geoLocationPath = this._makePathAbsolute( settings.geoLocationPath, settings.rootPath ); } protected static _makePathAbsolute( path:string, rootPath:string ) { if ( path.indexOf( rootPath ) === 0 ) { return path; } return RegExpUtility.joinPaths( [ rootPath, path ] ); } }