Restricting subsites

Jun 2, 2008 at 8:35 AM
Hello,

I've successfully installed SPNewsletter and it's working great, but I've got an issue with restricting subsites. On our company Sharepoint portal, we have several areas that we wish to restrict and I would like to know what is the exact syntax to use. Here's a sample of my SPNewsletter.Executable.exe.config file :
(values slightly modified)

    <add key="ExcludedSitesUrl" value="http://portal.company.com/dept;http://portal.company.com/dept/subsite;http://portal.company.com/marketing;http://portal.company.com/accounting" />

is it okay this way or should I modify something ?

Thank you in advance and best regards!
Max

P.S. : I speak (and am) french if that can improve the communication! ;-)
Mar 5, 2009 at 3:57 PM
Edited Mar 6, 2009 at 9:59 AM
i have fixed/changed this part:

use: 
<add key="ExcludedSitesUrl" value="SiteName1;SiteName2;" />

and replace Utils.IsPatternFound in SPNewsletter.Common\Utils.cs

with this:

public static bool IsPatternFound(string StringToEvaluate, string Patterns)
  {

   bool patternFound = false;
   if(StringToEvaluate == null || StringToEvaluate.Length == 0 || Patterns == null || Patterns.Length == 0)
   {
    return false;
   }
   else
   {
                string[] patternsArray = Patterns.Split(";".ToCharArray());

                using (SPSite site = new SPSite(StringToEvaluate))
                {
                    using (SPWeb web = site.OpenWeb())
                    {
                        foreach (var str in patternsArray)
                        {
                            if (web.Title == str.Trim())
                            {
                                return true;
                            }
                        }

                    }
                }
   }
   return patternFound;
  }