config | R Documentation |
Call these functions every time you need to get environment variables set, like the URL, user and password of the MongoDB database used by the course.
config(
url,
password,
cache = file.path(tempdir(), ".learnitdown_config"),
debug = Sys.getenv("LEARNITDOWN_DEBUG", 0) != 0
)
sign_in(
data,
password,
cipher = "aes-256-cbc",
iv = NULL,
cache = file.path(tempdir(), ".learnitdown_user"),
debug = Sys.getenv("LEARNITDOWN_DEBUG", 0) != 0
)
sign_out(
title = "Signing out",
message = "Do you really want to sign out with learnitdown?",
cache = file.path(tempdir(), ".learnitdown_user"),
debug = Sys.getenv("LEARNITDOWN_DEBUG", 0) != 0
)
encrypt(
object,
password,
cipher = "aes-256-cbc",
iv = NULL,
serialize = TRUE,
base64 = FALSE,
url.encode = FALSE
)
decrypt(
object,
password,
cipher = "aes-256-cbc",
iv = NULL,
unserialize = TRUE,
base64 = FALSE,
url.decode = FALSE
)
lock(
object,
password,
key = "",
message = "Password for learnitdown:",
reset = FALSE,
ref1 = NULL,
ref2 = NULL
)
unlock(
object,
password,
key = "",
message = "Password for learnitdown:",
reset = FALSE,
ref1 = NULL,
ref2 = NULL
)
url |
The URL of the encrypted file that contains the configuration information. |
password |
The password to crypt, decrypt, lock or unlock the data. |
cache |
The path to the file to use to store a cached version of these data. Access to the database will be checked, and if it fails, the configuration data are refreshed from the URL. |
debug |
Do we issue debugging messages? By default, it is set according
to the |
data |
The fingerprint data in clear or ciphered form (in this case, the string must start with "fingerprint="). |
cipher |
The cryptography algorithm to use. |
iv |
The initialization vector for the cipher. |
title |
The title of the dialog box prompting to sign out. |
message |
The message of the dialog box prompting to sign out, or asking for a password. |
object |
An object to be encrypted, decrypted, locked or unlocked. |
serialize |
Do we serialize |
base64 |
Do we encode/decode base64 the object ( |
url.encode |
Do we encode for URL (query) use ( |
unserialize |
Do we unserialize the resulting object after deciphering
it ( |
url.decode |
Do we decode URL before deciphering it ( |
key |
The key that stores the password. It is advised to use something
like |
reset |
Should we reset the password ( |
ref1 |
Code to check the validity of the password |
ref2 |
Second code to check password validity. |
Invisibly returns TRUE
if success, or FALSE
otherwise for
config()
. The encrypted/decrypted object for encrypt()
and decrypt()
,
or the locked/unlocked object for lock()
and unlock()
.
The user information for sign_in()
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.