| Title: | Optional Login and Registration Module System for ShinyApps | 
| Version: | 0.5.2 | 
| Description: | RegLog system provides a set of shiny modules to handle register procedure for your users, alongside with login, edit credentials and password reset functionality. It provides support for popular SQL databases and optionally googlesheet-based database for easy setup. For email sending it provides support for 'emayili' and 'gmailr' backends. Architecture makes customizing usability pretty straightforward. The authentication system created with shiny.reglog is designed to be optional: user don't need to be logged-in to access your application, but when logged-in the user data can be used to read from and write to relational databases. | 
| Depends: | R (≥ 4.1.0), R6, shiny | 
| Imports: | dplyr, lubridate, lifecycle, scrypt, shinyjs, stringi, uuid | 
| Suggests: | covr, DBI, DT, devtools, emayili, gmailr, googledrive, googlesheets4, jsonlite, knitr, mongolite, rmarkdown, RSQLite, shinytest2, testthat (≥ 3.0.0) | 
| License: | MIT + file LICENSE | 
| Encoding: | UTF-8 | 
| RoxygenNote: | 7.2.1 | 
| VignetteBuilder: | knitr | 
| Config/testthat/edition: | 3 | 
| URL: | https://statismike.github.io/shiny.reglog/ | 
| NeedsCompilation: | no | 
| Packaged: | 2022-08-29 20:56:35 UTC; kosin | 
| Author: | Michal Kosinski | 
| Maintainer: | Michal Kosinski <kosinski.mich@gmail.com> | 
| Repository: | CRAN | 
| Date/Publication: | 2022-08-30 18:20:02 UTC | 
shiny.reglog: Optional Login and Registration Module System for ShinyApps
Description
RegLog system provides a set of shiny modules to handle register procedure for your users, alongside with login, edit credentials and password reset functionality. It provides support for popular SQL databases and optionally googlesheet-based database for easy setup. For email sending it provides support for 'emayili' and 'gmailr' backends. Architecture makes customizing usability pretty straightforward. The authentication system created with shiny.reglog is designed to be optional: user don't need to be logged-in to access your application, but when logged-in the user data can be used to read from and write to relational databases.
Author(s)
Maintainer: Michal Kosinski kosinski.mich@gmail.com (ORCID)
See Also
Useful links:
DBI edit to the database handler
Description
Default handler function querying database to confirm credentials
edit procedure and update values saved within database. Used within object of
RegLogDBIConnector class internally.
Usage
DBI_credsEdit_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which need to contain within its data: 
 It can also contain elements for change: 
 | 
See Also
Other DBI handler functions: 
DBI_login_handler(),
DBI_register_handler(),
DBI_resetPass_confirmation_handler(),
DBI_resetPass_generation_handler()
DBI login handler
Description
Default handler function querying database to confirm login
procedure. Used within object of RegLogDBIConnector class internally.
Usage
DBI_login_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which should contain within its data: 
 | 
See Also
Other DBI handler functions: 
DBI_credsEdit_handler(),
DBI_register_handler(),
DBI_resetPass_confirmation_handler(),
DBI_resetPass_generation_handler()
DBI register handler
Description
Default handler function querying database to confirm registration
validity and input new data. Used within object of RegLogDBIConnector class internally.
Usage
DBI_register_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which should contain within its data: 
 | 
See Also
Other DBI handler functions: 
DBI_credsEdit_handler(),
DBI_login_handler(),
DBI_resetPass_confirmation_handler(),
DBI_resetPass_generation_handler()
DBI resetpass code confirmation handler
Description
Default handler function querying database to confirm credentials
edit procedure and update values saved within database. Used within object of
RegLogDBIConnector class internally.
Usage
DBI_resetPass_confirmation_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which need to contain within its data: 
 | 
See Also
Other DBI handler functions: 
DBI_credsEdit_handler(),
DBI_login_handler(),
DBI_register_handler(),
DBI_resetPass_generation_handler()
DBI resetpass code generation handler
Description
Default handler function querying database to confirm credentials
edit procedure and update values saved within database. Used within object of
RegLogDBIConnector class internally.
Usage
DBI_resetPass_generation_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which need to contain within its data: 
 | 
See Also
Other DBI handler functions: 
DBI_credsEdit_handler(),
DBI_login_handler(),
DBI_register_handler(),
DBI_resetPass_confirmation_handler()
Create RegLog-valid database tables with DBI
Description
Create RegLog-valid database tables with DBI
Usage
DBI_tables_create(
  conn,
  account_name = "account",
  reset_code_name = "reset_code",
  use_log = FALSE,
  log_name = "logs",
  user_data = NULL,
  hash_passwords = FALSE,
  verbose = TRUE
)
Arguments
| conn | DBI connection object | 
| account_name | Name of the table for storing user accounts credentials. Defaults to 'account'. Mandatory table. | 
| reset_code_name | Name of the table for storing generated password reset codes. Defaults to 'reset_code'. Mandatory table. | 
| use_log | Should the table for keeping RegLogServer logs be also created? Defaults to FALSE | 
| log_name | Name of the table for storing logs from RegLogServer object.
Used only if  | 
| user_data | If you wish to import existing user database, you can input data.frame with that table in this argument. It should contain columns: username, password, email. Defaults to NULL. | 
| hash_passwords | If you are importing table of users upon tables creation,
you can also specify if the password should be hashed using  | 
| verbose | Boolean specific if the actions made by function should be
printed back to the console. Defaults to  | 
Details
Currently, the function is tested and working correctly for SQLite, MySQL, MariaDB and PostrgreSQL databases. If you want to use another DBI-supported database, you need to create tables in other ways.
Created tables should have following structure:
- account (default name) - id: integer, primary key, auto-increment 
- username: varchar(255), NOT NULL, unique key 
- password: varchar(255), NOT NULL 
- email: varchar(255), NOT NULL, unique key 
- create_time: datetime, NOT NULL 
- update_time: datetime, NOT NULL 
 
- reset_code (default name) - id: integer, primary key, auto-increment 
- user_id: integer, NOT NULL, key 
- reset_code: varchar(10), NOT NULL 
- used: tinyint, NOT NULL 
- create_time: datetime, NOT NULL 
- update_time: datetime, NOT NULL 
 
- logs (default name, optional) - id: integer, primary key, auto-increment 
- time: datetime, NOT NULL 
- session: varchar(255), NOT NULL 
- direction: varchar(255), NOT NULL 
- type: varchar(255), NOT NULL 
- note: varchar(255) 
 
Value
List with results of the creation
See Also
Other RegLog databases: 
gsheet_tables_create(),
mongo_tables_create()
Examples
library(shiny.reglog)
# create a tenporary SQLite database
conn <- DBI::dbConnect(
  RSQLite::SQLite(),
  dbname = ":memory:"
)
# mockup user data
user_data <- 
  data.frame(username = c("Whatever", "Hanuka", "Helsinki", "How_come"), 
             password = c("&f5*MSYj^niDt=V'3.[dyEX.C/", "%}&B[fs\\}5PKE@,*+V\\tx9\"at]", 
                    "35z*ofW\\'G_8,@vCC`]~?e$Jm%", "s:;r_eLn?-D6;oA-=\"^R(-Ew<x"), 
             email = c("what@mil.com", "hehe@soso.so", "nider@what.no", "crazzz@simpsy.com"))
# create the tables and input the data (hashing the passwords in the process)
DBI_tables_create(conn = conn,
                  user_data = user_data,
                  hash_passwords = TRUE,
                  verbose = FALSE)
# check generater tables
DBI::dbListTables(conn = conn)
# check the "user" table for user data
DBI::dbReadTable(conn = conn,
                 "account")
# disconnect
DBI::dbDisconnect(conn = conn)
RegLog connector template
Description
Parent class for all RegLog connectors
Public fields
- module_id
- character vector specifying the automatically-generated module_id for listener server module 
- listener
- reactiveVal that the object keeps listening of changes for 
- message
- reactiveVal containing outward message 
- log
- list containing data about received and sent messages by the object 
- handlers
- named list containing functions used to handle different types of - RegLogConnectorMessage. Name of the element corresponds to the 'type' that is should handle.
Methods
Public methods
Method get_logs()
Function to receive all saved logs from the object in the form of single data.frame
Usage
RegLogConnector$get_logs()
Details
You can specify custom handler functions as a named list passed
to custom_handlers arguments during object initialization. Every custom
handler should take arguments: self and private - relating to the R6
object and message of class RegLogConnectorMessage. It should return
RegLogConnectorMessage object.
Returns
data.frame
Method new()
Initialization of the object. Sets up listener reactiveVal and initializes listening server module
Usage
RegLogConnector$new(custom_handlers = NULL)
Arguments
- custom_handlers
- named list of custom handler functions. Every custom handler should take arguments: - selfand- private- relating to the R6 object and- messageof class- RegLogConnectorMessage. It should return- RegLogConnectorMessageobject.
Returns
object of RegLogConnector class
Method suspend()
Suspend the listening to the changes
Usage
RegLogConnector$suspend()
Method resume()
Resume the listening to the changes
Usage
RegLogConnector$resume()
Method clone()
The objects of this class are cloneable with this method.
Usage
RegLogConnector$clone(deep = FALSE)
Arguments
- deep
- Whether to make a deep clone. 
create RegLogConnectorMessage object
Description
Create an object of ReglogConnectorMessage class. It is used
to send data to objects that inherit their class from RegLogConnector
Usage
RegLogConnectorMessage(type, ..., logcontent = NULL)
is.RegLogConnectorMessage(x)
Arguments
| type | character string declaring the type of message | 
| ... | named arguments that will be passed as data | 
| logcontent | character string. Optional description to save into logs. | 
| x | Any R object | 
Value
object of RegLogConnector class, containing fields:
-  time: numeric representation of Sys.time()
-  type: character specifying the type of message 
-  data: list of values that are to be sent alongside the message 
-  logcontent: Character string with information to be saved in logs. Optional. 
Connector to DBI-valid databases
Description
Object of this class handles all connections for the RegLogServer
object to the database. It is created to handle DBI compatible drivers.
Provides methods than will be used by RegLogServer to get and send data.
Super class
shiny.reglog::RegLogConnector -> RegLogDBIConnector
Methods
Public methods
Inherited methods
Method new()
Initialization of the object. Creates initial connection to the database.
Requires DBI package to be installed.
Usage
RegLogDBIConnector$new(
  driver,
  ...,
  table_names = c("account", "reset_code", "logs"),
  custom_handlers = NULL
)Arguments
- driver
- Call that specifies the driver to be used during all queries 
- ...
- other arguments used in - DBI::dbConnect()call
- table_names
- character vector. Contains names of the tables in the database: first containing user data, second - reset codes information, third (optional) - logs from the object. For more info check documentation of - DBI_database_create.
- custom_handlers
- named list of custom handler functions. Every custom handler should take arguments: - selfand- private- relating to the R6 object and- messageof class- RegLogConnectorMessage. It should return- RegLogConnectorMessageobject.
Returns
object of RegLogDBIConnector class
Method clone()
The objects of this class are cloneable with this method.
Usage
RegLogDBIConnector$clone(deep = FALSE)
Arguments
- deep
- Whether to make a deep clone. 
See Also
Other dbConnectors: 
RegLogGsheetConnector
Demonstration ShinyApp with basic RegLog system
Description
You can play a little with RegLogSever functionalities launching this ShinyApp. This demo needs also an installation of 'RSQLite' package to create and menage a temporary database.
Usage
RegLogDemo(emayili_smtp = NULL, emayili_from = NULL)
Arguments
| emayili_smtp | defined emayili smtp server for you e-mail provider. If kept as default NULL, the e-mail sending functionality won't be used. If provided, it will require an installation of 'emayili' package. | 
| emayili_from | String containing e-mail from which thesending will take place. Used only with 'emayili_smtp' defined. | 
RegLogConnector for email sending via emayili package
Description
With the use of this object, RegLogServer can send emails confirming the registration and containing code for password reset procedure.
Super class
shiny.reglog::RegLogConnector -> RegLogEmayiliConnector
Public fields
- mails
- List containing default mail templates to use by default mail handlers for register and password reset 
Methods
Public methods
Inherited methods
Method new()
Initialization of the object. Creates smtp server for email sending.
Usage
RegLogEmayiliConnector$new( from, smtp, lang = "en", custom_txts = NULL, custom_handlers = NULL, custom_mails = NULL )
Arguments
- from
- Character containing content in - fromof the email.
- smtp
- Object created by - emayili::serveror all its similiar functions.
- lang
- character specyfiyng which language to use for all texts generated in the UI. Defaults to 'en' for English. Currently 'pl' for Polish is also supported. 
- custom_txts
- named list containing character strings with custom messages. Defaults to NULL, so all built-in strings will be used. 
- custom_handlers
- named list of custom handler functions. Custom handler should take arguments: - selfand- private- relating to the R6 object and- messageof class- RegLogConnectorMessage. It should return return- RegLogConnectorMessageobject.
- custom_mails
- named list containing character strings of the same structure as elements in the - mailsfield. Not all elements need to be present.
Details
default mails are used by register_mail and reset_pass_mail
handlers. To change the mail used by these handlers you can pass character
strings to the custom_mail argument during initialization or append them
directly into this list.
They are stored (and should be passed accordingly) in a list of structure:
- register - subject 
- body 
 
- resetPass - subject 
- body 
 
- credsEdit - subject 
- body 
 
Method clone()
The objects of this class are cloneable with this method.
Usage
RegLogEmayiliConnector$clone(deep = FALSE)
Arguments
- deep
- Whether to make a deep clone. 
See Also
Other mailConnectors: 
RegLogGmailrConnector
RegLogConnector for email sending via emayili package
Description
With the use of this object, RegLogServer can send emails confirming the registration and containing code for password reset procedure.
Super class
shiny.reglog::RegLogConnector -> RegLogGmailrConnector
Public fields
- mails
- List containing default mail templates to use by default mail handlers for register and password reset 
Methods
Public methods
Inherited methods
Method new()
Initialization of the object. Creates smtp server for email sending.
Usage
RegLogGmailrConnector$new( from, lang = "en", custom_txts = NULL, custom_handlers = NULL, custom_mails = NULL )
Arguments
- from
- Character containing content in - fromof the email.
- lang
- character specyfiyng which language to use for all texts generated in the UI. Defaults to 'en' for English. Currently 'pl' for Polish is also supported. 
- custom_txts
- named list containing character strings with custom messages. Defaults to NULL, so all built-in strings will be used. 
- custom_handlers
- named list of custom handler functions. Custom handler should take arguments: - selfand- private- relating to the R6 object and- messageof class- RegLogConnectorMessage. It should return return- RegLogConnectorMessageobject.
- custom_mails
- named list containing character strings of the same structure as elements in the - mailsfield. Not all elements need to be present.
Details
default mails are used by register_mail and reset_pass_mail
handlers. To change the mail used by these handlers you can pass character
strings to the custom_mail argument during initialization or append them
directly into this list.
They are stored (and should be passed accordingly) in a list of structure:
- register - subject 
- body 
 
- resetPass - subject 
- body 
 
- credsEdit - subject 
- body 
 
Method clone()
The objects of this class are cloneable with this method.
Usage
RegLogGmailrConnector$clone(deep = FALSE)
Arguments
- deep
- Whether to make a deep clone. 
See Also
Other mailConnectors: 
RegLogEmayiliConnector
Connector to googlesheet database
Description
Object of this class handles all connections for the RegLogServer object to the database. It is created to handle googlesheet database. Provides methods than will be used by RegLogServer to get and send data.
Requires googlesheets4 package to be installed.
Super class
shiny.reglog::RegLogConnector -> RegLogGsheetConnector
Methods
Public methods
Inherited methods
Method new()
Initialization of the object. Creates initial connection to the database.
Usage
RegLogGsheetConnector$new(
  gsheet_ss,
  gsheet_sheetnames = c("account", "reset_code", "logs"),
  custom_handlers = NULL
)Arguments
- gsheet_ss
- id of the googlesheet holding database 
- gsheet_sheetnames
- character vector. Contains names of the sheets in the googlesheet: first containing user data, second - reset codes information, third (optional) - logs from the object. For more info check documentation of - gsheet_database_create.
- custom_handlers
- named list of custom handler functions. Every custom handler should take arguments: - selfand- private- relating to the R6 object and- messageof class- RegLogConnectorMessage. It should return- RegLogConnectorMessageobject.
Returns
object of RegLogDBIConnector class
Method clone()
The objects of this class are cloneable with this method.
Usage
RegLogGsheetConnector$clone(deep = FALSE)
Arguments
- deep
- Whether to make a deep clone. 
See Also
Other dbConnectors: 
RegLogDBIConnector
Connector to MongoDB database
Description
Object of this class handles all connections for the RegLogServer object to the database. It is created to handle MongoDB database compatible drivers. Provides methods than will be used by RegLogServer to get and send data.
Requires mongolite package to be installed.
Super class
shiny.reglog::RegLogConnector -> RegLogMongoConnector
Methods
Public methods
Inherited methods
Method new()
Initialization of the object
Usage
RegLogMongoConnector$new(
  mongo_url,
  mongo_db,
  mongo_options = mongolite::ssl_options(),
  collections = c("account", "reset_code", "logs"),
  custom_handlers = NULL
)Arguments
- mongo_url
- URI to the MongoDB cluster 
- mongo_db
- name of the MongoDB database 
- mongo_options
- additional connection options such as SSL keys/certs 
- collections
- names of the collections 
- custom_handlers
- named list of custom handler functions. Every custom handler should take arguments: - selfand- private- relating to the R6 object and- messageof class- RegLogConnectorMessage. It should return- RegLogConnectorMessageobject.
- table_names
- character vector. Contains names of the collections in the database: first containing user data, second - reset codes information, third (optional) - logs from the object. For more info check documentation of - mongo_database_create.
Returns
Object of RegLogMongoConnector class
Method clone()
The objects of this class are cloneable with this method.
Usage
RegLogMongoConnector$clone(deep = FALSE)
Arguments
- deep
- Whether to make a deep clone. 
Login and registration moduleServer
Description
RegLogServer is an R6 class to use for handling the whole backend of login and registration component of your shinyApp.
Public fields
- is_logged
- reactiveVal containing logical indicating if the user is logged in 
- user_id
- reactiveVal containing character specifying the logged user name. If the user is not logged in, it will consist of uuid generated with - uuid::UUIDgenerate
- user_mail
- reactiveVal cantaining character string specifying the logged user mail. When not logged in, it contains NULL. 
- account_id
- reactiveVal caintaining integer specifying the logged user account's id number: for SQL database it is equal to the value contained withing - idvariable. For googlesheets database it is equal to the row number - 1 (the header). If not logged, it contains NULL.
- mail_message
- reactiveVal containing most recent RegLogConnectorMessage received from mailConnector 
- message
- reactiveVal containing most recent RegLogConnectorMessage received from dbConnector or generated by RegLogServer itself. 
- module_id
- character storing ID for reglog_system module. 
- dbConnector
- RegLogConnectorobject used for communication with the database. Build-in children classes are- RegLogDBIConnectorand- RegLogGsheetConnector.
- mailConnector
- RegLogConnectorobject used for sending emails. Built-in children classes are- RegLogEmayiliConnectorand- RegLogGmailrConnector.
- log
- list containing all messages send and received. 
- UI_list_login
- reactiveVal holding the tagList of whole login UI. 
- UI_list_resetPass
- reactiveVal holding the tagList of whole resetPass UI. 
- UI_list_credsEdit
- reactiveVal holding the tagList of whole credentioals edit UI. 
- UI_list_register
- reactiveVal holding the tagList of whole register UI. 
Methods
Public methods
Method new()
Initialize 'ReglogServer' moduleServer
Usage
RegLogServer$new( dbConnector, mailConnector, app_name = basename(getwd()), app_address = NULL, lang = "en", custom_txts = NULL, use_modals = TRUE, module_id = "login_system" )
Arguments
- dbConnector
- object of class - RegLogConnectorhandling the reads from and writes to database. Two available in the package are- RegLogDBIConnectorand- RegLogGsheetsConnector. See their documentation for more information about usage and creation of custom dbConnectors.
- mailConnector
- object of class - RegLogConnectorhandling the email sending to the user for register confirmation and password reset. Two available in the package are- RegLogEmayiliConnectorand- RegLogGmailrConnector. See their documentation for more information about usage and creation of custom mailConnectors.
- app_name
- Name of the app to refer during correspondence to users. Defaults to the name of working directory. 
- app_address
- URL to refer to during correspondence to users. If left at NULL, the URL will be parsed from - session$clientData.
- lang
- character specyfiyng which language to use for all texts generated in the UI. Defaults to 'en' for English. Currently 'pl' for Polish is also supported. 
- custom_txts
- named list containing character strings with custom messages. Defaults to NULL, so all built-in strings will be used. 
- use_modals
- either logical indicating if all ( - TRUE) or none (- FALSE) modalDialogs should be shown or character vector indicating which modals should be shown. For more information see details.
- module_id
- Character declaring the id of the module. Defaults to 'login_system'. Recommended to keep it that way, unless it would cause any namespace issues. 
Method logout()
Method logging out logged user
Usage
RegLogServer$logout()
Method get_logs()
Method to receive all saved logs from the object in the form of single data.frame
Usage
RegLogServer$get_logs()
Returns
data.frame
Method clone()
The objects of this class are cloneable with this method.
Usage
RegLogServer$clone(deep = FALSE)
Arguments
- deep
- Whether to make a deep clone. 
Examples
# Run only in interactive session #
if (interactive()) {
  
  library(shiny.reglog)
  
  # for exemplary setup temporary SQLite database will be created
  library("DBI")
  library("RSQLite")
  temp_sqlite <- tempfile(fileext = ".sqlite")
  conn <- DBI::dbConnect(RSQLite::SQLite(),
                         dbname = temp_sqlite)
  DBI_tables_create(conn)
  DBI::dbDisconnect(conn)
  
  # create minimalistic UI
  ui <- navbarPage(
    title = "RegLog system",
    tabPanel("Register", RegLog_register_UI("custom_id")),
    tabPanel("Login", RegLog_login_UI("custom_id")),
    tabPanel("Credentials edit", RegLog_credsEdit_UI("custom_id")),
    tabPanel("Password reset", RegLog_resetPass_UI("custom_id"))
  )
  
  # create server logic
  server <- function(input, output, session) {
    
    # create dbConnector with connection to the temporary SQLite database
    dbConnector <- RegLogDBIConnector$new(
      driver = RSQLite::SQLite(),
      dbname = temp_sqlite)
    
    # create mockup mailConnector
    mailConnector <- RegLogConnector$new()
    
    # create RegLogServer
    RegLog <- RegLogServer$new(
      dbConnector = dbConnector,
      mailConnector = mailConnector,
      ## all arguments below are optional! ##
      app_name = "RegLog example",
      app_address = "https://reglogexample.com",
      lang = "en",
      # custom texts as a named list with strings
      custom_txts = list(
        user_id = "Name of the user",
        register_success_t= "Congratulations - you have been registered in 
                             successfully with RegLog system!"),
      # use modals as a named list of FALSE to inhibit specific modal
      use_modals = list(
        login_success = FALSE),
      # custom module id - provide the same to the UI elements!
      module_id = "custom_id")
  }
  
  shinyApp(ui, server)
}
Generate Edit User Data UI for RegLog system
Description
Generate Edit User Data UI for RegLog system
Usage
RegLog_credsEdit_UI(module_id = "login_system")
Arguments
| module_id | Character declaring the id of the module. Defaults to 'login_system'. Recommended to keep it that way, unless it would cause any namespace issues. | 
See Also
Other RegLog UI: 
RegLog_login_UI(),
RegLog_register_UI(),
RegLog_resetPass_UI()
Generate Login UI for RegLog system
Description
Generate Login UI for RegLog system
Usage
RegLog_login_UI(module_id = "login_system")
Arguments
| module_id | Character declaring the id of the module. Defaults to 'login_system'. Recommended to keep it that way, unless it would cause any namespace issues. | 
See Also
Other RegLog UI: 
RegLog_credsEdit_UI(),
RegLog_register_UI(),
RegLog_resetPass_UI()
Generate Register UI for RegLog system
Description
Generate Register UI for RegLog system
Usage
RegLog_register_UI(module_id = "login_system")
Arguments
| module_id | Character declaring the id of the module. Defaults to 'login_system'. Recommended to keep it that way, unless it would cause any namespace issues. | 
See Also
Other RegLog UI: 
RegLog_credsEdit_UI(),
RegLog_login_UI(),
RegLog_resetPass_UI()
Generate ResetPass code UI for RegLog system
Description
Generate ResetPass code UI for RegLog system
Usage
RegLog_resetPass_UI(module_id = "login_system")
Arguments
| module_id | Character declaring the id of the module. Defaults to 'login_system'. Recommended to keep it that way, unless it would cause any namespace issues. | 
See Also
Other RegLog UI: 
RegLog_credsEdit_UI(),
RegLog_login_UI(),
RegLog_register_UI()
Getting texts for given language
Description
Getting texts for given language
Usage
RegLog_txt(lang, x = NULL, custom_txts = NULL)
Arguments
| lang | character to identify the language | 
| x | character to identify the txt to get. If NULL, all labels are recovered | 
| custom_txts | named list providing custom messages to replace default for specific languages. | 
Details
'RegLog_txt' outside of internal usage should be used only for getting the structure of all texts generated by 'shiny.reglog'.
To customize texts used by RegLog objects, provide within their call named list to the 'custom_txts' argument - it will be passed to 'custom_txts' within this call. You can check validity of your list by providing the 'custom_txts' and calling this function in console.
Values of list provided should be named in the same way as the default text you are willing to replace.
Create new 'googlesheet' reglog database
Description
Used to match deprecated 'login_server' function. Use gsheet_tables_create()
to create 'googlesheet'-based database for new 'RegLogServer' object.
Usage
create_gsheet_db(name = NULL, credentials = NULL, credentials_pass_hashed)
Arguments
| name | specify name for 'googlesheet' file. Defaults to random name. | 
| credentials | you can pass credentials data to create already populated tables. Provide data.frame object containing variables: timestamp, user_id, user_mail and user_pass. If there are multiple records with the same user_id, the most recent will be kept only. | 
| credentials_pass_hashed | mandatory when putting some credentials data. Are the passwords already hashed with 'scrypt' package? Takes TRUE (if hashed) or FALSE (if not hashed and need hashing) | 
Value
id of the 'googlesheet' file. After creation you need to provide it to login_server().
Examples
if(googlesheets4::gs4_has_token()){
gsheet.id <- create_gsheet_db()
database <- gsheet_get_db(gsheet.id)
# you can then pass 'gsheet.id' to you 'login_server' call
#
# login_server(db_method = "gsheet",
#              gsheet_file = gsheet.id,
#              ...)
#
print(database)
googledrive::drive_trash(gsheet.id)
}
Create new 'SQLite' reglog database
Description
Used to match deprecated 'login_server' function. Use DBI_tables_create()
to create tables in 'DBI' supported database for new 'RegLogServer' object.
Usage
create_sqlite_db(output_file, credentials = NULL, credentials_pass_hashed)
Arguments
| output_file | path to new 'SQLite' database. After creation you need to provide it to  | 
| credentials | you can pass credentials data to create already populated tables. Provide data.frame object containing variables: timestamp, user_id, user_mail and user_pass. If there are multiple records with the same user_id, the most recent will be kept only. | 
| credentials_pass_hashed | specify if you put in some credentials data. Are the passwords already hashed with 'scrypt' package? Takes TRUE (if hashed) or FALSE (if not hashed and need hashing) | 
Examples
sqlite.path <- tempfile(fileext = "sqlite")
create_sqlite_db(sqlite.path)
database <- sqlite_get_db(sqlite.path)
# you can then pass 'sqlite.path' to you 'login_server' call
#
# login_server(db_method = "sqlite",
#              sqlite_db = sqlite.path,
#              ...)
#
print(database)
function to create standardized timestamp
Description
function to create standardized timestamp
Usage
db_timestamp()
Emayili custom email sending handler
Description
Default handler function parsing and sending email.
Used within object of RegLogEmayiliConnector class internally. It can
send custom emails using subject, body and attachments from
RegLogConnectorMessage of type custom_mail.
Usage
emayili_custom_mail_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which should contain within its data: 
 | 
Value
RegLogEmayiliConnector message.
See Also
Other mail handler functions: 
emayili_reglog_mail_handler(),
gmailr_custom_mail_handler(),
gmailr_reglog_mail_handler()
Emayili email sending handler
Description
Default handler function parsing and sending email.
Used within object of RegLogEmayiliConnector class internally.
Usage
emayili_reglog_mail_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which should contain within its data: 
 | 
Value
RegLogEmayiliConnector message.
See Also
Other mail handler functions: 
emayili_custom_mail_handler(),
gmailr_custom_mail_handler(),
gmailr_reglog_mail_handler()
Gmailr custom email sending handler
Description
Default handler function parsing and sending email.
Used within object of RegLogGmailrConnector class internally. It can
send custom emails using subject, body and attachments from
RegLogConnectorMessage of type custom_mail.
Usage
gmailr_custom_mail_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which should contain within its data: 
 | 
Value
RegLogGmailrConnector message.
See Also
Other mail handler functions: 
emayili_custom_mail_handler(),
emayili_reglog_mail_handler(),
gmailr_reglog_mail_handler()
Gmailr send email handler
Description
Default handler function parsing and sending register confirmation
email to newly registered user of the package. Used within object of
RegLogGmailrConnector class internally.
Usage
gmailr_reglog_mail_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which should contain within its data: 
 | 
Value
RegLogEmayiliConnector message.
See Also
Other mail handler functions: 
emayili_custom_mail_handler(),
emayili_reglog_mail_handler(),
gmailr_custom_mail_handler()
googlesheets edit to the database handler
Description
Default handler function querying database to confirm credentials
edit procedure and update values saved within database. Used within object of
RegLogGsheetConnector class internally.
Usage
gsheet_credsEdit_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which need to contain within its data: 
 It can also contain elements for change: 
 | 
See Also
Other googlesheets handler functions: 
gsheet_login_handler(),
gsheet_register_handler(),
gsheet_resetPass_confirmation_handler(),
gsheet_resetPass_generation_handler()
Function to read googlesheets shiny.reglog database
Description
As the new version of RegLog system allows for much more flexibility old functionalities for reading data is deprecated. Please use functions from adequate package: in this instance, 'googlesheets4' package.
Usage
gsheet_get_db(gsheet_db)
Arguments
| gsheet_db | ID of your 'googlesheets' database | 
Value
list containing user_db and reset_db dataframes
See Also
create_sqlite_db
googlesheets login handler
Description
Default handler function querying database to confirm login
procedure. Used within object of RegLogGsheetConnector class internally.
Usage
gsheet_login_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which should contain within its data: 
 | 
See Also
Other googlesheets handler functions: 
gsheet_credsEdit_handler(),
gsheet_register_handler(),
gsheet_resetPass_confirmation_handler(),
gsheet_resetPass_generation_handler()
googlesheets register handler
Description
Default handler function querying database to confirm registration
validity and input new data. Used within object of RegLogGsheetConnector class internally.
Usage
gsheet_register_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which should contain within its data: 
 | 
See Also
Other googlesheets handler functions: 
gsheet_credsEdit_handler(),
gsheet_login_handler(),
gsheet_resetPass_confirmation_handler(),
gsheet_resetPass_generation_handler()
googlesheets resetpass code confirmation handler
Description
Default handler function querying database to confirm credentials
edit procedure and update values saved within database. Used within object of
RegLogGsheetConnector class internally.
Usage
gsheet_resetPass_confirmation_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which need to contain within its data: 
 | 
See Also
Other googlesheets handler functions: 
gsheet_credsEdit_handler(),
gsheet_login_handler(),
gsheet_register_handler(),
gsheet_resetPass_generation_handler()
googlesheets resetpass code generation handler
Description
Default handler function querying database to confirm credentials
edit procedure and update values saved within database. Used within object of
RegLogGsheetConnector class internally.
Usage
gsheet_resetPass_generation_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which need to contain within its data: 
 | 
See Also
Other googlesheets handler functions: 
gsheet_credsEdit_handler(),
gsheet_login_handler(),
gsheet_register_handler(),
gsheet_resetPass_confirmation_handler()
Create RegLog-valid database tables with googlesheets4
Description
Create RegLog-valid database tables with googlesheets4
Usage
gsheet_tables_create(
  account_name = "account",
  reset_code_name = "reset_code",
  use_log = FALSE,
  log_name = "logs",
  user_data = NULL,
  hash_passwords = FALSE,
  gsheet_ss = NULL,
  gsheet_name = NULL,
  verbose = TRUE
)
Arguments
| account_name | Name of the sheet for storing user accounts credentials. Defaults to 'account'. Mandatory spreadsheet. | 
| reset_code_name | Name of the sheet for storing generated password reset codes. Defaults to 'reset_code'. Mandatory table. | 
| use_log | Should the sheet for keeping RegLogServer logs be also created? Defaults to FALSE | 
| log_name | Name of the sheet for storing logs from RegLogServer object.
Used only if  | 
| user_data | If you wish to import existing user database, you can input data.frame with that table in this argument. It should contain columns: username, password, email. Defaults to NULL. | 
| hash_passwords | If you are importing table of users upon tables creation,
you can also specify if the password should be hashed using  | 
| gsheet_ss | ID of the googlesheet that you want to append created tables
to. Defaults to  | 
| gsheet_name | If  | 
| verbose | Boolean specific if the actions made by function should be
printed back to the console. Defaults to  | 
Details
Created spreadsheets will have following structure:
- account (default name) - username: character 
- password: character 
- email: character 
- create_time: character 
- update_time: character 
 
- reset_code (default name) - user_id: numeric 
- reset_code: character 
- used: numeric 
- create_time: character 
- update_time: character 
 
- logs (default name, optional) - time: character 
- session: character 
- direction: character 
- type: character 
- note: character 
 
Value
ID of the googlesheet
See Also
Other RegLog databases: 
DBI_tables_create(),
mongo_tables_create()
Examples
if (googlesheets4::gs4_has_token()) {
  library(shiny.reglog)
  
  # mockup user data
  user_data <- 
    data.frame(username = c("Whatever", "Hanuka", "Helsinki", "How_come"), 
               password = c("&f5*MSYj^niDt=V'3.[dyEX.C/", "%}&B[fs\\}5PKE@,*+V\\tx9\"at]", 
                            "35z*ofW\\'G_8,@vCC`]~?e$Jm%", "s:;r_eLn?-D6;oA-=\"^R(-Ew<x"), 
               email = c("what@mil.com", "hehe@soso.so", "nider@what.no", "crazzz@simpsy.com"))
  
  # create the tables and input the data (hashing the passwords in the process)
  id <- gsheet_tables_create(user_data = user_data,
                             hash_passwords = TRUE,
                             verbose = FALSE)
  
  # check generated googlesheet
  googlesheets4::gs4_get(id)
  
  # check the "account" sheet for credentials data
  googlesheets4::read_sheet(id, "account")
  
  # remove example googlesheets
  googledrive::drive_trash(id)
}
Shiny UI module for login box
Description
It need to be used in conjuction with login_server() function and is suggested to be used alongside password_reset_UI() and register_UI() for full potential.
This function creates a UI div() element containing informations and input necessary for user to log-in. As it outputs a div() element, you can put it inside container of your choosing (be it some tabItem, fluidPage, fluidRow etc.)
Usage
login_UI(id = "login_system", lang = "en", custom_txts = NULL)
Arguments
| id | the id of the module. Defaults to "login_system" for all of the modules contained within the package. If you plan to use serveral login systems inside your app or for any other reason need to change it, remember to keep consistent id for all elements of module. | 
| lang | specifies the app used language. Accepts "en" or "pl". Defaults to "en" | 
| custom_txts | named list containing customized texts. For more details, see documentation for 'reglog_txt'. Provided list can contain only elements used by this function, but it is recommended to provide the same list for every 'shiny.reglog' function | 
Value
'tags$div' containing all elements for login procedure
See Also
login_server() for more details and example
Login server module
Description
This function has become deprecated. New RegLog system is based on RegLogServer R6 class.
Shiny server module for the optional login/registration system
This function creates a server module to handle other modules of the system: login_UI(), password_reset_UI() and register_UI
It uses database contained in 'googlesheet' file on your 'gdrive' or 'SQLite' database locally to read and write data of the users. You need to create a 'googlesheet' or 'SQLite' using create_gsheet_db() or create_sqlite_db() respectively.
Usage
login_server(
  id = "login_system",
  db_method,
  mail_method,
  appname,
  appaddress,
  lang = "en",
  gsheet_file,
  sqlite_db,
  gmailr_user,
  emayili_user,
  emayili_password,
  emayili_host,
  emayili_port,
  custom_txts = NULL,
  use_login_modals = list(UserNotFound = T, WrongPass = T, Success = T)
)
Arguments
| id | the id of the module. Defaults to "login_system" for all of the modules contained within the package. If you plan to use serveral login systems inside your app or for any other reason need to change it, remember to keep consistent id for all elements of module. | 
| db_method | the character string containing chosen database container, either:  | 
| mail_method | the character string containing chosen method of sending emails, either:  | 
| appname | the character string containing the name of your application (used in automatic e-mails for information purposes) | 
| appaddress | the character value containing the web address of your application (used in automatic e-mails for information purposes) | 
| lang | specifies the app used language. Accepts "en" or "pl". Defaults to "en" | 
| gsheet_file | the ID of your 'googlesheet' file holding the database. It is contained within URL address of your googlesheet (for:  | 
| sqlite_db | the path to your 'SQLite' database (for:  | 
| gmailr_user | your gmail address (for:  | 
| emayili_user | your email address, also used as login to your email account (for:  | 
| emayili_password | password to your email account (for:  | 
| emayili_host | host of your email box (for:  | 
| emayili_port | port of your email box (for:  | 
| custom_txts | named list containing customized texts. For more details, see documentation for 'reglog_txt'. Provided list can contain only elements used by this function, but it is recommended to provide the same list for every 'shiny.reglog' function | 
| use_login_modals | list of logicals indicating if the modalDialog after log-in should be shown. Defaults to named list of logicals: 
 | 
Details
The module logic creates a reactiveValues() object with loaded database of users and reset codes stored in session$userData. It allows to cut the reading from database to only one read per loading of the app - unfortunately it makes the app run slowly if the database of users gets very long.
Registration of new account mails the confirmation e-mail to the end user on provided e-mail.
Provided e-mail is needed for password reset: 10 digits code is generated and mailed to the user to confirm its identity. Reset code remains valid for 24 hours.
Authorization
- When using db_method of "gsheet" you need to authorize access to your google drive outside of the functions (using - googlesheets4:gs_auth()with default scopes:- "https://www.googleapis.com/auth/spreadsheets")
- When using mail_method of "emayili" you need to allow "less secure apps" to use your mailbox 
- When using mail_method of "gmailr" you need to authorize access to your gmail box by creating Oauth2 App on 'Google Cloud Platform' and passing it to - gmailr::gm_auth_configure()and allowing scopes:- "https://www.googleapis.com/auth/gmail.send"
Security
- Both passwords and reset codes are hashed with the help of 'scrypt' package for the extra security 
- gmailr mail_method seems to be more secure if you intend to use 'gmail' account to send emails. 'emayili' is suggested only when using other mailboxes. 
Value
reactiveValues() object with three elements:
is_logged, containing boolean describing authorization status
user_id, containing the logged user identification name. When not logged, it contains the timestamp of session start
user_mail, containing the logged user mail. When not logged, it is empty character string of nchar() value 0: ("")
last_state_change, containing string describing last change of login system state. Currently only supports state changes during login procedure
See Also
login_UI() for the login window in UI
password_reset_UI() for the password reset window in UI
register_UI() for the registration window in UI
Examples
## Only run this example in interactive R sessions
if(interactive()){
  
  #### example of db_method = "sqlite" and mail_method = "emayili"
  
  library(shiny)
  library(shiny.reglog)
  
  # initializing sqlite
  
  sqlite.path <- tempfile(fileext = "sqlite")
  create_sqlite_db(sqlite.path)
  database <- sqlite_get_db(sqlite.path)
  
  # Define UI containing shiny.reglog modules
  ui <- fluidPage(
    
    headerPanel(title = "shiny.reglog test"),
    
    tabsetPanel(
      tabPanel("Values", 
               # table of returned data for active user
               dataTableOutput("active_user_values"),
               # table of session$userData$reactive_db$user_db loaded at the start of session
               dataTableOutput("user_db"),
               # table of session$userData$reactive_db$reset_db loaded at the start of session
               dataTableOutput("reset_db")
      ),
      tabPanel("Login", login_UI()),
      tabPanel("Register", register_UI()),
      tabPanel("Reset Password", password_reset_UI()),
      tabPanel("Logout", logout_button())
      
    )
  )
  
  server <- function(input, output, session) {
    
    # login server with specified methods for database and mailing
    # to run it you need to replace placeholders with your details and 
    # cofigure it for your needs
    
    auth <- login_server(
      db_method = "sqlite",
      mail_method = "emayili",
      appname = "shiny.reglog example",
      appaddress = "not-on-net.com",
      sqlite_db = sqlite.path,
      # arguments below need configuration for your mailing account
      emayili_user = "your_email_address",
      emayili_password = "your_email_password",
      emayili_port = "your_email_box_port",
      emayili_host = "your_email_box_host"
    )
    
    # table of values returned by login_server
    
    output$active_user_values <- renderDataTable({
      data.frame(is_logged = auth$is_logged,
                 user_id = auth$user_id,
                 user_mail = auth$user_mail
      )
    })
    
    # tibbles contained within session$userData$reactive_db
   
    output$user_db <- renderDataTable(
      session$userData$reactive_db$user_db
    )
    
    output$reset_db <- renderDataTable(
      session$userData$reactive_db$reset_db
    )
  }
  
  # Run the application 
  shinyApp(ui = ui, server = server)
  
}
Action Button for logging out
Description
To be used in conjuction with deprecated login_server()
Simple action button - after pressing it, the user will be logged out.
Usage
logout_button(id = "login_system", lang = "en", custom_txts = NULL)
Arguments
| id | the id of the module. Defaults to "login_system" for all of the modules contained within the package. If you plan to use serveral login systems inside your app or for any other reason need to change it, remember to keep consistent id for all elements of module. | 
| lang | lang specifies the app used language. Accepts "en" or "pl". Defaults to "en" | 
| custom_txts | named list containing customized texts. For more details, see documentation for 'reglog_txt'. Provided list can contain only elements used by this function, but it is recommended to provide the same list for every 'shiny.reglog' function | 
Value
'actionButton' for logout
Mail attachment data to be handled by mailConnector via custom_mail RegLogConnectorMessage
Description
Mail attachment data to be handled by mailConnector via custom_mail RegLogConnectorMessage
Usage
mailMessageAttachment(filepath, filename = NULL, cid = NULL, filetype = NULL)
Arguments
| filepath | path to the file to be attached | 
| filename | name of the file to be used (supported by RegLogEmayiliConnector) | 
| cid | content ID to be used to access in email body | 
| filetype | mime type of the attached file | 
Value
mailMessageAttachment object
MongoDB edit to the database handler
Description
Default handler function querying database to confirm credentials
edit procedure and update values saved within database. Used within object of
RegLogMongoConnector class internally.
Usage
mongo_credsEdit_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which need to contain within its data: 
 It can also contain elements for change: 
 | 
See Also
Other MongoDB handler functions: 
mongo_login_handler(),
mongo_register_handler(),
mongo_resetPass_confirmation_handler(),
mongo_resetPass_generation_handler()
MongoDB login handler
Description
Default handler function querying database to confirm login
procedure. Used within object of RegLogMongoConnector class internally.
Usage
mongo_login_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which should contain within its data: 
 | 
See Also
Other MongoDB handler functions: 
mongo_credsEdit_handler(),
mongo_register_handler(),
mongo_resetPass_confirmation_handler(),
mongo_resetPass_generation_handler()
MongoDB register handler
Description
Default handler function querying database to confirm registration
validity and input new data. Used within object of RegLogMongoConnector class internally.
Usage
mongo_register_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which should contain within its data: 
 | 
See Also
Other MongoDB handler functions: 
mongo_credsEdit_handler(),
mongo_login_handler(),
mongo_resetPass_confirmation_handler(),
mongo_resetPass_generation_handler()
MongoDB resetpass code confirmation handler
Description
Default handler function querying database to confirm credentials
edit procedure and update values saved within database. Used within object of
RegLogMongoConnector class internally.
Usage
mongo_resetPass_confirmation_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which need to contain within its data: 
 | 
See Also
Other MongoDB handler functions: 
mongo_credsEdit_handler(),
mongo_login_handler(),
mongo_register_handler(),
mongo_resetPass_generation_handler()
MongoDB resetpass code generation handler
Description
Default handler function querying database to confirm credentials
edit procedure and update values saved within database. Used within object of
RegLogMongoConnector class internally.
Usage
mongo_resetPass_generation_handler(self, private, message)
Arguments
| self | R6 object element | 
| private | R6 object element | 
| message | RegLogConnectorMessage which need to contain within its data: 
 | 
See Also
Other MongoDB handler functions: 
mongo_credsEdit_handler(),
mongo_login_handler(),
mongo_register_handler(),
mongo_resetPass_confirmation_handler()
Create RegLog-valid database collections for MongoDB
Description
MongoDB database don't enforce a structure to the documents contained within. Even though this is true, it's best to use this function explicitly, as after creation of collections it also create appropriate indexes for quick querying of the database by RegLogMongoConnector.
Usage
mongo_tables_create(
  mongo_url,
  mongo_db,
  mongo_options = mongolite::ssl_options(),
  account_name = "account",
  reset_code_name = "reset_code",
  user_data = NULL,
  hash_passwords = FALSE,
  verbose = TRUE
)
Arguments
| mongo_url | URI to the MongoDB cluster | 
| mongo_db | name of the MongoDB database | 
| mongo_options | additional connection options such as SSL keys/certs | 
| account_name | Name of the collection for storing user accounts credentials. Defaults to 'account'. Mandatory collection. | 
| reset_code_name | Name of the collector for storing generated password reset codes. Defaults to 'reset_code'. Mandatory collection. | 
| user_data | If you wish to import existing user database, you can input data.frame with that table in this argument. It should contain columns: username, password, email (ond optionally: create_time). Defaults to NULL. | 
| hash_passwords | If you are importing table of users upon tables creation,
you can also specify if the password should be hashed using  | 
| verbose | Boolean specific if the actions made by function should be printed back to the console. | 
Details
Every document in created collections will have following structure:
- account (default name) - username: character (index) 
- password: character 
- email: character (index) 
- create_time: timestamp 
- update_time: timestamp 
 
- reset_code (default name) - user_id: character (index) 
- reset_code: character 
- used: numeric 
- create_time: timestamp 
- update_time: timestamp 
 
- logs (default name, optional) - this collection isn't created with this function, as there is no need for that - MongoDB collections don't have a set structure, and no additional index is created there. - time: timestamp 
- session: character 
- direction: character 
- type: character 
- note: character 
 
See Also
Other RegLog databases: 
DBI_tables_create(),
gsheet_tables_create()
Shiny UI module for password reset
Description
It need to be used in conjuction with login_server() function and is suggested to be used alongside login_UI() and register_UI() for full potential.
This function creates a UI div() element containing informations and input necessary for user to reset password. As it outputs a div() element, you can put it inside container of your choosing (be it some tabItem, fluidPage, fluidRow etc.). It is important to mention that password reset procedure invokes modalDialog(), so it should be avoided to contain this function inside one.
Usage
password_reset_UI(id = "login_system", lang = "en", custom_txts = NULL)
Arguments
| id | the id of the module. Defaults to "login_system" for all of the modules contained within the package. If you plan to use serveral login systems inside your app or for any other reason need to change it, remember to keep consistent id for all elements of module. | 
| lang | specifies the app used language. Accepts "en" or "pl". Defaults to "en" | 
| custom_txts | named list containing customized texts. For more details, see documentation for 'reglog_txt'. Provided list can contain only elements used by this function, but it is recommended to provide the same list for every 'shiny.reglog' function | 
Value
'tags$div' containing all elements for password reset procedure
See Also
login_server() for more details and example
Shiny UI module for registration box
Description
It need to be used in conjuction with login_server() function and is suggested to be used alongside login_UI() and password_reset_UI() for full potential.
This function creates a UI div() element containing informations and input necessary for user to register new account. As it outputs a div() element, you can put it inside container of your choosing (be it some tabItem, fluidPage, fluidRow etc.)
Usage
register_UI(id = "login_system", lang = "en", custom_txts = NULL)
Arguments
| id | the id of the module. Defaults to "login_system" for all of the modules contained within the package. If you plan to use serveral login systems inside your app or for any other reason need to change it, remember to keep consistent id for all elements of module. | 
| lang | specifies the app used language. Accepts "en" or "pl". Defaults to "en" | 
| custom_txts | named list containing customized texts. For more details, see documentation for 'reglog_txt'. Provided list can contain only elements used by this function, but it is recommended to provide the same list for every 'shiny.reglog' function | 
Value
'tags$div' containing all elements for registration procedure
See Also
login_server() for more details and example
Get texts for given language. Used within deprecated login_server
Description
Usage
reglog_txt(lang, x = NULL, custom_txts = NULL)
Arguments
| lang | character to identify the language | 
| x | character to identify the txt to get. If NULL, all labels are recovered | 
| custom_txts | named list providing custom messages to replace default for specific languages. | 
Details
'RegLog_txt' outside of internal usage should be used only for getting the structure of all texts generated by 'shiny.reglog'.
To customize texts used by RegLog objects, provide within their call named list to the 'custom_txts' argument - it will be passed to 'custom_txts' within this call. You can check validity of your list by providing the 'custom_txts' and calling this function in console.
Values of list provided should be named in the same way as the default text you are willing to replace.
Function to read SQLite shiny.reglog database
Description
As the new version of RegLog system allows for much more flexibility old functionalities for reading data is deprecated. Please use functions from adequate package: in this instance, 'DBI' package.
Usage
sqlite_get_db(sqlite_db)
Arguments
| sqlite_db | path to your 'SQLite' database | 
Value
list containing user_db and reset_db dataframes
See Also
create_sqlite_db