$showgroupaddform = true; $text = "Add a group"; break; case "validate": $errorString = ""; if ($_POST['token'] != $_SESSION['token']) { $errorString[] = "Invalid token! (what are you doing??)<br />"; } $token_age = time() - $_SESSION['token_time']; // force to resubmit after 5 minutes if ($token_age > 300) { $errorString[] = "Timout value exceeded, resubmit<br />"; } if (!is_valid_real_name($_POST['name'])) { $errorString[] = "Invalid groupname"; } elseif (group_exists($_POST['name'])) { $errorString[] = "Groupname already in use <br />"; //$showgrouplist = false; // do not show group list when dealing with add errors } if (!is_valid_real_name($_POST['description'])) { $errorString[] = "Invalid description"; } if (!empty($errorString)) { $showgroupaddform = true; } else { // group does not exist, create group $addgroupresult = ""; if (!add_group($_POST['name'], $_POST['description'], $user->data['user_id'])) { $errorString[] = "Could not add group to database"; $showgroupaddform = true; } else {
global $roleOperator; $t = new lime_test(570, new lime_output_color()); $t = new lime_test(7 + $iGroups * 2 + $iFirstname * 5 + $iDepartments * 2, new lime_output_color()); $t->diag('Reports To Test'); $t->is(function_exists('ws_open'), true, 'include wsClient.php'); $t->diag('WS WSDL URL ' . WS_WSDL_URL); $t->diag('WS_USER_ID ' . WS_USER_ID); $t->diag('WS_USER_PASS ' . WS_USER_PASS); ws_open(); $t->isa_ok($client, 'SoapClient', 'class SoapClient created'); //checking the groupList $groups = ws_groupList(); $t->is(count($groups->groups) >= 0, true, 'ws_groupList works fine'); $groupId = array(); foreach ($aGroups as $key => $val) { $groupId[] = group_exists($t, $groups, $val); } //checking roles $roles = ws_roleList(); $t->is(count($roles->roles) >= 2, true, 'ws_roleList works fine'); $roleOperator = ''; foreach ($roles->roles as $key => $val) { if ($val->name == 'PROCESSMAKER_OPERATOR') { $roleOperator = $val->guid; } } $t->is(strlen($roleOperator) >= 30, true, 'role PROCESSMAKER_OPERATOR exists'); if ($roleOperator == '') { throw new Exception("role PROCESSMAKER_OPERATOR doesn't exist"); } //checking user list