diff options
author | Tim Roes <mail@timroes.de> | 2012-05-07 17:08:35 +0200 |
---|---|---|
committer | Tim Roes <mail@timroes.de> | 2012-05-07 17:08:35 +0200 |
commit | efa78c8638547cab77a37006e7f86aed792a1609 (patch) | |
tree | 492804d80b28f8e32785b3648d9e03e77804b50f /inc | |
parent | ae992f53831c105d6deacfef79d7723b22a00033 (diff) | |
parent | f774b92a94947b3eabd64919b6b4ba74f9c4b5fd (diff) | |
download | rpg-efa78c8638547cab77a37006e7f86aed792a1609.tar.gz rpg-efa78c8638547cab77a37006e7f86aed792a1609.tar.bz2 |
Merge branch 'master' of https://github.com/splitbrain/dokuwiki
Diffstat (limited to 'inc')
50 files changed, 976 insertions, 232 deletions
diff --git a/inc/DifferenceEngine.php b/inc/DifferenceEngine.php index 01926b20c..0a7ce8e7c 100644 --- a/inc/DifferenceEngine.php +++ b/inc/DifferenceEngine.php @@ -818,6 +818,39 @@ class DiffFormatter { } } +/** + * Utilityclass for styling HTML formatted diffs + * + * Depends on global var $DIFF_INLINESTYLES, if true some minimal predefined + * inline styles are used. Useful for HTML mails and RSS feeds + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +class HTMLDiff { + /** + * Holds the style names and basic CSS + */ + static public $styles = array( + 'diff-addedline' => 'background-color: #ddffdd;', + 'diff-deletedline' => 'background-color: #ffdddd;', + 'diff-context' => 'background-color: #f5f5f5;', + 'diff-mark' => 'color: #ff0000;', + ); + + /** + * Return a class or style parameter + */ + static function css($classname){ + global $DIFF_INLINESTYLES; + + if($DIFF_INLINESTYLES){ + if(!isset(self::$styles[$classname])) return ''; + return 'style="'.self::$styles[$classname].'"'; + }else{ + return 'class="'.$classname.'"'; + } + } +} /** * Additions by Axel Boldt follow, partly taken from diff.php, phpwiki-1.3.3 @@ -838,11 +871,11 @@ class _HWLDF_WordAccumulator { function _flushGroup($new_tag) { if ($this->_group !== '') { if ($this->_tag == 'mark') - $this->_line .= '<strong>'.$this->_group.'</strong>'; + $this->_line .= '<strong '.HTMLDiff::css('diff-mark').'>'.$this->_group.'</strong>'; elseif ($this->_tag == 'add') - $this->_line .= '<span class="diff-addedline">'.$this->_group.'</span>'; + $this->_line .= '<span '.HTMLDiff::css('diff-addedline').'>'.$this->_group.'</span>'; elseif ($this->_tag == 'del') - $this->_line .= '<span class="diff-deletedline"><del>'.$this->_group.'</del></span>'; + $this->_line .= '<span '.HTMLDiff::css('diff-deletedline').'><del>'.$this->_group.'</del></span>'; else $this->_line .= $this->_group; } @@ -1020,8 +1053,8 @@ class TableDiffFormatter extends DiffFormatter { global $lang; $l1 = $lang['line'].' '.$xbeg; $l2 = $lang['line'].' '.$ybeg; - $r = '<tr><td class="diff-blockheader" colspan="2">'.$l1.":</td>\n". - '<td class="diff-blockheader" colspan="2">'.$l2.":</td>\n". + $r = '<tr><td '.HTMLDiff::css('diff-blockheader').' colspan="2">'.$l1.":</td>\n". + '<td '.HTMLDiff::css('diff-blockheader').' colspan="2">'.$l2.":</td>\n". "</tr>\n"; return $r; } @@ -1037,11 +1070,11 @@ class TableDiffFormatter extends DiffFormatter { } function addedLine($line) { - return '<td>+</td><td class="diff-addedline">' . $line.'</td>'; + return '<td>+</td><td '.HTMLDiff::css('diff-addedline').'>' . $line.'</td>'; } function deletedLine($line) { - return '<td>-</td><td class="diff-deletedline">' . $line.'</td>'; + return '<td>-</td><td '.HTMLDiff::css('diff-deletedline').'>' . $line.'</td>'; } function emptyLine() { @@ -1049,7 +1082,7 @@ class TableDiffFormatter extends DiffFormatter { } function contextLine($line) { - return '<td> </td><td class="diff-context">'.$line.'</td>'; + return '<td> </td><td '.HTMLDiff::css('diff-context').'>'.$line.'</td>'; } function _added($lines) { @@ -1115,9 +1148,9 @@ class InlineDiffFormatter extends DiffFormatter { $xbeg .= "," . $xlen; if ($ylen != 1) $ybeg .= "," . $ylen; - $r = '<tr><td colspan="'.$this->colspan.'" class="diff-blockheader">@@ '.$lang['line']." -$xbeg +$ybeg @@"; - $r .= ' <span class="diff-deletedline"><del>'.$lang['deleted'].'</del></span>'; - $r .= ' <span class="diff-addedline">'.$lang['created'].'</span>'; + $r = '<tr><td colspan="'.$this->colspan.'" '.HTMLDiff::css('diff-blockheader').'>@@ '.$lang['line']." -$xbeg +$ybeg @@"; + $r .= ' <span '.HTMLDiff::css('diff-deletedline').'><del>'.$lang['deleted'].'</del></span>'; + $r .= ' <span '.HTMLDiff::css('diff-addedline').'>'.$lang['created'].'</span>'; $r .= "</td></tr>\n"; return $r; } @@ -1134,19 +1167,19 @@ class InlineDiffFormatter extends DiffFormatter { function _added($lines) { foreach ($lines as $line) { - print('<tr><td colspan="'.$this->colspan.'" class="diff-addedline">'. $line . "</td></tr>\n"); + print('<tr><td colspan="'.$this->colspan.'" '.HTMLDiff::css('diff-addedline').'>'. $line . "</td></tr>\n"); } } function _deleted($lines) { foreach ($lines as $line) { - print('<tr><td colspan="'.$this->colspan.'" class="diff-deletedline"><del>' . $line . "</del></td></tr>\n"); + print('<tr><td colspan="'.$this->colspan.'" '.HTMLDiff::css('diff-deletedline').'><del>' . $line . "</del></td></tr>\n"); } } function _context($lines) { foreach ($lines as $line) { - print('<tr><td colspan="'.$this->colspan.'" class="diff-context">'.$line."</td></tr>\n"); + print('<tr><td colspan="'.$this->colspan.'" '.HTMLDiff::css('diff-context').'>'.$line."</td></tr>\n"); } } diff --git a/inc/JSON.php b/inc/JSON.php index 2dea44003..7f89005ff 100644 --- a/inc/JSON.php +++ b/inc/JSON.php @@ -47,8 +47,6 @@ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * - * @category - * @package * @author Michal Migurski <mike-json@teczno.com> * @author Matt Knapp <mdknapp[at]gmail[dot]com> * @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com> @@ -97,19 +95,6 @@ define('JSON_STRICT_TYPE', 11); /** * Converts to and from JSON format. - * - * @category - * @package - * @author Michal Migurski <mike-json@teczno.com> - * @author Matt Knapp <mdknapp[at]gmail[dot]com> - * @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com> - * @copyright 2005 Michal Migurski - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version - * @link - * @see - * @since - * @deprecated */ class JSON { @@ -151,7 +136,9 @@ class JSON { * @access public */ function encode($var) { - if (function_exists('json_encode')) return json_encode($var); + if (!$this->skipnative && function_exists('json_encode')){ + return json_encode($var); + } switch (gettype($var)) { case 'boolean': return $var ? 'true' : 'false'; @@ -582,17 +569,17 @@ class JSON { } - } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && - in_array($top['what'], array(JSON_SLICE, JSON_IN_ARR, JSON_IN_OBJ))) { + } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != JSON_IN_STR)) { // found a quote, and we are not inside a string array_push($stk, array('what' => JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c})); //print("Found start of string at {$c}\n"); } elseif (($chrs{$c} == $top['delim']) && ($top['what'] == JSON_IN_STR) && - (($chrs{$c - 1} != "\\") || - ($chrs{$c - 1} == "\\" && $chrs{$c - 2} == "\\"))) { + ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) { // found a quote, we're in a string, and it's not escaped + // we know that it's not escaped becase there is _not_ an + // odd number of backslashes at the end of the string so far array_pop($stk); //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n"); diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php new file mode 100644 index 000000000..507150d00 --- /dev/null +++ b/inc/Mailer.class.php @@ -0,0 +1,652 @@ +<?php +/** + * A class to build and send multi part mails (with HTML content and embedded + * attachments). All mails are assumed to be in UTF-8 encoding. + * + * Attachments are handled in memory so this shouldn't be used to send huge + * files, but then again mail shouldn't be used to send huge files either. + * + * @author Andreas Gohr <andi@splitbrain.org> + */ + +// end of line for mail lines - RFC822 says CRLF but postfix (and other MTAs?) +// think different +if(!defined('MAILHEADER_EOL')) define('MAILHEADER_EOL',"\n"); +#define('MAILHEADER_ASCIIONLY',1); + +class Mailer { + + protected $headers = array(); + protected $attach = array(); + protected $html = ''; + protected $text = ''; + + protected $boundary = ''; + protected $partid = ''; + protected $sendparam= null; + + protected $validator = null; + protected $allowhtml = true; + + /** + * Constructor + * + * Initializes the boundary strings and part counters + */ + public function __construct(){ + global $conf; + + $server = parse_url(DOKU_URL,PHP_URL_HOST); + + $this->partid = md5(uniqid(rand(),true)).'@'.$server; + $this->boundary = '----------'.md5(uniqid(rand(),true)); + + $listid = join('.',array_reverse(explode('/',DOKU_BASE))).$server; + $listid = strtolower(trim($listid,'.')); + + $this->allowhtml = (bool) $conf['htmlmail']; + + // add some default headers for mailfiltering FS#2247 + $this->setHeader('X-Mailer','DokuWiki '.getVersion()); + $this->setHeader('X-DokuWiki-User', $_SERVER['REMOTE_USER']); + $this->setHeader('X-DokuWiki-Title', $conf['title']); + $this->setHeader('X-DokuWiki-Server', $server); + $this->setHeader('X-Auto-Response-Suppress', 'OOF'); + $this->setHeader('List-Id',$conf['title'].' <'.$listid.'>'); + } + + /** + * Attach a file + * + * @param $path Path to the file to attach + * @param $mime Mimetype of the attached file + * @param $name The filename to use + * @param $embed Unique key to reference this file from the HTML part + */ + public function attachFile($path,$mime,$name='',$embed=''){ + if(!$name){ + $name = basename($path); + } + + $this->attach[] = array( + 'data' => file_get_contents($path), + 'mime' => $mime, + 'name' => $name, + 'embed' => $embed + ); + } + + /** + * Attach a file + * + * @param $path The file contents to attach + * @param $mime Mimetype of the attached file + * @param $name The filename to use + * @param $embed Unique key to reference this file from the HTML part + */ + public function attachContent($data,$mime,$name='',$embed=''){ + if(!$name){ + list($junk,$ext) = split('/',$mime); + $name = count($this->attach).".$ext"; + } + + $this->attach[] = array( + 'data' => $data, + 'mime' => $mime, + 'name' => $name, + 'embed' => $embed + ); + } + + /** + * Callback function to automatically embed images referenced in HTML templates + */ + protected function autoembed_cb($matches){ + static $embeds = 0; + $embeds++; + + // get file and mime type + $media = cleanID($matches[1]); + list($ext, $mime) = mimetype($media); + $file = mediaFN($media); + if(!file_exists($file)) return $matches[0]; //bad reference, keep as is + + // attach it and set placeholder + $this->attachFile($file,$mime,'','autoembed'.$embeds); + return '%%autoembed'.$embeds.'%%'; + } + + /** + * Add an arbitrary header to the mail + * + * If an empy value is passed, the header is removed + * + * @param string $header the header name (no trailing colon!) + * @param string $value the value of the header + * @param bool $clean remove all non-ASCII chars and line feeds? + */ + public function setHeader($header,$value,$clean=true){ + $header = str_replace(' ','-',ucwords(strtolower(str_replace('-',' ',$header)))); // streamline casing + if($clean){ + $header = preg_replace('/[^\w \-\.\+\@]+/','',$header); + $value = preg_replace('/[^\w \-\.\+\@<>]+/','',$value); + } + + // empty value deletes + $value = trim($value); + if($value === ''){ + if(isset($this->headers[$header])) unset($this->headers[$header]); + }else{ + $this->headers[$header] = $value; + } + } + + /** + * Set additional parameters to be passed to sendmail + * + * Whatever is set here is directly passed to PHP's mail() command as last + * parameter. Depending on the PHP setup this might break mailing alltogether + */ + public function setParameters($param){ + $this->sendparam = $param; + } + + /** + * 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 + * + * If you pass the HTML part or HTML replacements yourself you have to make + * sure you encode all HTML special chars correctly + * + * @param string $text plain text body + * @param array $textrep replacements to apply on the text part + * @param array $htmlrep replacements to apply on the HTML part, leave null to use $textrep + * @param array $html the HTML body, leave null to create it from $text + * @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; + $htmlrep = (array) $htmlrep; + $textrep = (array) $textrep; + + // create HTML from text if not given + if(is_null($html)){ + $html = $text; + $html = hsc($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('@HTMLBODY@',$html,$wrap); + } + + // copy over all replacements missing for HTML (autolink URLs) + foreach($textrep as $key => $value){ + if(isset($htmlrep[$key])) continue; + if(preg_match('/^https?:\/\//i',$value)){ + $htmlrep[$key] = '<a href="'.hsc($value).'">'.hsc($value).'</a>'; + }else{ + $htmlrep[$key] = hsc($value); + } + } + + // embed media from templates + $html = preg_replace_callback('/@MEDIA\(([^\)]+)\)@/', + array($this,'autoembed_cb'),$html); + + // prepare default replacements + $ip = clientIP(); + $cip = gethostsbyaddrs($ip); + $trep = array( + 'DATE' => dformat(), + 'BROWSER' => $_SERVER['HTTP_USER_AGENT'], + 'IPADDRESS' => $ip, + 'HOSTNAME' => $cip, + 'TITLE' => $conf['title'], + 'DOKUWIKIURL' => DOKU_URL, + 'USER' => $_SERVER['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($_SERVER['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($_SERVER['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); + + // Apply replacements + foreach ($trep as $key => $substitution) { + $text = str_replace('@'.strtoupper($key).'@',$substitution, $text); + } + foreach ($hrep as $key => $substitution) { + $html = str_replace('@'.strtoupper($key).'@',$substitution, $html); + } + + $this->setHTML($html); + $this->setText($text); + } + + /** + * Set the HTML part of the mail + * + * Placeholders can be used to reference embedded attachments + * + * You probably want to use setBody() instead + */ + public function setHTML($html){ + $this->html = $html; + } + + /** + * Set the plain text part of the mail + * + * You probably want to use setBody() instead + */ + public function setText($text){ + $this->text = $text; + } + + /** + * Add the To: recipients + * + * @see setAddress + * @param string $address Multiple adresses separated by commas + */ + public function to($address){ + $this->setHeader('To', $address, false); + } + + /** + * Add the Cc: recipients + * + * @see setAddress + * @param string $address Multiple adresses separated by commas + */ + public function cc($address){ + $this->setHeader('Cc', $address, false); + } + + /** + * Add the Bcc: recipients + * + * @see setAddress + * @param string $address Multiple adresses separated by commas + */ + public function bcc($address){ + $this->setHeader('Bcc', $address, false); + } + + /** + * Add the From: address + * + * This is set to $conf['mailfrom'] when not specified so you shouldn't need + * to call this function + * + * @see setAddress + * @param string $address from address + */ + public function from($address){ + $this->setHeader('From', $address, false); + } + + /** + * Add the mail's Subject: header + * + * @param string $subject the mail subject + */ + public function subject($subject){ + $this->headers['Subject'] = $subject; + } + + /** + * Sets an email address header with correct encoding + * + * Unicode characters will be deaccented and encoded base64 + * for headers. Addresses may not contain Non-ASCII data! + * + * Example: + * setAddress("föö <foo@bar.com>, me@somewhere.com","TBcc"); + * + * @param string $address Multiple adresses separated by commas + * @param string returns the prepared header (can contain multiple lines) + */ + public function cleanAddress($address){ + // No named recipients for To: in Windows (see FS#652) + $names = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? false : true; + + $address = preg_replace('/[\r\n\0]+/',' ',$address); // remove attack vectors + + $headers = ''; + $parts = explode(',',$address); + foreach ($parts as $part){ + $part = trim($part); + + // parse address + if(preg_match('#(.*?)<(.*?)>#',$part,$matches)){ + $text = trim($matches[1]); + $addr = $matches[2]; + }else{ + $addr = $part; + } + // skip empty ones + if(empty($addr)){ + continue; + } + + // FIXME: is there a way to encode the localpart of a emailaddress? + if(!utf8_isASCII($addr)){ + msg(htmlspecialchars("E-Mail address <$addr> is not ASCII"),-1); + continue; + } + + if(is_null($this->validator)){ + $this->validator = new EmailAddressValidator(); + $this->validator->allowLocalAddresses = true; + } + if(!$this->validator->check_email_address($addr)){ + msg(htmlspecialchars("E-Mail address <$addr> is not valid"),-1); + continue; + } + + // text was given + if(!empty($text) && $names){ + // add address quotes + $addr = "<$addr>"; + + if(defined('MAILHEADER_ASCIIONLY')){ + $text = utf8_deaccent($text); + $text = utf8_strip($text); + } + + if(!utf8_isASCII($text)){ + $text = '=?UTF-8?B?'.base64_encode($text).'?='; + } + }else{ + $text = ''; + } + + // add to header comma seperated + if($headers != ''){ + $headers .= ', '; + } + $headers .= $text.' '.$addr; + } + + if(empty($headers)) return false; + + return $headers; + } + + + /** + * Prepare the mime multiparts for all attachments + * + * Replaces placeholders in the HTML with the correct CIDs + */ + protected function prepareAttachments(){ + $mime = ''; + $part = 1; + // embedded attachments + foreach($this->attach as $media){ + // create content id + $cid = 'part'.$part.'.'.$this->partid; + + // replace wildcards + if($media['embed']){ + $this->html = str_replace('%%'.$media['embed'].'%%','cid:'.$cid,$this->html); + } + + $mime .= '--'.$this->boundary.MAILHEADER_EOL; + $mime .= 'Content-Type: '.$media['mime'].';'.MAILHEADER_EOL; + $mime .= 'Content-Transfer-Encoding: base64'.MAILHEADER_EOL; + $mime .= "Content-ID: <$cid>".MAILHEADER_EOL; + if($media['embed']){ + $mime .= 'Content-Disposition: inline; filename="'.$media['name'].'"'.MAILHEADER_EOL; + }else{ + $mime .= 'Content-Disposition: attachment; filename="'.$media['name'].'"'.MAILHEADER_EOL; + } + $mime .= MAILHEADER_EOL; //end of headers + $mime .= chunk_split(base64_encode($media['data']),74,MAILHEADER_EOL); + + $part++; + } + return $mime; + } + + /** + * Build the body and handles multi part mails + * + * Needs to be called before prepareHeaders! + * + * @return string the prepared mail body, false on errors + */ + protected function prepareBody(){ + global $conf; + + // no HTML mails allowed? remove HTML body + if(!$this->allowhtml){ + $this->html = ''; + } + + // check for body + if(!$this->text && !$this->html){ + return false; + } + + // add general headers + $this->headers['MIME-Version'] = '1.0'; + + $body = ''; + + if(!$this->html && !count($this->attach)){ // we can send a simple single part message + $this->headers['Content-Type'] = 'text/plain; charset=UTF-8'; + $this->headers['Content-Transfer-Encoding'] = 'base64'; + $body .= chunk_split(base64_encode($this->text),74,MAILHEADER_EOL); + }else{ // multi part it is + $body .= "This is a multi-part message in MIME format.".MAILHEADER_EOL; + + // prepare the attachments + $attachments = $this->prepareAttachments(); + + // do we have alternative text content? + if($this->text && $this->html){ + $this->headers['Content-Type'] = 'multipart/alternative;'.MAILHEADER_EOL. + ' boundary="'.$this->boundary.'XX"'; + $body .= '--'.$this->boundary.'XX'.MAILHEADER_EOL; + $body .= 'Content-Type: text/plain; charset=UTF-8'.MAILHEADER_EOL; + $body .= 'Content-Transfer-Encoding: base64'.MAILHEADER_EOL; + $body .= MAILHEADER_EOL; + $body .= chunk_split(base64_encode($this->text),74,MAILHEADER_EOL); + $body .= '--'.$this->boundary.'XX'.MAILHEADER_EOL; + $body .= 'Content-Type: multipart/related;'.MAILHEADER_EOL. + ' boundary="'.$this->boundary.'"'.MAILHEADER_EOL; + $body .= MAILHEADER_EOL; + } + + $body .= '--'.$this->boundary.MAILHEADER_EOL; + $body .= 'Content-Type: text/html; charset=UTF-8'.MAILHEADER_EOL; + $body .= 'Content-Transfer-Encoding: base64'.MAILHEADER_EOL; + $body .= MAILHEADER_EOL; + $body .= chunk_split(base64_encode($this->html),74,MAILHEADER_EOL); + $body .= MAILHEADER_EOL; + $body .= $attachments; + $body .= '--'.$this->boundary.'--'.MAILHEADER_EOL; + + // close open multipart/alternative boundary + if($this->text && $this->html){ + $body .= '--'.$this->boundary.'XX--'.MAILHEADER_EOL; + } + } + + return $body; + } + + /** + * Cleanup and encode the headers array + */ + protected function cleanHeaders(){ + global $conf; + + // clean up addresses + if(empty($this->headers['From'])) $this->from($conf['mailfrom']); + $addrs = array('To','From','Cc','Bcc'); + foreach($addrs as $addr){ + if(isset($this->headers[$addr])){ + $this->headers[$addr] = $this->cleanAddress($this->headers[$addr]); + } + } + + if(isset($this->headers['Subject'])){ + // add prefix to subject + if(empty($conf['mailprefix'])){ + if(utf8_strlen($conf['title']) < 20) { + $prefix = '['.$conf['title'].']'; + }else{ + $prefix = '['.utf8_substr($conf['title'], 0, 20).'...]'; + } + }else{ + $prefix = '['.$conf['mailprefix'].']'; + } + $len = strlen($prefix); + if(substr($this->headers['Subject'],0,$len) != $prefix){ + $this->headers['Subject'] = $prefix.' '.$this->headers['Subject']; + } + + // encode subject + if(defined('MAILHEADER_ASCIIONLY')){ + $this->headers['Subject'] = utf8_deaccent($this->headers['Subject']); + $this->headers['Subject'] = utf8_strip($this->headers['Subject']); + } + if(!utf8_isASCII($this->headers['Subject'])){ + $this->headers['Subject'] = '=?UTF-8?B?'.base64_encode($this->headers['Subject']).'?='; + } + } + + // wrap headers + foreach($this->headers as $key => $val){ + $this->headers[$key] = wordwrap($val,78,MAILHEADER_EOL.' '); + } + } + + /** + * Create a string from the headers array + * + * @returns string the headers + */ + protected function prepareHeaders(){ + $headers = ''; + foreach($this->headers as $key => $val){ + $headers .= "$key: $val".MAILHEADER_EOL; + } + return $headers; + } + + /** + * return a full email with all headers + * + * This is mainly intended for debugging and testing but could also be + * used for MHT exports + * + * @return string the mail, false on errors + */ + public function dump(){ + $this->cleanHeaders(); + $body = $this->prepareBody(); + if($body === 'false') return false; + $headers = $this->prepareHeaders(); + + return $headers.MAILHEADER_EOL.$body; + } + + /** + * Send the mail + * + * Call this after all data was set + * + * @triggers MAIL_MESSAGE_SEND + * @return bool true if the mail was successfully passed to the MTA + */ + public function send(){ + $success = false; + + // prepare hook data + $data = array( + // pass the whole mail class to plugin + 'mail' => $this, + // pass references for backward compatibility + 'to' => &$this->headers['To'], + 'cc' => &$this->headers['Cc'], + 'bcc' => &$this->headers['Bcc'], + 'from' => &$this->headers['From'], + 'subject' => &$this->headers['Subject'], + 'body' => &$this->text, + 'params' => &$this->sendparams, + 'headers' => '', // plugins shouldn't use this + // signal if we mailed successfully to AFTER event + 'success' => &$success, + ); + + // do our thing if BEFORE hook approves + $evt = new Doku_Event('MAIL_MESSAGE_SEND', $data); + if ($evt->advise_before(true)) { + // clean up before using the headers + $this->cleanHeaders(); + + // any recipients? + if(trim($this->headers['To']) === '' && + trim($this->headers['Cc']) === '' && + trim($this->headers['Bcc']) === '') return false; + + // The To: header is special + if(isset($this->headers['To'])){ + $to = $this->headers['To']; + unset($this->headers['To']); + }else{ + $to = ''; + } + + // so is the subject + if(isset($this->headers['Subject'])){ + $subject = $this->headers['Subject']; + unset($this->headers['Subject']); + }else{ + $subject = ''; + } + + // make the body + $body = $this->prepareBody(); + if($body === 'false') return false; + + // cook the headers + $headers = $this->prepareHeaders(); + // add any headers set by legacy plugins + if(trim($data['headers'])){ + $headers .= MAILHEADER_EOL.trim($data['headers']); + } + + // send the thing + if(is_null($this->sendparam)){ + $success = @mail($to,$subject,$body,$headers); + }else{ + $success = @mail($to,$subject,$body,$headers,$this->sendparam); + } + } + // any AFTER actions? + $evt->advise_after(); + return $success; + } +} diff --git a/inc/PassHash.class.php b/inc/PassHash.class.php index 3fb1349d2..d825057f0 100644 --- a/inc/PassHash.class.php +++ b/inc/PassHash.class.php @@ -316,6 +316,11 @@ class PassHash { * Uses salted MD5 hashs. Salt is 1+8 bytes long, 1st byte is the * iteration count when given, for null salts $compute is used. * + * The actual iteration count is the given count squared, maximum is + * 30 (-> 1073741824). If a higher one is given, the function throws + * an exception. + * + * @link http://www.openwall.com/phpass/ * @param string $clear - the clear text to hash * @param string $salt - the salt to use, null for random * @param string $magic - the hash identifier (P or H) @@ -330,6 +335,12 @@ class PassHash { } $iterc = $salt[0]; // pos 0 of salt is iteration count $iter = strpos($itoa64,$iterc); + + if($iter > 30){ + throw new Exception("Too high iteration count ($iter) in ". + __class__.'::'.__function__); + } + $iter = 1 << $iter; $salt = substr($salt,1,8); diff --git a/inc/auth.php b/inc/auth.php index 59ef1cb54..ed0e2dcf7 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -669,22 +669,17 @@ function auth_sendPassword($user,$password){ if(!$userinfo['mail']) return false; $text = rawLocale('password'); - $text = str_replace('@DOKUWIKIURL@',DOKU_URL,$text); - $text = str_replace('@FULLNAME@',$userinfo['name'],$text); - $text = str_replace('@LOGIN@',$user,$text); - $text = str_replace('@PASSWORD@',$password,$text); - $text = str_replace('@TITLE@',$conf['title'],$text); - - if(empty($conf['mailprefix'])) { - $subject = $lang['regpwmail']; - } else { - $subject = '['.$conf['mailprefix'].'] '.$lang['regpwmail']; - } + $trep = array( + 'FULLNAME' => $userinfo['name'], + 'LOGIN' => $user, + 'PASSWORD' => $password + ); - return mail_send($userinfo['name'].' <'.$userinfo['mail'].'>', - $subject, - $text, - $conf['mailfrom']); + $mail = new Mailer(); + $mail->to($userinfo['name'].' <'.$userinfo['mail'].'>'); + $mail->subject($lang['regpwmail']); + $mail->setBody($text,$trep); + return $mail->send(); } /** @@ -941,22 +936,17 @@ function act_resendpwd(){ io_saveFile($tfile,$user); $text = rawLocale('pwconfirm'); - $text = str_replace('@DOKUWIKIURL@',DOKU_URL,$text); - $text = str_replace('@FULLNAME@',$userinfo['name'],$text); - $text = str_replace('@LOGIN@',$user,$text); - $text = str_replace('@TITLE@',$conf['title'],$text); - $text = str_replace('@CONFIRM@',$url,$text); - - if(empty($conf['mailprefix'])) { - $subject = $lang['regpwmail']; - } else { - $subject = '['.$conf['mailprefix'].'] '.$lang['regpwmail']; - } + $trep = array( + 'FULLNAME' => $userinfo['name'], + 'LOGIN' => $user, + 'CONFIRM' => $url + ); - if(mail_send($userinfo['name'].' <'.$userinfo['mail'].'>', - $subject, - $text, - $conf['mailfrom'])){ + $mail = new Mailer(); + $mail->to($userinfo['name'].' <'.$userinfo['mail'].'>'); + $mail->subject($lang['regpwmail']); + $mail->setBody($text,$trep); + if($mail->send()){ msg($lang['resendpwdconfirm'],1); }else{ msg($lang['regmailfail'],-1); diff --git a/inc/common.php b/inc/common.php index 0a75f2eab..6ea536c44 100644 --- a/inc/common.php +++ b/inc/common.php @@ -676,10 +676,15 @@ function clientismobile(){ /** * Convert one or more comma separated IPs to hostnames * + * If $conf['dnslookups'] is disabled it simply returns the input string + * * @author Glen Harris <astfgl@iamnota.org> * @returns a comma separated list of hostnames */ function gethostsbyaddrs($ips){ + global $conf; + if(!$conf['dnslookups']) return $ips; + $hosts = array(); $ips = explode(',',$ips); @@ -789,8 +794,8 @@ function formText($text){ * * @author Andreas Gohr <andi@splitbrain.org> */ -function rawLocale($id){ - return io_readFile(localeFN($id)); +function rawLocale($id,$ext='txt'){ + return io_readFile(localeFN($id,$ext)); } /** @@ -1086,8 +1091,9 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ global $lang; global $conf; global $INFO; + global $DIFF_INLINESTYLES; - // decide if there is something to do + // decide if there is something to do, eg. whom to mail if($who == 'admin'){ if(empty($conf['notify'])) return; //notify enabled? $text = rawLocale('mailtext'); @@ -1112,49 +1118,54 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ return; //just to be safe } - $ip = clientIP(); - $text = str_replace('@DATE@',dformat(),$text); - $text = str_replace('@BROWSER@',$_SERVER['HTTP_USER_AGENT'],$text); - $text = str_replace('@IPADDRESS@',$ip,$text); - $text = str_replace('@HOSTNAME@',gethostsbyaddrs($ip),$text); - $text = str_replace('@NEWPAGE@',wl($id,'',true,'&'),$text); - $text = str_replace('@PAGE@',$id,$text); - $text = str_replace('@TITLE@',$conf['title'],$text); - $text = str_replace('@DOKUWIKIURL@',DOKU_URL,$text); - $text = str_replace('@SUMMARY@',$summary,$text); - $text = str_replace('@USER@',$_SERVER['REMOTE_USER'],$text); - $text = str_replace('@NAME@',$INFO['userinfo']['name'],$text); - $text = str_replace('@MAIL@',$INFO['userinfo']['mail'],$text); - - foreach ($replace as $key => $substitution) { - $text = str_replace('@'.strtoupper($key).'@',$substitution, $text); - } + // prepare replacements (keys not set in hrep will be taken from trep) + $trep = array( + 'NEWPAGE' => wl($id,'',true,'&'), + 'PAGE' => $id, + 'SUMMARY' => $summary + ); + $trep = array_merge($trep,$replace); + $hrep = array(); + // prepare content if($who == 'register'){ - $subject = $lang['mail_new_user'].' '.$summary; + $subject = $lang['mail_new_user'].' '.$summary; }elseif($rev){ - $subject = $lang['mail_changed'].' '.$id; - $text = str_replace('@OLDPAGE@',wl($id,"rev=$rev",true,'&'),$text); - $df = new Diff(explode("\n",rawWiki($id,$rev)), - explode("\n",rawWiki($id))); - $dformat = new UnifiedDiffFormatter(); - $diff = $dformat->format($df); + $subject = $lang['mail_changed'].' '.$id; + $trep['OLDPAGE'] = wl($id,"rev=$rev",true,'&'); + $df = new Diff(explode("\n",rawWiki($id,$rev)), + explode("\n",rawWiki($id))); + $dformat = new UnifiedDiffFormatter(); + $tdiff = $dformat->format($df); + + $DIFF_INLINESTYLES = true; + $dformat = new InlineDiffFormatter(); + $hdiff = $dformat->format($df); + $hdiff = '<table>'.$hdiff.'</table>'; + $DIFF_INLINESTYLES = false; }else{ - $subject=$lang['mail_newpage'].' '.$id; - $text = str_replace('@OLDPAGE@','none',$text); - $diff = rawWiki($id); - } - $text = str_replace('@DIFF@',$diff,$text); - if(empty($conf['mailprefix'])) { - if(utf8_strlen($conf['title']) < 20) { - $subject = '['.$conf['title'].'] '.$subject; - }else{ - $subject = '['.utf8_substr($conf['title'], 0, 20).'...] '.$subject; - } - }else{ - $subject = '['.$conf['mailprefix'].'] '.$subject; - } - mail_send($to,$subject,$text,$conf['mailfrom'],'',$bcc); + $subject = $lang['mail_newpage'].' '.$id; + $trep['OLDPAGE'] = '---'; + $tdiff = rawWiki($id); + $hdiff = nl2br(hsc($tdiff)); + } + $trep['DIFF'] = $tdiff; + $hrep['DIFF'] = $hdiff; + + // send mail + $mail = new Mailer(); + $mail->to($to); + $mail->bcc($bcc); + $mail->subject($subject); + $mail->setBody($text,$trep,$hrep); + if($who == 'subscribers'){ + $mail->setHeader( + 'List-Unsubscribe', + '<'.wl($id,array('do'=>'subscribe'),true,'&').'>', + false + ); + } + return $mail->send(); } /** diff --git a/inc/config_cascade.php b/inc/config_cascade.php index 79567fc56..e4a3df353 100644 --- a/inc/config_cascade.php +++ b/inc/config_cascade.php @@ -66,6 +66,7 @@ $config_cascade = array_merge( ), 'plugins' => array( + 'default' => array(DOKU_CONF.'plugins.php'), 'local' => array(DOKU_CONF.'plugins.local.php'), 'protected' => array( DOKU_CONF.'plugins.required.php', diff --git a/inc/events.php b/inc/events.php index 621cb64c1..09f3f3c0c 100644 --- a/inc/events.php +++ b/inc/events.php @@ -149,8 +149,8 @@ class Doku_Event_Handler { * @param $method (function) event handler function * @param $param (mixed) data passed to the event handler */ - function register_hook($event, $advise, &$obj, $method, $param=null) { - $this->_hooks[$event.'_'.$advise][] = array(&$obj, $method, $param); + function register_hook($event, $advise, $obj, $method, $param=null) { + $this->_hooks[$event.'_'.$advise][] = array($obj, $method, $param); } function process_event(&$event,$advise='') { diff --git a/inc/fulltext.php b/inc/fulltext.php index 620237296..8f4db111d 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -405,6 +405,8 @@ function ft_snippet_re_preprocess($term) { }else{ $term = $term.'\b'; } + + if($term == '\b' || $term == '\b\b') $term = ''; return $term; } diff --git a/inc/html.php b/inc/html.php index 022cd792a..be5666353 100644 --- a/inc/html.php +++ b/inc/html.php @@ -280,8 +280,11 @@ function html_draft(){ * @author Harry Fuecks <hfuecks@gmail.com> */ function html_hilight($html,$phrases){ - $phrases = array_filter((array) $phrases); - $regex = join('|',array_map('ft_snippet_re_preprocess', array_map('preg_quote_cb',$phrases))); + $phrases = (array) $phrases; + $phrases = array_map('preg_quote_cb', $phrases); + $phrases = array_map('ft_snippet_re_preprocess', $phrases); + $phrases = array_filter($phrases); + $regex = join('|',$phrases); if ($regex === '') return $html; if (!utf8_check($regex)) return $html; diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php index 2ba220e64..c1fc543fb 100644 --- a/inc/lang/en/lang.php +++ b/inc/lang/en/lang.php @@ -99,6 +99,7 @@ $lang['searchmedia_in'] = 'Search in %s'; $lang['txt_upload'] = 'Select file to upload'; $lang['txt_filename'] = 'Upload as (optional)'; $lang['txt_overwrt'] = 'Overwrite existing file'; +$lang['maxuploadsize'] = 'Upload max. %s per file.'; $lang['lockedby'] = 'Currently locked by'; $lang['lockexpire'] = 'Lock expires at'; diff --git a/inc/lang/en/mailwrap.html b/inc/lang/en/mailwrap.html new file mode 100644 index 000000000..f9f80fd80 --- /dev/null +++ b/inc/lang/en/mailwrap.html @@ -0,0 +1,13 @@ +<html> +<head> + <title>@TITLE@</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +</head> +<body> + +@HTMLBODY@ + +<br /><hr /> +<small>This mail was generated by DokuWiki at @DOKUWIKIURL@.</small> +</body> +</html> diff --git a/inc/lang/en/subscr_digest.txt b/inc/lang/en/subscr_digest.txt index fac8564bd..35011b6e6 100644 --- a/inc/lang/en/subscr_digest.txt +++ b/inc/lang/en/subscr_digest.txt @@ -15,6 +15,6 @@ To cancel the page notifications, log into the wiki at @SUBSCRIBE@ and unsubscribe page and/or namespace changes. --- +-- This mail was generated by DokuWiki at @DOKUWIKIURL@ diff --git a/inc/lang/en/subscr_list.txt b/inc/lang/en/subscr_list.txt index efe27d866..4c38b9326 100644 --- a/inc/lang/en/subscr_list.txt +++ b/inc/lang/en/subscr_list.txt @@ -12,6 +12,6 @@ To cancel the page notifications, log into the wiki at @SUBSCRIBE@ and unsubscribe page and/or namespace changes. --- +-- This mail was generated by DokuWiki at @DOKUWIKIURL@ diff --git a/inc/lang/en/subscr_single.txt b/inc/lang/en/subscr_single.txt index f2abe6d77..673c4c32a 100644 --- a/inc/lang/en/subscr_single.txt +++ b/inc/lang/en/subscr_single.txt @@ -18,6 +18,6 @@ To cancel the page notifications, log into the wiki at @NEWPAGE@ and unsubscribe page and/or namespace changes. --- +-- This mail was generated by DokuWiki at @DOKUWIKIURL@ diff --git a/inc/lang/eo/conflict.txt b/inc/lang/eo/conflict.txt index 603af39e1..cd0192942 100644 --- a/inc/lang/eo/conflict.txt +++ b/inc/lang/eo/conflict.txt @@ -1,5 +1,5 @@ ====== Pli nova versio ekzistas ====== -Ekzistas pli nova versio de la dokumento. Tio okazas kiam iu alia uzanto ŝanĝigis enhavon de la dokumento dum vi redaktis ĝin. +Ekzistas pli nova versio de la dokumento. Tio okazas kiam iu alia uzanto ŝanĝis enhavon de la dokumento dum vi redaktis ĝin. -Atente esploru distingojn kaj decidu kiun version vi tenigos. Se vi premos '"Konservi'", do via versio estos konservita. Presonte butonon '"Rezigni" vi tenos la kurantan version. +Atente esploru distingojn kaj decidu kiun version vi tenos. Se vi premos '"Konservi'", do via versio estos konservita. Presonte butonon '"Rezigni" vi tenos la kurantan version. diff --git a/inc/lang/eo/denied.txt b/inc/lang/eo/denied.txt index b35fe0412..3cd6c76bf 100644 --- a/inc/lang/eo/denied.txt +++ b/inc/lang/eo/denied.txt @@ -1,4 +1,4 @@ ====== Aliro malpermesita ====== -Vi ne havas sufiĉe da rajtoj por rigardi ĉi tiujn paĝojn. Eble vi forgesis identiĝi. +Vi ne havas sufiĉajn rajtojn rigardi ĉi tiujn paĝojn. Eble vi forgesis identiĝi. diff --git a/inc/lang/eo/diff.txt b/inc/lang/eo/diff.txt index ac5474ef1..5829a7db1 100644 --- a/inc/lang/eo/diff.txt +++ b/inc/lang/eo/diff.txt @@ -1,4 +1,4 @@ ====== Diferencoj ====== -Ĉi tie vi povas ekvidi diferencojn inter la aktuala versio kaj la elektita revizio de la paĝo. +Ĉi tie vi povas vidi diferencojn inter la aktuala versio kaj la elektita revizio de la paĝo. diff --git a/inc/lang/eo/draft.txt b/inc/lang/eo/draft.txt index fa43ecb74..32ddc83f6 100644 --- a/inc/lang/eo/draft.txt +++ b/inc/lang/eo/draft.txt @@ -1,5 +1,5 @@ -====== Skiza dosiero estis trovata ====== +====== Skiza dosiero troviĝis ====== -Via lasta sekcio de redakto en tiu ĉi paĝo ne estis korekte kompletita. DokuWiki aŭtomate konservis skizon dum vi laboris, kiun vi nun povas uzi por daŭrigi vian redaktadon. Sube vi povas vidi la datenaron, kiu estis konservata el via lasta sekcio. +Via lasta sekcio de redakto en tiu ĉi paĝo ne korekte kompletiĝis. DokuWiki aŭtomate konservis skizon dum vi laboris, kiun vi nun povas uzi por daŭrigi vian redaktadon. Sube vi povas vidi la datumaron, kiu konserviĝis el via lasta sekcio. Bonvolu decidi ĉu vi volas //restarigi// vian perditan redakton, //forigi// la aŭtomate konservitan skizon aŭ //rezigni// pri la redakta procezo. diff --git a/inc/lang/eo/edit.txt b/inc/lang/eo/edit.txt index 9239c7fe6..29b3382c5 100644 --- a/inc/lang/eo/edit.txt +++ b/inc/lang/eo/edit.txt @@ -1 +1 @@ -Redaktu paĝon kaj poste premu butonon titolitan '"Konservi'". Bonvolu tralegi la [[vikio:sintakso|vikian sintakson]] por kompreni kiel vi povas krei paĝojn. Bonvolu redakti nur se vi planas **plibonigi** la enhavon de la paĝo. Se vi volas nur testi ion, do bonvolu uzi specialan paĝon: [[vikio:ludejo|ludejo]]. +Redaktu paĝon kaj poste premu butonon titolitan '"Konservi'". Bonvolu tralegi la [[wiki:syntax|vikian sintakson]] por kompreni kiel vi povas krei paĝojn. Bonvolu redakti nur se vi planas **plibonigi** la enhavon de la paĝo. Se vi volas nur testi ion, bonvolu uzi specialan paĝon: [[wiki:playground|ludejo]]. diff --git a/inc/lang/eo/editrev.txt b/inc/lang/eo/editrev.txt index 4bab50b93..1640baa91 100644 --- a/inc/lang/eo/editrev.txt +++ b/inc/lang/eo/editrev.txt @@ -1,2 +1,2 @@ -**Vi laboras kun malnova revizio de la dokumento!** Se vi konservos ĝin, tiel kreiĝos nova kuranta versio kun la sama enhavo. +**Vi laboras kun malnova revizio de la dokumento!** Se vi konservos ĝin, kreiĝos nova kuranta versio kun la sama enhavo. ---- diff --git a/inc/lang/eo/index.txt b/inc/lang/eo/index.txt index 4ef720cb2..ac1f32cba 100644 --- a/inc/lang/eo/index.txt +++ b/inc/lang/eo/index.txt @@ -1,3 +1,3 @@ ====== Enhavo ====== -Tio ĉi estas indekso pri ĉiuj disponeblaj paĝoj ordigitaj laŭ [[doku>namespaces|nomspacoj]].
\ No newline at end of file +Tio ĉi estas indekso pri ĉiuj disponeblaj paĝoj ordigitaj laŭ [[doku>namespaces|nomspacoj]]. diff --git a/inc/lang/eo/install.html b/inc/lang/eo/install.html index 9f43ae82e..2e741e7c2 100644 --- a/inc/lang/eo/install.html +++ b/inc/lang/eo/install.html @@ -1,9 +1,9 @@ -<p>Tiu ĉi paĝo helpas en la unua instalo kaj agordado de <a href="http://dokuwiki.org">DokuWiki</a>. Pli da informo pri tiu instalilo estas disponebla en ĝia propra <a href="http://dokuwiki.org/installer">dokumentada paĝo</a>.</p> +<p>Tiu ĉi paĝo helpas en la unua instalo kaj agordado de <a href="http://dokuwiki.org">DokuWiki</a>. Pli da informo pri tiu instalilo disponeblas en ĝia propra <a href="http://dokuwiki.org/installer">dokumentada paĝo</a>.</p> -<p>DokuWiki uzas ordinarajn dosierojn por konservi vikiajn paĝojn kaj aliajn informojn asociitaj al tiuj paĝoj (ekz. bildoj, serĉindeksoj, malnovaj revizioj, ktp). Por bone funkcii, DokuWiki <strong>devas</strong> havi registran rajton sur la subdosierujoj, kiuj entenas tiujn dosierojn. Tiu ĉi instalilo ne kapablas difini permes-atributojn de dosierujoj. Ordinare, tio devas esti senpere farita de iu komando en konzolo aŭ, se vi abonas retprovizanton, per FTP aŭ kontrola panelo de tiu retprovidanto (ekz. cPanel).</p> +<p>DokuWiki uzas ordinarajn dosierojn por konservi vikiajn paĝojn kaj aliajn informojn asociitaj al tiuj paĝoj (ekz. bildoj, serĉindeksoj, malnovaj revizioj, ktp). Por bone funkcii, DokuWiki <strong>devas</strong> havi registran rajton sur la subdosierujoj, kiuj entenas tiujn dosierojn. Tiu ĉi instalilo ne kapablas difini permes-atributojn de dosierujoj. Ordinare, tio devas esti senpere farita de iu komando en konzolo aŭ, se vi abonas retprovizanton, per FTP aŭ kontrola panelo de tiu retprovidanto (ekz. cPanel).</p> -<p>Tiu ĉi instalilo difinos vian DokuWiki-an agordadon por <acronym title="alir-kontrola listo">ACL</acronym>, kiu ebligas al administranto identiĝi kaj aliri taŭgan interfacon por instali kromaĵojn, administri uzantojn kaj alireblon al vikipaĝoj, kaj difini agordojn ĝeneralajn. -Ĝi ne estas nepra por ke DokuWiki funkciu, tamen ĝi multe faciligos administradon.</p> +<p>Tiu ĉi instalilo difinos vian DokuWiki-an agordadon por <acronym title="alir-kontrola listo">ACL</acronym>, kiu ebligas al administranto identiĝi kaj aliri taŭgan interfacon por instali kromaĵojn, administri uzantojn kaj alireblon al vikipaĝoj, kaj difini agordojn ĝeneralajn. +Ĝi ne estas nepra por ke DokuWiki funkciu, tamen ĝi multe faciligos administradon.</p> -<p>Spertuloj aŭ uzantoj kiuj bezonas specialajn agordrimedojn devus uzi tiujn ligilojn por havi pli detalojn pri <a href="http://dokuwiki.org/install">instaladaj instrukcioj</a> -kaj <a href="http://dokuwiki.org/config">agordadaj difinoj</a>.</p>
\ No newline at end of file +<p>Spertuloj aŭ uzantoj kiuj bezonas specialajn agordrimedojn uzu tiujn ligilojn por havi pli detalojn pri <a href="http://dokuwiki.org/install">instaladaj instrukcioj</a> +kaj <a href="http://dokuwiki.org/config">agordadaj difinoj</a>.</p> diff --git a/inc/lang/eo/lang.php b/inc/lang/eo/lang.php index 41c6b80d1..b2c64b2a6 100644 --- a/inc/lang/eo/lang.php +++ b/inc/lang/eo/lang.php @@ -9,7 +9,7 @@ * @author Felipe Castro <fefcas@gmail.com> * @author Robert Bogenschneider <robog@gmx.de> * @author Erik Pedersen <erik.pedersen@shaw.ca> - * @author Robert BOGENSCHNEIDER <bogi@UEA.org> + * @author Robert Bogenschneider <bogi@uea.org> */ $lang['encoding'] = 'utf-8'; $lang['direction'] = 'ltr'; @@ -45,6 +45,7 @@ $lang['btn_backtomedia'] = 'Retroiri al elekto de dosiero'; $lang['btn_subscribe'] = 'Aliĝi al paĝaj modifoj'; $lang['btn_profile'] = 'Ĝisdatigi profilon'; $lang['btn_reset'] = 'Rekomenci'; +$lang['btn_resendpwd'] = 'Sendi novan pasvorton'; $lang['btn_draft'] = 'Redakti skizon'; $lang['btn_recover'] = 'Restarigi skizon'; $lang['btn_draftdel'] = 'Forigi skizon'; @@ -68,38 +69,39 @@ $lang['draftdate'] = 'Lasta konservo de la skizo:'; $lang['nosecedit'] = 'La paĝo ŝanĝiĝis intertempe, sekcio-informo estis malĝisdata, tial la tuta paĝo estas reŝargita.'; $lang['regmissing'] = 'Pardonu, vi devas plenigi ĉiujn kampojn.'; $lang['reguexists'] = 'Pardonu, ĉi tiu uzanto-nomo jam ekzistas.'; -$lang['regsuccess'] = 'La uzanto estas kreita kaj la pasvorto estis elsendita per retpoŝto.'; -$lang['regsuccess2'] = 'La uzanto estas kreita.'; +$lang['regsuccess'] = 'La uzanto kreiĝis kaj la pasvorto sendiĝis per retpoŝto.'; +$lang['regsuccess2'] = 'La uzanto kreiĝis.'; $lang['regmailfail'] = 'Ŝajne okazis eraro dum elsendo de la pasvorto. Bonvolu informi administranton pri tio!'; -$lang['regbadmail'] = 'Entajpita retpoŝta adreso ne ŝajnas valida. Se vi pensas, ke tio estas eraro, kontaktu la administranton.'; +$lang['regbadmail'] = 'Entajpita retpoŝta adreso ŝajnas ne valida. Se vi pensas, ke tio estas eraro, kontaktu la administranton.'; $lang['regbadpass'] = 'La du pasvortoj ne samas, bonvolu provi refoje.'; $lang['regpwmail'] = 'Via DokuWiki-pasvorto'; $lang['reghere'] = 'Se vi ne havas konton, vi povas akiri ĝin'; $lang['profna'] = 'Tiu ĉi vikio ne ebligas modifon en la profiloj.'; $lang['profnochange'] = 'Neniu ŝanĝo, nenio farinda.'; -$lang['profnoempty'] = 'Malplena nomo aŭ retadreso ne estas permesataj.'; -$lang['profchanged'] = 'La profilo de la uzanto estas sukcese ĝisdatigita.'; +$lang['profnoempty'] = 'Malplena nomo aŭ retadreso ne estas permesata.'; +$lang['profchanged'] = 'La profilo de la uzanto sukcese ĝisdatiĝis.'; $lang['pwdforget'] = 'Ĉu vi forgesis vian pasvorton? Prenu novan'; $lang['resendna'] = 'Tiu ĉi vikio ne ebligas resendon de la pasvortoj.'; +$lang['resendpwd'] = 'Sendi novan pasvorton al'; $lang['resendpwdmissing'] = 'Pardonu, vi devas plenigi ĉiujn kampojn.'; -$lang['resendpwdnouser'] = 'Pardonu, ni ne trovas tiun uzanton en nia datenbazo.'; +$lang['resendpwdnouser'] = 'Pardonu, tiu uzanto ne troveblas en nia datumbazo.'; $lang['resendpwdbadauth'] = 'Pardonu, tiu aŭtentiga kodo ne validas. Certiĝu, ke vi uzis la kompletan konfirmigan ligilon.'; -$lang['resendpwdconfirm'] = 'Konfirmiga ligilo estas sendita per retpoŝto.'; -$lang['resendpwdsuccess'] = 'Via nova pasvorto estas sendita per retpoŝto.'; +$lang['resendpwdconfirm'] = 'Konfirmiga ligilo sendiĝis per retpoŝto.'; +$lang['resendpwdsuccess'] = 'Via nova pasvorto sendiĝis per retpoŝto.'; $lang['license'] = 'Krom kie rekte indikite, enhavo de tiu ĉi vikio estas publikigita laŭ la jena permesilo:'; $lang['licenseok'] = 'Rimarku: redaktante tiun ĉi paĝon vi konsentas publikigi vian enhavon laŭ la jena permesilo:'; $lang['searchmedia'] = 'Serĉi dosiernomon:'; $lang['searchmedia_in'] = 'Serĉi en %s'; -$lang['txt_upload'] = 'Elektu dosieron por alŝuto'; +$lang['txt_upload'] = 'Elektu dosieron por alŝuti'; $lang['txt_filename'] = 'Alŝuti kiel (laŭvole)'; $lang['txt_overwrt'] = 'Anstataŭigi ekzistantan dosieron'; $lang['lockedby'] = 'Nune ŝlosita de'; $lang['lockexpire'] = 'Ŝlosado ĉesos en'; -$lang['js']['willexpire'] = 'Vi povos redakti ĉi tiun paĝon post unu minuto.\nSe vi volas nuligi tempkontrolon de la ŝlosado, do premu butonon "Antaŭrigardi".'; +$lang['js']['willexpire'] = 'Vi povos redakti ĉi tiun paĝon post unu minuto.\nSe vi volas nuligi tempokontrolon de la ŝlosado, premu la butonon "Antaŭrigardi".'; $lang['js']['notsavedyet'] = 'Ne konservitaj modifoj perdiĝos. Ĉu vi certe volas daŭrigi la procezon?'; $lang['js']['searchmedia'] = 'Serĉi dosierojn'; -$lang['js']['keepopen'] = 'Tenu la fenestron malfermata dum elekto'; +$lang['js']['keepopen'] = 'Tenu la fenestron malferma dum elekto'; $lang['js']['hidedetails'] = 'Kaŝi detalojn'; $lang['js']['mediatitle'] = 'Ligilaj agordoj'; $lang['js']['mediadisplay'] = 'Ligila tipo'; @@ -122,10 +124,10 @@ $lang['js']['medialeft'] = 'Meti la bildon maldekstren.'; $lang['js']['mediaright'] = 'Meti la bildon dekstren.'; $lang['js']['mediacenter'] = 'Meti la bildon mezen.'; $lang['js']['medianoalign'] = 'Ne uzi poziciigon.'; -$lang['js']['nosmblinks'] = 'Tio ĉi nur funkcias en la Vindozaĉa "Microsoft Internet Explorer".\nVi ankoraŭ povas kopii kaj almeti la ligilon.'; +$lang['js']['nosmblinks'] = 'Tio ĉi nur funkcias en "Microsoft Internet Explorer".\nVi ankoraŭ povas kopii kaj almeti la ligilon.'; $lang['js']['linkwiz'] = 'Ligil-Asistanto'; $lang['js']['linkto'] = 'Ligilo al:'; -$lang['js']['del_confirm'] = 'Ĉu vere forigi elektitajn ero(j)n?'; +$lang['js']['del_confirm'] = 'Ĉu vere forigi elektita(j)n ero(j)n?'; $lang['js']['restore_confirm'] = 'Ĉu vere restarigi ĉi tiun version?'; $lang['js']['media_diff'] = 'Rigardu la diferencojn:'; $lang['js']['media_diff_both'] = 'Flankon apud flanko'; @@ -141,27 +143,27 @@ $lang['rssfailed'] = 'Okazis eraro dum ricevado de la novaĵ-fluo: ' $lang['nothingfound'] = 'Ankoraŭ nenio troviĝas tie ĉi.'; $lang['mediaselect'] = 'Elekto de aŭdvidaĵa dosiero'; $lang['fileupload'] = 'Alŝuto de aŭdvidaĵa dosiero'; -$lang['uploadsucc'] = 'Alŝuto estis sukcesa'; -$lang['uploadfail'] = 'Alŝuto estis malsukcesa. Eble ĉu estas problemoj pro permes-atributoj?'; +$lang['uploadsucc'] = 'Alŝuto sukcesis'; +$lang['uploadfail'] = 'Alŝuto malsukcesis. Ĉu eble estas problemoj pro permes-atributoj?'; $lang['uploadwrong'] = 'Rifuzita alŝuto. Tiu ĉi dosiersufikso estas malpermesata!'; $lang['uploadexist'] = 'La dosiero jam ekzistas. Nenio estas farita.'; $lang['uploadbadcontent'] = 'La alŝutita enhavo ne kongruas al la sufikso %s.'; -$lang['uploadspam'] = 'La alŝutaĵo estis blokita de kontraŭspama vortlisto.'; -$lang['uploadxss'] = 'La alŝutajo estis blokita pro ebla malica enhavo.'; +$lang['uploadspam'] = 'La alŝutaĵo blokiĝis de kontraŭspama vortlisto.'; +$lang['uploadxss'] = 'La alŝutajo blokiĝis pro ebla malica enhavo.'; $lang['uploadsize'] = 'La alŝutita dosiero estis tro granda. (maks. %s)'; -$lang['deletesucc'] = 'La dosiero "%s" estas forigita.'; +$lang['deletesucc'] = 'La dosiero "%s" forigiĝis.'; $lang['deletefail'] = '"%s" ne povis esti forigita - kontrolu permes-atributojn.'; -$lang['mediainuse'] = 'La dosiero "%s" ne estis forigita - ĝi ankoraŭ estas uzata.'; +$lang['mediainuse'] = 'La dosiero "%s" ne forigiĝis - ĝi ankoraŭ estas uzata.'; $lang['namespaces'] = 'Nomspacoj'; $lang['mediafiles'] = 'Disponeblaj dosieroj'; $lang['accessdenied'] = 'Vi ne rajtas vidi tiun paĝon.'; -$lang['mediausage'] = 'Uzu la jenan sintakson por referenci tiun ĉi dosieron:'; +$lang['mediausage'] = 'Uzu jenan sintakson por referenci tiun ĉi dosieron:'; $lang['mediaview'] = 'Rigardi originalan dosieron'; $lang['mediaroot'] = 'ĉefo (root)'; -$lang['mediaupload'] = 'Alŝutu dosieron al la kuranta nomspaco tien ĉi. Por krei subnomspacojn, antaŭmetu ilin al via "Alŝuti kiel" dosiernomo, apartigante per dupunktoj (:).'; +$lang['mediaupload'] = 'Alŝutu dosieron al la kuranta nomspaco tien ĉi. Por krei subnomspacojn, antaŭmetu ilin al via "Alŝuti kiel" dosiernomo, disigigante per dupunktoj (:).'; $lang['mediaextchange'] = 'La dosiersufikso ŝanĝis de .%s al .%s!'; $lang['reference'] = 'Referencoj por'; -$lang['ref_inuse'] = 'La dosiero ne povas esti forigita, ĉar ĝi ankoraŭ estas uzata de la jenaj paĝoj:'; +$lang['ref_inuse'] = 'La dosiero ne povas esti forigita, ĉar ĝi ankoraŭ estas uzata de jenaj paĝoj:'; $lang['ref_hidden'] = 'Kelkaj referencoj estas en paĝoj, kiujn vi ne rajtas legi'; $lang['hits'] = 'Trafoj'; $lang['quickhits'] = 'Trafoj trovitaj en paĝnomoj'; @@ -184,8 +186,13 @@ $lang['created'] = 'kreita'; $lang['restored'] = 'malnova revizio restarigita'; $lang['external_edit'] = 'ekstera redakto'; $lang['summary'] = 'Bulteno de ŝanĝoj'; -$lang['noflash'] = 'La <a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a> estas bezonata por montrigi tiun ĉi enhavon.'; +$lang['noflash'] = 'La <a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a> necesas por montri tiun ĉi enhavon.'; $lang['download'] = 'Elŝuti eltiraĵon'; +$lang['tools'] = 'Iloj'; +$lang['user_tools'] = 'Uzantaj iloj'; +$lang['site_tools'] = 'Retejaj iloj'; +$lang['page_tools'] = 'Paĝaj iloj'; +$lang['skip_to_content'] = 'al la enhavo'; $lang['mail_newpage'] = 'paĝo aldonita:'; $lang['mail_changed'] = 'paĝo modifita:'; $lang['mail_subscribe_list'] = 'ŝanĝitaj paĝoj en nomspaco:'; @@ -221,10 +228,10 @@ $lang['qb_smileys'] = 'Ridetuloj'; $lang['qb_chars'] = 'Specialaj signaĵoj'; $lang['upperns'] = 'saltu al la parenca nomspaco'; $lang['admin_register'] = 'Aldoni novan uzanton'; -$lang['metaedit'] = 'Redakti metadatenaron'; -$lang['metasaveerr'] = 'La konservo de metadatenaro malsukcesis'; -$lang['metasaveok'] = 'La metadatenaro estis konservita'; -$lang['img_backto'] = 'Retroiri al'; +$lang['metaedit'] = 'Redakti metadatumaron'; +$lang['metasaveerr'] = 'La konservo de metadatumaro malsukcesis'; +$lang['metasaveok'] = 'La metadatumaro konserviĝis'; +$lang['img_backto'] = 'Iri reen al'; $lang['img_title'] = 'Titolo'; $lang['img_caption'] = 'Priskribo'; $lang['img_date'] = 'Dato'; @@ -237,7 +244,7 @@ $lang['img_camera'] = 'Kamerao'; $lang['img_keywords'] = 'Ŝlosilvortoj'; $lang['img_width'] = 'Larĝeco'; $lang['img_height'] = 'Alteco'; -$lang['img_manager'] = 'Rigardi en media-administrilo'; +$lang['img_manager'] = 'Rigardi en aŭdvidaĵ-administrilo'; $lang['subscr_subscribe_success'] = 'Aldonis %s al la abonlisto por %s'; $lang['subscr_subscribe_error'] = 'Eraro dum aldono de %s al la abonlisto por %s'; $lang['subscr_subscribe_noaddress'] = 'Ne estas adreso ligita al via ensaluto, ne eblas aldoni vin al la abonlisto'; @@ -271,7 +278,7 @@ $lang['i_confexists'] = '<code>%s</code> jam ekzistas'; $lang['i_writeerr'] = 'Ne eblas krei "<code>%s</code>". Vi bezonas kontroli la permesojn de la dosier(uj)oj kaj mem krej la dosieron.'; $lang['i_badhash'] = 'dokuwiki.php ne estas rekonebla aŭ ĝi estas modifita (hash=<code>%s</code>)'; $lang['i_badval'] = '<code>%s</code> - malvalida aŭ malplena valoro'; -$lang['i_success'] = 'La agordado estas sukcese kompletita. Vi povas forigi la dosieron nun. Pluiru al <a href="doku.php">via nova DokuWiki</a>.'; +$lang['i_success'] = 'La agordado sukcese kompletiĝis. Vi povas forigi la dosieron nun. Pluiru al <a href="doku.php">via nova DokuWiki</a>.'; $lang['i_failure'] = 'Kelkaj eraroj okazis dum la konservo de la agordaj dosieroj. Vi devas senpere korekti ilin antaŭ ol vi povos uzi <a href="doku.php">vian novan DokuWiki-on</a>. '; $lang['i_policy'] = 'Komenca ACL-a agordo'; $lang['i_pol0'] = 'Malferma Vikio (legi, skribi, alŝuti povas ĉiuj)'; @@ -287,7 +294,7 @@ $lang['days'] = 'antaŭ %d tagoj'; $lang['hours'] = 'antaŭ %d horoj'; $lang['minutes'] = 'antaŭ %d minutoj'; $lang['seconds'] = 'antaŭ %d sekundoj'; -$lang['wordblock'] = 'Via ŝanĝo ne estis savita, ĉar ĝi enhavas blokitan tekston (spamon).'; +$lang['wordblock'] = 'Via ŝanĝo ne konserviĝis, ĉar ĝi enhavas blokitan tekston (spamon).'; $lang['media_uploadtab'] = 'Alŝuto'; $lang['media_searchtab'] = 'Serĉo'; $lang['media_file'] = 'Dosiero'; diff --git a/inc/lang/eo/locked.txt b/inc/lang/eo/locked.txt index 68963da75..abdc05916 100644 --- a/inc/lang/eo/locked.txt +++ b/inc/lang/eo/locked.txt @@ -1,3 +1,3 @@ ====== La paĝo estas ŝlosita ====== -Tiu ĉi paĝo nun estas blokita pro redaktado de iu alia uzanto. Bonvole atendu ke ŝi/li finu redakti aŭ ke la ŝlosada tempolimo finiĝu. +Tiu ĉi paĝo nun blokiĝis pro redaktado de iu alia uzanto. Bonvolu atendi ke ŝi/li finu redakti aŭ ke la ŝlosada tempolimo finiĝu. diff --git a/inc/lang/eo/mailtext.txt b/inc/lang/eo/mailtext.txt index b2cb3b49d..2765301ea 100644 --- a/inc/lang/eo/mailtext.txt +++ b/inc/lang/eo/mailtext.txt @@ -1,4 +1,4 @@ -Paĝo en via DokuVikio estis ŝanĝita aŭ aldonita. Jen detaloj: +Paĝo en via DokuVikio ŝanĝiĝis aŭ aldoniĝis. Jen detaloj: Dato: @DATE@ Foliumilo: @BROWSER@ @@ -7,10 +7,9 @@ RetNodo: @HOSTNAME@ Antaŭa revizio: @OLDPAGE@ Nova revizio: @NEWPAGE@ Bulteno de ŝanĝoj: @SUMMARY@ -Uzulo: @USER@ +Uzanto: @USER@ @DIFF@ -- -Tiu ĉi mesaĝo estis kreita de DokuWiki, kiu lokiĝas tie: -@DOKUWIKIURL@
\ No newline at end of file +Tiu ĉi mesaĝo kreiĝis de DokuWiki, kiu lokiĝas ĉe @DOKUWIKIURL@ diff --git a/inc/lang/eo/newpage.txt b/inc/lang/eo/newpage.txt index 486f61f5a..53ab6209d 100644 --- a/inc/lang/eo/newpage.txt +++ b/inc/lang/eo/newpage.txt @@ -1,4 +1,4 @@ ====== Ĉi tiu paĝo ankoraŭ ne ekzistas ====== -Vi sekvis ligilon, kiu kondukas al artikolo ankoraŭ ne ekzistanta. Se vi rajtas, tiel vi povas krei tiun ĉi paĝon ekpremante la butonon "Krei paĝon". +Vi sekvis ligilon, kiu kondukas al artikolo ankoraŭ ne ekzistanta. Se vi rajtas, tiam vi povas krei tiun ĉi paĝon premante la butonon "Krei paĝon". diff --git a/inc/lang/eo/norev.txt b/inc/lang/eo/norev.txt index dc44d194b..e951a551b 100644 --- a/inc/lang/eo/norev.txt +++ b/inc/lang/eo/norev.txt @@ -1,3 +1,3 @@ ====== Tiu revizio ne ekzistas ====== -La elektita revizio ne ekzistas. Premu butonon "Malnovaj revizioj" por vidi liston de malnovaj revizioj de la dokumento.
\ No newline at end of file +La elektita revizio ne ekzistas. Premu butonon "Malnovaj revizioj" por vidi liston de malnovaj revizioj de la dokumento. diff --git a/inc/lang/eo/password.txt b/inc/lang/eo/password.txt index ef744059e..6dc42a9de 100644 --- a/inc/lang/eo/password.txt +++ b/inc/lang/eo/password.txt @@ -1,10 +1,9 @@ -Saluton @FULLNAME@! +Saluton, @FULLNAME@! -Jen via uzantodatenoj por @TITLE@ ĉe @DOKUWIKIURL@ +Jen viaj uzantodatumoj por @TITLE@ ĉe @DOKUWIKIURL@ Ensalutnomo: @LOGIN@ Pasvorto: @PASSWORD@ -- -Tiu ĉi mesaĝo estis kreita de DokuWiki ĉe -@DOKUWIKIURL@ +Tiu ĉi mesaĝo kreiĝis de DokuWiki ĉe @DOKUWIKIURL@ diff --git a/inc/lang/eo/preview.txt b/inc/lang/eo/preview.txt index ac2e75d00..b3faef69e 100644 --- a/inc/lang/eo/preview.txt +++ b/inc/lang/eo/preview.txt @@ -1,3 +1,3 @@ ====== Antaŭrigardo ====== -Tiu ĉi estas antaŭrigardo de redaktita teksto. Memoru: ĝi ankoraŭ **ne estas konservita**!
\ No newline at end of file +Tiu ĉi estas antaŭrigardo de redaktita teksto. Memoru: ĝi ankoraŭ **ne konserviĝis**! diff --git a/inc/lang/eo/pwconfirm.txt b/inc/lang/eo/pwconfirm.txt index f227752b1..5abc3d13e 100644 --- a/inc/lang/eo/pwconfirm.txt +++ b/inc/lang/eo/pwconfirm.txt @@ -1,14 +1,13 @@ -Saluton @FULLNAME@! +Saluton, @FULLNAME@! Iu petis novan pasvorton por via @TITLE@ ensalutnomo ĉe @DOKUWIKIURL@ -Se ne estas vi, kiu petis tion, do preterlasu tiun ĉi mesaĝon. +Se ne vi petis tion, ignoru tiun ĉi mesaĝon. -Por konfirmi, ke la peto estis vere via, bonvolu musklaki la jenan ligilon. +Por konfirmi, ke la peto estis vere via, bonvolu musklaki jenan ligilon: @CONFIRM@ -- -Tiu ĉi mesaĝo estis kreita de DokuWiki ĉe -@DOKUWIKIURL@
\ No newline at end of file +Tiu ĉi mesaĝo kreiĝis de DokuWiki ĉe @DOKUWIKIURL@ diff --git a/inc/lang/eo/read.txt b/inc/lang/eo/read.txt index 734eb1654..b8c642f43 100644 --- a/inc/lang/eo/read.txt +++ b/inc/lang/eo/read.txt @@ -1,2 +1,2 @@ -Tiu ĉi paĝo estas disponigata nur por legado (vi ne povas redakti ĝin). Sciigu administranton, se vi opinias ke tio estas ne ĝusta malpermeso. +Tiu ĉi paĝo disponiĝas nur por legado (vi ne povas redakti ĝin). Sciigu administranton, se vi opinias ke tio estas falsa malpermeso. diff --git a/inc/lang/eo/recent.txt b/inc/lang/eo/recent.txt index ffd9936e2..2454ea630 100644 --- a/inc/lang/eo/recent.txt +++ b/inc/lang/eo/recent.txt @@ -1,3 +1,3 @@ ====== Freŝaj Ŝanĝoj ====== -La jenaj paĝoj estis ŝanĝitaj antaŭ nelonga tempo.
\ No newline at end of file +Jenaj paĝoj ŝanĝiĝis antaŭ nelonge: diff --git a/inc/lang/eo/register.txt b/inc/lang/eo/register.txt index 57d5ca1f4..10b303d3b 100644 --- a/inc/lang/eo/register.txt +++ b/inc/lang/eo/register.txt @@ -1,4 +1,4 @@ ====== Registriĝi ====== -Entajpu necesajn informojn por enregistriĝi. Certiĝu ke via retpoŝta adreso estas vera ĉar ni sendos al ĝi vian pasvorton. +Entajpu necesajn informojn por enregistriĝi. Certiĝu ke via retpoŝta adreso estas vera, ĉar ni sendos al ĝi vian pasvorton. diff --git a/inc/lang/eo/registermail.txt b/inc/lang/eo/registermail.txt index 8b9ea8501..9ef6013c0 100644 --- a/inc/lang/eo/registermail.txt +++ b/inc/lang/eo/registermail.txt @@ -1,4 +1,4 @@ -Nova uzanto estis registrata. Jen la detaloj: +Nova uzanto registriĝis. Jen la detaloj: Uzantonomo: @NEWUSER@ Kompleta nomo: @NEWNAME@ @@ -10,5 +10,4 @@ IP-Adreso: @IPADDRESS@ Provizanto: @HOSTNAME@ -- -Tiu ĉi mesaĝo estis kreita de DokuWiki ĉe -@DOKUWIKIURL@
\ No newline at end of file +Tiu ĉi mesaĝo kreiĝis de DokuWiki ĉe @DOKUWIKIURL@ diff --git a/inc/lang/eo/resendpwd.txt b/inc/lang/eo/resendpwd.txt index 57b4b0408..556477a07 100644 --- a/inc/lang/eo/resendpwd.txt +++ b/inc/lang/eo/resendpwd.txt @@ -1,3 +1,3 @@ ====== Sendi novan pasvorton ====== -Bonvolu meti vian uzantonomon en la suban formularon petante novan pasvorton por via aliĝo en tiu ĉi vikio. Konfirma ligilo estos sendata al via registrita retadreso. +Bonvolu meti vian uzantonomon en la suban formularon petante novan pasvorton por via aliĝo en tiu ĉi vikio. Konfirma ligilo sendaiĝos al via registrita retadreso. diff --git a/inc/lang/eo/showrev.txt b/inc/lang/eo/showrev.txt index e3a8a1747..3ece4f2fb 100644 --- a/inc/lang/eo/showrev.txt +++ b/inc/lang/eo/showrev.txt @@ -1,2 +1,2 @@ -**Tiu estas malnova revizio de la dokumento**. Klaku sur titolo por ricevi kurantan version. +**Tiu estas malnova revizio de la dokumento**. Klaku sur titolon por ricevi kurantan version. ---- diff --git a/inc/lang/eo/stopwords.txt b/inc/lang/eo/stopwords.txt index 38757ae04..d27c569a2 100644 --- a/inc/lang/eo/stopwords.txt +++ b/inc/lang/eo/stopwords.txt @@ -1,6 +1,6 @@ # Jen listo de vortoj, kiujn la indeksilo ignoras, unu vorton po linio # Kiam vi modifas la dosieron, estu certa ke vi uzas UNIX-stilajn linifinaĵojn (unuopa novlinio) -# Ne enmetu vortojn malpli longajn ol 3 literoj - tiuj ĉiukaze estas ignorataj +# Ne enmetu vortojn malpli longajn ol 3 literoj - tiuj ĉiukaze ignoriĝas pri estas kaj @@ -17,4 +17,4 @@ kio kiam kie kiu -www
\ No newline at end of file +www diff --git a/inc/lang/eo/subscr_digest.txt b/inc/lang/eo/subscr_digest.txt index d6bc69887..42fc79ad1 100644 --- a/inc/lang/eo/subscr_digest.txt +++ b/inc/lang/eo/subscr_digest.txt @@ -16,5 +16,4 @@ Por nuligi la paĝinformojn, ensalutu la vikion ĉe kaj malabonu la paĝajn kaj/aŭ nomspacajn ŝanĝojn. -- -Tiu retpoŝtaĵo kreiĝis de DokuWiki ĉe -@DOKUWIKIURL@
\ No newline at end of file +Tiu retpoŝtaĵo kreiĝis de DokuWiki ĉe @DOKUWIKIURL@ diff --git a/inc/lang/eo/subscr_list.txt b/inc/lang/eo/subscr_list.txt index 175e3f3d2..1957e85e0 100644 --- a/inc/lang/eo/subscr_list.txt +++ b/inc/lang/eo/subscr_list.txt @@ -13,5 +13,4 @@ Por nuligi la paĝinformojn, ensalutu la vikion ĉe kaj malabonu la paĝajn kaj/aŭ nomspacajn ŝanĝojn. -- -Tiu retpoŝtaĵo kreiĝis de DokuWiki ĉe -@DOKUWIKIURL@
\ No newline at end of file +Tiu retpoŝtaĵo kreiĝis de DokuWiki ĉe @DOKUWIKIURL@ diff --git a/inc/lang/eo/subscr_single.txt b/inc/lang/eo/subscr_single.txt index d51c5ca15..431fd0251 100644 --- a/inc/lang/eo/subscr_single.txt +++ b/inc/lang/eo/subscr_single.txt @@ -19,5 +19,4 @@ Por nuligi la paĝinformojn, ensalutu la vikion ĉe kaj malabonu la paĝajn kaj/aŭ nomspacajn ŝanĝojn. -- -Tiu retpoŝtaĵo kreiĝis de DokuWiki ĉe -@DOKUWIKIURL@
\ No newline at end of file +Tiu retpoŝtaĵo kreiĝis de DokuWiki ĉe @DOKUWIKIURL@ diff --git a/inc/lang/eo/updateprofile.txt b/inc/lang/eo/updateprofile.txt index a3de0c840..4b52ff20a 100644 --- a/inc/lang/eo/updateprofile.txt +++ b/inc/lang/eo/updateprofile.txt @@ -1,3 +1,3 @@ ====== Ĝisdatigi vian profilon ====== -Vi nur bezonas kompletigi tiujn kampojn, kiujn vi deziras ŝanĝi. Vi ne povas ŝanĝi vian uzantonomon.
\ No newline at end of file +Vi nur kompletigu tiujn kampojn, kiujn vi deziras ŝanĝi. Vi ne povas ŝanĝi vian uzantonomon. diff --git a/inc/lang/eo/uploadmail.txt b/inc/lang/eo/uploadmail.txt index e7c327a60..1cb48ade6 100644 --- a/inc/lang/eo/uploadmail.txt +++ b/inc/lang/eo/uploadmail.txt @@ -1,4 +1,4 @@ -Dosiero estis alŝutita al via DokuVikio. Jen detaloj: +Dosiero alŝutiĝis al via DokuVikio. Jen detaloj: Dosiero: @MEDIA@ Dato: @DATE@ @@ -10,5 +10,4 @@ Dosier-tipo: @MIME@ Uzanto: @USER@ -- -Tiu ĉi mesaĝo estis kreita de DokuWiki ĉe -@DOKUWIKIURL@
\ No newline at end of file +Tiu ĉi mesaĝo kreiĝis de DokuWiki ĉe @DOKUWIKIURL@ diff --git a/inc/lang/fr/lang.php b/inc/lang/fr/lang.php index 140c584c3..a77be6965 100644 --- a/inc/lang/fr/lang.php +++ b/inc/lang/fr/lang.php @@ -23,6 +23,7 @@ * @author Johan Guilbaud <guilbaud.johan@gmail.com> * @author schplurtz@laposte.net * @author skimpax@gmail.com + * @author Yannick Aure <yannick.aure@gmail.com> */ $lang['encoding'] = 'utf-8'; $lang['direction'] = 'ltr'; @@ -58,6 +59,7 @@ $lang['btn_backtomedia'] = 'Retour à la sélection du fichier média'; $lang['btn_subscribe'] = 'S\'abonner à la page'; $lang['btn_profile'] = 'Mettre à jour le profil'; $lang['btn_reset'] = 'Réinitialiser'; +$lang['btn_resendpwd'] = 'Définir un nouveau mot de passe'; $lang['btn_draft'] = 'Modifier le brouillon'; $lang['btn_recover'] = 'Récupérer le brouillon'; $lang['btn_draftdel'] = 'Effacer le brouillon'; @@ -94,6 +96,7 @@ $lang['profnoempty'] = 'Un nom ou une adresse de courriel vide n\'est $lang['profchanged'] = 'Mise à jour du profil réussie.'; $lang['pwdforget'] = 'Mot de passe oublié ? Faites-vous envoyer votre mot de passe '; $lang['resendna'] = 'Ce wiki ne permet pas le renvoi de mot de passe.'; +$lang['resendpwd'] = 'Définir un nouveau mot de passe pour'; $lang['resendpwdmissing'] = 'Désolé, vous devez remplir tous les champs.'; $lang['resendpwdnouser'] = 'Désolé, cet utilisateur est introuvable dans notre base.'; $lang['resendpwdbadauth'] = 'Désolé, ce code d\'authentification est invalide. Assurez-vous d\'avoir utilisé le lien de confirmation.'; @@ -198,6 +201,11 @@ $lang['external_edit'] = 'modification externe'; $lang['summary'] = 'Résumé'; $lang['noflash'] = 'Le greffon <a href="http://www.adobe.com/products/flashplayer/">Adobe Flash</a> est nécessaire pour afficher ce contenu.'; $lang['download'] = 'Télécharger un extrait'; +$lang['tools'] = 'Outils'; +$lang['user_tools'] = 'Outils d\'utilisateurs'; +$lang['site_tools'] = 'Outils du Site'; +$lang['page_tools'] = 'Outils de la Page'; +$lang['skip_to_content'] = 'Aller au contenu'; $lang['mail_newpage'] = 'page ajoutée :'; $lang['mail_changed'] = 'page modifiée :'; $lang['mail_subscribe_list'] = 'pages modifiées dans la catégorie :'; @@ -268,6 +276,7 @@ $lang['subscr_style_digest'] = 'Courriel, tous les %.2f jours, résumant les m $lang['subscr_style_list'] = 'Liste des pages modifiées depuis le dernier courriel (tous les %.2f jours)'; $lang['authmodfailed'] = 'Mauvais paramétrage de l\'authentification. Merci d\'informer l\'administrateur du Wiki.'; $lang['authtempfail'] = 'L\'authentification est temporairement indisponible. Si cela perdure, merci d\'informer l\'administrateur du Wiki.'; +$lang['authpwdexpire'] = 'Votre mot de passe expirera dans %d jours, vous devriez le changer bientôt.'; $lang['i_chooselang'] = 'Choisissez votre langue'; $lang['i_installer'] = 'Installeur DokuWiki'; $lang['i_wikiname'] = 'Nom du wiki'; diff --git a/inc/lang/fr/resetpwd.txt b/inc/lang/fr/resetpwd.txt new file mode 100644 index 000000000..7b1990ca0 --- /dev/null +++ b/inc/lang/fr/resetpwd.txt @@ -0,0 +1,3 @@ +====== Définir un nouveau mot de passe ====== + +Merci d'entrer un nouveau mot de passe pour votre compte sur ce wiki.
\ No newline at end of file diff --git a/inc/lang/ja/lang.php b/inc/lang/ja/lang.php index 057fa5a54..490c84cc9 100644 --- a/inc/lang/ja/lang.php +++ b/inc/lang/ja/lang.php @@ -261,6 +261,7 @@ $lang['subscr_style_digest'] = 'それぞれのページへの変更の要約 $lang['subscr_style_list'] = '前回のメールから変更されたページをリスト(%.2f 日毎)'; $lang['authmodfailed'] = 'ユーザー認証の設定が正しくありません。Wikiの管理者に連絡して下さい。'; $lang['authtempfail'] = 'ユーザー認証が一時的に使用できなくなっています。この状態が続いているようであれば、Wikiの管理者に連絡して下さい。'; +$lang['authpwdexpire'] = 'あなたのパスワードは、あと%d日で有効期限が切れます。パスワードを変更してください。'; $lang['i_chooselang'] = '使用言語を選択してください'; $lang['i_installer'] = 'DokuWiki インストーラー'; $lang['i_wikiname'] = 'Wiki名'; diff --git a/inc/load.php b/inc/load.php index f3ab5bcdd..9f54034a3 100644 --- a/inc/load.php +++ b/inc/load.php @@ -49,6 +49,7 @@ function load_autoload($name){ static $classes = null; if(is_null($classes)) $classes = array( 'DokuHTTPClient' => DOKU_INC.'inc/HTTPClient.php', + 'HTTPClient' => DOKU_INC.'inc/HTTPClient.php', 'JSON' => DOKU_INC.'inc/JSON.php', 'adLDAP' => DOKU_INC.'inc/adLDAP.php', 'Diff' => DOKU_INC.'inc/DifferenceEngine.php', @@ -76,8 +77,9 @@ function load_autoload($name){ 'SafeFN' => DOKU_INC.'inc/SafeFN.class.php', 'Sitemapper' => DOKU_INC.'inc/Sitemapper.php', 'PassHash' => DOKU_INC.'inc/PassHash.class.php', + 'Mailer' => DOKU_INC.'inc/Mailer.class.php', 'RemoteAPI' => DOKU_INC.'inc/remote.php', - 'RemoteAPICore' => DOKU_INC.'inc/RemoteAPICore.php', + 'RemoteAPICore' => DOKU_INC.'inc/RemoteAPICore.php', 'DokuWiki_Action_Plugin' => DOKU_PLUGIN.'action.php', 'DokuWiki_Admin_Plugin' => DOKU_PLUGIN.'admin.php', diff --git a/inc/media.php b/inc/media.php index dd0193fa0..841a5218e 100644 --- a/inc/media.php +++ b/inc/media.php @@ -516,6 +516,7 @@ function media_contentcheck($file,$mime){ * Send a notify mail on uploads * * @author Andreas Gohr <andi@splitbrain.org> + * @fixme this should embed thumbnails of images in HTML version */ function media_notify($id,$file,$mime,$old_rev=false){ global $lang; @@ -523,31 +524,24 @@ function media_notify($id,$file,$mime,$old_rev=false){ global $INFO; if(empty($conf['notify'])) return; //notify enabled? - $ip = clientIP(); - $text = rawLocale('uploadmail'); - $text = str_replace('@DATE@',dformat(),$text); - $text = str_replace('@BROWSER@',$_SERVER['HTTP_USER_AGENT'],$text); - $text = str_replace('@IPADDRESS@',$ip,$text); - $text = str_replace('@HOSTNAME@',gethostsbyaddrs($ip),$text); - $text = str_replace('@DOKUWIKIURL@',DOKU_URL,$text); - $text = str_replace('@USER@',$_SERVER['REMOTE_USER'],$text); - $text = str_replace('@MIME@',$mime,$text); - $text = str_replace('@MEDIA@',ml($id,'',true,'&',true),$text); - $text = str_replace('@SIZE@',filesize_h(filesize($file)),$text); - if ($old_rev && $conf['mediarevisions']) { - $text = str_replace('@OLD@', ml($id, "rev=$old_rev", true, '&', true), $text); - } else { - $text = str_replace('@OLD@', '', $text); - } + $trep = array( + 'MIME' => $mime, + 'MEDIA' => ml($id,'',true,'&',true), + 'SIZE' => filesize_h(filesize($file)), + ); - if(empty($conf['mailprefix'])) { - $subject = '['.$conf['title'].'] '.$lang['mail_upload'].' '.$id; + if ($old_rev && $conf['mediarevisions']) { + $trep['OLD'] = ml($id, "rev=$old_rev", true, '&', true); } else { - $subject = '['.$conf['mailprefix'].'] '.$lang['mail_upload'].' '.$id; + $trep['OLD'] = '---'; } - mail_send($conf['notify'],$subject,$text,$conf['mailfrom']); + $mail = new Mailer(); + $mail->to($conf['notify']); + $mail->subject($lang['mail_upload'].' '.$id); + $mail->setBody($text,$trep); + return $mail->send(); } /** @@ -1608,7 +1602,35 @@ function media_uploadform($ns, $auth, $fullscreen = false){ echo NL.'<div id="mediamanager__uploader">'.NL; html_form('upload', $form); + echo '</div>'.NL; + + echo '<p class="maxsize">'; + printf($lang['maxuploadsize'],filesize_h(media_getuploadsize())); + echo '</p>'.NL; + +} + +/** + * Returns the size uploaded files may have + * + * This uses a conservative approach using the lowest number found + * in any of the limiting ini settings + * + * @returns int size in bytes + */ +function media_getuploadsize(){ + $okay = 0; + + $post = (int) php_to_byte(@ini_get('post_max_size')); + $suho = (int) php_to_byte(@ini_get('suhosin.post.max_value_length')); + $upld = (int) php_to_byte(@ini_get('upload_max_filesize')); + + if($post && ($post < $okay || $okay == 0)) $okay = $post; + if($suho && ($suho < $okay || $okay == 0)) $okay = $suho; + if($upld && ($upld < $okay || $okay == 0)) $okay = $upld; + + return $okay; } /** diff --git a/inc/pageutils.php b/inc/pageutils.php index db00258e2..c94d14624 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -355,19 +355,21 @@ function mediaFN($id, $rev=''){ } /** - * Returns the full filepath to a localized textfile if local + * Returns the full filepath to a localized file if local * version isn't found the english one is returned * + * @param string $id The id of the local file + * @param string $ext The file extension (usually txt) * @author Andreas Gohr <andi@splitbrain.org> */ -function localeFN($id){ +function localeFN($id,$ext='txt'){ global $conf; - $file = DOKU_CONF.'/lang/'.$conf['lang'].'/'.$id.'.txt'; + $file = DOKU_CONF.'/lang/'.$conf['lang'].'/'.$id.'.'.$ext; if(!@file_exists($file)){ - $file = DOKU_INC.'inc/lang/'.$conf['lang'].'/'.$id.'.txt'; + $file = DOKU_INC.'inc/lang/'.$conf['lang'].'/'.$id.'.'.$ext; if(!@file_exists($file)){ //fall back to english - $file = DOKU_INC.'inc/lang/en/'.$id.'.txt'; + $file = DOKU_INC.'inc/lang/en/'.$id.'.'.$ext; } } return $file; diff --git a/inc/subscription.php b/inc/subscription.php index c94f17ad0..d1ee0397a 100644 --- a/inc/subscription.php +++ b/inc/subscription.php @@ -377,18 +377,20 @@ function subscription_send_list($subscriber_mail, $ids, $ns_id) { */ function subscription_send($subscriber_mail, $replaces, $subject, $id, $template) { global $conf; + global $lang; $text = rawLocale($template); - $replaces = array_merge($replaces, array('TITLE' => $conf['title'], - 'DOKUWIKIURL' => DOKU_URL, - 'PAGE' => $id)); - - foreach ($replaces as $key => $substitution) { - $text = str_replace('@'.strtoupper($key).'@', $substitution, $text); - } + $trep = array_merge($replaces, array('PAGE' => $id)); - global $lang; $subject = $lang['mail_' . $subject] . ' ' . $id; - mail_send('', '['.$conf['title'].'] '. $subject, $text, - $conf['mailfrom'], '', $subscriber_mail); + $mail = new Mailer(); + $mail->bcc($subscriber_mail); + $mail->subject($subject); + $mail->setBody($text,$trep); + $mail->setHeader( + 'List-Unsubscribe', + '<'.wl($id,array('do'=>'subscribe'),true,'&').'>', + false + ); + return $mail->send(); } |