-
Notifications
You must be signed in to change notification settings - Fork 53
silgy_app_main
Jurek Muszyński edited this page Apr 9, 2019
·
2 revisions
Called after parsing HTTP request header. This is the main entry point for a request.
None
void silgy_app_main(int ci)
{
int ret=OK;
if ( REQ("login") )
{
gen_page_login(ci);
}
else if ( REQ("do_login") )
{
ret = silgy_usr_login(ci);
if ( ret != OK )
RES_LOCATION("login?msg=%d", ret);
else
RES_LOCATION("dashboard");
}
else if ( REQ("dashboard") )
{
gen_page_dashboard(ci);
}
else if ( REQ("") )
{
if ( LOGGED )
RES_LOCATION("dashboard");
else
gen_page_landing(ci);
}
else // page not found
{
RES_STATUS(404);
}
}