Skip to content

Instantly share code, notes, and snippets.

@johnbocook
Created September 28, 2017 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnbocook/949e7b9c383fc380713bd614152be65b to your computer and use it in GitHub Desktop.
Save johnbocook/949e7b9c383fc380713bd614152be65b to your computer and use it in GitHub Desktop.
Proof of concept - interacting with our SIS via slack channels. Includes authentication check based on channel access.
<cfoutput>
<cfif #StructKeyExists(FORM, "token")#>
<cfif #FORM.token# NEQ '##############'>
Sorry, Authentication Failed
<cfelse>
<cfif #FORM.channel_id# NEQ "############">
What are you doing?!?!!?? This channel is not authenticated - stop trying to break stuff.
<cfelse>
<cfif #FORM.text# EQ "restart">
@#FORM.user_name# - Sonis is restarting
<cfelseif #FORM.text# EQ "isup">
@#FORM.user_name# - Sonis is currently up. Uptime: #Hour(Now()-3)# hours #Second(Now())# Minutes.
<cfelseif #FORM.text# EQ "JB7891234">
Staff: John Smith, 614-779-5555, 523 E. Main St Columbus OH 43119
<cfelseif #FORM.text# EQ "who">
@#FORM.user_name# There are 18 users currently active in Sonis. John Bocook, Jared Black, Sunny Stewart, Michael Sheetz, Jeremiah Moebs, Logan Edmonds, Jason Sheetz
<cfelse>
@#FORM.user_name# - You need to pass the command to run
</cfif>
</cfif>
</cfif>
</cfif>
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment