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);
271 * together with the username in a cookie - the same info is stored
297 global $USERINFO;
298 global $conf;
299 global $lang;
301 global $auth;
303 global $INPUT;
310 if (!empty($pass) && $auth->checkPass($user, $pass)) {
312 $INPUT->server->set('REMOTE_USER', $user);
313 $secret = auth_cookiesalt(!$sticky, true); //bind non-sticky to session
317 //invalid credentials - log off
320 msg($lang['badlogin'], -1);
329 // we got a cookie - see if we can trust it
336 $auth->useSessionCache($user) &&
337 ($session['time'] >= time() - $conf['auth_security_timeout']) &&
342 // he has session, cookie and browser right - let him in
343 $INPUT->server->set('REMOTE_USER', $user);
348 // no we don't trust it yet - recheck pass but silent
349 $secret = auth_cookiesalt(!$sticky, true); //bind non-sticky to session
362 * This is neither unique nor unfakable - still it adds some
373 global $INPUT;
380 $INPUT->server->str('HTTP_USER_AGENT'),
381 $INPUT->server->str('HTTP_ACCEPT_LANGUAGE'),
407 global $conf;
467 $cipher->setPassword($secret, 'pbkdf2', 'sha1', 'phpseclib');
468 $cipher->setIV($iv);
472 http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf, Appendix C
476 return $cipher->encrypt($iv . $data);
492 $cipher->setPassword($secret, 'pbkdf2', 'sha1', 'phpseclib');
493 $cipher->setIV($iv);
496 return $cipher->decrypt(substr($ciphertext, 16));
511 * @param bool $keepbc - when true, the breadcrumb data is not cleared
515 global $conf;
516 global $USERINFO;
518 global $auth;
520 global $INPUT;
533 $INPUT->server->remove('REMOTE_USER');
538 'expires' => time() - 600000,
546 $auth->logOff();
569 global $conf;
570 global $USERINFO;
572 global $auth;
574 global $INPUT;
579 if (!$INPUT->server->has('REMOTE_USER')) {
582 $user = $INPUT->server->str('REMOTE_USER');
587 if ($USERINFO && $user === $INPUT->server->str('REMOTE_USER')) {
590 $groups = $auth->getUserData($user);
647 global $auth;
651 if (!$auth->isCaseSensitive()) {
655 $user = $auth->cleanUser($user);
667 if (!$auth->isCaseSensitive()) $member = PhpString::strtolower($member);
669 $member = $auth->cleanGroup(substr($member, 1));
672 $member = $auth->cleanUser($member);
693 global $conf;
694 global $USERINFO;
696 global $INPUT;
699 …return auth_aclcheck($id, $INPUT->server->str('REMOTE_USER'), is_array($USERINFO) ? $USERINFO['grp…
740 global $conf;
741 global $AUTH_ACL;
743 global $auth;
758 if (!$auth->isCaseSensitive()) {
762 $user = auth_nameencode($auth->cleanUser($user));
771 $perm = -1;
785 if (!$auth->isCaseSensitive() && $acl[1] !== '@ALL') {
796 if ($perm > -1) {
797 //we had a match - return it
815 if (!$auth->isCaseSensitive() && $acl[1] !== '@ALL') {
826 //we had a match - return it
827 if ($perm != -1) {
853 * are encoded UTF-8 multibyte are left as is (different from usual
867 global $cache_authname;
878 '/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f])/',
884 '/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f])/',
902 return '%' . dechex(ord(substr($matches[1], -1)));
928 if ($evt->advise_before(true)) {
932 $s = '!$%&?+*~#-_:.;,'; // specials
936 $data['password'] .= $c[auth_random(0, strlen($c) - 1)];
937 $data['password'] .= $v[auth_random(0, strlen($v) - 1)];
938 $data['password'] .= $a[auth_random(0, strlen($a) - 1)];
941 $data['password'] .= $s[auth_random(0, strlen($s) - 1)] . auth_random(10, 99);
943 $evt->advise_after();
959 global $lang;
961 global $auth;
964 $user = $auth->cleanUser($user);
965 $userinfo = $auth->getUserData($user, false);
977 $mail->to($mail->getCleanName($userinfo['name']) . ' <' . $userinfo['mail'] . '>');
978 $mail->subject($lang['regpwmail']);
979 $mail->setBody($text, $trep);
980 return $mail->send();
986 * This registers a new user - Data is read directly from $_POST
995 global $lang;
996 global $conf;
998 global $auth;
999 global $INPUT;
1001 if (!$INPUT->post->bool('save')) return false;
1005 $login = trim($auth->cleanUser($INPUT->post->str('login')));
1006 $fullname = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $INPUT->post->str('fullname')));
1007 $email = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $INPUT->post->str('email')));
1008 $pass = $INPUT->post->str('pass');
1009 $passchk = $INPUT->post->str('passchk');
1012 msg($lang['regmissing'], -1);
1019 msg($lang['regmissing'], -1); // complain about missing passwords
1022 msg($lang['regbadpass'], -1); // complain about misspelled passwords
1028 msg($lang['regbadmail'], -1);
1033 if (!$auth->triggerUserMod('create', [$login, $pass, $fullname, $email])) {
1034 msg($lang['regfail'], -1);
1040 $subscription->sendRegister($login, $fullname, $email);
1053 msg($lang['regmailfail'], -1);
1067 global $conf;
1068 global $lang;
1070 global $auth;
1072 global $INPUT;
1074 if (!$INPUT->post->bool('save')) return false;
1078 msg($lang['profna'], -1);
1083 $changes['pass'] = $INPUT->post->str('newpass');
1084 $changes['name'] = $INPUT->post->str('fullname');
1085 $changes['mail'] = $INPUT->post->str('email');
1088 if ($changes['pass'] != $INPUT->post->str('passchk')) {
1089 msg($lang['regbadpass'], -1);
1094 $changes['name'] = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $changes['name']));
1095 $changes['mail'] = trim(preg_replace('/[\x00-\x1f:<>&%,;]+/', '', $changes['mail']));
1099 (empty($changes['name']) && $auth->canDo('modName')) ||
1100 (empty($changes['mail']) && $auth->canDo('modMail'))
1102 msg($lang['profnoempty'], -1);
1105 if (!mail_isvalid($changes['mail']) && $auth->canDo('modMail')) {
1106 msg($lang['regbadmail'], -1);
1113 if (!$auth->canDo('modName')) unset($changes['name']);
1114 if (!$auth->canDo('modMail')) unset($changes['mail']);
1115 if (!$auth->canDo('modPass')) unset($changes['pass']);
1119 msg($lang['profnochange'], -1);
1124 if (!$auth->checkPass($INPUT->server->str('REMOTE_USER'), $INPUT->post->str('oldpass'))) {
1125 msg($lang['badpassconfirm'], -1);
1130 if (!$auth->triggerUserMod('modify', [$INPUT->server->str('REMOTE_USER'), &$changes])) {
1131 msg($lang['proffail'], -1);
1139 auth_setCookie($INPUT->server->str('REMOTE_USER'), $pass, (bool) $sticky);
1152 * Delete the current logged-in user
1158 global $conf;
1159 global $lang;
1161 global $auth;
1163 global $INPUT;
1165 if (!$INPUT->post->bool('delete')) return false;
1169 if (!actionOK('profile_delete') || !$auth->canDo('delUser')) {
1170 msg($lang['profnodelete'], -1);
1174 if (!$INPUT->post->bool('confirm_delete')) {
1175 msg($lang['profconfdeletemissing'], -1);
1180 if (!$auth->checkPass($INPUT->server->str('REMOTE_USER'), $INPUT->post->str('oldpass'))) {
1181 msg($lang['badpassconfirm'], -1);
1187 $deleted[] = $INPUT->server->str('REMOTE_USER');
1188 if ($auth->triggerUserMod('delete', [$deleted])) {
1202 * - handling the first request of password reset
1203 * - validating the password reset auth token
1214 global $lang;
1215 global $conf;
1217 global $auth;
1219 global $INPUT;
1222 msg($lang['resendna'], -1);
1226 $token = preg_replace('/[^a-f0-9]+/', '', $INPUT->str('pwauth'));
1229 // we're in token phase - get user info from token
1233 msg($lang['resendpwdbadauth'], -1);
1234 $INPUT->remove('pwauth');
1238 if ((time() - filemtime($tfile)) > (3 * 60 * 60 * 24)) {
1239 msg($lang['resendpwdbadauth'], -1);
1240 $INPUT->remove('pwauth');
1246 $userinfo = $auth->getUserData($user, false);
1248 msg($lang['resendpwdnouser'], -1);
1253 $pass = $INPUT->str('pass');
1257 if ($pass != $INPUT->str('passchk')) {
1258 msg($lang['regbadpass'], -1);
1263 if (!$auth->triggerUserMod('modify', [$user, ['pass' => $pass]])) {
1264 msg($lang['proffail'], -1);
1269 if (!$auth->triggerUserMod('modify', [$user, ['pass' => $pass]])) {
1270 msg($lang['proffail'], -1);
1277 msg($lang['regmailfail'], -1);
1286 if (!$INPUT->post->bool('save')) return false;
1288 if (!$INPUT->post->str('login')) {
1289 msg($lang['resendpwdmissing'], -1);
1292 $user = trim($auth->cleanUser($INPUT->post->str('login')));
1295 $userinfo = $auth->getUserData($user, false);
1297 msg($lang['resendpwdnouser'], -1);
1312 $mail->to($userinfo['name'] . ' <' . $userinfo['mail'] . '>');
1313 $mail->subject($lang['regpwmail']);
1314 $mail->setBody($text, $trep);
1315 if ($mail->send()) {
1318 msg($lang['regmailfail'], -1);
1342 global $conf;
1354 msg("Unsupported crypt method $method", -1);
1358 return $pass->$call($clear, $salt);
1378 return $pass->verify_hash($clear, $crypt);
1391 global $conf;
1393 global $auth;
1394 global $USERINFO;
1397 $USERINFO = $auth->getUserData($user);