]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
htsp: initialize creator for network accounts without usernames (IP addresses) for...
authorJaroslav Kysela <perex@perex.cz>
Thu, 21 May 2015 19:54:09 +0000 (21:54 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 21 May 2015 19:57:09 +0000 (21:57 +0200)
src/htsp_server.c

index 74019ebd6e32f1018b3b63408fb993ca75d40ca4..0fc7d1a820866d75ee0aea03cf6c61906616520b 100644 (file)
@@ -1683,6 +1683,8 @@ htsp_method_addAutorecEntry(htsp_connection_t *htsp, htsmsg_t *in)
   if(htsmsg_get_s64(in, "stopExtra", &stop_extra))
     stop_extra  = 0;     // 0 = dvr config
   creator = htsp->htsp_username;
+  if (creator == NULL || *creator == '\0')
+    creator = htsp->htsp_granted_access->aa_representative;
   if (!(comment = htsmsg_get_str(in, "comment")))
     comment = "";
   if (!(name = htsmsg_get_str(in, "name")))
@@ -1782,6 +1784,8 @@ htsp_method_addTimerecEntry(htsp_connection_t *htsp, htsmsg_t *in)
     enabled = 1;
 
   creator = htsp->htsp_username;
+  if (creator == NULL || *creator == '\0')
+    creator = htsp->htsp_granted_access->aa_representative;
   if (!(comment = htsmsg_get_str(in, "comment")))
     comment = "";
   if (!(name = htsmsg_get_str(in, "name")))