LCOV - code coverage report
Current view: top level - ucbhelper/source/provider - simpleauthenticationrequest.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 52 0.0 %
Date: 2012-08-25 Functions: 0 3 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 74 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*
       3                 :            :  * This file is part of the LibreOffice project.
       4                 :            :  *
       5                 :            :  * This Source Code Form is subject to the terms of the Mozilla Public
       6                 :            :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7                 :            :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8                 :            :  *
       9                 :            :  * This file incorporates work covered by the following license notice:
      10                 :            :  *
      11                 :            :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12                 :            :  *   contributor license agreements. See the NOTICE file distributed
      13                 :            :  *   with this work for additional information regarding copyright
      14                 :            :  *   ownership. The ASF licenses this file to you under the Apache
      15                 :            :  *   License, Version 2.0 (the "License"); you may not use this file
      16                 :            :  *   except in compliance with the License. You may obtain a copy of
      17                 :            :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18                 :            :  */
      19                 :            : 
      20                 :            : #include <com/sun/star/task/XMasterPasswordHandling.hpp>
      21                 :            : #include <com/sun/star/ucb/URLAuthenticationRequest.hpp>
      22                 :            : #include <ucbhelper/simpleauthenticationrequest.hxx>
      23                 :            : 
      24                 :            : using namespace com::sun::star;
      25                 :            : using namespace ucbhelper;
      26                 :            : 
      27                 :            : //=========================================================================
      28                 :          0 : SimpleAuthenticationRequest::SimpleAuthenticationRequest(
      29                 :            :                                       const rtl::OUString & rURL,
      30                 :            :                                       const rtl::OUString & rServerName,
      31                 :            :                                       const rtl::OUString & rRealm,
      32                 :            :                                       const rtl::OUString & rUserName,
      33                 :            :                                       const rtl::OUString & rPassword,
      34                 :            :                                       const rtl::OUString & rAccount,
      35                 :            :                                       sal_Bool bAllowPersistentStoring,
      36                 :          0 :                                       sal_Bool bAllowUseSystemCredentials )
      37                 :            : {
      38                 :            : 
      39                 :            :     // Fill request...
      40         [ #  # ]:          0 :     ucb::URLAuthenticationRequest aRequest;
      41                 :            : //    aRequest.Message        = // OUString
      42                 :            : //    aRequest.Context        = // XInterface
      43                 :          0 :     aRequest.Classification = task::InteractionClassification_ERROR;
      44                 :          0 :     aRequest.ServerName     = rServerName;
      45                 :            : //    aRequest.Diagnostic     = // OUString
      46                 :          0 :     aRequest.HasRealm       = !rRealm.isEmpty();
      47         [ #  # ]:          0 :     if ( aRequest.HasRealm )
      48                 :          0 :         aRequest.Realm = rRealm;
      49                 :          0 :     aRequest.HasUserName    = sal_True;
      50                 :          0 :     aRequest.UserName       = rUserName;
      51                 :          0 :     aRequest.HasPassword    = sal_True;
      52                 :          0 :     aRequest.Password       = rPassword;
      53                 :          0 :     aRequest.HasAccount     = !rAccount.isEmpty();
      54         [ #  # ]:          0 :     if ( aRequest.HasAccount )
      55                 :          0 :         aRequest.Account = rAccount;
      56                 :          0 :     aRequest.URL = rURL;
      57                 :            : 
      58                 :            :     initialize(aRequest,
      59                 :            :        sal_False,
      60                 :            :        sal_True,
      61                 :            :        sal_True,
      62                 :            :        aRequest.HasAccount,
      63                 :            :        bAllowPersistentStoring,
      64 [ #  # ][ #  # ]:          0 :        bAllowUseSystemCredentials );
      65                 :          0 : }
      66                 :            : 
      67                 :            : //=========================================================================
      68                 :          0 : SimpleAuthenticationRequest::SimpleAuthenticationRequest(
      69                 :            :                                       const rtl::OUString & rURL,
      70                 :            :                                       const rtl::OUString & rServerName,
      71                 :            :                                       EntityType eRealmType,
      72                 :            :                                       const rtl::OUString & rRealm,
      73                 :            :                                       EntityType eUserNameType,
      74                 :            :                                       const rtl::OUString & rUserName,
      75                 :            :                                       EntityType ePasswordType,
      76                 :            :                                       const rtl::OUString & rPassword,
      77                 :            :                                       EntityType eAccountType,
      78                 :          0 :                                       const rtl::OUString & rAccount )
      79                 :            : {
      80                 :            :     // Fill request...
      81         [ #  # ]:          0 :     ucb::URLAuthenticationRequest aRequest;
      82                 :            : //    aRequest.Message        = // OUString
      83                 :            : //    aRequest.Context        = // XInterface
      84                 :          0 :     aRequest.Classification = task::InteractionClassification_ERROR;
      85                 :          0 :     aRequest.ServerName     = rServerName;
      86                 :            : //    aRequest.Diagnostic     = // OUString
      87                 :          0 :     aRequest.HasRealm       = eRealmType != ENTITY_NA;
      88         [ #  # ]:          0 :     if ( aRequest.HasRealm )
      89                 :          0 :         aRequest.Realm = rRealm;
      90                 :          0 :     aRequest.HasUserName    = eUserNameType != ENTITY_NA;
      91         [ #  # ]:          0 :     if ( aRequest.HasUserName )
      92                 :          0 :         aRequest.UserName = rUserName;
      93                 :          0 :     aRequest.HasPassword    = ePasswordType != ENTITY_NA;
      94         [ #  # ]:          0 :     if ( aRequest.HasPassword )
      95                 :          0 :         aRequest.Password = rPassword;
      96                 :          0 :     aRequest.HasAccount     = eAccountType != ENTITY_NA;
      97         [ #  # ]:          0 :     if ( aRequest.HasAccount )
      98                 :          0 :         aRequest.Account = rAccount;
      99                 :          0 :     aRequest.URL = rURL;
     100                 :            : 
     101                 :            :     initialize(aRequest,
     102                 :            :        eRealmType == ENTITY_MODIFY,
     103                 :            :        eUserNameType == ENTITY_MODIFY,
     104                 :            :        ePasswordType == ENTITY_MODIFY,
     105                 :            :        eAccountType == ENTITY_MODIFY,
     106                 :            :        sal_True,
     107 [ #  # ][ #  # ]:          0 :        sal_False );
     108                 :          0 : }
     109                 :            : 
     110                 :            : //=========================================================================
     111                 :          0 : void SimpleAuthenticationRequest::initialize(
     112                 :            :       const ucb::URLAuthenticationRequest & rRequest,
     113                 :            :       sal_Bool bCanSetRealm,
     114                 :            :       sal_Bool bCanSetUserName,
     115                 :            :       sal_Bool bCanSetPassword,
     116                 :            :       sal_Bool bCanSetAccount,
     117                 :            :       sal_Bool bAllowPersistentStoring,
     118                 :            :       sal_Bool bAllowUseSystemCredentials )
     119                 :            : {
     120 [ #  # ][ #  # ]:          0 :     setRequest( uno::makeAny( rRequest ) );
     121                 :            : 
     122                 :            :     // Fill continuations...
     123                 :            :     uno::Sequence< ucb::RememberAuthentication > aRememberModes(
     124 [ #  # ][ #  # ]:          0 :         bAllowPersistentStoring ? 3 : 2 );
     125         [ #  # ]:          0 :     aRememberModes[ 0 ] = ucb::RememberAuthentication_NO;
     126         [ #  # ]:          0 :     aRememberModes[ 1 ] = ucb::RememberAuthentication_SESSION;
     127         [ #  # ]:          0 :     if (bAllowPersistentStoring)
     128         [ #  # ]:          0 :         aRememberModes[ 2 ] = ucb::RememberAuthentication_PERSISTENT;
     129                 :            : 
     130                 :            :     m_xAuthSupplier
     131                 :            :         = new InteractionSupplyAuthentication(
     132                 :            :                 this,
     133                 :            :                 bCanSetRealm,
     134                 :            :                 bCanSetUserName,
     135                 :            :                 bCanSetPassword,
     136                 :            :                 bCanSetAccount,
     137                 :            :                 aRememberModes, // rRememberPasswordModes
     138                 :            :                 ucb::RememberAuthentication_SESSION, // eDefaultRememberPasswordMode
     139                 :            :                 aRememberModes, // rRememberAccountModes
     140                 :            :                 ucb::RememberAuthentication_SESSION, // eDefaultRememberAccountMode
     141                 :            :                 bAllowUseSystemCredentials, // bCanUseSystemCredentials,
     142                 :            :                 false // bDefaultUseSystemCredentials
     143 [ #  # ][ #  # ]:          0 :             );
     144                 :            : 
     145                 :            :     uno::Sequence<
     146         [ #  # ]:          0 :         uno::Reference< task::XInteractionContinuation > > aContinuations( 3 );
     147 [ #  # ][ #  # ]:          0 :     aContinuations[ 0 ] = new InteractionAbort( this );
         [ #  # ][ #  # ]
     148 [ #  # ][ #  # ]:          0 :     aContinuations[ 1 ] = new InteractionRetry( this );
         [ #  # ][ #  # ]
     149 [ #  # ][ #  # ]:          0 :     aContinuations[ 2 ] = m_xAuthSupplier.get();
                 [ #  # ]
     150                 :            : 
     151 [ #  # ][ #  # ]:          0 :     setContinuations( aContinuations );
                 [ #  # ]
     152                 :          0 : }
     153                 :            : 
     154                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10