Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI: Do not show the access state if --noacl is active
  • Loading branch information
perexg committed Sep 13, 2014
1 parent 242496e commit a77b65a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/access.c
Expand Up @@ -46,7 +46,7 @@ struct access_ticket_queue access_tickets;
const char *superuser_username;
const char *superuser_password;

static int access_noacl;
int access_noacl;

/**
*
Expand Down
5 changes: 4 additions & 1 deletion src/webui/comet.c
Expand Up @@ -138,12 +138,15 @@ comet_mailbox_create(void)
static void
comet_access_update(http_connection_t *hc, comet_mailbox_t *cmb)
{
extern int access_noacl;

htsmsg_t *m = htsmsg_create_map();
const char *username = hc->hc_access ? (hc->hc_access->aa_username ?: "") : "";

htsmsg_add_str(m, "notificationClass", "accessUpdate");

htsmsg_add_str(m, "username", username);
if (!access_noacl)
htsmsg_add_str(m, "username", username);
htsmsg_add_u32(m, "dvr", !http_access_verify(hc, ACCESS_RECORDER));
htsmsg_add_u32(m, "admin", !http_access_verify(hc, ACCESS_ADMIN));

Expand Down
5 changes: 2 additions & 3 deletions src/webui/static/app/tvheadend.js
Expand Up @@ -311,7 +311,8 @@ function accessUpdate(o) {
if (!tvheadend.capabilities)
return;

tvheadend.rootTabPanel.setLogin(o.username);
if ('username' in o)
tvheadend.rootTabPanel.setLogin(o.username);

if (tvheadend.autorecButton)
tvheadend.autorecButton.setDisabled(o.dvr != true);
Expand Down Expand Up @@ -514,8 +515,6 @@ tvheadend.RootTabPanel = Ext.extend(Ext.TabPanel, {
if (p == this.loginItem || p == this.loginCmdItem)
return false;
});

this.setLogin('');
},

getComponent: function(comp) {
Expand Down

0 comments on commit a77b65a

Please sign in to comment.