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)

34     return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, 'UTF-8');
94 return preg_replace('/[\x00-\x1F]+/s', '', $string);
101 * @link http://en.wikipedia.org/wiki/Cross-site_request_forgery
102 * @link http://christ1an.blogspot.com/2007/04/preventing-csrf-efficiently.html
111 $user = $INPUT->server->str('REMOTE_USER');
114 // CSRF checks are only for logged in users - do not generate for anonymous
115 if (trim($user) == '' || trim($session) == '') return '';
116 return PassHash::hmac('md5', $session . $user, auth_cookiesalt());
129 if (!$INPUT->server->str('REMOTE_USER')) return true; // no logged in user, no need for a check
131 if (is_null($token)) $token = $INPUT->str('sectok');
133 msg('Security Token did not match. Possible CSRF attack.', -1);
161 * @param bool $htmlClient add info about whether is mobile browser
162 * @return array with info for a request of $id
171 // set info about manager/admin status.
172 $info = [];
173 $info['isadmin'] = false;
174 $info['ismanager'] = false;
175 if ($INPUT->server->has('REMOTE_USER')) {
176 $info['userinfo'] = $USERINFO;
177 $info['perm'] = auth_quickaclcheck($id);
178 $info['client'] = $INPUT->server->str('REMOTE_USER');
180 if ($info['perm'] == AUTH_ADMIN) {
181 $info['isadmin'] = true;
182 $info['ismanager'] = true;
184 $info['ismanager'] = true;
188 if (empty($info['userinfo']['name'])) {
189 $info['userinfo']['name'] = $INPUT->server->str('REMOTE_USER');
192 $info['perm'] = auth_aclcheck($id, '', null);
193 $info['client'] = clientIP(true);
196 $info['namespace'] = getNS($id);
200 $info['ismobile'] = clientismobile();
203 return $info;
207 * Return info about the current document as associative
210 * @return array with info about current document
222 $info = basicinfo($ID);
226 $info['id'] = $ID;
227 $info['rev'] = $REV;
230 $info['subscribed'] = $subManager->userSubscription();
232 $info['locked'] = checklock($ID);
233 $info['filepath'] = wikiFN($ID);
234 $info['exists'] = file_exists($info['filepath']);
235 $info['currentrev'] = @filemtime($info['filepath']);
239 if ($info['exists'] && ($info['currentrev'] == $REV)) {
248 $info['filepath'] = wikiFN($ID, $REV);
249 $info['exists'] = file_exists($info['filepath']);
252 $info['rev'] = $REV;
253 if ($info['exists']) {
254 $info['writable'] = (is_writable($info['filepath']) && $info['perm'] >= AUTH_EDIT);
256 $info['writable'] = ($info['perm'] >= AUTH_CREATE);
258 $info['editable'] = ($info['writable'] && empty($info['locked']));
259 $info['lastmod'] = @filemtime($info['filepath']);
262 $info['meta'] = p_get_metadata($ID);
267 $revinfo = $pagelog->getRevisionInfo($REV);
268 } elseif (!empty($info['meta']['last_change']) && is_array($info['meta']['last_change'])) {
269 $revinfo = $info['meta']['last_change'];
271 $revinfo = $pagelog->getRevisionInfo($info['lastmod']);
274 $info['meta']['last_change'] = $revinfo;
279 if ($revinfo !== false && $revinfo['date'] != $info['lastmod']) {
282 $info['meta']['last_change'] = $revinfo;
287 $info['ip'] = $revinfo['ip'];
288 $info['user'] = $revinfo['user'];
289 $info['sum'] = $revinfo['sum'];
290 // See also $INFO['meta']['last_change'] which is the most recent log line for page $ID.
291 // Use $INFO['meta']['last_change']['type']===DOKU_CHANGE_TYPE_MINOR_EDIT in place of $info['minor'].
293 $info['editor'] = $revinfo['user'] ?: $revinfo['ip'];
295 $info['ip'] = null;
296 $info['user'] = null;
297 $info['sum'] = null;
298 $info['editor'] = null;
302 $draft = new Draft($ID, $info['client']);
303 if ($draft->isDraftAvailable()) {
304 $info['draft'] = $draft->getDraftFilename();
307 return $info;
311 * Initialize and/or fill global $JSINFO with some basic info to be given to javascript
315 global $JSINFO, $ID, $INFO, $ACT;
320 //export minimal info to JS, plugins can add more
322 $JSINFO['namespace'] = isset($INFO) ? (string) $INFO['namespace'] : '';
331 * @return array with info about current media item
338 $info = basicinfo("$NS:*");
339 $info['image'] = $IMG;
341 return $info;
349 * @param array $params array with key-value pairs
374 * @param array $params array with (attribute name-attribute value) pairs
411 global $INFO;
417 if ($ACT != 'show' || $INFO['perm'] < AUTH_READ || isHiddenPage($ID) || !file_exists($file)) {
453 * on Windows (non-IIS) systems and to have proper URL encoding
480 strpos($INPUT->server->str('SERVER_SOFTWARE'), 'Microsoft-IIS') === false
707 * and gain information about the user who was blocked.
710 * data['matches'] - array of matches
711 * data['userinfo'] - information about the blocked user
712 * [ip] - ip address
713 * [user] - username (if logged in)
714 * [mail] - mail address (if logged in)
715 * [name] - real name (if logged in)
720 * @param string $text - optional text to check, if not given the globals are used
721 * @return bool - true if a spam word was found
730 global $INFO;
741 '!(\b)(www\.[\w.:?\-;,]+?\.[\w.:?\-;,]+?[\w/\#~:.?+=&%@\!\-.:?\-;,]+?)([.:?\-;,]*[^\w/\#~:.?+=&%@\!\-.:?\-;,])!i',
748 // read file in chunks of 200 - this should work around the
765 $data['userinfo']['ip'] = $INPUT->server->str('REMOTE_ADDR');
766 if ($INPUT->server->str('REMOTE_USER')) {
767 $data['userinfo']['user'] = $INPUT->server->str('REMOTE_USER');
768 $data['userinfo']['name'] = $INFO['userinfo']['name'];
769 $data['userinfo']['mail'] = $INFO['userinfo']['mail'];
781 * Honours X-Forwarded-For and X-Real-IP Proxy Headers
799 $ip[] = $INPUT->server->str('REMOTE_ADDR');
800 if ($INPUT->server->str('HTTP_X_FORWARDED_FOR')) {
801 $ip = array_merge($ip, explode(',', str_replace(' ', '', $INPUT->server->str('HTTP_X_FORWARDED_FOR'))));
803 if ($INPUT->server->str('HTTP_X_REAL_IP')) {
804 $ip = array_merge($ip, explode(',', str_replace(' ', '', $INPUT->server->str('HTTP_X_REAL_IP'))));
807 // remove any non-IP stuff
830 return $ip[count($ip) - 1];
838 * @link http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#code
840 * @deprecated 2018-04-27 you probably want media queries instead anyway
848 if ($INPUT->server->has('HTTP_X_WAP_PROFILE')) return true;
850 if (preg_match('/wap\.|\.wap/i', $INPUT->server->str('HTTP_ACCEPT'))) return true;
852 if (!$INPUT->server->has('HTTP_USER_AGENT')) return false;
859 'hand', 'mobi', 'phone', 'cdm', 'up\.b', 'audio', 'SIE\-', 'SEC\-', 'samsung', 'HTC', 'mot\-',
867 if (preg_match("/$uamatches/i", $INPUT->server->str('HTTP_USER_AGENT'))) return true;
880 if (preg_match('/^[a-zA-Z0-9\.]+>/u', $link)) return true;
934 if ((time() - filemtime($lock)) > $conf['locktime']) {
941 if ($ip == $INPUT->server->str('REMOTE_USER') || (session_id() && $session === session_id())) {
966 if ($INPUT->server->str('REMOTE_USER')) {
967 io_saveFile($lock, $INPUT->server->str('REMOTE_USER'));
974 * Unlock a page if it was locked by the user
989 if ($ip == $INPUT->server->str('REMOTE_USER') || $session == session_id()) {
1000 * also makes sure the given text is valid UTF-8
1012 // if the text is not valid UTF-8 we simply assume latin1
1089 if ($evt->advise_before(true)) {
1114 $evt->advise_after();
1163 '@USER@',
1182 $INPUT->server->str('REMOTE_USER'),
1203 * The range parameter needs to have the form "from-to"
1204 * and gives the range of the section in bytes - no
1205 * UTF-8 awareness is needed.
1210 * @param string $range in form "from-to"
1220 [$from, $to] = sexplode('-', $range, 2);
1221 // Make range zero-based, use defaults if marker is missing
1222 $from = $from ? $from - 1 : (0);
1223 $to = $to ? $to - 1 : (strlen($text));
1227 $slices[1] = substr($text, $from, $to - $from);
1276 * @deprecated 2021-11-28
1281 (new PageFile($id))->detectExternalEdit();
1293 * @param string $summary summary of text update
1294 * @param bool $minor mark this saved version as minor update
1300 $data = (new PageFile($id))->saveWikiText($text, $summary, $minor);
1313 $cache->removeCache();
1325 * @deprecated 2021-11-28
1330 return (new PageFile($id))->saveOldRevision();
1360 if ($conf['useacl'] && $INPUT->server->str('REMOTE_USER') && $minor) return false; //skip minors
1376 return $subscription->sendPageDiff($to, $tpl, $id, $rev, $summary, $current_rev);
1392 if (!$INPUT->server->has('HTTP_REFERER')) {
1395 $url = parse_url($INPUT->server->str('HTTP_REFERER'));
1418 $q = preg_split('/[\s\'"\\\\`()\]\[?:!\.{};,#+*<>\\/]+/', $q, -1, PREG_SPLIT_NO_EMPTY);
1439 while ($size >= 1024 && ($i < $count - 1)) {
1444 return round($size, $dec) . "\xC2\xA0" . $sizes[$i]; //non-breaking space
1459 $ago = time() - $dt;
1485 * strftime - %f can be used to get the value from datetime_h()
1517 $date_mod = date('Y-m-d\TH:i:s', $int_date);
1539 $obfuscate = ['@' => ' [at] ', '.' => ' [dot] ', '-' => ' [dash] '];
1570 * -1 (infinite size) will be reported as -1
1578 switch (strtoupper(substr($value, -1))) {
1580 $ret = (int) substr($value, 0, -1) * 1024 * 1024 * 1024;
1583 $ret = (int) substr($value, 0, -1) * 1024 * 1024;
1586 $ret = (int) substr($value, 0, -1) * 1024;
1623 $max -= PhpString::strlen($keep);
1629 PhpString::substr($short, 0, $half - 1) .
1631 PhpString::substr($short, $len - $half);
1635 * Return the users real name or e-mail address for use
1638 * @param string|null $username or null when currently logged-in user should be used
1640 * @return string html or plain text(not escaped) of formatted user name
1652 * @param string|null $username or null when currently logged-in user should be used
1654 * @return string html or plain text(not escaped) of formatted user name
1660 global $conf, $INFO;
1668 'username' => $username, // the unique user name
1681 'userlink' => '', // formatted user name as will be returned
1685 $data['username'] = $username = $INPUT->server->str('REMOTE_USER');
1687 $data['name'] = $INFO['userinfo']['name'] . ' (' . $INPUT->server->str('REMOTE_USER') . ')';
1689 $data['name'] = '<bdi>' . hsc($INFO['userinfo']['name']) . '</bdi> ' .
1690 '(<bdi>' . hsc($INPUT->server->str('REMOTE_USER')) . '</bdi>)';
1695 if ($evt->advise_before(true)) {
1698 $info = $auth->getUserData($username);
1700 if ($conf['showuseras'] != 'loginname' && isset($info) && $info) {
1704 $data['name'] = $textonly ? $info['name'] : hsc($info['name']);
1708 $data['name'] = obfuscate($info['mail']);
1721 if (!isset($info) && $auth instanceof AuthPlugin) {
1722 $info = $auth->getUserData($username);
1724 if (isset($info) && $info) {
1726 $data['link']['url'] = 'mailto:' . obfuscate($info['mail']);
1731 if (empty($xhtml_renderer->interwiki)) {
1732 $xhtml_renderer->interwiki = getInterwiki();
1734 $shortcut = 'user';
1736 $data['link']['url'] = $xhtml_renderer->_resolveInterWiki($shortcut, $username, $exists);
1762 $data['userlink'] = $xhtml_renderer->_formatLink($data['link']);
1765 $evt->advise_after();
1777 * @param string $type - type of image 'badge' or 'button'
1789 if (str_starts_with($conf['license'], 'cc-')) {
1815 if ($limit == -1) return true; // unlimited
1862 // check if running on IIS < 6 with CGI-PHP
1864 $INPUT->server->has('SERVER_SOFTWARE') && $INPUT->server->has('GATEWAY_INTERFACE') &&
1865 (strpos($INPUT->server->str('GATEWAY_INTERFACE'), 'CGI') !== false) &&
1866 (preg_match('|^Microsoft-IIS/(\d)\.\d$|', trim($INPUT->server->str('SERVER_SOFTWARE')), $matches)) &&
1876 // pass info about the redirect back to the test suite
1879 $testRequest->addData('send_redirect', $url);
1933 for ($i = $cnt - 2; $i >= 0; $i -= 2) {
2029 $content = preg_replace('/<!--.*?(-->)/s', '', $content); // comments