Skip to content
Laurent Jouanneau edited this page Jan 7, 2018 · 4 revisions

Using jCommunity with master_admin

In an application like a back-office or intranet, usually users should authenticate themselves before accessing to the application. This is the role of the master_admin module. However some features are missing, like password recovery or registration. So you may want to use jCommunity.

To do it, you must replace modules jauth and jauthdb by jcommunity. Here are instructions.

Note: this feature works only with Jelix 1.6.5 or higher.

Main configuration file

  • Declare the path to the module into the application. Either in the modulePath parameter in the configuration (jelix 1.6), or in the application.init.php file (jelix 1.7+)
  • Activate the jcommunity module and deactivate jauth and jauthdb
[modules]
jauth.access = 0
jauthdb.access = 0
jcommunity.access = 2
jcommunity.installparam = masteradmin

[simple_urlengine_entrypoints]

admin="jacl2db~*@classic, jacl2db_admin~*@classic, jauthdb_admin~*@classic, master_admin~*@classic, jpref_admin~*@classic,jcommunity~*@classic"

Database setup

you want to use the jCommunity table

The installation script of jcommunity will create the table community_users.

If you use the standard table of jauthdb (jlx_user) and it didn't change, and if you want to migrate existing users, add the installation parameter migratejauthdbusers.

[modules]
jcommunity.installparam = "masteradmin;migratejauthdbusers"

If you want to use your own users table or stay with jlx_user

If you added some fields into jlx_user or if you use an other table:

  1. Indicate to not install the community_users table
    jcommunity.installparam = "masteradmin;notjcommunitytable"
    
  2. add in your table all fields needed to jCommunity. See the SQL file jcommunity/install/sql. You should add at least these fields: status, keyactivate, request_date, create_date... If there are records, set the status field value to 1, and create_date to the date of the day.
  3. modify the dao file corresponding to your table (or overload it), by adding new fields and to create a new method verifyNickname (see an example in the file jcommunity/daos/user.dao.xml)
  4. modify the corresponding form file (or overload it) with the new fields. see an example in jcommunity/forms/account_admin.form.xml.

Configuring the mailer

If you didn't already setup it, do it. jCommunity needs to send emails when the user wants to reset its password or when he register a new account.

Replace templates

You must redefines the template master_admin~zone_admin_infobox.tpl. See an example in the directory install/theme of the jcommunity module. You should replace links to the jauth module by links to jcommunity (ex jauth~login:out by jcommunity~login:out ).

launch the installer

To finalize, you should launch the install script:

php cmd.php installapp
Clone this wiki locally