fixes: non-configured install doesnt redirect
Adds install info to servervars, adds information to login screen about going to the installer
This commit is contained in:
@@ -105,6 +105,8 @@ angular.module('umbraco.services')
|
||||
|
||||
/** Called to update the current user's timeout */
|
||||
function setUserTimeoutInternal(newTimeout) {
|
||||
|
||||
|
||||
var asNumber = parseFloat(newTimeout);
|
||||
if (!isNaN(asNumber) && currentUser && angular.isNumber(asNumber)) {
|
||||
currentUser.remainingAuthSeconds = newTimeout;
|
||||
@@ -118,7 +120,11 @@ angular.module('umbraco.services')
|
||||
if (currentUser && currentUser.id !== undefined) {
|
||||
lastUserId = currentUser.id;
|
||||
}
|
||||
currentUser.remainingAuthSeconds = 0;
|
||||
|
||||
if(currentUser){
|
||||
currentUser.remainingAuthSeconds = 0;
|
||||
}
|
||||
|
||||
lastServerTimeoutSet = null;
|
||||
currentUser = null;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
angular.module("umbraco").controller("Umbraco.Dialogs.LoginController", function ($scope, userService, legacyJsLoader, $routeParams) {
|
||||
angular.module("umbraco").controller("Umbraco.Dialogs.LoginController", function ($scope, userService, legacyJsLoader, $routeParams, $window) {
|
||||
|
||||
/**
|
||||
* @ngdoc function
|
||||
@@ -15,6 +15,11 @@
|
||||
$scope.today = weekday[d.getDay()];
|
||||
$scope.errorMsg = "";
|
||||
|
||||
//this means the application is not configured and needs the installer
|
||||
if(!Umbraco.Sys.ServerVariables.application){
|
||||
$scope.missingConfiguration = true;
|
||||
}
|
||||
|
||||
$scope.loginSubmit = function (login, password) {
|
||||
|
||||
//if the login and password are not empty we need to automatically
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
<form name="loginForm" ng-submit="loginSubmit(login, password)" ng-controller="Umbraco.Dialogs.LoginController">
|
||||
<div id="login" class="umb-modalcolumn" ng-class="{'show-validation': loginForm.$invalid}">
|
||||
<div class="form">
|
||||
|
||||
<div class="form" ng-show="missingConfiguration">
|
||||
<h1>Umbraco has not yet been installed,
|
||||
or you need to perform an upgrade.
|
||||
Please open the umbraco installer
|
||||
</h1>
|
||||
|
||||
<a href="../install" class="btn">Open installer</a>
|
||||
</div>
|
||||
|
||||
<div class="form" ng-hide="missingConfiguration">
|
||||
<h1>Happy {{today}}!</h1>
|
||||
<p><span ng-show="dialogData.isTimedOut">Session timed out. </span>Log in below</p>
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ angular.module("umbraco")
|
||||
|
||||
$scope.user = userService.getCurrentUser();
|
||||
$scope.history = historyService.current;
|
||||
$scope.version = Umbraco.Sys.ServerVariables.application.version + " assembly: " + Umbraco.Sys.ServerVariables.application.assemblyVersion;
|
||||
|
||||
|
||||
$scope.logout = function () {
|
||||
userService.logout().then(function () {
|
||||
|
||||
@@ -44,5 +44,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<small style="color: #d9d9d9; position: absolute; bottom: 5px; right: 20px">{{version}}</small>
|
||||
</div>
|
||||
</div>
|
||||
@@ -180,12 +180,36 @@ namespace Umbraco.Web.Editors
|
||||
{"trees", GetTreePluginsMetaData()}
|
||||
}
|
||||
},
|
||||
{"isDebuggingEnabled", HttpContext.IsDebuggingEnabled}
|
||||
{"isDebuggingEnabled", HttpContext.IsDebuggingEnabled},
|
||||
{
|
||||
"application", getApplicationState()
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return JavaScript(ServerVariablesParser.Parse(d));
|
||||
}
|
||||
|
||||
|
||||
private Dictionary<string, object> getApplicationState()
|
||||
{
|
||||
if (!ApplicationContext.IsConfigured)
|
||||
return null;
|
||||
|
||||
var app = new Dictionary<string, object>();
|
||||
app.Add("assemblyVersion", UmbracoVersion.AssemblyVersion);
|
||||
app.Add("isReady", ApplicationContext.IsReady);
|
||||
app.Add("isConfigured", ApplicationContext.IsConfigured);
|
||||
app.Add("isDatabaseConfigured", ApplicationContext.DatabaseContext.IsDatabaseConfigured);
|
||||
|
||||
var version = string.IsNullOrEmpty(UmbracoVersion.CurrentComment)
|
||||
? UmbracoVersion.Current.ToString(3)
|
||||
: string.Format("{0}-{1}", UmbracoVersion.Current.ToString(3), UmbracoVersion.CurrentComment);
|
||||
|
||||
app.Add("version", version);
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
|
||||
private IEnumerable<Dictionary<string, string>> GetTreePluginsMetaData()
|
||||
|
||||
Reference in New Issue
Block a user