[Mydatabasepilot-cvs] MyDatabasePilot Application.cfm,1.4,1.5 MyDatabasePilot.cfm,1.6,1.7
Status: Alpha
Brought to you by:
nanoface
From: <nan...@us...> - 2003-04-24 03:07:16
|
Update of /cvsroot/mydatabasepilot/MyDatabasePilot In directory sc8-pr-cvs1:/tmp/cvs-serv7973 Modified Files: Application.cfm MyDatabasePilot.cfm Log Message: Internal Structure Changed: [ 725992 ] Create new session var dbName Index: Application.cfm =================================================================== RCS file: /cvsroot/mydatabasepilot/MyDatabasePilot/Application.cfm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Application.cfm 23 Apr 2003 03:45:44 -0000 1.4 --- Application.cfm 24 Apr 2003 03:07:09 -0000 1.5 *************** *** 6,18 **** ********************************************************************************************---> ! <!---||| Set application name and enable sesson variables and enable client variables in the form of cookies |||---> <cfapplication name="MyDatabasePilot" clientmanagement="yes" sessionmanagement="yes" setclientcookies="yes" setdomaincookies="no" sessiontimeout="#CreateTimeSpan(0,0,15,0)#"> ! <!---||| Used in Debugging |||---> <!---<cfsetting showdebugoutput="No"> Specifies whether to show debugging output---> <!---<cfsetting enablecfoutputonly="yes"> Disables output of text that is not included inside cfoutput tags---> <!---<cfsetting requestTimeOut = "value in seconds"> You can use this setting to increase the page time-out if your application or page frequently accesses external resources that might be particularly slow---> ! <!---||| Set custom global error handling pages |||---> <!--- This is on the ToDo list <cferror type="exception" template="ErrorHandling/ExceptionErr.cfm"> --- 6,25 ---- ********************************************************************************************---> ! <!----------------------------------------------------------> ! <!--- Set application name and enable sesson variables ---> ! <!--- and enable client variables in the form of cookies ---> ! <!----------------------------------------------------------> <cfapplication name="MyDatabasePilot" clientmanagement="yes" sessionmanagement="yes" setclientcookies="yes" setdomaincookies="no" sessiontimeout="#CreateTimeSpan(0,0,15,0)#"> ! <!-------------------------> ! <!--- Used in Debugging ---> ! <!-------------------------> <!---<cfsetting showdebugoutput="No"> Specifies whether to show debugging output---> <!---<cfsetting enablecfoutputonly="yes"> Disables output of text that is not included inside cfoutput tags---> <!---<cfsetting requestTimeOut = "value in seconds"> You can use this setting to increase the page time-out if your application or page frequently accesses external resources that might be particularly slow---> ! <!----------------------------------------------> ! <!--- Set custom global error handling pages ---> ! <!----------------------------------------------> <!--- This is on the ToDo list <cferror type="exception" template="ErrorHandling/ExceptionErr.cfm"> *************** *** 22,60 **** ---> ! <!---||| Iniialize Client Variables |||---> <!---Add Client Variables here if any---> ! <!---||| Initialize Session Variables |||---> ! <!--- Note for Server Clusters: ! Since Session Variables can not be used in server clusters except those that support sticky sessions, ! this section (and anything that is dependent on Session Variables) may need to be rewritten as Client ! Variables for server clusters (We will see how many users actually run server cluster before spending ! to much time on this.)---> <!--- Lock code that uses session variables to ensure data integrity ---> <cflock timeout = "30" throwontimeout="no" type = "exclusive" scope = "session"> ! <!--- Initialize variables used by queries to connect to the database ---> <cfif NOT IsDefined("session.dataSource")> ! <!--- If you choose to configure a default database, you must set these variables to an actual ! database that you have complete access to ---> <cfset session.dataSource = ""> <!--- Enter default Data Source ---> <cfset session.userName = ""> <!--- Enter default User Name ---> <cfset session.password = ""> <!--- Enter default password ---> </cfif> - </cflock> ! <!---||| Ensure that session has not expired or a default data source is provided |||---> ! <!--- Lock code that uses session variables to ensure data integrity ---> ! <cflock timeout = "30" throwontimeout="no" type = "exclusive" scope = "session"> <!--- If datasource is Empty String, this would indicate that no default data source was provided ---> ! <!--- If user is not loggedIn and no default datasource exists, and login page was not yet requested ---> ! <cfif session.dataSource IS "" AND NOT IsDefined("session.loggedIn") AND NOT IsDefined("session.requestLogIn")> ! <!--- This line is needed so user is not sent on an endless redirect, since even the login form page calls the Application.cfm file ---> ! <cfset session.requestLogIn = "1"> ! <!--- Redirect User to login form if no data source exists ---> <cflocation url="index.cfm"> </cfif> </cflock> ! <!---||| Set Application-Wide Local scope variables |||---> <cfset applicationName = "MyDatabase Pilot"> <cfset applicationVersion = "v0.7.0(Alpha)"> --- 29,100 ---- ---> ! <!----------------------------------> ! <!--- Iniialize Client Variables ---> ! <!----------------------------------> <!---Add Client Variables here if any---> ! <!------------------------------------> ! <!--- Initialize Session Variables ---> ! <!------------------------------------> ! <!--- NOTE FOR SERVER CLUSTERS: ! Since Session Variables can not be used in server clusters except those that support sticky sessions, ! this section (and anything that is dependent on Session Variables) may need to be rewritten as Client ! Variables for server clusters (We will see how many users actually run server cluster before spending ! to much time on this.)---> <!--- Lock code that uses session variables to ensure data integrity ---> <cflock timeout = "30" throwontimeout="no" type = "exclusive" scope = "session"> ! <!---||| Initialize connection variables used by queries to connect to the database |||---> ! <!--- If dataSource does not exist ... ---> <cfif NOT IsDefined("session.dataSource")> ! <!--- NOTE FOR DEFAULT DATABASE USERS: ! If you choose to configure a default database, you must set the dataSource, userName and password ! variables to an actual database that you have complete access to ---> ! <!--- Initialize connection variables ---> <cfset session.dataSource = ""> <!--- Enter default Data Source ---> <cfset session.userName = ""> <!--- Enter default User Name ---> <cfset session.password = ""> <!--- Enter default password ---> </cfif> ! <!---||| Ensure User is Logged In and Session has not Expired |||---> ! <!--- If session is new or has expired ... ---> ! <cfif NOT IsDefined("session.loggedIn")> ! <!--- Check if default dataSource was configured ---> ! <!--- If dataSource is empty string ... ---> ! <cfif session.dataSource IS ""> ! <!--- this would indicate that no default data source was provided and user is not logged into any datasource ---> ! <cfset session.loggedIn = 0> ! <!--- Redirect User to login form ---> ! <cflocation url="index.cfm"> ! <cfelse> ! <!--- Otherwise user is logged in using default datasource configuration ---> ! <cfset session.loggedIn = 1> ! </cfif> ! </cfif> ! <!--- If requestLogIn does not exist, then set it to FALSE ! <cfif NOT IsDefined("session.requestLogIn")><cfset session.requestLogIn = 0></cfif> ! ! <!---||| Ensure that session has not expired or a default data source is provided |||---> <!--- If datasource is Empty String, this would indicate that no default data source was provided ---> ! <!--- If user is not loggedIn and no default datasource was provided, and login page was not yet requested ... ---> ! <cfif session.dataSource IS "" AND session.loggedIn IS FALSE AND session.requestLogIn IS FALSE> ! <!--- Set the requestLogIn flag to True ---> ! <cfset session.requestLogIn = "1"><!--- This line is needed so user is not sent on an endless redirect, since even the login form page calls the Application.cfm file ---> ! <!--- Redirect User to login form ---> <cflocation url="index.cfm"> + </cfif>---> + + <!---||| Initialize dbName |||---> + <!--- If dbName does not exist, and user is logged in ... ---> + <cfif NOT IsDefined("session.dbName") AND session.loggedIn IS TRUE> + <!--- Find out the Database Name by calling thisDatabaseName Query ---> + <cfinclude template="Query/LockRequired/thisDatabaseName.cfm"> + <!--- Set dbName Variable with result of thisDatabaseName Query ---> + <cfset session.dbName = "#thisDatabaseName.databaseName#"> </cfif> </cflock> ! <!--------------------------------------------------> ! <!--- Set Application-Wide Local scope variables ---> ! <!--------------------------------------------------> <cfset applicationName = "MyDatabase Pilot"> <cfset applicationVersion = "v0.7.0(Alpha)"> *************** *** 65,69 **** <cfset currentPage = "#currentPath#?#currentQueryString#"> ! <!---||| Include User-Defined Functions Used on Most Pages |||---> <!--- A need for this has not yet been determined <cfinclude template="Functions/SomeFunction.cfm"> --- 105,111 ---- <cfset currentPage = "#currentPath#?#currentQueryString#"> ! <!---------------------------------------------------------> ! <!--- Include User-Defined Functions Used on Most Pages ---> ! <!---------------------------------------------------------> <!--- A need for this has not yet been determined <cfinclude template="Functions/SomeFunction.cfm"> Index: MyDatabasePilot.cfm =================================================================== RCS file: /cvsroot/mydatabasepilot/MyDatabasePilot/MyDatabasePilot.cfm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MyDatabasePilot.cfm 21 Apr 2003 22:31:51 -0000 1.6 --- MyDatabasePilot.cfm 24 Apr 2003 03:07:09 -0000 1.7 *************** *** 8,12 **** ********************************************************************************************---> ! <!---||| Set database connection variables if new one was passed to this template |||---> <!--- Check to see if this template was called by FORM_LogintoDB with a new dataSource ---> <cfif IsDefined("Form.dataSource")> --- 8,12 ---- ********************************************************************************************---> ! <!---||| Reset session variables if new database was requested |||---> <!--- Check to see if this template was called by FORM_LogintoDB with a new dataSource ---> <cfif IsDefined("Form.dataSource")> *************** *** 19,31 **** <cfset session.userName = #Trim(Form.userName)#> <!--- User Name ---> <cfset session.password = #Trim(Form.password)#> <!--- Password ---> ! <cfset session.loggedIn = "1"> <!--- Set the loggedIn Flag to True ---> </cflock> </cfif> <!---||| Run Queries needed for body of Document based on the particular dbProcess Request |||---> ! <!--- Run dbGeneralInfo Query ---> ! <cfinclude template="Query/dbGeneralInfo.cfm"> ! <!--- Run any dbProcess specific Queries ---> ! <cfswitch expression="#dbProcess#"> <cfcase value="ShowTables"><cfinclude template="Query/tableList.cfm"></cfcase> <cfcase value="ShowFields"><cfinclude template="Query/fieldList.cfm"></cfcase> --- 19,33 ---- <cfset session.userName = #Trim(Form.userName)#> <!--- User Name ---> <cfset session.password = #Trim(Form.password)#> <!--- Password ---> ! <!--- Set the loggedIn Flag to True ---> ! <cfset session.loggedIn = 1> ! <!--- Find out the Database Name and Overwrite dbName Variable ---> ! <cfinclude template="Query/LockRequired/thisDatabaseName.cfm"> ! <cfset session.dbName = "#thisDatabaseName.databaseName#"> </cflock> </cfif> <!---||| Run Queries needed for body of Document based on the particular dbProcess Request |||---> ! <!--- Which dbProcess was requested? ---> ! <cfswitch expression="#dbProcess#"> <cfcase value="ShowTables"><cfinclude template="Query/tableList.cfm"></cfcase> <cfcase value="ShowFields"><cfinclude template="Query/fieldList.cfm"></cfcase> *************** *** 52,57 **** <cfinclude template="Include/MainMenu.cfm"> <td valign="top"> ! <h2>Current Database: <cfoutput query="dbGeneralInfo">#dbInUse#</cfoutput></h2> ! <!--- Execute Requested dbProcess ---> <cfswitch expression="#dbProcess#"> <cfcase value="ShowTables"><cfinclude template="dbProcessBody/ShowTables.cfm"></cfcase> --- 54,64 ---- <cfinclude template="Include/MainMenu.cfm"> <td valign="top"> ! <!---||| Show Current Database |||---> ! <!--- Initiate a readonly lock to ensure the integrity of session variables ---> ! <cflock timeout = "30" throwontimeout="no" type = "readonly" scope = "session"> ! <h2>Current Database: <cfoutput>#session.dbName#</cfoutput></h2> ! </cflock> ! ! <!---||| Output the Result of User Requested dbProcess |||---> <cfswitch expression="#dbProcess#"> <cfcase value="ShowTables"><cfinclude template="dbProcessBody/ShowTables.cfm"></cfcase> |