space Baylys
Just practicing to pass the Turing test.
space
space
space
space
Developer for Hire!
space
addedValues Plugin
space

Home

What's new

Bayly.Root

Cornershop Plugin

Career

edutools Root

Enhancements

Interests

linguist Plugin

Manila

Patches

Patches by Group

Papers

Sales

Sign My Guestbook

User(land) Relations.

Contact Address

Search Baylys

urlchains

space
Join Now
Login
space space space

manilaSuite.hosting.createSiteForm

Fix a bug that stops a hosted site having reserevd name, such as FAQ, because this inteferes with hosting site operation.

Also, provide a way to dis-allow changing the email address under which the site is created.

on createSiteForm (pta=nil)
  «Changes:
  «05/05/04, 13:58:03 by DAB
  «DAB Changes from 03/01/05, 16:09:10
  «all sites get their own root
  «from the controlpanel - always
  «user form entry - if boolean config.manila.prefs.flOneSitePerRoot exists use that value
  «A site preference can be set In #prefs flCannotChangeEmail
  «true - email address is taken from member record (non controlapnel calls)
  «false - sets as before from the form
  «name restricted to max of 18 chars - otherwise backups fail on Macintosh for folder name too long
  «5/3/04; 6:15:26 PM by JES
 unaltered lines omitted
  «4/9/04; 5:34:36 PM by JES
 unaltered lines omitted
  «7/9/03; 3:24:36 PM by JES
 unaltered lines omitted
  «3/31/03; 3:04:43 PM by JES
 unaltered lines omitted
  «8/16/02; 4:42:24 PM by JES
 unaltered lines omitted
  «07/12/00; 3:18:55 PM by PBS
 unaltered lines omitted
  «07/03/00; 12:12:57 PM by JES
 unaltered lines omitted
  «06/28/00; 12:27:43 PM by PBS
 unaltered lines omitted
  «06/27/00; 12:30:27 PM by JES
 unaltered lines omitted
  «06/26/00; 7:49:48 PM by JES
 unaltered lines omitted
  «06/25/00; 12:51:16 AM by JES
 unaltered lines omitted
  «06/23/00; 10:05:39 PM by PBS
 unaltered lines omitted
  «06/22/00; 4:14:12 PM by PBS
 unaltered lines omitted
  «06/22/00; 1:13:38 AM by JES
 unaltered lines omitted
  «06/17/00; 11:20:02 PM by PBS
 unaltered lines omitted
  «05/26/00; 11:50:27 AM by PBS
 unaltered lines omitted
 
  if pta == nil {pta = html.getPageTableAddress ()}
  «workspace.pt = pta^
 
  local (adrPrefs)
  local (flControlPanel = false)
  bundle //figure out which site's prefs to use
  local (flSubSites = adrPrefs^.flSubSites)
  local (baseDomain = adrPrefs^.baseDomain)
  local (flEditorsOnly = adrPrefs^.flEditorsOnlyCreateSites)
  local (flConvertToSiteTree = false) //PBS 06/28/00
  local (flSiteTreeExists = false)
  local (flCannotChangeEmail = false) «03/01/02, 18:34:33 by DAB
  try {flCannotChangeEmail = adrPrefs^.flCannotChangeEmail} «03/01/02, 18:34:37 by DAB
 
  bundle //PBS 06/28/00: find out if we need to convert to a siteTree
 
  if flEditorsOnly and not flControlPanel
 unaltered lines omitted
 
  bundle //check baseDomain, make sure it's good
 
  local (htmlText = "", indentLevel = 0)
  on add (s)
 unaltered lines omitted
 
  on buildForm (path, name, email, password, theme)
  local (action = pta^.uri)
  if pta^.pathArgs != "" // 06/26/00 JES: fixed form on storyReader and msgReader pages
 unaltered lines omitted
  add ("<form method=\"post\" action=\"" + action + "\">")
  if flCannotChangeEmail «01/10/17, 14:01:05 by DAB
  add ("<input type='hidden' name='email' value='" + manilaSuite.translateToEntities (email) + "'>")
  indentLevel++
  «local (host = pta^.host)
  add ("<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\">")
  indentLevel++
  bundle //host
  if flSubSites
  add ("<tr>")
  indentLevel++
  add ("<td valign=\"top\" align=\"right\"><nobr>")
  indentLevel++
  add ("http:\//" + baseDomain + "/")
  add ("</nobr></td>")
  indentLevel--
  add ("<td valign=\"top\" align=\"left\">")
  indentLevel++
  «add ("<input size=\"25\" name=\"path\" value=\"" + manilaSuite.translateToEntities (path) + "\">/")
  «(31- string.length("ManilaWebsite"))
 unaltered lines omitted
  add ("<input size=\"18\" maxlength = '18' name=\"path\" value=\"" + manilaSuite.translateToEntities (path) + "\">/") «04/05/03, 15:26:33 by DAB
  add ("</td>")
  indentLevel--
  add ("</tr>")
  indentLevel--
  else
 unaltered lines omitted
  bundle //name
  if not flCannotChangeEmail «01/10/17, 14:01:05 by DAB email conditional
  add ("<tr>")
  indentLevel++
  add ("<td valign=\"top\" align=\"right\">")
  indentLevel++
  add (manilaSuite.getString ("hosting.emailPrompt", pta: pta))
  add ("</td>")
  indentLevel--
  add ("<td valign=\"top\" align=\"left\">")
  indentLevel++
  add ("<input size=\"25\" name=\"email\" value=\"" + manilaSuite.translateToEntities (email) + "\">")
  add ("</td>")
  indentLevel--
  add ("</tr>")
  indentLevel--
  bundle //password
  bundle //theme
  bundle //Create Site button
 
  add ("</table>")
  indentLevel--
  add ("</form>")
  indentLevel--
 
  return (true)
 
  local (flPost = (string.lower (pta^.method) == "post"))
 
  if defined (pta^.searchArgTable.code) //fake up the post
 unaltered lines omitted
 
  if flPost
  if defined (pta^.postArgs.createSiteButton) or defined (pta^.postArgs.["createSiteButton.x"]) //button may be an image
 
  local (errorMessage = "")
  local (path, name, email, password, theme)
  path = string.trimWhiteSpace (pta^.postArgs.path)
  name = string.trimWhiteSpace (pta^.postArgs.name)
  email = string.trimWhiteSpace (pta^.postArgs.email)
  theme = string.trimWhiteSpace (pta^.postArgs.theme)
  password = string.trimWhiteSpace (pta^.postArgs.password)
 
  on error (errorMessage)
 unaltered lines omitted
 
  bundle //check inputs
  bundle //path
  bundle //name
  if name == ""
 unaltered lines omitted
  if defined(maniladata.newSiteTemplate.[name]) or ({"home", "faq", "feedback"} contains string.lower(name) ) «02/01/18, 12:01:07 by DAB
  errormessage = name + " is reserved, please choose another name"
  if errorMessage != ""
 unaltered lines omitted
  bundle //email
  bundle //password
  bundle //theme
 
  local (flRequireEmailConfirmation = false)
  if defined (adrPrefs^.flRequireEmailConfirmation)
 unaltered lines omitted
  if flRequireEmailConfirmation and (not flControlPanel) //special handling for queuing the request, and sending confirmation email
 unaltered lines omitted
 
  bundle //make this person a member of the ISP site if they're not already
 
  local (canonicalSiteName, siteTableName)
  bundle //create canonical site name
 
  local (membershipGroupName = canonicalSiteName + "Members")
  local (discussionGroupName = canonicalSiteName + "Discuss")
 
  local (flShareMembershipGroup = false)
  bundle //PBS 07/12/00: figure out if the new site shares a membership group
 
  local (adrHostingSite, hostingSiteGroupName)
  if adrPrefs^.canonicalSiteName != ""
 unaltered lines omitted
 
  bundle //check for existing site
 
  on createSite (siteUrl)
  local (flAddToDomains = false)
  if not flSubSites
 unaltered lines omitted
  local (flAddToUserDatabases = false)
  local (flUseExistingGdb = true)
  «local (flUseExistingGdb = not flControlpanel) «05/06/15, 14:52:22 by DAB
  if defined(config.manila.prefs.flOneSitePerRoot) «03/01/05, 16:42:03 by DAB
  flUseExistingGdb = not config.manila.prefs.flOneSitePerRoot «03/05/19, 12:59:20 by DAB
  flAddToUserDatabases = true «03/11/11, 08:48:54 by DAB
  if defined(maniladata.newSiteTemplate.[name]) or ({"home", "faq", "feedback"} contains string.lower(name) ) «02/01/18, 12:01:07 by DAB
  errormessage = name + " is reserved, please choose another name"
  local (existingGdbName)
  if not defined (config.manila.prefs.hostingGdbName)
 unaltered lines omitted
  existingGdbName = config.manila.prefs.hostingGdbName
  if defined (adrPrefs^.hostingGdbName)
 unaltered lines omitted
  local (gdbPath = Frontier.getSubFolder ("www") + existingGdbName)
  if not (defined ([gdbPath])) //is it already open?
 unaltered lines omitted
  local (siteInfo)
  local (siteName = siteTableName)
  siteInfo = manilaSuite.clone (siteName, membershipGroupName, discussionGroupName, email, password, name, siteUrl, flAddToDomains, flAddToUserDatabases, flUseExistingGdb, existingGdbName, canonicalSiteName, theme)
  siteInfo.adrSite^.["#newsSite"].siteName = path
 
  if flShareMembershipGroup //PBS 07/12/00: use membership-related URLs from the top-level site, make sure shared membership group has good cookie domain value
 unaltered lines omitted
 
  bundle //support for new per-site hosting prefs
 
  mainResponder.redirect (siteInfo.adrSite^.["#ftpSite"].url)
  return (siteInfo)
 
  if flSubSites
 unaltered lines omitted
  else //(try to) create a top-level site
 unaltered lines omitted
  else
 unaltered lines omitted
 
  if not flPost //display the form
 unaltered lines omitted
 
  return (manilaSuite.unTaint (htmlText)) //no further macros should be processed in this text
«bundle //test code
  «html.setpagetableaddress (@workspace.pt)
  «createsiteform ()

Relative to Frontier version 9.7b10