Skip to content

Instantly share code, notes, and snippets.

View eballisty's full-sized avatar

Edward Ballisty eballisty

View GitHub Profile
@eballisty
eballisty / rebuild.cfm
Created November 14, 2017 18:15
Rebuild Mura's default database indexes
<cfscript>
dbUtility.setTable('tcontent')
.addPrimaryKey('TContent_ID')
.addIndex('ContentID')
.addIndex('ContentHistID')
.addIndex('SiteID')
.addIndex('ParentID')
.addIndex('RemoteID')
.addIndex('ModuleID')
.addIndex('changesetID')
function onSiteRequestStart($) {
if (external_service_gives_successful_login_message) {
userBean = $.getBean('user').loadBy(username=oAuth.prsId, $.event('siteID'));
userBean.setUsername(oAuth.prsId);
userBean.setPassword(oAuth.prsId & 'RANDOMREALLYCOMPLICATEDSTRING');
userBean.setFname(oAuth.firstName);
userBean.setLname(oAuth.lastName);
userBean.setEmail(oAuth.emailAddress);
userBean.save();
@eballisty
eballisty / index.cfm
Created August 26, 2016 21:09
Enable Folder Expansion in Mura Site Map
<!--- This file is part of Mura CMS.
Mura CMS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, Version 2 of the License.
Mura CMS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@eballisty
eballisty / eventHandler.cfc
Created August 26, 2016 20:13
Register Method with Mura's API
public void function onSiteRequestStart(required struct $) output=false {
var APIUtility = $.siteConfig().getApi('json', 'v1');
var Service = $.getBean('MyService');
APIUtility.registerMethod('getData', Service.getData);
// then call the method via this url:
// /index.cfm/_api/json/v1/site_id/?method=getData
}
@eballisty
eballisty / config.cfm
Created December 11, 2015 18:09
Enable SVG upload in Mura
<!---
place file in:
#$.siteConfig('includePath')#/js/finder/config.cfm
or
#$.siteConfig('themeIncludePath')#/js/finder/config.cfm
--->
<cfset config.defaultAlledExtensions = '7z,aiff,asf,avi,bmp,csv,doc,docx,fla,flv,gif,gz,gzip,ics,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pptx,ppsx,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,xlsx,zip,m4v,less,svg'>
<cfset config.htmlExtensions = 'html,htm,xml,js,cfm,cfc,svg'>