Lines Matching +full:- +full:- +full:global
41 global $conf;
43 global $auth;
45 global $INPUT;
46 global $AUTH_ACL;
47 global $lang;
49 global $plugin_controller;
53 if ($INPUT->server->str('REMOTE_USER') === '') {
54 $INPUT->server->remove('REMOTE_USER');
60 foreach ($plugin_controller->getList('auth') as $plugin) {
62 $auth = $plugin_controller->load('auth', $plugin);
68 msg($lang['authtempfail'], -1);
72 if ($auth->success == false) {
76 msg($lang['authtempfail'], -1);
81 $INPUT->set('http_credentials', false);
82 if (!$conf['rememberme']) $INPUT->set('r', false);
86 …$header = $INPUT->server->str('HTTP_AUTHORIZATION') ?: $INPUT->server->str('REDIRECT_HTTP_AUTHORIZ…
87 if (preg_match('~^Basic ([a-z\d/+]*={0,2})$~i', $header, $matches)) {
93 …if (!$INPUT->str('u') && empty($_COOKIE[DOKU_COOKIE]) && !empty($INPUT->server->str('PHP_AUTH_USER…
94 $INPUT->set('u', $INPUT->server->str('PHP_AUTH_USER'));
95 $INPUT->set('p', $INPUT->server->str('PHP_AUTH_PW'));
96 $INPUT->set('http_credentials', true);
100 if (true === $auth->success) {
101 $INPUT->set('u', $auth->cleanUser(stripctl($INPUT->str('u'))));
102 $INPUT->set('p', stripctl($INPUT->str('p')));
108 if ($auth->canDo('external')) {
109 $ok = $auth->trustExternal($INPUT->str('u'), $INPUT->str('p'), $INPUT->bool('r'));
116 'user' => $INPUT->str('u'),
117 'password' => $INPUT->str('p'),
118 'sticky' => $INPUT->bool('r'),
119 'silent' => $INPUT->bool('http_credentials')
125 //load ACL into a global array XXX
140 global $config_cascade;
141 global $USERINFO;
143 global $INPUT;
157 // if user is not logged in, this ACL line is meaningless - skip it
158 if (!$INPUT->server->has('REMOTE_USER')) continue;
160 $id = str_replace('%USER%', cleanID($INPUT->server->str('REMOTE_USER')), $id);
161 … $rest = str_replace('%USER%', auth_nameencode($INPUT->server->str('REMOTE_USER')), $rest);
189 global $USERINFO;
190 global $INPUT;
192 global $auth;
220 // check x-dokuwiki-token header
221 if (isset($headers['x-dokuwiki-token'])) {
222 $token = $headers['x-dokuwiki-token'];
231 msg(hsc($e->getMessage()), -1);
236 $user = $authtoken->getUser();
237 $USERINFO = $auth->getUserData($user);
241 $INPUT->server->set('REMOTE_USER', $user);
273 * together with the username in a cookie - the same info is stored
299 global $USERINFO;
300 global $conf;
301 global $lang;
303 global $auth;
305 global $INPUT;
312 if (!empty($pass) && $auth->checkPass($user, $pass)) {
314 $INPUT->server->set('REMOTE_USER', $user);
315 $secret = auth_cookiesalt(!$sticky, true); //bind non-sticky to session
319 //invalid credentials - log off
322 msg($lang['badlogin'], -1);
331 // we got a cookie - see if we can trust it
339 $auth->useSessionCache($user) &&
340 ($session['time'] >= time() - $conf['auth_security_timeout']) &&
345 // he has session, cookie and browser right - let him in
346 $INPUT->server->set('REMOTE_USER', $user);
351 // no we don't trust it yet - recheck pass but silent
352 $secret = auth_cookiesalt(!$sticky, true); //bind non-sticky to session
365 * This is neither unique nor unfakable - still it adds some
376 global $INPUT;
383 $INPUT->server->str('HTTP_USER_AGENT'),
384 $INPUT->server->str('HTTP_ACCEPT_LANGUAGE'),
410 global $conf;
470 $cipher->setPassword($secret, 'pbkdf2', 'sha1', 'phpseclib');
471 $cipher->setIV($iv);
475 http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf, Appendix C
479 return $cipher->encrypt($iv . $data);
495 $cipher->setPassword($secret, 'pbkdf2', 'sha1', 'phpseclib');
496 $cipher->setIV($iv);
499 return $cipher->decrypt(substr($ciphertext, 16));
514 * @param bool $keepbc - when true, the breadcrumb data is not cleared
518 global $conf;
519 global $USERINFO;
521 global $auth;
523 global $INPUT;
536 $INPUT->server->remove('REMOTE_USER');
541 'expires' => time() - 600000,
549 $auth->logOff();
572 global $conf;
573 global $USERINFO;
575 global $auth;
577 global $INPUT;
582 if (!$INPUT->server->has('REMOTE_USER')) {
585 $user = $INPUT->server->str('REMOTE_USER');
590 if ($USERINFO && $user === $INPUT->server->str('REMOTE_USER')) {
593 $groups = $auth->getUserData($user);
650 global $auth;
654 if (!$auth->isCaseSensitive()) {
658 $user = $auth->cleanUser($user);
659 $groups = array_map($auth->cleanGroup(...), $groups);
670 if (!$auth->isCaseSensitive()) $member = PhpString::strtolower($member);
672 $member = $auth->cleanGroup(substr($member, 1));
675 $member = $auth->cleanUser($member);
696 global $conf;
697 global $USERINFO;
699 global $INPUT;
702 …return auth_aclcheck($id, $INPUT->server->str('REMOTE_USER'), is_array($USERINFO) ? $USERINFO['grp…
708 * Media files do not have per-file ACLs; permissions are always evaluated against the namespace
709 * they live in. This returns the namespace wildcard path (e.g. "wiki:*" or "*" for root-namespace
758 global $conf;
759 global $AUTH_ACL;
761 global $auth;
776 if (!$auth->isCaseSensitive()) {
780 $user = auth_nameencode($auth->cleanUser($user));
781 $groups = array_map($auth->cleanGroup(...), $groups);
789 $perm = -1;
803 if (!$auth->isCaseSensitive() && $acl[1] !== '@ALL') {
814 if ($perm > -1) {
815 //we had a match - return it
833 if (!$auth->isCaseSensitive() && $acl[1] !== '@ALL') {
844 //we had a match - return it
845 if ($perm != -1) {
871 * are encoded UTF-8 multibyte are left as is (different from usual
885 global $cache_authname;
896 '/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f])/',
902 '/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f])/',
920 return '%' . dechex(ord(substr($matches[1], -1)));
946 if ($evt->advise_before(true)) {
950 $s = '!$%&?+*~#-_:.;,'; // specials
954 $data['password'] .= $c[auth_random(0, strlen($c) - 1)];
955 $data['password'] .= $v[auth_random(0, strlen($v) - 1)];
956 $data['password'] .= $a[auth_random(0, strlen($a) - 1)];
959 $data['password'] .= $s[auth_random(0, strlen($s) - 1)] . auth_random(10, 99);
961 $evt->advise_after();
977 global $lang;
979 global $auth;
982 $user = $auth->cleanUser($user);
983 $userinfo = $auth->getUserData($user, false);
995 $mail->to($mail->getCleanName($userinfo['name']) . ' <' . $userinfo['mail'] . '>');
996 $mail->subject($lang['regpwmail']);
997 $mail->setBody($text, $trep);
998 return $mail->send();
1004 * This registers a new user - Data is read directly from $_POST
1013 global $lang;
1014 global $conf;
1016 global $auth;
1017 global $INPUT;
1019 if (!$INPUT->post->bool('save')) return false;
1023 $login = trim($auth->cleanUser($INPUT->post->str('login')));
1024 $fullname = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $INPUT->post->str('fullname')));
1025 $email = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $INPUT->post->str('email')));
1026 $pass = $INPUT->post->str('pass');
1027 $passchk = $INPUT->post->str('passchk');
1030 msg($lang['regmissing'], -1);
1037 msg($lang['regmissing'], -1); // complain about missing passwords
1040 msg($lang['regbadpass'], -1); // complain about misspelled passwords
1046 msg($lang['regbadmail'], -1);
1051 if (!$auth->triggerUserMod('create', [$login, $pass, $fullname, $email])) {
1052 msg($lang['regfail'], -1);
1058 $subscription->sendRegister($login, $fullname, $email);
1071 msg($lang['regmailfail'], -1);
1085 global $conf;
1086 global $lang;
1088 global $auth;
1090 global $INPUT;
1092 if (!$INPUT->post->bool('save')) return false;
1096 msg($lang['profna'], -1);
1101 $changes['pass'] = $INPUT->post->str('newpass');
1102 $changes['name'] = $INPUT->post->str('fullname');
1103 $changes['mail'] = $INPUT->post->str('email');
1106 if ($changes['pass'] != $INPUT->post->str('passchk')) {
1107 msg($lang['regbadpass'], -1);
1112 $changes['name'] = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $changes['name']));
1113 $changes['mail'] = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $changes['mail']));
1117 (empty($changes['name']) && $auth->canDo('modName')) ||
1118 (empty($changes['mail']) && $auth->canDo('modMail'))
1120 msg($lang['profnoempty'], -1);
1123 if (!MailUtils::isValid($changes['mail']) && $auth->canDo('modMail')) {
1124 msg($lang['regbadmail'], -1);
1131 if (!$auth->canDo('modName')) unset($changes['name']);
1132 if (!$auth->canDo('modMail')) unset($changes['mail']);
1133 if (!$auth->canDo('modPass')) unset($changes['pass']);
1137 msg($lang['profnochange'], -1);
1142 if (!$auth->checkPass($INPUT->server->str('REMOTE_USER'), $INPUT->post->str('oldpass'))) {
1143 msg($lang['badpassconfirm'], -1);
1148 if (!$auth->triggerUserMod('modify', [$INPUT->server->str('REMOTE_USER'), &$changes])) {
1149 msg($lang['proffail'], -1);
1157 auth_setCookie($INPUT->server->str('REMOTE_USER'), $pass, (bool) $sticky);
1170 * Delete the current logged-in user
1176 global $conf;
1177 global $lang;
1179 global $auth;
1181 global $INPUT;
1183 if (!$INPUT->post->bool('delete')) return false;
1187 if (!actionOK('profile_delete') || !$auth->canDo('delUser')) {
1188 msg($lang['profnodelete'], -1);
1192 if (!$INPUT->post->bool('confirm_delete')) {
1193 msg($lang['profconfdeletemissing'], -1);
1198 if (!$auth->checkPass($INPUT->server->str('REMOTE_USER'), $INPUT->post->str('oldpass'))) {
1199 msg($lang['badpassconfirm'], -1);
1205 $deleted[] = $INPUT->server->str('REMOTE_USER');
1206 if ($auth->triggerUserMod('delete', [$deleted])) {
1220 * - handling the first request of password reset
1221 * - validating the password reset auth token
1232 global $lang;
1233 global $conf;
1235 global $auth;
1237 global $INPUT;
1240 msg($lang['resendna'], -1);
1244 $token = preg_replace('/[^a-f0-9]+/', '', $INPUT->str('pwauth'));
1247 // we're in token phase - get user info from token
1251 msg($lang['resendpwdbadauth'], -1);
1252 $INPUT->remove('pwauth');
1256 if ((time() - filemtime($tfile)) > (3 * 60 * 60 * 24)) {
1257 msg($lang['resendpwdbadauth'], -1);
1258 $INPUT->remove('pwauth');
1264 $userinfo = $auth->getUserData($user, false);
1266 msg($lang['resendpwdnouser'], -1);
1271 $pass = $INPUT->str('pass');
1275 if ($pass != $INPUT->str('passchk')) {
1276 msg($lang['regbadpass'], -1);
1281 if (!$auth->triggerUserMod('modify', [$user, ['pass' => $pass]])) {
1282 msg($lang['proffail'], -1);
1287 if (!$auth->triggerUserMod('modify', [$user, ['pass' => $pass]])) {
1288 msg($lang['proffail'], -1);
1295 msg($lang['regmailfail'], -1);
1304 if (!$INPUT->post->bool('save')) return false;
1306 if (!$INPUT->post->str('login')) {
1307 msg($lang['resendpwdmissing'], -1);
1310 $user = trim($auth->cleanUser($INPUT->post->str('login')));
1313 $userinfo = $auth->getUserData($user, false);
1315 msg($lang['resendpwdnouser'], -1);
1330 $mail->to($userinfo['name'] . ' <' . $userinfo['mail'] . '>');
1331 $mail->subject($lang['regpwmail']);
1332 $mail->setBody($text, $trep);
1333 if ($mail->send()) {
1336 msg($lang['regmailfail'], -1);
1360 global $conf;
1372 msg("Unsupported crypt method $method", -1);
1376 return $pass->$call($clear, $salt);
1396 return $pass->verify_hash($clear, $crypt);
1409 global $conf;
1411 global $auth;
1412 global $USERINFO;
1415 $USERINFO = $auth->getUserData($user);