Permalink
Browse files

Added: NAS USerid/password to share security

  • Loading branch information...
hippojay committed Sep 15, 2011
1 parent 92eab93 commit 731cd0fbda417cb8f23792a6e9f709e9add106c8
Showing with 10 additions and 3 deletions.
  1. +5 −3 default.py
  2. +2 −0 resources/language/English/strings.xml
  3. +3 −0 resources/settings.xml
View
@@ -351,17 +351,19 @@ def mediaType(partproperties, server, dvdplayback=False):
#Might be OSX type, in which case, remove Volumes and replace with server
if g_nasoverride == "true":
server=g_nasoverrideip
+ loginstring=__settings__.getSetting('nasuserid')+":"+__settings__.getSetting('naspass')+"@"
else:
server=server.split(':')[0]
+ loginstring=""
if file.find('Volumes') > 0:
- filelocation=protocol+":/"+file.replace("Volumes",server)
+ filelocation=protocol+":/"+file.replace("Volumes",loginstring+server)
else:
if type == "winfile":
- filelocation=protocol+"://"+server+"/"+file[3:]
+ filelocation=protocol+"://"+loginstring+server+"/"+file[3:]
else:
#else assume its a file local to server available over smb/samba (now we have linux PMS). Add server name to file path.
- filelocation=protocol+"://"+server+file
+ filelocation=protocol+"://"+loginstring+server+file
else:
printDebug( "No option detected, streaming is safest to choose" )
filelocation="http://"+server+stream
@@ -66,4 +66,6 @@
<string id="30061">Override SMB location</string>
<string id="30062">NAS IP Address</string>
<string id="30063">AFP</string>
+ <string id="30064">NAS Username</string>
+ <string id="30065">NAS password</string>
</strings>
View
@@ -8,6 +8,9 @@
<setting id="forcedvd" type="bool" label="30060" default="false"/>
<setting id="nasoverride" type="bool" label="30061" default="false"/>
<setting id="nasoverrideip" type="text" label="30062" default="" visible="eq(-1,true)" enable="eq(-1,true)" />
+ <setting id="nasuserid" type="text" label="30064" default="" visible="eq(-2,true)" enable="eq(-2,true)" />
+ <setting id="naspass" type="text" label="30065" option="hidden" default="" visible="eq(-3,true)" enable="eq(-3,true)" />
+
</category>

0 comments on commit 731cd0f

Please sign in to comment.