mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-21 15:54:22 +01:00
(bug) hide create account links when public registrations disabled
This commit is contained in:
parent
838dbc85af
commit
931e19b331
@ -8,6 +8,7 @@
|
|||||||
- Fix a bug: OIDC scopes are separated by spaces, not commas
|
- Fix a bug: OIDC scopes are separated by spaces, not commas
|
||||||
- Fix a bug: unable to create OIDC custom scopes
|
- Fix a bug: unable to create OIDC custom scopes
|
||||||
- Fix a bug: enable admins to be invited to collaborate on projects
|
- Fix a bug: enable admins to be invited to collaborate on projects
|
||||||
|
- Fix a bug: hide some links to create an account if public registrations is disabled
|
||||||
- Fix a security issue: updated rack to 2.2.3.1 to fix [CVE-2022-30123](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30123) and [CVE-2022-30122](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30122)
|
- Fix a security issue: updated rack to 2.2.3.1 to fix [CVE-2022-30123](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30123) and [CVE-2022-30122](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30122)
|
||||||
|
|
||||||
|
|
||||||
|
@ -432,7 +432,7 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco
|
|||||||
size: 'sm',
|
size: 'sm',
|
||||||
resolve: {
|
resolve: {
|
||||||
settingsPromise: ['Setting', function (Setting) {
|
settingsPromise: ['Setting', function (Setting) {
|
||||||
return Setting.query({ names: "['confirmation_required']" }).$promise;
|
return Setting.query({ names: "['confirmation_required', 'public_registrations']" }).$promise;
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
controller: ['$scope', '$uibModalInstance', '_t', 'settingsPromise', function ($scope, $uibModalInstance, _t, settingsPromise) {
|
controller: ['$scope', '$uibModalInstance', '_t', 'settingsPromise', function ($scope, $uibModalInstance, _t, settingsPromise) {
|
||||||
@ -441,6 +441,9 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco
|
|||||||
// email confirmation required before user sign-in?
|
// email confirmation required before user sign-in?
|
||||||
$scope.confirmationRequired = settingsPromise.confirmation_required;
|
$scope.confirmationRequired = settingsPromise.confirmation_required;
|
||||||
|
|
||||||
|
// is public registrations allowed?
|
||||||
|
$scope.publicRegistrations = (settingsPromise.public_registrations !== 'false');
|
||||||
|
|
||||||
$scope.login = function () {
|
$scope.login = function () {
|
||||||
Auth.login(user).then(function (user) {
|
Auth.login(user).then(function (user) {
|
||||||
// Authentication succeeded ...
|
// Authentication succeeded ...
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
Application.Directives.directive('members', ['Member',
|
Application.Directives.directive('members', ['Member', 'Setting',
|
||||||
function (Member) {
|
function (Member, Setting) {
|
||||||
return ({
|
return ({
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
|
resolve: {
|
||||||
|
settingsPromise: ['Setting', function (Setting) {
|
||||||
|
return Setting.query({ names: "['public_registrations']" }).$promise;
|
||||||
|
}]
|
||||||
|
},
|
||||||
templateUrl: '/home/members.html',
|
templateUrl: '/home/members.html',
|
||||||
link ($scope, element, attributes) {
|
link ($scope, element, attributes) {
|
||||||
// The last registered members who confirmed their addresses
|
// The last registered members who confirmed their addresses
|
||||||
@ -12,6 +17,10 @@ Application.Directives.directive('members', ['Member',
|
|||||||
Member.lastSubscribed({ limit: 4 }, function (data) {
|
Member.lastSubscribed({ limit: 4 }, function (data) {
|
||||||
$scope.lastMembers = data;
|
$scope.lastMembers = data;
|
||||||
});
|
});
|
||||||
|
Setting.query({ names: "['public_registrations']" }, function (data) {
|
||||||
|
// is public registrations allowed?
|
||||||
|
$scope.publicRegistrations = (data.public_registrations !== 'false');
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// !!! MUST BE CALLED AT THE END of the directive
|
// !!! MUST BE CALLED AT THE END of the directive
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="m-t-sm m-b-sm text-center" ng-if="!isAuthenticated()">
|
<div class="m-t-sm m-b-sm text-center" ng-if="!isAuthenticated()" ng-show="publicRegistrations">
|
||||||
<button ng-click="signup($event)" class="btn btn-warning-full width-70 font-sbold rounded text-sm" translate>{{ 'app.public.home.create_an_account' }}</button>
|
<button ng-click="signup($event)" class="btn btn-warning-full width-70 font-sbold rounded text-sm" translate>{{ 'app.public.home.create_an_account' }}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
<button class="btn btn-valid btn-warning btn-block p-l btn-lg text-u-c r-b" ng-click="login()" ng-disabled="loginForm.$invalid" translate translate-default="OK">{{ 'app.shared.buttons.confirm' }}</button>
|
<button class="btn btn-valid btn-warning btn-block p-l btn-lg text-u-c r-b" ng-click="login()" ng-disabled="loginForm.$invalid" translate translate-default="OK">{{ 'app.shared.buttons.confirm' }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-center font-sbold">
|
<p class="text-center font-sbold" ng-show="publicRegistrations">
|
||||||
<span translate translate-default="Not registered?">{{ 'app.public.common.not_registered_to_the_fablab' }}</span>
|
<span translate translate-default="Not registered?">{{ 'app.public.common.not_registered_to_the_fablab' }}</span>
|
||||||
<br/>
|
<br/>
|
||||||
<a ng-click="openSignup($event)" class="text-u-l" translate translate-default="Create an account">{{ 'app.public.common.create_an_account' }}</a></br>
|
<a ng-click="openSignup($event)" class="text-u-l" translate translate-default="Create an account">{{ 'app.public.common.create_an_account' }}</a></br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user