Skip to content

Commit

Permalink
Merge pull request #983 from PaulTGG/master
Browse files Browse the repository at this point in the history
Added CREATE TABLE statements into config/database.php
  • Loading branch information
Shadow243 authored Apr 30, 2024
2 parents 0a1e5be + b7378ac commit 9ca886e
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 59 deletions.
78 changes: 19 additions & 59 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
| standard PHP sessions, as well as its own completely independent session
| system that uses memcached or a database for storage. In order to use
| database sessions, the database must be correctly configured in the "DB
| Support" section and the hm_user_session table must be created. In order to
| use Memcached sessions, the memcached server must be correctly configured
| in the "Memcached Support" section. In order to use Redis session, the
| Redis server must be configured in the "Redis Support" section.
| Support" section and the hm_user_session table must be created (see
| config/database.php for more information). In order to use Memcached
| sessions, the memcached server must be correctly configured in the
| "Memcached Support" section. In order to use Redis session, the Redis
| server must be configured in the "Redis Support" section.
| Valid values for this setting:
| PHP Standard PHP session handlers
| DB Custom database based sessions
Expand All @@ -38,15 +39,16 @@
|
| This setting defines how Cypht will authenticate your username and password
| when you login. If you want to use a database it must be correctly configured
| in the "DB Support" section and the hm_user table must be created. There are
| 3 PHP cli scripts to help manage database users in the scripts/ directory (
| create_account.php, delete_account.php, and update_password.php). If you want
| to authenticate against an IMAP server, you must setup the imap_auth_* settings
| below. If you want to authenticate against an LDAP server,
| you must setup the ldap_auth_* settings. Finally, if you want to let users
| pick from a list of popular mail services or try to auto-discover a mail
| system, set this to dynamic and make sure the dynamic_login module set is
| enabled in the "Module Sets" section of this file.
| in the "DB Support" section and the hm_user table must be created (see
| config/database.php for more information). There are 3 PHP cli scripts to
| help manage database users in the scripts/ directory (create_account.php,
| delete_account.php, and update_password.php). If you want to authenticate
| against an IMAP server, you must setup the imap_auth_* settings below. If
| you want to authenticate against an LDAP server, you must setup the ldap_auth_*
| settings. Finally, if you want to let users pick from a list of popular mail
| services or try to auto-discover a mail system, set this to dynamic and make
| sure the dynamic_login module set is enabled in the "Module Sets" section of
| this file.
|
| Valid values for this setting:
|
Expand Down Expand Up @@ -190,9 +192,10 @@
| Cypht supports 3 methods for saving user settings between logins. File based
| settings, database table or custom implementation. To store settings in a
| database, it must be configured in the "DB Support" section and the
| hm_user_settings table must be created. To store settings on the filesystem,
| the user_settings_dir must be created and the webserver software must be able
| to write to it. For custom implementations, see Hm_User_Config_File.
| hm_user_settings table must be created (see config/database.php for more
| information). To store settings on the filesystem, the user_settings_dir must
| be created and the webserver software must be able to write to it. For custom
| implementations, see Hm_User_Config_File.
|
| Valid values for this setting:
| file Store user settings in the filesystem
Expand Down Expand Up @@ -614,49 +617,6 @@
'auth_class' => env('AUTH_CLASS'),
'session_class' => env('SESSION_CLASS'),

/*
| -----------
| DB Sessions
| -----------
|
| If your session_type is set to DB, the following table must exist in the DB
| defined above, and the db user must have read-write access to it:
|
| Postgresql:
| CREATE TABLE hm_user_session (hm_id varchar(250) primary key not null, data text, date timestamp);
| MySQL or SQLite:
| CREATE TABLE hm_user_session (hm_id varchar(180), data longblob, date timestamp, primary key (hm_id));
|
|
|
| -----------------
| DB Authentication
| -----------------
|
| If your auth_type is set to DB, the following table must exist in the DB
| defined above, and the db user must have read-write access to it:
|
| Postgresql:
| CREATE TABLE hm_user (username varchar(255) primary key not null, hash varchar(255));
| MySQL or SQLite:
| CREATE TABLE hm_user (username varchar(250), hash varchar(250), primary key (username));
|
|
|
|
| -----------
| DB Settings
| -----------
|
| If your user_config_type is set to DB, the following table must exist in the
| DB defined above, and the db user must have read-write access to it:
|
| Postgresql:
| CREATE TABLE hm_user_settings (username varchar(250) primary key not null, settings text);
| MySQL or SQLite:
| CREATE TABLE hm_user_settings(username varchar(250), settings longblob, primary key (username));
*/

/*
| -----------------------------------------------------------------------------
| Modules
Expand Down
37 changes: 37 additions & 0 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,41 @@
| Database type. can be any supported PDO driver ; (http://php.net/manual/en/pdo.drivers.php)
*/
'db_driver' => env('DB_DRIVER','mysql')

/*
| DB Sessions
| -----------
| If your session_type is set to DB, the following table must exist in the DB
| defined above, and the db user must have read-write access to it:
|
| Postgresql:
| CREATE TABLE hm_user_session (hm_id varchar(250) primary key not null, data text, date timestamp);
|
| MySQL or SQLite:
| CREATE TABLE hm_user_session (hm_id varchar(180), data longblob, date timestamp, primary key (hm_id));
|
|
| DB Authentication
| -----------------
| If your auth_type is set to DB, the following table must exist in the DB
| defined above, and the db user must have read-write access to it:
|
| Postgresql:
| CREATE TABLE hm_user (username varchar(255) primary key not null, hash varchar(255));
|
| MySQL or SQLite:
| CREATE TABLE hm_user (username varchar(250), hash varchar(250), primary key (username));
|
|
| DB Settings
| -----------
| If your user_config_type is set to DB, the following table must exist in the
| DB defined above, and the db user must have read-write access to it:
|
| Postgresql:
| CREATE TABLE hm_user_settings (username varchar(250) primary key not null, settings text);
|
| MySQL or SQLite:
| CREATE TABLE hm_user_settings(username varchar(250), settings longblob, primary key (username));
*/
];

0 comments on commit 9ca886e

Please sign in to comment.