Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

strip added smb:// shares of their user/pass when adding, and instead…

… store that info in the password manager
  • Loading branch information...
commit 16d4661bee65691e52f2a39a9b7ad2834082941a 1 parent 870c888
Jonathan Marshall authored
Showing with 15 additions and 1 deletion.
  1. +15 −1 xbmc/dialogs/GUIDialogMediaSource.cpp
16 xbmc/dialogs/GUIDialogMediaSource.cpp
View
@@ -33,6 +33,7 @@
#include "settings/Settings.h"
#include "settings/GUISettings.h"
#include "guilib/LocalizeStrings.h"
+#include "PasswordManager.h"
using namespace std;
using namespace XFILE;
@@ -467,7 +468,20 @@ vector<CStdString> CGUIDialogMediaSource::GetPaths()
{
vector<CStdString> paths;
for (int i = 0; i < m_paths->Size(); i++)
+ {
if (!m_paths->Get(i)->GetPath().IsEmpty())
- paths.push_back(m_paths->Get(i)->GetPath());
+ { // strip off the user and password for smb paths (anything that the password manager can auth)
+ // and add the user/pass to the password manager - note, we haven't confirmed that it works
+ // at this point, but if it doesn't, the user will get prompted anyway in SMBDirectory.
+ CURL url(m_paths->Get(i)->GetPath());
+ if (url.GetProtocol() == "smb")
+ {
+ CPasswordManager::GetInstance().SaveAuthenticatedURL(url);
+ url.SetPassword("");
+ url.SetUserName("");
+ }
+ paths.push_back(url.Get());
+ }
+ }
return paths;
}
Please sign in to comment.
Something went wrong with that request. Please try again.