/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
*/
/* * Adapted to allow anonymous logins, just like with Anon-FTP, when * one gives the magic user name 'anonymous' and ones email address * as the password. * * Just add the following tokes to your <directory> setup: * * Anonymous magic-userid [magic-userid]... * * Anonymous_MustGiveEmail [ on | off ] default = on * Anonymous_LogEmail [ on | off ] default = on * Anonymous_VerifyEmail [ on | off ] default = off * Anonymous_NoUserId [ on | off ] default = off * * The magic user id is something like 'anonymous', it is NOT case sensitive. * * The MustGiveEmail flag can be used to force users to enter something * in the password field (like an email address). Default is on. * * Furthermore the 'NoUserID' flag can be set to allow completely empty * usernames in as well; this can be is convenient as a single return * in broken GUIs like W95 is often given by the user. The Default is off. * * Dirk.vanGulik@jrc.it; http://ewse.ceo.org; http://me-www.jrc.it/~dirkx *
*/
/* Ignore if we are not configured */ if (!conf->users && !conf->anyuserid) { return AUTH_USER_NOT_FOUND;
}
/* Do we allow an empty userID and/or is it the magic one
*/ if (!*user) { if (conf->nouserid) {
res = AUTH_USER_FOUND;
}
} elseif (conf->anyuserid) {
res = AUTH_USER_FOUND;
} else {
anon_auth_user *p = conf->users;
while (p) { if (!strcasecmp(user, p->user)) {
res = AUTH_USER_FOUND; break;
}
p = p->next;
}
}
/* Now if the supplied user-ID was ok, grant access if: * (a) no passwd was sent and no password and no verification * were configured. * (b) password was sent and no verification was configured * (c) verification was configured and the password (sent or not) * looks like an email address
*/ if ( (res == AUTH_USER_FOUND)
&& (!conf->mustemail || *sent_pw)
&& ( !conf->verifyemail
|| (ap_strchr_c(sent_pw, '@') && ap_strchr_c(sent_pw, '.'))))
{ if (conf->logemail && ap_is_initial_req(r)) {
ap_log_rerror(APLOG_MARK, APLOG_INFO, APR_SUCCESS, r, APLOGNO(01672) "Anonymous: Passwd <%s> Accepted",
sent_pw ? sent_pw : "\'none\'");
}
return AUTH_GRANTED;
}
return (res == AUTH_USER_NOT_FOUND ? res : AUTH_DENIED);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.