Configuration plugin

config plugin by Chris Smith
Manage your wiki's configuration settings (bundled with DokuWiki)

Provides Admin.
Compatible with DokuWiki (bundled).

Tagged with !bundled, configuration, options, settings.

This plugin allows wiki administrators to easily alter their configuration settings online from the comfort of their favorite webbrowser.

To access the admin page, first click “Log in”. When logged in as a super user, the “Admin” button will appear (bottom right by default, on all pages).

:!: Can't see “Login” nor “Admin”? You need to have configured your wiki for ACL, created a user and made that user a super user. If you disabled ACL, re-install the wiki (open the ..../install.php and read the instructions there)

Usage Notes

Settings are shown with different backgrounds to highlight their source. A blue background is used to show default values (conf/dokuwiki.php). A white background to show local changes (conf/local.php) and a light red background to show protected settings (conf/local.protected.php). Protected settings are discussed below.

On saving changed settings this plugin will copy the current local settings file (conf/local.php) to conf/local.php.bak and save the updated settings to conf/local.php. It will never make any changes to the default settings stored in conf/dokuwiki.php. However, any settings found in conf/local.php will override the default settings as explained in the configuration options page.

The plugin adds the following lines to the top of conf/local.php when it updates it …

/*
 * Dokuwiki's Main Configuration File - Local Settings 
 * Auto-generated by config plugin 
 * Run for user: <username>
 * Date: <current date/time, rfc 2822 format (day, dd MMM YYYY hh:mm:ss TZ)>
 */

Protecting Settings

You can protect certain settings by placing them in conf/local.protected.php. This plugin adds the following line to the bottom of conf/local.php

@include(DOKU_CONF.'local.protected.php');

— thereby ensuring the protected settings are included and will override any previously set values from conf/dokuwiki.php and conf/local.php. Any settings found in this file will be displayed by the plugin surrounded in light-red to indicated their protected status. Editing of protected values is disabled.

Installation

The plugin is installed automatically as part of the Dokuwiki installation process.

Login as a superuser/admin. Push the button Admin on the lower button bar. You will see Configuration Settings under the Administration title.

Details

The plugin has been structured to work to separate knowledge of Dokuwiki settings from the scripts which handle the settings.

  • admin.php provides the interface to dokuwiki's admin menu, the user and instantiates the configuration object.
  • settings/config.class.php contains the configuration class and several generic setting classes. It reads the metadata which describes the settings (settings/config.metadata.php) and loads dokuwiki's settings into objects capable of understanding each setting.
  • settings/extra.class.php provides some extra setting classes where a particular setting can not be handled by one of the generic classes.

Of the remaining files,

  • style.css has styles to assist in displaying settings, particular to indicated errors;
  • intro.txt & lang.php contain locale dependent strings displayed to the user. These two can be translated these into your local language. The translations should be stored in a sub-folder of lang with the same code you have chosen for your Dokuwiki installation.

Complete source listings can be found in the Dokuwiki source repository

Revision History

For further revision information refer Dokuwiki's darcs repository

  • 2006-03-05 — Included in Dokuwiki Release
  • 2006-01-24 — Darcs Only (package release held until after next Dokuwiki release).
    • add new config settings
    • improved pattern for config.class (thanks Otto)
    • add support for Dokuwiki's substitution styles
  • 2005-12-12 — Amendment to metadata to allow for 0 in seceditlevel (not released yet, see note below).
  • 2005-11-11 — :!: Fix self links, the plugin can't update config settings without this fix
  • 2005-10-30 — Released.

Bugs

Bugs should be reported through the DokuWiki bugtracker.

To Do

  • figure out a better way to handle settings of higher array dimension than 1
  • add help for individual settings - accessible from the settings page
  • group settings visually for easier editing

Comments/Discussion


I also have a problem, but with the way the local.php file is written. My ISP's system seems to change the group to which a file belong when it's written (created?) by a PHP program, and this plugin changes its permission to -rw-r–r–, the result being that I become unable to edit, delete or otherwise access the file directly. My only solution is to call my ISP support for them to chmod the file back to -rw-rw-rw-.

Is there a simple solution for this? Unfortunately I don't know PHP to try and fix it by myself. If you could help me by pointing which line needs to be changed and how I would be very thankful! — Alexander Gieg 2005-12-05 20:10

it must be something “wrong” with your PHP-coder-prog. Do check there your settings first, then those of your ftp-program. I don't think there are ISPs changing once set permission all by themselves… — Freddy 2005-12-05 21:06
I've checked all of this before, and everything works fine. — Alexander Gieg 2005-12-06 12:02
Try adding these two lines in settings/config.class.php at the start of function save_settings(), approx. line 83
  global $conf;
  umask($conf['umask']);

. Please let me know if it makes any difference. — Christopher Smith 2005-12-06 03:53

That made it! The file's now being created/updated with the correct permissions. Thank you very much! — Alexander Gieg 2005-12-06 12:02
I got burnt by this too. I think the umask setting is now deprecated, so I just put
  umask('0007');

instead. I also needed to put

  chgrp($file,'webpage');

at the end of the function, making sure that the webserver user (www-data or similar) was a member of the webpage group. (Make sure you restart apache so it gets the updated group context.) Luke Howson 2007-07-13


Where is the Save-button? — Robert Heinrich 2006-03-03 17:56

If local.php is not writable, there will be a highlight box at the top of the page explaining the settings are for information only and can't be changed. If the local.php is writable the save button will be at the bottom of the page. — Christopher Smith 2006-03-04 16:27

local.php has rw-rw-rw- and is “owned” by the webserver. What else needs to be writeable? Robert Heinrich 2006-03-06 08:45

the conf directory. The plugin attempts to move your current file to local.php.bak and create a new file. — Christopher Smith 2006-03-06 11:48

That did it. A big Thank You from me! Robert Heinrich 2006-03-06 19:19


It keeps telling me “The settings file can not be updated, if this is unintentional, ensure the local settings file name and permissions are correct.” What should all the ch options be for local.php? Running on Fedora 4 with Apache. — HippieCat 2006-03-06 07:52

The file needs to be writable by the webserver as does the conf directory. The exact permissions will depend on the owner/group of the file/directory and the user/group under which your php is running. — Christopher Smith 2006-03-06 11:48

Ok, I love this one, but - what does section about “edit Dokuwiki actions” mean? Do I disable them? For whom? Either the options are not cleary labeled, or I miss something… Besides it's really cool to have this interface… http://www.project22.org/wiki thanks a lot

The english prompt is “Disable DokuWiki actions”. It could be the translation to your native language isn't accurate. On reflection, I think making the english
Disable DokuWiki actions
Ticked actions will be disabled

Christopher Smith 2006-10-05 02:36

When I use conf plugin, it says “updated successful” however, it was not updated. Also I don't see any ”/* * Dokuwiki's Main Configuration File - Local Settings * Auto-generated by config plugin ” in my conf/local.php either. What could be cause? I have another wiki on a different server that one is working fine. thanks in advance.

Possibly the config plugin is having problems writing to your config file. If that is the case, it shouldn't report that it was successful. If you can verify the file you are looking at is the actual conf/local.php then please file a bug report. — Christopher Smith 2006-11-15 04:54

I am having a problem with the config plug in. I've installed the latest DokuWiki and it workd perfectly on my local machine. I've change to dokubook template and have changed the ACL to enable user to register into the system. However i can't seem to be able to see the admin button. For information, i am not able to create superuser (I've created a few users by registering them through the login system). Please help on how i could make the plugin working. Btw, i've read the entry above but i dunno/am not sure how to create a user and make that user as a super user. Please could someone help me. Thank you — abtet 2007-03-17

Normally the superuser is created during the installation. For the Dokubook template, the admin link is in the toolbox on the left, but only if you`re logged in as superuser. Have a look at your <dokuwiki>/conf/users.auth.php, there should be at least on user which is in the @admin group (the groups are listed at the end of every line after the last ':'). — Michael Klier 2007-03-17 12:23

Hello, I have the following problem; when I go to the admin page all the textboxes are empty. It seems as if config isn't reading any of the configuration parameters. However if I fill any textbox and press save, it generates a local.php file with the configuration, overwriting my old local.php. Dokuwiki is able to read the configuration, it's just that I would like to be able to use the config plugin. Thank you. Pedro Perez 2007-05-31

This bug is experienced by other users, too. See the Bug report
 
plugin/config.txt · Last modified: 2008/06/21 03:03 by ach
 
Imprint Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsTranslate