Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tmpDebug := "";
- tmpNSFPath := @ReplaceSubstring(@URLDecode( "Domino"; @UrlQueryString("nsfpath") );"/";"\\");
- tmpServers := @DbLookup( "":"" ; "":"cldbdir.nsf" ; "($Pathname)" ; tmpNSFPath; "CanonicalServername");
- tmpServers:=@If(@IsError(tmpServers);"";tmpServers);
- REM {Lookup home mail server };
- tmpHomeServer:=@Name([Canonicalize];@NameLookup( [NoUpdate];@UserName; "MailServer" ));
- REM {Is Home Mail server in list of servers, then move this up to the front of the list};
- tmpServers := @If(@IsMember(tmpHomeServer;tmpServers); tmpHomeServer : @Transform(tmpServers;"x";@If(x=tmpHomeServer;@Nothing;x));tmpServers);
- tmpDebug := tmpDebug + "ReplicaServers:" + @Implode(tmpServers;",");
- tmpDNSNames := "";
- tmpClusterName := "";
- tmpClusterServers := "";
- REM {If no servers found, then db is in a different cluster, return list of cluster servers, with home server in front of list};
- tmpServers := @If(tmpServers="" | @Elements(tmpServers)=0;
- @Do(
- tmpDebug := tmpDebug + "Looking for cluster servers;";
- tmpClusterName := @Subset(@DbLookup("":""; "":"names.nsf"; "($ServersLookup)"; tmpHomeServer; "ClusterName"); 1);
- tmpClusterServers := @DbLookup( "":""; "":"names.nsf"; "($Clusters)"; tmpClusterName; "$0");
- tmpClusterServers := @Transform(tmpClusterServers;"x";
- @If(x=tmpHomeServer;@Nothing;@Name([Canonicalize];x)));
- tmpClusterServers := @If(@IsMember(tmpHomeServer;tmpClusterServers); tmpHomeServer : @Transform(tmpClusterServers;"x";
- @If(x=tmpHomeServer;@Nothing;x));tmpClusterServers);
- tmpClusterServers);
- tmpServers);
- tmpLimit:=@Elements(tmpServers)+1;
- @For(n:=1;
- n<tmpLimit;
- n:=n+1;
- tmpHTTPHostNameALT:=@Subset(@DbLookup( "":"" ; "":"names.nsf" ; "($ServersLookup)" ; tmpServers[n] ; "HTTP_Hostname");1);
- tmpServerFQDN:=@Subset(@DbLookup( "":"" ; "":"names.nsf" ; "($ServersLookup)" ; tmpServers[n] ; "SMTPFullHostDomain");1);
- tmpString:=tmpString+@Text(n)+tmpHTTPHostNameAlt+tmpServerFQDN;
- tmpDNSNames := @If(@Length(tmpDNSNames)>0;tmpDNSNames+",";"") + @LowerCase(@If (tmpHTTPHostNameALT!="";tmpHTTPHostNameALT;tmpServerFQDN))
- );
- @If(tmpClusterName="";@SetHTTPHeader("X-Domino-ReplicaServers";tmpDNSNames);@SetHTTPHeader("X-Domino-ClusterServers";tmpDNSNames));
- @SetHTTPHeader("Cache-control";"no-store");
- @If(tmpDebug="";"";"<script>"+tmpDebug+"</script>")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement