-
Notifications
You must be signed in to change notification settings - Fork 5
Installation
Latest jCommunity version works only with Jelix 1.6 and higher. You need to upgrade Jelix to the latest minor release of the branch you use. Minimum supported versions are 1.6.5.
Download the package from http://download.jelix.org/forge/jcommunity/ and extract it somewhere.
You can then move modules/jcommunity into a module repository of your application, or declare the directory into the mainconfig.ini.php (for Jelix 1.6), or into the application.init.php (for Jelix 1.7+).
In your composer.json, in the require section, indicate:
"jelix/jcommunity-module": "1.1"
After a composer update
:
- if you use Jelix 1.6 or lower, you can declare jcommunity in the modulePath
parameter of the configuration. Example:
modulePath=(...);app:vendors/jelix/jcommunity-module/modules/
- if you use Jelix 1.7 or higher, it is automatically declared.
You should do nothing about them. Uninstall and deactivate them. jCommunity provides its own sql table, and its own dao. jCommunity provides all needed things, with some different behaviors.
jCommunity 1.1+ can be used with the master_admin module. Continue the installation by reading the specific manual for this purpose.
In the configuration of the application, activate the module and the auth plugin for the coordinator:
[modules]
jauth.access = 0
jauthdb.access = 0
jcommunity.access = 2
jcommunity.installparam =
[coordplugins]
auth=auth.coord.ini.php
Configure also parameters in the mailer section. jCommunity needs to send mail to users.
The installer supports some parameters. You should list them into the
jcommunity.installparam
, with a semi colon as separator.
-
rewriteconfig
: indicate to change automatically the jauth configuration -
defaultuser
: register an "admin" user (passowrd: "admin") into the community_users table -
masteradmin
(1.1+): indicate that jcommunity is used for master_admin module. see the dedicated chapter -
notjcommunitytable
(1.1+): do not create the community_users table. It's up to you to do changes into your own SQL table. Not compatible with migratejauthdbusers and defaultuser -
migratejauthdbusers
(1.1+): indicate to do migration jlx_users records to community_users
ex:
jcommunity.installparam = "rewriteconfig;defaultuser"
Don't forget double quotes, else characters after ";" will be interpreted as a comment.
With jCommunity 1.1+, you can use jPref to allow to change some settings. If you want to use it, you should also install the jpref module:
[modules]
jpref.access = 2
To finish the setup, launch the installer
php cmd.php installapp
It then creates a community_users
table. If you have already a table of users, you can
add new fields of community_users
in your table. You should then override all DAOs of
the jcommunity module to change fieldnames and the table.
The auth coordplugin is automatically activated in your configuration. However,
verify in your ini file yourapp/var/config/auth.coord.ini.php
, that you have these values:
driver = Db
on_error_action = "jcommunity~login:out"
bad_ip_action = "jcommunity~login:out"
persistant_crypt_key= "INSERT HERE A SENTENCE"
[Db]
; name of the dao to get user datas
dao = "jcommunity~user"
form = "jcommunity~account_admin"
See the dedicated page.
You can integrate the "status" zone into your main template (directly into the template or via your main response).
$response->body->assignZone('STATUS', 'jcommunity~status');
It shows links to the login form, the register form if the user isn't authenticated, or to the logout page and account page if he is authenticated.
You can change the start action in index/config.ini.php like this:
startModule=jcommunity
startAction="login:index"
if you use significant urls, link urls_account.xml, urls_auth.xml and urls_registration.xml to the main urls.xml of the application
<url pathinfo="/auth" module="jcommunity" include="urls_auth.xml"/>
<url pathinfo="/profile" module="jcommunity" include="urls_account.xml"/>
<url pathinfo="/registration" module="jcommunity" include="urls_registration.xml"/>