August 2007 - Posts

Site Template Tips - size matters

Sorry for resorting to the cheesy title but think it is worth it to get your attention. I spent quite awhile trying to figure this out so let me save you some time.

So you have a large customized site that you want to reuse as a template to create new sites and you find there are some barriers to this.

First barrier:

The maximum size that a list or site can be saved as a template is suppose to be 10M but I have received the limit message on sites as small as 6M. Anyways the fix for this is to increase the maximum. http://blogs.provoke.co.nz/Ari/archive/2007/05/24/increasing-the-maximum-size-of-list-templates.aspx  will show you how. Simple issue this command:

stsadm -o setproperty -propertyname max-template-document-size -propertyvalue 50000000

Then you can export your site template and save it to a local drive on your sharepoint box.

Second barrier:

In order to use your newly exported site template to create a root site collection you will need to add it to the available Site Collection templates: See  http://mindsharpblogs.com/kathy/archive/2007/04/10/1685.aspx

it is another simple stsadm command:

stsadm –o  addtemplate –filename c:\exercise.stp –title exercise

Cheers.

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
Posted by notorioustech | with no comments

Live login for SharePoint ready as soon as they release

We have been playing with the test system for integrating live id authentication into web sites so that we will be ready to provide that service when they go live.

see this blog for info on how to proceed with similar integrations: http://msnwindowslive.spaces.live.com/blog/

Our situation here is a little tricky in that we will need to support both standard form logins for existing members and also allow account creation and login using your live id.

The reasoning behind this is to increase the conversion of anonymous users to members so that all our work put into new member features actually gets used. We realize that there are so many sites out there with their own logins and memberships that it gets very tedious to manage.

If you have any questions about this for your own sites feel free to ask. 

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

Still Securing SharePoint - from members and anonymous users

When ViewFormPagesLockdown won't work for you and you still want your allitems.aspx and other forms secured then you have to write some code. Let me save you some steps, here is the code for a simple control that you can put at the top of a new master page ( i called mine secure.master ) which is a copy of default.master. I suppose I could have just used inheritence of master pages also. Then use the SP Designer to manually pick and change forms to use this new master page, you can pick multiple at a time also.

This code will by default redirect anonymous users away from the page and will also only allow specified member groups to access the page.

    public class SecureItem : WebControl
    {
        private string mGrantGroups = "";

        public string GrantGroups
        {
            get { return mGrantGroups; }
            set { mGrantGroups = value; }
        }

        private string mRedirPage = "/";

        public string RedirPage
        {
            get { return mRedirPage; }
            set { mRedirPage = value; }
        }
        protected override void OnLoad(EventArgs e)
        {
            string name = Context.User.Identity.Name;
            if (name.Trim() == "")
                Page.Response.Redirect (RedirPage,true);

            if (GrantGroups.Trim() == "") return;
            string[] grps = GrantGroups.Split(",".ToCharArray());
            bool doredir = true;
            try
            {
                for (int i = 0; i < grps.Length; i++)
                    if (grps[i].Trim() != "" && SPContext.Current.Web.IsCurrentUserMemberOfGroup(SPContext.Current.Web.Groups[grps[i].Trim()].ID))
                        doredir = false;

            }
            catch (Exception ee)
            {
                Page.Response.Write(ee.ToString());    
                 doredir = false;               
            }
             if (doredir)
                    Page.Response.Redirect (RedirPage,true); // has to be outside of try catch
        }
    }

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
Posted by notorioustech | with no comments