Mailinglist Archive: yast-commit (1224 mails)
| < Previous | Next > |
[yast-commit] r59543 - /branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp
- From: rhafer@xxxxxxxxxxxxxxxx
- Date: Fri, 13 Nov 2009 16:32:29 -0000
- Message-id: <E1N8z4X-0004zJ-KN@xxxxxxxxxxxxxxxx>
Author: rhafer
Date: Fri Nov 13 17:32:29 2009
New Revision: 59543
URL: http://svn.opensuse.org/viewcvs/yast?rev=59543&view=rev
Log:
Moved retrieval of AdminPW to a separate function
Modified:
branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp
Modified: branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp?rev=59543&r1=59542&r2=59543&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp Fri Nov 13
17:32:29 2009
@@ -542,6 +542,40 @@
return ret;
}
+string VerifyAdminPasswordPopup( map<string,any> bindparm )
+{
+ Ldap::Set(bindparm);
+ Ldap::LDAPInitWithTLSCheck($[]);
+ string pw = "";
+ symbol state= `cont;
+ while ( state == `cont )
+ {
+ pw = Ldap::GetLDAPPassword(false);
+ if ( size(pw) == 0 )
+ {
+ state = `cancel;
+ }
+ else
+ {
+ string err = Ldap::LDAPBind( pw );
+ if ( err != "" )
+ {
+ pw = "";
+ if( ! Popup::YesNo( _("LDAP Authentication failed. Try
again?\n") +
+ _("Error message: ") + err ) )
+ {
+ state = `cancel;
+ }
+ }
+ else
+ {
+ state= `ok;
+ }
+ }
+ }
+ return pw;
+}
+
map <string,any> SyncreplAccountConfig( map<string,any> syncrepl )
{
term widget =
@@ -615,32 +649,10 @@
"ldap_server" : syncrepl["provider","target"]:"",
"ldap_tls" : syncrepl["starttls"]:true
];
- Ldap::Set(client);
- Ldap::LDAPInitWithTLSCheck($[]);
- symbol state= `cont;
- while ( state == `cont )
- {
- string pw = Ldap::GetLDAPPassword(false);
- string err = Ldap::LDAPBind( pw );
- if ( err != "" )
- {
- if( ! Popup::YesNo( _("LDAP Authentication failed. Try
again?\n") +
- _("Error message: ") + err ) )
- {
- state = `cancel;
- }
- }
- else
- {
- state= `ok;
- authinfo_firstdb = $[
- "bind_dn" : rootdn,
- "bind_pw" : pw
- ];
- }
- }
- if ( state == `ok )
+ string pw = VerifyAdminPasswordPopup( client, suffix );
+ if ( size(pw) > 0 )
{
+ authinfo_firstdb = $[ "bind_dn" : rootdn, "bind_pw" : pw ];
string dn = LdapPopup::BrowseTree(suffix);
if ( dn != "" )
{
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
Date: Fri Nov 13 17:32:29 2009
New Revision: 59543
URL: http://svn.opensuse.org/viewcvs/yast?rev=59543&view=rev
Log:
Moved retrieval of AdminPW to a separate function
Modified:
branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp
Modified: branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp?rev=59543&r1=59542&r2=59543&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/ldap-server/src/dialogs.ycp Fri Nov 13
17:32:29 2009
@@ -542,6 +542,40 @@
return ret;
}
+string VerifyAdminPasswordPopup( map<string,any> bindparm )
+{
+ Ldap::Set(bindparm);
+ Ldap::LDAPInitWithTLSCheck($[]);
+ string pw = "";
+ symbol state= `cont;
+ while ( state == `cont )
+ {
+ pw = Ldap::GetLDAPPassword(false);
+ if ( size(pw) == 0 )
+ {
+ state = `cancel;
+ }
+ else
+ {
+ string err = Ldap::LDAPBind( pw );
+ if ( err != "" )
+ {
+ pw = "";
+ if( ! Popup::YesNo( _("LDAP Authentication failed. Try
again?\n") +
+ _("Error message: ") + err ) )
+ {
+ state = `cancel;
+ }
+ }
+ else
+ {
+ state= `ok;
+ }
+ }
+ }
+ return pw;
+}
+
map <string,any> SyncreplAccountConfig( map<string,any> syncrepl )
{
term widget =
@@ -615,32 +649,10 @@
"ldap_server" : syncrepl["provider","target"]:"",
"ldap_tls" : syncrepl["starttls"]:true
];
- Ldap::Set(client);
- Ldap::LDAPInitWithTLSCheck($[]);
- symbol state= `cont;
- while ( state == `cont )
- {
- string pw = Ldap::GetLDAPPassword(false);
- string err = Ldap::LDAPBind( pw );
- if ( err != "" )
- {
- if( ! Popup::YesNo( _("LDAP Authentication failed. Try
again?\n") +
- _("Error message: ") + err ) )
- {
- state = `cancel;
- }
- }
- else
- {
- state= `ok;
- authinfo_firstdb = $[
- "bind_dn" : rootdn,
- "bind_pw" : pw
- ];
- }
- }
- if ( state == `ok )
+ string pw = VerifyAdminPasswordPopup( client, suffix );
+ if ( size(pw) > 0 )
{
+ authinfo_firstdb = $[ "bind_dn" : rootdn, "bind_pw" : pw ];
string dn = LdapPopup::BrowseTree(suffix);
if ( dn != "" )
{
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
| < Previous | Next > |