Lines Matching full:if
51 // unset REMOTE_USER if empty
52 if ($INPUT->server->str('REMOTE_USER') === '') {
56 if (!$conf['useacl']) return false;
60 if ($conf['authtype'] === $plugin) {
66 if (!$auth instanceof AuthPlugin) {
71 if ($auth->success == false) {
81 if (!$conf['rememberme']) $INPUT->set('r', false);
86 if (preg_match('~^Basic ([a-z\d/+]*={0,2})$~i', $header, $matches)) {
91 // if no credentials were given try to use HTTP auth (for SSO)
92 …if (!$INPUT->str('u') && empty($_COOKIE[DOKU_COOKIE]) && !empty($INPUT->server->str('PHP_AUTH_USER…
99 if (true === $auth->success) {
104 if (!auth_tokenlogin()) {
107 if ($auth->canDo('external')) {
111 if ($ok === null) {
144 if (!is_readable($config_cascade['acl']['default'])) return [];
151 if (empty($line) || ($line[0] == '#')) continue; // skip blank lines & comments
155 if (strstr($line, '%USER%')) {
156 // if user is not logged in, this ACL line is meaningless - skip it
157 if (!$INPUT->server->has('REMOTE_USER')) continue;
164 if (strstr($line, '%GROUP%')) {
165 // if user is not logged in, grps is empty, no output will be added (i.e. skipped)
166 if (isset($USERINFO['grps'])) {
184 * @return bool true if token login succeeded
192 if (!$auth) return false;
197 if (function_exists('getallheaders')) {
199 if (is_array($headers)) {
205 if (!$headers) {
207 if (substr($key, 0, 5) === 'HTTP_') {
214 if (isset($headers['authorization'])) {
216 if ($type !== 'Bearer') $token = ''; // not the token we want
220 if (isset($headers['x-dokuwiki-token'])) {
224 if (empty($token)) return false;
237 if (!$USERINFO) return false;
269 * The authentication works like this: if a username was given
270 * a new login is assumed and user/password are checked. If they
276 * If no username was given the cookie is checked: if the username,
280 * If a cookie was found but no session info was availabe the
306 if (!$auth instanceof AuthPlugin) return false;
308 if (!empty($user)) {
310 …if (!empty($pass)) usleep(random_int(0, 250)); // add a random delay to prevent timing attacks #44…
311 if (!empty($pass) && $auth->checkPass($user, $pass)) {
319 if (!$silent) {
329 if ($user && $pass) {
330 // we got a cookie - see if we can trust it
333 if (isset($_SESSION[DOKU_COOKIE])) {
335 if (
394 * if no such file is found a random key is created and
397 * @param bool $addsession if true, the sessionid is added to the salt
398 * @param bool $secure if security is more important than keeping the old value
406 if (defined('SIMPLE_TEST')) {
411 if ($secure || !file_exists($file)) {
415 if (empty($salt)) {
419 if ($addsession) {
527 if (isset($_SESSION[DOKU_COOKIE]['auth']['user']))
529 if (isset($_SESSION[DOKU_COOKIE]['auth']['pass']))
531 if (isset($_SESSION[DOKU_COOKIE]['auth']['info']))
533 if (!$keepbc && isset($_SESSION[DOKU_COOKIE]['bc']))
547 if ($auth instanceof AuthPlugin) {
553 * Check if a user is a manager
562 * @param bool $adminonly when true checks if user is admin
579 if (!$auth instanceof AuthPlugin) return false;
580 if (is_null($user)) {
581 if (!$INPUT->server->has('REMOTE_USER')) {
587 if (is_null($groups)) {
589 if ($USERINFO && $user === $INPUT->server->str('REMOTE_USER')) {
600 if (!isset($cache[$cachekey]) || $recache) {
605 if (!$ok && !$adminonly) {
616 * Check if a user is admin
650 if (!$auth instanceof AuthPlugin) return false;
653 if (!$auth->isCaseSensitive()) {
668 if ($member == '@ALL') return true;
669 if (!$auth->isCaseSensitive()) $member = PhpString::strtolower($member);
670 if ($member[0] == '@') {
672 if (in_array($member, $groups)) return true;
675 if ($member == $user) return true;
699 # if no ACL is used always return upload rights
700 if (!$conf['useacl']) return AUTH_UPLOAD;
747 // if no ACL is used always return upload rights
748 if (!$conf['useacl']) return AUTH_UPLOAD;
749 if (!$auth instanceof AuthPlugin) return AUTH_NONE;
750 if (!is_array($AUTH_ACL)) return AUTH_NONE;
753 if (!is_array($groups)) $groups = [];
755 //if user is superuser or in superusergroup return 255 (acl_admin)
756 if (auth_isadmin($user, $groups)) {
760 if (!$auth->isCaseSensitive()) {
779 if ($user) $groups[] = $user;
783 if (count($matches)) {
787 if (!$auth->isCaseSensitive() && $acl[1] !== '@ALL') {
790 if (!in_array($acl[1], $groups)) {
793 if ($acl[2] > AUTH_DELETE) $acl[2] = AUTH_DELETE; //no admins in the ACL!
794 if ($acl[2] > $perm) {
798 if ($perm > -1) {
805 if ($ns) {
813 if (count($matches)) {
817 if (!$auth->isCaseSensitive() && $acl[1] !== '@ALL') {
820 if (!in_array($acl[1], $groups)) {
823 if ($acl[2] > AUTH_DELETE) $acl[2] = AUTH_DELETE; //no admins in the ACL!
824 if ($acl[2] > $perm) {
829 if ($perm != -1) {
836 if ($path != '*') {
838 if ($path == ':*') $path = '*';
874 if ($name == '%USER%') return $name;
875 if ($name == '%GROUP%') return $name;
877 if (!isset($cache[$name][$skip_group])) {
878 if ($skip_group && $name[0] == '@') {
930 if ($evt->advise_before(true)) {
964 if (!$auth instanceof AuthPlugin) return false;
969 if (!$userinfo['mail']) return false;
1003 if (!$INPUT->post->bool('save')) return false;
1004 if (!actionOK('register')) return false;
1013 if (empty($login) || empty($fullname) || empty($email)) {
1018 if ($conf['autopasswd']) {
1029 if (!mail_isvalid($email)) {
1035 if (!$auth->triggerUserMod('create', [$login, $pass, $fullname, $email])) {
1045 if (!$conf['autopasswd']) {
1051 if (auth_sendPassword($login, $pass)) {
1076 if (!$INPUT->post->bool('save')) return false;
1077 if (!checkSecurityToken()) return false;
1079 if (!actionOK('profile')) {
1090 if ($changes['pass'] != $INPUT->post->str('passchk')) {
1100 if (
1107 if (!mail_isvalid($changes['mail']) && $auth->canDo('modMail')) {
1115 if (!$auth->canDo('modName')) unset($changes['name']);
1116 if (!$auth->canDo('modMail')) unset($changes['mail']);
1117 if (!$auth->canDo('modPass')) unset($changes['pass']);
1120 if ($changes === []) {
1125 if ($conf['profileconfirm']) {
1126 if (!$auth->checkPass($INPUT->server->str('REMOTE_USER'), $INPUT->post->str('oldpass'))) {
1132 if (!$auth->triggerUserMod('modify', [$INPUT->server->str('REMOTE_USER'), &$changes])) {
1137 if (array_key_exists('pass', $changes) && $changes['pass']) {
1167 if (!$INPUT->post->bool('delete')) return false;
1168 if (!checkSecurityToken()) return false;
1171 if (!actionOK('profile_delete') || !$auth->canDo('delUser')) {
1176 if (!$INPUT->post->bool('confirm_delete')) {
1181 if ($conf['profileconfirm']) {
1182 if (!$auth->checkPass($INPUT->server->str('REMOTE_USER'), $INPUT->post->str('oldpass'))) {
1190 if ($auth->triggerUserMod('delete', [$deleted])) {
1223 if (!actionOK('resendpwd')) {
1230 if ($token) {
1234 if (!file_exists($tfile)) {
1240 if ((time() - filemtime($tfile)) > (3 * 60 * 60 * 24)) {
1249 if (!$userinfo['mail']) {
1254 if (!$conf['autopasswd']) { // we let the user choose a password
1258 if (!$pass) return false;
1259 if ($pass != $INPUT->str('passchk')) {
1265 if (!$auth->triggerUserMod('modify', [$user, ['pass' => $pass]])) {
1271 if (!$auth->triggerUserMod('modify', [$user, ['pass' => $pass]])) {
1276 if (auth_sendPassword($user, $pass)) {
1288 if (!$INPUT->post->bool('save')) return false;
1290 if (!$INPUT->post->str('login')) {
1298 if (!$userinfo['mail']) {
1317 if ($mail->send()) {
1330 * If the selected method needs a salt and none was given, a random one
1346 if ($clear === null) {
1350 if (empty($method)) $method = $conf['passcrypt'];
1355 if (!method_exists($pass, $call)) {
1368 * @return bool true if both match
1375 if ($crypt === DOKU_UNUSABLE_PASSWORD) {
1398 if (!$auth instanceof AuthPlugin) return false;
1430 if (!isset($_COOKIE[DOKU_COOKIE])) {