Branch: Tag:

1999-05-18

1999-05-18 21:46:13 by Martin Stjernholm <mast@lysator.liu.se>

Remove get_domain() and use the one in roxen.pike instead.

Rev: server/base_server/configuration.pike:1.192

1: - string cvs_version = "$Id: configuration.pike,v 1.191 1999/05/15 17:51:32 grubba Exp $"; + string cvs_version = "$Id: configuration.pike,v 1.192 1999/05/18 21:46:13 mast Exp $";   #include <module.h>   #include <roxen.h>   
3012:   }       -  - // Get the current domain. This is not as easy as one could think. -  - private string get_domain(int|void l) - { -  array f; -  string t, s; -  - // ConfigurationURL is set by the 'install' script. -  if (!l) { -  f = (roxen->QUERY(ConfigurationURL)/"://"); -  if (sizeof(f) > 1) { -  t = (replace(f[1], ({ ":", "/" }), ({ "\0", "\0" }))/"\0")[0]; -  f = t/"."; -  if (sizeof(f) > 1) { -  s = f[1..]*"."; -  } -  } -  } - #if efun(gethostbyname) - #if efun(gethostname) -  if(!s) { -  f = gethostbyname(gethostname()); // First try.. -  if(f) -  foreach(f, f) { -  if (arrayp(f)) { -  foreach(f, t) { -  f = t/"."; -  if ((sizeof(f) > 1) && -  (replace(t, ({ "0", "1", "2", "3", "4", "5", -  "6", "7", "8", "9", "." }), -  ({ "","","","","","","","","","","" })) != "")) { -  t = f[1..]*"."; -  if(!s || strlen(s) < strlen(t)) -  s=t; -  } -  } -  } -  } -  } - #endif - #endif -  if(!s) { -  t = Stdio.read_bytes("/etc/resolv.conf"); -  if(t) { -  if(!sscanf(t, "domain %s\n", s)) -  if(!sscanf(t, "search %s%*[ \t\n]", s)) -  s="nowhere"; -  } else { -  s="nowhere"; -  } -  } -  if(s && strlen(s)) -  { -  if(s[-1] == '.') s=s[..strlen(s)-2]; -  if(s[0] == '.') s=s[1..]; -  } else { -  s="unknown"; -  } -  return s; - } -  +    int disable_module( string modname )   {    mapping module;
3921:    något av de mönster som står i den här listan. Den här variabeln    påverkar även &lt;accessed&gt; RXML-styrkoden.");    -  defvar("Domain", get_domain(), "Domain", TYPE_STRING, +  defvar("Domain", roxen->get_domain(), "Domain", TYPE_STRING,    "The domainname of the server. The domainname is used "    " to generate default URLs, and to gererate email addresses");    deflocaledoc( "svenska", "Domain",