diff options
Diffstat (limited to 'connectivity/source/drivers/mysql/YUser.cxx')
-rw-r--r-- | connectivity/source/drivers/mysql/YUser.cxx | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/connectivity/source/drivers/mysql/YUser.cxx b/connectivity/source/drivers/mysql/YUser.cxx index d184230cb120..5f300a3b0672 100644 --- a/connectivity/source/drivers/mysql/YUser.cxx +++ b/connectivity/source/drivers/mysql/YUser.cxx @@ -43,7 +43,7 @@ OMySQLUser::OMySQLUser( const ::com::sun::star::uno::Reference< ::com::sun::star } // ------------------------------------------------------------------------- OMySQLUser::OMySQLUser( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection, - const ::rtl::OUString& _Name + const OUString& _Name ) : connectivity::sdbcx::OUser(_Name,sal_True) ,m_xConnection(_xConnection) { @@ -61,7 +61,7 @@ OUserExtend::OUserExtend( const ::com::sun::star::uno::Reference< ::com::sun:: // ------------------------------------------------------------------------- void OUserExtend::construct() { - registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD), PROPERTY_ID_PASSWORD,0,&m_Password,::getCppuType(static_cast< ::rtl::OUString*>(0))); + registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PASSWORD), PROPERTY_ID_PASSWORD,0,&m_Password,::getCppuType(static_cast< OUString*>(0))); } // ----------------------------------------------------------------------------- cppu::IPropertyArrayHelper* OUserExtend::createArrayHelper() const @@ -77,7 +77,7 @@ cppu::IPropertyArrayHelper & OUserExtend::getInfoHelper() } typedef connectivity::sdbcx::OUser_BASE OUser_BASE_RBHELPER; // ----------------------------------------------------------------------------- -sal_Int32 SAL_CALL OMySQLUser::getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(SQLException, RuntimeException) +sal_Int32 SAL_CALL OMySQLUser::getPrivileges( const OUString& objName, sal_Int32 objType ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed); @@ -87,12 +87,12 @@ sal_Int32 SAL_CALL OMySQLUser::getPrivileges( const ::rtl::OUString& objName, sa return nRights; } // ----------------------------------------------------------------------------- -void OMySQLUser::findPrivilegesAndGrantPrivileges(const ::rtl::OUString& objName, sal_Int32 objType,sal_Int32& nRights,sal_Int32& nRightsWithGrant) throw(SQLException, RuntimeException) +void OMySQLUser::findPrivilegesAndGrantPrivileges(const OUString& objName, sal_Int32 objType,sal_Int32& nRights,sal_Int32& nRightsWithGrant) throw(SQLException, RuntimeException) { nRightsWithGrant = nRights = 0; // first we need to create the sql stmt to select the privs Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); - ::rtl::OUString sCatalog,sSchema,sTable; + OUString sCatalog,sSchema,sTable; ::dbtools::qualifiedNameComponents(xMeta,objName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation); Reference<XResultSet> xRes; switch(objType) @@ -112,32 +112,32 @@ void OMySQLUser::findPrivilegesAndGrantPrivileges(const ::rtl::OUString& objName Any aCatalog; if ( !sCatalog.isEmpty() ) aCatalog <<= sCatalog; - xRes = xMeta->getColumnPrivileges(aCatalog,sSchema,sTable,::rtl::OUString("%")); + xRes = xMeta->getColumnPrivileges(aCatalog,sSchema,sTable,OUString("%")); } break; } if ( xRes.is() ) { - static const ::rtl::OUString sSELECT( "SELECT" ); - static const ::rtl::OUString sINSERT( "INSERT" ); - static const ::rtl::OUString sUPDATE( "UPDATE" ); - static const ::rtl::OUString sDELETE( "DELETE" ); - static const ::rtl::OUString sREAD( "READ" ); - static const ::rtl::OUString sCREATE( "CREATE" ); - static const ::rtl::OUString sALTER( "ALTER" ); - static const ::rtl::OUString sREFERENCE( "REFERENCE" ); - static const ::rtl::OUString sDROP( "DROP" ); - static const ::rtl::OUString sYes( "YES" ); + static const OUString sSELECT( "SELECT" ); + static const OUString sINSERT( "INSERT" ); + static const OUString sUPDATE( "UPDATE" ); + static const OUString sDELETE( "DELETE" ); + static const OUString sREAD( "READ" ); + static const OUString sCREATE( "CREATE" ); + static const OUString sALTER( "ALTER" ); + static const OUString sREFERENCE( "REFERENCE" ); + static const OUString sDROP( "DROP" ); + static const OUString sYes( "YES" ); nRightsWithGrant = nRights = 0; Reference<XRow> xCurrentRow(xRes,UNO_QUERY); while( xCurrentRow.is() && xRes->next() ) { - ::rtl::OUString sGrantee = xCurrentRow->getString(5); - ::rtl::OUString sPrivilege = xCurrentRow->getString(6); - ::rtl::OUString sGrantable = xCurrentRow->getString(7); + OUString sGrantee = xCurrentRow->getString(5); + OUString sPrivilege = xCurrentRow->getString(6); + OUString sGrantable = xCurrentRow->getString(7); if (!m_Name.equalsIgnoreAsciiCase(sGrantee)) continue; @@ -201,7 +201,7 @@ void OMySQLUser::findPrivilegesAndGrantPrivileges(const ::rtl::OUString& objName } } // ------------------------------------------------------------------------- -sal_Int32 SAL_CALL OMySQLUser::getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(SQLException, RuntimeException) +sal_Int32 SAL_CALL OMySQLUser::getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed); @@ -211,27 +211,27 @@ sal_Int32 SAL_CALL OMySQLUser::getGrantablePrivileges( const ::rtl::OUString& ob return nRightsWithGrant; } // ------------------------------------------------------------------------- -void SAL_CALL OMySQLUser::grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(SQLException, RuntimeException) +void SAL_CALL OMySQLUser::grantPrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(SQLException, RuntimeException) { if ( objType != PrivilegeObject::TABLE ) { ::connectivity::SharedResources aResources; - const ::rtl::OUString sError( aResources.getResourceString(STR_PRIVILEGE_NOT_GRANTED)); + const OUString sError( aResources.getResourceString(STR_PRIVILEGE_NOT_GRANTED)); ::dbtools::throwGenericSQLException(sError,*this); } // if ( objType != PrivilegeObject::TABLE ) ::osl::MutexGuard aGuard(m_aMutex); - ::rtl::OUString sPrivs = getPrivilegeString(objPrivileges); + OUString sPrivs = getPrivilegeString(objPrivileges); if(!sPrivs.isEmpty()) { - ::rtl::OUString sGrant; - sGrant += ::rtl::OUString("GRANT "); + OUString sGrant; + sGrant += OUString("GRANT "); sGrant += sPrivs; - sGrant += ::rtl::OUString(" ON "); + sGrant += OUString(" ON "); Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); sGrant += ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation); - sGrant += ::rtl::OUString(" TO "); + sGrant += OUString(" TO "); sGrant += m_Name; Reference<XStatement> xStmt = m_xConnection->createStatement(); @@ -241,27 +241,27 @@ void SAL_CALL OMySQLUser::grantPrivileges( const ::rtl::OUString& objName, sal_I } } // ------------------------------------------------------------------------- -void SAL_CALL OMySQLUser::revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(SQLException, RuntimeException) +void SAL_CALL OMySQLUser::revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(SQLException, RuntimeException) { if ( objType != PrivilegeObject::TABLE ) { ::connectivity::SharedResources aResources; - const ::rtl::OUString sError( aResources.getResourceString(STR_PRIVILEGE_NOT_REVOKED)); + const OUString sError( aResources.getResourceString(STR_PRIVILEGE_NOT_REVOKED)); ::dbtools::throwGenericSQLException(sError,*this); } ::osl::MutexGuard aGuard(m_aMutex); checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed); - ::rtl::OUString sPrivs = getPrivilegeString(objPrivileges); + OUString sPrivs = getPrivilegeString(objPrivileges); if(!sPrivs.isEmpty()) { - ::rtl::OUString sGrant; - sGrant += ::rtl::OUString("REVOKE "); + OUString sGrant; + sGrant += OUString("REVOKE "); sGrant += sPrivs; - sGrant += ::rtl::OUString(" ON "); + sGrant += OUString(" ON "); Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); sGrant += ::dbtools::quoteTableName(xMeta,objName,::dbtools::eInDataManipulation); - sGrant += ::rtl::OUString(" FROM "); + sGrant += OUString(" FROM "); sGrant += m_Name; Reference<XStatement> xStmt = m_xConnection->createStatement(); @@ -272,16 +272,16 @@ void SAL_CALL OMySQLUser::revokePrivileges( const ::rtl::OUString& objName, sal_ } // ----------------------------------------------------------------------------- // XUser -void SAL_CALL OMySQLUser::changePassword( const ::rtl::OUString& /*oldPassword*/, const ::rtl::OUString& newPassword ) throw(SQLException, RuntimeException) +void SAL_CALL OMySQLUser::changePassword( const OUString& /*oldPassword*/, const OUString& newPassword ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard(m_aMutex); checkDisposed(OUser_BASE_RBHELPER::rBHelper.bDisposed); - ::rtl::OUString sAlterPwd; - sAlterPwd = ::rtl::OUString("SET PASSWORD FOR "); + OUString sAlterPwd; + sAlterPwd = OUString("SET PASSWORD FOR "); sAlterPwd += m_Name; - sAlterPwd += ::rtl::OUString("@\"%\" = PASSWORD('") ; + sAlterPwd += OUString("@\"%\" = PASSWORD('") ; sAlterPwd += newPassword; - sAlterPwd += ::rtl::OUString("')") ; + sAlterPwd += OUString("')") ; Reference<XStatement> xStmt = m_xConnection->createStatement(); @@ -292,45 +292,45 @@ void SAL_CALL OMySQLUser::changePassword( const ::rtl::OUString& /*oldPassword*/ } } // ----------------------------------------------------------------------------- -::rtl::OUString OMySQLUser::getPrivilegeString(sal_Int32 nRights) const +OUString OMySQLUser::getPrivilegeString(sal_Int32 nRights) const { - ::rtl::OUString sPrivs; + OUString sPrivs; if((nRights & Privilege::INSERT) == Privilege::INSERT) - sPrivs += ::rtl::OUString("INSERT"); + sPrivs += OUString("INSERT"); if((nRights & Privilege::DELETE) == Privilege::DELETE) { if(!sPrivs.isEmpty()) - sPrivs += ::rtl::OUString(","); - sPrivs += ::rtl::OUString("DELETE"); + sPrivs += OUString(","); + sPrivs += OUString("DELETE"); } if((nRights & Privilege::UPDATE) == Privilege::UPDATE) { if(!sPrivs.isEmpty()) - sPrivs += ::rtl::OUString(","); - sPrivs += ::rtl::OUString("UPDATE"); + sPrivs += OUString(","); + sPrivs += OUString("UPDATE"); } if((nRights & Privilege::ALTER) == Privilege::ALTER) { if(!sPrivs.isEmpty()) - sPrivs += ::rtl::OUString(","); - sPrivs += ::rtl::OUString("ALTER"); + sPrivs += OUString(","); + sPrivs += OUString("ALTER"); } if((nRights & Privilege::SELECT) == Privilege::SELECT) { if(!sPrivs.isEmpty()) - sPrivs += ::rtl::OUString(","); - sPrivs += ::rtl::OUString("SELECT"); + sPrivs += OUString(","); + sPrivs += OUString("SELECT"); } if((nRights & Privilege::REFERENCE) == Privilege::REFERENCE) { if(!sPrivs.isEmpty()) - sPrivs += ::rtl::OUString(","); - sPrivs += ::rtl::OUString("REFERENCES"); + sPrivs += OUString(","); + sPrivs += OUString("REFERENCES"); } return sPrivs; |