Lines Matching full:if

52     // unset REMOTE_USER if empty
53 if ($INPUT->server->str('REMOTE_USER') === '') {
57 if (!$conf['useacl']) return false;
61 if ($conf['authtype'] === $plugin) {
67 if (!$auth instanceof AuthPlugin) {
72 if ($auth->success == false) {
82 if (!$conf['rememberme']) $INPUT->set('r', false);
87 if (preg_match('~^Basic ([a-z\d/+]*={0,2})$~i', $header, $matches)) {
92 // if no credentials were given try to use HTTP auth (for SSO)
93if (!$INPUT->str('u') && empty($_COOKIE[DOKU_COOKIE]) && !empty($INPUT->server->str('PHP_AUTH_USER…
100 if (true === $auth->success) {
105 if (!auth_tokenlogin()) {
108 if ($auth->canDo('external')) {
112 if ($ok === null) {
145 if (!is_readable($config_cascade['acl']['default'])) return [];
152 if (empty($line) || ($line[0] == '#')) continue; // skip blank lines & comments
156 if (strstr($line, '%USER%')) {
157 // if user is not logged in, this ACL line is meaningless - skip it
158 if (!$INPUT->server->has('REMOTE_USER')) continue;
165 if (strstr($line, '%GROUP%')) {
166 // if user is not logged in, grps is empty, no output will be added (i.e. skipped)
167 if (isset($USERINFO['grps'])) {
185 * @return bool true if token login succeeded
193 if (!$auth) return false;
198 if (function_exists('getallheaders')) {
200 if (is_array($headers)) {
206 if (!$headers) {
208 if (str_starts_with($key, 'HTTP_')) {
215 if (isset($headers['authorization'])) {
217 if ($type !== 'Bearer') $token = ''; // not the token we want
221 if (isset($headers['x-dokuwiki-token'])) {
225 if (empty($token)) return false;
238 if (!$USERINFO) return false;
270 * The authentication works like this: if a username was given
271 * a new login is assumed and user/password are checked. If they
277 * If no username was given the cookie is checked: if the username,
281 * If a cookie was found but no session info was availabe the
307 if (!$auth instanceof AuthPlugin) return false;
309 if (!empty($user)) {
311if (!empty($pass)) usleep(random_int(0, 250)); // add a random delay to prevent timing attacks #44…
312 if (!empty($pass) && $auth->checkPass($user, $pass)) {
320 if (!$silent) {
330 if ($user && $pass) {
331 // we got a cookie - see if we can trust it
334 if (isset($_SESSION[DOKU_COOKIE])) {
336 if (
395 * if no such file is found a random key is created and
398 * @param bool $addsession if true, the sessionid is added to the salt
399 * @param bool $secure if security is more important than keeping the old value
407 if (defined('SIMPLE_TEST')) {
412 if ($secure || !file_exists($file)) {
416 if (empty($salt)) {
420 if ($addsession) {
528 if (isset($_SESSION[DOKU_COOKIE]['auth']['user']))
530 if (isset($_SESSION[DOKU_COOKIE]['auth']['pass']))
532 if (isset($_SESSION[DOKU_COOKIE]['auth']['info']))
534 if (!$keepbc && isset($_SESSION[DOKU_COOKIE]['bc']))
548 if ($auth instanceof AuthPlugin) {
554 * Check if a user is a manager
563 * @param bool $adminonly when true checks if user is admin
580 if (!$auth instanceof AuthPlugin) return false;
581 if (is_null($user)) {
582 if (!$INPUT->server->has('REMOTE_USER')) {
588 if (is_null($groups)) {
590 if ($USERINFO && $user === $INPUT->server->str('REMOTE_USER')) {
601 if (!isset($cache[$cachekey]) || $recache) {
606 if (!$ok && !$adminonly) {
617 * Check if a user is admin
651 if (!$auth instanceof AuthPlugin) return false;
654 if (!$auth->isCaseSensitive()) {
669 if ($member == '@ALL') return true;
670 if (!$auth->isCaseSensitive()) $member = PhpString::strtolower($member);
671 if ($member[0] == '@') {
673 if (in_array($member, $groups)) return true;
676 if ($member == $user) return true;
700 # if no ACL is used always return upload rights
701 if (!$conf['useacl']) return AUTH_UPLOAD;
763 // if no ACL is used always return upload rights
764 if (!$conf['useacl']) return AUTH_UPLOAD;
765 if (!$auth instanceof AuthPlugin) return AUTH_NONE;
766 if (!is_array($AUTH_ACL)) return AUTH_NONE;
769 if (!is_array($groups)) $groups = [];
771 //if user is superuser or in superusergroup return 255 (acl_admin)
772 if (auth_isadmin($user, $groups)) {
776 if (!$auth->isCaseSensitive()) {
795 if ($user) $groups[] = $user;
799 if (count($matches)) {
803 if (!$auth->isCaseSensitive() && $acl[1] !== '@ALL') {
806 if (!in_array($acl[1], $groups)) {
809 if ($acl[2] > AUTH_DELETE) $acl[2] = AUTH_DELETE; //no admins in the ACL!
810 if ($acl[2] > $perm) {
814 if ($perm > -1) {
821 if ($ns) {
829 if (count($matches)) {
833 if (!$auth->isCaseSensitive() && $acl[1] !== '@ALL') {
836 if (!in_array($acl[1], $groups)) {
839 if ($acl[2] > AUTH_DELETE) $acl[2] = AUTH_DELETE; //no admins in the ACL!
840 if ($acl[2] > $perm) {
845 if ($perm != -1) {
852 if ($path != '*') {
854 if ($path == ':*') $path = '*';
890 if ($name == '%USER%') return $name;
891 if ($name == '%GROUP%') return $name;
893 if (!isset($cache[$name][$skip_group])) {
894 if ($skip_group && $name[0] == '@') {
946 if ($evt->advise_before(true)) {
980 if (!$auth instanceof AuthPlugin) return false;
985 if (!$userinfo['mail']) return false;
1019 if (!$INPUT->post->bool('save')) return false;
1020 if (!actionOK('register')) return false;
1029 if (empty($login) || empty($fullname) || empty($email)) {
1034 if ($conf['autopasswd']) {
1045 if (!MailUtils::isValid($email)) {
1051 if (!$auth->triggerUserMod('create', [$login, $pass, $fullname, $email])) {
1061 if (!$conf['autopasswd']) {
1067 if (auth_sendPassword($login, $pass)) {
1092 if (!$INPUT->post->bool('save')) return false;
1093 if (!checkSecurityToken()) return false;
1095 if (!actionOK('profile')) {
1106 if ($changes['pass'] != $INPUT->post->str('passchk')) {
1116 if (
1123 if (!MailUtils::isValid($changes['mail']) && $auth->canDo('modMail')) {
1131 if (!$auth->canDo('modName')) unset($changes['name']);
1132 if (!$auth->canDo('modMail')) unset($changes['mail']);
1133 if (!$auth->canDo('modPass')) unset($changes['pass']);
1136 if ($changes === []) {
1141 if ($conf['profileconfirm']) {
1142 if (!$auth->checkPass($INPUT->server->str('REMOTE_USER'), $INPUT->post->str('oldpass'))) {
1148 if (!$auth->triggerUserMod('modify', [$INPUT->server->str('REMOTE_USER'), &$changes])) {
1153 if (array_key_exists('pass', $changes) && $changes['pass']) {
1183 if (!$INPUT->post->bool('delete')) return false;
1184 if (!checkSecurityToken()) return false;
1187 if (!actionOK('profile_delete') || !$auth->canDo('delUser')) {
1192 if (!$INPUT->post->bool('confirm_delete')) {
1197 if ($conf['profileconfirm']) {
1198 if (!$auth->checkPass($INPUT->server->str('REMOTE_USER'), $INPUT->post->str('oldpass'))) {
1206 if ($auth->triggerUserMod('delete', [$deleted])) {
1239 if (!actionOK('resendpwd')) {
1246 if ($token) {
1250 if (!file_exists($tfile)) {
1256 if ((time() - filemtime($tfile)) > (3 * 60 * 60 * 24)) {
1265 if (!$userinfo['mail']) {
1270 if (!$conf['autopasswd']) { // we let the user choose a password
1274 if (!$pass) return false;
1275 if ($pass != $INPUT->str('passchk')) {
1281 if (!$auth->triggerUserMod('modify', [$user, ['pass' => $pass]])) {
1287 if (!$auth->triggerUserMod('modify', [$user, ['pass' => $pass]])) {
1292 if (auth_sendPassword($user, $pass)) {
1304 if (!$INPUT->post->bool('save')) return false;
1306 if (!$INPUT->post->str('login')) {
1314 if (!$userinfo['mail']) {
1333 if ($mail->send()) {
1346 * If the selected method needs a salt and none was given, a random one
1362 if ($clear === null) {
1366 if (empty($method)) $method = $conf['passcrypt'];
1371 if (!method_exists($pass, $call)) {
1384 * @return bool true if both match
1391 if ($crypt === DOKU_UNUSABLE_PASSWORD) {
1414 if (!$auth instanceof AuthPlugin) return false;
1446 if (!isset($_COOKIE[DOKU_COOKIE])) {