You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by hu...@apache.org on 2012/06/22 08:49:13 UTC
svn commit: r1352781 - in /httpd/httpd/branches/2.4.x/docs/manual:
developer/modguide.html.en mod/core.html.fr mod/core.xml.meta
mod/mod_authn_core.html.en mod/mod_authn_core.html.fr
Author: humbedooh
Date: Fri Jun 22 06:49:12 2012
New Revision: 1352781
URL: http://svn.apache.org/viewvc?rev=1352781&view=rev
Log:
xforms
Modified:
httpd/httpd/branches/2.4.x/docs/manual/developer/modguide.html.en
httpd/httpd/branches/2.4.x/docs/manual/mod/core.html.fr
httpd/httpd/branches/2.4.x/docs/manual/mod/core.xml.meta
httpd/httpd/branches/2.4.x/docs/manual/mod/mod_authn_core.html.en
httpd/httpd/branches/2.4.x/docs/manual/mod/mod_authn_core.html.fr
Modified: httpd/httpd/branches/2.4.x/docs/manual/developer/modguide.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/developer/modguide.html.en?rev=1352781&r1=1352780&r2=1352781&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/developer/modguide.html.en (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/developer/modguide.html.en Fri Jun 22 06:49:12 2012
@@ -565,11 +565,14 @@ POST data is four simple lines:
<pre class="prettyprint lang-c">
-<a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__apr__tables.html#gad7ea82d6608a4a633fc3775694ab71e4">apr_table_t</a> *GET;
-<a href="http://ci.apache.org/projects/httpd/trunk/doxygen/structapr__array__header__t.html">apr_array_header_t</a> *POST;
-
-<a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__SCRIPT.html#gaed25877b529623a4d8f99f819ba1b7bd">ap_args_to_table</a>(r, &GET);
-<a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__DAEMON.html#ga9d426b6382b49754d4f87c55f65af202">ap_parse_form_data</a>(r, NULL, &POST, -1, 8192);
+<a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__apr__tables.html#gad7ea82d6608a4a633fc3775694ab71e4">apr_table_t</a> *GET; <em>
+</em><a href="http://ci.apache.org/projects/httpd/trunk/doxygen/structapr__array__header__t.html">apr_array_header_t</a>*POST;
+<em>
+</em>
+<a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__SCRIPT.html#gaed25877b529623a4d8f99f819ba1b7bd">
+ap_args_to_table</a>(r, &GET); <em>
+</em><a href="http://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__DAEMON.html#ga9d426b6382b49754d4f87c55f65af202">
+ap_parse_form_data</a>(r, NULL, &POST, -1, 8192);
</pre>
@@ -1608,34 +1611,56 @@ or check out the rest of our documentati
<div class="section">
<h2><a name="snippets" id="snippets">Some useful snippets of code</a></h2>
-<h3><a name="get_post" id="get_post">Retrieve a variable from POST form data</a></h3>
+<h3><a name="get_post" id="get_post">Retrieve variables from POST form data</a></h3>
<pre class="prettyprint lang-c">
-const char *read_post_value(const apr_array_header_t *fields, const char *key)
-{
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- int i;
- apr_table_entry_t *e = 0;
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- e = (apr_table_entry_t *) fields->elts;
- for(i = 0; i < fields->nelts; i++) {
- if(!strcmp(e[i].key, key)) return e[i].val;
+typedef struct {
+ const char* key;
+ const char* value;
+} keyValuePair;
+
+keyValuePair* readPost(request_req* r) {
+ apr_array_header_t *pairs = NULL;
+ apr_off_t len;
+ apr_size_t size;
+ int res;
+ int i = 0;
+ char *buffer;
+ keyValuePair* kvp;
+
+ res = ap_parse_form_data(r, NULL, &pairs, -1, HUGE_STRING_LEN);
+ if (res != OK || !pairs) return NULL; /* Return NULL if we failed or if there are is no POST data */
+ kvp = apr_pcalloc(r->pool, sizeof(keyValuePair) * (pairs->nelts + 1));
+ while (pairs && !apr_is_empty_array(pairs)) {
+ ap_form_pair_t *pair = (ap_form_pair_t *) apr_array_pop(pairs);
+ i++;
+ apr_brigade_length(pair->value, 1, &len);
+ size = (apr_size_t) len;
+ buffer = apr_palloc(r->pool, size + 1);
+ apr_brigade_flatten(pair->value, buffer, &size);
+ buffer[len] = 0;
+ kvp[i]->key = apr_pstrdup(r->pool, pair->name);
+ kvp[i]->value = buffer;
}
- return 0;
+ return kvp;
}
+
static int example_handler(request_req *r)
{
/*~~~~~~~~~~~~~~~~~~~~~~*/
- apr_array_header_t *POST;
- const char *value;
- /*~~~~~~~~~~~~~~~~~~~~~~*/
- ap_parse_form_data(r, NULL, &POST, -1, 8192);
- value = read_post_value(POST, "valueA");
- if (!value) value = "(undefined)";
- ap_rprintf(r, "The value of valueA is: %s", value);
+ keyValuePair* formData;
+ /*~~~~~~~~~~~~~~~~~~~~~~*/
+
+ formData = readPost();
+ if (formData) {
+ int i;
+ for (i = 0; formData[i]; i++) {
+ ap_rprintf(r, "%s == %s\n", formData[i]->key, formData[i]->value);
+ }
+ }
return OK;
}
</pre>
Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/core.html.fr
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/core.html.fr?rev=1352781&r1=1352780&r2=1352781&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/core.html.fr (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/core.html.fr Fri Jun 22 06:49:12 2012
@@ -31,8 +31,6 @@
<a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
<a href="../tr/mod/core.html" hreflang="tr" rel="alternate" title="Türkçe"> tr </a></p>
</div>
-<div class="outofdate">Cette traduction peut être périmée. Vérifiez la version
- anglaise pour les changements récents.</div>
<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Fonctionnalités de base du serveur HTTP Apache toujours
disponibles</td></tr>
<tr><th><a href="module-dict.html#Status">Statut:</a></th><td>Core</td></tr></table>
Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/core.xml.meta
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/core.xml.meta?rev=1352781&r1=1352780&r2=1352781&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/core.xml.meta (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/core.xml.meta Fri Jun 22 06:49:12 2012
@@ -10,7 +10,7 @@
<variant outdated="yes">de</variant>
<variant>en</variant>
<variant outdated="yes">es</variant>
- <variant outdated="yes">fr</variant>
+ <variant>fr</variant>
<variant outdated="yes">ja</variant>
<variant outdated="yes">tr</variant>
</variants>
Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/mod_authn_core.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/mod_authn_core.html.en?rev=1352781&r1=1352780&r2=1352781&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/mod_authn_core.html.en (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/mod_authn_core.html.en Fri Jun 22 06:49:12 2012
@@ -116,6 +116,9 @@ Alias /secure /webpages/secure
AuthType Basic
AuthName "LDAP Protected Place"
Require valid-user
+ # Note that Require ldap-* would not work here, since the
+ # AuthnProviderAlias does not provide the config to authorization providers
+ # that are implemented in the same module as the authentication provider.
</Directory>
</pre>
</div>
Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/mod_authn_core.html.fr
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/mod_authn_core.html.fr?rev=1352781&r1=1352780&r2=1352781&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/mod_authn_core.html.fr (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/mod_authn_core.html.fr Fri Jun 22 06:49:12 2012
@@ -123,6 +123,10 @@ Alias /secure /webpages/secure
AuthType Basic
AuthName LDAP_Protected Place
Require valid-user
+ # Notez que Require ldap-* ne fonctionnerait pas ici, car
+ # AuthnProviderAlias ne fournit pas de configuration pour les
+ # fournisseurs d'autorisation implémentés dans le même module que le
+ # fournisseur d'authentification.
</Directory>
</pre>
</div>