merge
This commit is contained in:
@@ -42,6 +42,13 @@ namespace SqlCE4Umbraco
|
||||
{
|
||||
var sqlCeEngine = new SqlCeEngine(ConnectionString);
|
||||
sqlCeEngine.CreateDatabase();
|
||||
|
||||
// SD: Pretty sure this should be in a using clause but i don't want to cause unknown side-effects here
|
||||
// since it's been like this for quite some time
|
||||
//using (var sqlCeEngine = new SqlCeEngine(ConnectionString))
|
||||
//{
|
||||
// sqlCeEngine.CreateDatabase();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -165,6 +165,9 @@ namespace Umbraco.Core
|
||||
/// </remarks>
|
||||
internal string OriginalRequestUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the version configured matches the assembly version
|
||||
/// </summary>
|
||||
private bool Configured
|
||||
{
|
||||
get
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Umbraco.Core.Configuration
|
||||
private static string _reservedUrls;
|
||||
//ensure the built on (non-changeable) reserved paths are there at all times
|
||||
private const string StaticReservedPaths = "~/app_plugins/,~/install/,";
|
||||
private const string StaticReservedUrls = "~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd,";
|
||||
private const string StaticReservedUrls = "~/config/splashes/booting.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd,";
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -113,8 +113,8 @@ namespace Umbraco.Core
|
||||
public void ConfigureEmbeddedDatabaseConnection()
|
||||
{
|
||||
const string providerName = "System.Data.SqlServerCe.4.0";
|
||||
const string connectionString = @"Data Source=|DataDirectory|\Umbraco.sdf;Flush Interval=1;";
|
||||
|
||||
var connectionString = GetEmbeddedDatabaseConnectionString();
|
||||
SaveConnectionString(connectionString, providerName);
|
||||
|
||||
var path = Path.Combine(GlobalSettings.FullpathToRoot, "App_Data", "Umbraco.sdf");
|
||||
@@ -122,11 +122,23 @@ namespace Umbraco.Core
|
||||
{
|
||||
var engine = new SqlCeEngine(connectionString);
|
||||
engine.CreateDatabase();
|
||||
|
||||
// SD: Pretty sure this should be in a using clause but i don't want to cause unknown side-effects here
|
||||
// since it's been like this for quite some time
|
||||
//using (var engine = new SqlCeEngine(connectionString))
|
||||
//{
|
||||
// engine.CreateDatabase();
|
||||
//}
|
||||
}
|
||||
|
||||
Initialize(providerName);
|
||||
}
|
||||
|
||||
public string GetEmbeddedDatabaseConnectionString()
|
||||
{
|
||||
return @"Data Source=|DataDirectory|\Umbraco.sdf;Flush Interval=1;";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configure a ConnectionString that has been entered manually.
|
||||
/// </summary>
|
||||
@@ -149,27 +161,29 @@ namespace Umbraco.Core
|
||||
/// <param name="password">Database Password</param>
|
||||
/// <param name="databaseProvider">Type of the provider to be used (Sql, Sql Azure, Sql Ce, MySql)</param>
|
||||
public void ConfigureDatabaseConnection(string server, string databaseName, string user, string password, string databaseProvider)
|
||||
{
|
||||
string connectionString;
|
||||
string providerName = "System.Data.SqlClient";
|
||||
if (databaseProvider.ToLower().Contains("mysql"))
|
||||
{
|
||||
providerName = "MySql.Data.MySqlClient";
|
||||
connectionString = string.Format("Server={0}; Database={1};Uid={2};Pwd={3}", server, databaseName, user, password);
|
||||
}
|
||||
else if (databaseProvider.ToLower().Contains("azure"))
|
||||
{
|
||||
connectionString = BuildAzureConnectionString(server, databaseName, user, password);
|
||||
}
|
||||
else
|
||||
{
|
||||
connectionString = string.Format("server={0};database={1};user id={2};password={3}", server, databaseName, user, password);
|
||||
}
|
||||
{
|
||||
string providerName;
|
||||
var connectionString = GetDatabaseConnectionString(server, databaseName, user, password, databaseProvider, out providerName);
|
||||
|
||||
SaveConnectionString(connectionString, providerName);
|
||||
Initialize(providerName);
|
||||
}
|
||||
|
||||
public string GetDatabaseConnectionString(string server, string databaseName, string user, string password, string databaseProvider, out string providerName)
|
||||
{
|
||||
providerName = "System.Data.SqlClient";
|
||||
if (databaseProvider.ToLower().Contains("mysql"))
|
||||
{
|
||||
providerName = "MySql.Data.MySqlClient";
|
||||
return string.Format("Server={0}; Database={1};Uid={2};Pwd={3}", server, databaseName, user, password);
|
||||
}
|
||||
if (databaseProvider.ToLower().Contains("azure"))
|
||||
{
|
||||
return BuildAzureConnectionString(server, databaseName, user, password);
|
||||
}
|
||||
return string.Format("server={0};database={1};user id={2};password={3}", server, databaseName, user, password);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures a ConnectionString for the Umbraco database that uses Microsoft SQL Server integrated security.
|
||||
/// </summary>
|
||||
@@ -178,12 +192,16 @@ namespace Umbraco.Core
|
||||
public void ConfigureIntegratedSecurityDatabaseConnection(string server, string databaseName)
|
||||
{
|
||||
const string providerName = "System.Data.SqlClient";
|
||||
string connectionString = String.Format("Server={0};Database={1};Integrated Security=true", server, databaseName);
|
||||
|
||||
var connectionString = GetIntegratedSecurityDatabaseConnectionString(server, databaseName);
|
||||
SaveConnectionString(connectionString, providerName);
|
||||
Initialize(providerName);
|
||||
}
|
||||
|
||||
public string GetIntegratedSecurityDatabaseConnectionString(string server, string databaseName)
|
||||
{
|
||||
return String.Format("Server={0};Database={1};Integrated Security=true", server, databaseName);
|
||||
}
|
||||
|
||||
internal string BuildAzureConnectionString(string server, string databaseName, string user, string password)
|
||||
{
|
||||
if (server.Contains(".") && ServerStartsWithTcp(server) == false)
|
||||
@@ -597,5 +615,34 @@ namespace Umbraco.Core
|
||||
public bool Success { get; set; }
|
||||
public string Percentage { get; set; }
|
||||
}
|
||||
|
||||
internal bool IsConnectionStringConfigured(ConnectionStringSettings databaseSettings)
|
||||
{
|
||||
var dbIsSqlCe = false;
|
||||
if (databaseSettings != null && databaseSettings.ProviderName != null)
|
||||
dbIsSqlCe = databaseSettings.ProviderName == "System.Data.SqlServerCe.4.0";
|
||||
var sqlCeDatabaseExists = false;
|
||||
if (dbIsSqlCe)
|
||||
{
|
||||
var parts = databaseSettings.ConnectionString.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
var dataSourcePart = parts.FirstOrDefault(x => x.InvariantStartsWith("Data Source="));
|
||||
if (dataSourcePart != null)
|
||||
{
|
||||
var datasource = dataSourcePart.Replace("|DataDirectory|", AppDomain.CurrentDomain.GetData("DataDirectory").ToString());
|
||||
var filePath = datasource.Replace("Data Source=", string.Empty);
|
||||
sqlCeDatabaseExists = File.Exists(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
// Either the connection details are not fully specified or it's a SQL CE database that doesn't exist yet
|
||||
if (databaseSettings == null
|
||||
|| string.IsNullOrWhiteSpace(databaseSettings.ConnectionString) || string.IsNullOrWhiteSpace(databaseSettings.ProviderName)
|
||||
|| (dbIsSqlCe && sqlCeDatabaseExists == false))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,25 @@ namespace Umbraco.Core
|
||||
///</summary>
|
||||
internal static class DictionaryExtensions
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Method to Get a value by the key. If the key doesn't exist it will create a new TVal object for the key and return it.
|
||||
/// </summary>
|
||||
/// <typeparam name="TKey"></typeparam>
|
||||
/// <typeparam name="TVal"></typeparam>
|
||||
/// <param name="dict"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public static TVal GetOrCreate<TKey, TVal>(this IDictionary<TKey, TVal> dict, TKey key)
|
||||
where TVal : class, new()
|
||||
{
|
||||
if (dict.ContainsKey(key) == false)
|
||||
{
|
||||
dict.Add(key, new TVal());
|
||||
}
|
||||
return dict[key];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates an item with the specified key with the specified value
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Umbraco.Core.Persistence
|
||||
{
|
||||
//TODO: check if any of this works and for what databse types it works for:
|
||||
// ref: http://stackoverflow.com/questions/16171144/how-to-check-for-database-availability
|
||||
|
||||
internal static class SqlExtensions
|
||||
{
|
||||
public static bool IsConnectionAvailable(string connString)
|
||||
{
|
||||
using (var connection = new SqlConnection(connString))
|
||||
{
|
||||
return connection.IsAvailable();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsAvailable(this SqlConnection connection)
|
||||
{
|
||||
try
|
||||
{
|
||||
connection.Open();
|
||||
connection.Close();
|
||||
}
|
||||
catch (SqlException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,6 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
@@ -356,6 +355,7 @@
|
||||
<Compile Include="Persistence\EntityNotFoundException.cs" />
|
||||
<Compile Include="Persistence\Factories\MemberGroupFactory.cs" />
|
||||
<Compile Include="Persistence\Mappers\MemberGroupMapper.cs" />
|
||||
<Compile Include="Persistence\SqlExtensions.cs" />
|
||||
<Compile Include="PropertyEditors\DefaultPropertyValueConverterAttribute.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSeven\UpdateRelatedLinksData.cs" />
|
||||
<Compile Include="PropertyEditors\IValueEditor.cs" />
|
||||
|
||||
@@ -116,7 +116,6 @@ namespace Umbraco.Tests
|
||||
Assert.AreNotEqual(appCtx, result);
|
||||
}
|
||||
|
||||
[NUnit.Framework.Ignore("Need to fix more stuff up, this is ignore because an exception occurs because it wants to ensure we have a resolver initialized - need to make that process better for testability")]
|
||||
[Test]
|
||||
public void Can_Get_Umbraco_Context()
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -651,7 +651,9 @@
|
||||
<Content Include="Services\Importing\uBlogsy-Package.xml" />
|
||||
<Content Include="Services\Importing\XsltSearch-Package.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Folder Include="Install\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\amd64\*.* "$(TargetDir)amd64\" /Y /F /E /D
|
||||
|
||||
@@ -3,17 +3,18 @@ module.exports = function (grunt) {
|
||||
// Default task.
|
||||
grunt.registerTask('default', ['jshint:dev','build','karma:unit']);
|
||||
grunt.registerTask('dev', ['jshint:dev', 'build', 'webserver', 'open:dev', 'watch']);
|
||||
|
||||
|
||||
//run by the watch task
|
||||
grunt.registerTask('watch-js', ['jshint:dev','concat','copy:app','copy:mocks','copy:packages','copy:vs','karma:unit']);
|
||||
grunt.registerTask('watch-less', ['recess:build','copy:assets','copy:vs']);
|
||||
grunt.registerTask('watch-less', ['recess:build','recess:installer','copy:assets','copy:vs']);
|
||||
grunt.registerTask('watch-html', ['copy:views', 'copy:vs']);
|
||||
grunt.registerTask('watch-packages', ['copy:packages']);
|
||||
grunt.registerTask('watch-installer', ['concat:install','concat:installJs','copy:installer', 'copy:vs']);
|
||||
grunt.registerTask('watch-test', ['jshint:dev', 'karma:unit']);
|
||||
|
||||
//triggered from grunt dev or grunt
|
||||
grunt.registerTask('build', ['clean','concat','recess:min','copy']);
|
||||
|
||||
grunt.registerTask('build', ['clean','concat','recess:min','recess:installer','copy']);
|
||||
|
||||
//utillity tasks
|
||||
grunt.registerTask('docs', ['ngdocs']);
|
||||
grunt.registerTask('webserver', ['connect:devserver']);
|
||||
@@ -68,7 +69,7 @@ module.exports = function (grunt) {
|
||||
specs: ['test/**/*.spec.js'],
|
||||
scenarios: ['test/**/*.scenario.js'],
|
||||
samples: ['sample files/*.js'],
|
||||
html: ['src/index.html'],
|
||||
html: ['src/index.html','src/install.html'],
|
||||
|
||||
everything:['src/**/*.*', 'test/**/*.*', 'docs/**/*.*'],
|
||||
|
||||
@@ -86,6 +87,11 @@ module.exports = function (grunt) {
|
||||
assets: {
|
||||
files: [{ dest: '<%= distdir %>/assets', src : '**', expand: true, cwd: 'src/assets/' }]
|
||||
},
|
||||
|
||||
installer: {
|
||||
files: [{ dest: '<%= distdir %>/views/install', src : '**/*.html', expand: true, cwd: 'src/installer/steps' }]
|
||||
},
|
||||
|
||||
vendor: {
|
||||
files: [{ dest: '<%= distdir %>/lib', src : '**', expand: true, cwd: 'lib/' }]
|
||||
},
|
||||
@@ -130,8 +136,24 @@ module.exports = function (grunt) {
|
||||
process: true
|
||||
}
|
||||
},
|
||||
install: {
|
||||
src: ['src/installer/installer.html'],
|
||||
dest: '<%= distdir %>/installer.html',
|
||||
options: {
|
||||
process: true
|
||||
}
|
||||
},
|
||||
|
||||
installJs: {
|
||||
src: ['src/installer/**/*.js'],
|
||||
dest: '<%= distdir %>/js/umbraco.installer.js',
|
||||
options: {
|
||||
banner: "<%= banner %>\n(function() { \n\n angular.module('umbraco.install', []); \n",
|
||||
footer: "\n\n})();"
|
||||
}
|
||||
},
|
||||
controllers: {
|
||||
src:['src/views/**/*.controller.js'],
|
||||
src:['src/controllers/**/*.controller.js','src/views/**/*.controller.js'],
|
||||
dest: '<%= distdir %>/js/umbraco.controllers.js',
|
||||
options: {
|
||||
banner: "<%= banner %>\n(function() { \n\n",
|
||||
@@ -198,7 +220,7 @@ module.exports = function (grunt) {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
recess: {
|
||||
build: {
|
||||
files: {
|
||||
@@ -208,6 +230,14 @@ module.exports = function (grunt) {
|
||||
compile: true
|
||||
}
|
||||
},
|
||||
installer: {
|
||||
files: {
|
||||
'<%= distdir %>/assets/css/installer.css':
|
||||
['src/less/installer.less'] },
|
||||
options: {
|
||||
compile: true
|
||||
}
|
||||
},
|
||||
min: {
|
||||
files: {
|
||||
'<%= distdir %>/assets/css/<%= pkg.name %>.css': ['<%= src.less %>']
|
||||
@@ -220,7 +250,6 @@ module.exports = function (grunt) {
|
||||
},
|
||||
|
||||
|
||||
|
||||
watch:{
|
||||
css: {
|
||||
files: '**/*.less',
|
||||
@@ -237,6 +266,10 @@ module.exports = function (grunt) {
|
||||
files: ['test/**/*.js'],
|
||||
tasks: ['watch-test', 'timestamp'],
|
||||
},
|
||||
installer: {
|
||||
files: ['src/installer/**/*.*'],
|
||||
tasks: ['watch-installer', 'timestamp'],
|
||||
},
|
||||
html: {
|
||||
files: ['src/views/**/*.html', 'src/*.html'],
|
||||
tasks:['watch-html','timestamp']
|
||||
@@ -288,7 +321,7 @@ module.exports = function (grunt) {
|
||||
//NOTE: we ignore tabs vs spaces because enforcing that causes lots of errors depending on the text editor being used
|
||||
smarttabs: true,
|
||||
globals:{}
|
||||
}
|
||||
}
|
||||
},
|
||||
build:{
|
||||
files:['<%= src.prod %>'],
|
||||
@@ -312,13 +345,13 @@ module.exports = function (grunt) {
|
||||
smarttabs: true,
|
||||
globalstrict:true,
|
||||
globals:{$:false, jQuery:false,define:false,require:false,window:false}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
@@ -328,11 +361,10 @@ module.exports = function (grunt) {
|
||||
grunt.loadNpmTasks('grunt-recess');
|
||||
|
||||
grunt.loadNpmTasks('grunt-karma');
|
||||
|
||||
|
||||
grunt.loadNpmTasks('grunt-open');
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
|
||||
grunt.loadNpmTasks('grunt-ngdocs');
|
||||
grunt.loadNpmTasks('grunt-ngmin');
|
||||
|
||||
};
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
"karma-coffee-preprocessor": "0.0.1",
|
||||
"karma": "~0.9",
|
||||
"karma-phantomjs-launcher": "0.0.2",
|
||||
"grunt-ngdocs": "~0.1.2",
|
||||
"grunt-ngmin": "0.0.3"
|
||||
"grunt-ngdocs": "~0.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 763 KiB |
@@ -1,59 +0,0 @@
|
||||
angular.module('umbraco.directives.editors').directive('ace', function(assetsService) {
|
||||
var ACE_EDITOR_CLASS = 'ace-editor';
|
||||
|
||||
function loadAceEditor(element, mode) {
|
||||
assetsService.loadJs("lib/ace/noconflict/ace.js").then(function(){
|
||||
var editor = ace.edit($(element).find('.' + ACE_EDITOR_CLASS)[0]);
|
||||
editor.session.setMode("ace/mode/" + mode);
|
||||
editor.renderer.setShowPrintMargin(false);
|
||||
return editor;
|
||||
});
|
||||
}
|
||||
|
||||
function valid(editor) {
|
||||
return (Object.keys(editor.getSession().getAnnotations()).length === 0);
|
||||
}
|
||||
|
||||
return {
|
||||
restrict: 'A',
|
||||
require: '?ngModel',
|
||||
transclude: true,
|
||||
template: '<div class="transcluded" ng-transclude></div><div class="' + ACE_EDITOR_CLASS + '"></div>',
|
||||
|
||||
link: function(scope, element, attrs, ngModel) {
|
||||
function read() {
|
||||
ngModel.$setViewValue(editor.getValue());
|
||||
textarea.val(editor.getValue());
|
||||
}
|
||||
|
||||
var textarea = $(element).find('textarea');
|
||||
textarea.hide();
|
||||
|
||||
var mode = attrs.ace;
|
||||
var editor = loadAceEditor(element, mode);
|
||||
scope.ace = editor;
|
||||
|
||||
if (!ngModel)
|
||||
{
|
||||
return; // do nothing if no ngModel
|
||||
}
|
||||
|
||||
ngModel.$render = function() {
|
||||
var value = ngModel.$viewValue || '';
|
||||
editor.getSession().setValue(value);
|
||||
textarea.val(value);
|
||||
};
|
||||
|
||||
editor.getSession().on('changeAnnotation', function() {
|
||||
if (valid(editor)) {
|
||||
scope.$apply(read);
|
||||
}
|
||||
});
|
||||
|
||||
editor.getSession().setValue(textarea.val());
|
||||
|
||||
read();
|
||||
|
||||
}
|
||||
};
|
||||
});
|
||||
+32
-32
@@ -1,33 +1,33 @@
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:umbFileUpload
|
||||
* @function
|
||||
* @restrict A
|
||||
* @scope
|
||||
* @description
|
||||
* A single file upload field that will reset itself based on the object passed in for the rebuild parameter. This
|
||||
* is required because the only way to reset an upload control is to replace it's html.
|
||||
**/
|
||||
function umbSingleFileUpload($compile) {
|
||||
return {
|
||||
restrict: "E",
|
||||
scope: {
|
||||
rebuild: "="
|
||||
},
|
||||
replace: true,
|
||||
template: "<div><input type='file' umb-file-upload /></div>",
|
||||
link: function (scope, el, attrs) {
|
||||
|
||||
scope.$watch("rebuild", function (newVal, oldVal) {
|
||||
if (newVal && newVal !== oldVal) {
|
||||
//recompile it!
|
||||
el.html("<input type='file' umb-file-upload />");
|
||||
$compile(el.contents())(scope);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:umbFileUpload
|
||||
* @function
|
||||
* @restrict A
|
||||
* @scope
|
||||
* @description
|
||||
* A single file upload field that will reset itself based on the object passed in for the rebuild parameter. This
|
||||
* is required because the only way to reset an upload control is to replace it's html.
|
||||
**/
|
||||
function umbSingleFileUpload($compile) {
|
||||
return {
|
||||
restrict: "E",
|
||||
scope: {
|
||||
rebuild: "="
|
||||
},
|
||||
replace: true,
|
||||
template: "<div><input type='file' umb-file-upload /></div>",
|
||||
link: function (scope, el, attrs) {
|
||||
|
||||
scope.$watch("rebuild", function (newVal, oldVal) {
|
||||
if (newVal && newVal !== oldVal) {
|
||||
//recompile it!
|
||||
el.html("<input type='file' umb-file-upload />");
|
||||
$compile(el.contents())(scope);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').directive("umbSingleFileUpload", umbSingleFileUpload);
|
||||
+29
-29
@@ -1,30 +1,30 @@
|
||||
angular.module("umbraco.directives")
|
||||
.directive('sectionIcon', function ($compile, iconHelper) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
|
||||
link: function (scope, element, attrs) {
|
||||
|
||||
var icon = attrs.icon;
|
||||
|
||||
if (iconHelper.isLegacyIcon(icon)) {
|
||||
//its a known legacy icon, convert to a new one
|
||||
element.html("<i class='" + iconHelper.convertFromLegacyIcon(icon) + "'></i>");
|
||||
}
|
||||
else if (iconHelper.isFileBasedIcon(icon)) {
|
||||
var convert = iconHelper.convertFromLegacyImage(icon);
|
||||
if(convert){
|
||||
element.html("<i class='icon-section " + convert + "'></i>");
|
||||
}else{
|
||||
element.html("<img src='images/tray/" + icon + "'>");
|
||||
}
|
||||
//it's a file, normally legacy so look in the icon tray images
|
||||
}
|
||||
else {
|
||||
//it's normal
|
||||
element.html("<i class='icon-section " + icon + "'></i>");
|
||||
}
|
||||
}
|
||||
};
|
||||
angular.module("umbraco.directives")
|
||||
.directive('sectionIcon', function ($compile, iconHelper) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
|
||||
link: function (scope, element, attrs) {
|
||||
|
||||
var icon = attrs.icon;
|
||||
|
||||
if (iconHelper.isLegacyIcon(icon)) {
|
||||
//its a known legacy icon, convert to a new one
|
||||
element.html("<i class='" + iconHelper.convertFromLegacyIcon(icon) + "'></i>");
|
||||
}
|
||||
else if (iconHelper.isFileBasedIcon(icon)) {
|
||||
var convert = iconHelper.convertFromLegacyImage(icon);
|
||||
if(convert){
|
||||
element.html("<i class='icon-section " + convert + "'></i>");
|
||||
}else{
|
||||
element.html("<img src='images/tray/" + icon + "'>");
|
||||
}
|
||||
//it's a file, normally legacy so look in the icon tray images
|
||||
}
|
||||
else {
|
||||
//it's normal
|
||||
element.html("<i class='icon-section " + icon + "'></i>");
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
+27
-27
@@ -1,27 +1,27 @@
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:umbAvatar
|
||||
* @restrict E
|
||||
**/
|
||||
function avatarDirective() {
|
||||
return {
|
||||
restrict: "E", // restrict to an element
|
||||
replace: true, // replace the html element with the template
|
||||
templateUrl: 'views/directives/umb-avatar.html',
|
||||
scope: {
|
||||
name: '@',
|
||||
email: '@',
|
||||
hash: '@'
|
||||
},
|
||||
link: function(scope, element, attr, ctrl) {
|
||||
|
||||
scope.$watch("hash", function (val) {
|
||||
//set the gravatar url
|
||||
scope.gravatar = "http://www.gravatar.com/avatar/" + val + "?s=40";
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').directive("umbAvatar", avatarDirective);
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:umbAvatar
|
||||
* @restrict E
|
||||
**/
|
||||
function avatarDirective() {
|
||||
return {
|
||||
restrict: "E", // restrict to an element
|
||||
replace: true, // replace the html element with the template
|
||||
templateUrl: 'views/directives/umb-avatar.html',
|
||||
scope: {
|
||||
name: '@',
|
||||
email: '@',
|
||||
hash: '@'
|
||||
},
|
||||
link: function(scope, element, attr, ctrl) {
|
||||
|
||||
scope.$watch("hash", function (val) {
|
||||
//set the gravatar url
|
||||
scope.gravatar = "http://www.gravatar.com/avatar/" + val + "?s=40";
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').directive("umbAvatar", avatarDirective);
|
||||
+78
-78
@@ -1,79 +1,79 @@
|
||||
angular.module("umbraco.directives")
|
||||
.directive('umbHeader', function($parse, $timeout){
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: 'true',
|
||||
templateUrl: 'views/directives/umb-header.html',
|
||||
//create a new isolated scope assigning a tabs property from the attribute 'tabs'
|
||||
//which is bound to the parent scope property passed in
|
||||
scope: {
|
||||
tabs: "="
|
||||
},
|
||||
link: function (scope, iElement, iAttrs) {
|
||||
|
||||
var maxTabs = 4;
|
||||
|
||||
function collectFromDom(activeTab){
|
||||
var $panes = $('div.tab-content');
|
||||
|
||||
angular.forEach($panes.find('.tab-pane'), function (pane, index) {
|
||||
var $this = angular.element(pane);
|
||||
|
||||
var id = $this.attr("rel");
|
||||
var label = $this.attr("label");
|
||||
var tab = {id: id, label: label, active: false};
|
||||
if(!activeTab){
|
||||
tab.active = true;
|
||||
activeTab = tab;
|
||||
}
|
||||
|
||||
if ($this.attr("rel") === String(activeTab.id)) {
|
||||
$this.addClass('active');
|
||||
}
|
||||
else {
|
||||
$this.removeClass('active');
|
||||
}
|
||||
|
||||
if(label){
|
||||
scope.visibleTabs.push(tab);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
scope.showTabs = iAttrs.tabs ? true : false;
|
||||
scope.visibleTabs = [];
|
||||
scope.overflownTabs = [];
|
||||
|
||||
$timeout(function () {
|
||||
collectFromDom(undefined);
|
||||
}, 500);
|
||||
|
||||
//when the tabs change, we need to hack the planet a bit and force the first tab content to be active,
|
||||
//unfortunately twitter bootstrap tabs is not playing perfectly with angular.
|
||||
scope.$watch("tabs", function (newValue, oldValue) {
|
||||
|
||||
angular.forEach(newValue, function(val, index){
|
||||
var tab = {id: val.id, label: val.label};
|
||||
scope.visibleTabs.push(tab);
|
||||
});
|
||||
|
||||
//don't process if we cannot or have already done so
|
||||
if (!newValue) {return;}
|
||||
if (!newValue.length || newValue.length === 0){return;}
|
||||
|
||||
var activeTab = _.find(newValue, function (item) {
|
||||
return item.active;
|
||||
});
|
||||
|
||||
//we need to do a timeout here so that the current sync operation can complete
|
||||
// and update the UI, then this will fire and the UI elements will be available.
|
||||
$timeout(function () {
|
||||
collectFromDom(activeTab);
|
||||
}, 500);
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
angular.module("umbraco.directives")
|
||||
.directive('umbHeader', function($parse, $timeout){
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: 'true',
|
||||
templateUrl: 'views/directives/umb-header.html',
|
||||
//create a new isolated scope assigning a tabs property from the attribute 'tabs'
|
||||
//which is bound to the parent scope property passed in
|
||||
scope: {
|
||||
tabs: "="
|
||||
},
|
||||
link: function (scope, iElement, iAttrs) {
|
||||
|
||||
var maxTabs = 4;
|
||||
|
||||
function collectFromDom(activeTab){
|
||||
var $panes = $('div.tab-content');
|
||||
|
||||
angular.forEach($panes.find('.tab-pane'), function (pane, index) {
|
||||
var $this = angular.element(pane);
|
||||
|
||||
var id = $this.attr("rel");
|
||||
var label = $this.attr("label");
|
||||
var tab = {id: id, label: label, active: false};
|
||||
if(!activeTab){
|
||||
tab.active = true;
|
||||
activeTab = tab;
|
||||
}
|
||||
|
||||
if ($this.attr("rel") === String(activeTab.id)) {
|
||||
$this.addClass('active');
|
||||
}
|
||||
else {
|
||||
$this.removeClass('active');
|
||||
}
|
||||
|
||||
if(label){
|
||||
scope.visibleTabs.push(tab);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
scope.showTabs = iAttrs.tabs ? true : false;
|
||||
scope.visibleTabs = [];
|
||||
scope.overflownTabs = [];
|
||||
|
||||
$timeout(function () {
|
||||
collectFromDom(undefined);
|
||||
}, 500);
|
||||
|
||||
//when the tabs change, we need to hack the planet a bit and force the first tab content to be active,
|
||||
//unfortunately twitter bootstrap tabs is not playing perfectly with angular.
|
||||
scope.$watch("tabs", function (newValue, oldValue) {
|
||||
|
||||
angular.forEach(newValue, function(val, index){
|
||||
var tab = {id: val.id, label: val.label};
|
||||
scope.visibleTabs.push(tab);
|
||||
});
|
||||
|
||||
//don't process if we cannot or have already done so
|
||||
if (!newValue) {return;}
|
||||
if (!newValue.length || newValue.length === 0){return;}
|
||||
|
||||
var activeTab = _.find(newValue, function (item) {
|
||||
return item.active;
|
||||
});
|
||||
|
||||
//we need to do a timeout here so that the current sync operation can complete
|
||||
// and update the UI, then this will fire and the UI elements will be available.
|
||||
$timeout(function () {
|
||||
collectFromDom(activeTab);
|
||||
}, 500);
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -9,66 +9,6 @@ angular.module("umbraco.directives.html")
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: 'true',
|
||||
templateUrl: 'views/directives/html/umb-panel.html',
|
||||
link: function (scope, el, attrs) {
|
||||
|
||||
|
||||
function _setClass(bar, resize){
|
||||
|
||||
bar = $(bar);
|
||||
|
||||
//no need to process
|
||||
if(resize){
|
||||
bar.removeClass("umb-bottom-bar");
|
||||
}
|
||||
|
||||
//already positioned
|
||||
if(bar.hasClass("umb-bottom-bar")){
|
||||
return;
|
||||
}
|
||||
|
||||
var offset = bar.offset();
|
||||
if(offset){
|
||||
var bottom = bar.offset().top + bar.height();
|
||||
if(bottom > $(window).height()){
|
||||
bar.addClass("umb-bottom-bar");
|
||||
$(".tab-content .active").addClass("with-buttons");
|
||||
}else{
|
||||
bar.removeClass("umb-bottom-bar");
|
||||
$(".tab-content .active").removeClass("with-buttons");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//initial loading
|
||||
$timeout(function(){
|
||||
var bar = $(".tab-content .active .umb-tab-buttons")[0] || $(".tab-content .umb-tab-buttons")[0];
|
||||
var winHeight = $(window).height();
|
||||
|
||||
scope.$watch(function () {
|
||||
if(!bar){
|
||||
bar = $(".tab-content .active .umb-tab-buttons")[0] || $(".tab-content .umb-tab-buttons")[0];
|
||||
}
|
||||
|
||||
var bottom = bar.offsetTop + bar.offsetHeight;
|
||||
return bottom > winHeight;
|
||||
}, function(val) {
|
||||
_setClass(bar);
|
||||
});
|
||||
|
||||
|
||||
$(window).bind("resize", function () {
|
||||
_setClass(bar, true);
|
||||
winHeight = $(window).height();
|
||||
});
|
||||
|
||||
$('a[data-toggle="tab"]').on('shown', function (e) {
|
||||
bar = $(".tab-content .active .umb-tab-buttons")[0];
|
||||
_setClass(bar);
|
||||
});
|
||||
|
||||
}, 1000, false);
|
||||
}
|
||||
templateUrl: 'views/directives/html/umb-panel.html'
|
||||
};
|
||||
});
|
||||
+13
-13
@@ -1,14 +1,14 @@
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:umbTab
|
||||
* @restrict E
|
||||
**/
|
||||
angular.module("umbraco.directives")
|
||||
.directive('umbTab', function(){
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: 'true',
|
||||
templateUrl: 'views/directives/umb-tab.html'
|
||||
};
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:umbTab
|
||||
* @restrict E
|
||||
**/
|
||||
angular.module("umbraco.directives")
|
||||
.directive('umbTab', function(){
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: 'true',
|
||||
templateUrl: 'views/directives/umb-tab.html'
|
||||
};
|
||||
});
|
||||
+13
-13
@@ -1,14 +1,14 @@
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:umbTabView
|
||||
* @restrict E
|
||||
**/
|
||||
angular.module("umbraco.directives")
|
||||
.directive('umbTabView', function($timeout, $log){
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: 'true',
|
||||
templateUrl: 'views/directives/umb-tab-view.html'
|
||||
};
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:umbTabView
|
||||
* @restrict E
|
||||
**/
|
||||
angular.module("umbraco.directives")
|
||||
.directive('umbTabView', function($timeout, $log){
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: 'true',
|
||||
templateUrl: 'views/directives/umb-tab-view.html'
|
||||
};
|
||||
});
|
||||
+37
-37
@@ -1,38 +1,38 @@
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:autoScale
|
||||
* @element div
|
||||
* @function
|
||||
*
|
||||
* @description
|
||||
* Resize div's automatically to fit to the bottom of the screen, as an optional parameter an y-axis offset can be set
|
||||
* So if you only want to scale the div to 70 pixels from the bottom you pass "70"
|
||||
*
|
||||
* @example
|
||||
<example module="umbraco.directives">
|
||||
<file name="index.html">
|
||||
<div auto-scale="70" class="input-block-level"></div>
|
||||
</file>
|
||||
</example>
|
||||
*/
|
||||
angular.module("umbraco.directives")
|
||||
.directive('autoScale', function ($window) {
|
||||
return function (scope, el, attrs) {
|
||||
|
||||
var totalOffset = 0;
|
||||
var offsety = parseInt(attrs.autoScale, 10);
|
||||
var window = angular.element($window);
|
||||
if (offsety !== undefined){
|
||||
totalOffset += offsety;
|
||||
}
|
||||
|
||||
setTimeout(function () {
|
||||
el.height(window.height() - (el.offset().top + totalOffset));
|
||||
}, 500);
|
||||
|
||||
window.bind("resize", function () {
|
||||
el.height(window.height() - (el.offset().top + totalOffset));
|
||||
});
|
||||
|
||||
};
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:autoScale
|
||||
* @element div
|
||||
* @function
|
||||
*
|
||||
* @description
|
||||
* Resize div's automatically to fit to the bottom of the screen, as an optional parameter an y-axis offset can be set
|
||||
* So if you only want to scale the div to 70 pixels from the bottom you pass "70"
|
||||
*
|
||||
* @example
|
||||
<example module="umbraco.directives">
|
||||
<file name="index.html">
|
||||
<div auto-scale="70" class="input-block-level"></div>
|
||||
</file>
|
||||
</example>
|
||||
*/
|
||||
angular.module("umbraco.directives")
|
||||
.directive('autoScale', function ($window) {
|
||||
return function (scope, el, attrs) {
|
||||
|
||||
var totalOffset = 0;
|
||||
var offsety = parseInt(attrs.autoScale, 10);
|
||||
var window = angular.element($window);
|
||||
if (offsety !== undefined){
|
||||
totalOffset += offsety;
|
||||
}
|
||||
|
||||
setTimeout(function () {
|
||||
el.height(window.height() - (el.offset().top + totalOffset));
|
||||
}, 500);
|
||||
|
||||
window.bind("resize", function () {
|
||||
el.height(window.height() - (el.offset().top + totalOffset));
|
||||
});
|
||||
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:umbPanel
|
||||
* @restrict E
|
||||
**/
|
||||
angular.module("umbraco.directives.html")
|
||||
.directive('detectFold', function($timeout, $log){
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function (scope, el, attrs) {
|
||||
|
||||
var state = false,
|
||||
parent = $(".umb-panel-body"),
|
||||
winHeight = $(window).height(),
|
||||
calculate = _.throttle(function(){
|
||||
if(el && el.is(":visible") && !el.hasClass("umb-bottom-bar")){
|
||||
//var parent = el.parent();
|
||||
var hasOverflow = parent.innerHeight() < parent[0].scrollHeight;
|
||||
//var belowFold = (el.offset().top + el.height()) > winHeight;
|
||||
if(hasOverflow){
|
||||
el.addClass("umb-bottom-bar");
|
||||
}
|
||||
}
|
||||
return state;
|
||||
}, 1000);
|
||||
|
||||
scope.$watch(calculate, function(newVal, oldVal) {
|
||||
if(newVal !== oldVal){
|
||||
if(newVal){
|
||||
el.addClass("umb-bottom-bar");
|
||||
}else{
|
||||
el.removeClass("umb-bottom-bar");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(window).bind("resize", function () {
|
||||
winHeight = $(window).height();
|
||||
el.removeClass("umb-bottom-bar");
|
||||
state = false;
|
||||
calculate();
|
||||
});
|
||||
|
||||
$('a[data-toggle="tab"]').on('shown', function (e) {
|
||||
calculate();
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
+26
-26
@@ -1,27 +1,27 @@
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:headline
|
||||
**/
|
||||
angular.module("umbraco.directives")
|
||||
.directive('hotkey', function ($window, keyboardService, $log) {
|
||||
|
||||
return function (scope, el, attrs) {
|
||||
|
||||
//support data binding
|
||||
|
||||
var keyCombo = scope.$eval(attrs["hotkey"]);
|
||||
if (!keyCombo) {
|
||||
keyCombo = attrs["hotkey"];
|
||||
}
|
||||
|
||||
keyboardService.bind(keyCombo, function() {
|
||||
var element = $(el);
|
||||
if(element.is("a,button,input[type='button'],input[type='submit']")){
|
||||
element.click();
|
||||
}else{
|
||||
element.focus();
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:headline
|
||||
**/
|
||||
angular.module("umbraco.directives")
|
||||
.directive('hotkey', function ($window, keyboardService, $log) {
|
||||
|
||||
return function (scope, el, attrs) {
|
||||
|
||||
//support data binding
|
||||
|
||||
var keyCombo = scope.$eval(attrs["hotkey"]);
|
||||
if (!keyCombo) {
|
||||
keyCombo = attrs["hotkey"];
|
||||
}
|
||||
|
||||
keyboardService.bind(keyCombo, function() {
|
||||
var element = $(el);
|
||||
if(element.is("a,button,input[type='button'],input[type='submit']")){
|
||||
element.click();
|
||||
}else{
|
||||
element.focus();
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
});
|
||||
+28
-28
@@ -1,29 +1,29 @@
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:preventDefault
|
||||
**/
|
||||
angular.module("umbraco.directives")
|
||||
.directive('preventDefault', function() {
|
||||
return function(scope, element, attrs) {
|
||||
|
||||
var enabled = true;
|
||||
//check if there's a value for the attribute, if there is and it's false then we conditionally don't
|
||||
//prevent default.
|
||||
if (attrs.preventDefault) {
|
||||
attrs.$observe("preventDefault", function (newVal) {
|
||||
enabled = (newVal === "false" || newVal === 0 || newVal === false) ? false : true;
|
||||
});
|
||||
}
|
||||
|
||||
$(element).click(function (event) {
|
||||
if (event.metaKey || event.ctrlKey) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (enabled === true) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name umbraco.directives.directive:preventDefault
|
||||
**/
|
||||
angular.module("umbraco.directives")
|
||||
.directive('preventDefault', function() {
|
||||
return function(scope, element, attrs) {
|
||||
|
||||
var enabled = true;
|
||||
//check if there's a value for the attribute, if there is and it's false then we conditionally don't
|
||||
//prevent default.
|
||||
if (attrs.preventDefault) {
|
||||
attrs.$observe("preventDefault", function (newVal) {
|
||||
enabled = (newVal === "false" || newVal === 0 || newVal === false) ? false : true;
|
||||
});
|
||||
}
|
||||
|
||||
$(element).click(function (event) {
|
||||
if (event.metaKey || event.ctrlKey) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (enabled === true) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
@@ -125,6 +125,39 @@ function mediaHelper(umbRequestHelper) {
|
||||
return "";
|
||||
},
|
||||
|
||||
registerFileResolver: function(propertyEditorAlias, func){
|
||||
_mediaFileResolvers[propertyEditorAlias] = func;
|
||||
},
|
||||
|
||||
resolveFile : function(mediaItem){
|
||||
var _props = [];
|
||||
|
||||
//we either have properties raw on the object, or spread out on tabs
|
||||
if(mediaItem.properties){
|
||||
_props = mediaItem.properties;
|
||||
}else if(mediaItem.tabs){
|
||||
_.each(mediaItem.tabs, function(tab){
|
||||
if(tab.properties){
|
||||
_props.concat(tab.propeties);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//we go through our file resolvers to see if any of them matches the editors
|
||||
var result = "";
|
||||
_.each(_mediaFileResolvers, function(resolver, key){
|
||||
var property = _.find(_props, function(property){ return property.editor === key; });
|
||||
|
||||
if(property){
|
||||
var file = resolver(property);
|
||||
if(file){
|
||||
result = file;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
},
|
||||
/**
|
||||
* @ngdoc function
|
||||
* @name umbraco.services.mediaHelper#scaleToMaxSize
|
||||
@@ -208,41 +241,8 @@ function mediaHelper(umbRequestHelper) {
|
||||
var lowered = imagePath.toLowerCase();
|
||||
var ext = lowered.substr(lowered.lastIndexOf(".") + 1);
|
||||
return ("," + Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes + ",").indexOf("," + ext + ",") !== -1;
|
||||
},
|
||||
|
||||
registerFileResolver: function(propertyEditorAlias, func){
|
||||
_mediaFileResolvers[propertyEditorAlias] = func;
|
||||
},
|
||||
|
||||
resolveFile : function(mediaItem){
|
||||
var _props = [];
|
||||
|
||||
//we either have properties raw on the object, or spread out on tabs
|
||||
if(mediaItem.properties){
|
||||
_props = mediaItem.properties;
|
||||
}else if(mediaItem.tabs){
|
||||
_.each(mediaItem.tabs, function(tab){
|
||||
if(tab.properties){
|
||||
_props.concat(tab.propeties);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//we go through our file resolvers to see if any of them matches the editors
|
||||
var result = "";
|
||||
_.each(_mediaFileResolvers, function(resolver, key){
|
||||
var property = _.find(_props, function(property){ return property.editor === key; });
|
||||
|
||||
if(property){
|
||||
var file = resolver(property);
|
||||
if(file){
|
||||
result = file;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
angular.module('umbraco.services').factory('mediaHelper', mediaHelper);
|
||||
@@ -0,0 +1,21 @@
|
||||
yepnope({
|
||||
|
||||
load: [
|
||||
'lib/jquery/jquery-2.0.3.min.js',
|
||||
|
||||
/* 1.1.5 */
|
||||
'lib/angular/1.1.5/angular.min.js',
|
||||
'lib/angular/1.1.5/angular-cookies.min.js',
|
||||
'lib/angular/1.1.5/angular-mobile.min.js',
|
||||
'lib/angular/1.1.5/angular-mocks.js',
|
||||
'lib/angular/1.1.5/angular-sanitize.min.js',
|
||||
'lib/underscore/underscore.js',
|
||||
'js/umbraco.installer.js'
|
||||
],
|
||||
|
||||
complete: function () {
|
||||
jQuery(document).ready(function () {
|
||||
angular.bootstrap(document, ['umbraco.install']);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,32 @@
|
||||
angular.module("umbraco.install").controller("Umbraco.InstallerController",
|
||||
function($scope, installerService){
|
||||
|
||||
$scope.stepIndex = 0;
|
||||
//comment this out if you just want to see tips
|
||||
installerService.init();
|
||||
|
||||
//uncomment this to see tips
|
||||
//installerService.switchToFeedback();
|
||||
|
||||
$scope.installer = installerService.status;
|
||||
|
||||
$scope.forward = function(){
|
||||
installerService.forward();
|
||||
};
|
||||
|
||||
$scope.backward = function(){
|
||||
installerService.backward();
|
||||
};
|
||||
|
||||
$scope.install = function(){
|
||||
installerService.install();
|
||||
};
|
||||
|
||||
$scope.gotoStep = function(step){
|
||||
installerService.gotoNamedStep(step);
|
||||
};
|
||||
|
||||
$scope.restart = function () {
|
||||
installerService.gotoStep(0);
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/belle/" />
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Install Umbraco</title>
|
||||
<link rel="stylesheet" href="assets/css/installer.css" />
|
||||
</head>
|
||||
|
||||
<body ng-class="{touch:touchDevice, installing:installer.current.installing}" ng-controller="Umbraco.InstallerController" id="umbracoInstallPageBody">
|
||||
|
||||
<img src="assets/img/application/logo_white.png" id="logo" />
|
||||
|
||||
<div id="installer" class="absolute-center clearfix" ng-if="installer.current">
|
||||
<div ng-include="installer.current.view"></div>
|
||||
</div>
|
||||
|
||||
<div id="overlay"></div>
|
||||
<script src="lib/yepnope/yepnope.min.js"></script>
|
||||
<script src="js/install.loader.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,320 @@
|
||||
angular.module("umbraco.install").factory('installerService', function($rootScope, $q, $timeout, $http, $location, $log){
|
||||
|
||||
var _status = {
|
||||
index: 0,
|
||||
current: undefined,
|
||||
steps: undefined,
|
||||
loading: true,
|
||||
progress: "100%"
|
||||
};
|
||||
|
||||
var factTimer = undefined;
|
||||
var _installerModel = {
|
||||
installId: undefined,
|
||||
instructions: {
|
||||
}
|
||||
};
|
||||
|
||||
//add to umbraco installer facts here
|
||||
var facts = ['Umbraco helped millions of people watch a man jump from the edge of space',
|
||||
'Over 250.000 websites are currently powered by Umbraco',
|
||||
'On an average day, more then 1000 people download Umbraco',
|
||||
'<a target="_blank" href="http://umbraco.tv">umbraco.tv</a> is the premier source of Umbraco video tutorials to get you started',
|
||||
'You can find the worlds friendliest CMS community at <a target="_blank" href="http://our.umbraco.org">our.umbraco.org</a>',
|
||||
'You can become a certified Umbraco developer by attending one of the official courses',
|
||||
'Umbraco works really well on tablets',
|
||||
'You have 100% control over your markup and design when crafting a website in Umbraco',
|
||||
'Umbraco is the best of both worlds: 100% free and open source, and backed by a professional and profitable company',
|
||||
"There's a pretty big chance, you've visited a website powered by Umbraco today",
|
||||
"'Umbraco-spotting' is the game of spotting big brands running Umbraco",
|
||||
"Atleast 2 people have the Umbraco logo tattooed on them",
|
||||
"'Umbraco' is the danish name for an allen key",
|
||||
"Has been around since 2005, that's a looong time in IT",
|
||||
"More than 400 people from all over the world meet each year in Denmark in June for our annual conference <a target='_blank' href='http://codegarden14.com'>CodeGarden</a>",
|
||||
"While you install Umbraco someone else on the other side of the planet probably does it too",
|
||||
"You can extend Umbraco without modifying the source code and using either javascript or c#"
|
||||
];
|
||||
|
||||
/**
|
||||
Returns the description for the step at a given index based on the order of the serverOrder of steps
|
||||
Since they don't execute on the server in the order that they are displayed in the UI.
|
||||
*/
|
||||
function getDescriptionForStepAtIndex(steps, index) {
|
||||
var sorted = _.sortBy(steps, "serverOrder");
|
||||
if (sorted[index]) {
|
||||
return sorted[index].description;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/* Returns the description for the given step name */
|
||||
function getDescriptionForStepName(steps, name) {
|
||||
var found = _.find(steps, function(i) {
|
||||
return i.name == name;
|
||||
});
|
||||
return (found) ? found.description : null;
|
||||
}
|
||||
|
||||
//calculates the offset of the progressbar on the installaer
|
||||
function calculateProgress(steps, next) {
|
||||
var pct = "100%";
|
||||
var f = _.find(steps, function(item, index) {
|
||||
if(item.name == next){
|
||||
pct = Math.floor((index+1 / steps.length * 100)) + "%";
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return pct;
|
||||
}
|
||||
|
||||
//helpful defaults for the view loading
|
||||
function resolveView(view){
|
||||
|
||||
if(view.indexOf(".html") < 0){
|
||||
view = view + ".html";
|
||||
}
|
||||
if(view.indexOf("/") < 0){
|
||||
view = "views/install/" + view;
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
/** Have put this here because we are not referencing our other modules */
|
||||
function safeApply (scope, fn) {
|
||||
if (scope.$$phase || scope.$root.$$phase) {
|
||||
if (angular.isFunction(fn)) {
|
||||
fn();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (angular.isFunction(fn)) {
|
||||
scope.$apply(fn);
|
||||
}
|
||||
else {
|
||||
scope.$apply();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var service = {
|
||||
|
||||
status : _status,
|
||||
//loads the needed steps and sets the intial state
|
||||
init : function(){
|
||||
service.status.loading = true;
|
||||
if(!_status.all){
|
||||
service.getSteps().then(function(response){
|
||||
service.status.steps = response.data.steps;
|
||||
service.status.index = 0;
|
||||
_installerModel.installId = response.data.installId;
|
||||
service.findNextStep();
|
||||
|
||||
$timeout(function(){
|
||||
service.status.loading = false;
|
||||
service.status.configuring = true;
|
||||
}, 2000);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
//loads available packages from our.umbraco.org
|
||||
getPackages : function(){
|
||||
return $http.get(Umbraco.Sys.ServerVariables.installApiBaseUrl + "GetPackages");
|
||||
},
|
||||
|
||||
getSteps : function(){
|
||||
return $http.get(Umbraco.Sys.ServerVariables.installApiBaseUrl + "GetSetup");
|
||||
},
|
||||
|
||||
gotoStep : function(index){
|
||||
var step = service.status.steps[index];
|
||||
step.view = resolveView(step.view);
|
||||
|
||||
if(!step.model){
|
||||
step.model = {};
|
||||
}
|
||||
|
||||
service.status.index = index;
|
||||
service.status.current = step;
|
||||
service.retrieveCurrentStep();
|
||||
},
|
||||
|
||||
gotoNamedStep : function(stepName){
|
||||
var step = _.find(service.status.steps, function(s, index){
|
||||
if (s.view && s.name === stepName) {
|
||||
service.status.index = index;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
step.view = resolveView(step.view);
|
||||
if(!step.model){
|
||||
step.model = {};
|
||||
}
|
||||
service.retrieveCurrentStep();
|
||||
service.status.current = step;
|
||||
},
|
||||
|
||||
/**
|
||||
Finds the next step containing a view. If one is found it stores it as the current step
|
||||
and retreives the step information and returns it, otherwise returns null .
|
||||
*/
|
||||
findNextStep : function(){
|
||||
var step = _.find(service.status.steps, function(s, index){
|
||||
if(s.view && index >= service.status.index){
|
||||
service.status.index = index;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
if (step) {
|
||||
if (step.view.indexOf(".html") < 0) {
|
||||
step.view = step.view + ".html";
|
||||
}
|
||||
|
||||
if (step.view.indexOf("/") < 0) {
|
||||
step.view = "views/install/" + step.view;
|
||||
}
|
||||
|
||||
if (!step.model) {
|
||||
step.model = {};
|
||||
}
|
||||
|
||||
service.status.current = step;
|
||||
service.retrieveCurrentStep();
|
||||
|
||||
//returns the next found step
|
||||
return step;
|
||||
}
|
||||
else {
|
||||
//there are no more steps found containing a view so return null
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
storeCurrentStep : function(){
|
||||
_installerModel.instructions[service.status.current.name] = service.status.current.model;
|
||||
},
|
||||
|
||||
retrieveCurrentStep : function(){
|
||||
if(_installerModel.instructions[service.status.current.name]){
|
||||
service.status.current.model = _installerModel.instructions[service.status.current.name];
|
||||
}
|
||||
},
|
||||
|
||||
/** Moves the installer forward to the next view, if there are not more views than the installation will commence */
|
||||
forward : function(){
|
||||
service.storeCurrentStep();
|
||||
service.status.index++;
|
||||
var found = service.findNextStep();
|
||||
if (!found) {
|
||||
//no more steps were found so start the installation process
|
||||
service.install();
|
||||
}
|
||||
},
|
||||
|
||||
backwards : function(){
|
||||
service.storeCurrentStep();
|
||||
service.gotoStep(service.status.index--);
|
||||
},
|
||||
|
||||
install : function(){
|
||||
service.storeCurrentStep();
|
||||
service.switchToFeedback();
|
||||
|
||||
service.status.feedback = getDescriptionForStepAtIndex(service.status.steps, 0);
|
||||
service.status.progress = 0;
|
||||
|
||||
function processInstallStep(){
|
||||
$http.post(Umbraco.Sys.ServerVariables.installApiBaseUrl + "PostPerformInstall",
|
||||
_installerModel).then(function(response){
|
||||
if(!response.data.complete){
|
||||
|
||||
//progress feedback
|
||||
service.status.progress = calculateProgress(service.status.steps, response.data.nextStep);
|
||||
|
||||
if(response.data.view){
|
||||
//set the current view and model to whatever the process returns, the view is responsible for retriggering install();
|
||||
var v = resolveView(response.data.view);
|
||||
service.status.current = {view: v, model: response.data.model};
|
||||
|
||||
//turn off loading bar and feedback
|
||||
service.switchToConfiguration();
|
||||
}
|
||||
else {
|
||||
var desc = getDescriptionForStepName(service.status.steps, response.data.nextStep);
|
||||
if (desc) {
|
||||
service.status.feedback = desc;
|
||||
}
|
||||
processInstallStep();
|
||||
}
|
||||
}
|
||||
else {
|
||||
service.complete();
|
||||
}
|
||||
}, function(err){
|
||||
//this is where we handle installer error
|
||||
var v = err.data.view ? resolveView(err.data.view) : resolveView("error");
|
||||
var model = err.data.model ? err.data.model : err.data;
|
||||
|
||||
service.status.current = {view: v, model: model};
|
||||
service.switchToConfiguration();
|
||||
});
|
||||
}
|
||||
processInstallStep();
|
||||
},
|
||||
|
||||
randomFact: function () {
|
||||
safeApply($rootScope, function() {
|
||||
service.status.fact = facts[_.random(facts.length - 1)];
|
||||
});
|
||||
},
|
||||
|
||||
switchToFeedback : function(){
|
||||
service.status.current = undefined;
|
||||
service.status.loading = true;
|
||||
service.status.configuring = false;
|
||||
|
||||
//initial fact
|
||||
service.randomFact();
|
||||
|
||||
//timed facts
|
||||
factTimer = window.setInterval(function(){
|
||||
service.randomFact();
|
||||
},6000);
|
||||
},
|
||||
|
||||
switchToConfiguration : function(){
|
||||
service.status.loading = false;
|
||||
service.status.configuring = true;
|
||||
service.status.feedback = undefined;
|
||||
service.status.fact = undefined;
|
||||
|
||||
if(factTimer){
|
||||
clearInterval(factTimer);
|
||||
}
|
||||
},
|
||||
|
||||
complete : function(){
|
||||
|
||||
service.status.progress = "100%";
|
||||
service.status.done = true;
|
||||
service.status.feedback = "Redirecting you to Umbraco, please wait";
|
||||
service.status.loading = false;
|
||||
|
||||
if(factTimer){
|
||||
clearInterval(factTimer);
|
||||
}
|
||||
|
||||
$timeout(function(){
|
||||
window.location.href = Umbraco.Sys.ServerVariables.umbracoBaseUrl;
|
||||
}, 1500);
|
||||
}
|
||||
};
|
||||
|
||||
return service;
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
<div>
|
||||
<h1>Continue Umbraco Installation</h1>
|
||||
<p>
|
||||
You see this screen because your Umbraco installation did not complete correctly.
|
||||
</p>
|
||||
<p>
|
||||
Simply click <strong>continue</strong> below to be guided through the rest of the installation process.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<button class="btn btn-success" ng-click="install()">Continue</button>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,25 @@
|
||||
angular.module("umbraco.install").controller("Umbraco.Installer.DataBaseController", function($scope, $http, installerService){
|
||||
|
||||
$scope.checking = false;
|
||||
$scope.validateAndForward = function(){
|
||||
if(!$scope.checking && this.myForm.$valid){
|
||||
$scope.checking = true;
|
||||
var model = installerService.status.current.model;
|
||||
|
||||
$http.post(Umbraco.Sys.ServerVariables.installApiBaseUrl + "PostValidateDatabaseConnection",
|
||||
model).then(function(response){
|
||||
|
||||
if(response.data === "true"){
|
||||
installerService.forward();
|
||||
}else{
|
||||
$scope.invalidDbDns = true;
|
||||
}
|
||||
|
||||
$scope.checking = false;
|
||||
}, function(){
|
||||
$scope.invalidDbDns = true;
|
||||
$scope.checking = false;
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,132 @@
|
||||
<div ng-controller="Umbraco.Installer.DataBaseController">
|
||||
|
||||
<h1>Configure your database</h1>
|
||||
<p>
|
||||
Enter connection and authentication details for the database you want to install Umbraco on
|
||||
</p>
|
||||
|
||||
<form name="myForm" class="form-horizontal" novalidate ng-submit="validateAndForward();">
|
||||
|
||||
|
||||
<div class="control-group">
|
||||
<legend>What type of database do you use?</legend>
|
||||
<label class="control-label" for="dbType">Database type</label>
|
||||
<div class="controls">
|
||||
<select name="dbType" ng-model="installer.current.model.dbType" required>
|
||||
<optgroup>
|
||||
<option value="0">Embedded database SQL CE</option>
|
||||
<option value="1">Microsft SQL Server</option>
|
||||
<option value="2">MySQL</option>
|
||||
</optgroup>
|
||||
<optgroup>
|
||||
<option value="-1">Custom connection-string</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-if="installer.current.model.dbType == 0">
|
||||
<p>Great!, no need to configure anything then, you simply click the <strong>continue</strong> button below to continue to the next step</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div ng-if="installer.current.model.dbType < 0">
|
||||
|
||||
<legend>What is the exact connectionstring we should use?</legend>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="server">Connection string</label>
|
||||
<div class="controls">
|
||||
|
||||
<textarea class="input-block-level" required ng-model="installer.current.model.connectionString" rows="5">
|
||||
</textarea>
|
||||
<small class="inline-help">Enter a valid database connection string.</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-if="installer.current.model.dbType > 0">
|
||||
<div class="row">
|
||||
<legend>Where do we find your database?</legend>
|
||||
<div class="span6">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="server">Server</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="server" placeholder="127.0.0.1/SQLEXPRESS" required ng-model="installer.current.model.server" />
|
||||
<small class="inline-help">Enter server domain or IP</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="span6">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="databaseName">Database name</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="installer.current.model.databaseName"
|
||||
placeholder="umbraco-cms"
|
||||
required ng-model="installer.current.model.databaseName" />
|
||||
<small class="inline-help">Enter the name of the database</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<legend>What credentials are used to access the database?</legend>
|
||||
<div class="span6">
|
||||
<div class="control-group" ng-if="!installer.current.model.integratedAuth">
|
||||
<label class="control-label" for="login">Login</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="login"
|
||||
placeholder="databaseuser"
|
||||
required ng-model="installer.current.model.login" />
|
||||
<small class="inline-help">Enter the database user name</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="span6">
|
||||
<div class="control-group" ng-if="!installer.current.model.integratedAuth">
|
||||
<label class="control-label" for="password">Password</label>
|
||||
<div class="controls">
|
||||
<input type="password" name="password"
|
||||
placeholder="umbraco-cms"
|
||||
required ng-model="installer.current.model.password" />
|
||||
<small class="inline-help">Enter the database password</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="span12 control-group" ng-if="installer.current.model.dbType == 1">
|
||||
<div class="controls">
|
||||
<label class="checkbox" for="integratedAuth">
|
||||
<input type="checkbox" name="integratedAuth"
|
||||
placeholder="umbraco-cms"
|
||||
ng-model="installer.current.model.integratedAuth" /> Use intergrated authentication</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="control-group" ng-class="{disabled:myForm.$invalid}">
|
||||
<div class="controls">
|
||||
<input type="submit" ng-disabled="myForm.$invalid || checking"
|
||||
value="Continue" class="btn btn-success" />
|
||||
|
||||
<span class="inline-help" ng-if="checking" ng-animate="'fade'">
|
||||
Validating your database connection...
|
||||
</span>
|
||||
|
||||
<span class="inline-help error" ng-if="invalidDbDns" ng-animate="'fade'">
|
||||
Could not connect to database
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,9 @@
|
||||
<div class="error">
|
||||
<h1>Error during installation</h1>
|
||||
|
||||
<p class="message">{{installer.current.model.message}}</p>
|
||||
|
||||
<p><small>See log for full details</small></p>
|
||||
|
||||
<button class="btn btn-success" ng-click="restart()">Go back</button>
|
||||
</div>
|
||||
@@ -0,0 +1,26 @@
|
||||
<div>
|
||||
<h1>Your permission settings are not ready for umbraco</h1>
|
||||
<p>
|
||||
In order to run umbraco, you'll need to update your permission settings.
|
||||
Detailed information about the correct file & folder permissions for Umbraco can be found
|
||||
<a href="http://our.umbraco.org/documentation/Installation/permissions"><strong>here</strong></a>.
|
||||
</p>
|
||||
<p>
|
||||
The following report list the permissions that are currently failing. Once the permissions are fixed press the 'Go back' button to restart the installation.
|
||||
</p>
|
||||
|
||||
<ul class="permissions-report">
|
||||
<li ng-repeat="(category, items) in installer.current.model.errors">
|
||||
<h4>{{category}}</h4>
|
||||
<ul>
|
||||
<li ng-repeat="item in items">
|
||||
{{item}}
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<button class="btn btn-success" ng-click="restart()">Go back</button>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,12 @@
|
||||
angular.module("umbraco.install").controller("Umbraco.Installer.PackagesController", function ($scope, installerService) {
|
||||
|
||||
installerService.getPackages().then(function (response) {
|
||||
$scope.packages = response.data;
|
||||
});
|
||||
|
||||
$scope.setPackageAndContinue = function (pckId) {
|
||||
installerService.status.current.model = pckId;
|
||||
installerService.forward();
|
||||
};
|
||||
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
<div ng-controller="Umbraco.Installer.PackagesController">
|
||||
<h1>Install a starter website</h1>
|
||||
|
||||
<p>
|
||||
Installing a starter website helps you learn how Umbraco works, and gives you a solid
|
||||
and simple foundation to build on top of.
|
||||
</p>
|
||||
|
||||
<ul class="thumbnails">
|
||||
<li class="span3" ng-repeat="pck in packages">
|
||||
<a href ng-click="setPackageAndContinue(pck.id)" class="thumbnail">
|
||||
<img ng-src="http://our.umbraco.org{{pck.thumbnail}}" alt="{{pck.name}}">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<a href ng-click="setPackageAndContinue('00000000-0000-0000-0000-000000000000')" class="btn btn-link">
|
||||
No thanks, I do not want to install a starter website
|
||||
</a>
|
||||
</div>
|
||||
@@ -0,0 +1,14 @@
|
||||
<div>
|
||||
<h1>Upgrading Umbraco</h1>
|
||||
<p>
|
||||
Welcome to the Umbraco installer. You see this screen because your Umbraco installation needs a quick upgrade of its database and files,
|
||||
it is completely harmless and will simply ensure your website is kept as fast, secure and uptodate as possible.
|
||||
</p>
|
||||
<p>
|
||||
Simply click <strong>continue</strong> below to be guided through the rest of the upgrade
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<button class="btn btn-success" ng-click="install()">Continue</button>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
angular.module("umbraco.install").controller("Umbraco.Install.UserController", function($scope, installerService) {
|
||||
|
||||
$scope.passwordPattern = /.*/;
|
||||
if ($scope.installer.current.model.minNonAlphaNumericLength > 0) {
|
||||
var exp = "";
|
||||
for (var i = 0; i < $scope.installer.current.model.minNonAlphaNumericLength; i++) {
|
||||
exp += ".*[\\W].*";
|
||||
}
|
||||
//replace duplicates
|
||||
exp = exp.replace(".*.*", ".*");
|
||||
$scope.passwordPattern = new RegExp(exp);
|
||||
}
|
||||
|
||||
$scope.validateAndInstall = function(){
|
||||
installerService.install();
|
||||
};
|
||||
|
||||
$scope.validateAndForward = function(){
|
||||
if(this.myForm.$valid){
|
||||
installerService.forward();
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
@@ -0,0 +1,56 @@
|
||||
<div ng-controller="Umbraco.Install.UserController">
|
||||
<h1>Install Umbraco 7</h1>
|
||||
|
||||
<p>Enter your name, email and password to install Umbraco 7 with its default settings, alternatively you can customize your installation</p>
|
||||
|
||||
<form name="myForm" class="form-horizontal" novalidate ng-submit="validateAndInstall();">
|
||||
|
||||
<div class="row">
|
||||
<div class="span8">
|
||||
<div class="pull-right">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="name">Name</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="name" placeholder="First Last" required
|
||||
ng-model="installer.current.model.name" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="email">Email</label>
|
||||
<div class="controls">
|
||||
<input type="email" name="email" placeholder="you@example.com" required ng-model="installer.current.model.email" />
|
||||
<small class="inline-help">Your email will be used as your login</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="password">Password</label>
|
||||
<div class="controls">
|
||||
<input type="password" name="installer.current.model.password"
|
||||
ng-minlength="{{installer.current.model.minCharLength}}"
|
||||
ng-pattern="passwordPattern"
|
||||
required
|
||||
ng-model="installer.current.model.password" />
|
||||
<small class="inline-help">At least {{installer.current.model.minCharLength}} characters long</small>
|
||||
<small ng-if="installer.current.model.minNonAlphaNumericLength > 0" class="inline-help">
|
||||
At least {{installer.current.model.minNonAlphaNumericLength}} symbol{{installer.current.model.minNonAlphaNumericLength > 1 ? 's' : ''}}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group" ng-class="{disabled:myForm.$invalid}">
|
||||
<div class="controls">
|
||||
|
||||
<input type="submit" ng-disabled="myForm.$invalid" value="Install" class="btn btn-success" />
|
||||
|
||||
<a href class="btn btn-link" ng-disabled="myForm.$invalid" ng-click="validateAndForward()">Customize</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
<div>
|
||||
<h1>Major version upgrade from {{installer.current.model.currentVersion}} to {{installer.current.model.newVersion}}</h1>
|
||||
<h2>There were {{installer.current.model.errors.length}} issues detected</h2>
|
||||
<p>
|
||||
The following compatibility issues were found. If you continue all non-compatible property editors will be converted to a Readonly/Label.
|
||||
You will be able to change the property editor to a compatible type manually by editing the data type after installation.
|
||||
</p>
|
||||
<p>
|
||||
Otherwise if you choose not to proceed you will need to fix the errors listed below.
|
||||
Refer to v{{installer.current.model.newVersion}} upgrade instructions for full details.
|
||||
</p>
|
||||
|
||||
<ul class="upgrade-report">
|
||||
<li ng-repeat="item in installer.current.model.errors">
|
||||
{{item}}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<button class="btn btn-success" ng-click="forward()">Continue</button>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,280 @@
|
||||
// Core variables and mixins
|
||||
@import "fonts.less"; // Loading fonts
|
||||
@import "variables.less"; // Modify this for custom colors, font-sizes, etc
|
||||
@import "mixins.less";
|
||||
@import "buttons.less";
|
||||
@import "forms.less";
|
||||
|
||||
// Grid system and page structure
|
||||
@import "../../lib/bootstrap/less/scaffolding.less";
|
||||
@import "../../lib/bootstrap/less/grid.less";
|
||||
@import "../../lib/bootstrap/less/layouts.less";
|
||||
|
||||
@import "../../lib/bootstrap/less/thumbnails.less";
|
||||
@import "../../lib/bootstrap/less/media.less";
|
||||
|
||||
|
||||
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
|
||||
html {
|
||||
background: url('../img/installer.jpg') no-repeat center center fixed;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
font-family: @baseFontFamily;
|
||||
font-size: @baseFontSize;
|
||||
line-height: @baseLineHeight;
|
||||
color: @textColor;
|
||||
|
||||
vertical-align: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#logo{
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
left: 20px;
|
||||
opacity: 0.8;
|
||||
z-index: 777;
|
||||
}
|
||||
|
||||
#installer{
|
||||
margin: auto;
|
||||
background: white;
|
||||
width: 750px;
|
||||
height: 600px;
|
||||
text-align: left;
|
||||
padding: 30px;
|
||||
overflow:hidden;
|
||||
z-index: 667;
|
||||
}
|
||||
|
||||
#overlay{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background: @blackLight;
|
||||
z-index: 666;
|
||||
}
|
||||
|
||||
.loading #overlay{
|
||||
opacity: 0.5;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
|
||||
#fact{
|
||||
color: #fff;
|
||||
text-shadow: 0px 0px 4px black;
|
||||
font-size: 25px;
|
||||
text-align: left;
|
||||
line-height: 35px;
|
||||
z-index: 667;
|
||||
height: 600px;
|
||||
width: 750px;
|
||||
}
|
||||
|
||||
#fact h2{
|
||||
font-size: 35px;
|
||||
border-bottom: 1px solid white;
|
||||
padding-bottom: 10px;
|
||||
margin-bottom: 20px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#fact a{color: white;}
|
||||
|
||||
#feedback{
|
||||
color: #fff;
|
||||
text-shadow: 0px 0px 4px black;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
z-index: 667;
|
||||
bottom: 20px;
|
||||
right: 0;
|
||||
left: 0;
|
||||
height: 25px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
|
||||
h1{
|
||||
border-bottom: 1px solid @grayLighter;
|
||||
padding-bottom: 10px;
|
||||
color: @gray;
|
||||
}
|
||||
|
||||
.error h1, .error .message, span.error{ color: @red;}
|
||||
|
||||
legend{font-size: 14px; font-weight: bold}
|
||||
|
||||
input.ng-dirty.ng-invalid{border-color: #b94a48; color: #b94a48;}
|
||||
.disabled{
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.controls{
|
||||
text-align: left
|
||||
}
|
||||
|
||||
.controls small{display: block; color: @gray;}
|
||||
|
||||
.absolute-center {
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
top: 0; left: 0; bottom: 0; right: 0;
|
||||
}
|
||||
|
||||
.fade-hide, .fade-show {
|
||||
-webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
|
||||
-moz-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
|
||||
-o-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
|
||||
transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
|
||||
}
|
||||
.fade-hide {
|
||||
opacity:1;
|
||||
}
|
||||
.fade-hide.fade-hide-active {
|
||||
opacity:0;
|
||||
}
|
||||
.fade-show {
|
||||
opacity:0;
|
||||
}
|
||||
.fade-show.fade-show-active {
|
||||
opacity:1;
|
||||
}
|
||||
|
||||
|
||||
.umb-loader{
|
||||
background-color: white;
|
||||
margin-top:0;
|
||||
margin-left:-100%;
|
||||
-moz-animation-name:bounce_loadingProgressG;
|
||||
-moz-animation-duration:1s;
|
||||
-moz-animation-iteration-count:infinite;
|
||||
-moz-animation-timing-function:linear;
|
||||
-webkit-animation-name:bounce_loadingProgressG;
|
||||
-webkit-animation-duration:1s;
|
||||
-webkit-animation-iteration-count:infinite;
|
||||
-webkit-animation-timing-function:linear;
|
||||
-ms-animation-name:bounce_loadingProgressG;
|
||||
-ms-animation-duration:1s;
|
||||
-ms-animation-iteration-count:infinite;
|
||||
-ms-animation-timing-function:linear;
|
||||
-o-animation-name:bounce_loadingProgressG;
|
||||
-o-animation-duration:1s;
|
||||
-o-animation-iteration-count:infinite;
|
||||
-o-animationtiming-function:linear;
|
||||
animation-name:bounce_loadingProgressG;
|
||||
animation-duration:1s;
|
||||
animation-iteration-count:infinite;
|
||||
animation-timing-function:linear;
|
||||
width:100%;
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
|
||||
@-moz-keyframes bounce_loadingProgressG{
|
||||
0%{
|
||||
margin-left:-100%;
|
||||
}
|
||||
|
||||
100%{
|
||||
margin-left:100%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@-webkit-keyframes bounce_loadingProgressG{
|
||||
0%{
|
||||
margin-left:-100%;
|
||||
}
|
||||
|
||||
100%{
|
||||
margin-left:100%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@-ms-keyframes bounce_loadingProgressG{
|
||||
0%{
|
||||
margin-left:-100%;
|
||||
}
|
||||
|
||||
100%{
|
||||
margin-left:100%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@-o-keyframes bounce_loadingProgressG{
|
||||
0%{
|
||||
margin-left:-100%;
|
||||
}
|
||||
|
||||
100%{
|
||||
margin-left:100%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@keyframes bounce_loadingProgressG{
|
||||
0%{
|
||||
margin-left:-100%;
|
||||
}
|
||||
100%{
|
||||
margin-left:100%;
|
||||
}
|
||||
}
|
||||
|
||||
//loader defaults
|
||||
.umb-loader-container, .umb-loader-done{
|
||||
height: 3px;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
width: 0%;
|
||||
z-index: 777;
|
||||
}
|
||||
|
||||
.umb-loader-done{
|
||||
right: 0%;
|
||||
background: white;
|
||||
}
|
||||
|
||||
|
||||
.permissions-report {
|
||||
overflow:auto;
|
||||
height:320px;
|
||||
margin:0;
|
||||
display:block;
|
||||
padding:0;
|
||||
}
|
||||
.permissions-report > li {
|
||||
list-style:none;
|
||||
}
|
||||
.permissions-report h4 {
|
||||
margin:7px;
|
||||
}
|
||||
|
||||
.upgrade-report {
|
||||
overflow:auto;
|
||||
height:280px;
|
||||
display:block;
|
||||
}
|
||||
@@ -166,7 +166,7 @@
|
||||
}
|
||||
|
||||
.umb-tab-buttons{padding-left: 240px;}
|
||||
.umb-tab-pane.with-buttons{padding-bottom: 90px}
|
||||
.umb-tab-pane{padding-bottom: 90px}
|
||||
|
||||
.tab-content{overflow: visible; }
|
||||
|
||||
|
||||
@@ -127,13 +127,6 @@ angular.module("umbraco").controller("Umbraco.Dialogs.TreePickerController",
|
||||
|
||||
|
||||
$scope.multiSubmit = function (result) {
|
||||
|
||||
if(dialogOptions.minNumber || dialogOptions.maxNumber){
|
||||
if(dialogOptions.minNumber > result.length || dialogOptions.maxNumber < result.length){
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
entityResource.getByIds(result, $scope.entityType).then(function (ents) {
|
||||
$scope.submit(ents);
|
||||
});
|
||||
|
||||
@@ -49,8 +49,7 @@
|
||||
|
||||
<div class="umb-panel-footer">
|
||||
<div class="umb-el-wrap umb-panel-buttons">
|
||||
{{opt.filter | json}}
|
||||
<div class="btn-toolbar umb-btn-toolbar pull-right">
|
||||
<div class="btn-toolbar umb-btn-toolbar pull-right">
|
||||
|
||||
<a href ng-click="close()" class="btn btn-link">
|
||||
<localize key="general_cancel">Cancel</localize>
|
||||
|
||||
@@ -38,8 +38,7 @@
|
||||
</umb-property>
|
||||
|
||||
|
||||
|
||||
<div class="umb-tab-buttons" ng-class="{'umb-dimmed': busy}">
|
||||
<div class="umb-tab-buttons" detect-fold ng-class="{'umb-dimmed': busy}">
|
||||
<div class="btn-group" ng-show="content.template">
|
||||
<a class="btn" ng-click="preview(content)">
|
||||
<localize key="buttons_showPage">Preview page</localize>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
</umb-property>
|
||||
|
||||
|
||||
<div class="umb-tab-buttons">
|
||||
<div class="umb-tab-buttons" detect-fold>
|
||||
<div class="btn-group">
|
||||
<button type="submit" data-hotkey="ctrl+s" class="btn btn-success">
|
||||
<localize key="buttons_save">Save</localize>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<umb-editor model="property"></umb-editor>
|
||||
</umb-property>
|
||||
|
||||
<div class="umb-tab-buttons" ng-class="{'umb-dimmed': busy}">
|
||||
<div class="umb-tab-buttons" detect-fold ng-class="{'umb-dimmed': busy}">
|
||||
<div class="btn-group">
|
||||
<button type="submit" data-hotkey="ctrl+s" class="btn btn-success">
|
||||
<localize key="buttons_save">Save</localize>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<umb-editor model="property"></umb-editor>
|
||||
</umb-property>
|
||||
|
||||
<div class="umb-tab-buttons" ng-class="{'umb-dimmed': busy}">
|
||||
<div class="umb-tab-buttons" detect-fold ng-class="{'umb-dimmed': busy}">
|
||||
<div class="btn-group">
|
||||
<button type="submit" data-hotkey="ctrl+s" class="btn btn-success">
|
||||
<localize key="buttons_save">Save</localize>
|
||||
|
||||
@@ -23,4 +23,11 @@
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div ng-if="model.config.minNumber && model.config.minNumber > renderModel.length">
|
||||
You need to add atleast {{model.config.minNumber-renderModel.length}} items
|
||||
</div>
|
||||
<div ng-if="model.config.maxNumber && model.config.maxNumber < renderModel.length">
|
||||
You can only have {{model.config.maxNumber}} items selected
|
||||
</div>
|
||||
</div>
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
//this controller simply tells the dialogs service to open a mediaPicker window
|
||||
//with a specified callback, this callback will receive an object with a selection on it
|
||||
angular.module('umbraco')
|
||||
|
||||
angular.module('umbraco')
|
||||
|
||||
.controller("Umbraco.PropertyEditors.ImageCropperController",
|
||||
function ($rootScope, $routeParams, $scope, $log, mediaHelper, cropperHelper, $timeout, editorState, umbRequestHelper, fileManager) {
|
||||
|
||||
function($rootScope, $routeParams, $scope, $log, mediaHelper, cropperHelper, $timeout, editorState, umbRequestHelper, fileManager) {
|
||||
|
||||
var config = $scope.model.config;
|
||||
mediaHelper.registerFileResolver("Umbraco.ImageCropper", function (property) {
|
||||
if (property.value.src) {
|
||||
|
||||
+105
-103
@@ -1,104 +1,106 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Web.Install;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps.Skinning
|
||||
{
|
||||
public delegate void StarterKitInstalledEventHandler();
|
||||
|
||||
public partial class LoadStarterKits : StepUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the string for the package installer web service base url
|
||||
/// </summary>
|
||||
protected string PackageInstallServiceBaseUrl { get; private set; }
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
|
||||
//Get the URL for the package install service base url
|
||||
var umbracoPath = Core.Configuration.GlobalSettings.UmbracoMvcArea;
|
||||
var urlHelper = new UrlHelper(Context.Request.RequestContext);
|
||||
PackageInstallServiceBaseUrl = urlHelper.Action("Index", "InstallPackage", new { area = umbracoPath });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Flag to show if we can connect to the repo or not
|
||||
/// </summary>
|
||||
protected bool CannotConnect { get; private set; }
|
||||
|
||||
public event StarterKitInstalledEventHandler StarterKitInstalled;
|
||||
|
||||
protected virtual void OnStarterKitInstalled()
|
||||
{
|
||||
StarterKitInstalled();
|
||||
}
|
||||
|
||||
|
||||
private readonly global::umbraco.cms.businesslogic.packager.repositories.Repository _repo;
|
||||
private const string RepoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66";
|
||||
|
||||
public LoadStarterKits()
|
||||
{
|
||||
_repo = global::umbraco.cms.businesslogic.packager.repositories.Repository.getByGuid(RepoGuid);
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void NextStep(object sender, EventArgs e)
|
||||
{
|
||||
var p = (Default)this.Page;
|
||||
InstallHelper.RedirectToNextStep(Page, Request.GetItemAsString("installStep"));
|
||||
}
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
|
||||
if (_repo == null)
|
||||
{
|
||||
throw new InvalidOperationException("Could not find repository with id " + RepoGuid);
|
||||
}
|
||||
|
||||
//clear progressbar cache
|
||||
InstallHelper.ClearProgress();
|
||||
|
||||
if (_repo.HasConnection())
|
||||
{
|
||||
try
|
||||
{
|
||||
var r = new org.umbraco.our.Repository();
|
||||
|
||||
rep_starterKits.DataSource = r.Modules();
|
||||
rep_starterKits.DataBind();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error<LoadStarterKits>("Cannot connect to package repository", ex);
|
||||
CannotConnect = true;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CannotConnect = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void GotoLastStep(object sender, EventArgs e)
|
||||
{
|
||||
InstallHelper.RedirectToLastStep(Page);
|
||||
}
|
||||
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using System.Web.UI;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Web.Install;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps.Skinning
|
||||
{
|
||||
public delegate void StarterKitInstalledEventHandler();
|
||||
|
||||
public partial class LoadStarterKits : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the string for the package installer web service base url
|
||||
/// </summary>
|
||||
protected string PackageInstallServiceBaseUrl { get; private set; }
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
|
||||
//Get the URL for the package install service base url
|
||||
var umbracoPath = Core.Configuration.GlobalSettings.UmbracoMvcArea;
|
||||
var urlHelper = new UrlHelper(Context.Request.RequestContext);
|
||||
//PackageInstallServiceBaseUrl = urlHelper.Action("Index", "InstallPackage", new { area = "UmbracoInstall" });
|
||||
PackageInstallServiceBaseUrl = urlHelper.GetUmbracoApiService("Index", "InstallPackage", "UmbracoInstall");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Flag to show if we can connect to the repo or not
|
||||
/// </summary>
|
||||
protected bool CannotConnect { get; private set; }
|
||||
|
||||
public event StarterKitInstalledEventHandler StarterKitInstalled;
|
||||
|
||||
protected virtual void OnStarterKitInstalled()
|
||||
{
|
||||
StarterKitInstalled();
|
||||
}
|
||||
|
||||
|
||||
private readonly global::umbraco.cms.businesslogic.packager.repositories.Repository _repo;
|
||||
private const string RepoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66";
|
||||
|
||||
public LoadStarterKits()
|
||||
{
|
||||
_repo = global::umbraco.cms.businesslogic.packager.repositories.Repository.getByGuid(RepoGuid);
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//protected void NextStep(object sender, EventArgs e)
|
||||
//{
|
||||
// var p = (Default)this.Page;
|
||||
// //InstallHelper.RedirectToNextStep(Page, Request.GetItemAsString("installStep"));
|
||||
//}
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
|
||||
if (_repo == null)
|
||||
{
|
||||
throw new InvalidOperationException("Could not find repository with id " + RepoGuid);
|
||||
}
|
||||
|
||||
//clear progressbar cache
|
||||
//InstallHelper.ClearProgress();
|
||||
|
||||
if (_repo.HasConnection())
|
||||
{
|
||||
try
|
||||
{
|
||||
var r = new org.umbraco.our.Repository();
|
||||
|
||||
rep_starterKits.DataSource = r.Modules();
|
||||
rep_starterKits.DataBind();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error<LoadStarterKits>("Cannot connect to package repository", ex);
|
||||
CannotConnect = true;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CannotConnect = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void GotoLastStep(object sender, EventArgs e)
|
||||
{
|
||||
//InstallHelper.RedirectToLastStep(Page);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+60
-60
@@ -1,60 +1,60 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps.Skinning {
|
||||
|
||||
|
||||
public partial class LoadStarterKits {
|
||||
|
||||
/// <summary>
|
||||
/// pl_loadStarterKits control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder pl_loadStarterKits;
|
||||
|
||||
/// <summary>
|
||||
/// JsInclude1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::ClientDependency.Core.Controls.JsInclude JsInclude1;
|
||||
|
||||
/// <summary>
|
||||
/// rep_starterKits control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Repeater rep_starterKits;
|
||||
|
||||
/// <summary>
|
||||
/// LinkButton1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton LinkButton1;
|
||||
|
||||
/// <summary>
|
||||
/// LinkButton2 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton LinkButton2;
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps.Skinning {
|
||||
|
||||
|
||||
public partial class LoadStarterKits {
|
||||
|
||||
/// <summary>
|
||||
/// pl_loadStarterKits control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder pl_loadStarterKits;
|
||||
|
||||
/// <summary>
|
||||
/// JsInclude1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::ClientDependency.Core.Controls.JsInclude JsInclude1;
|
||||
|
||||
/// <summary>
|
||||
/// rep_starterKits control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Repeater rep_starterKits;
|
||||
|
||||
/// <summary>
|
||||
/// LinkButton1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton LinkButton1;
|
||||
|
||||
/// <summary>
|
||||
/// LinkButton2 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton LinkButton2;
|
||||
}
|
||||
}
|
||||
+97
-97
@@ -1,98 +1,98 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="LoadStarterKits.ascx.cs" Inherits="Umbraco.Web.UI.Install.Steps.Skinning.LoadStarterKits" %>
|
||||
<%@ Import Namespace="Umbraco.Web.org.umbraco.our" %>
|
||||
|
||||
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
|
||||
|
||||
<asp:PlaceHolder ID="pl_loadStarterKits" runat="server">
|
||||
|
||||
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="installer/js/PackageInstaller.js" PathNameAlias="UmbracoClient" />
|
||||
|
||||
<% if (!CannotConnect) { %>
|
||||
<script type="text/javascript">
|
||||
(function ($) {
|
||||
$(document).ready(function () {
|
||||
var installer = new Umbraco.Installer.PackageInstaller({
|
||||
starterKits: $("a.selectStarterKit"),
|
||||
baseUrl: "<%= PackageInstallServiceBaseUrl %>",
|
||||
serverError: $("#serverError"),
|
||||
connectionError: $("#connectionError"),
|
||||
setProgress: updateProgressBar,
|
||||
setStatusMessage: updateStatusMessage
|
||||
});
|
||||
installer.init();
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
<% } %>
|
||||
<div id="starter-kit-progress" style="display: none;">
|
||||
<h2>Installation in progress...</h2>
|
||||
<div class="loader">
|
||||
<div class="hold">
|
||||
<div class="progress-bar">
|
||||
</div>
|
||||
<span class="progress-bar-value">0%</span>
|
||||
</div>
|
||||
<strong></strong>
|
||||
</div>
|
||||
</div>
|
||||
<asp:Repeater ID="rep_starterKits" runat="server">
|
||||
<headertemplate>
|
||||
<ul class="thumbnails">
|
||||
</headertemplate>
|
||||
<itemtemplate>
|
||||
<li class="add-<%# ((Package)Container.DataItem).Text.Replace(" ","").ToLower() %>">
|
||||
<div class="image">
|
||||
|
||||
|
||||
<div class="overlay"><a href="#" class="single-tab selectStarterKit" data-name="<%# ((Package)Container.DataItem).Text %>" title="Install <%# ((Package)Container.DataItem).Text %>" data-repoid="<%# ((Package)Container.DataItem).RepoGuid %>">Install <%# ((Package)Container.DataItem).Text %></a></div>
|
||||
<img src="http://our.umbraco.org<%# ((Package)Container.DataItem).Thumbnail %>" alt="<%# ((Package)Container.DataItem).Text %>">
|
||||
|
||||
<a class="zoom-in" title="Enlarge <%# ((Package)Container.DataItem).Text %>" href="#<%# ((Package)Container.DataItem).Text %>">Open</a>
|
||||
</div>
|
||||
</li>
|
||||
<div id="<%# ((Package)Container.DataItem).Text %>" class="lb"><a href="#top"><img src="http://our.umbraco.org<%# ((Package)Container.DataItem).Thumbnail %>" alt="oh man" /></a></div>
|
||||
|
||||
</itemtemplate>
|
||||
<footertemplate>
|
||||
</ul>
|
||||
<asp:LinkButton runat="server" ID="declineStarterKits" CssClass="declineKit" OnClientClick="return confirm('Are you sure you do not want to install a starter kit?');" OnClick="NextStep">
|
||||
No thanks, do not install a starterkit!
|
||||
</asp:LinkButton>
|
||||
</footertemplate>
|
||||
</asp:Repeater>
|
||||
|
||||
</asp:PlaceHolder>
|
||||
|
||||
<div id="connectionError" style="<%= CannotConnect ? "" : "display:none;" %>">
|
||||
|
||||
<div style="padding: 0 100px 13px 5px;">
|
||||
<h2>Oops...the installer can't connect to the repository</h2>
|
||||
Starter Kits could not be fetched from the repository as there was no connection - which can occur if you are using a proxy server or firewall with certain configurations,
|
||||
or if you are not currently connected to the internet.
|
||||
<br />
|
||||
Click <strong>Continue</strong> to complete the installation then navigate to the Developer section of your Umbraco installation
|
||||
where you will find the Starter Kits listed in the Packages tree.
|
||||
</div>
|
||||
|
||||
<!-- btn box -->
|
||||
<footer class="btn-box">
|
||||
<div class="t"> </div>
|
||||
<asp:LinkButton ID="LinkButton1" class="btn-step btn btn-continue" runat="server" OnClick="GotoLastStep"><span>Continue</span></asp:LinkButton>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="serverError" style="display:none;">
|
||||
|
||||
<div style="padding: 0 100px 13px 5px;">
|
||||
<h2>Oops...the installer encountered an error</h2>
|
||||
<div class="error-message"></div>
|
||||
</div>
|
||||
|
||||
<!-- btn box -->
|
||||
<footer class="btn-box">
|
||||
<div class="t"> </div>
|
||||
<asp:LinkButton ID="LinkButton2" class="btn-step btn btn-continue" runat="server" OnClick="GotoLastStep"><span>Continue</span></asp:LinkButton>
|
||||
</footer>
|
||||
|
||||
<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="LoadStarterKits.ascx.cs" Inherits="Umbraco.Web.UI.Install.Steps.Skinning.LoadStarterKits" %>
|
||||
<%@ Import Namespace="Umbraco.Web.org.umbraco.our" %>
|
||||
|
||||
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
|
||||
|
||||
<asp:PlaceHolder ID="pl_loadStarterKits" runat="server">
|
||||
|
||||
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="installer/js/PackageInstaller.js" PathNameAlias="UmbracoClient" />
|
||||
|
||||
<% if (!CannotConnect) { %>
|
||||
<script type="text/javascript">
|
||||
(function ($) {
|
||||
$(document).ready(function () {
|
||||
var installer = new Umbraco.Installer.PackageInstaller({
|
||||
starterKits: $("a.selectStarterKit"),
|
||||
baseUrl: "<%= PackageInstallServiceBaseUrl %>",
|
||||
serverError: $("#serverError"),
|
||||
connectionError: $("#connectionError"),
|
||||
setProgress: updateProgressBar,
|
||||
setStatusMessage: updateStatusMessage
|
||||
});
|
||||
installer.init();
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
<% } %>
|
||||
<div id="starter-kit-progress" style="display: none;">
|
||||
<h2>Installation in progress...</h2>
|
||||
<div class="loader">
|
||||
<div class="hold">
|
||||
<div class="progress-bar">
|
||||
</div>
|
||||
<span class="progress-bar-value">0%</span>
|
||||
</div>
|
||||
<strong></strong>
|
||||
</div>
|
||||
</div>
|
||||
<asp:Repeater ID="rep_starterKits" runat="server">
|
||||
<headertemplate>
|
||||
<ul class="thumbnails">
|
||||
</headertemplate>
|
||||
<itemtemplate>
|
||||
<li class="add-<%# ((Package)Container.DataItem).Text.Replace(" ","").ToLower() %>">
|
||||
<div class="image">
|
||||
|
||||
|
||||
<div class="overlay"><a href="#" class="single-tab selectStarterKit" data-name="<%# ((Package)Container.DataItem).Text %>" title="Install <%# ((Package)Container.DataItem).Text %>" data-repoid="<%# ((Package)Container.DataItem).RepoGuid %>">Install <%# ((Package)Container.DataItem).Text %></a></div>
|
||||
<img src="http://our.umbraco.org<%# ((Package)Container.DataItem).Thumbnail %>" alt="<%# ((Package)Container.DataItem).Text %>">
|
||||
|
||||
<a class="zoom-in" title="Enlarge <%# ((Package)Container.DataItem).Text %>" href="#<%# ((Package)Container.DataItem).Text %>">Open</a>
|
||||
</div>
|
||||
</li>
|
||||
<div id="<%# ((Package)Container.DataItem).Text %>" class="lb"><a href="#top"><img src="http://our.umbraco.org<%# ((Package)Container.DataItem).Thumbnail %>" alt="oh man" /></a></div>
|
||||
|
||||
</itemtemplate>
|
||||
<footertemplate>
|
||||
</ul>
|
||||
<%--<asp:LinkButton runat="server" ID="declineStarterKits" CssClass="declineKit" OnClientClick="return confirm('Are you sure you do not want to install a starter kit?');" OnClick="NextStep">
|
||||
No thanks, do not install a starterkit!
|
||||
</asp:LinkButton>--%>
|
||||
</footertemplate>
|
||||
</asp:Repeater>
|
||||
|
||||
</asp:PlaceHolder>
|
||||
|
||||
<div id="connectionError" style="<%= CannotConnect ? "" : "display:none;" %>">
|
||||
|
||||
<div style="padding: 0 100px 13px 5px;">
|
||||
<h2>Oops...the installer can't connect to the repository</h2>
|
||||
Starter Kits could not be fetched from the repository as there was no connection - which can occur if you are using a proxy server or firewall with certain configurations,
|
||||
or if you are not currently connected to the internet.
|
||||
<br />
|
||||
Click <strong>Continue</strong> to complete the installation then navigate to the Developer section of your Umbraco installation
|
||||
where you will find the Starter Kits listed in the Packages tree.
|
||||
</div>
|
||||
|
||||
<!-- btn box -->
|
||||
<footer class="btn-box">
|
||||
<div class="t"> </div>
|
||||
<asp:LinkButton ID="LinkButton1" class="btn-step btn btn-continue" runat="server" OnClick="GotoLastStep"><span>Continue</span></asp:LinkButton>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="serverError" style="display:none;">
|
||||
|
||||
<div style="padding: 0 100px 13px 5px;">
|
||||
<h2>Oops...the installer encountered an error</h2>
|
||||
<div class="error-message"></div>
|
||||
</div>
|
||||
|
||||
<!-- btn box -->
|
||||
<footer class="btn-box">
|
||||
<div class="t"> </div>
|
||||
<asp:LinkButton ID="LinkButton2" class="btn-step btn btn-continue" runat="server" OnClick="GotoLastStep"><span>Continue</span></asp:LinkButton>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,52 @@
|
||||
@using Umbraco.Web
|
||||
@using Umbraco.Web.Install.Controllers
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="@ViewBag.UmbracoBaseFolder/" />
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Install Umbraco</title>
|
||||
<link rel="stylesheet" href="assets/css/installer.css" />
|
||||
</head>
|
||||
|
||||
<body ng-class="{loading:installer.loading}" ng-controller="Umbraco.InstallerController" id="umbracoInstallPageBody">
|
||||
|
||||
<img src="assets/img/application/logo_white.png" id="logo" />
|
||||
|
||||
<div class="umb-loader-container" ng-style="{'width': installer.progress}">
|
||||
<div class="umb-loader" id="loader" ng-if="installer.loading"></div>
|
||||
</div>
|
||||
|
||||
<div id="overlay" ng-cloak ng-animate="'fade'" ng-show="installer.done"></div>
|
||||
|
||||
<div id="installer" class="absolute-center clearfix"
|
||||
ng-cloak
|
||||
ng-animate="'fade'"
|
||||
ng-show="installer.configuring">
|
||||
<div ng-if="installer.current" ng-include="installer.current.view"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div ng-cloak ng-animate="'fade'" id="fact" class="absolute-center clearfix" ng-show="installer.fact">
|
||||
<h2>Did you know</h2>
|
||||
<p ng-bind-html-unsafe="installer.fact"></p>
|
||||
</div>
|
||||
|
||||
<h3 ng-cloak ng-animate="'fade'" id="feedback" ng-show="installer.feedback">{{installer.feedback}}</h3>
|
||||
<script type="text/javascript">
|
||||
var Umbraco = {};
|
||||
Umbraco.Sys = {};
|
||||
Umbraco.Sys.ServerVariables = {
|
||||
"installApiBaseUrl": "@ViewBag.InstallApiBaseUrl",
|
||||
"umbracoBaseUrl": "@ViewBag.UmbracoBaseFolder"
|
||||
};
|
||||
</script>
|
||||
<script src="lib/yepnope/yepnope.min.js"></script>
|
||||
<script src="js/install.loader.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<pages pageBaseType="System.Web.Mvc.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc" />
|
||||
<add namespace="System.Web.Mvc.Ajax" />
|
||||
<add namespace="System.Web.Mvc.Html" />
|
||||
<add namespace="System.Web.Routing" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web.webPages.razor>
|
||||
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
</appSettings>
|
||||
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
|
||||
</httpHandlers>
|
||||
|
||||
<!--
|
||||
Enabling request validation in view pages would cause validation to occur
|
||||
after the input has already been processed by the controller. By default
|
||||
MVC performs request validation before a controller processes the input.
|
||||
To change this behavior apply the ValidateInputAttribute to a
|
||||
controller or action.
|
||||
-->
|
||||
<pages
|
||||
validateRequest="false"
|
||||
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<controls>
|
||||
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
|
||||
</controls>
|
||||
</pages>
|
||||
</system.web>
|
||||
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
|
||||
<handlers>
|
||||
<remove name="BlockViewHandler"/>
|
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
@@ -307,10 +307,13 @@
|
||||
<Compile Include="..\SolutionInfo.cs">
|
||||
<Link>Properties\SolutionInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Install\Default.aspx.cs">
|
||||
<DependentUpon>default.aspx</DependentUpon>
|
||||
<Compile Include="Areas\UmbracoInstall\Legacy\LoadStarterKits.ascx.cs">
|
||||
<DependentUpon>loadStarterKits.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Areas\UmbracoInstall\Legacy\LoadStarterKits.ascx.designer.cs">
|
||||
<DependentUpon>loadStarterKits.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Config\splashes\NoNodes.aspx.cs">
|
||||
<DependentUpon>noNodes.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -319,103 +322,6 @@
|
||||
<DependentUpon>noNodes.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Default.aspx.designer.cs">
|
||||
<DependentUpon>default.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Install\InstallerRestService.aspx.cs">
|
||||
<DependentUpon>InstallerRestService.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\InstallerRestService.aspx.designer.cs">
|
||||
<DependentUpon>InstallerRestService.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\Database.ascx.cs">
|
||||
<DependentUpon>database.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\Database.ascx.designer.cs">
|
||||
<DependentUpon>database.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\DefaultUser.ascx.cs">
|
||||
<DependentUpon>defaultUser.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\DefaultUser.ascx.designer.cs">
|
||||
<DependentUpon>defaultUser.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\License.ascx.cs">
|
||||
<DependentUpon>license.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\License.ascx.designer.cs">
|
||||
<DependentUpon>license.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\Renaming.ascx.cs">
|
||||
<DependentUpon>renaming.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\Renaming.ascx.designer.cs">
|
||||
<DependentUpon>renaming.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\RenderingEngine.ascx.cs">
|
||||
<DependentUpon>RenderingEngine.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\RenderingEngine.ascx.designer.cs">
|
||||
<DependentUpon>RenderingEngine.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\Skinning\LoadStarterKits.ascx.cs">
|
||||
<DependentUpon>loadStarterKits.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\Skinning\LoadStarterKits.ascx.designer.cs">
|
||||
<DependentUpon>loadStarterKits.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\StarterKits.ascx.cs">
|
||||
<DependentUpon>StarterKits.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\StarterKits.ascx.designer.cs">
|
||||
<DependentUpon>StarterKits.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\StepUserControl.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\TheEnd.ascx.cs">
|
||||
<DependentUpon>theend.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\TheEnd.ascx.designer.cs">
|
||||
<DependentUpon>theend.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\UpgradeReport.ascx.cs">
|
||||
<DependentUpon>UpgradeReport.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\UpgradeReport.ascx.designer.cs">
|
||||
<DependentUpon>UpgradeReport.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\ValidatePermissions.ascx.cs">
|
||||
<DependentUpon>validatePermissions.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\ValidatePermissions.ascx.designer.cs">
|
||||
<DependentUpon>validatePermissions.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\Welcome.ascx.cs">
|
||||
<DependentUpon>welcome.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Steps\Welcome.ascx.designer.cs">
|
||||
<DependentUpon>welcome.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Install\Title.ascx.cs">
|
||||
<DependentUpon>Title.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Install\Title.ascx.designer.cs">
|
||||
<DependentUpon>Title.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -630,6 +536,7 @@
|
||||
<Compile Include="Umbraco\TreeInit.aspx.designer.cs">
|
||||
<DependentUpon>treeInit.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Content Include="Areas\UmbracoInstall\Legacy\loadStarterKits.ascx" />
|
||||
<Content Include="Umbraco\ClientRedirect.aspx" />
|
||||
<Content Include="Umbraco\create.aspx" />
|
||||
<Content Include="Umbraco\Logout.aspx" />
|
||||
@@ -651,7 +558,6 @@
|
||||
</Compile>
|
||||
<Content Include="Config\Splashes\booting.aspx" />
|
||||
<Content Include="Config\Splashes\noNodes.aspx" />
|
||||
<Content Include="Install\Steps\UpgradeReport.ascx" />
|
||||
<Content Include="Umbraco\Dashboard\UserControlProxy.aspx" />
|
||||
<Content Include="Umbraco\Create\PartialView.ascx" />
|
||||
<Content Include="Umbraco\Create\User.ascx" />
|
||||
@@ -667,6 +573,7 @@
|
||||
<SubType>
|
||||
</SubType>
|
||||
</Content>
|
||||
<Content Include="Areas\UmbracoInstall\Views\Web.config" />
|
||||
<None Include="Config\404handlers.Release.config">
|
||||
<DependentUpon>404handlers.config</DependentUpon>
|
||||
</None>
|
||||
@@ -729,6 +636,7 @@
|
||||
<Content Include="MacroScripts\Web.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="Areas\UmbracoInstall\Views\Install\Index.cshtml" />
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
@@ -740,7 +648,6 @@
|
||||
<DependentUpon>UI.xml</DependentUpon>
|
||||
</None>
|
||||
<Content Include="Global.asax" />
|
||||
<Content Include="Install\Steps\RenderingEngine.ascx" />
|
||||
<Content Include="Umbraco\Config\Lang\en_us.xml" />
|
||||
<Content Include="Umbraco\Config\Lang\he.xml" />
|
||||
<Content Include="Umbraco\Config\Lang\ja.xml" />
|
||||
@@ -1752,12 +1659,6 @@
|
||||
<Content Include="Umbraco_Client\Installer\Js\jquery.1.4.4.js" />
|
||||
<Content Include="Umbraco_Client\Installer\Js\jquery.main.js" />
|
||||
<Content Include="Umbraco_Client\Installer\Js\jquery.ui.selectmenu.js" />
|
||||
<Content Include="Install\Steps\database.ascx" />
|
||||
<Content Include="Install\Steps\renaming.ascx" />
|
||||
<Content Include="Install\Steps\StarterKits.ascx" />
|
||||
<Content Include="Install\Steps\Skinning\loadStarterKits.ascx" />
|
||||
<Content Include="Install\Title.ascx" />
|
||||
<Content Include="Install\InstallerRestService.aspx" />
|
||||
<Content Include="Umbraco\Config\Lang\ko.xml" />
|
||||
<Content Include="Umbraco\Dashboard\FeedProxy.aspx" />
|
||||
<Content Include="Umbraco\Developer\Packages\StarterKits.aspx" />
|
||||
@@ -1895,8 +1796,6 @@
|
||||
<Content Include="Umbraco_Client\Tree\Themes\Default\icons.png" />
|
||||
<Content Include="Umbraco_Client\Tree\Themes\Umbraco\icons.png" />
|
||||
<Content Include="default.aspx" />
|
||||
<Content Include="Install\default.aspx" />
|
||||
<Content Include="Install\Steps\license.ascx" />
|
||||
<Content Include="Umbraco\Actions\delete.aspx" />
|
||||
<Content Include="Umbraco\Actions\editContent.aspx" />
|
||||
<Content Include="Umbraco\Actions\preview.aspx" />
|
||||
@@ -2087,18 +1986,6 @@
|
||||
<Content Include="Umbraco\Images\Editor\underline_tw.gif" />
|
||||
<Content Include="Umbraco\Images\Editor\unlink.gif" />
|
||||
<Content Include="Umbraco\Images\Editor\visualaid.gif" />
|
||||
<Content Include="Install\Steps\defaultUser.ascx">
|
||||
<SubType>UserControl</SubType>
|
||||
</Content>
|
||||
<Content Include="Install\Steps\theend.ascx">
|
||||
<SubType>UserControl</SubType>
|
||||
</Content>
|
||||
<Content Include="Install\Steps\validatePermissions.ascx">
|
||||
<SubType>UserControl</SubType>
|
||||
</Content>
|
||||
<Content Include="Install\Steps\welcome.ascx">
|
||||
<SubType>UserControl</SubType>
|
||||
</Content>
|
||||
<Content Include="Umbraco\Config\Create\UI.xml" />
|
||||
<Content Include="Umbraco\Config\Lang\en.xml">
|
||||
<SubType>Designer</SubType>
|
||||
@@ -2615,6 +2502,7 @@
|
||||
<Folder Include="App_Code\" />
|
||||
<Folder Include="App_Data\" />
|
||||
<Folder Include="App_Plugins\" />
|
||||
<Folder Include="Areas\UmbracoInstall\Views\Shared\" />
|
||||
<Folder Include="Css\" />
|
||||
<Folder Include="MasterPages\" />
|
||||
<Folder Include="Media\" />
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
yepnope({
|
||||
|
||||
load: [
|
||||
'lib/jquery/jquery-2.0.3.min.js',
|
||||
|
||||
/* 1.1.5 */
|
||||
'lib/angular/1.1.5/angular.min.js',
|
||||
'lib/angular/1.1.5/angular-cookies.min.js',
|
||||
'lib/angular/1.1.5/angular-mobile.min.js',
|
||||
'lib/angular/1.1.5/angular-mocks.js',
|
||||
'lib/angular/1.1.5/angular-sanitize.min.js',
|
||||
'lib/underscore/underscore.js',
|
||||
'js/umbraco.servervariables.js',
|
||||
'js/app.dev.js'
|
||||
],
|
||||
|
||||
complete: function () {
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
angular.module('umbraco.install', [
|
||||
'umbraco.resources',
|
||||
'umbraco.services',
|
||||
'umbraco.httpbackend',
|
||||
'ngMobile'
|
||||
]);
|
||||
|
||||
angular.bootstrap(document, ['umbraco.install']);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
yepnope({
|
||||
|
||||
load: [
|
||||
'lib/jquery/jquery-2.0.3.min.js',
|
||||
|
||||
/* 1.1.5 */
|
||||
'lib/angular/1.1.5/angular.min.js',
|
||||
'lib/angular/1.1.5/angular-cookies.min.js',
|
||||
'lib/angular/1.1.5/angular-mobile.min.js',
|
||||
'lib/angular/1.1.5/angular-mocks.js',
|
||||
'lib/angular/1.1.5/angular-sanitize.min.js',
|
||||
'lib/underscore/underscore.js',
|
||||
'js/umbraco.installer.js'
|
||||
],
|
||||
|
||||
complete: function () {
|
||||
jQuery(document).ready(function () {
|
||||
angular.bootstrap(document, ['umbraco.install']);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -10,7 +10,7 @@ NOTES:
|
||||
* Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config
|
||||
* A new version will invalidate both client and server cache and create new persisted files
|
||||
-->
|
||||
<clientDependency version="242556669" fileDependencyExtensions=".js,.css" loggerType="Umbraco.Web.UI.CdfLogger, umbraco">
|
||||
<clientDependency version="394389720" fileDependencyExtensions=".js,.css" loggerType="Umbraco.Web.UI.CdfLogger, umbraco">
|
||||
|
||||
<!--
|
||||
This section is used for Web Forms only, the enableCompositeFiles="true" is optional and by default is set to true.
|
||||
@@ -44,22 +44,12 @@ NOTES:
|
||||
-->
|
||||
<compositeFiles defaultProvider="defaultFileProcessingProvider" compositeFileHandlerPath="~/DependencyHandler.axd">
|
||||
<fileProcessingProviders>
|
||||
<add name="CompositeFileProcessor"
|
||||
type="ClientDependency.Core.CompositeFiles.Providers.CompositeFileProcessingProvider, ClientDependency.Core"
|
||||
enableCssMinify="true"
|
||||
enableJsMinify="true"
|
||||
persistFiles="true"
|
||||
compositeFilePath="~/App_Data/TEMP/ClientDependency"
|
||||
bundleDomains="localhost:123456"
|
||||
urlType="Base64QueryStrings"
|
||||
pathUrlFormat="{dependencyId}/{version}/{type}"/>
|
||||
<add name="CompositeFileProcessor" type="ClientDependency.Core.CompositeFiles.Providers.CompositeFileProcessingProvider, ClientDependency.Core" enableCssMinify="true" enableJsMinify="true" persistFiles="true" compositeFilePath="~/App_Data/TEMP/ClientDependency" bundleDomains="localhost:123456" urlType="Base64QueryStrings" pathUrlFormat="{dependencyId}/{version}/{type}" />
|
||||
</fileProcessingProviders>
|
||||
|
||||
<!-- A file map provider stores references to dependency files by an id to be used in the handler URL when using the MappedId Url type -->
|
||||
<fileMapProviders>
|
||||
<add name="XmlFileMap"
|
||||
type="ClientDependency.Core.CompositeFiles.Providers.XmlFileMapper, ClientDependency.Core"
|
||||
mapPath="~/App_Data/TEMP/ClientDependency" />
|
||||
<add name="XmlFileMap" type="ClientDependency.Core.CompositeFiles.Providers.XmlFileMapper, ClientDependency.Core" mapPath="~/App_Data/TEMP/ClientDependency" />
|
||||
</fileMapProviders>
|
||||
|
||||
</compositeFiles>
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
using System;
|
||||
using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Web.Install;
|
||||
using Umbraco.Web.Security;
|
||||
using Umbraco.Web.UI.Pages;
|
||||
using umbraco;
|
||||
|
||||
namespace Umbraco.Web.UI.Install
|
||||
{
|
||||
public partial class Default : BasePage
|
||||
{
|
||||
private string _installStep = "";
|
||||
|
||||
protected string CurrentStepClass = "";
|
||||
|
||||
protected void Page_Load(object sender, System.EventArgs e)
|
||||
{
|
||||
rp_steps.DataSource = InstallHelper.InstallerSteps.Values;
|
||||
rp_steps.DataBind();
|
||||
}
|
||||
|
||||
private void LoadContent(InstallerStep currentStep)
|
||||
{
|
||||
PlaceHolderStep.Controls.Clear();
|
||||
PlaceHolderStep.Controls.Add(LoadControl(IOHelper.ResolveUrl(currentStep.UserControl)));
|
||||
step.Value = currentStep.Alias;
|
||||
CurrentStepClass = currentStep.Alias;
|
||||
}
|
||||
|
||||
int _stepCounter = 0;
|
||||
protected void BindStep(object sender, RepeaterItemEventArgs e)
|
||||
{
|
||||
|
||||
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
|
||||
{
|
||||
var i = (InstallerStep)e.Item.DataItem;
|
||||
|
||||
if (!i.HideFromNavigation)
|
||||
{
|
||||
var _class = (Literal)e.Item.FindControl("lt_class");
|
||||
var name = (Literal)e.Item.FindControl("lt_name");
|
||||
|
||||
if (i.Alias == CurrentStepClass)
|
||||
_class.Text = "active";
|
||||
|
||||
_stepCounter++;
|
||||
name.Text = (_stepCounter).ToString() + " - " + i.Name;
|
||||
}
|
||||
else
|
||||
e.Item.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
override protected void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
|
||||
_installStep = Request.GetItemAsString("installStep");
|
||||
|
||||
//if this is not an upgrade we will log in with the default user.
|
||||
// It's not considered an upgrade if the ConfigurationStatus is missing or empty.
|
||||
if (string.IsNullOrWhiteSpace(GlobalSettings.ConfigurationStatus) == false)
|
||||
{
|
||||
var result = Security.ValidateCurrentUser(false);
|
||||
|
||||
switch (result)
|
||||
{
|
||||
case ValidateRequestAttempt.FailedNoPrivileges:
|
||||
case ValidateRequestAttempt.FailedTimedOut:
|
||||
case ValidateRequestAttempt.FailedNoContextId:
|
||||
Response.Redirect(SystemDirectories.Umbraco + "/AuthorizeUpgrade?redir=" + Server.UrlEncode(Request.RawUrl));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var s = string.IsNullOrEmpty(_installStep)
|
||||
? InstallHelper.InstallerSteps["welcome"]
|
||||
: InstallHelper.InstallerSteps[_installStep];
|
||||
|
||||
LoadContent(s);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install {
|
||||
|
||||
|
||||
public partial class Default
|
||||
{
|
||||
/// <summary>
|
||||
/// ScriptManager1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.ScriptManager ScriptManager1;
|
||||
|
||||
/// <summary>
|
||||
/// rp_steps control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Repeater rp_steps;
|
||||
|
||||
/// <summary>
|
||||
/// PlaceHolderStep control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder PlaceHolderStep;
|
||||
|
||||
/// <summary>
|
||||
/// step control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
public global::System.Web.UI.HtmlControls.HtmlInputHidden step;
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="InstallerRestService.aspx.cs" Inherits="Umbraco.Web.UI.Install.InstallerRestService" %>
|
||||
@@ -1,126 +0,0 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Security.Authentication;
|
||||
using System.Web;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Web.Script.Services;
|
||||
using System.Web.Services;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Web.Install;
|
||||
using umbraco;
|
||||
using umbraco.businesslogic.Exceptions;
|
||||
|
||||
namespace Umbraco.Web.UI.Install
|
||||
{
|
||||
public partial class InstallerRestService : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
LogHelper.Info<InstallerRestService>(string.Format("Hitting Page_Load on InstallerRestService.aspx for the requested '{0}' feed", Request.QueryString["feed"]));
|
||||
|
||||
// Stop Caching in IE
|
||||
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
|
||||
|
||||
// Stop Caching in Firefox
|
||||
Response.Cache.SetNoStore();
|
||||
|
||||
string feed = Request.QueryString["feed"];
|
||||
string url = "http://our.umbraco.org/html/twitter";
|
||||
|
||||
if (feed == "progress")
|
||||
{
|
||||
Response.ContentType = "application/json";
|
||||
Response.Write(InstallHelper.GetProgress());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (feed == "blogs")
|
||||
url = "http://our.umbraco.org/html/blogs";
|
||||
|
||||
if (feed == "sitebuildervids")
|
||||
url = "http://umbraco.org/feeds/videos/site-builder-foundation-html";
|
||||
|
||||
if (feed == "developervids")
|
||||
url = "http://umbraco.org/feeds/videos/developer-foundation-html";
|
||||
|
||||
string xmlResponse = library.GetXmlDocumentByUrl(url).Current.OuterXml;
|
||||
|
||||
if (!xmlResponse.Contains("System.Net.WebException"))
|
||||
{
|
||||
Response.Write(library.GetXmlDocumentByUrl(url).Current.OuterXml);
|
||||
}
|
||||
else
|
||||
{
|
||||
Response.Write("We can't connect to umbraco.tv right now. Click <strong>Set up your new website</strong> above to continue.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[WebMethod]
|
||||
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
|
||||
public static string Install()
|
||||
{
|
||||
//if its not configured then we can continue
|
||||
if (ApplicationContext.Current == null || ApplicationContext.Current.IsConfigured)
|
||||
{
|
||||
throw new AuthenticationException("The application is already configured");
|
||||
}
|
||||
|
||||
LogHelper.Info<InstallerRestService>("Running 'Install' service");
|
||||
|
||||
var result = ApplicationContext.Current.DatabaseContext.CreateDatabaseSchemaAndData();
|
||||
|
||||
if (result.RequiresUpgrade == false)
|
||||
{
|
||||
HandleConnectionStrings();
|
||||
}
|
||||
|
||||
var js = new JavaScriptSerializer();
|
||||
var jsonResult = js.Serialize(result);
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
|
||||
public static string Upgrade()
|
||||
{
|
||||
//if its not configured then we can continue
|
||||
if (ApplicationContext.Current == null || ApplicationContext.Current.IsConfigured)
|
||||
{
|
||||
throw new AuthenticationException("The application is already configured");
|
||||
}
|
||||
|
||||
LogHelper.Info<InstallerRestService>("Running 'Upgrade' service");
|
||||
|
||||
var result = ApplicationContext.Current.DatabaseContext.UpgradeSchemaAndData();
|
||||
|
||||
HandleConnectionStrings();
|
||||
|
||||
//After upgrading we must restart the app pool - the reason is because PetaPoco caches a lot of the mapping logic
|
||||
// and after we upgrade a db, some of the mapping needs to be updated so we restart the app pool to clear it's cache or
|
||||
// else we can end up with YSODs
|
||||
ApplicationContext.Current.RestartApplicationPool(new HttpContextWrapper(HttpContext.Current));
|
||||
|
||||
var js = new JavaScriptSerializer();
|
||||
var jsonResult = js.Serialize(result);
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
private static void HandleConnectionStrings()
|
||||
{
|
||||
// Remove legacy umbracoDbDsn configuration setting if it exists and connectionstring also exists
|
||||
if (ConfigurationManager.ConnectionStrings[Core.Configuration.GlobalSettings.UmbracoConnectionName] != null)
|
||||
{
|
||||
Core.Configuration.GlobalSettings.RemoveSetting(Core.Configuration.GlobalSettings.UmbracoConnectionName);
|
||||
}
|
||||
else
|
||||
{
|
||||
var ex = new ArgumentNullException(string.Format("ConfigurationManager.ConnectionStrings[{0}]", Core.Configuration.GlobalSettings.UmbracoConnectionName), "Install / upgrade did not complete successfully, umbracoDbDSN was not set in the connectionStrings section");
|
||||
LogHelper.Error<InstallerRestService>("", ex);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install {
|
||||
|
||||
|
||||
public partial class InstallerRestService {
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="Title.ascx.cs" Inherits="Umbraco.Web.UI.Install.Title" %>
|
||||
<%@ Import Namespace="Umbraco.Core.Configuration" %>
|
||||
<title>Umbraco <%=UmbracoVersion.Current.ToString(3)%> <%=UmbracoVersion.CurrentComment%> Configuration Wizard</title>
|
||||
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Umbraco.Web.UI.Pages;
|
||||
|
||||
namespace Umbraco.Web.UI.Install
|
||||
{
|
||||
public partial class Title : System.Web.UI.UserControl
|
||||
{
|
||||
}
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install {
|
||||
|
||||
|
||||
public partial class Title {
|
||||
}
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
<%@ Page Language="c#" CodeBehind="Default.aspx.cs" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Install.Default" EnableViewState="False" %>
|
||||
|
||||
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
|
||||
|
||||
<%@ Register Src="~/install/Title.ascx" TagPrefix="umb1" TagName="PageTitle" %><!DOCTYPE html>
|
||||
<html>
|
||||
<head runat="server">
|
||||
|
||||
<meta charset="utf-8">
|
||||
|
||||
<umb1:PageTitle runat="server" />
|
||||
|
||||
<link rel="icon" type="image/png" href="<%=umbraco.GlobalSettings.Path + "/Images/PinnedIcons/umb.ico" %>" />
|
||||
|
||||
<link media="all" rel="stylesheet" href="../umbraco_client/installer/css/jquery-ui-1.8.6.custom.css" />
|
||||
<link media="all" type="text/css" rel="stylesheet" href="../umbraco_client/installer/css/reset.css" />
|
||||
<link media="all" rel="stylesheet" href="../umbraco_client/installer/css/all.css" />
|
||||
<link media="all" type="text/css" rel="stylesheet" href="../umbraco_client/installer/css/form.css" />
|
||||
|
||||
<script src="../umbraco_client/Application/NamespaceManager.js" type="text/javascript"></script>
|
||||
<script src="../umbraco_client/ui/base2.js" type="text/javascript"></script>
|
||||
<script src="../umbraco_client/installer/js/jquery.1.4.4.js" type="text/javascript"></script>
|
||||
<script src="../umbraco_client/installer/js/jquery.ui.selectmenu.js" type="text/javascript"></script>
|
||||
<script src="../umbraco_client/installer/js/jquery.main.js" type="text/javascript"></script>
|
||||
<script src="../umbraco_client/passwordStrength/passwordstrength.js" type="text/javascript"></script>
|
||||
|
||||
<script src="../umbraco_client/installer/js/PackageInstaller.js" type="text/javascript"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<link media="all" rel="stylesheet" href="../umbraco_client/installer/css/lt7.css">
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<!--[if lt IE 7]><script type="text/javascript" src="../umbraco_client/installer/js/ie-png.js"></script><![endif]-->
|
||||
</head>
|
||||
|
||||
<body class="<%= CurrentStepClass %>">
|
||||
|
||||
|
||||
<form runat="server">
|
||||
<asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server">
|
||||
<Services>
|
||||
<asp:ServiceReference Path="../umbraco/webservices/CheckForUpgrade.asmx" />
|
||||
</Services>
|
||||
</asp:ScriptManager>
|
||||
<!-- all page -->
|
||||
|
||||
<section id="wrapper">
|
||||
|
||||
<div class="wholder">
|
||||
|
||||
<!-- header -->
|
||||
|
||||
<header id="header">
|
||||
|
||||
<div class="holder">
|
||||
|
||||
<strong class="logo"><a href="#">Umbraco</a></strong>
|
||||
|
||||
</div>
|
||||
|
||||
</header>
|
||||
|
||||
<!-- all content -->
|
||||
|
||||
<section id="main">
|
||||
|
||||
<!-- tabset -->
|
||||
|
||||
<nav class="tabset">
|
||||
|
||||
<asp:Repeater ID="rp_steps" runat="server" OnItemDataBound="BindStep">
|
||||
<HeaderTemplate>
|
||||
<ul>
|
||||
</HeaderTemplate>
|
||||
<FooterTemplate></ul></FooterTemplate>
|
||||
<ItemTemplate>
|
||||
<li class="<asp:literal runat='server' ID='lt_class' />">
|
||||
<asp:Literal ID="lt_name" runat="server" /><em> </em></li>
|
||||
</ItemTemplate>
|
||||
</asp:Repeater>
|
||||
|
||||
<div class="b"> </div>
|
||||
|
||||
</nav>
|
||||
|
||||
<!-- content -->
|
||||
|
||||
<section class="content">
|
||||
<asp:PlaceHolder ID="PlaceHolderStep" runat="server"></asp:PlaceHolder>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<!-- bg page
|
||||
<div class="bg-main">
|
||||
<div class="color2">
|
||||
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
|
||||
<div class="color3">
|
||||
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
|
||||
<div class="color1">
|
||||
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
|
||||
<div class="color4">
|
||||
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
|
||||
<div class="color5">
|
||||
|
||||
<div class="bg-c"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
-->
|
||||
|
||||
<!-- lightbox -->
|
||||
<div class="lightbox" id="lightbox">
|
||||
<a href="#" class="btn-close btn-close-box">close</a>
|
||||
<div class="t"> </div>
|
||||
<div class="c">
|
||||
<div class="heading">
|
||||
<strong class="title">Name of skin</strong>
|
||||
<span class="create">Created by: <a href="#">Cogworks</a></span>
|
||||
</div>
|
||||
<div class="carusel">
|
||||
<ul>
|
||||
<li>
|
||||
<img src="../umbraco_client/installer/images/img09.jpg" alt="image description"></li>
|
||||
<li>
|
||||
<img src="../umbraco_client/installer/images/img10.jpg" alt="image description"></li>
|
||||
<li>
|
||||
<img src="../umbraco_client/installer/images/img11.jpg" alt="image description"></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<footer class="btn-box">
|
||||
<a href="#single-tab4" class="single-tab btn-install btn-close-box">Install</a>
|
||||
</footer>
|
||||
</div>
|
||||
<div class="b"> </div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" runat="server" value="welcome" id="step" />
|
||||
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -1,273 +0,0 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Data.Common;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using System.IO;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Web.Install;
|
||||
using umbraco.DataLayer;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps
|
||||
{
|
||||
/// <summary>
|
||||
/// Database detection step in the installer wizard.
|
||||
/// </summary>
|
||||
public partial class Database : StepUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns whether the selected database is an embedded database.
|
||||
/// </summary>
|
||||
protected bool IsEmbeddedDatabase
|
||||
{
|
||||
get
|
||||
{
|
||||
var databaseSettings = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName];
|
||||
var configuredDatabaseIsEmbedded = databaseSettings != null && databaseSettings.ProviderName.ToLower().Contains("SqlServerCe".ToLower());
|
||||
|
||||
return Request["database"] == "embedded" || configuredDatabaseIsEmbedded;
|
||||
}
|
||||
}
|
||||
|
||||
protected bool IsConfigured
|
||||
{
|
||||
get { return DatabaseType.SelectedValue != ""; }
|
||||
}
|
||||
|
||||
protected bool IsNewInstall
|
||||
{
|
||||
get
|
||||
{
|
||||
var databaseSettings = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName];
|
||||
if (databaseSettings != null && (
|
||||
databaseSettings.ConnectionString.Trim() == string.Empty
|
||||
&& databaseSettings.ProviderName.Trim() == string.Empty
|
||||
&& GlobalSettings.ConfigurationStatus == string.Empty))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the connection string is set by direct text input.
|
||||
/// </summary>
|
||||
protected bool ManualConnectionString
|
||||
{
|
||||
get { return Request["database"] == "advanced"; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the right panel to the user.
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The event arguments.</param>
|
||||
protected void Page_Load(object sender, System.EventArgs e)
|
||||
{
|
||||
// Does the user have to enter a connection string?
|
||||
if (settings.Visible && !Page.IsPostBack)
|
||||
{
|
||||
//If the connection string is already present in web.config we don't need to show the settings page and we jump to installing/upgrading.
|
||||
var databaseSettings = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName];
|
||||
|
||||
var dbIsSqlCe = false;
|
||||
if(databaseSettings != null && databaseSettings.ProviderName != null)
|
||||
dbIsSqlCe = databaseSettings.ProviderName == "System.Data.SqlServerCe.4.0";
|
||||
var sqlCeDatabaseExists = false;
|
||||
if (dbIsSqlCe)
|
||||
{
|
||||
var datasource = databaseSettings.ConnectionString.Replace("|DataDirectory|", AppDomain.CurrentDomain.GetData("DataDirectory").ToString());
|
||||
var filePath = datasource.Replace("Data Source=", string.Empty);
|
||||
sqlCeDatabaseExists = File.Exists(filePath);
|
||||
}
|
||||
|
||||
// Either the connection details are not fully specified or it's a SQL CE database that doesn't exist yet
|
||||
if (databaseSettings == null
|
||||
|| string.IsNullOrWhiteSpace(databaseSettings.ConnectionString) || string.IsNullOrWhiteSpace(databaseSettings.ProviderName)
|
||||
|| (dbIsSqlCe && sqlCeDatabaseExists == false))
|
||||
{
|
||||
installProgress.Visible = true;
|
||||
upgradeProgress.Visible = false;
|
||||
ShowDatabaseSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
//Since a connection string was present we verify whether this is an upgrade or an empty db
|
||||
var result = ApplicationContext.Current.DatabaseContext.ValidateDatabaseSchema();
|
||||
var determinedVersion = result.DetermineInstalledVersion();
|
||||
if (determinedVersion.Equals(new Version(0, 0, 0)))
|
||||
{
|
||||
//Fresh install
|
||||
installProgress.Visible = true;
|
||||
upgradeProgress.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Upgrade
|
||||
installProgress.Visible = false;
|
||||
upgradeProgress.Visible = true;
|
||||
}
|
||||
|
||||
settings.Visible = false;
|
||||
installing.Visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prepares and shows the database settings panel.
|
||||
/// </summary>
|
||||
protected void ShowDatabaseSettings()
|
||||
{
|
||||
// Parse the connection string
|
||||
var connectionStringBuilder = new DbConnectionStringBuilder();
|
||||
|
||||
var databaseSettings = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName];
|
||||
if (databaseSettings != null && string.IsNullOrWhiteSpace(databaseSettings.ConnectionString) == false)
|
||||
{
|
||||
var dataHelper = DataLayerHelper.CreateSqlHelper(databaseSettings.ConnectionString, false);
|
||||
connectionStringBuilder.ConnectionString = dataHelper.ConnectionString;
|
||||
|
||||
// Prepare data layer type
|
||||
var datalayerType = GetConnectionStringValue(connectionStringBuilder, "datalayer");
|
||||
if (datalayerType.Length > 0)
|
||||
{
|
||||
foreach (ListItem item in DatabaseType.Items)
|
||||
if (item.Value != string.Empty && datalayerType.Contains(item.Value))
|
||||
DatabaseType.SelectedValue = item.Value;
|
||||
}
|
||||
else if (dataHelper.ConnectionString != "server=.\\SQLEXPRESS;database=DATABASE;user id=USER;password=PASS")
|
||||
DatabaseType.SelectedValue = "SqlServer";
|
||||
}
|
||||
else
|
||||
{
|
||||
DatabaseType.SelectedValue = "SqlServer";
|
||||
}
|
||||
|
||||
DatabaseType_SelectedIndexChanged(this, new EventArgs());
|
||||
|
||||
// Prepare other fields
|
||||
DatabaseServer.Text = GetConnectionStringValue(connectionStringBuilder, "server");
|
||||
if (string.IsNullOrEmpty(DatabaseServer.Text)) DatabaseServer.Text = GetConnectionStringValue(connectionStringBuilder, "Data Source");
|
||||
DatabaseName.Text = GetConnectionStringValue(connectionStringBuilder, "database");
|
||||
if (string.IsNullOrEmpty(DatabaseName.Text)) DatabaseName.Text = GetConnectionStringValue(connectionStringBuilder, "Initial Catalog");
|
||||
DatabaseUsername.Text = GetConnectionStringValue(connectionStringBuilder, "user id");
|
||||
DatabasePassword.Text = GetConnectionStringValue(connectionStringBuilder, "password");
|
||||
if (string.IsNullOrEmpty(DatabasePassword.Text)) DatabasePassword.Text = GetConnectionStringValue(connectionStringBuilder, "pwd");
|
||||
|
||||
ToggleVisible(DatabaseServerItem, !ManualConnectionString && !IsEmbeddedDatabase);
|
||||
ToggleVisible(DatabaseUsernameItem, !ManualConnectionString && !IsEmbeddedDatabase);
|
||||
ToggleVisible(DatabasePasswordItem, !ManualConnectionString && !IsEmbeddedDatabase);
|
||||
ToggleVisible(DatabaseNameItem, !ManualConnectionString && !IsEmbeddedDatabase);
|
||||
|
||||
if (IsNewInstall || IsEmbeddedDatabase)
|
||||
dbinit.Text = "$('#databaseOptionEmbedded').click();$('#databaseOptionEmbedded').change();";
|
||||
else if (ManualConnectionString)
|
||||
dbinit.Text = "$('#databaseOptionAdvanced').click();$('#databaseOptionAdvanced').change();";
|
||||
else if (DatabaseType.SelectedValue == "SqlServer")
|
||||
dbinit.Text = "$('#databaseOptionBlank').click();$('#databaseOptionBlank').change();";
|
||||
else if (DatabaseType.SelectedValue == "SqlAzure")
|
||||
dbinit.Text = "$('#databaseOptionBlank').click();$('#databaseOptionBlank').change();";
|
||||
//toggleVisible(DatabaseConnectionString, ManualConnectionString);
|
||||
|
||||
// Make sure ASP.Net displays the password text
|
||||
DatabasePassword.Attributes["value"] = DatabasePassword.Text;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the installation/upgrade panel.
|
||||
/// </summary>
|
||||
protected void SaveDbConfig(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var dbContext = ApplicationContext.Current.DatabaseContext;
|
||||
|
||||
if (string.IsNullOrEmpty(ConnectionString.Text) == false)
|
||||
{
|
||||
dbContext.ConfigureDatabaseConnection(ConnectionString.Text);
|
||||
}
|
||||
else if (IsEmbeddedDatabase)
|
||||
{
|
||||
dbContext.ConfigureEmbeddedDatabaseConnection();
|
||||
}
|
||||
else
|
||||
{
|
||||
var server = DatabaseServer.Text;
|
||||
var databaseName = DatabaseName.Text;
|
||||
|
||||
if (DatabaseType.SelectedValue == "SqlServer" && DatabaseIntegratedSecurity.Checked == true)
|
||||
{
|
||||
dbContext.ConfigureIntegratedSecurityDatabaseConnection(server, databaseName);
|
||||
}
|
||||
else
|
||||
{
|
||||
dbContext.ConfigureDatabaseConnection(server, databaseName,
|
||||
DatabaseUsername.Text, DatabasePassword.Text, DatabaseType.SelectedValue
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error<Database>("Exception was thrown during the setup of the database in 'saveDBConfig'.", ex);
|
||||
}
|
||||
|
||||
settings.Visible = false;
|
||||
installing.Visible = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of the specified item in the connection string.
|
||||
/// </summary>
|
||||
/// <param name="connectionStringBuilder">The connection string.</param>
|
||||
/// <param name="keyword">Name of the item.</param>
|
||||
/// <returns>The value of the item, or an empty string if not found.</returns>
|
||||
protected string GetConnectionStringValue(DbConnectionStringBuilder connectionStringBuilder, string keyword)
|
||||
{
|
||||
object value = null;
|
||||
connectionStringBuilder.TryGetValue(keyword, out value);
|
||||
return (string)value ?? String.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show the needed fields according to the database type.
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="e">The event arguments.</param>
|
||||
protected void DatabaseType_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
ToggleVisible(DatabaseServerItem, !ManualConnectionString && !IsEmbeddedDatabase);
|
||||
ToggleVisible(DatabaseUsernameItem, !ManualConnectionString && !IsEmbeddedDatabase);
|
||||
ToggleVisible(DatabasePasswordItem, !ManualConnectionString && !IsEmbeddedDatabase);
|
||||
ToggleVisible(DatabaseNameItem, !ManualConnectionString && !IsEmbeddedDatabase);
|
||||
|
||||
//toggleVisible(DatabaseConnectionString, ManualConnectionString);
|
||||
}
|
||||
|
||||
private static void ToggleVisible(HtmlGenericControl div, bool visible)
|
||||
{
|
||||
if (!visible)
|
||||
div.Attributes["style"] = "display: none;";
|
||||
else
|
||||
div.Attributes["style"] = "display: block;";
|
||||
}
|
||||
|
||||
protected void GotoSettings(object sender, EventArgs e)
|
||||
{
|
||||
settings.Visible = true;
|
||||
installing.Visible = false;
|
||||
|
||||
ShowDatabaseSettings();
|
||||
|
||||
jsVars.Text = "showDatabaseSettings();";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,249 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps {
|
||||
|
||||
|
||||
public partial class Database {
|
||||
|
||||
/// <summary>
|
||||
/// settings control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder settings;
|
||||
|
||||
/// <summary>
|
||||
/// DatabaseType control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList DatabaseType;
|
||||
|
||||
/// <summary>
|
||||
/// ph_dbError control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder ph_dbError;
|
||||
|
||||
/// <summary>
|
||||
/// lt_dbError control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal lt_dbError;
|
||||
|
||||
/// <summary>
|
||||
/// DatabaseServerItem control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl DatabaseServerItem;
|
||||
|
||||
/// <summary>
|
||||
/// DatabaseServerLabel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label DatabaseServerLabel;
|
||||
|
||||
/// <summary>
|
||||
/// DatabaseServer control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox DatabaseServer;
|
||||
|
||||
/// <summary>
|
||||
/// DatabaseNameItem control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl DatabaseNameItem;
|
||||
|
||||
/// <summary>
|
||||
/// DatabaseNameLabel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label DatabaseNameLabel;
|
||||
|
||||
/// <summary>
|
||||
/// DatabaseName control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox DatabaseName;
|
||||
|
||||
/// <summary>
|
||||
/// DatabaseIntegratedSecurity control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox DatabaseIntegratedSecurity;
|
||||
|
||||
/// <summary>
|
||||
/// DatabaseUsernameItem control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl DatabaseUsernameItem;
|
||||
|
||||
/// <summary>
|
||||
/// DatabaseUsernameLabel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label DatabaseUsernameLabel;
|
||||
|
||||
/// <summary>
|
||||
/// DatabaseUsername control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox DatabaseUsername;
|
||||
|
||||
/// <summary>
|
||||
/// DatabasePasswordItem control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl DatabasePasswordItem;
|
||||
|
||||
/// <summary>
|
||||
/// DatabasePasswordLabel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label DatabasePasswordLabel;
|
||||
|
||||
/// <summary>
|
||||
/// DatabasePassword control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox DatabasePassword;
|
||||
|
||||
/// <summary>
|
||||
/// embeddedFilesMissing control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl embeddedFilesMissing;
|
||||
|
||||
/// <summary>
|
||||
/// DatabaseConnectionString control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl DatabaseConnectionString;
|
||||
|
||||
/// <summary>
|
||||
/// ConnectionStringLabel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label ConnectionStringLabel;
|
||||
|
||||
/// <summary>
|
||||
/// ConnectionString control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox ConnectionString;
|
||||
|
||||
/// <summary>
|
||||
/// jsVars control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal jsVars;
|
||||
|
||||
/// <summary>
|
||||
/// dbinit control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal dbinit;
|
||||
|
||||
/// <summary>
|
||||
/// installing control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder installing;
|
||||
|
||||
/// <summary>
|
||||
/// installProgress control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder installProgress;
|
||||
|
||||
/// <summary>
|
||||
/// upgradeProgress control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder upgradeProgress;
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
using System;
|
||||
using System.Web.Security;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Security;
|
||||
using Umbraco.Web.Install;
|
||||
using Umbraco.Web.Security;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.providers;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for defaultUser.
|
||||
/// </summary>
|
||||
public partial class DefaultUser : StepUserControl
|
||||
{
|
||||
|
||||
protected MembershipProvider CurrentProvider
|
||||
{
|
||||
get
|
||||
{
|
||||
var provider = Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider];
|
||||
if (provider == null)
|
||||
{
|
||||
throw new InvalidOperationException("No MembershipProvider found with name " + UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider);
|
||||
}
|
||||
return provider;
|
||||
}
|
||||
}
|
||||
|
||||
protected void ChangePasswordClick(object sender, EventArgs e)
|
||||
{
|
||||
Page.Validate();
|
||||
|
||||
if (Page.IsValid)
|
||||
{
|
||||
var user = User.GetUser(0);
|
||||
|
||||
var membershipUser = CurrentProvider.GetUser(0, true);
|
||||
if (membershipUser == null)
|
||||
{
|
||||
throw new InvalidOperationException("No user found in membership provider with id of 0");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var success = membershipUser.ChangePassword(user.GetPassword(), tb_password.Text.Trim());
|
||||
if (success == false)
|
||||
{
|
||||
PasswordValidator.IsValid = false;
|
||||
PasswordValidator.ErrorMessage = "Password must be at least " + CurrentProvider.MinRequiredPasswordLength + " characters long and contain at least " + CurrentProvider.MinRequiredNonAlphanumericCharacters + " symbols";
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
PasswordValidator.IsValid = false;
|
||||
PasswordValidator.ErrorMessage = "Password must be at least " + CurrentProvider.MinRequiredPasswordLength + " characters long and contain at least " + CurrentProvider.MinRequiredNonAlphanumericCharacters + " symbols";
|
||||
return;
|
||||
}
|
||||
|
||||
user.Email = tb_email.Text.Trim();
|
||||
user.Name = tb_name.Text.Trim();
|
||||
user.LoginName = tb_login.Text;
|
||||
|
||||
user.Save();
|
||||
|
||||
if (cb_newsletter.Checked)
|
||||
{
|
||||
try
|
||||
{
|
||||
var client = new System.Net.WebClient();
|
||||
var values = new NameValueCollection {{"name", tb_name.Text}, {"email", tb_email.Text}};
|
||||
|
||||
client.UploadValues("http://umbraco.org/base/Ecom/SubmitEmail/installer.aspx", values);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error<DefaultUser>("An error occurred subscribing user to newsletter", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (String.IsNullOrWhiteSpace(GlobalSettings.ConfigurationStatus))
|
||||
UmbracoContext.Current.Security.PerformLogin(user.Id);
|
||||
|
||||
InstallHelper.RedirectToNextStep(Page, GetCurrentStep());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps {
|
||||
|
||||
|
||||
public partial class DefaultUser {
|
||||
|
||||
/// <summary>
|
||||
/// identify control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder identify;
|
||||
|
||||
/// <summary>
|
||||
/// tb_name control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox tb_name;
|
||||
|
||||
/// <summary>
|
||||
/// tb_email control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox tb_email;
|
||||
|
||||
/// <summary>
|
||||
/// tb_login control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox tb_login;
|
||||
|
||||
/// <summary>
|
||||
/// tb_password control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox tb_password;
|
||||
|
||||
/// <summary>
|
||||
/// PasswordValidator control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CustomValidator PasswordValidator;
|
||||
|
||||
/// <summary>
|
||||
/// tb_password_confirm control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox tb_password_confirm;
|
||||
|
||||
/// <summary>
|
||||
/// cb_newsletter control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox cb_newsletter;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Umbraco.Web.Install;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps
|
||||
{
|
||||
public partial class License : StepUserControl
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps {
|
||||
|
||||
|
||||
public partial class License {
|
||||
|
||||
/// <summary>
|
||||
/// btnNext control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnNext;
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using Umbraco.Core.IO;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps
|
||||
{
|
||||
public partial class Renaming : StepUserControl
|
||||
{
|
||||
private readonly string _oldAccessFilePath = IOHelper.MapPath(SystemDirectories.Data + "/access.xml");
|
||||
private readonly string _newAccessFilePath = IOHelper.MapPath(SystemDirectories.Data + "/access.config");
|
||||
private bool _changesNeeded = false;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// check access.xml file
|
||||
identifyResult.Text += CheckAccessFile();
|
||||
|
||||
if (_changesNeeded)
|
||||
{
|
||||
changesNeeded.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
noChangedNeeded.Visible = true;
|
||||
changesNeeded.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private string CheckAccessFile()
|
||||
{
|
||||
if (!NewAccessFileExist() && OldAccessFileExist())
|
||||
{
|
||||
_changesNeeded = true;
|
||||
return "<li>Access.xml found. Needs to be renamed to access.config</li>";
|
||||
}
|
||||
return "<li>Public Access file is all good. No changes needed</li>";
|
||||
}
|
||||
|
||||
private bool OldAccessFileExist()
|
||||
{
|
||||
return File.Exists(_oldAccessFilePath);
|
||||
}
|
||||
|
||||
private bool NewAccessFileExist()
|
||||
{
|
||||
return File.Exists(_newAccessFilePath);
|
||||
}
|
||||
|
||||
protected void UpdateChangesClick(object sender, EventArgs e)
|
||||
{
|
||||
bool succes = true;
|
||||
string progressText = "";
|
||||
|
||||
// rename access file
|
||||
if (OldAccessFileExist())
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Move(_oldAccessFilePath, IOHelper.MapPath(SystemFiles.AccessXml));
|
||||
progressText += String.Format("<li>Public Access file renamed</li>");
|
||||
}
|
||||
catch (Exception ee)
|
||||
{
|
||||
progressText += String.Format("<li>Error renaming access file: {0}</li>", ee.ToString());
|
||||
succes = false;
|
||||
}
|
||||
}
|
||||
|
||||
string resultClass = succes ? "success" : "error";
|
||||
resultText.Text = String.Format("<div class=\"{0}\"><p>{1}</p></div>",
|
||||
resultClass,
|
||||
progressText);
|
||||
result.Visible = true;
|
||||
init.Visible = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps {
|
||||
|
||||
|
||||
public partial class Renaming {
|
||||
|
||||
/// <summary>
|
||||
/// init control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel init;
|
||||
|
||||
/// <summary>
|
||||
/// noChangedNeeded control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel noChangedNeeded;
|
||||
|
||||
/// <summary>
|
||||
/// changesNeeded control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel changesNeeded;
|
||||
|
||||
/// <summary>
|
||||
/// identifyResult control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal identifyResult;
|
||||
|
||||
/// <summary>
|
||||
/// updateChanges control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button updateChanges;
|
||||
|
||||
/// <summary>
|
||||
/// result control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel result;
|
||||
|
||||
/// <summary>
|
||||
/// resultText control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal resultText;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RenderingEngine.ascx.cs" Inherits="Umbraco.Web.UI.Install.Steps.RenderingEngine" %>
|
||||
|
||||
<div class="tab main-tabinfo">
|
||||
<div class="container">
|
||||
<h1>
|
||||
Chose how you like to work with Templates</h1>
|
||||
<p>
|
||||
Umbraco works with both ASP.NET WebForms (also known as MasterPages) and ASP.NET MVC (called Views). If you're not sure, we recommend using the MVC templates. You can of course use both but let's select a default one to get started.
|
||||
</p>
|
||||
</div>
|
||||
<div class="step rendering-engine">
|
||||
<div class="container">
|
||||
<p>
|
||||
<strong>Choose a default template type:</strong>
|
||||
</p>
|
||||
<asp:RadioButtonList runat="server" ID="EngineSelection" RepeatLayout="Flow">
|
||||
<asp:ListItem Selected="True">MVC</asp:ListItem>
|
||||
<asp:ListItem>Web forms</asp:ListItem>
|
||||
</asp:RadioButtonList>
|
||||
</div>
|
||||
</div>
|
||||
<!-- btn box -->
|
||||
<footer class="btn-box">
|
||||
<div class="t"> </div>
|
||||
<asp:LinkButton ID="btnNext" CssClass="btn btn-continue" runat="server" OnClick="GotoNextStep"><span>Continue</span></asp:LinkButton>
|
||||
</footer>
|
||||
</div>
|
||||
@@ -1,22 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Umbraco.Core.Configuration;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps
|
||||
{
|
||||
public partial class RenderingEngine : StepUserControl
|
||||
{
|
||||
protected override void GotoNextStep(object sender, EventArgs e)
|
||||
{
|
||||
////set the default engine
|
||||
//UmbracoSettings.DefaultRenderingEngine = Core.RenderingEngine.Mvc;
|
||||
//UmbracoSettings.Save();
|
||||
|
||||
base.GotoNextStep(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps {
|
||||
|
||||
|
||||
public partial class RenderingEngine {
|
||||
|
||||
/// <summary>
|
||||
/// EngineSelection control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RadioButtonList EngineSelection;
|
||||
|
||||
/// <summary>
|
||||
/// btnNext control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnNext;
|
||||
}
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="StarterKits.ascx.cs" Inherits="Umbraco.Web.UI.Install.Steps.StarterKits" %>
|
||||
|
||||
<!-- Choose starter kit -->
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="udp">
|
||||
<ContentTemplate>
|
||||
|
||||
<script type="text/javascript">
|
||||
var intervalId = 0;
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
jQuery('.zoom-list a.selectStarterKit').click(function () {
|
||||
jQuery('.main-tabinfo').hide();
|
||||
jQuery('#starterkitname').html( jQuery(this).attr("title") );
|
||||
|
||||
jQuery('#single-tab1').show();
|
||||
//fire off the progressbar
|
||||
intervalId = setInterval("progressBarCallback()", 1000);
|
||||
|
||||
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
||||
function pageLoad(sender, args) {
|
||||
if (args.get_isPartialLoad()) {
|
||||
|
||||
clearInterval(intervalId);
|
||||
|
||||
jQuery('#single-tab1').hide();
|
||||
|
||||
initZoomList2();
|
||||
initSlide();
|
||||
|
||||
initLightBox();
|
||||
|
||||
jQuery('.btn-install-gal').click(function () {
|
||||
jQuery('#browseSkins').hide();
|
||||
jQuery('#installingSkin').show();
|
||||
|
||||
//fire off the progressbar
|
||||
intervalId = setInterval("progressBarCallback()", 1000);
|
||||
|
||||
jQuery('#skinname').html( jQuery(this).attr("title") );
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function progressBarCallback() {
|
||||
jQuery.getJSON('InstallerRestService.aspx?feed=progress', function (data) {
|
||||
|
||||
if (data.percentage > 0) {
|
||||
updateProgressBar(data.percentage);
|
||||
updateStatusMessage(data.message);
|
||||
}
|
||||
|
||||
if (data.error != "") {
|
||||
clearInterval(intervalId);
|
||||
updateStatusMessage(data.error);
|
||||
}
|
||||
|
||||
if (data.percentage == 100) {
|
||||
clearInterval(intervalId);
|
||||
jQuery(".btn-box").show();
|
||||
jQuery('.ui-progressbar-value').css("background-image", "url(../umbraco_client/installer/images/pbar.gif)");
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<asp:Placeholder ID="pl_starterKit" Runat="server" Visible="True">
|
||||
<!-- starter box -->
|
||||
<div class="tab main-tabinfo">
|
||||
<div class="container">
|
||||
<h1>Starter kits</h1>
|
||||
<p>To help you get started here are some basic starter kits. They have been tailored to suit common site configurations and install useful functionality.</p>
|
||||
</div>
|
||||
<!-- menu -->
|
||||
<asp:PlaceHolder ID="ph_starterKits" runat="server" />
|
||||
</div>
|
||||
</asp:Placeholder>
|
||||
|
||||
|
||||
<!-- Choose starter kit design -->
|
||||
<asp:Placeholder ID="pl_starterKitDesign" Runat="server" Visible="True">
|
||||
<div class="tab install-tab" id="browseSkins">
|
||||
<div class="container">
|
||||
<h1>Install a Skin</h1>
|
||||
<div class="accept-hold">
|
||||
<p>You can now further enhance your site by choosing one of these great skins. This will apply a default look and feel to all the pages in your site, considerably reducing development time.</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- skins -->
|
||||
<asp:Placeholder ID="ph_starterKitDesigns" runat="server" />
|
||||
</div>
|
||||
</asp:Placeholder>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
<!-- itstall starter kit -->
|
||||
<div class="tab install-tab" id="single-tab1" style="display: none">
|
||||
<div class="container">
|
||||
<h1>Installing Starter Kit</h1>
|
||||
<h2><strong id="starterkitname">Your starter kit</strong> is installing. </h2>
|
||||
<div class="loader alt">
|
||||
<div class="hold">
|
||||
<div class="progress-bar"></div>
|
||||
<span class="progress-bar-value">56%</span>
|
||||
</div>
|
||||
<strong>Starting installation...</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
using System;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Web.Install;
|
||||
using Umbraco.Web.UI.Install.Steps.Skinning;
|
||||
using umbraco.cms.businesslogic.packager;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps
|
||||
{
|
||||
public partial class StarterKits : StepUserControl
|
||||
{
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (InstalledPackage.GetAllInstalledPackages().Count > 0)
|
||||
GotoNextStep(sender, e);
|
||||
|
||||
ShowStarterKits();
|
||||
}
|
||||
|
||||
|
||||
private void ShowStarterKits()
|
||||
{
|
||||
ph_starterKits.Controls.Add(LoadControl(SystemDirectories.Install + "/steps/Skinning/loadStarterKits.ascx"));
|
||||
|
||||
pl_starterKit.Visible = true;
|
||||
pl_starterKitDesign.Visible = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps {
|
||||
|
||||
|
||||
public partial class StarterKits {
|
||||
|
||||
/// <summary>
|
||||
/// udp control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.UpdatePanel udp;
|
||||
|
||||
/// <summary>
|
||||
/// pl_starterKit control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder pl_starterKit;
|
||||
|
||||
/// <summary>
|
||||
/// ph_starterKits control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder ph_starterKits;
|
||||
|
||||
/// <summary>
|
||||
/// pl_starterKitDesign control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder pl_starterKitDesign;
|
||||
|
||||
/// <summary>
|
||||
/// ph_starterKitDesigns control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder ph_starterKitDesigns;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using System.Web.UI;
|
||||
using Umbraco.Web.Install;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps
|
||||
{
|
||||
public abstract class StepUserControl : UserControl
|
||||
{
|
||||
protected string GetCurrentStep()
|
||||
{
|
||||
var defaultPage = (Default) Page;
|
||||
return defaultPage.step.Value;
|
||||
}
|
||||
|
||||
protected virtual void GotoNextStep(object sender, EventArgs e)
|
||||
{
|
||||
InstallHelper.RedirectToNextStep(Page, GetCurrentStep());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using System;
|
||||
using System.Web;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Web.Security;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps
|
||||
{
|
||||
public partial class TheEnd : StepUserControl
|
||||
{
|
||||
protected void Page_Load(object sender, System.EventArgs e)
|
||||
{
|
||||
// Update configurationStatus
|
||||
try
|
||||
{
|
||||
GlobalSettings.ConfigurationStatus = UmbracoVersion.Current.ToString(3);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error<TheEnd>("An error occurred updating the config status", ex);
|
||||
}
|
||||
|
||||
// Update ClientDependency version
|
||||
var clientDependencyConfig = new ClientDependencyConfiguration();
|
||||
var clientDependencyUpdated = clientDependencyConfig.IncreaseVersionNumber();
|
||||
|
||||
//Clear the auth cookie - this is required so that the login screen is displayed after upgrade and so the
|
||||
// csrf anti-forgery tokens are created, otherwise there will just be JS errors if the user has an old
|
||||
// login token from a previous version when we didn't have csrf tokens in place
|
||||
var security = new WebSecurity(new HttpContextWrapper(Context), ApplicationContext.Current);
|
||||
security.ClearCurrentLogin();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps {
|
||||
|
||||
|
||||
public partial class TheEnd {
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UpgradeReport.ascx.cs" Inherits="Umbraco.Web.UI.Install.Steps.UpgradeReport" %>
|
||||
|
||||
<div class="tab main-tabinfo">
|
||||
<div class="container">
|
||||
<h1>Major version upgrade from <%= CurrentVersion %> to <%= NewVersion %></h1>
|
||||
|
||||
<asp:MultiView runat="server" ActiveViewIndex="<%#ToggleView.ActiveViewIndex %>" ID="MultiView1">
|
||||
<asp:View ID="View1" runat="server">
|
||||
<p>
|
||||
This installation step will determine if there are compatibility issues with Property Editors that you have defined in your current installation.
|
||||
</p>
|
||||
</asp:View>
|
||||
<asp:View ID="View2" runat="server">
|
||||
|
||||
<asp:MultiView runat="server" ActiveViewIndex="<%#Report.Any() ? 0 : 1 %>">
|
||||
<asp:View runat="server">
|
||||
<h2>There were <%=Report.Count() %> issues detected</h2>
|
||||
<p>
|
||||
The following compatibility issues were found. If you continue all non-compatible property editors will be converted to a Readonly/Label.
|
||||
You will be able to change the property editor to a compatible type manually by editing the data type after installation.
|
||||
</p>
|
||||
<p>
|
||||
Otherwise if you choose not to proceed you will need to fix the errors listed below.
|
||||
Refer to v<%= NewVersion%> upgrade instructions for full details.
|
||||
</p>
|
||||
</asp:View>
|
||||
<asp:View runat="server">
|
||||
<h2>No issues detected</h2>
|
||||
<p>
|
||||
<strong>Click 'Continue' to proceed with the upgrade</strong>
|
||||
</p>
|
||||
</asp:View>
|
||||
</asp:MultiView>
|
||||
</asp:View>
|
||||
</asp:MultiView>
|
||||
|
||||
</div>
|
||||
<div class="step rendering-engine">
|
||||
<div class="container btn-box">
|
||||
<asp:MultiView runat="server" ActiveViewIndex="0" ID="ToggleView">
|
||||
<asp:View runat="server">
|
||||
<p>
|
||||
<strong>Click 'Continue' to generate the compatibility report</strong>
|
||||
</p>
|
||||
</asp:View>
|
||||
<asp:View runat="server">
|
||||
|
||||
<table class="upgrade-report">
|
||||
<% foreach (var item in Report)
|
||||
{ %>
|
||||
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<span class='<%= item.Item1 ? "ui-state-default ui-icon ui-icon-check" : "ui-state-highlight ui-icon ui-icon-alert" %>'></span>
|
||||
</td>
|
||||
<td class="msg">
|
||||
<%=item.Item2 %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<% } %>
|
||||
</table>
|
||||
</asp:View>
|
||||
</asp:MultiView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- btn box -->
|
||||
<footer class="btn-box">
|
||||
<div class="t"> </div>
|
||||
<asp:LinkButton ID="btnNext" CssClass="btn btn-continue" runat="server" OnClick="NextButtonClick"><span>Continue</span></asp:LinkButton>
|
||||
</footer>
|
||||
</div>
|
||||
@@ -1,96 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps
|
||||
{
|
||||
public partial class UpgradeReport : StepUserControl
|
||||
{
|
||||
protected Version CurrentVersion { get; private set; }
|
||||
protected Version NewVersion { get; private set; }
|
||||
protected IEnumerable<Tuple<bool, string>> Report { get; private set; }
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
|
||||
var result = ApplicationContext.Current.DatabaseContext.ValidateDatabaseSchema();
|
||||
var determinedVersion = result.DetermineInstalledVersion();
|
||||
|
||||
CurrentVersion = determinedVersion;
|
||||
NewVersion = UmbracoVersion.Current;
|
||||
Report = new List<Tuple<bool, string>>();
|
||||
}
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
if (!IsPostBack)
|
||||
{
|
||||
DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
protected void NextButtonClick(object sender, EventArgs e)
|
||||
{
|
||||
if (ToggleView.ActiveViewIndex == 1)
|
||||
{
|
||||
GotoNextStep(sender, e);
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateReport();
|
||||
ToggleView.ActiveViewIndex = 1;
|
||||
DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateReport()
|
||||
{
|
||||
var errorReport = new List<Tuple<bool, string>>();
|
||||
|
||||
var sql = new Sql();
|
||||
sql
|
||||
.Select(
|
||||
SqlSyntaxContext.SqlSyntaxProvider.GetQuotedColumn("cmsDataType", "controlId"),
|
||||
SqlSyntaxContext.SqlSyntaxProvider.GetQuotedColumn("umbracoNode", "text"))
|
||||
.From(SqlSyntaxContext.SqlSyntaxProvider.GetQuotedTableName("cmsDataType"))
|
||||
.InnerJoin(SqlSyntaxContext.SqlSyntaxProvider.GetQuotedTableName("umbracoNode"))
|
||||
.On(
|
||||
SqlSyntaxContext.SqlSyntaxProvider.GetQuotedColumn("cmsDataType", "nodeId") + " = " +
|
||||
SqlSyntaxContext.SqlSyntaxProvider.GetQuotedColumn("umbracoNode", "id"));
|
||||
|
||||
var list = ApplicationContext.Current.DatabaseContext.Database.Fetch<dynamic>(sql);
|
||||
foreach (var item in list)
|
||||
{
|
||||
Guid legacyId = item.controlId;
|
||||
//check for a map entry
|
||||
var alias = LegacyPropertyEditorIdToAliasConverter.GetAliasFromLegacyId(legacyId);
|
||||
if (alias != null)
|
||||
{
|
||||
//check that the new property editor exists with that alias
|
||||
var editor = PropertyEditorResolver.Current.GetByAlias(alias);
|
||||
if (editor == null)
|
||||
{
|
||||
errorReport.Add(new Tuple<bool, string>(false, string.Format("Property Editor with ID '{0}' (assigned to Data Type '{1}') has a valid GUID -> Alias map but no property editor was found. It will be replaced with a Readonly/Label property editor.", item.controlId, item.text)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
errorReport.Add(new Tuple<bool, string>(false, string.Format("Property Editor with ID '{0}' (assigned to Data Type '{1}') does not have a valid GUID -> Alias map. It will be replaced with a Readonly/Label property editor.", item.controlId, item.text)));
|
||||
}
|
||||
}
|
||||
|
||||
Report = errorReport;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps {
|
||||
|
||||
|
||||
public partial class UpgradeReport {
|
||||
|
||||
/// <summary>
|
||||
/// MultiView1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.MultiView MultiView1;
|
||||
|
||||
/// <summary>
|
||||
/// View1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.View View1;
|
||||
|
||||
/// <summary>
|
||||
/// View2 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.View View2;
|
||||
|
||||
/// <summary>
|
||||
/// ToggleView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.MultiView ToggleView;
|
||||
|
||||
/// <summary>
|
||||
/// btnNext control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnNext;
|
||||
}
|
||||
}
|
||||
@@ -1,181 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Web.Install;
|
||||
using umbraco;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps
|
||||
{
|
||||
public partial class ValidatePermissions : StepUserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
var permissionsOk = true;
|
||||
var packageOk = true;
|
||||
var foldersOk = true;
|
||||
var cacheOk = true;
|
||||
var valResult = "";
|
||||
|
||||
// Test default dir permissions
|
||||
foreach (var dir in FilePermissionHelper.PermissionDirs)
|
||||
{
|
||||
var result = SaveAndDeleteFile(IOHelper.MapPath(dir + "/configWizardPermissionTest.txt"));
|
||||
|
||||
if (!result)
|
||||
{
|
||||
permissionsOk = false;
|
||||
permSummary.Text += "<li>Directory: ./" + dir + "</li>";
|
||||
}
|
||||
|
||||
// Print
|
||||
valResult += " " + dir + " : " + SuccessOrFailure(result) + "!<br/>";
|
||||
}
|
||||
|
||||
// Test default file permissions
|
||||
foreach (var file in FilePermissionHelper.PermissionFiles)
|
||||
{
|
||||
var result = OpenFileForWrite(IOHelper.MapPath(file));
|
||||
if (!result)
|
||||
{
|
||||
permissionsOk = false;
|
||||
permSummary.Text += "<li>File: " + file + "</li>";
|
||||
}
|
||||
|
||||
// Print
|
||||
valResult += " " + file + " : " + SuccessOrFailure(result) + "!<br/>";
|
||||
}
|
||||
permissionResults.Text = valResult;
|
||||
|
||||
// Test package dir permissions
|
||||
string packageResult = "";
|
||||
foreach (var dir in FilePermissionHelper.PackagesPermissionsDirs)
|
||||
{
|
||||
var result =
|
||||
SaveAndDeleteFile(IOHelper.MapPath(dir + "/configWizardPermissionTest.txt"));
|
||||
if (!result)
|
||||
{
|
||||
packageOk = false;
|
||||
permSummary.Text += "<li>Directory: " + dir + "</li>";
|
||||
}
|
||||
|
||||
// Print
|
||||
packageResult += " ./" + dir + " : " + SuccessOrFailure(result) + "!<br/>";
|
||||
}
|
||||
packageResults.Text = packageResult;
|
||||
|
||||
// Test umbraco.xml file
|
||||
try
|
||||
{
|
||||
content.Instance.PersistXmlToFile();
|
||||
xmlResult.Text = "Success!";
|
||||
}
|
||||
catch (Exception ee)
|
||||
{
|
||||
cacheOk = false;
|
||||
xmlResult.Text = "Failed!";
|
||||
string tempFile = SystemFiles.ContentCacheXml;
|
||||
|
||||
if (tempFile.Substring(0, 1) == "/")
|
||||
tempFile = tempFile.Substring(1, tempFile.Length - 1);
|
||||
|
||||
permSummary.Text += string.Format("<li>File ./{0}<br/><strong>Error message: </strong>{1}</li>", tempFile, ee);
|
||||
}
|
||||
|
||||
// Test creation of folders
|
||||
try
|
||||
{
|
||||
string tempDir = IOHelper.MapPath(SystemDirectories.Media + "/testCreatedByConfigWizard");
|
||||
Directory.CreateDirectory(tempDir);
|
||||
Directory.Delete(tempDir);
|
||||
foldersResult.Text = "Success!";
|
||||
}
|
||||
catch
|
||||
{
|
||||
foldersOk = false;
|
||||
foldersResult.Text = "Failure!";
|
||||
}
|
||||
|
||||
// update config files
|
||||
if (permissionsOk)
|
||||
{
|
||||
foreach (
|
||||
var configFile in new DirectoryInfo(IOHelper.MapPath(SystemDirectories.Config)).GetFiles("*.xml"))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(configFile.FullName.Replace(".xml", ".config")))
|
||||
File.Delete(configFile.FullName.Replace(".xml", ".config"));
|
||||
|
||||
configFile.MoveTo(configFile.FullName.Replace(".xml", ".config"));
|
||||
}
|
||||
catch { }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Generate summary
|
||||
howtoResolve.Visible = true;
|
||||
if (permissionsOk && cacheOk && packageOk && foldersOk)
|
||||
{
|
||||
perfect.Visible = true;
|
||||
howtoResolve.Visible = false;
|
||||
}
|
||||
else if (permissionsOk && cacheOk && foldersOk)
|
||||
noPackages.Visible = true;
|
||||
else if (permissionsOk && cacheOk)
|
||||
{
|
||||
folderWoes.Visible = true;
|
||||
grant.Visible = false;
|
||||
noFolders.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
error.Visible = true;
|
||||
if (!foldersOk)
|
||||
folderWoes.Visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
private static string SuccessOrFailure(bool result)
|
||||
{
|
||||
return result ? "Success" : "Failure";
|
||||
}
|
||||
|
||||
private static bool SaveAndDeleteFile(string file)
|
||||
{
|
||||
try
|
||||
{
|
||||
//first check if the directory of the file exists, and if not try to create that first.
|
||||
var fi = new FileInfo(file);
|
||||
if (!fi.Directory.Exists)
|
||||
{
|
||||
fi.Directory.Create();
|
||||
}
|
||||
|
||||
File.WriteAllText(file,
|
||||
"This file has been created by the umbraco configuration wizard. It is safe to delete it!");
|
||||
File.Delete(file);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private bool OpenFileForWrite(string file)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.AppendText(file).Close();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,132 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps {
|
||||
|
||||
|
||||
public partial class ValidatePermissions {
|
||||
|
||||
/// <summary>
|
||||
/// perfect control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal perfect;
|
||||
|
||||
/// <summary>
|
||||
/// noPackages control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal noPackages;
|
||||
|
||||
/// <summary>
|
||||
/// noFolders control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal noFolders;
|
||||
|
||||
/// <summary>
|
||||
/// error control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal error;
|
||||
|
||||
/// <summary>
|
||||
/// howtoResolve control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel howtoResolve;
|
||||
|
||||
/// <summary>
|
||||
/// grant control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel grant;
|
||||
|
||||
/// <summary>
|
||||
/// permSummary control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal permSummary;
|
||||
|
||||
/// <summary>
|
||||
/// folderWoes control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel folderWoes;
|
||||
|
||||
/// <summary>
|
||||
/// permissionResults control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal permissionResults;
|
||||
|
||||
/// <summary>
|
||||
/// packageResults control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal packageResults;
|
||||
|
||||
/// <summary>
|
||||
/// xmlResult control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal xmlResult;
|
||||
|
||||
/// <summary>
|
||||
/// foldersResult control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal foldersResult;
|
||||
|
||||
/// <summary>
|
||||
/// btnNext control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnNext;
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
using System;
|
||||
using Umbraco.Core;
|
||||
using umbraco;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps
|
||||
{
|
||||
public partial class Welcome : StepUserControl
|
||||
{
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
//clear the plugin cache when installation starts (just a safety check)
|
||||
PluginManager.Current.ClearPluginCache();
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// Check for config! SD: I've moved this config check above the other stuff since there's no point in doing all that processing if we're
|
||||
// just going to redirect if this setting is true.
|
||||
if (GlobalSettings.Configured)
|
||||
{
|
||||
Response.Redirect(Request.QueryString["url"] ?? "/", true);
|
||||
}
|
||||
|
||||
var result = ApplicationContext.Current.DatabaseContext.ValidateDatabaseSchema();
|
||||
var determinedVersion = result.DetermineInstalledVersion();
|
||||
|
||||
// Display the Umbraco upgrade message if Umbraco is already installed
|
||||
if (string.IsNullOrWhiteSpace(GlobalSettings.ConfigurationStatus) == false || determinedVersion.Equals(new Version(0, 0, 0)) == false)
|
||||
{
|
||||
ph_install.Visible = false;
|
||||
ph_upgrade.Visible = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps {
|
||||
|
||||
|
||||
public partial class Welcome {
|
||||
|
||||
/// <summary>
|
||||
/// ph_install control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder ph_install;
|
||||
|
||||
/// <summary>
|
||||
/// ph_upgrade control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder ph_upgrade;
|
||||
|
||||
/// <summary>
|
||||
/// btnNext control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton btnNext;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user