Hopefully this is a very simple idea and easy to implement.
For every user i setup, part of the processes is linking their download folder to an accessable HTTPS folder on the server. This link is always their username ie:
# ln -s /home/USER1/rtorrent/downloads/ /var/www/USER1
I am trying to create a plugin that does the following:
- Checks authentication/user to make sure it knows what user is logged in.
- redirects the new plugin tab so that when the plugin is clicked it simply opens this link in the tab.
Problem is multi-users i havent quite figured out how to get JS to do the authentication if even possible.
I should add im currently using lighttpd with htdigest for user authentication.
I am fairly new at all this and my code is probably garbage but im posting here anyways in case someone can tidy it up/figure it out. Im not looking for any functionality besides actually just being able to see the links to the files.
This is what i have to far:
Code:
var frame = null;
user = "$user"; ## I KNOW THIS ISNT RIGHT##
plugin.addNewTabWithURL = function( tabName, tabURL )
{
frame = document.createElement("IFRAME");
frame.name = "new_url";
frame.src = tabURL;
frame.id = "new_url";
frame.style.width = "100%";
frame.style.height = "100%";
frame.style.border = "0";
this.attachPageToTabs(frame,tabName);
}
theTabs.onShow = function(id)
{
if(id=="new_url")
{
frame.src = "https://server1.gamestuff.ca/" + user;
}
}
plugin.addNewTabWithURL( "File Explorer");
For every user i setup, part of the processes is linking their download folder to an accessable HTTPS folder on the server. This link is always their username ie:
# ln -s /home/USER1/rtorrent/downloads/ /var/www/USER1
I am trying to create a plugin that does the following:
- Checks authentication/user to make sure it knows what user is logged in.
- redirects the new plugin tab so that when the plugin is clicked it simply opens this link in the tab.
Problem is multi-users i havent quite figured out how to get JS to do the authentication if even possible.
I should add im currently using lighttpd with htdigest for user authentication.
I am fairly new at all this and my code is probably garbage but im posting here anyways in case someone can tidy it up/figure it out. Im not looking for any functionality besides actually just being able to see the links to the files.
This is what i have to far:
Code:
var frame = null;
user = "$user"; ## I KNOW THIS ISNT RIGHT##
plugin.addNewTabWithURL = function( tabName, tabURL )
{
frame = document.createElement("IFRAME");
frame.name = "new_url";
frame.src = tabURL;
frame.id = "new_url";
frame.style.width = "100%";
frame.style.height = "100%";
frame.style.border = "0";
this.attachPageToTabs(frame,tabName);
}
theTabs.onShow = function(id)
{
if(id=="new_url")
{
frame.src = "https://server1.gamestuff.ca/" + user;
}
}
plugin.addNewTabWithURL( "File Explorer");