Showing posts with label SPS 2003. Show all posts
Showing posts with label SPS 2003. Show all posts

SharePoint 2003: User can not be added to the site - “Cannot add the user because a user with that name already exists”

Often we come across issue when a user in SharePoint 2003 site cannot be added as a member of the site. The error that you encounter while adding the user is : “Cannot add the user because a user with that name already exists”.
However when you go through the list of users of the site, you cannot find this user. Neither he has got access to the site.
This issue generally occurs when you have changed the user’s account name in active directory. For example if you have a user with account domain\oldID with access to http://sitecollection. Now you have changed the account of the user in AD from domain\oldID to domain\newID. When the user now tries to access http://sitecollection, he gets “Access Denied”. On the other hand if the administrator tries to add user’s new account domain\newID to the site collection, following error is encountered: “Cannot add the user because a user with that name already exists”.
To fix this issue you need to delete user from site collection user list. So open the link http://<sitecollection>/_layouts/1033/Siteusrs.aspx . Replace your site collection path between <>.
Here you will see all the users in site collection. Identify your user’s ID from the list, and delete him/her. Now you can add the new account without any error.
You can also navigate to the above page: Site Settings > Go to Site Administration(Administrator Section) > View site collection user information (Site Collection Administration)
Please note that this fix is only applicable on SharePoint 2003

Creating List/Document Library with Terms and Conditions sections

Often business comes with a requirement that they need to store data in the sharepoint list, however they need some information to be displayed on the New item page.
 
These kind of requirements although look very simple from business point of view, it becomes a nightmare if you want to create custom pages for it.
 
"Terms and conditions" option is one such requirement. Although you can implement it in various ways, here is a good option to create "T&C" text on new items page and enable the form only when these "T&C" are agreed. 
 
1. Create a List/Document library. http://spsite/Lists/ExampleList
2. Create the desired columns for the List/Document Library created
3. Open the http://spsite/Lists/ExampleList/Newform.aspx for that List/Document Library with the following query parameter “toolpaneview=2”. So your URL will look likehttp://spsite/Lists/ExampleList/Newform.aspx?toolpaneview=2
4. Now the newform.aspx page opens in edit mode.
5. Add a content editor webpart in the page. This content editor webpart should be added just above the fields of the form.
6. Add following HTML code in the webpart.

<div style="text-align: left">&#160;</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="text-align: left"><tbody><tr><td>
REPLACE THIS WITH YOUR TERMS AND CONDITIONS
<br/><br/> <font style="font-size: 12pt">
<input id="chkAgreement" onclick="apply()" type="checkbox" value="on"/>
<strong>I AGREE</strong></font><br/><br/><font style="font-size: 10pt
<br/></font></td></tr></tbody></table>
<script type="text/javascript">
function hideload()
{
var imag = document.getElementsByTagName('table');
for(var i=0;i<imag.length;i++)
{
if(imag[i].className.indexOf('ms-formtable') != -1 ) { var tbl = imag[i];}
if(imag[i].className.indexOf('ms-formtoolbar') != -1 ) { var tbl2 = imag[i];}
}
var ribbonhide = document.getElementById("s4-ribbonrow");
var stylechng = tbl.style;
var stylechng2 = tbl2.style;
var stylechng3 = ribbonhide.style;
stylechng.display = 'none';
stylechng2.display = 'none';
stylechng3.display = 'none';
}

function apply()
{
var imag = document.getElementsByTagName('table');
for(var i=0;i<imag.length;i++)
{
if(imag[i].className.indexOf('ms-formtable') != -1 ) { var tbl = imag[i];}
if(imag[i].className.indexOf('ms-formtoolbar') != -1 ) { var tbl2 = imag[i];}
}

var ribbonhide = document.getElementById("s4-ribbonrow");
var chkBx = document.getElementById("chkAgreement");
var stylechng = tbl.style;
var stylechng2 = tbl2.style;
var stylechng3 = ribbonhide.style;

if(chkBx.checked==false) {
stylechng.display = 'none';
stylechng2.display = 'none';
stylechng3.display = 'none';
}
else {
stylechng.display = 'block';
stylechng2.display = 'block';
stylechng3.display = 'none';
}
}
hideload();</script>
7. Add a content editor webpart in the page. This content editor webpart should be added just below the fields of the form.
8. Add following HTML code in the webpart.
<script>
hideload();</script>
Done.
If you don’t want to touch the ribbon control please remove the greyed out line above. Hiding the ribbon can be tricky as you might find it difficult to modify the webparts. But it gives a very good look and feel to the page if you remove it.
 
So if you have hidden the ribbon, you can edit the page by first closing content webpart, deployed in step 7 and 8. Then edit the page and redeploy the closed webpart.
 
 
 
 

How to insert webparts in Default SharePoint pages

Many times new requirements come in SharePoint projects where users want little customization in the default pages like Newform.aspx, Allitems.aspx.
These requirements are generally very easy to make on a custom page and thats why developers end up creating new pages.

However, such requirements can often be easily implemented by just inserting a Content editor webpart in these pages. It may be possible that you are not getting edit page option on the page. This trick will help to edit such pages.

Add "?toolpaneview=2" at the end of the page URL. So if your page URL is http://sharepointsite/sites/site1/lists/list1/newform.aspx so change the URL to http://sharepointsite/sites/site1/lists/list1/newform.aspx?toolpaneview=2.

Now you will get the page in the edit mode. Add whatever you want to and save the page.

This trick is helpful in almost all the pages in all the versions of SharePoint i.e. 2003,2007 and 2010.

Webpart not available for custom site group members

Webpart not available for custom site group members:

To implement security in the Portal area, I created new security groups in sharepoint. But users complained that many webparts were not available for them to import on page. Users were not able to browse or search them.Users who are members of custom site groups cannot access Web Parts when they view Web Part galleries in SharePoint Portal Server 2003.
This is because the webpart gallery is not set to automatically inherit permissions - so none of the custom site groups can access any of the standard webparts in the web part gallery.


After some investigation found following workaround:

1. Connect to the portal site, and then click Site Settings.
2. Under General Settings on the Site Settings page, click Manage security and additional settings.
3. Under Templates and Web Parts on the Manage security and additional settings page, click Manage Web Part gallery.
4. On the Web Part Gallery page, click Modify settings and columns.
5. The Customize Web Part Gallery page is displayed in your Web browser. The URL in the Address box of the Web browser contains a GUID in brackets. Copy the GUID that appears in the URL, and then paste the GUID into a blank document in Notepad.

The following is an example of a URL:
http://ServerName/_layouts/1033/listedit.aspx?List={AE2A9E4C-BE4C-47C6-8A01-45E119543F7F}
In this example URL, the GUID is AE2A9E4C-BE4C-47C6-8A01-45E119543F7F.
6. In a new Web browser window, type the following URL in the Address box, where GUID is the GUID that you determined earlier in step 5:
http://ServerName/_layouts/1033/ShrOpt.aspx?obj=GUID,doclib
Note Make sure that you replace the GUID that you determined in step 5 with the GUID in the URL. To do this, paste the GUID from the Notepad document into the URL.

The following is an example of a URL that uses the example GUID from step 5:
http://ServerName/_layouts/1033/ShrOpt.aspx?obj=AE2A9E4C-BE4C-47C6-8A01-45E119543F7F,doclib
7. After you type the URL and the GUID in the Address box of your Web browser, press ENTER. The Change Permissions: Web Part Gallery page is displayed in your Web browser.
8. On the Change Permissions: Web Part Gallery page, click Inherit permissions from the parent Web site.
9. Click OK on the message that appears.
10. Assign the View items permission to all site groups except for the Web Designer site group. To do this, follow these steps:a. On the Change Permissions: Web Part Gallery page, click to select the check boxes that are next to the site groups that are displayed on the Change Permissions: Web Part Gallery page. Do not click to select the check box that is next to the Web Designer site group.

Note Make sure that the check box that is next to the Web Designer site group is not selected.
b. Click Edit Permissions of Selected Users.
c. On the Modify Permissions: Web Part Gallery page, click View Items, and then click OK.

11. Assign the View, insert, edit, delete items; change list settings permission to the Web Designer site group. To do this, follow these steps:a. On the Change Permissions: Web Part Gallery page, click to select the check box that is next to the Web Designer site group, and then click Edit Permissions of Selected Users.
b. On the Modify Permissions: Web Part Gallery page, click View, insert, edit, delete items; change list settings, and then click OK