diff options
author | Mikhail Voitenko <mav@openoffice.org> | 2008-02-11 07:35:34 +0000 |
---|---|---|
committer | Mikhail Voitenko <mav@openoffice.org> | 2008-02-11 07:35:34 +0000 |
commit | 1abd836201dd66b93a648c58ee929cfc45e170d7 (patch) | |
tree | a91ff1d27a51032ab0570321aa45cd23781815f9 | |
parent | 1b9a822eead9e30267f3425d67e8f9b56169113d (diff) |
change user and password handling
3 files changed, 21 insertions, 12 deletions
diff --git a/swext/mediawiki/src/com/sun/star/wiki/Helper.java b/swext/mediawiki/src/com/sun/star/wiki/Helper.java index 79200685fed2..a31d6ac13182 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/Helper.java +++ b/swext/mediawiki/src/com/sun/star/wiki/Helper.java @@ -4,9 +4,9 @@ * * $RCSfile: Helper.java,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: mav $ $Date: 2008-02-07 12:49:36 $ + * last change: $Author: mav $ $Date: 2008-02-11 08:35:34 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -782,7 +782,7 @@ public class Helper { HostConfiguration aHostConfig = null; - if ( sWikiUser != null && sWikiUser.length() > 0 && sWikiPass != null && xContext != null ) + if ( sWikiUser != null && sWikiPass != null && xContext != null ) { HostConfiguration aNewHostConfig = new HostConfiguration(); diff --git a/swext/mediawiki/src/com/sun/star/wiki/Settings.java b/swext/mediawiki/src/com/sun/star/wiki/Settings.java index 0204f50c07c0..3181dd658842 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/Settings.java +++ b/swext/mediawiki/src/com/sun/star/wiki/Settings.java @@ -4,9 +4,9 @@ * * $RCSfile: Settings.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: mav $ $Date: 2008-01-28 13:47:59 $ + * last change: $Author: mav $ $Date: 2008-02-11 08:35:34 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -35,17 +35,14 @@ package com.sun.star.wiki; -import com.sun.star.beans.NamedValue; import com.sun.star.container.XNameAccess; import com.sun.star.container.XNameContainer; import com.sun.star.container.XNameReplace; -import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XSingleServiceFactory; -import com.sun.star.uno.AnyConverter; +import com.sun.star.task.UrlRecord; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import com.sun.star.util.XChangesBatch; -import java.net.InetSocketAddress; import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; @@ -293,6 +290,16 @@ public class Settings ht.put( "Url", allCons[i] ); ht.put( "Username", "" ); ht.put( "Password", "" ); + + //TODO/LATER: how to handle more than one user? + // for now use the first one + UrlRecord aRecord = Helper.GetUsersForURL( m_xContext, allCons[i] ); + if ( aRecord != null && aRecord.UserList != null && aRecord.UserList.length > 0 ) + { + ht.put( "Username", aRecord.UserList[0] ); + if ( aRecord.UserList[0].Passwords != null && aRecord.UserList[0].Passwords.length > 0 ) + ht.put( "Password", aRecord.UserList[0].Passwords[0] ); + } addWikiCon( ht ); } diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java b/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java index 2ff56a8fb8b0..ab0a9405a279 100644 --- a/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java +++ b/swext/mediawiki/src/com/sun/star/wiki/WikiEditSettingDialog.java @@ -4,9 +4,9 @@ * * $RCSfile: WikiEditSettingDialog.java,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: mav $ $Date: 2008-02-10 15:56:36 $ + * last change: $Author: mav $ $Date: 2008-02-11 08:35:34 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -82,8 +82,10 @@ public class WikiEditSettingDialog extends WikiDialog XPropertySet xUrlField = GetPropSet( "UrlField" ); xUrlField.setPropertyValue( "Text", ht.get( "Url" ) ); + GetPropSet( "UsernameField" ).setPropertyValue( "Text", ht.get( "Username" )); - GetPropSet( "PasswordField" ).setPropertyValue( "Text", ht.get( "Password" )); + // the password should be entered or the Cancel should be pressed + // GetPropSet( "PasswordField" ).setPropertyValue( "Text", ht.get( "Password" )); } catch ( Exception ex ) { |