- 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
/**
* 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);
// 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(
<< "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
{
#include <curl/curl.h>
+#include "zypp/base/Deprecated.h"
+
#include "zypp/Url.h"
#include "zypp/base/PtrTypes.h"
virtual bool valid() const;
void setUrl(const Url & url) { _url = url; }
- void setUserName(const std::string & username) { _username = username; }
+ void setUsername(const std::string & username) { _username = username; }
+ /** \deprecated use setUsername() instead */
+ ZYPP_DEPRECATED void setUserName(const std::string & username) { _username = username; }
void setPassword(const std::string & password) { _password = password; }
Url url() const { return _url; }