forked from dweuthen/roundcube-application_passwords
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.inc.php.dist
46 lines (36 loc) · 2.5 KB
/
config.inc.php.dist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
// Application Passwords Plugin Options
// ------------------------------------
// PEAR database DSN for performing the query.
$config['application_passwords_db_dsn'] = 'mysql://user:password@localhost/table';
// The SQL queries used to manage application-specific passwords.
// The query can contain the following macros that will be expanded as follows:
// %a is replaced with the application name
// %i is replaced with the application id
// %p is replaced with the plaintext new password
// %s is replaced with the plaintext (hex) new password salt
// %u is replaced with the username (from the session info)
// %l is replaced with the local part of the username
// (in case the username is an email address)
// %d is replaced with the domain part of the username
// (in case the username is an email address)
// Sample CREATE statement
// CREATE TABLE app_password (app_id int NOT NULL AUTO_INCREMENT KEY, application varchar(100) NOT NULL, username varchar(100) NOT NULL, domain varchar(100) NOT NULL, salt varchar(16) NULL, password varchar(100) NULL, created datetime);
// Sample Dovecot password query:
// password_query = SELECT username, domain, NULL AS password, 'Y' as nopassword FROM app_password WHERE username = '%n' AND password = SHA2(CONCAT (salt,REPLACE('%w',' ','')),512)
// password_query = CALL app_authenticate '%n', '%w', '%r', '%s', 'dovecot', 1,;
// SQL query for displaying list of applications for which a password is set
$config['application_passwords_select_query'] = 'SELECT app_id, application, created, lastlogin FROM app_password WHERE user_id=%u';
// SQL query for storing new application-specific password
$config['application_passwords_insert_query'] = 'INSERT INTO app_password (user_id, application, salt, password, created) VALUES (%u, %a, %s, SHA2(CONCAT(%s,%p), 512), now())';
// SQL query for deleting an application-specific password
$config['application_passwords_delete_query'] = 'DELETE FROM app_password WHERE user_id=%u AND app_id=%i';
// By default domains in variables are using unicode.
// Enable this option to use punycoded names
$config['application_passwords_idn_ascii'] = false;
// Show password in blocks of 4 characters separated by spaces
$config['application_passwords_show_spaces'] = true;
// Show a QR code that contains the password so it can be scanned for a phone
// Note: This uses google charts image API, so it sends the password
// to Google/NSA/Lizard People over HTTPS.
$config['application_passwords_show_barcode'] = false;