-
Notifications
You must be signed in to change notification settings - Fork 5
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.
- 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"
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 added some fields into jlx_user or if you use an other table:
- Indicate to not install the community_users table
jcommunity.installparam = "masteradmin;notjcommunitytable"
- 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.
- 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)
- modify the corresponding form file (or overload it) with the new fields. see an example in jcommunity/forms/account_admin.form.xml.
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.
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
).
To finalize, you should launch the install script:
php cmd.php installapp