Move Shib constants to new lib, fixed symbol conflicts.
[shibboleth/cpp-sp.git] / xmlproviders / XMLAAP.cpp
index 2ea26f1..5d29257 100644 (file)
@@ -25,6 +25,7 @@
 #include "internal.h"
 #include <algorithm>
 #include <log4cpp/Category.hh>
+#include <shibsp/SPConstants.h>
 
 using namespace shibboleth;
 using namespace saml;
@@ -168,7 +169,7 @@ void XMLAAPImpl::init()
             AttributeRule* rule=new AttributeRule(static_cast<DOMElement*>(nlist->item(i)));
 #ifdef HAVE_GOOD_STL
             xstring key=rule->getName();
-            key=key + chBang + chBang + (rule->getNamespace() ? rule->getNamespace() : Constants::SHIB_ATTRIBUTE_NAMESPACE_URI);
+            key=key + chBang + chBang + (rule->getNamespace() ? rule->getNamespace() : shibspconstants::SHIB1_ATTRIBUTE_NAMESPACE_URI);
 #else
             auto_ptr_char aname(rule->getName());
             string key(aname.get());
@@ -193,8 +194,7 @@ void XMLAAPImpl::init()
                 }
                 else {
                     m_aliasMap[rule->getAlias()]=rule;
-                else
-                    log.error("<AttributeRule> cannot specify Alias of 'user', please use alternate value");
+                }
             }
         }
     }
@@ -217,9 +217,9 @@ void XMLAAPImpl::init()
 XMLAAPImpl::~XMLAAPImpl()
 {
 #ifdef HAVE_GOOD_STL
-    for_each(m_attrMap.begin(),m_attrMap.end(),shibtarget::cleanup_pair<xstring,AttributeRule>());
+    for_each(m_attrMap.begin(),m_attrMap.end(),xmltooling::cleanup_pair<xstring,AttributeRule>());
 #else
-    for_each(m_attrMap.begin(),m_attrMap.end(),shibtarget::cleanup_pair<string,AttributeRule>());
+    for_each(m_attrMap.begin(),m_attrMap.end(),xmltooling::cleanup_pair<string,AttributeRule>());
 #endif
 }
 
@@ -232,7 +232,7 @@ XMLAAPImpl::AttributeRule::AttributeRule(const DOMElement* e) :
     m_name=e->getAttributeNS(NULL,SHIB_L(Name));
     m_namespace=e->getAttributeNS(NULL,SHIB_L(Namespace));
     if (!m_namespace || !*m_namespace)
-        m_namespace=Constants::SHIB_ATTRIBUTE_NAMESPACE_URI;
+        m_namespace=shibspconstants::SHIB1_ATTRIBUTE_NAMESPACE_URI;
     
     const XMLCh* caseSensitive=e->getAttributeNS(NULL,SHIB_L(CaseSensitive));
     m_caseSensitive=(!caseSensitive || !*caseSensitive || *caseSensitive==chDigit_1 || *caseSensitive==chLatin_t);
@@ -358,7 +358,7 @@ const IAttributeRule* XMLAAP::lookup(const XMLCh* attrName, const XMLCh* attrNam
 {
 #ifdef HAVE_GOOD_STL
     xstring key=attrName;
-    key=key + chBang + chBang + (attrNamespace ? attrNamespace : Constants::SHIB_ATTRIBUTE_NAMESPACE_URI);
+    key=key + chBang + chBang + (attrNamespace ? attrNamespace : shibspconstants::SHIB1_ATTRIBUTE_NAMESPACE_URI);
 #else
     auto_ptr_char aname(attrName);
     string key=aname.get();