-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 29a7998
Showing
7 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
toucher Plugin for DokuWiki | ||
|
||
touches config files | ||
|
||
All documentation for this plugin can be found at | ||
http://www.dokuwiki.org/plugin:toucher | ||
|
||
If you install this plugin manually, make sure it is installed in | ||
lib/plugins/toucher/ - if the folder is called different it | ||
will not work! | ||
|
||
Please refer to http://www.dokuwiki.org/plugins for additional info | ||
on how to install plugins in DokuWiki. | ||
|
||
---- | ||
Copyright (C) Andriy Nych <nych.andriy@gmail.com> | ||
|
||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; version 2 of the License | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
See the COPYING file in your DokuWiki folder for details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
/** | ||
* DokuWiki Plugin toucher (Admin Component) | ||
* | ||
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html | ||
* @author Andriy Nych <nych.andriy@gmail.com> | ||
*/ | ||
|
||
// must be run within Dokuwiki | ||
if (!defined('DOKU_INC')) die(); | ||
|
||
if (!defined('DOKU_LF')) define('DOKU_LF', "\n"); | ||
if (!defined('DOKU_TAB')) define('DOKU_TAB', "\t"); | ||
if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); | ||
|
||
require_once DOKU_PLUGIN.'admin.php'; | ||
|
||
class admin_plugin_toucher extends DokuWiki_Admin_Plugin { | ||
|
||
public function getMenuSort() { | ||
return 13; | ||
} | ||
|
||
public function forAdminOnly() { | ||
return $this->getConf('admin_only'); | ||
} | ||
|
||
function touchFiles() { | ||
touch(DOKU_CONF."local.php"); // this is the core of this plugin | ||
} | ||
|
||
public function handle() { | ||
global $INFO; | ||
|
||
if ($this->getConf('admin_only')) { | ||
if (!$INFO[isadmin]) { | ||
msg('Plugin toucher failed: you must be admin to touch configuration',-1); | ||
return false; | ||
} | ||
} | ||
$this->touchFiles(); | ||
msg('Plugin toucher touched configuration files',1); | ||
return true; | ||
} | ||
|
||
public function html() { | ||
ptln('<h1>' . $this->getLang('menu') . '</h1>'); | ||
ptln('<p>Configuration files have been just touched.</p>'); | ||
} | ||
} | ||
|
||
// vim:ts=4:sw=4:et: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
/** | ||
* Default settings for the toucher plugin | ||
* | ||
* @author Andriy Nych <nych.andriy@gmail.com> | ||
*/ | ||
|
||
$conf['admin_only'] = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
/** | ||
* Options for the toucher plugin | ||
* | ||
* @author Andriy Nych <nych.andriy@gmail.com> | ||
*/ | ||
|
||
$meta['admin_only'] = array('onoff'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
/** | ||
* English language file for toucher plugin | ||
* | ||
* @author Andriy Nych <nych.andriy@gmail.com> | ||
*/ | ||
|
||
$lang['menu'] = 'Touch configuration files'; | ||
|
||
|
||
//Setup VIM: ex: et ts=4 : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
/** | ||
* english language file for toucher plugin | ||
* | ||
* @author Andriy Nych <nych.andriy@gmail.com> | ||
*/ | ||
|
||
$lang['admin_only'] = 'Allow toucher plugin only for admins (superusers)'; | ||
|
||
//Setup VIM: ex: et ts=4 : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
base toucher | ||
author Andriy Nych | ||
email nych.andriy@gmail.com | ||
date 2012-09-16 | ||
name Toucher plugin | ||
desc A plugin for touching configuration files without changing DokuWiki settings | ||
url http://www.dokuwiki.org/plugin:toucher |