Mailinglist Archive: zypp-commit (315 mails)

< Previous Next >
[zypp-commit] r11181 - in /trunk/libzypp/zypp/media: CredentialManager.cc MediaCurl.cc
  • From: jkupec@xxxxxxxxxxxxxxxx
  • Date: Fri, 26 Sep 2008 13:25:03 -0000
  • Message-id: <20080926132503.CE41926AD3@xxxxxxxxxxxxxxxx>
Author: jkupec
Date: Fri Sep 26 15:25:03 2008
New Revision: 11181

URL: http://svn.opensuse.org/viewcvs/zypp?rev=11181&view=rev
Log:
- save credentials after asking for them
- todo: ask user _where_ to store them. Automatically saving to user's
credentials.cat for now

Modified:
trunk/libzypp/zypp/media/CredentialManager.cc
trunk/libzypp/zypp/media/MediaCurl.cc

Modified: trunk/libzypp/zypp/media/CredentialManager.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/media/CredentialManager.cc?rev=11181&r1=11180&r2=11181&view=diff
==============================================================================
--- trunk/libzypp/zypp/media/CredentialManager.cc (original)
+++ trunk/libzypp/zypp/media/CredentialManager.cc Fri Sep 26 15:25:03 2008
@@ -286,8 +286,12 @@

void CredentialManager::addCred(const AuthData & cred)
{
-#warning addCred(const AuthData & cred) not implemented
- // add with user callbacks
+ Pathname credfile = cred.url().getQueryParam("credentials");
+ if (credfile.empty())
+ //! \todo ask user where to store these creds. saving to user creds for
now
+ addUserCred(cred);
+ else
+ saveInFile(cred, credfile);
}


@@ -338,6 +342,7 @@
{
AuthData_Ptr c_ptr;
c_ptr.reset(new AuthData(cred)); // FIX for child classes if needed
+ c_ptr->setUrl(Url()); // don't save url in custom creds file
CredentialManager::CredentialSet creds;
creds.insert(c_ptr);


Modified: trunk/libzypp/zypp/media/MediaCurl.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/media/MediaCurl.cc?rev=11181&r1=11180&r2=11181&view=diff
==============================================================================
--- trunk/libzypp/zypp/media/MediaCurl.cc (original)
+++ trunk/libzypp/zypp/media/MediaCurl.cc Fri Sep 26 15:25:03 2008
@@ -1653,6 +1653,13 @@
if ( ret != 0 ) ZYPP_THROW(MediaCurlSetOptException(_url, _curlError));
}

+ if (!cmcred)
+ {
+ credentials->setUrl(_url);
+ cm.addCred(*credentials);
+ cm.save();
+ }
+
return true;
}


--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages