[opencms-dev] Login User Fails in Custom Site. - Please help.
Govind R
rocks2984 at gmail.com
Wed May 27 12:17:38 CEST 2009
Hello All
I have created a custom site "XXX" as /sites/XXX
My Code Follows:-
- Site and Group Creation.
final String resourceName = "/sites/"+ "XXX";
if (!cmsObject.existsResource(resourceName)) {
cmsObject.createResource(resourceName,
CmsResourceTypeFolder.RESOURCE_TYPE_ID);
cmsObject.unlockResource(resourceName);
cmsObject.publishResource(resourceName);
}
CmsOrgUnitManager orgUnitManager = OpenCms.getOrgUnitManager();
CmsOrganizationalUnit readiOneOU =
orgUnitManager.createOrganizationalUnit(cmsObject, "XXX"+"OU/", "XXX"+"
Organization Unit", 0, "/sites/"+"XXX"+"/");
cmsObject.createGroup(readiOneOU.getName()+"XXX"+"Group", "XXX"+" Group",
CmsGroup.FLAG_ENABLED, "XXX"+"OU/"+"Users");
- Create User.
String siteName = "XXX";
String OUName = siteName +"OU/";
Map propMap = new HashMap();
propMap.put("USERPREFERENCES_workplace-startupsettingssite",
"sites/"+"siteName +"/");
cmsObject.createUser(OUName+"abc", "abc", description, propMap);
cmsObject.addUserToGroup(OUName+"abc", OUName+ siteName+"Group");
// Creates Successfully.
- Login User
String OUName = "XXX"+"OU/";
cmsObject.loginUser(OUName+"abc", "abc");
cmsObject.getRequestContext().setCurrentProject(cmsObject.readProject("Offline"));
This Gives Exception :- User Doesn't Exists. There is an
entry in user table with name "abc"
Please help..its urgent
Regards
Govind R .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20090527/d100e53c/attachment.htm>
More information about the opencms-dev
mailing list