add brief for functions in db, implemet full group manipulation (except owner,color), some fixes

This commit is contained in:
2026-04-01 20:13:50 +02:00
parent 81d0d19064
commit b00eff5c47
9 changed files with 150 additions and 26 deletions
-5
View File
@@ -1,5 +0,0 @@
TOKEN1=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwiZXhwIjoxNzc1MDM3Mzc3LCJpYXQiOjE3NzUwMzM3Nzd9.BIZm-58PtXm13_q5O5M7B7YFjmYZFG0hE615POZ8xhY
USER1_ID=1
TOKEN2=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyIiwiZXhwIjoxNzc1MDM3Mzc3LCJpYXQiOjE3NzUwMzM3Nzd9.mUEEqxtbmmjwICEb_y2LhknR_I7Cis-5kSscm6it5bY
USER2_ID=2
GROUP_ID=2
+1 -1
View File
@@ -18,7 +18,7 @@ echo "=== Adding user2 (ID: $USER2_ID) to group $GROUP_ID ==="
RESP=$(curl -s -w "\n%{http_code}" -X POST "$BASE_URL/mod/group/addclients" \
-d "token=$TOKEN1" \
-d "groupid=$GROUP_ID" \
-d "users=$USER2_ID")
-d "clients=$USER2_ID")
BODY=$(echo "$RESP" | head -1)
CODE=$(echo "$RESP" | tail -1)
echo "Response: $BODY (HTTP $CODE)"
+5 -5
View File
@@ -15,7 +15,7 @@ if [[ -z "$TOKEN1" || -z "$TOKEN2" || -z "$GROUP_ID" ]]; then
fi
echo "=== Getting members of group $GROUP_ID as user1 (owner) ==="
RESP=$(curl -s -w "\n%{http_code}" -X POST "$BASE_URL/get/groupmembers" \
RESP=$(curl -s -w "\n%{http_code}" -X POST "$BASE_URL/get/group/members" \
-d "token=$TOKEN1" \
-d "group=$GROUP_ID")
BODY=$(echo "$RESP" | head -1)
@@ -29,7 +29,7 @@ fi
echo ""
echo "=== Getting members of group $GROUP_ID as user2 (member) ==="
RESP=$(curl -s -w "\n%{http_code}" -X POST "$BASE_URL/get/groupmembers" \
RESP=$(curl -s -w "\n%{http_code}" -X POST "$BASE_URL/get/group/members" \
-d "token=$TOKEN2" \
-d "group=$GROUP_ID")
BODY=$(echo "$RESP" | head -1)
@@ -43,7 +43,7 @@ fi
echo ""
echo "=== Getting members with invalid token ==="
RESP=$(curl -s -w "\n%{http_code}" -X POST "$BASE_URL/get/groupmembers" \
RESP=$(curl -s -w "\n%{http_code}" -X POST "$BASE_URL/get/group/members" \
-d "token=invalid_token" \
-d "group=$GROUP_ID")
BODY=$(echo "$RESP" | head -1)
@@ -57,7 +57,7 @@ fi
echo ""
echo "=== Getting members with invalid group ID ==="
RESP=$(curl -s -w "\n%{http_code}" -X POST "$BASE_URL/get/groupmembers" \
RESP=$(curl -s -w "\n%{http_code}" -X POST "$BASE_URL/get/group/members" \
-d "token=$TOKEN1" \
-d "group=abc")
BODY=$(echo "$RESP" | head -1)
@@ -71,7 +71,7 @@ fi
echo ""
echo "=== Getting members of non-existent group ==="
RESP=$(curl -s -w "\n%{http_code}" -X POST "$BASE_URL/get/groupmembers" \
RESP=$(curl -s -w "\n%{http_code}" -X POST "$BASE_URL/get/group/members" \
-d "token=$TOKEN1" \
-d "group=999999")
BODY=$(echo "$RESP" | head -1)