Warning: Cannot modify header information - headers already sent by (output started at /var/www/jonas-eriksen.dk/pic/private/index.php:1) in /var/www/jonas-eriksen.dk/pic/private/index.php on line 215
PK! ** Preview.phpnu[savedraft(); parent::preProcess(); } /** @inheritdoc */ public function tplContent() { global $TEXT; html_edit(); html_show($TEXT); } /** * Saves a draft on preview */ protected function savedraft() { global $ID, $INFO; $draft = new \dokuwiki\Draft($ID, $INFO['client']); if (!$draft->saveDraft()) { $errors = $draft->getErrors(); foreach ($errors as $error) { msg(hsc($error), -1); } } } } PK!2&Ʃ Revisions.phpnu[int('first')); } } PK!øA̷ Revert.phpnu[ redirect -> show throw new ActionAbort('draftdel'); } } PK!vBB Source.phpnu[ $ID, 'preact' => $ACT ); //get section name when coming from section edit if($INPUT->has('hid')) { // Use explicitly transmitted header id $opts['fragment'] = $INPUT->str('hid'); } else if($PRE && preg_match('/^\s*==+([^=\n]+)/', $TEXT, $match)) { // Fallback to old mechanism $check = false; //Byref $opts['fragment'] = sectionID($match[0], $check); } // execute the redirect Event::createAndTrigger('ACTION_SHOW_REDIRECT', $opts, array($this, 'redirect')); // should never be reached throw new ActionAbort('show'); } /** * Execute the redirect * * Default action for ACTION_SHOW_REDIRECT * * @param array $opts id and fragment for the redirect and the preact */ public function redirect($opts) { $go = wl($opts['id'], '', true, '&'); if(isset($opts['fragment'])) $go .= '#' . $opts['fragment']; //show it send_redirect($go); } } PK!0G]] Media.phpnu[server->str('REQUEST_METHOD')) == 'post') { $newaction = 'redirect'; } else { $newaction = 'show'; } } $this->newaction = $newaction; } /** * Returns the action to use next * * @return string */ public function getNewAction() { return $this->newaction; } /** * Should this Exception's message be shown to the user? * * @param null|bool $set when null is given, the current setting is not changed * @return bool */ public function displayToUser($set = null) { if(!is_null($set)) $this->displayToUser = $set; return $set; } } PK!ѥ%Exception/ActionDisabledException.phpnu[canDo('modPass')) throw new ActionDisabledException(); } /** @inheritdoc */ public function preProcess() { if($this->resendpwd()) { throw new ActionAbort('login'); } } /** @inheritdoc */ public function tplContent() { html_resendpwd(); } /** * Send a new password * * This function handles both phases of the password reset: * * - handling the first request of password reset * - validating the password reset auth token * * @author Benoit Chesneau * @author Chris Smith * @author Andreas Gohr * @fixme this should be split up into multiple methods * @return bool true on success, false on any error */ protected function resendpwd() { global $lang; global $conf; /* @var \dokuwiki\Extension\AuthPlugin $auth */ global $auth; global $INPUT; if(!actionOK('resendpwd')) { msg($lang['resendna'], -1); return false; } $token = preg_replace('/[^a-f0-9]+/', '', $INPUT->str('pwauth')); if($token) { // we're in token phase - get user info from token $tfile = $conf['cachedir'] . '/' . $token[0] . '/' . $token . '.pwauth'; if(!file_exists($tfile)) { msg($lang['resendpwdbadauth'], -1); $INPUT->remove('pwauth'); return false; } // token is only valid for 3 days if((time() - filemtime($tfile)) > (3 * 60 * 60 * 24)) { msg($lang['resendpwdbadauth'], -1); $INPUT->remove('pwauth'); @unlink($tfile); return false; } $user = io_readfile($tfile); $userinfo = $auth->getUserData($user, $requireGroups = false); if(!$userinfo['mail']) { msg($lang['resendpwdnouser'], -1); return false; } if(!$conf['autopasswd']) { // we let the user choose a password $pass = $INPUT->str('pass'); // password given correctly? if(!$pass) return false; if($pass != $INPUT->str('passchk')) { msg($lang['regbadpass'], -1); return false; } // change it if(!$auth->triggerUserMod('modify', array($user, array('pass' => $pass)))) { msg($lang['proffail'], -1); return false; } } else { // autogenerate the password and send by mail $pass = auth_pwgen($user); if(!$auth->triggerUserMod('modify', array($user, array('pass' => $pass)))) { msg($lang['proffail'], -1); return false; } if(auth_sendPassword($user, $pass)) { msg($lang['resendpwdsuccess'], 1); } else { msg($lang['regmailfail'], -1); } } @unlink($tfile); return true; } else { // we're in request phase if(!$INPUT->post->bool('save')) return false; if(!$INPUT->post->str('login')) { msg($lang['resendpwdmissing'], -1); return false; } else { $user = trim($auth->cleanUser($INPUT->post->str('login'))); } $userinfo = $auth->getUserData($user, $requireGroups = false); if(!$userinfo['mail']) { msg($lang['resendpwdnouser'], -1); return false; } // generate auth token $token = md5(auth_randombytes(16)); // random secret $tfile = $conf['cachedir'] . '/' . $token[0] . '/' . $token . '.pwauth'; $url = wl('', array('do' => 'resendpwd', 'pwauth' => $token), true, '&'); io_saveFile($tfile, $user); $text = rawLocale('pwconfirm'); $trep = array( 'FULLNAME' => $userinfo['name'], 'LOGIN' => $user, 'CONFIRM' => $url ); $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); } return true; } // never reached } } PK!jn Plugin.phpnu[actionname); if($evt->advise_before()) { msg('Failed to handle action: ' . hsc($this->actionname), -1); } $evt->advise_after(); } } PK!j* Logout.phpnu[canDo('logout')) throw new ActionDisabledException(); } /** @inheritdoc */ public function preProcess() { global $ID; global $INPUT; // when logging out during an edit session, unlock the page $lockedby = checklock($ID); if($lockedby == $INPUT->server->str('REMOTE_USER')) { unlock($ID); } // do the logout stuff and redirect to login auth_logoff(); send_redirect(wl($ID, array('do' => 'login'), true, '&')); // should never be reached throw new ActionException('login'); } } PK!4/ Draft.phpnu[canDo('delUser')) throw new ActionDisabledException(); } /** @inheritdoc */ public function preProcess() { global $lang; if(auth_deleteprofile()) { msg($lang['profdeleted'], 1); throw new ActionAbort('show'); } else { throw new ActionAbort('profile'); } } } PK!r Profile.phpnu[canDo('Profile')) throw new ActionDisabledException(); } /** @inheritdoc */ public function preProcess() { global $lang; if(updateprofile()) { msg($lang['profchanged'], 1); throw new ActionAbort('show'); } } /** @inheritdoc */ public function tplContent() { html_updateprofile(); } } PK!EEAbstractAclAction.phpnu[str('difftype'); if(!empty($difftype)) { set_doku_pref('difftype', $difftype); } } /** @inheritdoc */ public function tplContent() { html_diff(); } } PK!Mz Login.phpnu[server->has('REMOTE_USER')) { // nothing to do throw new ActionException(); } } /** @inheritdoc */ public function tplContent() { html_login(); } } PK!kBeeSave.phpnu[ $DATE) { throw new ActionException('conflict'); } //save it saveWikiText($ID, con($PRE, $TEXT, $SUF, true), $SUM, $INPUT->bool('minor')); //use pretty mode for con //unlock it unlock($ID); // continue with draftdel -> redirect -> show throw new ActionAbort('draftdel'); } } PK!5sAbstractAliasAction.phpnu[canDo('addUser')) throw new ActionDisabledException(); } /** @inheritdoc */ public function preProcess() { if(register()) { // FIXME could be moved from auth to here throw new ActionAbort('login'); } } /** @inheritdoc */ public function tplContent() { html_register(); } } PK!{3m Cancel.phpnu[ redirect -> show throw new ActionAbort('draftdel'); } } PK!2 Sitemap.phpnu[ * @throws FatalException * @inheritdoc */ public function preProcess() { global $conf; if($conf['sitemap'] < 1 || !is_numeric($conf['sitemap'])) { throw new FatalException('Sitemap generation is disabled', 404); } $sitemap = Mapper::getFilePath(); if(Mapper::sitemapIsCompressed()) { $mime = 'application/x-gzip'; } else { $mime = 'application/xml; charset=utf-8'; } // Check if sitemap file exists, otherwise create it if(!is_readable($sitemap)) { Mapper::generate(); } if(is_readable($sitemap)) { // Send headers header('Content-Type: ' . $mime); header('Content-Disposition: attachment; filename=' . \dokuwiki\Utf8\PhpString::basename($sitemap)); http_conditionalRequest(filemtime($sitemap)); // Send file //use x-sendfile header to pass the delivery to compatible webservers http_sendfile($sitemap); readfile($sitemap); exit; } throw new FatalException('Could not read the sitemap file - bad permissions?'); } } PK!= Draftdel.phpnu[isDraftAvailable()) { $draft->deleteDraft(); } throw new ActionAbort('redirect'); } } PK!͟#=?? Admin.phpnu[str('page', '', true)) != '') { /** @var $plugin \dokuwiki\Extension\AdminPlugin */ if($plugin = plugin_getRequestAdminPlugin()) { // FIXME this method does also permission checking if(!$plugin->isAccessibleByCurrentUser()) { throw new ActionException('denied'); } $plugin->handle(); } } } public function tplContent() { tpl_admin(); } } PK!]FQ Q Export.phpnu[ * @author Michael Klier * @inheritdoc */ public function preProcess() { global $ID; global $REV; global $conf; global $lang; $pre = ''; $post = ''; $headers = array(); // search engines: never cache exported docs! (Google only currently) $headers['X-Robots-Tag'] = 'noindex'; $mode = substr($this->actionname, 7); switch($mode) { case 'raw': $headers['Content-Type'] = 'text/plain; charset=utf-8'; $headers['Content-Disposition'] = 'attachment; filename=' . noNS($ID) . '.txt'; $output = rawWiki($ID, $REV); break; case 'xhtml': $pre .= '' . DOKU_LF; $pre .= '' . DOKU_LF; $pre .= '' . DOKU_LF; $pre .= ' ' . DOKU_LF; // FIXME improve wrapper $pre .= ' ' . $ID . '' . DOKU_LF; // get metaheaders ob_start(); tpl_metaheaders(); $pre .= ob_get_clean(); $pre .= '' . DOKU_LF; $pre .= '' . DOKU_LF; $pre .= '
' . DOKU_LF; // get toc $pre .= tpl_toc(true); $headers['Content-Type'] = 'text/html; charset=utf-8'; $output = p_wiki_xhtml($ID, $REV, false); $post .= '
' . DOKU_LF; $post .= '' . DOKU_LF; $post .= '' . DOKU_LF; break; case 'xhtmlbody': $headers['Content-Type'] = 'text/html; charset=utf-8'; $output = p_wiki_xhtml($ID, $REV, false); break; default: $output = p_cached_output(wikiFN($ID, $REV), $mode, $ID); $headers = p_get_metadata($ID, "format $mode"); break; } // prepare event data $data = array(); $data['id'] = $ID; $data['mode'] = $mode; $data['headers'] = $headers; $data['output'] =& $output; Event::createAndTrigger('ACTION_EXPORT_POSTPROCESS', $data); if(!empty($data['output'])) { if(is_array($data['headers'])) foreach($data['headers'] as $key => $val) { header("$key: $val"); } print $pre . $data['output'] . $post; exit; } throw new ActionAbort(); } } PK!Bl Check.phpnu[handleSubscribeData(); } catch(ActionAbort $e) { throw $e; } catch(\Exception $e) { msg($e->getMessage(), -1); } } /** @inheritdoc */ public function tplContent() { tpl_subscribe(); } /** * Handle page 'subscribe' * * @author Adrian Lang * @throws \Exception if (un)subscribing fails * @throws ActionAbort when (un)subscribing worked */ protected function handleSubscribeData() { global $lang; global $INFO; global $INPUT; // get and preprocess data. $params = array(); foreach(array('target', 'style', 'action') as $param) { if($INPUT->has("sub_$param")) { $params[$param] = $INPUT->str("sub_$param"); } } // any action given? if not just return and show the subscription page if(empty($params['action']) || !checkSecurityToken()) return; // Handle POST data, may throw exception. Event::createAndTrigger('ACTION_HANDLE_SUBSCRIBE', $params, array($this, 'handlePostData')); $target = $params['target']; $style = $params['style']; $action = $params['action']; // Perform action. $subManager = new SubscriberManager(); if($action === 'unsubscribe') { $ok = $subManager->remove($target, $INPUT->server->str('REMOTE_USER'), $style); } else { $ok = $subManager->add($target, $INPUT->server->str('REMOTE_USER'), $style); } if($ok) { msg( sprintf( $lang["subscr_{$action}_success"], hsc($INFO['userinfo']['name']), prettyprint_id($target) ), 1 ); throw new ActionAbort('redirect'); } throw new \Exception( sprintf( $lang["subscr_{$action}_error"], hsc($INFO['userinfo']['name']), prettyprint_id($target) ) ); } /** * Validate POST data * * Validates POST data for a subscribe or unsubscribe request. This is the * default action for the event ACTION_HANDLE_SUBSCRIBE. * * @author Adrian Lang * * @param array &$params the parameters: target, style and action * @throws \Exception */ public function handlePostData(&$params) { global $INFO; global $lang; global $INPUT; // Get and validate parameters. if(!isset($params['target'])) { throw new \Exception('no subscription target given'); } $target = $params['target']; $valid_styles = array('every', 'digest'); if(substr($target, -1, 1) === ':') { // Allow “list” subscribe style since the target is a namespace. $valid_styles[] = 'list'; } $style = valid_input_set( 'style', $valid_styles, $params, 'invalid subscription style given' ); $action = valid_input_set( 'action', array('subscribe', 'unsubscribe'), $params, 'invalid subscription action given' ); // Check other conditions. if($action === 'subscribe') { if($INFO['userinfo']['mail'] === '') { throw new \Exception($lang['subscr_subscribe_noaddress']); } } elseif($action === 'unsubscribe') { $is = false; foreach($INFO['subscribed'] as $subscr) { if($subscr['target'] === $target) { $is = true; } } if($is === false) { throw new \Exception( sprintf( $lang['subscr_not_subscribed'], $INPUT->server->str('REMOTE_USER'), prettyprint_id($target) ) ); } // subscription_set deletes a subscription if style = null. $style = null; } $params = compact('target', 'style', 'action'); } } PK!O\>44 Recover.phpnu[str('show_changes'); if(!empty($show_changes)) { set_doku_pref('show_changes', $show_changes); $this->showType = $show_changes; } else { $this->showType = get_doku_pref('show_changes', 'both'); } } /** @inheritdoc */ public function tplContent() { global $INPUT; html_recent((int) $INPUT->extract('first')->int('first'), $this->showType); } } PK!>uu Backlink.phpnu[actionname = $actionname; } else { // http://stackoverflow.com/a/27457689/172068 $this->actionname = strtolower(substr(strrchr(get_class($this), '\\'), 1)); } } /** * Return the minimum permission needed * * This needs to return one of the AUTH_* constants. It will be checked against * the current user and page after checkPermissions() ran through. If it fails, * the user will be shown the Denied action. * * @return int */ abstract public function minimumPermission(); /** * Check conditions are met to run this action * * @throws ActionException * @return void */ public function checkPreconditions() { } /** * Process data * * This runs before any output is sent to the browser. * * Throw an Exception if a different action should be run after this step. * * @throws ActionException * @return void */ public function preProcess() { } /** * Output whatever content is wanted within tpl_content(); * * @fixme we may want to return a Ui class here */ public function tplContent() { throw new FatalException('No content for Action ' . $this->actionname); } /** * Returns the name of this action * * This is usually the lowercased class name, but may differ for some actions. * eg. the export_ modes or for the Plugin action. * * @return string */ public function getActionName() { return $this->actionname; } } PK!9p  AbstractUserAction.phpnu[server->str('REMOTE_USER')) { throw new ActionUserRequiredException(); } } } PK!нћ Search.phpnu[has('q')) { parse_str($INPUT->server->str('QUERY_STRING'), $urlParts); $urlParts['q'] = $urlParts['id']; unset($urlParts['id']); $url = wl($ID, $urlParts, true, '&'); send_redirect($url); } if ($s === '') throw new ActionAbort(); $this->adjustGlobalQuery(); } /** @inheritdoc */ public function tplContent() { $this->execute(); $search = new \dokuwiki\Ui\Search($this->pageLookupResults, $this->fullTextResults, $this->highlight); $search->show(); } /** * run the search */ protected function execute() { global $INPUT, $QUERY; $after = $INPUT->str('min'); $before = $INPUT->str('max'); $this->pageLookupResults = ft_pageLookup($QUERY, true, useHeading('navigation'), $after, $before); $this->fullTextResults = ft_pageSearch($QUERY, $highlight, $INPUT->str('srt'), $after, $before); $this->highlight = $highlight; } /** * Adjust the global query accordingly to the config search_nslimit and search_fragment * * This will only do something if the search didn't originate from the form on the searchpage itself */ protected function adjustGlobalQuery() { global $conf, $INPUT, $QUERY, $ID; if ($INPUT->bool('sf')) { return; } $Indexer = idx_get_indexer(); $parsedQuery = ft_queryParser($Indexer, $QUERY); if (empty($parsedQuery['ns']) && empty($parsedQuery['notns'])) { if ($conf['search_nslimit'] > 0) { if (getNS($ID) !== false) { $nsParts = explode(':', getNS($ID)); $ns = implode(':', array_slice($nsParts, 0, $conf['search_nslimit'])); $QUERY .= " @$ns"; } } } if ($conf['search_fragment'] !== 'exact') { if (empty(array_diff($parsedQuery['words'], $parsedQuery['and']))) { if (strpos($QUERY, '*') === false) { $queryParts = explode(' ', $QUERY); $queryParts = array_map(function ($part) { if (strpos($part, '@') === 0) { return $part; } if (strpos($part, 'ns:') === 0) { return $part; } if (strpos($part, '^') === 0) { return $part; } if (strpos($part, '-ns:') === 0) { return $part; } global $conf; if ($conf['search_fragment'] === 'starts_with') { return $part . '*'; } if ($conf['search_fragment'] === 'ends_with') { return '*' . $part; } return '*' . $part . '*'; }, $queryParts); $QUERY = implode(' ', $queryParts); } } } } } PK!vmm Conflict.phpnu[44 Recover.phpnu[PK!v+~~ VRecent.phpnu[PK!>uu Backlink.phpnu[PK!f];;Edit.phpnu[PK!~(Yu2AbstractAction.phpnu[PK!9p  ^AbstractUserAction.phpnu[PK!нћ Search.phpnu[PK!vmm Conflict.phpnu[PK,, +