1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-21 00:55:17 +00:00

Can update group settings

This commit is contained in:
2019-12-26 13:49:17 +01:00
parent 7e28722574
commit 0c8ce5c922
10 changed files with 317 additions and 3 deletions

View File

@ -0,0 +1,11 @@
import { GroupInfo } from "./Group";
/**
* Group settings
*
* @author Pierre HUBERT
*/
export class GroupSettings extends GroupInfo {
}

View File

@ -9,6 +9,7 @@ import * as sharp from 'sharp';
import { UserHelper } from "../helpers/UserHelper";
import { GroupsAccessLevel } from "./Group";
import { GroupsHelper } from "../helpers/GroupsHelper";
import { checkVirtualDirectory } from "../utils/VirtualDirsUtils";
/**
* Response to a request
@ -67,6 +68,16 @@ export class RequestHandler {
return this.getPostParam(name) != undefined;
}
/**
* Check out whether a POST string is present in the request or not
*
* @param name The name of the POST field to check
* @param minLength Minimal length of the parameter
*/
public hasPostString(name: string, minLength: number = 0) : boolean {
return this.hasPostParameter(name) && this.getPostParam(name).length >= minLength;
}
/**
* Get an email address included in a post request
*
@ -233,6 +244,21 @@ export class RequestHandler {
return groupID;
}
/**
* Get a virtual directory included in a POST request
*
* @param name The name of the POST variable
* @return The virtual directory, if found as valid
*/
public postVirtualDirectory(name: string) : string {
const dir = this.postString(name);
if(!checkVirtualDirectory(dir))
this.error(401, "Specified directory seems to be invalid!");
return dir;
}
/**
* Get information about an uploaded file
*