Lines Matching +full:- +full:- +full:global
40 global $conf;
42 global $auth;
44 global $INPUT;
45 global $AUTH_ACL;
46 global $lang;
48 global $plugin_controller;
52 if ($INPUT->server->str('REMOTE_USER') === '') {
53 $INPUT->server->remove('REMOTE_USER');
59 foreach ($plugin_controller->getList('auth') as $plugin) {
61 $auth = $plugin_controller->load('auth', $plugin);
67 msg($lang['authtempfail'], -1);
71 if ($auth->success == false) {
75 msg($lang['authtempfail'], -1);
80 $INPUT->set('http_credentials', false);
81 if (!$conf['rememberme']) $INPUT->set('r', false);
85 …$header = $INPUT->server->str('HTTP_AUTHORIZATION') ?: $INPUT->server->str('REDIRECT_HTTP_AUTHORIZ…
86 if (preg_match('~^Basic ([a-z\d/+]*={0,2})$~i', $header, $matches)) {
92 …if (!$INPUT->str('u') && empty($_COOKIE[DOKU_COOKIE]) && !empty($INPUT->server->str('PHP_AUTH_USER…
93 $INPUT->set('u', $INPUT->server->str('PHP_AUTH_USER'));
94 $INPUT->set('p', $INPUT->server->str('PHP_AUTH_PW'));
95 $INPUT->set('http_credentials', true);
99 if (true === $auth->success) {
100 $INPUT->set('u', $auth->cleanUser(stripctl($INPUT->str('u'))));
101 $INPUT->set('p', stripctl($INPUT->str('p')));
107 if ($auth->canDo('external')) {
108 $ok = $auth->trustExternal($INPUT->str('u'), $INPUT->str('p'), $INPUT->bool('r'));
115 'user' => $INPUT->str('u'),
116 'password' => $INPUT->str('p'),
117 'sticky' => $INPUT->bool('r'),
118 'silent' => $INPUT->bool('http_credentials')
124 //load ACL into a global array XXX
139 global $config_cascade;
140 global $USERINFO;
142 global $INPUT;
156 // if user is not logged in, this ACL line is meaningless - skip it
157 if (!$INPUT->server->has('REMOTE_USER')) continue;
159 $id = str_replace('%USER%', cleanID($INPUT->server->str('REMOTE_USER')), $id);
160 … $rest = str_replace('%USER%', auth_nameencode($INPUT->server->str('REMOTE_USER')), $rest);
188 global $USERINFO;
189 global $INPUT;
191 global $auth;
219 // check x-dokuwiki-token header
220 if (isset($headers['x-dokuwiki-token'])) {
221 $token = $headers['x-dokuwiki-token'];
230 msg(hsc($e->getMessage()), -1);
235 $user = $authtoken->getUser();
236 $USERINFO = $auth->getUserData($user);
240 $INPUT->server->set('REMOTE_USER', $user);
272 * together with the username in a cookie - the same info is stored
298 global $USERINFO;
299 global $conf;
300 global $lang;
302 global $auth;
304 global $INPUT;
311 if (!empty($pass) && $auth->checkPass($user, $pass)) {
313 $INPUT->server->set('REMOTE_USER', $user);
314 $secret = auth_cookiesalt(!$sticky, true); //bind non-sticky to session
318 //invalid credentials - log off
321 msg($lang['badlogin'], -1);
330 // we got a cookie - see if we can trust it
338 $auth->useSessionCache($user) &&
339 ($session['time'] >= time() - $conf['auth_security_timeout']) &&
344 // he has session, cookie and browser right - let him in
345 $INPUT->server->set('REMOTE_USER', $user);
350 // no we don't trust it yet - recheck pass but silent
351 $secret = auth_cookiesalt(!$sticky, true); //bind non-sticky to session
364 * This is neither unique nor unfakable - still it adds some
375 global $INPUT;
382 $INPUT->server->str('HTTP_USER_AGENT'),
383 $INPUT->server->str('HTTP_ACCEPT_LANGUAGE'),
409 global $conf;
469 $cipher->setPassword($secret, 'pbkdf2', 'sha1', 'phpseclib');
470 $cipher->setIV($iv);
474 http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf, Appendix C
478 return $cipher->encrypt($iv . $data);
494 $cipher->setPassword($secret, 'pbkdf2', 'sha1', 'phpseclib');
495 $cipher->setIV($iv);
498 return $cipher->decrypt(substr($ciphertext, 16));
513 * @param bool $keepbc - when true, the breadcrumb data is not cleared
517 global $conf;
518 global $USERINFO;
520 global $auth;
522 global $INPUT;
535 $INPUT->server->remove('REMOTE_USER');
540 'expires' => time() - 600000,
548 $auth->logOff();
571 global $conf;
572 global $USERINFO;
574 global $auth;
576 global $INPUT;
581 if (!$INPUT->server->has('REMOTE_USER')) {
584 $user = $INPUT->server->str('REMOTE_USER');
589 if ($USERINFO && $user === $INPUT->server->str('REMOTE_USER')) {
592 $groups = $auth->getUserData($user);
649 global $auth;
653 if (!$auth->isCaseSensitive()) {
657 $user = $auth->cleanUser($user);
658 $groups = array_map($auth->cleanGroup(...), $groups);
669 if (!$auth->isCaseSensitive()) $member = PhpString::strtolower($member);
671 $member = $auth->cleanGroup(substr($member, 1));
674 $member = $auth->cleanUser($member);
695 global $conf;
696 global $USERINFO;
698 global $INPUT;
701 …return auth_aclcheck($id, $INPUT->server->str('REMOTE_USER'), is_array($USERINFO) ? $USERINFO['grp…
742 global $conf;
743 global $AUTH_ACL;
745 global $auth;
760 if (!$auth->isCaseSensitive()) {
764 $user = auth_nameencode($auth->cleanUser($user));
765 $groups = array_map($auth->cleanGroup(...), $groups);
773 $perm = -1;
787 if (!$auth->isCaseSensitive() && $acl[1] !== '@ALL') {
798 if ($perm > -1) {
799 //we had a match - return it
817 if (!$auth->isCaseSensitive() && $acl[1] !== '@ALL') {
828 //we had a match - return it
829 if ($perm != -1) {
855 * are encoded UTF-8 multibyte are left as is (different from usual
869 global $cache_authname;
880 '/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f])/',
886 '/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f])/',
904 return '%' . dechex(ord(substr($matches[1], -1)));
930 if ($evt->advise_before(true)) {
934 $s = '!$%&?+*~#-_:.;,'; // specials
938 $data['password'] .= $c[auth_random(0, strlen($c) - 1)];
939 $data['password'] .= $v[auth_random(0, strlen($v) - 1)];
940 $data['password'] .= $a[auth_random(0, strlen($a) - 1)];
943 $data['password'] .= $s[auth_random(0, strlen($s) - 1)] . auth_random(10, 99);
945 $evt->advise_after();
961 global $lang;
963 global $auth;
966 $user = $auth->cleanUser($user);
967 $userinfo = $auth->getUserData($user, false);
979 $mail->to($mail->getCleanName($userinfo['name']) . ' <' . $userinfo['mail'] . '>');
980 $mail->subject($lang['regpwmail']);
981 $mail->setBody($text, $trep);
982 return $mail->send();
988 * This registers a new user - Data is read directly from $_POST
997 global $lang;
998 global $conf;
1000 global $auth;
1001 global $INPUT;
1003 if (!$INPUT->post->bool('save')) return false;
1007 $login = trim($auth->cleanUser($INPUT->post->str('login')));
1008 $fullname = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $INPUT->post->str('fullname')));
1009 $email = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $INPUT->post->str('email')));
1010 $pass = $INPUT->post->str('pass');
1011 $passchk = $INPUT->post->str('passchk');
1014 msg($lang['regmissing'], -1);
1021 msg($lang['regmissing'], -1); // complain about missing passwords
1024 msg($lang['regbadpass'], -1); // complain about misspelled passwords
1030 msg($lang['regbadmail'], -1);
1035 if (!$auth->triggerUserMod('create', [$login, $pass, $fullname, $email])) {
1036 msg($lang['regfail'], -1);
1042 $subscription->sendRegister($login, $fullname, $email);
1055 msg($lang['regmailfail'], -1);
1069 global $conf;
1070 global $lang;
1072 global $auth;
1074 global $INPUT;
1076 if (!$INPUT->post->bool('save')) return false;
1080 msg($lang['profna'], -1);
1085 $changes['pass'] = $INPUT->post->str('newpass');
1086 $changes['name'] = $INPUT->post->str('fullname');
1087 $changes['mail'] = $INPUT->post->str('email');
1090 if ($changes['pass'] != $INPUT->post->str('passchk')) {
1091 msg($lang['regbadpass'], -1);
1096 $changes['name'] = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $changes['name']));
1097 $changes['mail'] = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $changes['mail']));
1101 (empty($changes['name']) && $auth->canDo('modName')) ||
1102 (empty($changes['mail']) && $auth->canDo('modMail'))
1104 msg($lang['profnoempty'], -1);
1107 if (!mail_isvalid($changes['mail']) && $auth->canDo('modMail')) {
1108 msg($lang['regbadmail'], -1);
1115 if (!$auth->canDo('modName')) unset($changes['name']);
1116 if (!$auth->canDo('modMail')) unset($changes['mail']);
1117 if (!$auth->canDo('modPass')) unset($changes['pass']);
1121 msg($lang['profnochange'], -1);
1126 if (!$auth->checkPass($INPUT->server->str('REMOTE_USER'), $INPUT->post->str('oldpass'))) {
1127 msg($lang['badpassconfirm'], -1);
1132 if (!$auth->triggerUserMod('modify', [$INPUT->server->str('REMOTE_USER'), &$changes])) {
1133 msg($lang['proffail'], -1);
1141 auth_setCookie($INPUT->server->str('REMOTE_USER'), $pass, (bool) $sticky);
1154 * Delete the current logged-in user
1160 global $conf;
1161 global $lang;
1163 global $auth;
1165 global $INPUT;
1167 if (!$INPUT->post->bool('delete')) return false;
1171 if (!actionOK('profile_delete') || !$auth->canDo('delUser')) {
1172 msg($lang['profnodelete'], -1);
1176 if (!$INPUT->post->bool('confirm_delete')) {
1177 msg($lang['profconfdeletemissing'], -1);
1182 if (!$auth->checkPass($INPUT->server->str('REMOTE_USER'), $INPUT->post->str('oldpass'))) {
1183 msg($lang['badpassconfirm'], -1);
1189 $deleted[] = $INPUT->server->str('REMOTE_USER');
1190 if ($auth->triggerUserMod('delete', [$deleted])) {
1204 * - handling the first request of password reset
1205 * - validating the password reset auth token
1216 global $lang;
1217 global $conf;
1219 global $auth;
1221 global $INPUT;
1224 msg($lang['resendna'], -1);
1228 $token = preg_replace('/[^a-f0-9]+/', '', $INPUT->str('pwauth'));
1231 // we're in token phase - get user info from token
1235 msg($lang['resendpwdbadauth'], -1);
1236 $INPUT->remove('pwauth');
1240 if ((time() - filemtime($tfile)) > (3 * 60 * 60 * 24)) {
1241 msg($lang['resendpwdbadauth'], -1);
1242 $INPUT->remove('pwauth');
1248 $userinfo = $auth->getUserData($user, false);
1250 msg($lang['resendpwdnouser'], -1);
1255 $pass = $INPUT->str('pass');
1259 if ($pass != $INPUT->str('passchk')) {
1260 msg($lang['regbadpass'], -1);
1265 if (!$auth->triggerUserMod('modify', [$user, ['pass' => $pass]])) {
1266 msg($lang['proffail'], -1);
1271 if (!$auth->triggerUserMod('modify', [$user, ['pass' => $pass]])) {
1272 msg($lang['proffail'], -1);
1279 msg($lang['regmailfail'], -1);
1288 if (!$INPUT->post->bool('save')) return false;
1290 if (!$INPUT->post->str('login')) {
1291 msg($lang['resendpwdmissing'], -1);
1294 $user = trim($auth->cleanUser($INPUT->post->str('login')));
1297 $userinfo = $auth->getUserData($user, false);
1299 msg($lang['resendpwdnouser'], -1);
1314 $mail->to($userinfo['name'] . ' <' . $userinfo['mail'] . '>');
1315 $mail->subject($lang['regpwmail']);
1316 $mail->setBody($text, $trep);
1317 if ($mail->send()) {
1320 msg($lang['regmailfail'], -1);
1344 global $conf;
1356 msg("Unsupported crypt method $method", -1);
1360 return $pass->$call($clear, $salt);
1380 return $pass->verify_hash($clear, $crypt);
1393 global $conf;
1395 global $auth;
1396 global $USERINFO;
1399 $USERINFO = $auth->getUserData($user);