|
Revision 5, 1.2 kB
(checked in by DanWilson, 17 years ago)
|
|
Initial Commit Of ModelGlue? Website (upgrade to blogcfc 511)
|
| Line | |
|---|
| 1 | <cfcomponent displayName="Soundings" hint="Core CFC for the application. Main purpose is to handle settings." output="false"> |
|---|
| 2 | |
|---|
| 3 | <cffunction name="getSettings" access="public" returnType="struct" output="false" |
|---|
| 4 | hint="Returns application settings as a structure."> |
|---|
| 5 | |
|---|
| 6 | <!--- load the settings from the ini file ---> |
|---|
| 7 | <cfset var settingsFile = replace(getDirectoryFromPath(getCurrentTemplatePath()),"\","/","all") & "/settings.ini"> |
|---|
| 8 | <cfset var iniData = getProfileSections(settingsFile)> |
|---|
| 9 | <cfset var r = structNew()> |
|---|
| 10 | <cfset var key = ""> |
|---|
| 11 | |
|---|
| 12 | <cfloop index="key" list="#iniData.settings#"> |
|---|
| 13 | <cfset r[key] = getProfileString(settingsFile,"settings",key)> |
|---|
| 14 | </cfloop> |
|---|
| 15 | |
|---|
| 16 | <cfreturn r> |
|---|
| 17 | |
|---|
| 18 | </cffunction> |
|---|
| 19 | |
|---|
| 20 | <cffunction name="setPassword" access="public" returnType="void" output="false" roles="surveyadmin" |
|---|
| 21 | hint="Updates the password"> |
|---|
| 22 | <cfargument name="password" type="string" required="true" hint="Hashed version of password."> |
|---|
| 23 | <cfset var settingsFile = replace(getDirectoryFromPath(getCurrentTemplatePath()),"\","/","all") & "/settings.ini"> |
|---|
| 24 | |
|---|
| 25 | <cfset setProfileString(settingsFile,"settings","password",arguments.password)> |
|---|
| 26 | </cffunction> |
|---|
| 27 | |
|---|
| 28 | </cfcomponent> |
|---|