Guest User

Untitled

a guest
Oct 16th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. <cfsetting showdebugoutput="false">
  2. <cfset showForm = true>
  3. <cfif structKeyExists(form, "username") and structKeyExists(form, "password")>
  4. <!--- First, validate --->
  5. <cfif application.gistService.validate(form.username, form.password)>
  6. <cfset packet = {username=form.username, password=form.password}>
  7. <cfset fileWrite(expandPath("./settings.json"), serializeJSON(packet))>
  8. <cfset showForm = false>
  9. <cfelse>
  10. <cfset errorFlag = true>
  11. </cfif>
  12. </cfif>
  13.  
  14. <!DOCTYPE html>
  15. <html>
  16. <head>
  17. <link rel="stylesheet" href="app.css?<cfoutput>x=#createUUID()#</cfoutput>" type="text/css" />
  18. </head>
  19.  
  20. <body>
  21.  
  22. <cfif showForm>
  23.  
  24. <cfif not structKeyExists(variables, "errorFlag")>
  25. <p>
  26. In order to use this extension, you must provide your Github username and password. This information
  27. will be stored in a plain text file in the extension directory. This is a one-time setup process.
  28. </p>
  29. <cfelse>
  30. <p>
  31. Sorry, but the information you provided did not validate.
  32. </p>
  33. </cfif>
  34.  
  35. <form method="post">
  36. <p>
  37. <label for="username">Username:</label> <input type="text" id="username" name="username">
  38. </p>
  39. <p>
  40. <label for="password">Password:</label> <input type="password" id="password" name="password"><br/>
  41. </p>
  42. <p>
  43. <input type="submit" value="Save Information">
  44. </p>
  45. </form>
  46.  
  47. <cfelse>
  48.  
  49. <p>
  50. Congratulations! Your Github information validated and you are ready to use the extension. Please
  51. try your action again.
  52. </p>
  53.  
  54. </cfif>
  55.  
  56. </body>
  57. </html>
Add Comment
Please, Sign In to add comment