Author: jkupec
Date: Fri Sep 26 16:21:00 2008
New Revision: 11185
URL: http://svn.opensuse.org/viewcvs/zypp?rev=11185&view=rev
Log:
- comments
- fixed setUserName() name to be consistent with getter
Modified:
trunk/libzypp/package/libzypp.changes
trunk/libzypp/zypp/media/CredentialManager.h
trunk/libzypp/zypp/media/MediaCurl.cc
trunk/libzypp/zypp/media/MediaUserAuth.h
Modified: trunk/libzypp/package/libzypp.changes
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=11185&r1=11184&r2=11185&view=diff
==============================================================================
--- trunk/libzypp/package/libzypp.changes (original)
+++ trunk/libzypp/package/libzypp.changes Fri Sep 26 16:21:00 2008
@@ -8,6 +8,12 @@
- version 5.13.0 (13)
-------------------------------------------------------------------
+Fri Sep 26 15:25:33 CEST 2008 - jkupec@suse.cz
+
+- save user credentials after asking for them
+- revision 11181
+
+-------------------------------------------------------------------
Thu Sep 25 23:19:55 CEST 2008 - jkupec@suse.cz
- ZConfig::credentialsGlobal{File,Dir}() added
Modified: trunk/libzypp/zypp/media/CredentialManager.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/media/CredentialManager.h?rev=11185&r1=11184&r2=11185&view=diff
==============================================================================
--- trunk/libzypp/zypp/media/CredentialManager.h (original)
+++ trunk/libzypp/zypp/media/CredentialManager.h Fri Sep 26 16:21:00 2008
@@ -111,6 +111,17 @@
/**
* Add new credentials with user callbacks.
+ *
+ * If the cred->url() contains 'credentials' query parameter, the
+ * credentials will be automatically saved to the specified file using the
+ * \ref saveInFile() method.
+ *
+ * Otherwise a callback will be called asking whether to save to custom
+ * file, or to global or user's credentials catalog.
+ *
+ * \todo Currently no callback is called, credentials are automatically
+ * saved to user's credentials.cat if no 'credentials' parameter
+ * has been specified
*/
void addCred(const AuthData & cred);
Modified: trunk/libzypp/zypp/media/MediaCurl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/media/MediaCurl.cc?rev=11185&r1=11184&r2=11185&view=diff
==============================================================================
--- trunk/libzypp/zypp/media/MediaCurl.cc (original)
+++ trunk/libzypp/zypp/media/MediaCurl.cc Fri Sep 26 16:21:00 2008
@@ -1605,10 +1605,10 @@
// preset the username if present in current url
if (!_url.getUsername().empty() && firstTry)
- curlcred->setUserName(_url.getUsername());
+ curlcred->setUsername(_url.getUsername());
string prompt_msg;
- if (!firstTry || !_url.getUsername().empty())
+ if (!firstTry)
prompt_msg = _("Invalid user name or password.");
else // first prompt
prompt_msg = boost::str(boost::format(
@@ -1625,7 +1625,18 @@
<< "CurlAuthData: " << *curlcred << endl;
if (curlcred->valid())
+ {
credentials = curlcred;
+ // if (credentials->username() != _url.getUsername())
+ // _url.setUsername(credentials->username());
+ /**
+ * \todo find a way to save the url with changed username
+ * back to repoinfo or dont store urls with username
+ * (and either forbid more repos with the same url and different
+ * user, or return a set of credentials from CM and try them one
+ * by one)
+ */
+ }
}
else
{
Modified: trunk/libzypp/zypp/media/MediaUserAuth.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/media/MediaUserAuth.h?rev=11185&r1=11184&r2=11185&view=diff
==============================================================================
--- trunk/libzypp/zypp/media/MediaUserAuth.h (original)
+++ trunk/libzypp/zypp/media/MediaUserAuth.h Fri Sep 26 16:21:00 2008
@@ -14,6 +14,8 @@
#include