Configuration

From KFMdoc
Jump to: navigation, search

Before version 1.4

Contents

Setup KFM

The first action to do is to set-up KFM. A good starting point is the configuration.dist.php file. Rename this to configuration.php:

cp configuration.dist.php configuration.php

Read this file carefully since it contains a lot of explanations.

Database

At first set up the database settings according to your server. When using mysql, change $kfm_db_type to mysql:

$kfm_db_type = 'mysql';

Make sure that the database specified by $kfm_db_name exists and can be accessed using the host, username, password and optionally port settings. In normal cases use phpMyAdmin to create the database and change the $kfm_db_username and $kfm_db_passord settings to access the mysql database.

Security

There is a very important setting named:

$use_kfm_security

The default value is false. This assumes that you add your own security code to the configuration file. Something like:

$MyCMS->securePage();

for example. If this is not the case for you, please change this value to true to use the built in security of KFM. Otherwise everybody can login to the files. If this setting is set to true a login screen appears when the KFM page is opened.

Note that the default username/password is admin/admin, change this as fast as you can!!!!

Locations

You have to inform kfm about the available locations of the files. Read the explanation in the configuration.php file for these settings. Important is to set the kfm_url setting in the Admin panel setting as well.

Admin panel

New in KFM 1.4 is the admin panel. Here you can configure KFM using a graphical system.

User management

User management is only available for users having admin rights. KFM has a special user with username admin. This is a very important user. Assuming this is your first login and you logged-in using admin/admin, please go as fast as possible to the Change password tab and Change your password!!!!!!. If you plan on having multiple users, create at first a user account for yourself and give it admin rights. The admin user's settings will be the default settings for all other users. So if you use the admin user as your account, settings you change may affect the settings of other users. Users with status user will not see the users management tab and will see the settings tab as first page when they go to the admin panel.

Settings

admin panel settings
admin panel settings

Most of the settings of KFM are done via the admin panel. This can be found by adding admin/ to the KFM root url.

Note that the default username/password is admin/admin, change this as fast as you can!!!!

Most of these settings have help available by clicking the question mark next to it. The admin user should not be considered a normal user. All de settings done by the admin user will become the default settings for all other users. So if you are planning on using the KFM user management system, consider the admin user for setting the default settings only. Settings that are marked user setting can be changed by users itself. One of the most useful examples of this is the theme setting.

Double click behaviour (File associations)

file associations
file associations
file associations rename
file associations rename

Before version 1.4 double click behaviour could be configured to be download or return, where images were shown if download was selected. As from version 1.4 the double click behaviour is not so black and white any more. You can specify associations specific for extensions. You associate extensions with a plugin. This makes sense since files like gif, png, jpg are likely to be associated to the image viewer plugin (lightbox, lytebox) and files like html, txt with EditArea.

For developers and fans of the old system. Setting up KFM for download is done by adding the following to the configuration.php or api/config.php file:

$kfm->addAssociation('download', 'all');

But the admin panel gives a nice graphical solution as well. The tab File associations can create these file associations. Here you can link extensions to plugins. Examples of these are:

  • download
  • return_url, return_thumbnail, return_file_id
  • editarea
  • lightbox

Extensions are given as a comma separated list. If the value is all, it will select all. Regular expressions are not supported. You can always specify a default plugin for all extensions, since KFM will look if the extension of the file that is double clicked is specified explicitly and if no association for that extension is found it will execute the plugin specified for all extensions. If you want to have a default plugin for all extensions, exept some, create a dummy plugin (Plugin with empty doFunction) and point these extensions to this function. Make sure that the nocontextmenu setting is true for this plugin.

Custom configuration settings

The admin panel gives a nice access to the settings of KFM, but might nog be sufficient. You may want to have settings based on your own CMS or something else. To do this add these settings to the configuration.php file. Some examples:

$kfm->setting('banned_folders', array('/^\./', 'admin', $MyCMS->hidden_folder), true);
$kfm->setting('root_folder', 'users/'+$MyCMS->username, true);

The last true freezes the setting preventing any further changes from that moment on.

Personal tools