Use new random_id() for queue IDs
[disorder] / server / actions.c
index 961fdec..2468b77 100644 (file)
@@ -33,7 +33,7 @@ static void redirect(const char *url) {
   /* By default use the 'back' argument */
   if(!url)
     url = cgi_get("back");
-  if(url) {
+  if(url && *url) {
     if(strncmp(url, "http", 4))
       /* If the target is not a full URL assume it's the action */
       url = cgi_makeurl(config->url, "action", url, (char *)0);
@@ -731,13 +731,15 @@ void dcgi_expand(const char *name, int header) {
   const char *p, *found;
 
   /* Parse macros first */
-  if((found = mx_find("macros.tmpl")))
+  if((found = mx_find("macros.tmpl", 1/*report*/)))
+    mx_expand_file(found, sink_discard(), 0);
+  if((found = mx_find("user.tmpl", 0/*report*/)))
     mx_expand_file(found, sink_discard(), 0);
   /* For unknown actions check that they aren't evil */
   if(!dcgi_valid_action(name))
     fatal(0, "invalid action name '%s'", name);
   byte_xasprintf((char **)&p, "%s.tmpl", name);
-  if(!(found = mx_find(p)))
+  if(!(found = mx_find(p, 0/*report*/)))
     fatal(errno, "cannot find %s", p);
   if(header) {
     if(printf("Content-Type: text/html\n"