aqhome-cgi: add login url.

This commit is contained in:
Martin Preuss
2026-05-29 17:18:20 +02:00
parent a65e6fbec2
commit 78ea72efe0
4 changed files with 23 additions and 0 deletions

View File

@@ -130,6 +130,7 @@ void _handleRequest(AQCGI_REQUEST *rq, const char *sPathStaticFiles, const char
int rv;
sv=AQH_ServiceFiles_new(sPathRuntimeFiles, sBaseUrl);
AQH_Service_SetLoginUrl(sv, "/aqhome/login");
rv=_handlePath(sv, rq, sPathStaticFiles);
if (rv<0) {

View File

@@ -76,6 +76,7 @@ void AQH_Service_free(AQH_SERVICE *sv)
free(sv->baseFolder);
free(sv->runtimeFolder);
free(sv->cacheFolder);
free(sv->loginUrl);
GWEN_FREE_OBJECT(sv);
}
}
@@ -110,6 +111,23 @@ const char *AQH_Service_GetCacheFolder(const AQH_SERVICE *sv)
const char *AQH_Service_GetLoginUrl(const AQH_SERVICE *sv)
{
return sv?sv->loginUrl:NULL;
}
void AQH_Service_SetLoginUrl(AQH_SERVICE *sv, const char *s)
{
if (sv) {
free(sv->loginUrl);
sv->loginUrl=s?strdup(s):NULL;
}
}
#if 0
AQH_MODULE *AQH_Service_GetModuleByPath(const AQH_SERVICE *sv, const char *s)
{

View File

@@ -56,6 +56,8 @@ AQH_SERVICE *AQH_Service_new(const char *baseFolder, const char *baseUrl);
void AQH_Service_free(AQH_SERVICE *sv);
const char *AQH_Service_GetBaseUrl(const AQH_SERVICE *sv);
const char *AQH_Service_GetLoginUrl(const AQH_SERVICE *sv);
void AQH_Service_SetLoginUrl(AQH_SERVICE *sv, const char *s);
const char *AQH_Service_GetBaseFolder(const AQH_SERVICE *sv);
const char *AQH_Service_GetRuntimeFolder(const AQH_SERVICE *sv);
const char *AQH_Service_GetCacheFolder(const AQH_SERVICE *sv);

View File

@@ -22,6 +22,8 @@ struct AQH_SERVICE {
char *runtimeFolder;
char *cacheFolder;
char *loginUrl;
AQH_SERVICE_HANDLEREQUEST_FN handleRequestFn;
AQH_SERVICE_LOADUSER_FN loadUserFn;