1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dokuwiki_ynh.git synced 2024-09-03 18:26:20 +02:00

Merge pull request #1 from alexjj/elenor-of-tsort

Updated to Elenor of Tsort
This commit is contained in:
Alex Johnstone 2016-10-21 20:38:04 -07:00 committed by GitHub
commit fdf5a72746
1820 changed files with 10952 additions and 22368 deletions

View file

@ -4,7 +4,7 @@ at http://www.dokuwiki.org/
For Installation Instructions see
http://www.dokuwiki.org/install
DokuWiki - 2004-2015 (c) Andreas Gohr <andi@splitbrain.org>
DokuWiki - 2004-2016 (c) Andreas Gohr <andi@splitbrain.org>
and the DokuWiki Community
See COPYING and file headers for license info

View file

@ -1 +1 @@
2015-08-10a "Detritus"
2016-06-26a "Elenor of Tsort"

View file

@ -1,2 +1,7 @@
order allow,deny
deny from all
<IfModule mod_authz_host>
Require all denied
</IfModule>
<IfModule !mod_authz_host>
Order allow,deny
Deny from all
</IfModule>

View file

@ -248,7 +248,7 @@ class PageCLI extends DokuCLI {
lock($wiki_id);
if(checklock($wiki_id) != $this->username) {
if(checklock($wiki_id)) {
$this->error("Unable to obtain lock for $wiki_id ");
var_dump(checklock($wiki_id));
exit(1);

View file

@ -1,3 +1,8 @@
## no access to the conf directory
order allow,deny
deny from all
<IfModule mod_authz_host>
Require all denied
</IfModule>
<IfModule !mod_authz_host>
Order allow,deny
Deny from all
</IfModule>

View file

@ -65,7 +65,7 @@ $conf['disableactions'] = ''; //comma separated list of actions to di
$conf['auth_security_timeout'] = 900; //time (seconds) auth data is considered valid, set to 0 to recheck on every page view
$conf['securecookie'] = 1; //never send HTTPS cookies via HTTP
$conf['remote'] = 0; //Enable/disable remote interfaces
$conf['remoteuser'] = '!!not set !!'; //user/groups that have access to remote interface (comma separated)
$conf['remoteuser'] = '!!not set!!'; //user/groups that have access to remote interface (comma separated)
/* Antispam Features */
$conf['usewordblock']= 1; //block spam based on words? 0|1
@ -149,7 +149,7 @@ $conf['compression'] = 'gz'; //compress old revisions: (0: off) ('gz
// bz2 generates smaller files, but needs more cpu-power
$conf['gzip_output'] = 0; //use gzip content encodeing for the output xhtml (if allowed by browser)
$conf['compress'] = 1; //Strip whitespaces and comments from Styles and JavaScript? 1|0
$conf['cssdatauri'] = 0; //Maximum byte size of small images to embed into CSS, won't work on IE<8
$conf['cssdatauri'] = 512; //Maximum byte size of small images to embed into CSS, won't work on IE<8
$conf['send404'] = 0; //Send a HTTP 404 status for non existing pages?
$conf['broken_iua'] = 0; //Platform with broken ignore_user_abort (IIS+CGI) 0|1
$conf['xsendfile'] = 0; //Use X-Sendfile (1 = lighttpd, 2 = standard)

View file

@ -26,11 +26,11 @@ wpmeta https://meta.wikipedia.org/wiki/{NAME}
doku https://www.dokuwiki.org/
rfc https://tools.ietf.org/html/rfc
man http://man.cx/
amazon https://www.amazon.com/exec/obidos/ASIN/{URL}/splitbrain-20/
amazon.de https://www.amazon.de/exec/obidos/ASIN/{URL}/splitbrain-21/
amazon.uk https://www.amazon.co.uk/exec/obidos/ASIN/
amazon https://www.amazon.com/dp/{URL}?tag=splitbrain-20
amazon.de https://www.amazon.de/dp/{URL}?tag=splitbrain-21
amazon.uk https://www.amazon.co.uk/dp/{URL}
paypal https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=
phpfn https://www.php.net/{NAME}
phpfn https://secure.php.net/{NAME}
skype skype:{NAME}
google.de https://www.google.de/search?q=
go https://www.google.com/search?q={URL}&amp;btnI=lucky

View file

@ -14,23 +14,23 @@ $license['publicdomain'] = array(
'url' => 'http://creativecommons.org/licenses/publicdomain/',
);
$license['cc-by'] = array(
'name' => 'CC Attribution 3.0 Unported',
'url' => 'http://creativecommons.org/licenses/by/3.0/',
'name' => 'CC Attribution 4.0 International',
'url' => 'http://creativecommons.org/licenses/by/4.0/',
);
$license['cc-by-sa'] = array(
'name' => 'CC Attribution-Share Alike 3.0 Unported',
'url' => 'http://creativecommons.org/licenses/by-sa/3.0/',
'name' => 'CC Attribution-Share Alike 4.0 International',
'url' => 'http://creativecommons.org/licenses/by-sa/4.0/',
);
$license['gnufdl'] = array(
'name' => 'GNU Free Documentation License 1.3',
'url' => 'http://www.gnu.org/licenses/fdl-1.3.html',
);
$license['cc-by-nc'] = array(
'name' => 'CC Attribution-Noncommercial 3.0 Unported',
'url' => 'http://creativecommons.org/licenses/by-nc/3.0/',
'name' => 'CC Attribution-Noncommercial 4.0 International',
'url' => 'http://creativecommons.org/licenses/by-nc/4.0/',
);
$license['cc-by-nc-sa'] = array(
'name' => 'CC Attribution-Noncommercial-Share Alike 3.0 Unported',
'url' => 'http://creativecommons.org/licenses/by-nc-sa/3.0/',
'name' => 'CC Attribution-Noncommercial-Share Alike 4.0 International',
'url' => 'http://creativecommons.org/licenses/by-nc-sa/4.0/',
);

View file

@ -1,2 +1,7 @@
order allow,deny
deny from all
<IfModule mod_authz_host>
Require all denied
</IfModule>
<IfModule !mod_authz_host>
Order allow,deny
Deny from all
</IfModule>

View file

@ -2,6 +2,10 @@
# but were removed later. An up to date DokuWiki should not have any of
# the files installed
# removed in 2016-06-26
inc/cliopts.php
lib/tpl/dokuwiki/css/mixins.less
# removed in 2015-08-10
inc/TarLib.class.php
inc/geshi.php
@ -228,19 +232,6 @@ inc/geshi/xpp.php
inc/geshi/yaml.php
inc/geshi/z80.php
inc/geshi/zxbasic.php
inc/lang/ku/admin.txt
inc/lang/ku/denied.txt
inc/lang/ku/editrev.txt
inc/lang/ku/locked.txt
inc/lang/ku/login.txt
inc/lang/ku/mailtext.txt
inc/lang/ku/norev.txt
inc/lang/ku/password.txt
inc/lang/ku/read.txt
inc/lang/ku/register.txt
inc/lang/ku/revisions.txt
inc/lang/ku/showrev.txt
inc/lang/ku/stopwords.txt
lib/images/interwiki/coral.gif
lib/images/interwiki/dokubug.gif
lib/images/interwiki/sb.gif
@ -250,25 +241,6 @@ lib/scripts/tw-sack.js
# removed in 2014-05-05
lib/images/fileicons/audio.png
lib/plugins/acl/lang/hi/lang.php
lib/plugins/acl/lang/id-ni/lang.php
lib/plugins/acl/lang/lb/lang.php
lib/plugins/acl/lang/ms/lang.php
lib/plugins/authad/lang/lv/settings.php
lib/plugins/authldap/lang/lv/settings.php
lib/plugins/authmysql/lang/fi/settings.php
lib/plugins/authmysql/lang/lv/settings.php
lib/plugins/authpgsql/lang/fi/settings.php
lib/plugins/authpgsql/lang/it/settings.php
lib/plugins/authpgsql/lang/lv/settings.php
lib/plugins/authpgsql/lang/pl/settings.php
lib/plugins/config/lang/hr/lang.php
lib/plugins/config/lang/id/lang.php
lib/plugins/config/lang/kk/lang.php
lib/plugins/config/lang/lb/lang.php
lib/plugins/config/lang/mk/lang.php
lib/plugins/config/lang/ms/lang.php
lib/plugins/config/lang/vi/lang.php
lib/plugins/plugin/admin.php
lib/plugins/plugin/classes/ap_delete.class.php
lib/plugins/plugin/classes/ap_download.class.php
@ -380,31 +352,6 @@ lib/plugins/plugin/lang/zh/admin_plugin.txt
lib/plugins/plugin/lang/zh/lang.php
lib/plugins/plugin/plugin.info.txt
lib/plugins/plugin/style.css
lib/plugins/popularity/lang/et/lang.php
lib/plugins/popularity/lang/hr/lang.php
lib/plugins/popularity/lang/id/lang.php
lib/plugins/popularity/lang/kk/lang.php
lib/plugins/popularity/lang/lb/lang.php
lib/plugins/popularity/lang/mk/lang.php
lib/plugins/popularity/lang/ms/lang.php
lib/plugins/popularity/lang/vi/lang.php
lib/plugins/revert/lang/af/lang.php
lib/plugins/revert/lang/hi/lang.php
lib/plugins/revert/lang/hr/lang.php
lib/plugins/revert/lang/id-ni/lang.php
lib/plugins/revert/lang/id/lang.php
lib/plugins/revert/lang/kk/lang.php
lib/plugins/revert/lang/lb/lang.php
lib/plugins/revert/lang/lt/lang.php
lib/plugins/revert/lang/mk/lang.php
lib/plugins/revert/lang/ms/lang.php
lib/plugins/revert/lang/vi/lang.php
lib/plugins/usermanager/lang/hi/lang.php
lib/plugins/usermanager/lang/hr/lang.php
lib/plugins/usermanager/lang/id-ni/lang.php
lib/plugins/usermanager/lang/lb/lang.php
lib/plugins/usermanager/lang/ms/lang.php
lib/plugins/usermanager/lang/vi/lang.php
# removed in 2013-11-18
lib/images/arrow_down.gif
@ -689,7 +636,6 @@ lib/scripts/domTT.js
# removed in 2006-11-06
inc/admin_acl.php
inc/lang/lt/stopwords.txt
inc/magpie
inc/magpie/rss_cache.inc
inc/magpie/rss_fetch.inc

View file

@ -96,9 +96,9 @@ $lang['js']['nosmblinks'] = '';
You can also use an image to link to another internal or external page by combining the syntax for links and [[#images_and_other_files|images]] (see below) like this:
[[http://www.php.net|{{wiki:dokuwiki-128.png}}]]
[[http://php.net|{{wiki:dokuwiki-128.png}}]]
[[http://www.php.net|{{wiki:dokuwiki-128.png}}]]
[[http://php.net|{{wiki:dokuwiki-128.png}}]]
Please note: The image formatting is the only formatting syntax accepted in link names.
@ -136,12 +136,12 @@ Resize to given width: {{wiki:dokuwiki-128.png?50}}
Resize to given width and height((when the aspect ratio of the given width and height doesn't match that of the image, it will be cropped to the new ratio before resizing)): {{wiki:dokuwiki-128.png?200x50}}
Resized external image: {{http://de3.php.net/images/php.gif?200x50}}
Resized external image: {{http://php.net/images/php.gif?200x50}}
Real size: {{wiki:dokuwiki-128.png}}
Resize to given width: {{wiki:dokuwiki-128.png?50}}
Resize to given width and height: {{wiki:dokuwiki-128.png?200x50}}
Resized external image: {{http://de3.php.net/images/php.gif?200x50}}
Resized external image: {{http://php.net/images/php.gif?200x50}}
By using left or right whitespaces you can choose the alignment.

View file

@ -9,7 +9,7 @@
*/
// update message version - always use a string to avoid localized floats!
$updateVersion = "47.1";
$updateVersion = "48.1";
// xdebug_start_profiling();

View file

@ -135,7 +135,7 @@ function rss_parseOptions() {
'content_type' => array('str', 'view', $conf['rss_media'])
) as $name => $val) {
$opt[$name] = $INPUT->$val[0]($val[1], $val[2], true);
$opt[$name] = $INPUT->{$val[0]}($val[1], $val[2], true);
}
$opt['items'] = max(0, (int) $opt['items']);

View file

@ -1,3 +1,8 @@
## no access to the inc directory
order allow,deny
deny from all
<IfModule mod_authz_host>
Require all denied
</IfModule>
<IfModule !mod_authz_host>
Order allow,deny
Deny from all
</IfModule>

View file

@ -1281,5 +1281,241 @@ class InlineDiffFormatter extends DiffFormatter {
}
}
/**
* A class for computing three way diffs.
*
* @author Geoffrey T. Dairiki <dairiki@dairiki.org>
*/
class Diff3 extends Diff {
/**
* Conflict counter.
*
* @var integer
*/
var $_conflictingBlocks = 0;
/**
* Computes diff between 3 sequences of strings.
*
* @param array $orig The original lines to use.
* @param array $final1 The first version to compare to.
* @param array $final2 The second version to compare to.
*/
function __construct($orig, $final1, $final2) {
$engine = new _DiffEngine();
$this->_edits = $this->_diff3($engine->diff($orig, $final1),
$engine->diff($orig, $final2));
}
/**
* Returns the merged lines
*
* @param string $label1 label for first version
* @param string $label2 label for second version
* @param string $label3 separator between versions
* @return array lines of the merged text
*/
function mergedOutput($label1='<<<<<<<',$label2='>>>>>>>',$label3='=======') {
$lines = array();
foreach ($this->_edits as $edit) {
if ($edit->isConflict()) {
/* FIXME: this should probably be moved somewhere else. */
$lines = array_merge($lines,
array($label1),
$edit->final1,
array($label3),
$edit->final2,
array($label2));
$this->_conflictingBlocks++;
} else {
$lines = array_merge($lines, $edit->merged());
}
}
return $lines;
}
/**
* @access private
*/
function _diff3($edits1, $edits2) {
$edits = array();
$bb = new _Diff3_BlockBuilder();
$e1 = current($edits1);
$e2 = current($edits2);
while ($e1 || $e2) {
if ($e1 && $e2 && is_a($e1, '_DiffOp_copy') && is_a($e2, '_DiffOp_copy')) {
/* We have copy blocks from both diffs. This is the (only)
* time we want to emit a diff3 copy block. Flush current
* diff3 diff block, if any. */
if ($edit = $bb->finish()) {
$edits[] = $edit;
}
$ncopy = min($e1->norig(), $e2->norig());
assert($ncopy > 0);
$edits[] = new _Diff3_Op_copy(array_slice($e1->orig, 0, $ncopy));
if ($e1->norig() > $ncopy) {
array_splice($e1->orig, 0, $ncopy);
array_splice($e1->closing, 0, $ncopy);
} else {
$e1 = next($edits1);
}
if ($e2->norig() > $ncopy) {
array_splice($e2->orig, 0, $ncopy);
array_splice($e2->closing, 0, $ncopy);
} else {
$e2 = next($edits2);
}
} else {
if ($e1 && $e2) {
if ($e1->orig && $e2->orig) {
$norig = min($e1->norig(), $e2->norig());
$orig = array_splice($e1->orig, 0, $norig);
array_splice($e2->orig, 0, $norig);
$bb->input($orig);
}
if (is_a($e1, '_DiffOp_copy')) {
$bb->out1(array_splice($e1->closing, 0, $norig));
}
if (is_a($e2, '_DiffOp_copy')) {
$bb->out2(array_splice($e2->closing, 0, $norig));
}
}
if ($e1 && ! $e1->orig) {
$bb->out1($e1->closing);
$e1 = next($edits1);
}
if ($e2 && ! $e2->orig) {
$bb->out2($e2->closing);
$e2 = next($edits2);
}
}
}
if ($edit = $bb->finish()) {
$edits[] = $edit;
}
return $edits;
}
}
/**
* @author Geoffrey T. Dairiki <dairiki@dairiki.org>
*
* @access private
*/
class _Diff3_Op {
function __construct($orig = false, $final1 = false, $final2 = false) {
$this->orig = $orig ? $orig : array();
$this->final1 = $final1 ? $final1 : array();
$this->final2 = $final2 ? $final2 : array();
}
function merged() {
if (!isset($this->_merged)) {
if ($this->final1 === $this->final2) {
$this->_merged = &$this->final1;
} elseif ($this->final1 === $this->orig) {
$this->_merged = &$this->final2;
} elseif ($this->final2 === $this->orig) {
$this->_merged = &$this->final1;
} else {
$this->_merged = false;
}
}
return $this->_merged;
}
function isConflict() {
return $this->merged() === false;
}
}
/**
* @author Geoffrey T. Dairiki <dairiki@dairiki.org>
*
* @access private
*/
class _Diff3_Op_copy extends _Diff3_Op {
function __construct($lines = false) {
$this->orig = $lines ? $lines : array();
$this->final1 = &$this->orig;
$this->final2 = &$this->orig;
}
function merged() {
return $this->orig;
}
function isConflict() {
return false;
}
}
/**
* @author Geoffrey T. Dairiki <dairiki@dairiki.org>
*
* @access private
*/
class _Diff3_BlockBuilder {
function __construct() {
$this->_init();
}
function input($lines) {
if ($lines) {
$this->_append($this->orig, $lines);
}
}
function out1($lines) {
if ($lines) {
$this->_append($this->final1, $lines);
}
}
function out2($lines) {
if ($lines) {
$this->_append($this->final2, $lines);
}
}
function isEmpty() {
return !$this->orig && !$this->final1 && !$this->final2;
}
function finish() {
if ($this->isEmpty()) {
return false;
} else {
$edit = new _Diff3_Op($this->orig, $this->final1, $this->final2);
$this->_init();
return $edit;
}
}
function _init() {
$this->orig = $this->final1 = $this->final2 = array();
}
function _append(&$array, $lines) {
array_splice($array, sizeof($array), 0, $lines);
}
}
//Setup VIM: ex: et ts=4 :

View file

@ -6,7 +6,7 @@ namespace dokuwiki\Form;
*
* For Radio- and Checkboxes
*
* @package DokuForm
* @package dokuwiki\Form
*/
class CheckableElement extends InputElement {

View file

@ -0,0 +1,128 @@
<?php
namespace dokuwiki\Form;
/**
* Class DropdownElement
*
* Represents a HTML select. Please note that this does not support multiple selected options!
*
* @package dokuwiki\Form
*/
class DropdownElement extends InputElement {
protected $options = array();
protected $value = '';
/**
* @param string $name The name of this form element
* @param string $options The available options
* @param string $label The label text for this element (will be autoescaped)
*/
public function __construct($name, $options, $label = '') {
parent::__construct('dropdown', $name, $label);
$this->options($options);
}
/**
* Get or set the options of the Dropdown
*
* Options can be given as associative array (value => label) or as an
* indexd array (label = value) or as an array of arrays. In the latter
* case an element has to look as follows:
* option-value => array (
* 'label' => option-label,
* 'attrs' => array (
* attr-key => attr-value, ...
* )
* )
*
* @param null|array $options
* @return $this|array
*/
public function options($options = null) {
if($options === null) return $this->options;
if(!is_array($options)) throw new \InvalidArgumentException('Options have to be an array');
$this->options = array();
foreach($options as $key => $val) {
if(is_int($key)) {
$this->options[$val] = array('label' => (string) $val);
} elseif (!is_array($val)) {
$this->options[$key] = array('label' => (string) $val);
} else {
if (!key_exists('label', $val)) throw new \InvalidArgumentException('If option is given as array, it has to have a "label"-key!');
$this->options[$key] = $val;
}
}
$this->val(''); // set default value (empty or first)
return $this;
}
/**
* Gets or sets an attribute
*
* When no $value is given, the current content of the attribute is returned.
* An empty string is returned for unset attributes.
*
* When a $value is given, the content is set to that value and the Element
* itself is returned for easy chaining
*
* @param string $name Name of the attribute to access
* @param null|string $value New value to set
* @return string|$this
*/
public function attr($name, $value = null) {
if(strtolower($name) == 'multiple') {
throw new \InvalidArgumentException('Sorry, the dropdown element does not support the "multiple" attribute');
}
return parent::attr($name, $value);
}
/**
* Get or set the current value
*
* When setting a value that is not defined in the options, the value is ignored
* and the first option's value is selected instead
*
* @param null|string $value The value to set
* @return $this|string
*/
public function val($value = null) {
if($value === null) return $this->value;
if(isset($this->options[$value])) {
$this->value = $value;
} else {
// unknown value set, select first option instead
$keys = array_keys($this->options);
$this->value = (string) array_shift($keys);
}
return $this;
}
/**
* Create the HTML for the select it self
*
* @return string
*/
protected function mainElementHTML() {
if($this->useInput) $this->prefillInput();
$html = '<select ' . buildAttributes($this->attrs()) . '>';
foreach($this->options as $key => $val) {
$selected = ($key == $this->value) ? ' selected="selected"' : '';
$attrs = '';
if (is_array($val['attrs'])) {
array_walk($val['attrs'],function (&$aval, $akey){$aval = hsc($akey).'="'.hsc($aval).'"';});
$attrs = join(' ', $val['attrs']);
}
$html .= '<option' . $selected . ' value="' . hsc($key) . '" '.$attrs.'>' . hsc($val['label']) . '</option>';
}
$html .= '</select>';
return $html;
}
}

View file

@ -69,7 +69,7 @@ abstract class Element {
/**
* Removes the given attribute if it exists
*
* @param $name
* @param string $name
* @return $this
*/
public function rmattr($name) {

View file

@ -58,8 +58,8 @@ class Form extends Element {
/**
* Sets a hidden field
*
* @param $name
* @param $value
* @param string $name
* @param string $value
* @return $this
*/
public function setHiddenField($name, $value) {
@ -83,7 +83,7 @@ class Form extends Element {
* A position out-of-bounds will return either the
* first (underflow) or last (overflow) element.
*
* @param $pos
* @param int $pos
* @return Element
*/
public function getElementAt($pos) {
@ -153,7 +153,7 @@ class Form extends Element {
* Replaces an existing element with a new one
*
* @param Element $element the new element
* @param $pos 0-based position of the element to replace
* @param int $pos 0-based position of the element to replace
*/
public function replaceElement(Element $element, $pos) {
if(is_a($element, '\dokuwiki\Form\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form');
@ -163,7 +163,7 @@ class Form extends Element {
/**
* Remove an element from the form completely
*
* @param $pos 0-based position of the element to remove
* @param int $pos 0-based position of the element to remove
*/
public function removeElement($pos) {
array_splice($this->elements, $pos, 1);
@ -176,8 +176,8 @@ class Form extends Element {
/**
* Adds a text input field
*
* @param $name
* @param $label
* @param string $name
* @param string $label
* @param int $pos
* @return InputElement
*/
@ -188,8 +188,8 @@ class Form extends Element {
/**
* Adds a password input field
*
* @param $name
* @param $label
* @param string $name
* @param string $label
* @param int $pos
* @return InputElement
*/
@ -200,8 +200,8 @@ class Form extends Element {
/**
* Adds a radio button field
*
* @param $name
* @param $label
* @param string $name
* @param string $label
* @param int $pos
* @return CheckableElement
*/
@ -212,8 +212,8 @@ class Form extends Element {
/**
* Adds a checkbox field
*
* @param $name
* @param $label
* @param string $name
* @param string $label
* @param int $pos
* @return CheckableElement
*/
@ -221,11 +221,24 @@ class Form extends Element {
return $this->addElement(new CheckableElement('checkbox', $name, $label), $pos);
}
/**
* Adds a dropdown field
*
* @param string $name
* @param array $options
* @param string $label
* @param int $pos
* @return DropdownElement
*/
public function addDropdown($name, $options, $label = '', $pos = -1) {
return $this->addElement(new DropdownElement($name, $options, $label), $pos);
}
/**
* Adds a textarea field
*
* @param $name
* @param $label
* @param string $name
* @param string $label
* @param int $pos
* @return TextareaElement
*/
@ -260,7 +273,7 @@ class Form extends Element {
/**
* Adds a label referencing another input element, escapes the label for you
*
* @param $label
* @param string $label
* @param string $for
* @param int $pos
* @return Element
@ -295,7 +308,7 @@ class Form extends Element {
/**
* Add fixed HTML to the form
*
* @param $html
* @param string $html
* @param int $pos
* @return HTMLElement
*/
@ -306,7 +319,7 @@ class Form extends Element {
/**
* Add a closed HTML tag to the form
*
* @param $tag
* @param string $tag
* @param int $pos
* @return TagElement
*/
@ -319,7 +332,7 @@ class Form extends Element {
*
* Be sure to close it again!
*
* @param $tag
* @param string $tag
* @param int $pos
* @return TagOpenElement
*/
@ -332,7 +345,7 @@ class Form extends Element {
*
* Be sure it had been opened before
*
* @param $tag
* @param string $tag
* @param int $pos
* @return TagCloseElement
*/
@ -343,7 +356,7 @@ class Form extends Element {
/**
* Open a Fieldset
*
* @param $legend
* @param string $legend
* @param int $pos
* @return FieldsetOpenElement
*/
@ -409,17 +422,17 @@ class Form extends Element {
public function toHTML() {
$this->balanceFieldsets();
$html = '<form ' . buildAttributes($this->attrs()) . '>' . DOKU_LF;
$html = '<form ' . buildAttributes($this->attrs()) . '>';
foreach($this->hidden as $name => $value) {
$html .= '<input type="hidden" name="' . $name . '" value="' . formText($value) . '" />' . DOKU_LF;
$html .= '<input type="hidden" name="' . $name . '" value="' . formText($value) . '" />';
}
foreach($this->elements as $element) {
$html .= $element->toHTML() . DOKU_LF;
$html .= $element->toHTML();
}
$html .= '</form>' . DOKU_LF;
$html .= '</form>';
return $html;
}

View file

@ -128,10 +128,8 @@ class InputElement extends Element {
$value = '';
}
}
if($value !== '') {
$this->val($value);
}
}
/**
* The HTML representation of this element

View file

@ -22,7 +22,7 @@ class TagCloseElement extends ValueElement {
/**
* do not call this
*
* @param $class
* @param string $class
* @return void
* @throws \BadMethodCallException
*/
@ -33,36 +33,48 @@ class TagCloseElement extends ValueElement {
/**
* do not call this
*
* @param $id
* @return void
* @param null|string $id
* @return string
* @throws \BadMethodCallException
*/
public function id($id = null) {
if ($id === null) {
return '';
} else {
throw new \BadMethodCallException('You can\t add ID to closing tag');
}
}
/**
* do not call this
*
* @param $name
* @param $value
* @return void
* @param string $name
* @param null|string $value
* @return string
* @throws \BadMethodCallException
*/
public function attr($name, $value = null) {
if ($value === null) {
return '';
} else {
throw new \BadMethodCallException('You can\t add attributes to closing tag');
}
}
/**
* do not call this
*
* @param $attributes
* @return void
* @param array|null $attributes
* @return array
* @throws \BadMethodCallException
*/
public function attrs($attributes = null) {
if ($attributes === null) {
return array();
} else {
throw new \BadMethodCallException('You can\t add attributes to closing tag');
}
}
/**
* The HTML representation of this element

View file

@ -31,7 +31,7 @@ class TextareaElement extends InputElement {
*/
public function val($value = null) {
if($value !== null) {
$this->text = $value;
$this->text = cleanText($value);
return $this;
}
return $this->text;

View file

@ -20,7 +20,7 @@ abstract class ValueElement extends Element {
/**
* @param string $type
* @param array|string $value
* @param string $value
* @param array $attributes
*/
public function __construct($type, $value, $attributes = array()) {

View file

@ -272,13 +272,15 @@ class HTTPClient {
$server = $this->proxy_host;
$port = $this->proxy_port;
if (empty($port)) $port = 8080;
$use_tls = $this->proxy_ssl;
}else{
$request_url = $path;
if (!isset($port)) $port = ($uri['scheme'] == 'https') ? 443 : 80;
$use_tls = ($uri['scheme'] == 'https');
}
// add SSL stream prefix if needed - needs SSL support in PHP
if($port == 443 || $this->proxy_ssl) {
if($use_tls) {
if(!in_array('ssl', stream_get_transports())) {
$this->status = -200;
$this->error = 'This PHP version does not support SSL - cannot connect to server';
@ -597,13 +599,15 @@ class HTTPClient {
// setups with this solution before, but we have no usable test for that and TLS should be the more
// common crypto by now
if (@stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
$requesturl = $requestinfo['path'];
$requesturl = $requestinfo['path'].
(!empty($requestinfo['query'])?'?'.$requestinfo['query']:'');
return true;
}
// if the above failed, this will most probably not work either, but we can try
if (@stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_SSLv3_CLIENT)) {
$requesturl = $requestinfo['path'];
$requesturl = $requestinfo['path'].
(!empty($requestinfo['query'])?'?'.$requestinfo['query']:'');
return true;
}

View file

@ -1314,8 +1314,8 @@ class JpegMeta {
$this->_info['file']['Width'] = $size[0];
$this->_info['file']['Height'] = $size[1];
// set mime types and formats
// http://www.php.net/manual/en/function.getimagesize.php
// http://www.php.net/manual/en/function.image-type-to-mime-type.php
// http://php.net/manual/en/function.getimagesize.php
// http://php.net/manual/en/function.image-type-to-mime-type.php
switch ($size[2]){
case 1:
$this->_info['file']['Mime'] = 'image/gif';

View file

@ -32,10 +32,12 @@ class Mailer {
protected $validator = null;
protected $allowhtml = true;
protected $replacements = array('text'=> array(), 'html' => array());
/**
* Constructor
*
* Initializes the boundary strings and part counters
* Initializes the boundary strings, part counters and token replacements
*/
public function __construct() {
global $conf;
@ -61,6 +63,8 @@ class Mailer {
$this->setHeader('X-Auto-Response-Suppress', 'OOF');
$this->setHeader('List-Id', $conf['title'].' <'.$listid.'>');
$this->setHeader('Date', date('r'), false);
$this->prepareTokenReplacements();
}
/**
@ -174,7 +178,7 @@ class Mailer {
* Set the text and HTML body and apply replacements
*
* This function applies a whole bunch of default replacements in addition
* to the ones specidifed as parameters
* to the ones specified as parameters
*
* If you pass the HTML part or HTML replacements yourself you have to make
* sure you encode all HTML special chars correctly
@ -186,10 +190,6 @@ class Mailer {
* @param bool $wrap wrap the HTML in the default header/Footer
*/
public function setBody($text, $textrep = null, $htmlrep = null, $html = null, $wrap = true) {
global $INFO;
global $conf;
/* @var Input $INPUT */
global $INPUT;
$htmlrep = (array)$htmlrep;
$textrep = (array)$textrep;
@ -198,15 +198,20 @@ class Mailer {
if(is_null($html)) {
$html = $text;
$html = hsc($html);
$html = preg_replace('/^-----*$/m', '<hr >', $html);
$html = preg_replace('/^----+$/m', '<hr >', $html);
$html = nl2br($html);
}
if($wrap) {
$wrap = rawLocale('mailwrap', 'html');
$html = preg_replace('/\n-- <br \/>.*$/s', '', $html); //strip signature
$html = str_replace('@EMAILSIGNATURE@', '', $html); //strip @EMAILSIGNATURE@
$html = str_replace('@HTMLBODY@', $html, $wrap);
}
if(strpos($text, '@EMAILSIGNATURE@') === false) {
$text .= '@EMAILSIGNATURE@';
}
// copy over all replacements missing for HTML (autolink URLs)
foreach($textrep as $key => $value) {
if(isset($htmlrep[$key])) continue;
@ -223,34 +228,9 @@ class Mailer {
array($this, 'autoembed_cb'), $html
);
// prepare default replacements
$ip = clientIP();
$cip = gethostsbyaddrs($ip);
$trep = array(
'DATE' => dformat(),
'BROWSER' => $INPUT->server->str('HTTP_USER_AGENT'),
'IPADDRESS' => $ip,
'HOSTNAME' => $cip,
'TITLE' => $conf['title'],
'DOKUWIKIURL' => DOKU_URL,
'USER' => $INPUT->server->str('REMOTE_USER'),
'NAME' => $INFO['userinfo']['name'],
'MAIL' => $INFO['userinfo']['mail'],
);
$trep = array_merge($trep, (array)$textrep);
$hrep = array(
'DATE' => '<i>'.hsc(dformat()).'</i>',
'BROWSER' => hsc($INPUT->server->str('HTTP_USER_AGENT')),
'IPADDRESS' => '<code>'.hsc($ip).'</code>',
'HOSTNAME' => '<code>'.hsc($cip).'</code>',
'TITLE' => hsc($conf['title']),
'DOKUWIKIURL' => '<a href="'.DOKU_URL.'">'.DOKU_URL.'</a>',
'USER' => hsc($INPUT->server->str('REMOTE_USER')),
'NAME' => hsc($INFO['userinfo']['name']),
'MAIL' => '<a href="mailto:"'.hsc($INFO['userinfo']['mail']).'">'.
hsc($INFO['userinfo']['mail']).'</a>',
);
$hrep = array_merge($hrep, (array)$htmlrep);
// add default token replacements
$trep = array_merge($this->replacements['text'], (array)$textrep);
$hrep = array_merge($this->replacements['html'], (array)$htmlrep);
// Apply replacements
foreach($trep as $key => $substitution) {
@ -615,6 +595,66 @@ class Mailer {
return $headers.MAILHEADER_EOL.$body;
}
/**
* Prepare default token replacement strings
*
* Populates the '$replacements' property.
* Should be called by the class constructor
*/
protected function prepareTokenReplacements() {
global $INFO;
global $conf;
/* @var Input $INPUT */
global $INPUT;
global $lang;
$ip = clientIP();
$cip = gethostsbyaddrs($ip);
$this->replacements['text'] = array(
'DATE' => dformat(),
'BROWSER' => $INPUT->server->str('HTTP_USER_AGENT'),
'IPADDRESS' => $ip,
'HOSTNAME' => $cip,
'TITLE' => $conf['title'],
'DOKUWIKIURL' => DOKU_URL,
'USER' => $INPUT->server->str('REMOTE_USER'),
'NAME' => $INFO['userinfo']['name'],
'MAIL' => $INFO['userinfo']['mail']
);
$signature = str_replace('@DOKUWIKIURL@', $this->replacements['text']['DOKUWIKIURL'], $lang['email_signature_text']);
$this->replacements['text']['EMAILSIGNATURE'] = "\n-- \n" . $signature . "\n";
$this->replacements['html'] = array(
'DATE' => '<i>' . hsc(dformat()) . '</i>',
'BROWSER' => hsc($INPUT->server->str('HTTP_USER_AGENT')),
'IPADDRESS' => '<code>' . hsc($ip) . '</code>',
'HOSTNAME' => '<code>' . hsc($cip) . '</code>',
'TITLE' => hsc($conf['title']),
'DOKUWIKIURL' => '<a href="' . DOKU_URL . '">' . DOKU_URL . '</a>',
'USER' => hsc($INPUT->server->str('REMOTE_USER')),
'NAME' => hsc($INFO['userinfo']['name']),
'MAIL' => '<a href="mailto:"' . hsc($INFO['userinfo']['mail']) . '">' .
hsc($INFO['userinfo']['mail']) . '</a>'
);
$signature = $lang['email_signature_text'];
if(!empty($lang['email_signature_html'])) {
$signature = $lang['email_signature_html'];
}
$signature = str_replace(
array(
'@DOKUWIKIURL@',
"\n"
),
array(
$this->replacements['html']['DOKUWIKIURL'],
'<br />'
),
$signature
);
$this->replacements['html']['EMAILSIGNATURE'] = $signature;
}
/**
* Send the mail
*

View file

@ -44,6 +44,13 @@ class PassHash {
$method = 'pmd5';
$salt = $m[1];
$magic = 'H';
} elseif(preg_match('/^pbkdf2_(\w+?)\$(\d+)\$(.{12})\$/', $hash, $m)) {
$method = 'djangopbkdf2';
$magic = array(
'algo' => $m[1],
'iter' => $m[2],
);
$salt = $m[3];
} elseif(preg_match('/^sha1\$(.{5})\$/', $hash, $m)) {
$method = 'djangosha1';
$salt = $m[1];
@ -83,7 +90,8 @@ class PassHash {
//crypt and compare
$call = 'hash_'.$method;
if($this->$call($clear, $salt, $magic) === $hash) {
$newhash = $this->$call($clear, $salt, $magic);
if($newhash === $hash) {
return true;
}
return false;
@ -135,7 +143,7 @@ class PassHash {
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author <mikey_nich at hotmail dot com>
* @link http://de.php.net/manual/en/function.crypt.php#73619
* @link http://php.net/manual/en/function.crypt.php#73619
*
* @param string $clear The clear text to hash
* @param string $salt The salt to use, null for random
@ -176,7 +184,7 @@ class PassHash {
* This is basically the same as smd1 above, but as used by Apache.
*
* @author <mikey_nich at hotmail dot com>
* @link http://de.php.net/manual/en/function.crypt.php#73619
* @link http://php.net/manual/en/function.crypt.php#73619
*
* @param string $clear The clear text to hash
* @param string $salt The salt to use, null for random
@ -276,7 +284,7 @@ class PassHash {
*
* This method was used by old MySQL systems
*
* @link http://www.php.net/mysql
* @link http://php.net/mysql
* @author <soren at byu dot edu>
* @param string $clear The clear text to hash
* @return string Hashed password
@ -435,6 +443,69 @@ class PassHash {
return 'md5$'.$salt.'$'.md5($salt.$clear);
}
/**
* Password hashing method 'djangopbkdf2'
*
* An algorithm and iteration count should be given in the opts array.
* Defaults to sha256 and 24000 iterations
*
* @param string $clear The clear text to hash
* @param string $salt The salt to use, null for random
* @param array $opts ('algo' => hash algorithm, 'iter' => iterations)
* @return string Hashed password
* @throws Exception when PHP is missing support for the method/algo
*/
public function hash_djangopbkdf2($clear, $salt=null, $opts=array()) {
$this->init_salt($salt, 12);
if(empty($opts['algo'])) {
$algo = 'sha256';
} else {
$algo = $opts['algo'];
}
if(empty($opts['iter'])) {
$iter = 24000;
} else {
$iter = (int) $opts['iter'];
}
if(!function_exists('hash_pbkdf2')) {
throw new Exception('This PHP installation has no PBKDF2 support');
}
if(!in_array($algo, hash_algos())) {
throw new Exception("This PHP installation has no $algo support");
}
$hash = base64_encode(hash_pbkdf2($algo, $clear, $salt, $iter, 0, true));
return "pbkdf2_$algo\$$iter\$$salt\$$hash";
}
/**
* Alias for djangopbkdf2 defaulting to sha256 as hash algorithm
*
* @param string $clear The clear text to hash
* @param string $salt The salt to use, null for random
* @param array $opts ('iter' => iterations)
* @return string Hashed password
* @throws Exception when PHP is missing support for the method/algo
*/
public function hash_djangopbkdf2_sha256($clear, $salt=null, $opts=array()) {
$opts['algo'] = 'sha256';
return $this->hash_djangopbkdf2($clear, $salt, $opts);
}
/**
* Alias for djangopbkdf2 defaulting to sha1 as hash algorithm
*
* @param string $clear The clear text to hash
* @param string $salt The salt to use, null for random
* @param array $opts ('iter' => iterations)
* @return string Hashed password
* @throws Exception when PHP is missing support for the method/algo
*/
public function hash_djangopbkdf2_sha1($clear, $salt=null, $opts=array()) {
$opts['algo'] = 'sha1';
return $this->hash_djangopbkdf2($clear, $salt, $opts);
}
/**
* Passwordhashing method 'bcrypt'
*
@ -511,7 +582,7 @@ class PassHash {
*
* @see hash_hmac()
* @author KC Cloyd
* @link http://www.php.net/manual/en/function.hash-hmac.php#93440
* @link http://php.net/manual/en/function.hash-hmac.php#93440
*
* @param string $algo Name of selected hashing algorithm (i.e. "md5", "sha256", "haval160,4",
* etc..) See hash_algos() for a list of supported algorithms.

View file

@ -3,12 +3,19 @@
/**
* Increased whenever the API is changed
*/
define('DOKU_API_VERSION', 9);
define('DOKU_API_VERSION', 10);
/**
* Provides the core methods for the remote API.
* The methods are ordered in 'wiki.<method>' and 'dokuwiki.<method>' namespaces
*/
class RemoteAPICore {
private $api;
/**
* @param RemoteAPI $api
*/
public function __construct(RemoteAPI $api) {
$this->api = $api;
}
@ -18,7 +25,7 @@ class RemoteAPICore {
*
* @return array
*/
function __getRemoteInfo() {
public function __getRemoteInfo() {
return array(
'dokuwiki.getVersion' => array(
'args' => array(),
@ -97,7 +104,7 @@ class RemoteAPICore {
), 'wiki.getPageInfo' => array(
'args' => array('string'),
'return' => 'array',
'doc' => 'Returns a struct with info about the page.',
'doc' => 'Returns a struct with info about the page, latest version.',
'name' => 'pageInfo'
), 'wiki.getPageInfoVersion' => array(
'args' => array('string', 'int'),
@ -126,9 +133,9 @@ class RemoteAPICore {
'return' => 'array',
'Returns a struct about all recent media changes since given timestamp.'
), 'wiki.aclCheck' => array(
'args' => array('string'),
'args' => array('string', 'string', 'array'),
'return' => 'int',
'doc' => 'Returns the permissions of a given wiki page.'
'doc' => 'Returns the permissions of a given wiki page. By default, for current user/groups'
), 'wiki.putAttachment' => array(
'args' => array('string', 'file', 'array'),
'return' => 'array',
@ -166,14 +173,14 @@ class RemoteAPICore {
/**
* @return string
*/
function getVersion() {
public function getVersion() {
return getVersion();
}
/**
* @return int unix timestamp
*/
function getTime() {
public function getTime() {
return time();
}
@ -185,7 +192,7 @@ class RemoteAPICore {
* @return string page text.
* @throws RemoteAccessDeniedException if no permission for page
*/
function rawPage($id,$rev=''){
public function rawPage($id,$rev=''){
$id = $this->resolvePageId($id);
if(auth_quickaclcheck($id) < AUTH_READ){
throw new RemoteAccessDeniedException('You are not allowed to read this file', 111);
@ -208,7 +215,7 @@ class RemoteAPICore {
* @throws RemoteAccessDeniedException no permission for media
* @throws RemoteException not exist
*/
function getAttachment($id){
public function getAttachment($id){
$id = cleanID($id);
if (auth_quickaclcheck(getNS($id).':*') < AUTH_READ) {
throw new RemoteAccessDeniedException('You are not allowed to read this file', 211);
@ -231,7 +238,7 @@ class RemoteAPICore {
* @param string $id page id
* @return array
*/
function getAttachmentInfo($id){
public function getAttachmentInfo($id){
$id = cleanID($id);
$info = array(
'lastModified' => $this->api->toDate(0),
@ -239,9 +246,18 @@ class RemoteAPICore {
);
$file = mediaFN($id);
if ((auth_quickaclcheck(getNS($id).':*') >= AUTH_READ) && file_exists($file)){
if(auth_quickaclcheck(getNS($id) . ':*') >= AUTH_READ) {
if(file_exists($file)) {
$info['lastModified'] = $this->api->toDate(filemtime($file));
$info['size'] = filesize($file);
} else {
//Is it deleted media with changelog?
$medialog = new MediaChangeLog($id);
$revisions = $medialog->getRevisions(0, 1);
if(!empty($revisions)) {
$info['lastModified'] = $this->api->toDate($revisions[0]);
}
}
}
return $info;
@ -255,7 +271,7 @@ class RemoteAPICore {
* @return null|string html
* @throws RemoteAccessDeniedException no access to page
*/
function htmlPage($id,$rev=''){
public function htmlPage($id,$rev=''){
$id = $this->resolvePageId($id);
if(auth_quickaclcheck($id) < AUTH_READ){
throw new RemoteAccessDeniedException('You are not allowed to read this page', 111);
@ -268,7 +284,7 @@ class RemoteAPICore {
*
* @return array
*/
function listPages(){
public function listPages(){
$list = array();
$pages = idx_get_indexer()->getPages();
$pages = array_filter(array_filter($pages,'isVisiblePage'),'page_exists');
@ -298,7 +314,7 @@ class RemoteAPICore {
* $opts['hash'] do md5 sum of content?
* @return array
*/
function readNamespace($ns,$opts){
public function readNamespace($ns,$opts){
global $conf;
if(!is_array($opts)) $opts=array();
@ -317,7 +333,7 @@ class RemoteAPICore {
* @param string $query
* @return array
*/
function search($query){
public function search($query){
$regex = array();
$data = ft_pageSearch($query,$regex);
$pages = array();
@ -352,7 +368,7 @@ class RemoteAPICore {
*
* @return string
*/
function getTitle(){
public function getTitle(){
global $conf;
return $conf['title'];
}
@ -375,7 +391,7 @@ class RemoteAPICore {
* @return array
* @throws RemoteAccessDeniedException no access to the media files
*/
function listAttachments($ns, $options = array()) {
public function listAttachments($ns, $options = array()) {
global $conf;
$ns = cleanID($ns);
@ -422,7 +438,7 @@ class RemoteAPICore {
* @throws RemoteAccessDeniedException no access for page
* @throws RemoteException page not exist
*/
function pageInfo($id,$rev=''){
public function pageInfo($id,$rev=''){
$id = $this->resolvePageId($id);
if(auth_quickaclcheck($id) < AUTH_READ){
throw new RemoteAccessDeniedException('You are not allowed to read this page', 111);
@ -458,7 +474,7 @@ class RemoteAPICore {
* @throws RemoteAccessDeniedException no write access for page
* @throws RemoteException no id, empty new page or locked
*/
function putPage($id, $text, $params) {
public function putPage($id, $text, $params) {
global $TEXT;
global $lang;
@ -519,7 +535,7 @@ class RemoteAPICore {
* @param array $params such as summary,minor
* @return bool|string
*/
function appendPage($id, $text, $params) {
public function appendPage($id, $text, $params) {
$currentpage = $this->rawPage($id);
if (!is_string($currentpage)) {
return $currentpage;
@ -538,7 +554,7 @@ class RemoteAPICore {
* @return false|string
* @throws RemoteException
*/
function putAttachment($id, $file, $params) {
public function putAttachment($id, $file, $params) {
$id = cleanID($id);
$auth = auth_quickaclcheck(getNS($id).':*');
@ -572,7 +588,7 @@ class RemoteAPICore {
* @throws RemoteAccessDeniedException no permissions
* @throws RemoteException file in use or not deleted
*/
function deleteAttachment($id){
public function deleteAttachment($id){
$id = cleanID($id);
$auth = auth_quickaclcheck(getNS($id).':*');
$res = media_delete($id, $auth);
@ -588,14 +604,31 @@ class RemoteAPICore {
}
/**
* Returns the permissions of a given wiki page
* Returns the permissions of a given wiki page for the current user or another user
*
* @param string $id page id
* @param string|null $user username
* @param array|null $groups array of groups
* @return int permission level
*/
function aclCheck($id) {
public function aclCheck($id, $user = null, $groups = null) {
/** @var DokuWiki_Auth_Plugin $auth */
global $auth;
$id = $this->resolvePageId($id);
if($user === null) {
return auth_quickaclcheck($id);
} else {
if($groups === null) {
$userinfo = $auth->getUserData($user);
if($userinfo === false) {
$groups = array();
} else {
$groups = $userinfo['grps'];
}
}
return auth_aclcheck($id, $user, $groups);
}
}
/**
@ -607,7 +640,7 @@ class RemoteAPICore {
* @return array
* @throws RemoteAccessDeniedException no read access for page
*/
function listLinks($id) {
public function listLinks($id) {
$id = $this->resolvePageId($id);
if(auth_quickaclcheck($id) < AUTH_READ){
throw new RemoteAccessDeniedException('You are not allowed to read this page', 111);
@ -618,7 +651,6 @@ class RemoteAPICore {
$ins = p_cached_instructions(wikiFN($id));
// instantiate new Renderer - needed for interwiki links
include(DOKU_INC.'inc/parser/xhtml.php');
$Renderer = new Doku_Renderer_xhtml();
$Renderer->interwiki = getInterwiki();
@ -661,7 +693,7 @@ class RemoteAPICore {
* @return array
* @throws RemoteException no valid timestamp
*/
function getRecentChanges($timestamp) {
public function getRecentChanges($timestamp) {
if(strlen($timestamp) != 10) {
throw new RemoteException('The provided value is not a valid timestamp', 311);
}
@ -699,7 +731,7 @@ class RemoteAPICore {
* @return array
* @throws RemoteException no valid timestamp
*/
function getRecentMediaChanges($timestamp) {
public function getRecentMediaChanges($timestamp) {
if(strlen($timestamp) != 10)
throw new RemoteException('The provided value is not a valid timestamp', 311);
@ -728,16 +760,18 @@ class RemoteAPICore {
/**
* Returns a list of available revisions of a given wiki page
* Number of returned pages is set by $conf['recent']
* However not accessible pages are skipped, so less than $conf['recent'] could be returned
*
* @author Michael Klier <chi@chimeric.de>
*
* @param string $id page id
* @param int $first skip the first n changelog lines
* @param int $first skip the first n changelog lines (0 = from current(if exists), 1 = from 1st old rev, 2 = from 2nd old rev, etc)
* @return array
* @throws RemoteAccessDeniedException no read access for page
* @throws RemoteException empty id
*/
function pageVersions($id, $first) {
public function pageVersions($id, $first) {
$id = $this->resolvePageId($id);
if(auth_quickaclcheck($id) < AUTH_READ) {
throw new RemoteAccessDeniedException('You are not allowed to read this page', 111);
@ -750,25 +784,19 @@ class RemoteAPICore {
throw new RemoteException('Empty page ID', 131);
}
$first = (int) $first;
$first_rev = $first - 1;
$first_rev = $first_rev < 0 ? 0 : $first_rev;
$pagelog = new PageChangeLog($id);
$revisions = $pagelog->getRevisions($first, $conf['recent']+1);
$revisions = $pagelog->getRevisions($first_rev, $conf['recent']);
if(count($revisions)==0 && $first!=0) {
$first=0;
$revisions = $pagelog->getRevisions($first, $conf['recent']+1);
}
if(count($revisions)>0 && $first==0) {
if($first == 0) {
array_unshift($revisions, ''); // include current revision
if ( count($revisions) > $conf['recent'] ){
array_pop($revisions); // remove extra log entry
}
}
if(count($revisions) > $conf['recent']) {
array_pop($revisions); // remove extra log entry
}
if(!empty($revisions)) {
foreach($revisions as $rev) {
$file = wikiFN($id,$rev);
@ -800,7 +828,7 @@ class RemoteAPICore {
/**
* The version of Wiki RPC API supported
*/
function wiki_RPCVersion(){
public function wiki_RPCVersion(){
return 2;
}
@ -817,7 +845,7 @@ class RemoteAPICore {
* @param array[] $set list pages with array('lock' => array, 'unlock' => array)
* @return array
*/
function setLocks($set){
public function setLocks($set){
$locked = array();
$lockfail = array();
$unlocked = array();
@ -855,7 +883,7 @@ class RemoteAPICore {
*
* @return int
*/
function getAPIVersion(){
public function getAPIVersion(){
return DOKU_API_VERSION;
}
@ -866,7 +894,7 @@ class RemoteAPICore {
* @param string $pass
* @return int
*/
function login($user,$pass){
public function login($user,$pass){
global $conf;
/** @var DokuWiki_Auth_Plugin $auth */
global $auth;
@ -896,7 +924,7 @@ class RemoteAPICore {
*
* @return int
*/
function logoff(){
public function logoff(){
global $conf;
global $auth;
if(!$conf['useacl']) return 0;

View file

@ -29,6 +29,8 @@ function act_dispatch(){
// give plugins an opportunity to process the action
$evt = new Doku_Event('ACTION_ACT_PREPROCESS',$ACT);
$headers = array();
if ($evt->advise_before()) {
//sanitize $ACT
@ -144,8 +146,10 @@ function act_dispatch(){
$ACT = act_draftdel($ACT);
//draft saving on preview
if($ACT == 'preview')
if($ACT == 'preview') {
$headers[] = "X-XSS-Protection: 0";
$ACT = act_draftsave($ACT);
}
//edit
if(in_array($ACT, array('edit', 'preview', 'recover'))) {
@ -189,7 +193,6 @@ function act_dispatch(){
global $license;
//call template FIXME: all needed vars available?
$headers = array();
$headers[] = 'Content-Type: text/html; charset=utf-8';
trigger_event('ACTION_HEADERS_SEND',$headers,'act_sendheaders');

View file

@ -51,11 +51,6 @@ function auth_setup() {
if ($conf['authtype'] === $plugin) {
$auth = $plugin_controller->load('auth', $plugin);
break;
} elseif ('auth' . $conf['authtype'] === $plugin) {
// matches old auth backends (pre-Weatherwax)
$auth = $plugin_controller->load('auth', $plugin);
msg('Your authtype setting is deprecated. You must set $conf[\'authtype\'] = "auth' . $conf['authtype'] . '"'
. ' in your configuration (see <a href="https://www.dokuwiki.org/auth">Authentication Backends</a>)',-1,'','',MSG_ADMINS_ONLY);
}
}
@ -101,10 +96,7 @@ function auth_setup() {
$INPUT->set('p', stripctl($INPUT->str('p')));
}
if($INPUT->str('authtok')) {
// when an authentication token is given, trust the session
auth_validateToken($INPUT->str('authtok'));
} elseif(!is_null($auth) && $auth->canDo('external')) {
if(!is_null($auth) && $auth->canDo('external')) {
// external trust mechanism in place
$auth->trustExternal($INPUT->str('u'), $INPUT->str('p'), $INPUT->bool('r'));
} else {
@ -274,52 +266,6 @@ function auth_login($user, $pass, $sticky = false, $silent = false) {
return false;
}
/**
* Checks if a given authentication token was stored in the session
*
* Will setup authentication data using data from the session if the
* token is correct. Will exit with a 401 Status if not.
*
* @author Andreas Gohr <andi@splitbrain.org>
*
* @param string $token The authentication token
* @return boolean|null true (or will exit on failure)
*/
function auth_validateToken($token) {
if(!$token || $token != $_SESSION[DOKU_COOKIE]['auth']['token']) {
// bad token
http_status(401);
print 'Invalid auth token - maybe the session timed out';
unset($_SESSION[DOKU_COOKIE]['auth']['token']); // no second chance
exit;
}
// still here? trust the session data
global $USERINFO;
/* @var Input $INPUT */
global $INPUT;
$INPUT->server->set('REMOTE_USER',$_SESSION[DOKU_COOKIE]['auth']['user']);
$USERINFO = $_SESSION[DOKU_COOKIE]['auth']['info'];
return true;
}
/**
* Create an auth token and store it in the session
*
* NOTE: this is completely unrelated to the getSecurityToken() function
*
* @author Andreas Gohr <andi@splitbrain.org>
*
* @return string The auth token
*/
function auth_createToken() {
$token = md5(auth_randombytes(16));
@session_start(); // reopen the session if needed
$_SESSION[DOKU_COOKIE]['auth']['token'] = $token;
session_write_close();
return $token;
}
/**
* Builds a pseudo UID from browser and IP data
*
@ -380,7 +326,7 @@ function auth_cookiesalt($addsession = false, $secure = false) {
*
* @author Mark Seecof
* @author Michael Hamann <michael@content-space.de>
* @link http://www.php.net/manual/de/function.mt-rand.php#83655
* @link http://php.net/manual/de/function.mt-rand.php#83655
*
* @param int $length number of bytes to get
* @return string binary random strings
@ -1098,12 +1044,19 @@ function updateprofile() {
return false;
}
// update cookie and session with the changed data
if($changes['pass']) {
// update cookie and session with the changed data
list( /*user*/, $sticky, /*pass*/) = auth_getCookie();
$pass = auth_encrypt($changes['pass'], auth_cookiesalt(!$sticky, true));
auth_setCookie($INPUT->server->str('REMOTE_USER'), $pass, (bool) $sticky);
} else {
// make sure the session is writable
@session_start();
// invalidate session cache
$_SESSION[DOKU_COOKIE]['auth']['time'] = 0;
session_write_close();
}
return true;
}

View file

@ -23,6 +23,7 @@ define('DOKU_CHANGE_TYPE_REVERT', 'R');
* @return array|bool parsed line or false
*/
function parseChangelogLine($line) {
$line = rtrim($line, "\n");
$tmp = explode("\t", $line);
if ($tmp!==false && count($tmp)>1) {
$info = array();
@ -32,9 +33,16 @@ function parseChangelogLine($line) {
$info['id'] = $tmp[3]; // page id
$info['user'] = $tmp[4]; // user name
$info['sum'] = $tmp[5]; // edit summary (or action reason)
$info['extra'] = rtrim($tmp[6], "\n"); // extra data (varies by line type)
$info['extra'] = $tmp[6]; // extra data (varies by line type)
if(isset($tmp[7]) && $tmp[7] !== '') { //last item has line-end||
$info['sizechange'] = (int) $tmp[7];
} else {
$info['sizechange'] = null;
}
return $info;
} else { return false; }
} else {
return false;
}
}
/**
@ -48,12 +56,13 @@ function parseChangelogLine($line) {
* @param array $flags Additional flags in a key value array.
* Available flags:
* - ExternalEdit - mark as an external edit.
* @param null|int $sizechange Change of filesize
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Esther Brunner <wikidesign@gmail.com>
* @author Ben Coburn <btcoburn@silicodon.net>
*/
function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extra='', $flags=null){
function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extra='', $flags=null, $sizechange = null){
global $conf, $INFO;
/** @var Input $INPUT */
global $INPUT;
@ -71,6 +80,11 @@ function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extr
if(!$date) $date = time(); //use current time if none supplied
$remote = (!$flagExternalEdit)?clientIP(true):'127.0.0.1';
$user = (!$flagExternalEdit)?$INPUT->server->str('REMOTE_USER'):'';
if($sizechange === null) {
$sizechange = '';
} else {
$sizechange = (int) $sizechange;
}
$strip = array("\t", "\n");
$logline = array(
@ -79,8 +93,9 @@ function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extr
'type' => str_replace($strip, '', $type),
'id' => $id,
'user' => $user,
'sum' => utf8_substr(str_replace($strip, '', $summary),0,255),
'extra' => str_replace($strip, '', $extra)
'sum' => utf8_substr(str_replace($strip, '', $summary), 0, 255),
'extra' => str_replace($strip, '', $extra),
'sizechange' => $sizechange
);
$wasCreated = ($type===DOKU_CHANGE_TYPE_CREATE);
@ -130,8 +145,9 @@ function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extr
* @param array $flags Additional flags in a key value array.
* Available flags:
* - (none, so far)
* @param null|int $sizechange Change of filesize
*/
function addMediaLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extra='', $flags=null){
function addMediaLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extra='', $flags=null, $sizechange = null){
global $conf;
/** @var Input $INPUT */
global $INPUT;
@ -141,6 +157,11 @@ function addMediaLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='',
if(!$date) $date = time(); //use current time if none supplied
$remote = clientIP(true);
$user = $INPUT->server->str('REMOTE_USER');
if($sizechange === null) {
$sizechange = '';
} else {
$sizechange = (int) $sizechange;
}
$strip = array("\t", "\n");
$logline = array(
@ -149,8 +170,9 @@ function addMediaLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='',
'type' => str_replace($strip, '', $type),
'id' => $id,
'user' => $user,
'sum' => utf8_substr(str_replace($strip, '', $summary),0,255),
'extra' => str_replace($strip, '', $extra)
'sum' => utf8_substr(str_replace($strip, '', $summary), 0, 255),
'extra' => str_replace($strip, '', $extra),
'sizechange' => $sizechange
);
// add changelog lines
@ -1035,69 +1057,3 @@ class MediaChangelog extends ChangeLog {
return mediaFN($this->id);
}
}
/**
* Get the changelog information for a specific page id
* and revision (timestamp). Adjacent changelog lines
* are optimistically parsed and cached to speed up
* consecutive calls to getRevisionInfo. For large
* changelog files, only the chunk containing the
* requested changelog line is read.
*
* @deprecated 2013-11-20
*
* @author Ben Coburn <btcoburn@silicodon.net>
* @author Kate Arzamastseva <pshns@ukr.net>
*
* @param string $id
* @param int $rev
* @param int $chunk_size
* @param bool $media
* @return array|bool
*/
function getRevisionInfo($id, $rev, $chunk_size = 8192, $media = false) {
dbg_deprecated('class PageChangeLog or class MediaChangelog');
if($media) {
$changelog = new MediaChangeLog($id, $chunk_size);
} else {
$changelog = new PageChangeLog($id, $chunk_size);
}
return $changelog->getRevisionInfo($rev);
}
/**
* Return a list of page revisions numbers
* Does not guarantee that the revision exists in the attic,
* only that a line with the date exists in the changelog.
* By default the current revision is skipped.
*
* The current revision is automatically skipped when the page exists.
* See $INFO['meta']['last_change'] for the current revision.
*
* For efficiency, the log lines are parsed and cached for later
* calls to getRevisionInfo. Large changelog files are read
* backwards in chunks until the requested number of changelog
* lines are recieved.
*
* @deprecated 2013-11-20
*
* @author Ben Coburn <btcoburn@silicodon.net>
* @author Kate Arzamastseva <pshns@ukr.net>
*
* @param string $id the page of interest
* @param int $first skip the first n changelog lines
* @param int $num number of revisions to return
* @param int $chunk_size
* @param bool $media
* @return array
*/
function getRevisions($id, $first, $num, $chunk_size = 8192, $media = false) {
dbg_deprecated('class PageChangeLog or class MediaChangelog');
if($media) {
$changelog = new MediaChangeLog($id, $chunk_size);
} else {
$changelog = new PageChangeLog($id, $chunk_size);
}
return $changelog->getRevisions($first, $num);
}

View file

@ -1,512 +0,0 @@
<?php
/**
* Brutally chopped and modified from http://pear.php.net/package/Console_Getopts
*
* PHP Version 5
*
* Copyright (c) 1997-2004 The PHP Group
*
* LICENSE: This source file is subject to the New BSD license that is
* available through the world-wide-web at the following URI:
* http://www.opensource.org/licenses/bsd-license.php. If you did not receive
* a copy of the New BSD License and are unable to obtain it through the web,
* please send a note to license@php.net so we can mail you a copy immediately.
*
* @category Console
* @package Console_Getopt
* @author Andrei Zmievski <andrei@php.net>
* @modified Harry Fuecks hfuecks gmail.com
* @modified Tanguy Ortolo <tanguy+dokuwiki@ortolo.eu>
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @version CVS: $Id$
* @link http://pear.php.net/package/Console_Getopt
*
*/
//------------------------------------------------------------------------------
/**
* Sets up CLI environment based on SAPI and PHP version
* Helps resolve some issues between the CGI and CLI SAPIs
* as well is inconsistencies between PHP 4.3+ and older versions
*/
if (version_compare(phpversion(), '4.3.0', '<') || php_sapi_name() == 'cgi') {
// Handle output buffering
@ob_end_flush();
ob_implicit_flush(true);
// PHP ini settings
set_time_limit(0);
ini_set('track_errors', "1");
ini_set('html_errors', "0");
ini_set('magic_quotes_runtime', "0");
// Define stream constants
define('STDIN', fopen('php://stdin', 'r'));
define('STDOUT', fopen('php://stdout', 'w'));
define('STDERR', fopen('php://stderr', 'w'));
// Close the streams on script termination
register_shutdown_function(
create_function('',
'fclose(STDIN); fclose(STDOUT); fclose(STDERR); return true;')
);
}
//------------------------------------------------------------------------------
/**
* Error codes
*/
define('DOKU_CLI_OPTS_UNKNOWN_OPT',1); //Unrecognized option
define('DOKU_CLI_OPTS_OPT_ARG_REQUIRED',2); //Option requires argument
define('DOKU_CLI_OPTS_OPT_ARG_DENIED',3); //Option not allowed argument
define('DOKU_CLI_OPTS_OPT_ABIGUOUS',4);//Option abiguous
define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
//------------------------------------------------------------------------------
/**
* Command-line options parsing class.
*
* @author Andrei Zmievski <andrei@php.net>
*
* @deprecated 2014-05-16
*/
class Doku_Cli_Opts {
/**
* <?php ?>
* @see http://www.sitepoint.com/article/php-command-line-1/3
* @param string $bin_file executing file name - this MUST be passed the __FILE__ constant
* @param string $short_options short options
* @param array $long_options (optional) long options
* @return Doku_Cli_Opts_Container|Doku_Cli_Opts_Error
*/
function & getOptions($bin_file, $short_options, $long_options = null) {
$args = Doku_Cli_Opts::readPHPArgv();
if ( Doku_Cli_Opts::isError($args) ) {
return $args;
}
// Compatibility between "php extensions.php" and "./extensions.php"
if ( realpath($_SERVER['argv'][0]) == $bin_file ) {
$options = Doku_Cli_Opts::getOpt($args,$short_options,$long_options);
} else {
$options = Doku_Cli_Opts::getOpt2($args,$short_options,$long_options);
}
if ( Doku_Cli_Opts::isError($options) ) {
return $options;
}
$container = new Doku_Cli_Opts_Container($options);
return $container;
}
/**
* Parses the command-line options.
*
* The first parameter to this function should be the list of command-line
* arguments without the leading reference to the running program.
*
* The second parameter is a string of allowed short options. Each of the
* option letters can be followed by a colon ':' to specify that the option
* requires an argument, or a double colon '::' to specify that the option
* takes an optional argument.
*
* The third argument is an optional array of allowed long options. The
* leading '--' should not be included in the option name. Options that
* require an argument should be followed by '=', and options that take an
* option argument should be followed by '=='.
*
* The return value is an array of two elements: the list of parsed
* options and the list of non-option command-line arguments. Each entry in
* the list of parsed options is a pair of elements - the first one
* specifies the option, and the second one specifies the option argument,
* if there was one.
*
* Long and short options can be mixed.
*
* Most of the semantics of this function are based on GNU getopt_long().
*
* @param array $args an array of command-line arguments
* @param string $short_options specifies the list of allowed short options
* @param array $long_options specifies the list of allowed long options
*
* @return array two-element array containing the list of parsed options and
* the non-option arguments
* @access public
*/
function getopt2($args, $short_options, $long_options = null) {
return Doku_Cli_Opts::doGetopt(
2, $args, $short_options, $long_options
);
}
/**
* This function expects $args to start with the script name (POSIX-style).
* Preserved for backwards compatibility.
*
* @param array $args an array of command-line arguments
* @param string $short_options specifies the list of allowed short options
* @param array $long_options specifies the list of allowed long options
*
* @see getopt2()
* @return array two-element array containing the list of parsed options and
* the non-option arguments
*/
function getopt($args, $short_options, $long_options = null) {
return Doku_Cli_Opts::doGetopt(
1, $args, $short_options, $long_options
);
}
/**
* The actual implementation of the argument parsing code.
*
* @param int $version Version to use
* @param array $args an array of command-line arguments
* @param string $short_options specifies the list of allowed short options
* @param array $long_options specifies the list of allowed long options
*
* @return array
*/
function doGetopt($version, $args, $short_options, $long_options = null) {
// in case you pass directly readPHPArgv() as the first arg
if (Doku_Cli_Opts::isError($args)) {
return $args;
}
if (empty($args)) {
return array(array(), array());
}
$opts = array();
$non_opts = array();
settype($args, 'array');
if ($long_options && is_array($long_options)) {
sort($long_options);
}
/*
* Preserve backwards compatibility with callers that relied on
* erroneous POSIX fix.
*/
if ($version < 2) {
if (isset($args[0]{0}) && $args[0]{0} != '-') {
array_shift($args);
}
}
reset($args);
while (list($i, $arg) = each($args)) {
/* The special element '--' means explicit end of
options. Treat the rest of the arguments as non-options
and end the loop. */
if ($arg == '--') {
$non_opts = array_merge($non_opts, array_slice($args, $i + 1));
break;
}
if ($arg{0} != '-' || (strlen($arg) > 1 && $arg{1} == '-' && !$long_options)) {
$non_opts = array_merge($non_opts, array_slice($args, $i));
break;
} elseif (strlen($arg) > 1 && $arg{1} == '-') {
$error = Doku_Cli_Opts::_parseLongOption(substr($arg, 2), $long_options, $opts, $args);
if (Doku_Cli_Opts::isError($error))
return $error;
} elseif ($arg == '-') {
// - is stdin
$non_opts = array_merge($non_opts, array_slice($args, $i));
break;
} else {
$error = Doku_Cli_Opts::_parseShortOption(substr($arg, 1), $short_options, $opts, $args);
if (Doku_Cli_Opts::isError($error))
return $error;
}
}
return array($opts, $non_opts);
}
/**
* Parse short option
*
* @param string $arg Argument
* @param string $short_options Available short options
* @param string[][] &$opts
* @param string[] &$args
*
* @access private
* @return void|Doku_Cli_Opts_Error
*/
function _parseShortOption($arg, $short_options, &$opts, &$args) {
$len = strlen($arg);
for ($i = 0; $i < $len; $i++) {
$opt = $arg{$i};
$opt_arg = null;
/* Try to find the short option in the specifier string. */
if (($spec = strstr($short_options, $opt)) === false || $arg{$i} == ':')
{
return Doku_Cli_Opts::raiseError(
DOKU_CLI_OPTS_UNKNOWN_OPT,
"Unrecognized option -- $opt"
);
}
if (strlen($spec) > 1 && $spec{1} == ':') {
if (strlen($spec) > 2 && $spec{2} == ':') {
if ($i + 1 < strlen($arg)) {
/* Option takes an optional argument. Use the remainder of
the arg string if there is anything left. */
$opts[] = array($opt, substr($arg, $i + 1));
break;
}
} else {
/* Option requires an argument. Use the remainder of the arg
string if there is anything left. */
if ($i + 1 < strlen($arg)) {
$opts[] = array($opt, substr($arg, $i + 1));
break;
} else if (list(, $opt_arg) = each($args)) {
/* Else use the next argument. */;
if (Doku_Cli_Opts::_isShortOpt($opt_arg) || Doku_Cli_Opts::_isLongOpt($opt_arg))
return Doku_Cli_Opts::raiseError(
DOKU_CLI_OPTS_OPT_ARG_REQUIRED,
"option requires an argument --$opt"
);
}
else
return Doku_Cli_Opts::raiseError(
DOKU_CLI_OPTS_OPT_ARG_REQUIRED,
"Option requires an argument -- $opt"
);
}
}
$opts[] = array($opt, $opt_arg);
}
}
/**
* Checks if an argument is a short option
*
* @param string $arg Argument to check
*
* @access private
* @return bool
*/
function _isShortOpt($arg){
return strlen($arg) == 2 && $arg[0] == '-'
&& preg_match('/[a-zA-Z]/', $arg[1]);
}
/**
* Checks if an argument is a long option
*
* @param string $arg Argument to check
*
* @access private
* @return bool
*/
function _isLongOpt($arg){
return strlen($arg) > 2 && $arg[0] == '-' && $arg[1] == '-' &&
preg_match('/[a-zA-Z]+$/', substr($arg, 2));
}
/**
* Parse long option
*
* @param string $arg Argument
* @param string[] $long_options Available long options
* @param string[][] &$opts
* @param string[] &$args
*
* @access private
* @return void|Doku_Cli_Opts_Error
*/
function _parseLongOption($arg, $long_options, &$opts, &$args) {
@list($opt, $opt_arg) = explode('=', $arg, 2);
$opt_len = strlen($opt);
$opt_cnt = count($long_options);
for ($i = 0; $i < $opt_cnt; $i++) {
$long_opt = $long_options[$i];
$opt_start = substr($long_opt, 0, $opt_len);
$long_opt_name = str_replace('=', '', $long_opt);
/* Option doesn't match. Go on to the next one. */
if ($opt_start != $opt)
continue;
$opt_rest = substr($long_opt, $opt_len);
/* Check that the options uniquely matches one of the allowed
options. */
if ($i + 1 < count($long_options)) {
$next_option_rest = substr($long_options[$i + 1], $opt_len);
} else {
$next_option_rest = '';
}
if ($opt_rest != '' && $opt{0} != '=' &&
$i + 1 < $opt_cnt &&
$opt == substr($long_options[$i+1], 0, $opt_len) &&
$next_option_rest != '' &&
$next_option_rest{0} != '=') {
return Doku_Cli_Opts::raiseError(
DOKU_CLI_OPTS_OPT_ABIGUOUS,
"Option --$opt is ambiguous"
);
}
if (substr($long_opt, -1) == '=') {
if (substr($long_opt, -2) != '==') {
/* Long option requires an argument.
Take the next argument if one wasn't specified. */;
if (!strlen($opt_arg) && !(list(, $opt_arg) = each($args))) {
return Doku_Cli_Opts::raiseError(
DOKU_CLI_OPTS_OPT_ARG_REQUIRED,
"Option --$opt requires an argument"
);
}
if (Doku_Cli_Opts::_isShortOpt($opt_arg)
|| Doku_Cli_Opts::_isLongOpt($opt_arg))
return Doku_Cli_Opts::raiseError(
DOKU_CLI_OPTS_OPT_ARG_REQUIRED,
"Option --$opt requires an argument"
);
}
} else if ($opt_arg) {
return Doku_Cli_Opts::raiseError(
DOKU_CLI_OPTS_OPT_ARG_DENIED,
"Option --$opt doesn't allow an argument"
);
}
$opts[] = array('--' . $opt, $opt_arg);
return;
}
return Doku_Cli_Opts::raiseError(
DOKU_CLI_OPTS_UNKNOWN_OPT,
"Unrecognized option --$opt"
);
}
/**
* Safely read the $argv PHP array across different PHP configurations.
* Will take care on register_globals and register_argc_argv ini directives
*
* @access public
* @return array|Doku_Cli_Opts_Error the $argv PHP array or PEAR error if not registered
*/
function readPHPArgv() {
global $argv;
if (!is_array($argv)) {
if (!@is_array($_SERVER['argv'])) {
if (!@is_array($GLOBALS['HTTP_SERVER_VARS']['argv'])) {
return Doku_Cli_Opts::raiseError(
DOKU_CLI_OPTS_ARG_READ,
"Could not read cmd args (register_argc_argv=Off?)"
);
}
return $GLOBALS['HTTP_SERVER_VARS']['argv'];
}
return $_SERVER['argv'];
}
return $argv;
}
/**
* @param $code
* @param $msg
* @return Doku_Cli_Opts_Error
*/
function raiseError($code, $msg) {
return new Doku_Cli_Opts_Error($code, $msg);
}
/**
* @param $obj
* @return bool
*/
function isError($obj) {
return is_a($obj, 'Doku_Cli_Opts_Error');
}
}
//------------------------------------------------------------------------------
class Doku_Cli_Opts_Error {
var $code;
var $msg;
function __construct($code, $msg) {
$this->code = $code;
$this->msg = $msg;
}
function getMessage() {
return $this->msg;
}
function isError() {
return true;
}
}
//------------------------------------------------------------------------------
class Doku_Cli_Opts_Container {
var $options = array();
var $args = array();
function __construct($options) {
foreach ( $options[0] as $option ) {
if ( false !== ( strpos($option[0], '--') ) ) {
$opt_name = substr($option[0], 2);
} else {
$opt_name = $option[0];
}
$this->options[$opt_name] = $option[1];
}
$this->args = $options[1];
}
function has($option) {
return array_key_exists($option, $this->options);
}
function get($option) {
if ( isset($this->options[$option]) ) {
return ( $this->options[$option] ) ;
}
}
function arg($index) {
if ( isset($this->args[$index]) ) {
return $this->args[$index];
}
}
function numArgs() {
return count($this->args);
}
function hasArgs() {
return count($this->args) !== 0;
}
function isError() {
return false;
}
}

View file

@ -30,6 +30,32 @@ function hsc($string) {
return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
}
/**
* Checks if the given input is blank
*
* This is similar to empty() but will return false for "0".
*
* Please note: when you pass uninitialized variables, they will implicitly be created
* with a NULL value without warning.
*
* To avoid this it's recommended to guard the call with isset like this:
*
* (isset($foo) && !blank($foo))
* (!isset($foo) || blank($foo))
*
* @param $in
* @param bool $trim Consider a string of whitespace to be blank
* @return bool
*/
function blank(&$in, $trim = false) {
if(is_null($in)) return true;
if(is_array($in)) return empty($in);
if($in === "\0") return true;
if($trim && trim($in) === '') return true;
if(strlen($in) > 0) return false;
return empty($in);
}
/**
* print a newline terminated string
*
@ -1164,6 +1190,48 @@ function con($pre, $text, $suf, $pretty = false) {
return $pre.$text.$suf;
}
/**
* Checks if the current page version is newer than the last entry in the page's
* changelog. If so, we assume it has been an external edit and we create an
* attic copy and add a proper changelog line.
*
* This check is only executed when the page is about to be saved again from the
* wiki, triggered in @see saveWikiText()
*
* @param string $id the page ID
*/
function detectExternalEdit($id) {
global $lang;
$fileLastMod = wikiFN($id);
$lastMod = @filemtime($fileLastMod); // from page
$pagelog = new PageChangeLog($id, 1024);
$lastRev = $pagelog->getRevisions(-1, 1); // from changelog
$lastRev = (int) (empty($lastRev) ? 0 : $lastRev[0]);
if(!file_exists(wikiFN($id, $lastMod)) && file_exists($fileLastMod) && $lastMod >= $lastRev) {
// add old revision to the attic if missing
saveOldRevision($id);
// add a changelog entry if this edit came from outside dokuwiki
if($lastMod > $lastRev) {
$fileLastRev = wikiFN($id, $lastRev);
$revinfo = $pagelog->getRevisionInfo($lastRev);
if(empty($lastRev) || !file_exists($fileLastRev) || $revinfo['type'] == DOKU_CHANGE_TYPE_DELETE) {
$filesize_old = 0;
} else {
$filesize_old = io_getSizeFile($fileLastRev);
}
$filesize_new = filesize($fileLastMod);
$sizechange = $filesize_new - $filesize_old;
addLogEntry($lastMod, $id, DOKU_CHANGE_TYPE_EDIT, $lang['external_edit'], '', array('ExternalEdit'=> true), $sizechange);
// remove soon to be stale instructions
$cache = new cache_instructions($id, $fileLastMod);
$cache->removeCache();
}
}
}
/**
* Saves a wikitext by calling io_writeWikiPage.
* Also directs changelog and attic updates.
@ -1189,77 +1257,88 @@ function saveWikiText($id, $text, $summary, $minor = false) {
/* @var Input $INPUT */
global $INPUT;
// ignore if no changes were made
if($text == rawWiki($id, '')) {
return;
// prepare data for event
$svdta = array();
$svdta['id'] = $id;
$svdta['file'] = wikiFN($id);
$svdta['revertFrom'] = $REV;
$svdta['oldRevision'] = @filemtime($svdta['file']);
$svdta['newRevision'] = 0;
$svdta['newContent'] = $text;
$svdta['oldContent'] = rawWiki($id);
$svdta['summary'] = $summary;
$svdta['contentChanged'] = ($svdta['newContent'] != $svdta['oldContent']);
$svdta['changeInfo'] = '';
$svdta['changeType'] = DOKU_CHANGE_TYPE_EDIT;
$svdta['sizechange'] = null;
// select changelog line type
if($REV) {
$svdta['changeType'] = DOKU_CHANGE_TYPE_REVERT;
$svdta['changeInfo'] = $REV;
} else if(!file_exists($svdta['file'])) {
$svdta['changeType'] = DOKU_CHANGE_TYPE_CREATE;
} else if(trim($text) == '') {
// empty or whitespace only content deletes
$svdta['changeType'] = DOKU_CHANGE_TYPE_DELETE;
// autoset summary on deletion
if(blank($svdta['summary'])) {
$svdta['summary'] = $lang['deleted'];
}
} else if($minor && $conf['useacl'] && $INPUT->server->str('REMOTE_USER')) {
//minor edits only for logged in users
$svdta['changeType'] = DOKU_CHANGE_TYPE_MINOR_EDIT;
}
$file = wikiFN($id);
$old = @filemtime($file); // from page
$wasRemoved = (trim($text) == ''); // check for empty or whitespace only
$wasCreated = !file_exists($file);
$wasReverted = ($REV == true);
$pagelog = new PageChangeLog($id, 1024);
$newRev = false;
$oldRev = $pagelog->getRevisions(-1, 1); // from changelog
$oldRev = (int) (empty($oldRev) ? 0 : $oldRev[0]);
if(!file_exists(wikiFN($id, $old)) && file_exists($file) && $old >= $oldRev) {
// add old revision to the attic if missing
saveOldRevision($id);
// add a changelog entry if this edit came from outside dokuwiki
if($old > $oldRev) {
addLogEntry($old, $id, DOKU_CHANGE_TYPE_EDIT, $lang['external_edit'], '', array('ExternalEdit'=> true));
// remove soon to be stale instructions
$cache = new cache_instructions($id, $file);
$cache->removeCache();
}
}
$event = new Doku_Event('COMMON_WIKIPAGE_SAVE', $svdta);
if(!$event->advise_before()) return;
if($wasRemoved) {
// if the content has not been changed, no save happens (plugins may override this)
if(!$svdta['contentChanged']) return;
detectExternalEdit($id);
if(
$svdta['changeType'] == DOKU_CHANGE_TYPE_CREATE ||
($svdta['changeType'] == DOKU_CHANGE_TYPE_REVERT && !file_exists($svdta['file']))
) {
$filesize_old = 0;
} else {
$filesize_old = filesize($svdta['file']);
}
if($svdta['changeType'] == DOKU_CHANGE_TYPE_DELETE) {
// Send "update" event with empty data, so plugins can react to page deletion
$data = array(array($file, '', false), getNS($id), noNS($id), false);
$data = array(array($svdta['file'], '', false), getNS($id), noNS($id), false);
trigger_event('IO_WIKIPAGE_WRITE', $data);
// pre-save deleted revision
@touch($file);
@touch($svdta['file']);
clearstatcache();
$newRev = saveOldRevision($id);
$data['newRevision'] = saveOldRevision($id);
// remove empty file
@unlink($file);
@unlink($svdta['file']);
$filesize_new = 0;
// don't remove old meta info as it should be saved, plugins can use IO_WIKIPAGE_WRITE for removing their metadata...
// purge non-persistant meta data
p_purge_metadata($id);
$del = true;
// autoset summary on deletion
if(empty($summary)) $summary = $lang['deleted'];
// remove empty namespaces
io_sweepNS($id, 'datadir');
io_sweepNS($id, 'mediadir');
} else {
// save file (namespace dir is created in io_writeWikiPage)
io_writeWikiPage($file, $text, $id);
io_writeWikiPage($svdta['file'], $text, $id);
// pre-save the revision, to keep the attic in sync
$newRev = saveOldRevision($id);
$del = false;
$svdta['newRevision'] = saveOldRevision($id);
$filesize_new = filesize($svdta['file']);
}
$svdta['sizechange'] = $filesize_new - $filesize_old;
// select changelog line type
$extra = '';
$type = DOKU_CHANGE_TYPE_EDIT;
if($wasReverted) {
$type = DOKU_CHANGE_TYPE_REVERT;
$extra = $REV;
} else if($wasCreated) {
$type = DOKU_CHANGE_TYPE_CREATE;
} else if($wasRemoved) {
$type = DOKU_CHANGE_TYPE_DELETE;
} else if($minor && $conf['useacl'] && $INPUT->server->str('REMOTE_USER')) {
$type = DOKU_CHANGE_TYPE_MINOR_EDIT;
} //minor edits only for logged in users
$event->advise_after();
addLogEntry($svdta['newRevision'], $svdta['id'], $svdta['changeType'], $svdta['summary'], $svdta['changeInfo'], null, $svdta['sizechange']);
addLogEntry($newRev, $id, $type, $summary, $extra);
// send notify mails
notify($id, 'admin', $old, $summary, $minor);
notify($id, 'subscribers', $old, $summary, $minor);
notify($svdta['id'], 'admin', $svdta['oldRevision'], $svdta['summary'], $minor);
notify($svdta['id'], 'subscribers', $svdta['oldRevision'], $svdta['summary'], $minor);
// update the purgefile (timestamp of the last time anything within the wiki was changed)
io_saveFile($conf['cachedir'].'/purgefile', time());
@ -1398,7 +1477,7 @@ function filesize_h($size, $dec = 1) {
$i++;
}
return round($size, $dec).' '.$sizes[$i];
return round($size, $dec)."\xC2\xA0".$sizes[$i]; //non-breaking space
}
/**
@ -1462,7 +1541,7 @@ function dformat($dt = null, $format = '') {
* Formats a timestamp as ISO 8601 date
*
* @author <ungu at terong dot com>
* @link http://www.php.net/manual/en/function.date.php#54072
* @link http://php.net/manual/en/function.date.php#54072
*
* @param int $int_date current date in UNIX timestamp
* @return string
@ -1523,7 +1602,7 @@ function unslash($string, $char = "'") {
* Convert php.ini shorthands to byte
*
* @author <gilthans dot NO dot SPAM at gmail dot com>
* @link http://de3.php.net/manual/en/ini.core.php#79564
* @link http://php.net/manual/en/ini.core.php#79564
*
* @param string $v shorthands
* @return int|string
@ -1793,6 +1872,8 @@ function is_mem_available($mem, $bytes = 1048576) {
* @param string $url url being directed to
*/
function send_redirect($url) {
$url = stripctl($url); // defend against HTTP Response Splitting
/* @var Input $INPUT */
global $INPUT;
@ -1860,7 +1941,7 @@ function valid_input_set($param, $valid_values, $array, $exc = '') {
*/
function get_doku_pref($pref, $default) {
$enc_pref = urlencode($pref);
if(strpos($_COOKIE['DOKU_PREFS'], $enc_pref) !== false) {
if(isset($_COOKIE['DOKU_PREFS']) && strpos($_COOKIE['DOKU_PREFS'], $enc_pref) !== false) {
$parts = explode('#', $_COOKIE['DOKU_PREFS']);
$cnt = count($parts);
for($i = 0; $i < $cnt; $i += 2) {

View file

@ -62,6 +62,7 @@ $config_cascade = array_merge(
),
'plainauth.users' => array(
'default' => DOKU_CONF . 'users.auth.php',
'protected' => '' // not used by default
),
'plugins' => array(
'default' => array(DOKU_CONF . 'plugins.php'),

View file

@ -701,7 +701,7 @@ function ft_queryParser($Indexer, $query){
if (preg_match($ope_regex, $token)) {
// operator
$last_ope = end($ope_stack);
while ($ope_precedence[$token] <= $ope_precedence[$last_ope] && $last_ope != '(') {
while ($last_ope !== false && $ope_precedence[$token] <= $ope_precedence[$last_ope] && $last_ope != '(') {
$parsed_ary[] = array_pop($ope_stack);
$last_ope = end($ope_stack);
}

View file

@ -74,7 +74,7 @@ function html_login(){
function html_denied() {
print p_locale_xhtml('denied');
if(!$_SERVER['REMOTE_USER']){
if(empty($_SERVER['REMOTE_USER'])){
html_login();
}
}
@ -226,8 +226,7 @@ function html_btn($name, $id, $akey, $params, $method='get', $tooltip='', $label
$tip .= ' ['.strtoupper($akey).']';
$ret .= 'accesskey="'.$akey.'" ';
}
$ret .= 'title="'.$tip.'" ';
$ret .= '/>';
$ret .= 'title="'.$tip.'">';
$ret .= hsc($label);
$ret .= '</button>';
$ret .= '</div></form>';
@ -502,28 +501,61 @@ function html_revisions($first=0, $media_id = false){
array_pop($revisions); // remove extra log entry
}
if (!$media_id) $date = dformat($INFO['lastmod']);
else $date = dformat(@filemtime(mediaFN($id)));
if (!$media_id) print p_locale_xhtml('revisions');
$params = array('id' => 'page__revisions', 'class' => 'changes');
if ($media_id) $params['action'] = media_managerURL(array('image' => $media_id), '&');
if($media_id) {
$params['action'] = media_managerURL(array('image' => $media_id), '&');
}
if(!$media_id) {
$exists = $INFO['exists'];
$display_name = useHeading('navigation') ? hsc(p_get_first_heading($id)) : $id;
if(!$display_name) {
$display_name = $id;
}
} else {
$exists = file_exists(mediaFN($id));
$display_name = $id;
}
$form = new Doku_Form($params);
$form->addElement(form_makeOpenTag('ul'));
if (!$media_id) $exists = $INFO['exists'];
else $exists = file_exists(mediaFN($id));
if($exists && $first == 0) {
$minor = false;
if($media_id) {
$date = dformat(@filemtime(mediaFN($id)));
$href = media_managerURL(array('image' => $id, 'tab_details' => 'view'), '&');
$display_name = (!$media_id && useHeading('navigation')) ? hsc(p_get_first_heading($id)) : $id;
if (!$display_name) $display_name = $id;
$changelog->setChunkSize(1024);
$revinfo = $changelog->getRevisionInfo(@filemtime(fullpath(mediaFN($id))));
if($exists && $first==0){
if (!$media_id && isset($INFO['meta']) && isset($INFO['meta']['last_change']) && $INFO['meta']['last_change']['type']===DOKU_CHANGE_TYPE_MINOR_EDIT)
$form->addElement(form_makeOpenTag('li', array('class' => 'minor')));
else
$form->addElement(form_makeOpenTag('li'));
$summary = $revinfo['sum'];
if($revinfo['user']) {
$editor = $revinfo['user'];
} else {
$editor = $revinfo['ip'];
}
$sizechange = $revinfo['sizechange'];
} else {
$date = dformat($INFO['lastmod']);
if(isset($INFO['meta']) && isset($INFO['meta']['last_change'])) {
if($INFO['meta']['last_change']['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT) {
$minor = true;
}
if(isset($INFO['meta']['last_change']['sizechange'])) {
$sizechange = $INFO['meta']['last_change']['sizechange'];
} else {
$sizechange = null;
}
}
$href = wl($id);
$summary = $INFO['sum'];
$editor = $INFO['editor'];
}
$form->addElement(form_makeOpenTag('li', array('class' => ($minor ? 'minor' : ''))));
$form->addElement(form_makeOpenTag('div', array('class' => 'li')));
$form->addElement(form_makeTag('input', array(
'type' => 'checkbox',
@ -536,8 +568,6 @@ function html_revisions($first=0, $media_id = false){
$form->addElement('<img src="'.DOKU_BASE.'lib/images/blank.gif" width="15" height="11" alt="" />');
if (!$media_id) $href = wl($id);
else $href = media_managerURL(array('image' => $id, 'tab_details' => 'view'), '&');
$form->addElement(form_makeOpenTag('a', array(
'class' => 'wikilink1',
'href' => $href)));
@ -546,29 +576,19 @@ function html_revisions($first=0, $media_id = false){
if ($media_id) $form->addElement(form_makeOpenTag('div'));
if (!$media_id) {
if($summary) {
$form->addElement(form_makeOpenTag('span', array('class' => 'sum')));
$form->addElement(' ');
$form->addElement(htmlspecialchars($INFO['sum']));
if(!$media_id) $form->addElement(' ');
$form->addElement('<bdi>' . htmlspecialchars($summary) . '</bdi>');
$form->addElement(form_makeCloseTag('span'));
}
$changelog->setChunkSize(1024);
$form->addElement(form_makeOpenTag('span', array('class' => 'user')));
if($media_id) {
$revinfo = $changelog->getRevisionInfo(@filemtime(fullpath(mediaFN($id))));
if($revinfo['user']) {
$editor = $revinfo['user'];
} else {
$editor = $revinfo['ip'];
}
} else {
$editor = $INFO['editor'];
}
$form->addElement((empty($editor))?('('.$lang['external_edit'].')'):editorinfo($editor));
$form->addElement((empty($editor))?('('.$lang['external_edit'].')'):'<bdi>'.editorinfo($editor).'</bdi>');
$form->addElement(form_makeCloseTag('span'));
html_sizechange($sizechange, $form);
$form->addElement('('.$lang['current'].')');
if ($media_id) $form->addElement(form_makeCloseTag('div'));
@ -577,7 +597,7 @@ function html_revisions($first=0, $media_id = false){
$form->addElement(form_makeCloseTag('li'));
}
foreach($revisions as $rev){
foreach($revisions as $rev) {
$date = dformat($rev);
$info = $changelog->getRevisionInfo($rev);
if($media_id) {
@ -586,10 +606,11 @@ function html_revisions($first=0, $media_id = false){
$exists = page_exists($id, $rev);
}
if ($info['type']===DOKU_CHANGE_TYPE_MINOR_EDIT)
$form->addElement(form_makeOpenTag('li', array('class' => 'minor')));
else
$form->addElement(form_makeOpenTag('li'));
$class = '';
if($info['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT) {
$class = 'minor';
}
$form->addElement(form_makeOpenTag('li', array('class' => $class)));
$form->addElement(form_makeOpenTag('div', array('class' => 'li')));
if($exists){
$form->addElement(form_makeTag('input', array(
@ -605,9 +626,14 @@ function html_revisions($first=0, $media_id = false){
$form->addElement(form_makeCloseTag('span'));
if($exists){
if (!$media_id) $href = wl($id,"rev=$rev,do=diff", false, '&');
else $href = media_managerURL(array('image' => $id, 'rev' => $rev, 'mediado' => 'diff'), '&');
$form->addElement(form_makeOpenTag('a', array('href' => $href, 'class' => 'diff_link')));
if (!$media_id) {
$href = wl($id,"rev=$rev,do=diff", false, '&');
} else {
$href = media_managerURL(array('image' => $id, 'rev' => $rev, 'mediado' => 'diff'), '&');
}
$form->addElement(form_makeOpenTag('a', array(
'class' => 'diff_link',
'href' => $href)));
$form->addElement(form_makeTag('img', array(
'src' => DOKU_BASE.'lib/images/diff.png',
'width' => 15,
@ -615,9 +641,15 @@ function html_revisions($first=0, $media_id = false){
'title' => $lang['diff'],
'alt' => $lang['diff'])));
$form->addElement(form_makeCloseTag('a'));
if (!$media_id) $href = wl($id,"rev=$rev",false,'&');
else $href = media_managerURL(array('image' => $id, 'tab_details' => 'view', 'rev' => $rev), '&');
$form->addElement(form_makeOpenTag('a', array('href' => $href, 'class' => 'wikilink1')));
if (!$media_id) {
$href = wl($id,"rev=$rev",false,'&');
} else {
$href = media_managerURL(array('image' => $id, 'tab_details' => 'view', 'rev' => $rev), '&');
}
$form->addElement(form_makeOpenTag('a', array(
'class' => 'wikilink1',
'href' => $href)));
$form->addElement($display_name);
$form->addElement(form_makeCloseTag('a'));
}else{
@ -629,7 +661,7 @@ function html_revisions($first=0, $media_id = false){
if ($info['sum']) {
$form->addElement(form_makeOpenTag('span', array('class' => 'sum')));
if (!$media_id) $form->addElement(' ');
if(!$media_id) $form->addElement(' ');
$form->addElement('<bdi>'.htmlspecialchars($info['sum']).'</bdi>');
$form->addElement(form_makeCloseTag('span'));
}
@ -645,6 +677,8 @@ function html_revisions($first=0, $media_id = false){
}
$form->addElement(form_makeCloseTag('span'));
html_sizechange($info['sizechange'], $form);
if ($media_id) $form->addElement(form_makeCloseTag('div'));
$form->addElement(form_makeCloseTag('div'));
@ -696,7 +730,7 @@ function html_revisions($first=0, $media_id = false){
* @param int $first
* @param string $show_changes
*/
function html_recent($first=0, $show_changes='both'){
function html_recent($first = 0, $show_changes = 'both') {
global $conf;
global $lang;
global $ID;
@ -705,48 +739,50 @@ function html_recent($first=0, $show_changes='both'){
* This is the cheapest solution to get this information.
*/
$flags = 0;
if ($show_changes == 'mediafiles' && $conf['mediarevisions']) {
if($show_changes == 'mediafiles' && $conf['mediarevisions']) {
$flags = RECENTS_MEDIA_CHANGES;
} elseif ($show_changes == 'pages') {
} elseif($show_changes == 'pages') {
$flags = 0;
} elseif ($conf['mediarevisions']) {
} elseif($conf['mediarevisions']) {
$show_changes = 'both';
$flags = RECENTS_MEDIA_PAGES_MIXED;
}
$recents = getRecents($first,$conf['recent'] + 1,getNS($ID),$flags);
if(count($recents) == 0 && $first != 0){
$first=0;
$recents = getRecents($first,$conf['recent'] + 1,getNS($ID),$flags);
$recents = getRecents($first, $conf['recent'] + 1, getNS($ID), $flags);
if(count($recents) == 0 && $first != 0) {
$first = 0;
$recents = getRecents($first, $conf['recent'] + 1, getNS($ID), $flags);
}
$hasNext = false;
if (count($recents)>$conf['recent']) {
if(count($recents) > $conf['recent']) {
$hasNext = true;
array_pop($recents); // remove extra log entry
}
print p_locale_xhtml('recent');
if (getNS($ID) != '')
if(getNS($ID) != '') {
print '<div class="level1"><p>' . sprintf($lang['recent_global'], getNS($ID), wl('', 'do=recent')) . '</p></div>';
}
$form = new Doku_Form(array('id' => 'dw__recent', 'method' => 'GET', 'class' => 'changes'));
$form->addHidden('sectok', null);
$form->addHidden('do', 'recent');
$form->addHidden('id', $ID);
if ($conf['mediarevisions']) {
if($conf['mediarevisions']) {
$form->addElement('<div class="changeType">');
$form->addElement(form_makeListboxField(
'show_changes',
array(
'pages' => $lang['pages_changes'],
'mediafiles' => $lang['media_changes'],
'both' => $lang['both_changes']),
'both' => $lang['both_changes']
),
$show_changes,
$lang['changes_type'],
'','',
array('class'=>'quickselect')));
'', '',
array('class' => 'quickselect')));
$form->addElement(form_makeButton('submit', 'recent', $lang['btn_apply']));
$form->addElement('</div>');
@ -754,20 +790,21 @@ function html_recent($first=0, $show_changes='both'){
$form->addElement(form_makeOpenTag('ul'));
foreach($recents as $recent){
foreach($recents as $recent) {
$date = dformat($recent['date']);
if ($recent['type']===DOKU_CHANGE_TYPE_MINOR_EDIT)
$form->addElement(form_makeOpenTag('li', array('class' => 'minor')));
else
$form->addElement(form_makeOpenTag('li'));
$class = '';
if($recent['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT) {
$class = 'minor';
}
$form->addElement(form_makeOpenTag('li', array('class' => $class)));
$form->addElement(form_makeOpenTag('div', array('class' => 'li')));
if (!empty($recent['media'])) {
if(!empty($recent['media'])) {
$form->addElement(media_printicon($recent['id']));
} else {
$icon = DOKU_BASE.'lib/images/fileicons/file.png';
$form->addElement('<img src="'.$icon.'" alt="'.$recent['id'].'" class="icon" />');
$icon = DOKU_BASE . 'lib/images/fileicons/file.png';
$form->addElement('<img src="' . $icon . '" alt="' . $recent['id'] . '" class="icon" />');
}
$form->addElement(form_makeOpenTag('span', array('class' => 'date')));
@ -777,11 +814,11 @@ function html_recent($first=0, $show_changes='both'){
$diff = false;
$href = '';
if (!empty($recent['media'])) {
if(!empty($recent['media'])) {
$changelog = new MediaChangeLog($recent['id']);
$revs = $changelog->getRevisions(0, 1);
$diff = (count($revs) && file_exists(mediaFN($recent['id'])));
if ($diff) {
if($diff) {
$href = media_managerURL(array(
'tab_details' => 'history',
'mediado' => 'diff',
@ -790,63 +827,68 @@ function html_recent($first=0, $show_changes='both'){
), '&');
}
} else {
$href = wl($recent['id'],"do=diff", false, '&');
$href = wl($recent['id'], "do=diff", false, '&');
}
if (!empty($recent['media']) && !$diff) {
$form->addElement('<img src="'.DOKU_BASE.'lib/images/blank.gif" width="15" height="11" alt="" />');
if(!empty($recent['media']) && !$diff) {
$form->addElement('<img src="' . DOKU_BASE . 'lib/images/blank.gif" width="15" height="11" alt="" />');
} else {
$form->addElement(form_makeOpenTag('a', array('class' => 'diff_link', 'href' => $href)));
$form->addElement(form_makeTag('img', array(
'src' => DOKU_BASE.'lib/images/diff.png',
'src' => DOKU_BASE . 'lib/images/diff.png',
'width' => 15,
'height'=> 11,
'height' => 11,
'title' => $lang['diff'],
'alt' => $lang['diff']
)));
$form->addElement(form_makeCloseTag('a'));
}
if (!empty($recent['media'])) {
$href = media_managerURL(array('tab_details' => 'history',
'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
if(!empty($recent['media'])) {
$href = media_managerURL(array('tab_details' => 'history', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
} else {
$href = wl($recent['id'],"do=revisions",false,'&');
$href = wl($recent['id'], "do=revisions", false, '&');
}
$form->addElement(form_makeOpenTag('a', array('class' => 'revisions_link', 'href' => $href)));
$form->addElement(form_makeOpenTag('a', array(
'class' => 'revisions_link',
'href' => $href)));
$form->addElement(form_makeTag('img', array(
'src' => DOKU_BASE.'lib/images/history.png',
'src' => DOKU_BASE . 'lib/images/history.png',
'width' => 12,
'height'=> 14,
'height' => 14,
'title' => $lang['btn_revs'],
'alt' => $lang['btn_revs']
)));
$form->addElement(form_makeCloseTag('a'));
if (!empty($recent['media'])) {
if(!empty($recent['media'])) {
$href = media_managerURL(array('tab_details' => 'view', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
$class = (file_exists(mediaFN($recent['id']))) ? 'wikilink1' : $class = 'wikilink2';
$form->addElement(form_makeOpenTag('a', array('class' => $class, 'href' => $href)));
$class = file_exists(mediaFN($recent['id'])) ? 'wikilink1' : 'wikilink2';
$form->addElement(form_makeOpenTag('a', array(
'class' => $class,
'href' => $href)));
$form->addElement($recent['id']);
$form->addElement(form_makeCloseTag('a'));
} else {
$form->addElement(html_wikilink(':'.$recent['id'],useHeading('navigation')?null:$recent['id']));
$form->addElement(html_wikilink(':' . $recent['id'], useHeading('navigation') ? null : $recent['id']));
}
$form->addElement(form_makeOpenTag('span', array('class' => 'sum')));
$form->addElement(' '.htmlspecialchars($recent['sum']));
$form->addElement(' ' . htmlspecialchars($recent['sum']));
$form->addElement(form_makeCloseTag('span'));
$form->addElement(form_makeOpenTag('span', array('class' => 'user')));
if($recent['user']){
$form->addElement('<bdi>'.editorinfo($recent['user']).'</bdi>');
if(auth_ismanager()){
$form->addElement(' <bdo dir="ltr">('.$recent['ip'].')</bdo>');
if($recent['user']) {
$form->addElement('<bdi>' . editorinfo($recent['user']) . '</bdi>');
if(auth_ismanager()) {
$form->addElement(' <bdo dir="ltr">(' . $recent['ip'] . ')</bdo>');
}
}else{
$form->addElement('<bdo dir="ltr">'.$recent['ip'].'</bdo>');
} else {
$form->addElement('<bdo dir="ltr">' . $recent['ip'] . '</bdo>');
}
$form->addElement(form_makeCloseTag('span'));
html_sizechange($recent['sizechange'], $form);
$form->addElement(form_makeCloseTag('div'));
$form->addElement(form_makeCloseTag('li'));
}
@ -854,28 +896,28 @@ function html_recent($first=0, $show_changes='both'){
$form->addElement(form_makeOpenTag('div', array('class' => 'pagenav')));
$last = $first + $conf['recent'];
if ($first > 0) {
if($first > 0) {
$first -= $conf['recent'];
if ($first < 0) $first = 0;
if($first < 0) $first = 0;
$form->addElement(form_makeOpenTag('div', array('class' => 'pagenav-prev')));
$form->addElement(form_makeOpenTag('button', array(
'type' => 'submit',
'name' => 'first['.$first.']',
'name' => 'first[' . $first . ']',
'accesskey' => 'n',
'title' => $lang['btn_newer'].' [N]',
'title' => $lang['btn_newer'] . ' [N]',
'class' => 'button show'
)));
$form->addElement($lang['btn_newer']);
$form->addElement(form_makeCloseTag('button'));
$form->addElement(form_makeCloseTag('div'));
}
if ($hasNext) {
if($hasNext) {
$form->addElement(form_makeOpenTag('div', array('class' => 'pagenav-next')));
$form->addElement(form_makeOpenTag('button', array(
'type' => 'submit',
'name' => 'first['.$last.']',
'name' => 'first[' . $last . ']',
'accesskey' => 'p',
'title' => $lang['btn_older'].' [P]',
'title' => $lang['btn_older'] . ' [P]',
'class' => 'button show'
)));
$form->addElement($lang['btn_older']);
@ -897,10 +939,9 @@ function html_index($ns){
global $conf;
global $ID;
$ns = cleanID($ns);
#fixme use appropriate function
if(empty($ns)){
$ns = dirname(str_replace(':','/',$ID));
if($ns == '.') $ns ='';
$ns = getNS($ID);
if($ns === false) $ns ='';
}
$ns = utf8_encodeFN(str_replace(':','/',$ns));
@ -2116,7 +2157,17 @@ function html_admin(){
// print the rest as sorted list
if(count($menu)){
usort($menu, 'p_sort_modes');
// sort by name, then sort
usort(
$menu,
function ($a, $b) {
$strcmp = strcasecmp($a['prompt'], $b['prompt']);
if($strcmp != 0) return $strcmp;
if($a['sort'] == $b['sort']) return 0;
return ($a['sort'] < $b['sort']) ? -1 : 1;
}
);
// output the menu
ptln('<div class="clearer"></div>');
print p_locale_xhtml('adminplugins');
@ -2349,6 +2400,7 @@ function html_tabs($tabs, $current_tab = null) {
echo '</ul>'.NL;
}
/**
* Prints a single tab
*
@ -2373,3 +2425,28 @@ function html_tab($href, $caption, $selected=false) {
echo $tab;
}
/**
* Display size change
*
* @param int $sizechange - size of change in Bytes
* @param Doku_Form $form - form to add elements to
*/
function html_sizechange($sizechange, Doku_Form $form) {
if(isset($sizechange)) {
$class = 'sizechange';
$value = filesize_h(abs($sizechange));
if($sizechange > 0) {
$class .= ' positive';
$value = '+' . $value;
} elseif($sizechange < 0) {
$class .= ' negative';
$value = '-' . $value;
} else {
$value = '±' . $value;
}
$form->addElement(form_makeOpenTag('span', array('class' => $class)));
$form->addElement($value);
$form->addElement(form_makeCloseTag('span'));
}
}

View file

@ -197,6 +197,8 @@ function http_rangeRequest($fh,$size,$mime){
* @return bool
*/
function http_gzip_valid($uncompressed_file) {
if(!DOKU_HAS_GZIP) return false;
$gzip = $uncompressed_file.'.gz';
if (filemtime($gzip) < filemtime($uncompressed_file)) { // filemtime returns false (0) if file doesn't exist
return copy($uncompressed_file, 'compress.zlib://'.$gzip);
@ -252,10 +254,10 @@ function http_cached_finish($file, $content) {
// save cache file
io_saveFile($file, $content);
if(function_exists('gzopen')) io_saveFile("$file.gz",$content);
if(DOKU_HAS_GZIP) io_saveFile("$file.gz",$content);
// finally send output
if ($conf['gzip_output']) {
if ($conf['gzip_output'] && DOKU_HAS_GZIP) {
header('Vary: Accept-Encoding');
header('Content-Encoding: gzip');
print gzencode($content,9,FORCE_GZIP);

View file

@ -195,10 +195,12 @@ require_once(DOKU_INC.'vendor/autoload.php');
require_once(DOKU_INC.'inc/load.php');
// disable gzip if not available
if($conf['compression'] == 'bz2' && !function_exists('bzopen')){
define('DOKU_HAS_BZIP', function_exists('bzopen'));
define('DOKU_HAS_GZIP', function_exists('gzopen'));
if($conf['compression'] == 'bz2' && !DOKU_HAS_BZIP) {
$conf['compression'] = 'gz';
}
if($conf['compression'] == 'gz' && !function_exists('gzopen')){
if($conf['compression'] == 'gz' && !DOKU_HAS_GZIP) {
$conf['compression'] = 0;
}
@ -547,7 +549,7 @@ EOT;
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author <richpageau at yahoo dot co dot uk>
* @link http://de3.php.net/manual/en/function.realpath.php#75992
* @link http://php.net/manual/en/function.realpath.php#75992
*/
function fullpath($path,$exists=false){
static $run = 0;

View file

@ -107,9 +107,11 @@ function io_readFile($file,$clean=true){
$ret = '';
if(file_exists($file)){
if(substr($file,-3) == '.gz'){
if(!DOKU_HAS_GZIP) return false;
$ret = gzfile($file);
if(is_array($ret)) $ret = join('', $ret);
}else if(substr($file,-4) == '.bz2'){
if(!DOKU_HAS_BZIP) return false;
$ret = bzfile($file);
}else{
$ret = file_get_contents($file);
@ -222,11 +224,13 @@ function _io_saveFile($file, $content, $append) {
$fileexists = file_exists($file);
if(substr($file,-3) == '.gz'){
if(!DOKU_HAS_GZIP) return false;
$fh = @gzopen($file,$mode.'9');
if(!$fh) return false;
gzwrite($fh, $content);
gzclose($fh);
}else if(substr($file,-4) == '.bz2'){
if(!DOKU_HAS_BZIP) return false;
if($append) {
$bzcontent = bzfile($file);
if($bzcontent === false) return false;
@ -313,8 +317,10 @@ function io_replaceInFile($file, $oldline, $newline, $regex=false, $maxlines=0)
// load into array
if(substr($file,-3) == '.gz'){
if(!DOKU_HAS_GZIP) return false;
$lines = gzfile($file);
}else if(substr($file,-4) == '.bz2'){
if(!DOKU_HAS_BZIP) return false;
$lines = bzfile($file, true);
}else{
$lines = file($file);
@ -483,7 +489,7 @@ function io_makeFileDir($file){
/**
* Creates a directory hierachy.
*
* @link http://www.php.net/manual/en/function.mkdir.php
* @link http://php.net/manual/en/function.mkdir.php
* @author <saint@corenova.com>
* @author Andreas Gohr <andi@splitbrain.org>
*
@ -770,3 +776,46 @@ function io_grep($file,$pattern,$max=0,$backref=false){
return $matches;
}
/**
* Get size of contents of a file, for a compressed file the uncompressed size
* Warning: reading uncompressed size of content of bz-files requires uncompressing
*
* @author Gerrit Uitslag <klapinklapin@gmail.com>
*
* @param string $file filename path to file
* @return int size of file
*/
function io_getSizeFile($file) {
if (!file_exists($file)) return 0;
if(substr($file,-3) == '.gz'){
$fp = @fopen($file, "rb");
if($fp === false) return 0;
fseek($fp, -4, SEEK_END);
$buffer = fread($fp, 4);
fclose($fp);
$array = unpack("V", $buffer);
$uncompressedsize = end($array);
}else if(substr($file,-4) == '.bz2'){
if(!DOKU_HAS_BZIP) return 0;
$bz = bzopen($file,"r");
if($bz === false) return 0;
$uncompressedsize = 0;
while (!feof($bz)) {
//8192 seems to be the maximum buffersize?
$buffer = bzread($bz,8192);
if(($buffer === false) || (bzerrno($bz) !== 0)) {
return 0;
}
$uncompressedsize += strlen($buffer);
}
}else{
$uncompressedsize = filesize($file);
}
return $uncompressedsize;
}

View file

@ -345,3 +345,5 @@ $lang['currentns'] = 'مساحة الاسم الحالية';
$lang['searchresult'] = 'نتيجة البحث';
$lang['plainhtml'] = 'نص HTML غير منسق';
$lang['wikimarkup'] = 'علامات الوكي';
$lang['email_signature_text'] = 'أنشئت هذه الرسالة من دوكو ويكي في
@DOKUWIKIURL@';

View file

@ -10,8 +10,3 @@
مستخدم : @USER@
@DIFF@
--
تم أرسال هذه الرسالة من دوكو ويكي فى
@DOKUWIKIURL@

View file

@ -8,6 +8,6 @@
@HTMLBODY@
<br /><hr />
<small>تم انشاء هذا البريد الالكتروني بواسطة DokuWiki في @DOKUWIKIURL@.</small>
<small>@EMAILSIGNATURE@</small>
</body>
</html>

View file

@ -4,7 +4,3 @@
أسم المستخدم : @LOGIN@
كلمة السر : @PASSWORD@
--
تم أرسال هذه الرسالة من دوكو ويكي
@DOKUWIKIURL@

View file

@ -4,5 +4,3 @@
إذا لم تكن قد طلبت كلمة سر جديدة رجاء قم بتجاهل هذه الرسالة .
لتأكيد أنك أنت قمت بطلب كلمة السر الجديدة . نرجو منك الضغط على الرابط في الأسفل .
@CONFIRM@
--
لقد تم عمل هذه الرسالة من قبل DokuWiki .. في @DOKUWIKIURL@

View file

@ -8,7 +8,3 @@
المتصفح : @BROWSER@
عنوان-IP: @IPADDRESS@
اسم المضيف: @HOSTNAME@
--
وُلد هذا البريد من دوكو ويكي في
@DOKUWIKIURL@

View file

@ -14,7 +14,3 @@
@DOKUWIKIURL@ ثم زُر
@SUBSCRIBE@
وألغ اشتراكك من الصفحات أو النظاقات
--
أنشئت هذه الرسالة من دوكو ويكي في
@DOKUWIKIURL@

View file

@ -11,7 +11,3 @@
@DOKUWIKIURL@ ثم زُر
@SUBSCRIBE@
ثم ألغ اشتراك تغييرات الصفحة و/أو النطاق.
--
وُلد هذا البريد من دوكو ويكي في
@DOKUWIKIURL@

View file

@ -17,7 +17,3 @@
@DOKUWIKIURL@ ثم زُر
@SUBSCRIBE@
وألغ الاشتراك من تغييرات الصفحة و/أو النطاق.
--
ولد هذا البريد باستخدام دوكو ويكي في
@DOKUWIKIURL@

View file

@ -8,7 +8,3 @@
الحجم : @SIZE@
نوع MIME : @MIME@
المستخدم: @USER@
--
ولد هذا البريد من دوكو ويكي في
@DOKUWIKIURL@

View file

@ -213,3 +213,5 @@ $lang['days'] = '%d gün əvvəl';
$lang['hours'] = '%d saat əvvəl';
$lang['minutes'] = '%d dəqiqə əvvəl';
$lang['seconds'] = '%d saniyə əvvəl';
$lang['email_signature_text'] = 'DokuWiki aşağıdakı adresdə yerləşir
@DOKUWIKIURL@';

View file

@ -10,9 +10,3 @@ Dəyişiklərin xülasəsi : @SUMMARY@
İstifadəçi : @USER@
@DIFF@
--
Bu məktub DokuWiki tərəfindən yaradıldı.
DokuWiki aşağıdakı adresdə yerləşir:
@DOKUWIKIURL@

View file

@ -4,8 +4,3 @@ Sizin @TITLE@ (@DOKUWIKIURL@) üçün olan məlumatlarınız
İstifadəçi adı : @LOGIN@
Şifrə : @PASSWORD@
--
Bu məktub DokuWiki tərəfindən yaradıldı.
DokuWiki aşağıdakı adresdə yerləşir:
@DOKUWIKIURL@

View file

@ -7,8 +7,3 @@ Kimsə @DOKUWIKIURL@ adresində yerləşən @TITLE@ adlı wiki-yə giriş üçü
Tələbi təsdiq etmək üçün, aşağıdakı link-ə keçin.
@CONFIRM@
--
Bu məktub DokuWiki tərəfindən yaradıldı.
DokuWiki aşağıdakı adresdə yerləşir:
@DOKUWIKIURL@

View file

@ -8,8 +8,3 @@ Tarix : @DATE@
Brauzer : @BROWSER@
IP adres : @IPADDRESS@
Host : @HOSTNAME@
--
Bu məktub DokuWiki tərəfindən yaradıldı.
DokuWiki aşağıdakı adresdə yerləşir:
@DOKUWIKIURL@

View file

@ -8,8 +8,3 @@ Host : @HOSTNAME@
Həcm : @SIZE@
MIME Növ : @MIME@
İstifadəçi : @USER@
--
Bu məktub DokuWiki tərəfindən yaradıldı.
DokuWiki aşağıdakı adresdə yerləşir:
@DOKUWIKIURL@

View file

@ -331,5 +331,8 @@ $lang['media_perm_read'] = 'За съжаление нямате дост
$lang['media_perm_upload'] = 'За съжаление нямате достатъчно права, за да можете да качите файла.';
$lang['media_update'] = 'Качване на нова версия';
$lang['media_restore'] = 'Възстановяване на тази версия';
$lang['currentns'] = 'Текущо именно пространство';
$lang['searchresult'] = 'Резултати от търсенето';
$lang['plainhtml'] = 'Обикновен HTML';
$lang['email_signature_text'] = 'Писмото е генерирано от DokuWiki на адрес
@DOKUWIKIURL@';

View file

@ -10,7 +10,3 @@ IP адрес : @IPADDRESS@
Потребител : @USER@
@DIFF@
--
Писмото е генерирано от DokuWiki на адрес @DOKUWIKIURL@

View file

@ -8,6 +8,6 @@
@HTMLBODY@
<br /><hr />
<small>Писмото е генерирано от DokuWiki на адрес @DOKUWIKIURL@.</small>
<small>@EMAILSIGNATURE@</small>
</body>
</html>

View file

@ -4,6 +4,3 @@
Потребител : @LOGIN@
Парола : @PASSWORD@
--
Писмото е генерирано от DokuWiki на адрес @DOKUWIKIURL@

View file

@ -8,6 +8,3 @@
За да потвърдите, че искането е наистина от вас, моля ползвайте следния линк:
@CONFIRM@
--
Писмото е генерирано от DokuWiki на адрес @DOKUWIKIURL@

View file

@ -8,6 +8,3 @@ E. поща : @NEWEMAIL@
Браузър : @BROWSER@
IP адрес : @IPADDRESS@
Име на хоста : @HOSTNAME@
--
Писмото е генерирано от DokuWiki на адрес @DOKUWIKIURL@

View file

@ -13,6 +13,3 @@
Ако желаете да прекратите уведомяването за страницата трябва да се впишете на адрес @DOKUWIKIURL@, да посетите
@SUBSCRIBE@
и да прекратите абонамента за промени по страницата или именното пространство.
--
Писмото е генерирано от DokuWiki на адрес @DOKUWIKIURL@

View file

@ -10,6 +10,3 @@
Ако желаете да прекратите уведомяването за страницата трябва да се впишете на адрес @DOKUWIKIURL@, да посетите
@SUBSCRIBE@
и да прекратите абонамента за промени по страницата или именното пространство.
--
Писмото е генерирано от DokuWiki на адрес @DOKUWIKIURL@

View file

@ -16,7 +16,3 @@
Ако желаете да прекратите уведомяването за страницата трябва да се впишете на адрес @DOKUWIKIURL@, да посетите
@SUBSCRIBE@
и да прекратите абонамента за промени по страницата или именното пространство.
--
Писмото е генерирано от DokuWiki на адрес
@DOKUWIKIURL@

View file

@ -8,6 +8,3 @@ IP адрес : @IPADDRESS@
Размер : @SIZE@
MIME тип : @MIME@
Потребител : @USER@
--
Писмото е генерирано от DokuWiki на адрес @DOKUWIKIURL@

View file

@ -218,3 +218,6 @@ $lang['days'] = 'fa %d dies';
$lang['hours'] = 'fa %d hores';
$lang['minutes'] = 'fa %d minuts';
$lang['seconds'] = 'fa %d segons';
$lang['email_signature_text'] = 'Este correu ha segut generat per DokuWiki en
@DOKUWIKIURL@';

View file

@ -10,8 +10,3 @@ Resum: @SUMMARY@
Usuari: @USER@
@DIFF@
--
Este correu l'ha generat DokuWiki en
@DOKUWIKIURL@

View file

@ -4,7 +4,3 @@ Estes són les seues senyes d'usuari per a @TITLE@ en @DOKUWIKIURL@
Usuari : @LOGIN@
Contrasenya : @PASSWORD@
--
Este correu l'ha generat DokuWiki en
@DOKUWIKIURL@

View file

@ -9,7 +9,3 @@ Per a confirmar que la petició ha segut feta realment per vosté
utilise el següent víncul.
@CONFIRM@
--
Este correu l'ha generat DokuWiki en
@DOKUWIKIURL@

View file

@ -8,7 +8,3 @@ Data : @DATE@
Navegador : @BROWSER@
Direcció IP : @IPADDRESS@
Nom de la màquina : @HOSTNAME@
--
Este correu l'ha generat DokuWiki en
@DOKUWIKIURL@

View file

@ -8,7 +8,3 @@ Nom de la màquina: @HOSTNAME@
Tamany: @SIZE@
Tipo MIME: @MIME@
Usuari: @USER@
--
Este correu ha segut generat per DokuWiki en
@DOKUWIKIURL@

View file

@ -331,6 +331,8 @@ $lang['media_perm_read'] = 'No teniu permisos suficients per a llegir arxi
$lang['media_perm_upload'] = 'No teniu permisos suficients per a pujar arxius';
$lang['media_update'] = 'Puja la nova versió';
$lang['media_restore'] = 'Restaura aquesta versió';
$lang['email_signature_text'] = 'Aquest mail ha estat generat per DokuWiki a
@DOKUWIKIURL@';
$lang['currentns'] = 'Espai de noms actual';
$lang['searchresult'] = 'Resultats cerca';
$lang['plainhtml'] = 'HTML pla';

View file

@ -9,8 +9,3 @@ Resum d'edició : @SUMMARY@
Usuari : @USER@
@DIFF@
--
Missatge generat per DokuWiki en
@DOKUWIKIURL@

View file

@ -8,6 +8,6 @@
@HTMLBODY@
<br /><hr />
<small>Aquest correu electrònic ha estat generat per DokuWiki a @DOKUWIKIURL@.</small>
<small>@EMAILSIGNATURE@</small>
</body>
</html>

View file

@ -4,7 +4,3 @@ Aquestes són les teves dades per a entrar en @TITLE@ en l'adreça @DOKUWIKIURL@
Usuari : @LOGIN@
Contrasenya : @PASSWORD@
--
Missatge generat per DokuWiki en
@DOKUWIKIURL@

View file

@ -9,7 +9,3 @@ Per confirmar que realment heu sol·licitat una nova contrasenya, utilitzeu
l'enllaç següent:
@CONFIRM@
--
Missatge generat per DokuWiki en
@DOKUWIKIURL@

View file

@ -8,7 +8,3 @@ Data: @DATE@
Navegador: @BROWSER@
Adreça IP: @IPADDRESS@
Ordinador: @HOSTNAME@
--
Missatge generat per DokuWiki en
@DOKUWIKIURL@

View file

@ -14,8 +14,3 @@ Si voleu cancel·lar les notificacions per a la pàgina, accediu al wiki a
@DOKUWIKIURL@, visiteu
@SUBSCRIBE@
i doneu-vos de baixa dels canvis de la pàgina o de l'espai.
--
Aquest mail ha estat generat per DokuWiki a
@DOKUWIKIURL@

View file

@ -14,8 +14,3 @@ Si voleu cancel·lar les notificacions per a la pàgina, accediu al wiki a
@DOKUWIKIURL@, visiteu
@SUBSCRIBE@
i doneu-vos de baixa dels canvis de la pàgina o de l'espai.
--
Aquest mail ha estat generat per DokuWiki a
@DOKUWIKIURL@

View file

@ -8,7 +8,3 @@ Ordinador: @HOSTNAME@
Mida: @SIZE@
Tipus MIME: @MIME@
Usuari: @USER@
--
Missatge generat per DokuWiki en
@DOKUWIKIURL@

View file

@ -1,3 +1,3 @@
====== Správa ======
Níže je možno spravovat vaši DokuWiki.
Níže je možno spravovat vaší DokuWiki.

View file

@ -353,3 +353,5 @@ $lang['plainhtml'] = 'Čisté HTML';
$lang['wikimarkup'] = 'Wiki jazyk';
$lang['page_nonexist_rev'] = 'Stránka neexistovala na %s. Byla vytvořena dodatečne na <a href="%s">%s</a>.';
$lang['unable_to_parse_date'] = 'Nelze rozebrat parametr "%s".';
$lang['email_signature_text'] = 'Tento e-mail byl automaticky vygenerován systémem DokuWiki
@DOKUWIKIURL@';

View file

@ -10,8 +10,3 @@ Komentář : @SUMMARY@
Uživatel : @USER@
@DIFF@
--
Tento e-mail byl automaticky vygenerován systémem DokuWiki
@DOKUWIKIURL@

View file

@ -8,6 +8,6 @@
@HTMLBODY@
<br /><hr />
<small>Tento mail byl vygenerován systémem DokuWiki na adrese @DOKUWIKIURL@.</small>
<small>@EMAILSIGNATURE@</small>
</body>
</html>

View file

@ -5,7 +5,3 @@ Zde jsou přihlašovací informace pro wiki @TITLE@ (@DOKUWIKIURL@)
Jméno : @FULLNAME@
Uživatelské jméno : @LOGIN@
Heslo : @PASSWORD@
--
Tento e-mail byl automaticky vygenerován systémem DokuWiki
@DOKUWIKIURL@

View file

@ -7,7 +7,3 @@ Pokud jste o nové heslo nežádali, ignorujte prosím tento e-mail.
Pro potvrzení, že jste tento požadavek poslali opravdu vy, prosím otevřete následující odkaz.
@CONFIRM@
--
Tento e-mail byl automaticky vygenerován systémem DokuWiki
@DOKUWIKIURL@

View file

@ -8,7 +8,3 @@ Datum : @DATE@
Prohlížeč : @BROWSER@
IP adresa : @IPADDRESS@
Hostitel : @HOSTNAME@
--
Tento e-mail byl automaticky vygenerován systémem DokuWiki
@DOKUWIKIURL@

View file

@ -1,3 +1,2 @@
**Toto je starší verze dokumentu!**
----

View file

@ -16,7 +16,3 @@ se prosím přihlašte do wiki na adrese
@SUBSCRIBE@
a odhlaste se z odebírání změn na stránce či
ve jmenném prostoru.
--
Tento e-mail byl automaticky vygenerován systémem DokuWiki
@DOKUWIKIURL@

View file

@ -13,7 +13,3 @@ se prosím příhlašte do wiki na adrese
@SUBSCRIBE@
a odhlaste se z odebírání změn na stránce či
ve jmenném prostoru.
--
Tento e-mail byl automaticky vygenerován systémem DokuWiki
@DOKUWIKIURL@

View file

@ -19,7 +19,3 @@ se prosím přihlašte do wiki na adrese
@SUBSCRIBE@
a odhlaste se z odebírání změn na stránce či
ve jmenném prostoru.
--
Tento e-mail byl automaticky vygenerován systémem DokuWiki
@DOKUWIKIURL@

View file

@ -8,7 +8,3 @@ Hostitel : @HOSTNAME@
Velikost : @SIZE@
MIME typ : @MIME@
Uživatel : @USER@
--
Tento e-mail byl automaticky vygenerován systémem DokuWiki
@DOKUWIKIURL@

View file

@ -0,0 +1,4 @@
====== Gweinyddu ======
Gallwch chi ddarganfod rhestr o dasgau gweinyddol ar gael mewn DokuWiki, isod.

View file

@ -0,0 +1,2 @@
===== Ategion Ychwanegol =====

View file

@ -0,0 +1,4 @@
====== Olgysylltiadau ======
Dyma restr o dudalennau sy'n ymddangos eu bod nhw'n cysylltu'n ôl i'r dudalen gyfredol.

View file

@ -0,0 +1,6 @@
====== Mae fersiwn mwy diweddar yn bodoli ======
Mae fersiwn mwy diweddar o'r ddogfen a wnaethoch chi olygu yn bodoli. Bydd hwn yn digwydd pan fydd defnyddiwr arall yn newid y ddogfen wrth i chi'n ei golygu hi.
Archwiliwch y gwahaniaethau isod yn drylwyr, yna penderfynnwch pa fersiwn i'w gadw. Os ydych chi'n dewis ''cadw'', caiff eich fersiwn chi ei gadw. Pwyswch ''canslo'' i gadw'r fersiwn cyfredol.

View file

@ -0,0 +1,4 @@
====== Gwrthodwyd Hawl ======
Sori, 'sdim hawliau digonol 'da chi i barhau.

View file

@ -0,0 +1,4 @@
====== Gwahaniaethau ======
Mae hwn yn dangos y gwahaniaethau rhwng dau fersiwn y dudalen.

View file

@ -0,0 +1,8 @@
====== Ffeil ddrafft wedi'i darganfod ======
Doedd eich sesiwn golygu ddiwethaf heb gwblhau'n gywir. Gwnaeth DokuWiki gadw copi ddrafft yn awtomatig wrth i chi weithio, sydd nawr ar gael i chi er mwyn parhau gyda'ch golygu. Gallwch chi weld y data a gafodd ei gadw o'ch sesiwn diwethaf isod.
Penderfynwch os ydych chi am //adennill// eich sesiwn golygu goll, //dileu//'r drafft awtogadw neu //canslo//'r broses olygu.

View file

@ -0,0 +1,2 @@
Golygwch y dudalen a phwyso ''Cadw''. Gweler [[wiki:syntax]] ar gyfer cystrawen Wici. Golygwch y dudalen hon dim ond os ydych chi'n gallu ei **gwella** hi. Os ydych chi am brofi pethau, cymerwch eich camau cyntaf ar y [[playground:playground|maes chwarae]].

Some files were not shown because too many files have changed in this diff Show more