minor improvements
This commit is contained in:
@ -13,8 +13,6 @@ import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author joern.muehlencord
|
||||
|
||||
@ -42,7 +42,7 @@ public class SPUserGroup extends SPObject {
|
||||
|
||||
public void addUserToGroup(String userLoginName, String groupName) throws JAXBException, SAXException, ParserConfigurationException,
|
||||
NoSuchAlgorithmException, IOException, KeyManagementException {
|
||||
SPUser user = getUser(userLoginName);
|
||||
SPUser user = getUser("i:0#.w|", userLoginName);
|
||||
if (user == null) {
|
||||
throw new SAXException("User not found");
|
||||
}
|
||||
@ -52,7 +52,7 @@ public class SPUserGroup extends SPObject {
|
||||
|
||||
public void removeUserFromGroup(String userLoginName, String groupName) throws NoSuchAlgorithmException, KeyManagementException, MalformedURLException,
|
||||
JAXBException, SAXException {
|
||||
SPUser user = getUser(userLoginName);
|
||||
SPUser user = getUser("i:0#.w|", userLoginName);
|
||||
if (user == null) {
|
||||
throw new SAXException("User not found");
|
||||
}
|
||||
@ -116,7 +116,7 @@ public class SPUserGroup extends SPObject {
|
||||
}
|
||||
|
||||
public String getUserId(String userLoginName) throws NoSuchAlgorithmException, KeyManagementException, MalformedURLException, JAXBException, SAXException {
|
||||
SPUser user = getUser(userLoginName);
|
||||
SPUser user = getUser("i:0#.w|", userLoginName);
|
||||
if (user == null) {
|
||||
return null;
|
||||
} else {
|
||||
@ -125,7 +125,7 @@ public class SPUserGroup extends SPObject {
|
||||
}
|
||||
|
||||
public String getUserName(String userLoginName) throws NoSuchAlgorithmException, KeyManagementException, MalformedURLException, JAXBException, SAXException {
|
||||
SPUser user = getUser(userLoginName);
|
||||
SPUser user = getUser("i:0#.w|", userLoginName);
|
||||
if (user == null) {
|
||||
return null;
|
||||
} else {
|
||||
@ -155,8 +155,12 @@ public class SPUserGroup extends SPObject {
|
||||
return null;
|
||||
}
|
||||
|
||||
private SPUser getUser(String userLoginName) throws NoSuchAlgorithmException, KeyManagementException, MalformedURLException, JAXBException, SAXException {
|
||||
GetUserInfoResponse.GetUserInfoResult result = getUserGroupPort().getUserInfo("i:0#.w|" + userLoginName);
|
||||
public SPUser getUserFromId(String userId) throws NoSuchAlgorithmException, KeyManagementException, MalformedURLException, JAXBException, SAXException {
|
||||
return getUser ("i:0#.w|", userId);
|
||||
}
|
||||
|
||||
private SPUser getUser(Object prefix, String userLoginName) throws NoSuchAlgorithmException, KeyManagementException, MalformedURLException, JAXBException, SAXException {
|
||||
GetUserInfoResponse.GetUserInfoResult result = getUserGroupPort().getUserInfo(prefix + userLoginName);
|
||||
// TODO why is i:0#.w| in front?
|
||||
|
||||
if (result.getContent() != null) {
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
<xs:attribute name="DisplayName" use="optional"/>
|
||||
<xs:attribute name="Login" use="optional"/>
|
||||
<xs:attribute name="SiteUser" use="optional"/>
|
||||
<xs:attribute name="arg1" use="optional"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
|
||||
Reference in New Issue
Block a user