Skip to content

Commit ed7d01a

Browse files
committed
hotfix: remove password column on admin
1 parent 14f0fe1 commit ed7d01a

1 file changed

Lines changed: 1 addition & 31 deletions

File tree

components/board.admin/R/admin_table_credentials.R

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ admin_table_credentials_server <- function(id, auth, credentials_file = NULL) {
9191
render_version(isolate(render_version()) + 1)
9292
})
9393

94-
## Build display data with only email, password, admin columns.
95-
## Password and admin use custom HTML inputs; email is plain text.
9694
display_data <- shiny::reactive({
9795
render_version()
9896
df <- shiny::isolate(cred_data())
@@ -101,18 +99,6 @@ admin_table_credentials_server <- function(id, auth, credentials_file = NULL) {
10199

102100
display <- data.frame(
103101
email = df$email,
104-
password = sapply(seq_len(nrow(df)), function(i) {
105-
pw_escaped <- gsub('"', "&quot;", df$password[i])
106-
sprintf(
107-
paste0(
108-
'<input type="password" class="pw-input" data-row="%d" value="%s"',
109-
' ondblclick="this.type=\'text\';this.select();"',
110-
' onblur="this.type=\'password\';"',
111-
' style="%swidth:100px;">'
112-
),
113-
i, pw_escaped, input_style
114-
)
115-
}),
116102
admin = sapply(seq_len(nrow(df)), function(i) {
117103
val <- toupper(trimws(df$ADMIN[i]))
118104
is_self <- identical(tolower(trimws(df$email[i])), current_email)
@@ -152,14 +138,8 @@ admin_table_credentials_server <- function(id, auth, credentials_file = NULL) {
152138
var row = parseInt($(this).data('row'));
153139
var val = $(this).val();
154140
Shiny.setInputValue('%s', {row: row, value: val}, {priority: 'event'});
155-
});
156-
table.on('change', 'input.pw-input', function() {
157-
var row = parseInt($(this).data('row'));
158-
var val = $(this).val();
159-
Shiny.setInputValue('%s', {row: row, value: val}, {priority: 'event'});
160141
});",
161-
ns("admin_select_change"),
162-
ns("password_change")
142+
ns("admin_select_change")
163143
)),
164144
options = list(
165145
dom = "lfrtip",
@@ -184,16 +164,6 @@ admin_table_credentials_server <- function(id, auth, credentials_file = NULL) {
184164
status("Unsaved changes")
185165
})
186166

187-
## Handle password input changes
188-
shiny::observeEvent(input$password_change, {
189-
shiny::req(isTRUE(auth$ADMIN))
190-
change <- input$password_change
191-
df <- cred_data()
192-
df$password[change$row] <- change$value
193-
cred_data(df)
194-
status("Unsaved changes")
195-
})
196-
197167
## Add a new user row
198168
shiny::observeEvent(input$add_user, {
199169
shiny::req(isTRUE(auth$ADMIN))

0 commit comments

Comments
 (0)