free(user);
user = NULL;
}
+#ifdef USE_MYPAGE
} else if(strcmp(query, "mypage") == 0) {
title = rv_strdup("My Page");
desc = rv_strdup("You manage your information here.");
add_data(&page, INSTANCE_ROOT);
add_data(&page, "/?page=login\">log in</a>?\n");
}
+#endif
} else if(strcmp(query, "myrepo") == 0) {
title = rv_strdup("My Repositories");
desc = rv_strdup("You manage your repositories here.");
add_data(&buffer, " </div>\n");
#endif
} else {
+#ifdef USE_MYPAGE
add_data(&buffer, " <div>\n");
add_data(&buffer, " <a href=\"");
add_data(&buffer, INSTANCE_ROOT);
add_data(&buffer, "/?page=mypage\">My Page</a>\n");
add_data(&buffer, " </div>\n");
+#endif
add_data(&buffer, " <div>\n");
add_data(&buffer, " <a href=\"");
return st;
}
+int check_mypage(void) {
+ int st = 0;
+#if defined(USE_MYPAGE) && !defined(USE_GRAPHICSMAGICK)
+ fprintf(stderr, "USE_MYPAGE is defined, but USE_GRAPHICSMAGICK is not defined.\n");
+ st = 1;
+#endif
+#if defined(USE_MYPAGE) && !defined(USE_LIBPNG)
+ fprintf(stderr, "USE_MYPAGE is defined, but USE_LIBPNG is not defined.\n");
+ st = 1;
+#endif
+ return st;
+}
+
int main() {
int st;
st = check_db();
if(st != 0) goto fail;
st = check_files();
if(st != 0) goto fail;
+ st = check_mypage();
+ if(st != 0) goto fail;
printf("Config validation successful.\n");
return 0;
fail:
/* Use GraphicsMagick or not. */
#define USE_GRAPHICSMAGICK
+/* Use libpng or not. */
+#define USE_LIBPNG
+
+/* My Page for the modern theme.*/
+/* Requires USE_GRAPHICSMAGICK and USE_LIBPNG to be defined. */
+#define USE_MYPAGE
+
/* PATH, uses PATH from environment automatically if not defined. */
#undef USE_PATH