|
From: <tre...@us...> - 2006-05-02 15:40:23
|
Revision: 5 Author: trekkie_lugfl Date: 2006-05-02 08:40:08 -0700 (Tue, 02 May 2006) ViewCVS: http://svn.sourceforge.net/yawcs/?rev=5&view=rev Log Message: ----------- configuration of mod_rewrite should now finaly work... Modified Paths: -------------- mod_vhost_ldap_ng/trunk/mod_vhost_ldap_ng.c Modified: mod_vhost_ldap_ng/trunk/mod_vhost_ldap_ng.c =================================================================== --- mod_vhost_ldap_ng/trunk/mod_vhost_ldap_ng.c 2006-05-01 18:40:38 UTC (rev 4) +++ mod_vhost_ldap_ng/trunk/mod_vhost_ldap_ng.c 2006-05-02 15:40:08 UTC (rev 5) @@ -636,78 +636,90 @@ while (attributes2[i]) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r, "[mod_vhost_ldap_ng.c] checking attribute: %s=%s", attributes2[i], vals[i] ); - if (strcasecmp (attributes2[i], "apacheServerName") == 0) { - reqc->name = apr_pstrdup (r->pool, vals[i]); + // little optimation.. (only try set attribute if it has a value) + if(vals[i]) + { + if (strcasecmp (attributes2[i], "apacheServerName") == 0) { + reqc->name = apr_pstrdup (r->pool, vals[i]); + } + else if (strcasecmp (attributes2[i], "apacheServerAdmin") == 0) { + reqc->admin = apr_pstrdup (r->pool, vals[i]); + } + else if (strcasecmp (attributes2[i], "apacheDocumentRoot") == 0) { + reqc->docroot = apr_pstrdup (r->pool, vals[i] ); + } + else if (strcasecmp (attributes2[i], "apacheScriptAlias") == 0) { + reqc->cgiroot = apr_pstrdup (r->pool, vals[i]); + } + else if (strcasecmp (attributes2[i], "apacheSuexecUid") == 0) { + reqc->uid = apr_pstrdup(r->pool, vals[i] ); + } + else if (strcasecmp (attributes2[i], "apacheSuexecGid") == 0) { + reqc->gid = apr_pstrdup(r->pool, vals[i] ); + } + else if( mod_php->cmds ) + { + if (strcasecmp (attributes2[i], "apachePhpValue") == 0) { + mod_vhost_ldap_ng_call_take2( r, mod_php, mod_php_cfg, "php_value", vals[i] ); + } + else if (strcasecmp (attributes2[i], "apachePhpFlag") == 0) { + mod_vhost_ldap_ng_call_take2( r, mod_php, mod_php_cfg, "php_flag", vals[i] ); + } + else if (strcasecmp (attributes2[i], "apachePhpAdminValue") == 0) { + mod_vhost_ldap_ng_call_take2( r, mod_php, mod_php_cfg, "php_admin_value", vals[i] ); + } + else if (strcasecmp (attributes2[i], "apachePhpAdminFlag") == 0) { + mod_vhost_ldap_ng_call_take2( r, mod_php, mod_php_cfg, "php_admin_flag", vals[i] ); + } + else if (strcasecmp (attributes2[i], "apachePHPINIDir") == 0) { + mod_vhost_ldap_ng_call_take1( r, mod_php, mod_php_cfg, "PHPINIDir", vals[i] ); + } + } + if( mod_rewrite->cmds) + { + if (strcasecmp (attributes2[i], "apacheRewriteEngine") == 0) { + // init mod_rewrite + if( strcasecmp( vals[i], "On") == 0 ) + { + ((void**)r->server->module_config)[ mod_rewrite->module_index ] = mod_rewrite->create_server_config( r->pool, r->server ); + mod_vhost_ldap_ng_call_flag( r, mod_rewrite, mod_rewrite_cfg, "RewriteEngine", vals[i] ); + } + } + else if (strcasecmp (attributes2[i], "apacheRewriteOptions") == 0) { + mod_vhost_ldap_ng_call_take2( r, mod_rewrite, mod_rewrite_cfg, "RewriteOptions", vals[i] ); + } + else if (strcasecmp (attributes2[i], "apacheRewriteBase") == 0) { + mod_vhost_ldap_ng_call_take1( r, mod_rewrite, mod_rewrite_cfg, "RewriteBase", vals[i] ); + } + else if (strcasecmp (attributes2[i], "apacheRewriteCond") == 0) { + mod_vhost_ldap_ng_call_raw( r, mod_rewrite, mod_rewrite_cfg, "RewriteCond", vals[i] ); + } + else if (strcasecmp (attributes2[i], "apacheRewriteRule") == 0) { + char* toParse = (char*)vals[i]; + char* rule = NULL; + char* last = NULL; + while( rule = apr_strtok( toParse, ";", &last)) + { + if(!toParse) + rule++; + toParse = NULL; + mod_vhost_ldap_ng_call_raw( r, mod_rewrite, mod_rewrite_cfg, "RewriteRule", rule); + } + } + else if (strcasecmp (attributes2[i], "apacheRewriteMap") == 0) { + mod_vhost_ldap_ng_call_take2( r, mod_rewrite, mod_rewrite_cfg, "RewriteMap", vals[i] ); + } + else if (strcasecmp (attributes2[i], "apacheRewriteLock") == 0) { + mod_vhost_ldap_ng_call_take1( r, mod_rewrite, mod_rewrite_cfg, "RewriteOptions", vals[i] ); + } + else if (strcasecmp (attributes2[i], "apacheRewriteLog") == 0) { + mod_vhost_ldap_ng_call_take1( r, mod_rewrite, mod_rewrite_cfg, "RewriteLog", vals[i] ); + } + else if (strcasecmp (attributes2[i], "apacheRewriteLogLevel") == 0) { + mod_vhost_ldap_ng_call_take1( r, mod_rewrite, mod_rewrite_cfg, "RewriteLogLevel", vals[i] ); + } + } } - else if (strcasecmp (attributes2[i], "apacheServerAdmin") == 0) { - reqc->admin = apr_pstrdup (r->pool, vals[i]); - } - else if (strcasecmp (attributes2[i], "apacheDocumentRoot") == 0) { - reqc->docroot = apr_pstrdup (r->pool, vals[i] ); - } - else if (strcasecmp (attributes2[i], "apacheScriptAlias") == 0) { - reqc->cgiroot = apr_pstrdup (r->pool, vals[i]); - } - else if (strcasecmp (attributes2[i], "apacheSuexecUid") == 0) { - reqc->uid = apr_pstrdup(r->pool, vals[i] ); - } - else if (strcasecmp (attributes2[i], "apacheSuexecGid") == 0) { - reqc->gid = apr_pstrdup(r->pool, vals[i] ); - } - else if( mod_php->cmds ) - { - if (strcasecmp (attributes2[i], "apachePhpValue") == 0) { - mod_vhost_ldap_ng_call_take2( r, mod_php, mod_php_cfg, "php_value", vals[i] ); - } - else if (strcasecmp (attributes2[i], "apachePhpFlag") == 0) { - mod_vhost_ldap_ng_call_take2( r, mod_php, mod_php_cfg, "php_flag", vals[i] ); - } - else if (strcasecmp (attributes2[i], "apachePhpAdminValue") == 0) { - mod_vhost_ldap_ng_call_take2( r, mod_php, mod_php_cfg, "php_admin_value", vals[i] ); - } - else if (strcasecmp (attributes2[i], "apachePhpAdminFlag") == 0) { - mod_vhost_ldap_ng_call_take2( r, mod_php, mod_php_cfg, "php_admin_flag", vals[i] ); - } - else if (strcasecmp (attributes2[i], "apachePHPINIDir") == 0) { - mod_vhost_ldap_ng_call_take1( r, mod_php, mod_php_cfg, "PHPINIDir", vals[i] ); - } - } - if( mod_rewrite->cmds) - { - if (strcasecmp (attributes2[i], "apacheRewriteEngine") == 0) { - // init mod_rewrite - if( strcasecmp( vals[i], "On") == 0 ) - { - ((void**)r->server->module_config)[ mod_rewrite->module_index ] = mod_rewrite->create_server_config( r->pool, r->server ); - mod_vhost_ldap_ng_call_flag( r, mod_rewrite, mod_rewrite_cfg, "RewriteEngine", vals[i] ); - } - } - else if (strcasecmp (attributes2[i], "apacheRewriteOptions") == 0) { - mod_vhost_ldap_ng_call_take2( r, mod_rewrite, mod_rewrite_cfg, "RewriteOptions", vals[i] ); - } - else if (strcasecmp (attributes2[i], "apacheRewriteBase") == 0) { - mod_vhost_ldap_ng_call_take1( r, mod_rewrite, mod_rewrite_cfg, "RewriteBase", vals[i] ); - } - else if (strcasecmp (attributes2[i], "apacheRewriteCond") == 0) { - mod_vhost_ldap_ng_call_raw( r, mod_rewrite, mod_rewrite_cfg, "RewriteCond", vals[i] ); - } - else if (strcasecmp (attributes2[i], "apacheRewriteRule") == 0) { - mod_vhost_ldap_ng_call_raw( r, mod_rewrite, mod_rewrite_cfg, "RewriteRule", vals[i] ); - } - else if (strcasecmp (attributes2[i], "apacheRewriteMap") == 0) { - mod_vhost_ldap_ng_call_take2( r, mod_rewrite, mod_rewrite_cfg, "RewriteMap", vals[i] ); - } - else if (strcasecmp (attributes2[i], "apacheRewriteLock") == 0) { - mod_vhost_ldap_ng_call_take1( r, mod_rewrite, mod_rewrite_cfg, "RewriteOptions", vals[i] ); - } - else if (strcasecmp (attributes2[i], "apacheRewriteLog") == 0) { - mod_vhost_ldap_ng_call_take1( r, mod_rewrite, mod_rewrite_cfg, "RewriteLog", vals[i] ); - } - else if (strcasecmp (attributes2[i], "apacheRewriteLogLevel") == 0) { - mod_vhost_ldap_ng_call_take1( r, mod_rewrite, mod_rewrite_cfg, "RewriteLogLevel", vals[i] ); - } - } - i++; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |