mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Updating webpi package files
This commit is contained in:
parent
bb41f1f559
commit
248cc7ecde
9
lib/msdeploy/createlogin.sql
Normal file
9
lib/msdeploy/createlogin.sql
Normal file
@ -0,0 +1,9 @@
|
||||
/**********************************************************************/
|
||||
/* Install.SQL */
|
||||
/* Creates a login and makes the user a member of db roles */
|
||||
/* */
|
||||
/* Modifications for SQL AZURE - ON MASTER */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
CREATE LOGIN PlaceHolderForUser WITH PASSWORD = 'PlaceHolderForPassword'
|
15
lib/msdeploy/createuser.sql
Normal file
15
lib/msdeploy/createuser.sql
Normal file
@ -0,0 +1,15 @@
|
||||
/**********************************************************************/
|
||||
/* CreateUser.SQL */
|
||||
/* Creates a user and makes the user a member of db roles */
|
||||
/* This script runs against the User database and requires connection string */
|
||||
/* Supports SQL Server and SQL AZURE */
|
||||
/**********************************************************************/
|
||||
|
||||
-- Create database user and map to login
|
||||
-- and add user to the datareader, datawriter, ddladmin and securityadmin roles
|
||||
--
|
||||
|
||||
CREATE USER PlaceHolderForUser FOR LOGIN PlaceHolderForUser;
|
||||
GO
|
||||
EXEC sp_addrolemember 'db_owner', PlaceHolderForUser;
|
||||
GO
|
@ -1,45 +0,0 @@
|
||||
/**********************************************************************/
|
||||
/* Install.SQL */
|
||||
/* Creates a login and makes the user a member of db roles */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
-- Declare variables for database name, username and password
|
||||
DECLARE @dbName sysname,
|
||||
@dbUser sysname,
|
||||
@dbPwd nvarchar(max);
|
||||
|
||||
-- Set variables for database name, username and password
|
||||
SET @dbName = 'PlaceHolderForDb';
|
||||
SET @dbUser = 'PlaceHolderForUser';
|
||||
SET @dbPwd = 'PlaceHolderForPassword';
|
||||
|
||||
DECLARE @cmd nvarchar(max)
|
||||
|
||||
-- Create login
|
||||
IF( SUSER_SID(@dbUser) is null )
|
||||
BEGIN
|
||||
print '-- Creating login '
|
||||
SET @cmd = N'CREATE LOGIN ' + quotename(@dbUser) + N' WITH PASSWORD ='''+ replace(@dbPwd, '''', '''''') + N''''
|
||||
EXEC(@cmd)
|
||||
END
|
||||
|
||||
-- Create database user and map to login
|
||||
-- and add user to the datareader, datawriter, ddladmin and securityadmin roles
|
||||
--
|
||||
SET @cmd = N'USE ' + quotename(@DBName) + N';
|
||||
IF( NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = ''' + replace(@dbUser, '''', '''''') + N'''))
|
||||
BEGIN
|
||||
print ''-- Creating user'';
|
||||
CREATE USER ' + quotename(@dbUser) + N' FOR LOGIN ' + quotename(@dbUser) + N';
|
||||
print ''-- Adding user'';
|
||||
EXEC sp_addrolemember ''db_ddladmin'', ''' + replace(@dbUser, '''', '''''') + N''';
|
||||
print ''-- Adding user'';
|
||||
EXEC sp_addrolemember ''db_securityadmin'', ''' + replace(@dbUser, '''', '''''') + N''';
|
||||
print ''-- Adding user'';
|
||||
EXEC sp_addrolemember ''db_datareader'', ''' + replace(@dbUser, '''', '''''') + N''';
|
||||
print ''-- Adding user'';
|
||||
EXEC sp_addrolemember ''db_datawriter'', ''' + replace(@dbUser, '''', '''''') + N''';
|
||||
END'
|
||||
EXEC(@cmd)
|
||||
GO
|
@ -1,7 +1,13 @@
|
||||
<MSDeploy.iisApp>
|
||||
<iisapp path="Orchard" managedRuntimeVersion="v4.0" />
|
||||
<iisapp path="Orchard" managedRuntimeVersion="v4.0" />
|
||||
<setAcl path="Orchard/App_Data" setAclAccess="Modify" />
|
||||
<setAcl path="Orchard/Media" setAclAccess="Modify" />
|
||||
<setAcl path="Orchard/bin/HostRestart" setAclAccess="Modify" />
|
||||
<dbFullSql path="install.sql" />
|
||||
</MSDeploy.iisApp>
|
||||
|
||||
<!-- Runs SQL script to create login and assign permissions, requires transacted="false"
|
||||
This script runs as the database administrator provided in parameters.xml
|
||||
-->
|
||||
<dbfullsql path="createlogin.sql" transacted="false" />
|
||||
<dbfullsql path="createuser.sql" transacted="false" />
|
||||
|
||||
</MSDeploy.iisApp>
|
@ -47,19 +47,17 @@
|
||||
<!-- Prompts for the admin password and uses it for the administrator connection string.
|
||||
This is use to create a login and assign permissions. The SQL tag indicates it is a parameter required for SQL.
|
||||
The DbAdminPassword tag indicates it should be used when the user is creating a new database. If they're not, it can be filled in with the DbUserPassword value. -->
|
||||
<parameter name="Database Administrator Password" description="Password for the database administrator account." tags="New, Password, SQL, dbAdminPassword">
|
||||
<parameter name="Database Administrator Password" description="Password for the database administrator account." tags="Password, SQL, dbAdminPassword">
|
||||
</parameter>
|
||||
|
||||
<parameter name="Admin Connection String SqlServer"
|
||||
tags="SQLConnectionString, AdminConnectionString, Hidden, Validate" description="Automatically sets the connection string for the connection request."
|
||||
defaultValue="Data Source={Database Server};Initial Catalog={Database Name};User Id={Database Administrator};Password={Database Administrator Password}">
|
||||
<parameterEntry type="ProviderPath" scope="dbfullsql" match="install.sql" />
|
||||
<parameter name="Admin Connection String SqlServer1" tags="SQLConnectionString, sql, Hidden" description="Automatically sets the connection string for the connection request." defaultValue="Data Source={Database Server};Initial Catalog=MASTER;User Id={Database Administrator};Password={Database Administrator Password}">
|
||||
<parameterEntry type="ProviderPath" scope="dbfullsql" match="createlogin.sql" />
|
||||
</parameter>
|
||||
|
||||
<parameter name="Non-Admin Connection String SqlServer"
|
||||
tags="SQLConnectionString, UserConnectionString, Hidden" description="Automatically sets the connection string for the connection request."
|
||||
defaultValue="Data Source={Database Server};Initial Catalog={Database Name};User Id={Database Username};Password={Database Password}">
|
||||
<parameter name="Admin Connection String SqlServer2" tags="SQLConnectionString, SQL, Hidden" description="Automatically sets the connection string for the connection request." defaultValue="Data Source={Database Server};Initial Catalog={Database Name};User Id={Database Administrator};Password={Database Administrator Password}">
|
||||
<parameterEntry type="ProviderPath" scope="dbfullsql" match="createuser.sql" />
|
||||
</parameter>
|
||||
|
||||
|
||||
<parameter name="Orchard Connection String" friendlyName="Orchard Connection String" description="Orchard SQL Data Connection String Setting" defaultValue="" tags="Sql, SqlCE, SingleLineConnectionString, Hidden">
|
||||
<parameterEntry kind="TextFile" scope="\\Settings\.txt$" match="(?<=\s*DataConnectionString:\s+)[^\s].*[^\r\n]" />
|
||||
|
Loading…
Reference in New Issue
Block a user