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:
11
src/entities/GroupSettings.ts
Normal file
11
src/entities/GroupSettings.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { GroupInfo } from "./Group";
|
||||
|
||||
/**
|
||||
* Group settings
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
export class GroupSettings extends GroupInfo {
|
||||
|
||||
}
|
@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user