|
From: creedon <icr...@us...> - 2005-07-05 18:46:22
|
Update of /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/adminSite/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14844 Modified Files: setupFrontier Log Message: rewrite Index: setupFrontier =================================================================== RCS file: /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/adminSite/website/setupFrontier,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** setupFrontier 15 Jun 2005 23:31:51 -0000 1.2 --- setupFrontier 5 Jul 2005 18:46:12 -0000 1.3 *************** *** 1,3 **** FrontierVcsFile:1:scpt:mainResponder.adminSite.website.setupFrontier ! on setupFrontier () { ÇChanges Ç6/15/05; 11:34:39 AM by TAC Çchanged config.manila.prefs.baseUrl to config.mainResponder.prefs.baseUrl Çchanged references to userland table, to Frontier table Ç5/18/04; 11:37:08 PM by JES ÇOn OS X, handle options for not enabling port forwarding, and setting the actual port. Ç4/13/04; 1:35:37 AM by JES ÇGive a confirmation page after submitting forms to let the user know what's about to happen when they log in. Ç3/12/04; 4:25:55 PM by JES ÇSave all open databases after processing a POST. Prevents possible configuration errors if Frontier is exitted before databases are saved after initial setup. Ç8/21/02; 7:17:33 PM by JES ÇFixed a bug which would prevent the setup from succeeding on Windows and MacOS Classic. Ç4/11/02; 10:27:06 PM by JES ÇCreated. Cribbed from radio.html.setupFrontier. local (flOpenAdminSite = true); //set to false to open the first Manila site instead. local (pta = html.getPageTableAddress ()); Çworkspace.pt = pta^ pta^.title = "It Worked!"; local (htmltext, indentlevel = 0); on add (s) { htmltext = htmltext + string.filledstring ("\t", indentlevel) + s + "\r"}; bundle { //set up a temp table to save messages for redirected pages if not defined (system.temp.frontier.setupFrontier) { new (tableType, @system.temp.frontier.setupFrontier)}}; local (errorMessage = "", confirmMessage = "", postedSection = "", flError = false, flConfirmPage = false, flPortForwardPage = false); if pta^.method == "POST" { Çworkspace.pt = pta^; edit (@workspace.pt) local (adrargs = @pta^.postArgs); on getInitials (s) { local (initials = ""); bundle { //strip off parentheticals if s contains "(" { s = string.nthField (s, "(", 1)}; if s contains "[" { s = string.nthField (s, "[", 1)}; if s contains "{" { s = string.nthField (s, "{", 1)}}; s = string.trimWhiteSpace (s); initials = string.upper (s[1]); local (i, ct = sizeOf (s)); if sizeOf (s) > 1 { local (flNextCharIsInitial = false); for i = 2 to ct { if flNextCharIsInitial { if string.isAlpha (s[i]) { initials = initials + string.upper (s[i])}; flNextCharIsInitial = false}; if not string.isAlpha (s[i]) { flNextCharIsInitial = true}}}; return (initials)}; on setName (name) { user.prefs.name = name; bundle { //set user.prefs.initials user.prefs.initials = getInitials (name)}}; on setEmail (email) { user.prefs.mailAddress = email}; on saveDatabases () { local (rootPath = window.getFile (@root)); on visitproc (f) { if f != rootPath { fileMenu.save (f)} else { fileMenu.saveMyRoot (@root)}; return (true)}; table.visitOpenDatabases (@visitproc); target.set (@root); fileMenu.save ()}; local (flFinishSetup = false); if defined (adrargs^.setupFrontier) { //personalization postedSection = "setupFrontier"; local (name = adrargs^.name); local (organization = adrargs^.organization); local (serverDomain = adrargs^.serverDomain); local (email = adrargs^.email); local (mailhost = adrargs^.mailHost); local (password = adrargs^.password); local (repeat = adrargs^.repeatPassword); if system.environment.isMac { //convert name, organization to Mac text name = latinToMac.convert (name); organization = latinToMac.convert (organization)}; setName (name); setEmail (email); user.prefs.organization = organization; user.prefs.mailHost = mailhost; config.mainResponder.prefs.baseUrl = "http://" + serverDomain + "/"; bundle { //check that the password is ok, and that it matches the repeat password if sizeOf (password) < 4 { errorMessage = "Can't continue setting up Frontier because the password you supplied is not at least four characters long."; flError = true}; if not flError { if password != repeat { errorMessage = "Can't continue setting up Frontier because the password you supplied does not match the repeat password."; flError = true}}}; bundle { //set up Admin member for access to control panel bundle { //create the Admin membership group if needed local (adrRoot = @[system.temp.mainResponder.membersRootFile]); local (adrGroup = @adrRoot^.admin); if not defined (adrGroup^) { new (tableType, adrGroup)}; if not defined (adrGroup^.callbacks) { new (tableType, @adrGroup^.callbacks)}; if not defined (adrGroup^.cookieDomain) { adrGroup^.cookieDomain = ""}; if not defined (adrGroup^.cookieExpires) { adrGroup^.cookieExpires = "Mon, 01 Apr 2030 07:00:00 GMT"}; if not defined (adrGroup^.cookieName) { adrGroup^.cookieName = "Admin"}; if not defined (adrGroup^.mailReturnAddress) { adrGroup^.mailReturnAddress = user.prefs.mailAddress}; if not defined (adrGroup^.mailSubject) { adrGroup^.mailSubject = "Admin"}; if not defined (adrGroup^.mailTemplate) { wp.newTextObject ("", @adrGroup^.mailTemplate)}; if not defined (adrGroup^.openToPublic) { adrGroup^.openToPublic = false}; if not defined (adrGroup^.users) { new (tableType, @adrGroup^.users)}}; local (adrMember = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)); if not defined (adrMember^) { new (tableType, adrMember)}; adrMember^.password = password; if not defined (adrMember^.personalInfo) { new (tableType, @adrMember^.personalInfo)}; if not defined (adrMember^.personalInfo.name) { adrMember^.personalInfo.name = user.prefs.name}}; if not flError { //complete the setup try { //trap network errors if system.environment.isCarbon { //we need to run the port forwarding page now flPortForwardPage = true} else { //Windows and Classic don't need to deal with port forwarding local (urlParts = string.urlSplit (config.mainResponder.prefs.baseUrl)); Frontier.completeSetup (urlParts[2], password); flConfirmPage = true; }}Çsystem.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage = false //require login from now on else { //network or other error errorMessage = tryError; flError = true}}}; if defined (adrargs^.proxy) { //set proxy settings postedSection = "proxy"; try { //convert port to a number -- if not, it's an error adrargs^.port = number (adrargs^.port)} else { errorMessage = "Can't set your proxy settings because the port you entered is not valid."; adrargs^.enabled = false; flError = true}; user.webBrowser.proxy.domain = adrargs^.domain; user.webBrowser.proxy.username = adrargs^.username; user.webBrowser.proxy.password = binary (adrargs^.password); user.webBrowser.proxy.enabled = false; if not flError { user.webBrowser.proxy.port = adrargs^.port}; if defined (adrargs^.enabled) { if adrargs^.enabled { user.webBrowser.proxy.enabled = true}}; //PBS 12/31/01: *true*, not false (that was a bug) if flError { //redirect to the proxy settings section of the page mainResponder.redirect ("http://" + pta^.host + pta^.uri + "#proxy")} else { confirmMessage = "Your proxy server information has been set."; mainResponder.redirect ("http://" + pta^.host + pta^.uri)}}; if defined (adrargs^.portForward) { //set port forwarding preferences local (adminPassword = adrargs^.password); local (flRememberAdminPassword = defined (adrargs^.flRememberAdminPassword)); local (flEnablePortForwarding = defined (adrargs^.flEnablePortForwarding)); local (actualPort = number (adrargs^.port)); if actualPort != user.inetd.config.http.port { local (flRunning = inetd.isDaemonRunning (@user.inetd.config.http)); if flRunning { //stop server, set port, restart server inetd.stopOne (@user.inetd.config.http); user.inetd.config.http.port = actualPort; inetd.startOne (@user.inetd.config.http)} else { //just set port user.inetd.config.http.port = actualPort}}; if flRememberAdminPassword and flEnablePortForwarding { user.prefs.portForwardingAdminPassword = binary (adminPassword)}; local (password = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)^.password); local (urlparts = string.urlSplit (config.mainResponder.prefs.baseUrl)); Frontier.completeSetup (urlparts[2], password, adminPassword, flRememberAdminPassword, flEnablePortForwarding); flConfirmPage = true; };Çsystem.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage = false //require login from now on Çif defined (adrargs^.confirmSetup) //redirect to the Control Panel home page ÇmainResponder.redirect ("http://" + pta^.host + "/") bundle { //if redirecting, set messages in the temp table, and don't bother to finish rendering saveDatabases (); if defined (pta^.responderAttributes.redirectUrl) { temp.frontier.postedSection = postedSection; temp.frontier.setupFrontier.flError = flError; temp.frontier.setupFrontier.errorMessage = errorMessage; temp.frontier.setupFrontier.message = confirmMessage; return ("")} else { //no redirect -- make sure messages are cleared temp.frontier.postedSection = ""; temp.frontier.setupFrontier.flError = false; temp.frontier.setupFrontier.errorMessage = ""; temp.frontier.setupFrontier.message = ""}}}; if flConfirmPage and (not flError) { //render the confirmation page bundle { //Confirmation page pta^.title = "Congratulations!"; local (adminSiteUrl = "http://" + pta^.host + "/"); local (t); new (tableType, @t); t.adminSiteUrl = adminSiteUrl; add (mainResponder.getString ("setupFrontier.newUserConfirmMessage", @t)); bundle { //add the Continue button add ("<form method=\"GET\" action=\"" + adminSiteUrl + "\">"); add ("<input type=\"submit\" value=\"Continue\" onclick=\"document.location='" + adminSiteUrl + "'\">"); add ("</form>")}; system.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage = false}; //require login from now on Çbundle //redirect to admin website home page Çif flOpenAdminSite //see the first line of this script above Çlocal (port, adminSiteUrl) Çport = user.inetd.config.http2.port Çif port == 80 ÇadminSiteUrl = "http://127.0.0.1/" Çelse ÇadminSiteUrl = "http://127.0.0.1:" + port + "/" ÇmainResponder.redirect (adminSiteUrl) Çelse Çlocal (myManilaServerSiteUrl = manilaSuite.getSiteUrl (@myManilaServerManilaWebsite)) ÇmainResponder.redirect (myManilaServerSiteUrl) Çreturn ("")}} else { //render the welcome/setup form bundle { //change the template to the setup template, which doesn't have navigation links to the rest of the control panel table.assign (@pta^.template, "setup"); pta^.indirectTemplate = true}; if flPortForwardPage { //oops -- unix: we have to deal with port forwarding local (t); new (tableType, @t); t.adminPassword = ""; t.rememberAdminPassword = "checked"; t.enablePortForwarding = "checked"; t.actualPort = user.inetd.config.http.port; if defined (user.prefs.portForwardingAdminPassword) { t.adminPassword = string (user.prefs.portForwardingAdminPassword)}; add (mainResponder.getString ("setupFrontier.portForward", @t))} else { //the main setup form and proxy settings local (name = user.prefs.name, email = user.prefs.mailAddress, organization = user.prefs.organization, mailHost = user.prefs.mailHost); if system.environment.isMac { //convert name, organization to latin text name = latinToMac.macToLatin (name); organization = latinToMac.macToLatin (organization)}; bundle { //render the new user page local (t); new (tabletype, @t); bundle { //add personal info to replacement table t.username = name; t.useremail = email; t.userorganization = organization; t.userpassword = ""; local (urlparts = string.urlSplit (config.mainResponder.prefs.baseUrl)); t.serverdomain = urlparts[2]; try { //try to get the admin password from the Admin membership group local (adrMember = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)); if defined (adrMember^) { t.userpassword = adrMember^.password}}; t.mailhost = mailHost}; bundle { //add proxy settings to replacement table with user.webBrowser.proxy { t.proxydomain = user.webBrowser.proxy.domain; t.proxyusername = user.webBrowser.proxy.username; t.proxypassword = string (user.webBrowser.proxy.password); t.proxyport = user.webBrowser.proxy.port; if user.webBrowser.proxy.enabled { t.proxyenabled = "checked"} else { t.proxyenabled = ""}}}; bundle { //add error or confirmation messages to replacement table t.proxyConfirm = ""; t.setupError = ""; t.proxyError = ""; if defined (system.temp.frontier.postedSection) { //only defined after the first POST if defined (system.temp.frontier.setupFrontier.flError) { //only defined after the first POST if temp.frontier.setupFrontier.flError { case temp.frontier.postedSection { "setupFrontier" { t.setupError = "<p><font color=\"red\">" + temp.frontier.setupFrontier.errorMessage + "</font></p>"}; "proxy" { t.proxyError = "<p><font color=\"red\">" + temp.frontier.setupFrontier.errorMessage + "</font></p>"}}} else { case temp.frontier.postedSection { "proxy" { t.proxyConfirm = "<p><font color=\"navy\">" + temp.frontier.setupFrontier.message + "</font></p>"}}}}}}; add (mainResponder.getString ("setupFrontier.main", @t))}}}; return (htmltext)}; Çbundle //testing Çlocal (pagetable); new (tableType, @pagetable) Çpagetable.method = "GET" Çhtml.setPageTableAddress (@pagetable) ÇsetupFrontier () Çhtml.deletePageTableAddress () \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:mainResponder.adminSite.website.setupFrontier ! on setupFrontier () { ÇChanges Ç7/4/05; 3:35:07 PM by TAC Çrewrite, based on old code <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/mainResponderRoot/mainResponder/adminSite/website/setupFrontier?rev=1.2> local (pta = html.getPageTableAddress ()); local (errorMessage = "", htmlText = "", indentLevel = 0, pathArgs = ""); on add (s) { htmlText = htmlText + string.filledstring ("\t", indentLevel) + s + "\r"}; on popupWindowLink (label, localizationStringId) { localizationStringId = string.urlEncode (localizationStringId); return ("<a href=\"JavaScript: newWindow=openWin ('" + string.popLeading (pta^.URI, '/') + "$popupWindow?label=" + string.urlEncode (label) + "&localizationStringId=" + localizationStringId + "', 'prefsPopup', 'width=400,height=400,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1'); newWindow.focus ()\">" + label + "</a>")}; if pta^.method == "POST" { local (adrArgs = @pta^.postArgs, flError = false); if defined (adrArgs^.personalize) { // personalize local (name = adrArgs^.name); local (organization = adrArgs^.organization); local (email = adrArgs^.email); local (mailHost = adrArgs^.mailHost); local (password = adrArgs^.password); local (repeat = adrArgs^.repeatPassword); try { // convert port to a number -- if not, it's an error adrArgs^.webServerPort = number (adrArgs^.webServerPort)} else { errorMessage = "Can't set the web server port because the port you entered is not valid."; flError = true}; on getInitials (s) { local (initials = ""); bundle { //strip off parentheticals if s contains "(" { s = string.nthField (s, "(", 1)}; if s contains "[" { s = string.nthField (s, "[", 1)}; if s contains "{" { s = string.nthField (s, "{", 1)}}; s = string.trimWhiteSpace (s); initials = string.upper (s[1]); local (i, ct = sizeOf (s)); if sizeOf (s) > 1 { local (flNextCharIsInitial = false); for i = 2 to ct { if flNextCharIsInitial { if string.isAlpha (s[i]) { initials = initials + string.upper (s[i])}; flNextCharIsInitial = false}; if not string.isAlpha (s[i]) { flNextCharIsInitial = true}}}; return (initials)}; on setName (name) { user.prefs.name = name; bundle { //set user.prefs.initials user.prefs.initials = getInitials (name)}}; on setEmail (email) { user.prefs.mailAddress = email}; if system.environment.isMac { //convert name, organization to Mac text name = latinToMac.convert (name); organization = latinToMac.convert (organization)}; setName (name); setEmail (email); user.prefs.organization = organization; user.prefs.mailHost = mailHost; config.mainResponder.prefs.baseUrl = "http://" + adrArgs^.webServerDomain + "/"; bundle { //check that the password is ok, and that it matches the repeat password if sizeOf (password) < 4 { errorMessage = "Can't continue setting up Frontier because the password you supplied is not at least four characters long."; flError = true}; if not flError { if password != repeat { errorMessage = "Can't continue setting up Frontier because the password you supplied does not match the repeat password."; flError = true}}}; bundle { //set up Admin member for access to control panel bundle { //create the Admin membership group if needed local (adrRoot = @[system.temp.mainResponder.membersRootFile]); local (adrGroup = @adrRoot^.admin); if not defined (adrGroup^) { new (tableType, adrGroup)}; if not defined (adrGroup^.callbacks) { new (tableType, @adrGroup^.callbacks)}; if not defined (adrGroup^.cookieDomain) { adrGroup^.cookieDomain = ""}; if not defined (adrGroup^.cookieExpires) { adrGroup^.cookieExpires = "Mon, 01 Apr 2030 07:00:00 GMT"}; if not defined (adrGroup^.cookieName) { adrGroup^.cookieName = "Admin"}; if not defined (adrGroup^.mailReturnAddress) { adrGroup^.mailReturnAddress = user.prefs.mailAddress}; if not defined (adrGroup^.mailSubject) { adrGroup^.mailSubject = "Admin"}; if not defined (adrGroup^.mailTemplate) { wp.newTextObject ("", @adrGroup^.mailTemplate)}; if not defined (adrGroup^.openToPublic) { adrGroup^.openToPublic = false}; if not defined (adrGroup^.users) { new (tableType, @adrGroup^.users)}}; local (adrMember = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)); if not defined (adrMember^) { new (tableType, adrMember)}; adrMember^.password = password; if not defined (adrMember^.personalInfo) { new (tableType, @adrMember^.personalInfo)}; if not defined (adrMember^.personalInfo.name) { adrMember^.personalInfo.name = user.prefs.name}}; if not (flError) { if adrArgs^.webServerPort != user.inetd.config.http.port { // web server port local (flRunning = inetd.isDaemonRunning (@user.inetd.config.http)); if flRunning { //stop server, set port, restart server inetd.stopOne (@user.inetd.config.http); user.inetd.config.http.port = adrArgs^.webServerPort; inetd.startOne (@user.inetd.config.http)} else { //just set port user.inetd.config.http.port = adrArgs^.webServerPort}}; scriptError ("!redirect " + pta^.URI + "$proxyServer")}}; if defined (adrArgs^.proxyServer) { // proxy server try { // convert port to a number -- if not, it's an error adrArgs^.port = number (adrArgs^.port)} else { errorMessage = "Can't set your proxy server settings because the port you entered is not valid."; adrArgs^.enabled = false; flError = true}; user.webBrowser.proxy.domain = adrArgs^.domain; user.webBrowser.proxy.username = adrArgs^.username; user.webBrowser.proxy.password = binary (adrArgs^.password); user.webBrowser.proxy.enabled = false; if defined (adrArgs^.enabled) { if adrArgs^.enabled { user.webBrowser.proxy.enabled = true}}; if not (flError) { user.webBrowser.proxy.port = adrArgs^.port; scriptError ("!redirect " + pta^.URI + "$portForwarding")}}; if defined (adrArgs^.portForwarding) { // port forwarding local (adminPassword = adrArgs^.password); local (flEnablePortForwarding = defined (adrArgs^.flEnablePortForwarding)); local (flRememberAdminPassword = defined (adrArgs^.flRememberAdminPassword)); local (password = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)^.password); local (urlParts = string.urlSplit (config.mainResponder.prefs.baseUrl)); bundle { // convert actualPort to a number -- if not, it's an error try { adrArgs^.actualPort = number (adrArgs^.actualPort)} else { errorMessage = "Can't set your actual web server port because the port you entered is not valid."; flEnablePortForwarding = false; flError = true}}; bundle { // convert apparentPort to a number -- if not, it's an error try { adrArgs^.apparentPort = number (adrArgs^.apparentPort)} else { errorMessage = "Can't set your apparent web server port because the port you entered is not valid."; flEnablePortForwarding = false; flError = true}}; if flRememberAdminPassword and flEnablePortForwarding { user.prefs.portForwardingAdminPassword = binary (adminPassword)}; if not (flError) { if adrArgs^.actualPort != user.inetd.config.http.port or adrArgs^.apparentPort != user.inetd.config.http.apparentPort { local (flRunning = inetd.isDaemonRunning (@user.inetd.config.http)); if flRunning { // stop server, set port, restart server inetd.stopOne (@user.inetd.config.http); user.inetd.config.http.apparentPort = adrArgs^.apparentPort; user.inetd.config.http.port = adrArgs^.actualPort; inetd.startOne (@user.inetd.config.http)} else { // just set port user.inetd.config.http.apparentPort = adrArgs^.apparentPort; user.inetd.config.http.port = adrArgs^.actualPort}}}; Frontier.completeSetup (urlParts [2], password, adminPassword, flRememberAdminPassword, flEnablePortForwarding); if not (flError) { scriptError ("!redirect " + pta^.URI + "$congratulations")}}}; if defined (pta^.pathArgs) { if pta^.pathArgs != "" { pathArgs = pta^.pathArgs}}; case pathArgs { // generally the cases should be ordered in user presentation order, they can be accessed by name or number, name is preferred "1"; "personalize" { local (name = user.prefs.name, organization = user.prefs.organization); pta^.title = "Personalize"; bundle { // change the template to the setup template, which doesn't have navigation links to the rest of the admin site table.assign (@pta^.template, "setup"); pta^.indirectTemplate = true}; if system.environment.isMac { // convert name, organization to latin text name = latinToMac.macToLatin (name); organization = latinToMac.macToLatin (organization)}; bundle { //render the new user page local (t); new (tabletype, @t); bundle { // add the labels to the replacement table t.webserverdomainlabel = popupWindowLink ("Web server domain name or IP address", "setupFrontier.popupText.webServerDomainIp")}; bundle { // add personal info to replacement table t.mailhost = user.prefs.mailHost; t.useremail = user.prefs.mailAddress; t.username = name; t.userorganization = organization; t.userpassword = ""; bundle { // web server domain or ip address local (urlParts = string.urlSplit (config.mainResponder.prefs.baseUrl)); t.webserverdomain = urlParts [2]}; try { // try to get the admin password from the Admin membership group local (adrMember = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)); if defined (adrMember^) { t.userpassword = adrMember^.password}}; bundle { // web server port t.webserverport = user.inetd.config.http.port}}; bundle { // add error message to replacement table t.errorMessage = ""; if errorMessage != "" { t.errorMessage = "<p style=\"color: red;\">" + errorMessage + "</p>"}}; add (mainResponder.getString ("setupFrontier.personalize", @t))}}; "2"; "proxyServer" { pta^.title = "Proxy Server Settings"; bundle { // change the template to the setup template, which doesn't have navigation links to the rest of the admin site table.assign (@pta^.template, "setup"); pta^.indirectTemplate = true}; bundle { // render the new user page local (t); new (tabletype, @t); bundle { // add proxy settings to replacement table with user.webBrowser.proxy { t.proxydomain = domain; t.proxyusername = username; t.proxypassword = string (password); t.proxyport = port; if enabled { t.proxyenabled = "checked"} else { t.proxyenabled = ""}}}; bundle { // add error message to replacement table t.errorMessage = ""; if errorMessage != "" { t.errorMessage = "<p style=\"color: red;\">" + errorMessage + "</p>"}}; add (mainResponder.getString ("setupFrontier.proxyServer", @t))}}; "3"; "portForwarding" { if system.environment.isCarbon { //we need to run the port forwarding page now pta^.title = "Mac OS X Port Forwarding"; bundle { // change the template to the setup template, which doesn't have navigation links to the rest of the admin site table.assign (@pta^.template, "setup"); pta^.indirectTemplate = true}; bundle { // render the new user page local (t); new (tabletype, @t); t.adminPassword = ""; t.rememberAdminPassword = "checked"; t.enablePortForwarding = "checked"; t.actualPort = user.inetd.config.http.port; t.apparentPort = 80; if defined (user.inetd.config.http.apparentPort) { t.apparentPort = user.inetd.config.http.apparentPort}; if defined (user.prefs.portForwardingAdminPassword) { t.adminPassword = string (user.prefs.portForwardingAdminPassword)}; bundle { // add error message to replacement table t.errorMessage = ""; if errorMessage != "" { t.errorMessage = "<p style=\"color: red;\">" + errorMessage + "</p>"}}; add (mainResponder.getString ("setupFrontier.portForwarding", @t))}} else { //Windows and Classic don't need to deal with port forwarding local (password = mainResponder.members.getMemberTable ("Admin", user.prefs.mailAddress)^.password); local (urlParts = string.urlSplit (config.mainResponder.prefs.baseUrl)); Frontier.completeSetup (urlParts [2], password); scriptError ("!redirect " + pta^.URI + "$congratulations")}}; "4"; "congratulations" { bundle { // change the template to the setup template, which doesn't have navigation links to the rest of the admin site table.assign (@pta^.template, "setup"); pta^.indirectTemplate = true}; pta^.title = "Congratulations"; local (adminSiteUrl = "http://" + pta^.host + "/"); bundle { //render the new user page add (mainResponder.getString ("setupFrontier.newUserConfirmMessage")); bundle { //add the Continue button local (adminSiteUrl = "http://" + pta^.host + "/"); add ("<form method=\"GET\" action=\"" + adminSiteUrl + "\">"); add ("<input type=\"submit\" value=\"Continue\" onclick=\"document.location='" + adminSiteUrl + "'\">"); add ("</form>")}; if defined (system.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage) { system.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage = false}}}; //require login from now on "popupWindow" { // this is a special case, it produces a popup window pta^.autoParagraphs = true; pta^.title = "Popup Text"; table.assign (@pta^.template, "{bodytext}"); try { delete (@pta^.javaScript)}; // popup windows should not have any JavaScript add ("<div name=\"setupfrontierpopupwindow\" style=\"font-size: x-large; margin: 13px;\">"); indentLevel++; add ("<b>"); indentLevel++; add (string.urlDecode (pta^.searchArgTable.label)); add ("</b>"); indentLevel--; add ("<br/>"); add ("<br/>"); add (mainResponder.getString (pta^.searchArgTable.localizationStringId)); add ("</div>"); indentLevel--}} else { scriptError ("!redirect " + pta^.URI + "$personalize")}; return (htmlText)} \ No newline at end of file |