From dbb269fef030f4ffc64f246c975408bbdd754434 Mon Sep 17 00:00:00 2001 From: Nishi Date: Wed, 21 Aug 2024 02:02:13 +0000 Subject: [PATCH] adding authz git-svn-id: file:///raid/svn-personal/repoview/trunk@9 7e8b2a19-8934-dd40-8cb3-db22cdd5a80f --- CGI/db/dbm.c | 24 ++++++++++++++++++++++++ CGI/theme/modern.c | 22 +++++++++++++++++++++- authz | 4 ++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 authz diff --git a/CGI/db/dbm.c b/CGI/db/dbm.c index a0749a0..b39d3b0 100644 --- a/CGI/db/dbm.c +++ b/CGI/db/dbm.c @@ -1 +1,25 @@ /* $Id$ */ + +#include "rv_db.h" + +#include "rv_sha512.h" + +#include + +#include + +void rv_init_db(void) {} + +void rv_close_db(void) {} + +bool rv_has_user(const char* name) {} + +bool rv_check_password(const char* username, const char* password) {} + +void rv_save_token(const char* username, const char* token) {} + +char* rv_who_has_token(const char* token) {} + +bool rv_has_token(const char* token) {} + +void rv_remove_token(const char* token) {} diff --git a/CGI/theme/modern.c b/CGI/theme/modern.c index a0461e5..d3670bd 100644 --- a/CGI/theme/modern.c +++ b/CGI/theme/modern.c @@ -95,6 +95,14 @@ void render_page(void) { add_data(&page, INSTANCE_ROOT); add_data(&page, "/?page=login\">log in?\n"); } + } else if(strcmp(query, "myrepo") == 0) { + title = rv_strdup("My Repositories"); + desc = rv_strdup("You manage your repositories here."); + if(user == NULL) { + page = rv_strdup("It looks like you are not logged in.
Want to log in?\n"); + } } else if(strcmp(query, "logout") == 0) { title = rv_strdup("Logout"); desc = rv_strdup("You can log out from your account here."); @@ -174,7 +182,7 @@ void render_stuff(void) { add_data(&buffer, " float: left;\n"); add_data(&buffer, " margin: 0 0;\n"); add_data(&buffer, " padding-left: 0;\n"); - add_data(&buffer, " padding-right: 20px;\n"); + add_data(&buffer, " padding-right: 25px;\n"); add_data(&buffer, " padding-top: 7px;\n"); add_data(&buffer, "}\n"); add_data(&buffer, "body {\n"); @@ -273,6 +281,18 @@ void render_stuff(void) { add_data(&buffer, "/?page=login\">Login\n"); add_data(&buffer, " \n"); } else { + add_data(&buffer, "
\n"); + add_data(&buffer, " My Page\n"); + add_data(&buffer, "
\n"); + + add_data(&buffer, "
\n"); + add_data(&buffer, " My Repositories\n"); + add_data(&buffer, "
\n"); + add_data(&buffer, "
\n"); add_data(&buffer, "