Skip to content
This repository
Newer
Older
100644 307 lines (251 sloc) 13.437 kb
5ca71da5 » mattlevine
2009-04-15 adding licenses
1 <!--- This file is part of Mura CMS.
2
3 Mura CMS is free software: you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation, Version 2 of the License.
6
7 Mura CMS is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
7903353c » mattlevine
2010-07-06 1. Adding application.instanceID to determine witch Mura instance in …
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ÔøΩSee the
5ca71da5 » mattlevine
2009-04-15 adding licenses
10 GNU General Public License for more details.
11
12 You should have received a copy of the GNU General Public License
7903353c » mattlevine
2010-07-06 1. Adding application.instanceID to determine witch Mura instance in …
13 along with Mura CMS. ÔøΩIf not, see <http://www.gnu.org/licenses/>.
5ca71da5 » mattlevine
2009-04-15 adding licenses
14
15 Linking Mura CMS statically or dynamically with other modules constitutes
16 the preparation of a derivative work based on Mura CMS. Thus, the terms and
7903353c » mattlevine
2010-07-06 1. Adding application.instanceID to determine witch Mura instance in …
17 conditions of the GNU General Public License version 2 (ÔøΩGPLÔøΩ) cover the entire combined work.
5ca71da5 » mattlevine
2009-04-15 adding licenses
18
19 However, as a special exception, the copyright holders of Mura CMS grant you permission
20 to combine Mura CMS with programs or libraries that are released under the GNU Lesser General Public License version 2.1.
21
7903353c » mattlevine
2010-07-06 1. Adding application.instanceID to determine witch Mura instance in …
22 In addition, as a special exception, ÔøΩthe copyright holders of Mura CMS grant you permission
23 to combine Mura CMS ÔøΩwith independent software modules that communicate with Mura CMS solely
5ca71da5 » mattlevine
2009-04-15 adding licenses
24 through modules packaged as Mura CMS plugins and deployed through the Mura CMS plugin installation API,
7903353c » mattlevine
2010-07-06 1. Adding application.instanceID to determine witch Mura instance in …
25 provided that these modules (a) may only modify the ÔøΩ/trunk/www/plugins/ directory through the Mura CMS
5ca71da5 » mattlevine
2009-04-15 adding licenses
26 plugin installation API, (b) must not alter any default objects in the Mura CMS database
27 and (c) must not alter any files in the following directories except in cases where the code contains
28 a separately distributed license.
29
30 /trunk/www/admin/
31 /trunk/www/tasks/
32 /trunk/www/config/
33 /trunk/www/requirements/mura/
34
35 You may copy and distribute such a combined work under the terms of GPL for Mura CMS, provided that you include
36 the source code of that other code when and as the GNU GPL requires distribution of source code.
37
38 For clarity, if you create a modified version of Mura CMS, you are not obligated to grant this special exception
39 for your modified version; it is your choice whether to do so, or to make such modified version available under
7903353c » mattlevine
2010-07-06 1. Adding application.instanceID to determine witch Mura instance in …
40 the GNU General Public License version 2 ÔøΩwithout this exception. ÔøΩYou may, if you choose, apply this exception
5ca71da5 » mattlevine
2009-04-15 adding licenses
41 to your own modified versions of Mura CMS.
42 --->
9a64f5ae » mattlevine
2009-04-05 Added new event based system for the front controller
43 <cfcomponent output="false" extends="mura.cfobject">
44
3a29be4d » mattlevine
2010-04-29 git-svn-id: http://svn.blueriver.com/mura/trunk/www@2186 50f7a5e4-a14…
45 <cffunction name="purgeSiteCache" returntype="any" access="remote" output="false">
6e16f02f » mattlevine
2010-07-05 1. Adding logic to store remote host of comments.
46 <cfargument name="siteid" required="true" default="">
00756008 » mattlevine
2011-05-17 1. Adding two tier caching for data and output cache types.
47 <cfargument name="type" required="true" default="" hint="data, output or both">
6e16f02f » mattlevine
2010-07-05 1. Adding logic to store remote host of comments.
48 <cfargument name="appreloadkey" required="true" default="">
8e8b0cf4 » mattlevine
2010-07-06 1. Adding application.instanceID to determine witch Mura instance in …
49 <cfargument name="instanceID" required="true" default="">
7903353c » mattlevine
2010-07-06 1. Adding application.instanceID to determine witch Mura instance in …
50 <cfif arguments.instanceID neq application.instanceID
8e8b0cf4 » mattlevine
2010-07-06 1. Adding application.instanceID to determine witch Mura instance in …
51 and arguments.appreloadkey eq application.appreloadkey>
6e16f02f » mattlevine
2010-07-05 1. Adding logic to store remote host of comments.
52 <cfif len(arguments.siteid)>
00756008 » mattlevine
2011-05-17 1. Adding two tier caching for data and output cache types.
53 <cfset application.settingsManager.getSite(arguments.siteID).purgeCache(type=arguments.type)>
6e16f02f » mattlevine
2010-07-05 1. Adding logic to store remote host of comments.
54 <cfelse>
55 <cfset application.settingsManager.purgeAllCache()>
56 </cfif>
57 </cfif>
9a64f5ae » mattlevine
2009-04-05 Added new event based system for the front controller
58 </cffunction>
59
86f246eb » mattlevine
2011-05-16 1. Adding cache purge broadcasting to the cluster manager.
60 <cffunction name="purgeUserCache" returntype="any" access="remote" output="false">
61 <cfargument name="userID" required="true" default="">
62 <cfargument name="appreloadkey" required="true" default="">
63 <cfargument name="instanceID" required="true" default="">
64 <cfif arguments.instanceID neq application.instanceID
65 and arguments.appreloadkey eq application.appreloadkey>
66 <cfset application.userManager.purgeUserCache(userid=arguments.userID)>
67 </cfif>
68 </cffunction>
69
70 <cffunction name="purgeCategoryCache" returntype="any" access="remote" output="false">
71 <cfargument name="categoryID" required="true" default="">
72 <cfargument name="appreloadkey" required="true" default="">
73 <cfargument name="instanceID" required="true" default="">
74 <cfif arguments.instanceID neq application.instanceID
75 and arguments.appreloadkey eq application.appreloadkey>
76 <cfset application.categoryManager.purgeCategoryCache(categoryID=arguments.categoryID)>
77 </cfif>
78 </cffunction>
79
80 <cffunction name="purgeCategoryDescendentsCache" returntype="any" access="remote" output="false">
81 <cfargument name="categoryID" required="true" default="">
82 <cfargument name="appreloadkey" required="true" default="">
83 <cfargument name="instanceID" required="true" default="">
84 <cfif arguments.instanceID neq application.instanceID
85 and arguments.appreloadkey eq application.appreloadkey>
00756008 » mattlevine
2011-05-17 1. Adding two tier caching for data and output cache types.
86 <cfset application.categoryManager.purgeCategoryDescendentsCache(categoryID=arguments.categoryID)>
87 </cfif>
88 </cffunction>
89
90 <cffunction name="purgeContentCache" returntype="any" access="remote" output="false">
91 <cfargument name="contentID" required="true" default="">
92 <cfargument name="siteID" required="true" default="">
93 <cfargument name="appreloadkey" required="true" default="">
94 <cfargument name="instanceID" required="true" default="">
95 <cfif arguments.instanceID neq application.instanceID
96 and arguments.appreloadkey eq application.appreloadkey>
97 <cfset application.contentManager.purgeContentCache(contentID=arguments.contentID,siteID=arguments.siteID)>
98 </cfif>
99 </cffunction>
100
101 <cffunction name="purgeContentDescendentsCache" returntype="any" access="remote" output="false">
102 <cfargument name="contentID" required="true" default="">
103 <cfargument name="siteID" required="true" default="">
104 <cfargument name="appreloadkey" required="true" default="">
105 <cfargument name="instanceID" required="true" default="">
106 <cfif arguments.instanceID neq application.instanceID
107 and arguments.appreloadkey eq application.appreloadkey>
108 <cfset application.contentManager.purgeContentDescendentsCache(contentID=arguments.contentID,siteID=arguments.siteID)>
86f246eb » mattlevine
2011-05-16 1. Adding cache purge broadcasting to the cluster manager.
109 </cfif>
110 </cffunction>
111
3a29be4d » mattlevine
2010-04-29 git-svn-id: http://svn.blueriver.com/mura/trunk/www@2186 50f7a5e4-a14…
112 <cffunction name="reload" returntype="any" access="remote" output="false">
6e16f02f » mattlevine
2010-07-05 1. Adding logic to store remote host of comments.
113 <cfargument name="appreloadkey" required="true" default="">
8e8b0cf4 » mattlevine
2010-07-06 1. Adding application.instanceID to determine witch Mura instance in …
114 <cfargument name="instanceID" required="true" default="">
7903353c » mattlevine
2010-07-06 1. Adding application.instanceID to determine witch Mura instance in …
115 <cfif arguments.instanceID neq application.instanceID
8e8b0cf4 » mattlevine
2010-07-06 1. Adding application.instanceID to determine witch Mura instance in …
116 and arguments.appreloadkey eq application.appreloadkey>
6e16f02f » mattlevine
2010-07-05 1. Adding logic to store remote host of comments.
117 <cfset application.appInitialized=false/>
118 <cfset application.broadcastInit=false />
119 </cfif>
9a64f5ae » mattlevine
2009-04-05 Added new event based system for the front controller
120 </cffunction>
121
3a29be4d » mattlevine
2010-04-29 git-svn-id: http://svn.blueriver.com/mura/trunk/www@2186 50f7a5e4-a14…
122 <cffunction name="login" returntype="any" output="false" access="remote">
3f0649e2 » mattlevine
2010-02-02 1. Merging 5.2 to trunk.
123 <cfargument name="username">
124 <cfargument name="password">
125 <cfargument name="siteID">
126 <cfset var authToken=hash(createUUID())>
127 <cfset var rsSession="">
128 <cfset var sessionData="">
129
130 <cfset application.loginManager.remoteLogin(arguments)>
131
132 <cfif session.mura.isLoggedIn>
133 <cfwddx action="cfml2wddx" output="sessionData" input="#session.mura#">
134
135 <cfquery name="rsSession" datasource="#application.configBean.getDatasource()#" username="#application.configBean.getDBUsername()#" password="#application.configBean.getDBPassword()#">
136 select * from tuserremotesessions
137 where userID=<cfqueryparam cfsqltype="cf_sql_varchar" value="#session.mura.userID#">
138 </cfquery>
139
140 <cfif rsSession.recordcount>
141
142 <cfif rsSession.lastAccessed gte dateAdd("h",-3,now()) and application.configBean.getSharableRemoteSessions()>
143 <cfquery datasource="#application.configBean.getDatasource()#" username="#application.configBean.getDBUsername()#" password="#application.configBean.getDBPassword()#">
144 update tuserremotesessions set
145 data=<cfqueryparam cfsqltype="cf_sql_varchar" value="#sessionData#">,
f4e2a94a » mattlevine
2011-05-14 1. Switching from createODBCDatetime to cfqueryparam
146 lastAccessed=<cfqueryparam cfsqltype="cf_sql_timestamp" value="#now()#">
3f0649e2 » mattlevine
2010-02-02 1. Merging 5.2 to trunk.
147 where userID=<cfqueryparam cfsqltype="cf_sql_varchar" value="#session.mura.userID#">
148 </cfquery>
149
150 <cfset authToken=rsSession.AuthToken>
151
152 <cfelse>
153 <cfquery datasource="#application.configBean.getDatasource()#" username="#application.configBean.getDBUsername()#" password="#application.configBean.getDBPassword()#">
154 update tuserremotesessions set
155 authToken=<cfqueryparam cfsqltype="cf_sql_varchar" value="#authToken#">,
156 data=<cfqueryparam cfsqltype="cf_sql_varchar" value="#sessionData#">,
f4e2a94a » mattlevine
2011-05-14 1. Switching from createODBCDatetime to cfqueryparam
157 created=<cfqueryparam cfsqltype="cf_sql_timestamp" value="#now()#">,
158 lastAccessed=<cfqueryparam cfsqltype="cf_sql_timestamp" value="#now()#">
3f0649e2 » mattlevine
2010-02-02 1. Merging 5.2 to trunk.
159 where userID=<cfqueryparam cfsqltype="cf_sql_varchar" value="#session.mura.userID#">
160 </cfquery>
161
162 </cfif>
163 <cfelse>
164 <cfquery datasource="#application.configBean.getDatasource()#" username="#application.configBean.getDBUsername()#" password="#application.configBean.getDBPassword()#">
165 INSERT Into tuserremotesessions (userID,authToken,data,created,lastAccessed)
166 values(
167 <cfqueryparam cfsqltype="cf_sql_varchar" value="#session.mura.userID#">,
168 <cfqueryparam cfsqltype="cf_sql_varchar" value="#authToken#">,
169 <cfqueryparam cfsqltype="cf_sql_varchar" value="#sessionData#">,
f4e2a94a » mattlevine
2011-05-14 1. Switching from createODBCDatetime to cfqueryparam
170 <cfqueryparam cfsqltype="cf_sql_timestamp" value="#now()#">,
171 <cfqueryparam cfsqltype="cf_sql_timestamp" value="#now()#">
3f0649e2 » mattlevine
2010-02-02 1. Merging 5.2 to trunk.
172 )
173 </cfquery>
174
175 </cfif>
176
177
178 <cfreturn authToken>
179 <cfelse>
180 <cfif isDate(session.blockLoginUntil) and session.blockLoginUntil gt now()>
181 <cfset application.loginManager.logout()>
182 <cfreturn "blocked">
183 <cfelse>
184 <cfset application.loginManager.logout()>
185 <cfreturn "false">
186 </cfif>
187 </cfif>
188 </cffunction>
189
3a29be4d » mattlevine
2010-04-29 git-svn-id: http://svn.blueriver.com/mura/trunk/www@2186 50f7a5e4-a14…
190 <cffunction name="logout" returntype="any" output="false" access="remote">
3f0649e2 » mattlevine
2010-02-02 1. Merging 5.2 to trunk.
191 <cfargument name="authToken">
192
193 <cfquery datasource="#application.configBean.getDatasource()#" username="#application.configBean.getDBUsername()#" password="#application.configBean.getDBPassword()#">
194 update tuserremotesessions set
195 lastAccessed=#createODBCDateTime(dateAdd("h",-3,now()))#
196 where authToken=<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.authToken#">
197 </cfquery>
198
199 <cfset application.loginManager.logout()>
200
201 </cffunction>
202
203 <cffunction name="getService" returntype="any" output="false">
204 <cfargument name="serviceName">
205
206 <cfif not structKeyExists(application,"proxyServices")>
207 <cfset application.proxyServices=structNew()>
208 </cfif>
209
4f7cffd5 » mattlevine
2010-03-02 1. Removing testing code.
210 <cfif not structKeyExists(application.proxyServices, arguments.serviceName)>
3f0649e2 » mattlevine
2010-02-02 1. Merging 5.2 to trunk.
211 <cfset application.proxyServices[arguments.serviceName]=createObject("component","mura.proxy.#arguments.serviceName#").init()>
212 </cfif>
213
214 <cfreturn application.proxyServices[arguments.serviceName]>
215 </cffunction>
216
217 <cffunction name="isValidSession" returntype="any" output="false">
218 <cfargument name="authToken">
219 <cfset var rsSession="">
220
221 <cfif not len(arguments.authToken)>
222 <cfreturn false>
223 <cfelse>
224 <cfquery name="rsSession" datasource="#application.configBean.getDatasource()#" username="#application.configBean.getDBUsername()#" password="#application.configBean.getDBPassword()#">
225 select authToken from tuserremotesessions
226 where authtoken=<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.authToken#">
227 and lastAccessed > #createODBCDateTime(dateAdd("h",-3,now()))#
228 </cfquery>
229
230 <cfreturn rsSession.recordcount>
231 </cfif>
232 </cffunction>
233
234 <cffunction name="getSession" returntype="any" output="false">
235 <cfargument name="authToken">
236 <cfset var rsSession="">
237 <cfset var sessionData=structNew()>
238
239 <cfquery name="rsSession" datasource="#application.configBean.getDatasource()#" username="#application.configBean.getDBUsername()#" password="#application.configBean.getDBPassword()#">
240 select * from tuserremotesessions
241 where authtoken=<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.authToken#">
242 </cfquery>
243
244 <cfquery datasource="#application.configBean.getDatasource()#" username="#application.configBean.getDBUsername()#" password="#application.configBean.getDBPassword()#">
245 update tuserremotesessions
f4e2a94a » mattlevine
2011-05-14 1. Switching from createODBCDatetime to cfqueryparam
246 set lastAccessed=<cfqueryparam cfsqltype="cf_sql_timestamp" value="#now()#">
3f0649e2 » mattlevine
2010-02-02 1. Merging 5.2 to trunk.
247 where authToken=<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.authToken#">
248 </cfquery>
249
250 <cfwddx action="wddx2cfml" input="#rsSession.data#" output="sessionData">
251
252 <cfreturn sessionData>
253 </cffunction>
254
3a29be4d » mattlevine
2010-04-29 git-svn-id: http://svn.blueriver.com/mura/trunk/www@2186 50f7a5e4-a14…
255 <cffunction name="call" returntype="any" access="remote">
3f0649e2 » mattlevine
2010-02-02 1. Merging 5.2 to trunk.
256 <cfargument name="serviceName">
257 <cfargument name="methodName">
78cee2fc » mattlevine
2011-01-18 1. Initial push of 5.4 to trunk.
258 <cfargument name="authToken" default="">
259 <cfargument name="args" default="#structNew()#">
3f0649e2 » mattlevine
2010-02-02 1. Merging 5.2 to trunk.
260
261 <cfset var event="">
262 <cfset var service="">
263
78cee2fc » mattlevine
2011-01-18 1. Initial push of 5.4 to trunk.
264 <cfif isJSON(arguments.args)>
265 <cfset arguments.args=deserializeJSON(arguments.args)>
266 <cfelseif isWddx(arguments.args)>
267 <cfwddx action="wddx2cfml" input="#arguments.args#" output="arguments.args">
268 </cfif>
269
270 <cfif (isDefined("session.mura.isLoggedIn") and session.mura.isLoggedIn)
271 or (len(arguments.authToken) and isValidSession(arguments.authToken))>
272
273 <cfif len(arguments.authToken)>
274 <cfset session.mura=getSession(arguments.authToken)>
ca1164d8 » mattlevine
2011-04-21 1. Removing format method and replacing it with removeObjects.
275 <cfset session.siteID=session.mura.siteID>
276 <cfset application.rbFactory.resetSessionLocale()>
78cee2fc » mattlevine
2011-01-18 1. Initial push of 5.4 to trunk.
277 </cfif>
3f0649e2 » mattlevine
2010-02-02 1. Merging 5.2 to trunk.
278
279 <cfif not isObject(arguments.args)>
280 <cfset event=createObject("component","mura.event")>
281 <cfset event.init(args)>
282 <cfset event.setValue("proxy",this)>
283 <cfelse>
284 <cfset event=args>
285 </cfif>
6e16f02f » mattlevine
2010-07-05 1. Adding logic to store remote host of comments.
286
3f0649e2 » mattlevine
2010-02-02 1. Merging 5.2 to trunk.
287 <cfset event.setValue("isProxyCall",true)>
288 <cfset event.setValue("serviceName",arguments.serviceName)>
289 <cfset event.setValue("methodName",arguments.methodName)>
290 <cfset service=getService(event.getValue('serviceName'))>
291
292 <cfinvoke component="#service#" method="call">
293 <cfinvokeargument name="event" value="#event#" />
294 </cfinvoke>
295
78cee2fc » mattlevine
2011-01-18 1. Initial push of 5.4 to trunk.
296 <cfif len(arguments.authToken)>
297 <cfset application.loginManager.logout()>
298 </cfif>
299
3f0649e2 » mattlevine
2010-02-02 1. Merging 5.2 to trunk.
300 <cfreturn event.getValue("__response__")>
301
302 <cfelse>
303 <cfreturn "invalid session">
304 </cfif>
305 </cffunction>
306
9a64f5ae » mattlevine
2009-04-05 Added new event based system for the front controller
307 </cfcomponent>
Something went wrong with that request. Please try again.