add remove users from group webservices
This commit is contained in:
@@ -934,6 +934,49 @@ class wsBase
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* remove user from group
|
||||
* @param string $appDocUid
|
||||
* @return $result will return an object
|
||||
*/
|
||||
public function removeUserFromGroup($userId, $groupId) {
|
||||
try {
|
||||
G::LoadClass('groups');
|
||||
global $RBAC;
|
||||
$RBAC->initRBAC();
|
||||
$user=$RBAC->verifyUserId($userId);
|
||||
if($user==0){
|
||||
$result = new wsResponse (3, "User not registered in the system");
|
||||
return $result;
|
||||
}
|
||||
|
||||
$groups = new Groups;
|
||||
$very_group = $groups->verifyGroup( $groupId );
|
||||
if ( $very_group==0 ) {
|
||||
$result = new wsResponse (9, "Group not registered in the system");
|
||||
return $result;
|
||||
}
|
||||
|
||||
$very_user = $groups->verifyUsertoGroup( $groupId, $userId);
|
||||
if($very_user==1){
|
||||
$oGroup = new Groups();
|
||||
$oGroup->removeUserOfGroup($groupId, $userId);
|
||||
$result = new wsResponse (0, "command executed successfuly");
|
||||
return $result;
|
||||
}
|
||||
//$oGroup->removeUserOfGroup($_POST['GRP_UID'], $_POST['USR_UID']);
|
||||
$result = new wsResponse (8, "User not registered in the group");
|
||||
return $result;
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
$result = new wsResponse (100, $e->getMessage());
|
||||
return $result;
|
||||
}
|
||||
//G::LoadClass('groups');
|
||||
// $oGroup = new Groups();
|
||||
// $oGroup->removeUserOfGroup($_POST['GRP_UID'], $_POST['USR_UID']);
|
||||
}
|
||||
|
||||
/*
|
||||
* assigns a user to a group
|
||||
* @param string $userId
|
||||
@@ -2028,4 +2071,6 @@ class wsBase
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -221,6 +221,15 @@
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="removeUserFromGroupRequest">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="sessionId" type="xs:string"/>
|
||||
<xs:element name="userId" type="xs:string"/>
|
||||
<xs:element name="groupId" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="assignUserToDepartmentRequest">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
@@ -787,7 +796,11 @@
|
||||
</message>
|
||||
<message name="importProcessFromLibraryResponse">
|
||||
<part name="parameters" element="xs0:importProcessFromLibraryResponse"/>
|
||||
</message>
|
||||
</message>
|
||||
|
||||
<message name="removeUserFromGroupRequest">
|
||||
<part name="parameters" element="xs0:removeUserFromGroupRequest"/>
|
||||
</message>
|
||||
<portType name="ProcessMakerServiceSoap">
|
||||
<operation name="login">
|
||||
<input message="xs0:loginRequest"/>
|
||||
@@ -908,7 +921,11 @@
|
||||
<operation name="importProcessFromLibrary">
|
||||
<input message="xs0:importProcessFromLibraryRequest"/>
|
||||
<output message="xs0:importProcessFromLibraryResponse"/>
|
||||
</operation>
|
||||
</operation>
|
||||
<operation name="removeUserFromGroup">
|
||||
<input message="xs0:removeUserFromGroupRequest"/>
|
||||
<output message="xs0:pmResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="ProcessMakerServiceSoap" type="xs0:ProcessMakerServiceSoap">
|
||||
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
@@ -1182,6 +1199,15 @@
|
||||
<soap12:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="removeUserFromGroup">
|
||||
<soap12:operation soapAction="urn:removeUserFromGroup" soapActionRequired="true" style="document"/>
|
||||
<input>
|
||||
<soap12:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap12:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="ProcessMakerService">
|
||||
<documentation>ProcessMaker Web Service</documentation>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
G::LoadClass('wsBase');
|
||||
|
||||
function login( $params ) {
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->login( $params->userid, $params->password );
|
||||
return array(
|
||||
@@ -42,27 +42,27 @@
|
||||
}
|
||||
|
||||
function ProcessList( $params ) {
|
||||
|
||||
|
||||
$vsResult = isValidSession($params->sessionId);
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
$o->guid = $vsResult->status_code. ' ' . $vsResult->message;
|
||||
$o->name = '';
|
||||
return array("processes" => $o);
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_FACTORY') == 0 ){
|
||||
$o->guid = "2 You have not privileges to execute this function";
|
||||
$o->name = '';
|
||||
return array("processes" => $o);
|
||||
}
|
||||
|
||||
|
||||
/** if you are not an admin user, then this function will return only your valid process **/
|
||||
if ( ifPermission( $params->sessionId, 'PM_FACTORY') == 0 ) {
|
||||
G::LoadClass('sessions');
|
||||
$oSessions = new Sessions();
|
||||
$session = $oSessions->getSessionUser($params->sessionId);
|
||||
$userId = $session['USR_UID'];
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->processListVerified( $userId );
|
||||
return array("processes" => $res );
|
||||
@@ -74,20 +74,20 @@
|
||||
}
|
||||
|
||||
function RoleList( $params ) {
|
||||
|
||||
|
||||
$vsResult = isValidSession($params->sessionId);
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
$o->guid = $vsResult->status_code. ' ' . $vsResult->message;
|
||||
$o->name = '';
|
||||
return array("roles" => $o);
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_USERS') == 0 ){
|
||||
$o->guid = "2 You have not privileges to execute this function";
|
||||
$o->name = '';
|
||||
return array("roles" => $o);
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->roleList();
|
||||
return array("roles" => $res );
|
||||
@@ -100,13 +100,13 @@
|
||||
$o->name = '';
|
||||
return array("groups" => $o);
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_USERS') == 0 ){
|
||||
$o->guid = "2 You have not privileges to execute this function";
|
||||
$o->name = '';
|
||||
return array("groups" => $o);
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->groupList();
|
||||
return array("groups" => $res );
|
||||
@@ -119,13 +119,13 @@
|
||||
$o->name = '';
|
||||
return array("departments" => $o);
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_USERS') == 0 ){
|
||||
$o->guid = "2 You have not privileges to execute this function";
|
||||
$o->name = '';
|
||||
return array("departments" => $o);
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->departmentList();
|
||||
return array("departments" => $res );
|
||||
@@ -140,7 +140,7 @@
|
||||
$o->delIndex = '';
|
||||
return array("cases" => $o);
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
||||
$o->guid = "2 You have not privileges to execute this function";
|
||||
$o->name = '';
|
||||
@@ -166,13 +166,13 @@
|
||||
$o->name = '';
|
||||
return array("users" => $o);
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_USERS') == 0 ){
|
||||
$o->guid = "2 You have not privileges to execute this function";
|
||||
$o->name = '';
|
||||
return array("users" => $o);
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->userList();
|
||||
return array("users" => $res );
|
||||
@@ -186,14 +186,14 @@
|
||||
$o->processId = '';
|
||||
return array("triggers" => $o);
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
||||
$o->guid = "2 You have not privileges to execute this function";
|
||||
$o->name = '';
|
||||
$o->processId = '';
|
||||
return array("triggers" => $o);
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->triggerList();
|
||||
return array("triggers" => $res );
|
||||
@@ -213,7 +213,7 @@
|
||||
$o->link = '';
|
||||
return array("documents" => $o);
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
||||
$o->guid = "2 You have not privileges to execute this function";
|
||||
$o->filename = '';
|
||||
@@ -232,7 +232,7 @@
|
||||
$session = $oSessions->getSessionUser($params->sessionId);
|
||||
$userId = $session['USR_UID'];
|
||||
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->outputDocumentList( $params->caseId, $userId );
|
||||
return array("documents" => $res );
|
||||
@@ -252,7 +252,7 @@
|
||||
$o->link = '';
|
||||
return array("documents" => $o);
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
||||
$o->guid = "2 You have not privileges to execute this function";
|
||||
$o->filename = '';
|
||||
@@ -270,7 +270,7 @@
|
||||
$oSessions = new Sessions();
|
||||
$session = $oSessions->getSessionUser($params->sessionId);
|
||||
$userId = $session['USR_UID'];
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->inputDocumentList( $params->caseId, $userId );
|
||||
return array("documents" => $res );
|
||||
@@ -284,7 +284,7 @@
|
||||
$o->description = '';
|
||||
return array("documents" => $o);
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
||||
$o->guid = "2 You have not privileges to execute this function";
|
||||
$o->name = '';
|
||||
@@ -302,12 +302,12 @@
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
||||
$result = new wsResponse (2, "You have not privileges to execute this function");
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->removeDocument( $params->appDocUid );
|
||||
return $res;
|
||||
@@ -318,12 +318,12 @@
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult->getPayloadArray();
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ) {
|
||||
$result = new wsResponse (2, "You do not have privileges");
|
||||
return $result->getPayloadArray();
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->sendMessage(
|
||||
$params->caseId,
|
||||
@@ -342,12 +342,12 @@
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ) {
|
||||
$result = new wsResponse (2, "You do not have privileges");
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->getCaseInfo( $params->caseId, $params->delIndex );
|
||||
return $res;
|
||||
@@ -358,12 +358,12 @@
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ) {
|
||||
$result = new wsResponse (2, "You do not have privileges");
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase();
|
||||
$variables = $params->variables;
|
||||
$Fields = Array();
|
||||
@@ -376,12 +376,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$params->variables = $Fields;
|
||||
$res = $ws->sendVariables($params->caseId, $params->variables);
|
||||
|
||||
return $res->getPayloadArray();
|
||||
|
||||
|
||||
}
|
||||
|
||||
function GetVariables( $params ) {
|
||||
@@ -389,12 +389,12 @@
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
||||
$result = new wsGetVariableResponse (2, "You do not have privileges", NULL );
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
|
||||
$res = $ws->getVariables($params->caseId, $params->variables);
|
||||
@@ -403,12 +403,12 @@
|
||||
|
||||
function DerivateCase( $params ) {
|
||||
$oSession = new Sessions();
|
||||
|
||||
|
||||
$vsResult = isValidSession($params->sessionId);
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
||||
$result = new wsResponse (2, "You do not have privileges");
|
||||
return $result;
|
||||
@@ -425,12 +425,12 @@
|
||||
|
||||
function RouteCase( $params ) {
|
||||
$oSession = new Sessions();
|
||||
|
||||
|
||||
$vsResult = isValidSession($params->sessionId);
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
||||
$result = new wsResponse (2, "You do not have privileges");
|
||||
return $result;
|
||||
@@ -452,7 +452,7 @@
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
||||
$result = new wsResponse (2, "You do not have privileges");
|
||||
return $result;
|
||||
@@ -461,7 +461,7 @@
|
||||
$oSession = new Sessions();
|
||||
$user = $oSession->getSessionUser($params->sessionId);
|
||||
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$delIndex = ( isset ( $params->delIndex ) ) ? $params->delIndex : 1 ;
|
||||
$res = $ws->executeTrigger( $user['USR_UID'], $params->caseId, $params->triggerIndex, $delIndex);
|
||||
@@ -473,12 +473,12 @@
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
||||
$result = new wsResponse (2, "You do not have privileges");
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$variables = $params->variables;
|
||||
foreach ( $variables as $key=>$val ){
|
||||
@@ -492,14 +492,14 @@
|
||||
}
|
||||
|
||||
function NewCase( $params ) {
|
||||
|
||||
|
||||
G::LoadClass('sessions');
|
||||
|
||||
|
||||
$vsResult = isValidSession($params->sessionId);
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
|
||||
if ( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
||||
$result = new wsResponse (2, "You do not have privileges");
|
||||
return $result;
|
||||
@@ -509,7 +509,7 @@
|
||||
$session = $oSessions->getSessionUser($params->sessionId);
|
||||
$userId = $session['USR_UID'];
|
||||
$variables = $params->variables;
|
||||
|
||||
|
||||
/* this code is for previous version of ws, and apparently this will work for grids inside the variables..
|
||||
if (!isset($params->variables) ) {
|
||||
$variables = array();
|
||||
@@ -549,28 +549,28 @@
|
||||
}
|
||||
*/
|
||||
$variables = $params->variables;
|
||||
|
||||
|
||||
|
||||
|
||||
if ( is_object ($variables) ) {
|
||||
$Fields[ $variables->name ]= $variables->value ;
|
||||
}
|
||||
if ( is_array ( $variables) ) {
|
||||
foreach ( $variables as $key=>$val ) {
|
||||
if (!is_object($val->value)){
|
||||
eval('$Fields[ "' . $val->name . '" ]= $val->value ;');
|
||||
eval('$Fields[ ' . $val->name . ' ]= $val->value ;');
|
||||
}
|
||||
}
|
||||
}
|
||||
$params->variables = $Fields;
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->newCase($params->processId, $userId, $params->taskId, $params->variables);
|
||||
|
||||
|
||||
######################################################################
|
||||
# we need to register the case id for a stored session variable. like a normal Session.
|
||||
######################################################################
|
||||
$oSessions->registerGlobal('APPLICATION', $res->caseId);
|
||||
######################################################################
|
||||
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -579,7 +579,7 @@
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult->getPayloadArray();
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_USERS') == 0 ){
|
||||
$result = new wsResponse (2, "You do not have privileges");
|
||||
return $result->getPayloadArray();
|
||||
@@ -587,12 +587,12 @@
|
||||
G::LoadClass('sessions');
|
||||
$sessions = new Sessions;
|
||||
$user=$sessions->getSessionUser($params->sessionId);
|
||||
|
||||
|
||||
if(!is_array($user)){
|
||||
return new wsResponse (3, 'User not registered in the system');
|
||||
}
|
||||
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->assignUserToGroup( $params->userId, $params->groupId);
|
||||
return $res->getPayloadArray();
|
||||
@@ -603,7 +603,7 @@
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult->getPayloadArray();
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_USERS') == 0 ){
|
||||
$result = new wsResponse (2, "You do not have privileges");
|
||||
return $result->getPayloadArray();
|
||||
@@ -611,12 +611,12 @@
|
||||
G::LoadClass('sessions');
|
||||
$sessions = new Sessions;
|
||||
$user=$sessions->getSessionUser($params->sessionId);
|
||||
|
||||
|
||||
if(!is_array($user)){
|
||||
return new wsResponse (3, 'User not registered in the system');
|
||||
}
|
||||
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->AssignUserToDepartment( $params->userId, $params->departmentId, $params->manager );
|
||||
return $res->getPayloadArray();
|
||||
@@ -627,12 +627,12 @@
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_USERS') == 0){
|
||||
$result = new wsCreateUserResponse (2, "You do not have privileges");
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->createUser( $params->userId, $params->firstname, $params->lastname, $params->email, $params->role, $params->password);
|
||||
return $res;
|
||||
@@ -644,12 +644,12 @@
|
||||
$result = new wsCreateGroupResponse ($vsResult->status_code , $vsResult->message, '' );
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_USERS') == 0 ) {
|
||||
$result = new wsCreateGroupResponse (2, "You do not have privileges", '');
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->createGroup( $params->name );
|
||||
return $res;
|
||||
@@ -660,12 +660,12 @@
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_USERS') == 0){
|
||||
$result = new wsCreateUserResponse (2, "You do not have privileges");
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->CreateDepartment( $params->name, $params->parentUID );
|
||||
return $res;
|
||||
@@ -678,13 +678,13 @@
|
||||
$o->name = '';
|
||||
return array("tasks" => $o);
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
||||
$o->guid = "2 You have not privileges to execute this function";
|
||||
$o->name = '';
|
||||
return array("tasks" => $o);
|
||||
}
|
||||
|
||||
|
||||
G::LoadClass('sessions');
|
||||
$ws = new wsBase ();
|
||||
$oSessions = new Sessions();
|
||||
@@ -701,13 +701,13 @@
|
||||
$o->name = '';
|
||||
return array("taskCases" => $o);
|
||||
}
|
||||
|
||||
|
||||
if( ifPermission( $params->sessionId, 'PM_CASES') == 0 ){
|
||||
$o->guid = "2 You have not privileges to execute this function";
|
||||
$o->name = '';
|
||||
return array("taskCases" => $o);
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->taskCase( $params->caseId );
|
||||
return array("taskCases" => $res );
|
||||
@@ -718,7 +718,7 @@
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->reassignCase($params->sessionId, $params->caseId, $params->delIndex, $params->userIdSource, $params->userIdTarget );
|
||||
return $res ;
|
||||
@@ -729,7 +729,7 @@
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->systemInformation( );
|
||||
return $res;
|
||||
@@ -740,17 +740,17 @@
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->importProcessFromLibrary( $params->processId ,$params->version ,$params->importOption ,$params->usernameLibrary ,$params->passwordLibrary );
|
||||
return $res;
|
||||
}
|
||||
|
||||
/*************/
|
||||
|
||||
|
||||
#added By Erik AO <erik@colosa.com> in datetime 26.06.2008 10:00:00
|
||||
# modified 12-01-2010 by erik
|
||||
|
||||
|
||||
function isValidSession($sessionId){
|
||||
G::LoadClass('sessions');
|
||||
$oSessions = new Sessions();
|
||||
@@ -758,11 +758,22 @@
|
||||
if( is_array($session) ) {
|
||||
return new wsResponse (0, 'Session active');
|
||||
} else {
|
||||
|
||||
|
||||
return new wsResponse (9, 'Session expired');
|
||||
}
|
||||
}
|
||||
//add removeUserFromGroup
|
||||
function removeUserFromGroup( $params ) {
|
||||
$vsResult = isValidSession($params->sessionId);
|
||||
if( $vsResult->status_code !== 0 ){
|
||||
return $vsResult;
|
||||
}
|
||||
|
||||
$ws = new wsBase ();
|
||||
$res = $ws->removeUserFromGroup($params->userId, $params->groupId);
|
||||
return $res ;
|
||||
}
|
||||
//end add
|
||||
function ifPermission( $sessionId, $permission ){
|
||||
global $RBAC;
|
||||
$RBAC->initRBAC();
|
||||
@@ -782,8 +793,8 @@
|
||||
}
|
||||
return $sw;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$server = new SoapServer( $wsdl );
|
||||
$server->addFunction("Login");
|
||||
$server->addFunction("ProcessList");
|
||||
@@ -816,6 +827,6 @@ $server->addFunction("TaskCase");
|
||||
$server->addFunction("ReassignCase");
|
||||
$server->addFunction("systemInformation");
|
||||
$server->addFunction("importProcessFromLibrary");
|
||||
|
||||
$server->addFunction("removeUserFromGroup");
|
||||
$server->handle();
|
||||
|
||||
|
||||
@@ -1075,7 +1075,25 @@ switch ($_POST ['action']) {
|
||||
|
||||
G::RenderPage ( 'publish', 'raw' );
|
||||
break;
|
||||
//add removeUserFromGroup
|
||||
case "removeUserFromGroup" :
|
||||
$sessionId = $frm ["SESSION_ID"];
|
||||
$userId = $frm ["USER_ID"];
|
||||
$groupId = $frm ["GROUP_ID"];
|
||||
$params = array ('sessionId' => $sessionId, 'userId' => $userId, 'groupId' => $groupId );
|
||||
$result = $client->__SoapCall ( 'removeUserFromGroup', array ($params ) );
|
||||
$G_PUBLISH = new Publisher ( );
|
||||
$fields ['status_code'] = $result->status_code;
|
||||
$fields ['message'] = $result->message;
|
||||
$fields ['time_stamp'] = $result->timestamp;
|
||||
if( $result->status_code == 9 ){
|
||||
$_SESSION ['WS_SESSION_ID'] = '';
|
||||
}
|
||||
|
||||
$G_PUBLISH->AddContent ( 'xmlform', 'xmlform', 'setup/wsShowResult', null, $fields );
|
||||
G::RenderPage ( 'publish', 'raw' );
|
||||
break;
|
||||
//end add
|
||||
case "RemoveDocument" :
|
||||
$appDocUid = $frm ["APP_DOC_UID"];
|
||||
$sessionId = $frm ["SESSION_ID"];
|
||||
|
||||
@@ -104,6 +104,7 @@ $allWebservices [] = 'OutputDocumentList';
|
||||
$allWebservices [] = 'RemoveDocument';
|
||||
$allWebservices [] = 'TaskCase';
|
||||
$allWebservices [] = 'ReassignCase';
|
||||
$allWebservices [] = 'removeUserFromGroup';
|
||||
|
||||
foreach ( $allWebservices as $ws ) {
|
||||
$ID_TEST = G::LoadTranslation ( 'ID_TEST' );
|
||||
|
||||
17
workflow/engine/xmlform/setup/wsremoveUserFromGroup.xml
Normal file
17
workflow/engine/xmlform/setup/wsremoveUserFromGroup.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm name="webservices" width="500" mode="edit" border="0" enableTemplate="0" height="105px">
|
||||
<SESSION_ID type="text" size="36" maxlength="32">
|
||||
<en>Session Id</en>
|
||||
</SESSION_ID>
|
||||
<USER_ID type="dropdown" sqlConnection="dbarray">
|
||||
SELECT * from user
|
||||
<en>User ID</en>
|
||||
<GROUP_ID type="dropdown" sqlConnection="dbarray">
|
||||
SELECT * from group
|
||||
<en>Group ID</en>
|
||||
<ACTION type="hidden">
|
||||
</ACTION>
|
||||
<ACTIONB type="button" onclick="submitThisForm(this.form);">
|
||||
<en>RemoveUserToGroup</en>
|
||||
</ACTIONB>
|
||||
</dynaForm>
|
||||
Reference in New Issue
Block a user