Lines Matching +full:update +full:- +full:user +full:- +full:info -(+path:inc +path:lang) -(+path:lib +path:plugins +path:lang) -(+path:lib +path:tpl +path:dokuwiki +path:lang)

38     return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, 'UTF-8');
98 return preg_replace('/[\x00-\x1F]+/s', '', $string);
105 * @link http://en.wikipedia.org/wiki/Cross-site_request_forgery
106 * @link http://christ1an.blogspot.com/2007/04/preventing-csrf-efficiently.html
115 $user = $INPUT->server->str('REMOTE_USER');
118 // CSRF checks are only for logged in users - do not generate for anonymous
119 if (trim($user) == '' || trim($session) == '') return '';
120 return PassHash::hmac('md5', $session . $user, auth_cookiesalt());
133 if (!$INPUT->server->str('REMOTE_USER')) return true; // no logged in user, no need for a check
135 if (is_null($token)) $token = $INPUT->str('sectok');
137 msg('Security Token did not match. Possible CSRF attack.', -1);
162 * @param bool $htmlClient add info about whether is mobile browser
163 * @return array with info for a request of $id
175 // set info about manager/admin status.
176 $info = [];
177 $info['isadmin'] = false;
178 $info['ismanager'] = false;
179 if ($INPUT->server->has('REMOTE_USER')) {
180 $info['userinfo'] = $USERINFO;
181 $info['perm'] = auth_quickaclcheck($id);
182 $info['client'] = $INPUT->server->str('REMOTE_USER');
184 if ($info['perm'] == AUTH_ADMIN) {
185 $info['isadmin'] = true;
186 $info['ismanager'] = true;
188 $info['ismanager'] = true;
192 if (empty($info['userinfo']['name'])) {
193 $info['userinfo']['name'] = $INPUT->server->str('REMOTE_USER');
196 $info['perm'] = auth_aclcheck($id, '', null);
197 $info['client'] = clientIP(true);
200 $info['namespace'] = getNS($id);
204 $info['ismobile'] = clientismobile();
207 return $info;
211 * Return info about the current document as associative
214 * @return array with info about current document
226 $info = basicinfo($ID);
230 $info['id'] = $ID;
231 $info['rev'] = $REV;
234 $info['subscribed'] = $subManager->userSubscription();
236 $info['locked'] = checklock($ID);
237 $info['filepath'] = wikiFN($ID);
238 $info['exists'] = file_exists($info['filepath']);
239 $info['currentrev'] = @filemtime($info['filepath']);
243 if ($info['exists'] && ($info['currentrev'] == $REV)) {
252 $info['filepath'] = wikiFN($ID, $REV);
253 $info['exists'] = file_exists($info['filepath']);
256 $info['rev'] = $REV;
257 if ($info['exists']) {
258 $info['writable'] = (is_writable($info['filepath']) && $info['perm'] >= AUTH_EDIT);
260 $info['writable'] = ($info['perm'] >= AUTH_CREATE);
262 $info['editable'] = ($info['writable'] && empty($info['locked']));
263 $info['lastmod'] = @filemtime($info['filepath']);
266 $info['meta'] = p_get_metadata($ID);
271 $revinfo = $pagelog->getRevisionInfo($REV);
272 } elseif (!empty($info['meta']['last_change']) && is_array($info['meta']['last_change'])) {
273 $revinfo = $info['meta']['last_change'];
275 $revinfo = $pagelog->getRevisionInfo($info['lastmod']);
278 $info['meta']['last_change'] = $revinfo;
283 if ($revinfo !== false && $revinfo['date'] != $info['lastmod']) {
286 $info['meta']['last_change'] = $revinfo;
291 $info['ip'] = $revinfo['ip'];
292 $info['user'] = $revinfo['user'];
293 $info['sum'] = $revinfo['sum'];
294 // See also $INFO['meta']['last_change'] which is the most recent log line for page $ID.
295 …// Use $INFO['meta']['last_change']['type']===DOKU_CHANGE_TYPE_MINOR_EDIT in place of $info['minor…
297 $info['editor'] = $revinfo['user'] ?: $revinfo['ip'];
299 $info['ip'] = null;
300 $info['user'] = null;
301 $info['sum'] = null;
302 $info['editor'] = null;
306 $draft = new Draft($ID, $info['client']);
307 if ($draft->isDraftAvailable()) {
308 $info['draft'] = $draft->getDraftFilename();
311 return $info;
315 * Initialize and/or fill global $JSINFO with some basic info to be given to javascript
319 global $JSINFO, $ID, $INFO, $ACT;
324 //export minimal info to JS, plugins can add more
326 $JSINFO['namespace'] = isset($INFO) ? (string)$INFO['namespace'] : '';
335 * @return array with info about current media item
342 $info = basicinfo("$NS:*");
343 $info['image'] = $IMG;
345 return $info;
367 * @param array $params array with (attribute name-attribute value) pairs
406 global $INFO;
412 if ($ACT != 'show' || $INFO['perm'] < AUTH_READ || isHiddenPage($ID) || !file_exists($file)) {
448 * on Windows (non-IIS) systems and to have proper URL encoding
475 strpos($INPUT->server->str('SERVER_SOFTWARE'), 'Microsoft-IIS') === false
702 * and gain information about the user who was blocked.
705 * data['matches'] - array of matches
706 * data['userinfo'] - information about the blocked user
707 * [ip] - ip address
708 * [user] - username (if logged in)
709 * [mail] - mail address (if logged in)
710 * [name] - real name (if logged in)
712 * @param string $text - optional text to check, if not given the globals are used
713 * @return bool - true if a spam word was found
725 global $INFO;
736 …'!(\b)(www\.[\w.:?\-;,]+?\.[\w.:?\-;,]+?[\w/\#~:.?+=&%@\!\-.:?\-;,]+?)([.:?\-;,]*[^\w/\#~:.?+=&%@\…
743 // read file in chunks of 200 - this should work around the
760 $data['userinfo']['ip'] = $INPUT->server->str('REMOTE_ADDR');
761 if ($INPUT->server->str('REMOTE_USER')) {
762 $data['userinfo']['user'] = $INPUT->server->str('REMOTE_USER');
763 $data['userinfo']['name'] = $INFO['userinfo']['name'];
764 $data['userinfo']['mail'] = $INFO['userinfo']['mail'];
778 * - The X-Real-IP header if $conf[realip] is true.
779 * - The X-Forwarded-For header if all the proxies are trusted by $conf[trustedproxies].
780 * - The TCP/IP connection remote address.
781 * - 0.0.0.0 if all else fails.
783 * The 'realip' config value should only be set to true if the X-Real-IP header
786 * The 'trustedproxies' setting must not allow any IP, otherwise the X-Forwarded-For
791 * @return string Returns an IP address if 'single' is true, or a comma-separated list
807 * @link http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#code
809 * @deprecated 2018-04-27 you probably want media queries instead anyway
817 if ($INPUT->server->has('HTTP_X_WAP_PROFILE')) return true;
819 if (preg_match('/wap\.|\.wap/i', $INPUT->server->str('HTTP_ACCEPT'))) return true;
821 if (!$INPUT->server->has('HTTP_USER_AGENT')) return false;
828 … 'hand', 'mobi', 'phone', 'cdm', 'up\.b', 'audio', 'SIE\-', 'SEC\-', 'samsung', 'HTC', 'mot\-',
836 if (preg_match("/$uamatches/i", $INPUT->server->str('HTTP_USER_AGENT'))) return true;
849 if (preg_match('/^[a-zA-Z0-9\.]+>/u', $link)) return true;
903 if ((time() - filemtime($lock)) > $conf['locktime']) {
910 if ($ip == $INPUT->server->str('REMOTE_USER') || (session_id() && $session === session_id())) {
935 if ($INPUT->server->str('REMOTE_USER')) {
936 io_saveFile($lock, $INPUT->server->str('REMOTE_USER'));
943 * Unlock a page if it was locked by the user
958 if ($ip == $INPUT->server->str('REMOTE_USER') || $session == session_id()) {
969 * also makes sure the given text is valid UTF-8
981 // if the text is not valid UTF-8 we simply assume latin1
1058 if ($evt->advise_before(true)) {
1083 $evt->advise_after();
1132 '@USER@',
1151 $INPUT->server->str('REMOTE_USER'),
1172 * The range parameter needs to have the form "from-to"
1173 * and gives the range of the section in bytes - no
1174 * UTF-8 awareness is needed.
1177 * @param string $range in form "from-to"
1189 [$from, $to] = sexplode('-', $range, 2);
1190 // Make range zero-based, use defaults if marker is missing
1191 $from = $from ? $from - 1 : (0);
1192 $to = $to ? $to - 1 : (strlen($text));
1196 $slices[1] = substr($text, $from, $to - $from);
1245 * @deprecated 2021-11-28
1250 (new PageFile($id))->detectExternalEdit();
1259 * @param string $summary summary of text update
1260 * @param bool $minor mark this saved version as minor update
1269 $data = (new PageFile($id))->saveWikiText($text, $summary, $minor);
1282 $cache->removeCache();
1294 * @deprecated 2021-11-28
1299 return (new PageFile($id))->saveOldRevision();
1329 … if ($conf['useacl'] && $INPUT->server->str('REMOTE_USER') && $minor) return false; //skip minors
1345 return $subscription->sendPageDiff($to, $tpl, $id, $rev, $summary, $current_rev);
1361 if (!$INPUT->server->has('HTTP_REFERER')) {
1364 $url = parse_url($INPUT->server->str('HTTP_REFERER'));
1387 $q = preg_split('/[\s\'"\\\\`()\]\[?:!\.{};,#+*<>\\/]+/', $q, -1, PREG_SPLIT_NO_EMPTY);
1408 while ($size >= 1024 && ($i < $count - 1)) {
1413 return round($size, $dec) . "\xC2\xA0" . $sizes[$i]; //non-breaking space
1428 $ago = time() - $dt;
1454 * strftime - %f can be used to get the value from datetime_h()
1486 $date_mod = date('Y-m-d\TH:i:s', $int_date);
1508 $obfuscate = ['@' => ' [at] ', '.' => ' [dot] ', '-' => ' [dash] '];
1539 * -1 (infinite size) will be reported as -1
1547 switch (strtoupper(substr($value, -1))) {
1549 $ret = (int)substr($value, 0, -1) * 1024 * 1024 * 1024;
1552 $ret = (int)substr($value, 0, -1) * 1024 * 1024;
1555 $ret = (int)substr($value, 0, -1) * 1024;
1592 $max -= PhpString::strlen($keep);
1598 PhpString::substr($short, 0, $half - 1) .
1600 PhpString::substr($short, $len - $half);
1604 * Return the users real name or e-mail address for use
1607 * @param string|null $username or null when currently logged-in user should be used
1609 * @return string html or plain text(not escaped) of formatted user name
1621 * @param string|null $username or null when currently logged-in user should be used
1623 * @return string html or plain text(not escaped) of formatted user name
1629 global $conf, $INFO;
1637 'username' => $username, // the unique user name
1650 'userlink' => '', // formatted user name as will be returned
1654 $data['username'] = $username = $INPUT->server->str('REMOTE_USER');
1656 … $data['name'] = $INFO['userinfo']['name'] . ' (' . $INPUT->server->str('REMOTE_USER') . ')';
1658 $data['name'] = '<bdi>' . hsc($INFO['userinfo']['name']) . '</bdi> ' .
1659 '(<bdi>' . hsc($INPUT->server->str('REMOTE_USER')) . '</bdi>)';
1664 if ($evt->advise_before(true)) {
1667 $info = $auth->getUserData($username);
1669 if ($conf['showuseras'] != 'loginname' && isset($info) && $info) {
1673 $data['name'] = $textonly ? $info['name'] : hsc($info['name']);
1677 $data['name'] = obfuscate($info['mail']);
1690 if (!isset($info) && $auth instanceof AuthPlugin) {
1691 $info = $auth->getUserData($username);
1693 if (isset($info) && $info) {
1695 $data['link']['url'] = 'mailto:' . obfuscate($info['mail']);
1700 if ($xhtml_renderer->interwiki === []) {
1701 $xhtml_renderer->interwiki = getInterwiki();
1703 $shortcut = 'user';
1705 … $data['link']['url'] = $xhtml_renderer->_resolveInterWiki($shortcut, $username, $exists);
1731 $data['userlink'] = $xhtml_renderer->_formatLink($data['link']);
1734 $evt->advise_after();
1744 * @param string $type - type of image 'badge' or 'button'
1758 if (str_starts_with($conf['license'], 'cc-')) {
1784 if ($limit == -1) return true; // unlimited
1831 // check if running on IIS < 6 with CGI-PHP
1833 $INPUT->server->has('SERVER_SOFTWARE') && $INPUT->server->has('GATEWAY_INTERFACE') &&
1834 (strpos($INPUT->server->str('GATEWAY_INTERFACE'), 'CGI') !== false) &&
1835 …(preg_match('|^Microsoft-IIS/(\d)\.\d$|', trim($INPUT->server->str('SERVER_SOFTWARE')), $matches))…
1845 // pass info about the redirect back to the test suite
1848 $testRequest->addData('send_redirect', $url);
1896 return (new PrefCookie())->get($pref, $default);
1916 (new PrefCookie())->set($pref, $val);
1950 $content = preg_replace('/<!--.*?(-->)/s', '', $content); // comments