diff --git a/src/account.c b/src/account.c index 482af4a..896df44 100644 --- a/src/account.c +++ b/src/account.c @@ -95,7 +95,7 @@ void content_account(mastodont_t* api, char** data, size_t size) struct base_page b = { .locale = L10N_EN_US, .content = account_page, - .sidebar_right = NULL + .sidebar_left = NULL }; /* Output */ diff --git a/src/base_page.c b/src/base_page.c index 804d63a..4d1555a 100644 --- a/src/base_page.c +++ b/src/base_page.c @@ -93,6 +93,8 @@ void render_base_page(struct base_page* page, mastodont_t* api) L10N[locale][L10N_DIRECT], config_url_prefix, L10N[locale][L10N_CONFIG], + page->sidebar_left ? + page->sidebar_left : "", page->content, sidebar_str ? sidebar_str : "
Not logged in
"); diff --git a/src/base_page.h b/src/base_page.h index daf0fd0..351e19b 100644 --- a/src/base_page.h +++ b/src/base_page.h @@ -26,7 +26,7 @@ struct base_page { enum l10n_locale locale; char* content; - char* sidebar_right; + char* sidebar_left; }; void render_base_page(struct base_page* page, mastodont_t* api); diff --git a/src/error.c b/src/error.c index 7ea3259..e800b24 100644 --- a/src/error.c +++ b/src/error.c @@ -44,7 +44,7 @@ void content_not_found(mastodont_t* api, char* path) struct base_page b = { .locale = L10N_EN_US, .content = page, - .sidebar_right = NULL + .sidebar_left = NULL }; render_base_page(&b, api); diff --git a/src/lists.c b/src/lists.c index 6ea20b5..d99926d 100644 --- a/src/lists.c +++ b/src/lists.c @@ -85,7 +85,7 @@ void content_lists(mastodont_t* api, char** data, size_t size) struct base_page b = { .locale = L10N_EN_US, .content = lists_page, - .sidebar_right = NULL + .sidebar_left = NULL }; // Output diff --git a/src/login.c b/src/login.c index 9669ffa..3304c42 100644 --- a/src/login.c +++ b/src/login.c @@ -37,6 +37,7 @@ void content_login(mastodont_t* api, char** data, size_t data_size) char* error = NULL; char* page; + printf("%s: %s\r\n", post.username ? post.username: "none", post.password ? post.password : "none"); if (post.username && post.password) { // Getting the client id/secret @@ -71,7 +72,7 @@ void content_login(mastodont_t* api, char** data, size_t data_size) printf("Set-Cookie: access_token=%s; Path=/; Max-Age=31536000\r\n", token.access_token); printf("Set-Cookie: logged_in=t; Path=/; Max-Age=31536000\r\n"); // if config_url_prefix is empty, make it root - printf("Location: %s/\r\n", + printf("Location: %s\r\n\r\nRedirecting...", config_url_prefix[0] == '\0' ? "/" : config_url_prefix); return; @@ -90,7 +91,7 @@ void content_login(mastodont_t* api, char** data, size_t data_size) struct base_page b = { .locale = L10N_EN_US, .content = page, - .sidebar_right = NULL + .sidebar_left = NULL }; // Output diff --git a/src/main.c b/src/main.c index b616d0b..c9d8dec 100644 --- a/src/main.c +++ b/src/main.c @@ -43,7 +43,7 @@ int main(void) unsigned run_count = 1; // API - for (;FCGI_Accept() >= 0; ++run_count) + while (FCGI_Accept() >= 0) { mastodont_t api; api.url = config_instance_url; diff --git a/src/notifications.c b/src/notifications.c index cd380ac..286076a 100644 --- a/src/notifications.c +++ b/src/notifications.c @@ -91,7 +91,7 @@ void content_notifications(mastodont_t* api, char** data, size_t data_size) struct base_page b = { .locale = L10N_EN_US, .content = data_notifications_page_html, - .sidebar_right = NULL + .sidebar_left = NULL }; // Output diff --git a/src/page_config.c b/src/page_config.c index 5610746..35d1f69 100644 --- a/src/page_config.c +++ b/src/page_config.c @@ -43,7 +43,7 @@ void content_config(mastodont_t* api, char** data, size_t size) struct base_page b = { .locale = L10N_EN_US, .content = data_config_html, - .sidebar_right = NULL + .sidebar_left = NULL }; render_base_page(&b, api); diff --git a/src/query.c b/src/query.c index 78e4b8c..34cce4c 100644 --- a/src/query.c +++ b/src/query.c @@ -16,9 +16,9 @@ * along with this program. If not, see