Skip to content

Instantly share code, notes, and snippets.

@jasdumas
Created August 2, 2015 13:43
Show Gist options
  • Save jasdumas/8fe37b19aea95fcee5be to your computer and use it in GitHub Desktop.
Save jasdumas/8fe37b19aea95fcee5be to your computer and use it in GitHub Desktop.
#################################################
# Authentication Log-on page with conditionalPanel
#################################################
# Global variables can go here
n <- 200
# Define the UI
ui <- bootstrapPage(
column(6, offset = 3,
conditionalPanel(condition = "input.secret !== 'bluedemons'", # login page disappears when the correct password and the submit button is pressed
helpText("Thank you for visiting and for wanting to try out this awesome Bioinformatics tool.
This web application is currently in development and requires password
access for usage. Please contact us for the password."),
a(href="mailto:jasmine.dumas@gmail.com?subject=GEO-AWS&body=Please send me the password!", "Email Us!"),
br(), br(),
textInput("secret", label="Please Enter the Password", value =""),
helpText("Password Hint: DePaul Mascot"),
submitButton(text ="Enter", icon=icon("refresh")))),
column(12,
conditionalPanel(condition = "input.secret == 'bluedemons'", # content is only visible when the correct password is entered
numericInput('n', 'Number of obs', n),
plotOutput('plot'))
)
)
# Define the server code
server <- function(input, output) {
output$plot <- renderPlot({
hist(runif(input$n))
})
}
# Return a Shiny app object
shinyApp(ui = ui, server = server)
@jasdumas
Copy link
Author

jasdumas commented Dec 4, 2015

obvious the password is visible but the point is to try and limit users and direct users who want to use the application to send an email to the package author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment