fix(torrents): reomve redundant login check code

This commit is contained in:
OldHawk
2017-10-22 21:40:24 +08:00
parent 36deb6e3a4
commit a16793e2fd
30 changed files with 8 additions and 193 deletions

View File

@@ -50,11 +50,6 @@
* init all event bundle
*/
function init() {
// If user is not signed in then redirect back home
if (!Authentication.user) {
$state.go('authentication.signin');
}
registerCallback();
// Make sure the Socket is connected

View File

@@ -42,13 +42,6 @@
});
});
/**
* If user is not signed in then redirect back signin
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* initTopOneInfo
*/

View File

@@ -15,13 +15,6 @@
vm.user = Authentication.user;
vm.forumPath = [];
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* init
*/

View File

@@ -23,13 +23,6 @@
vm.forumPath = [];
vm.postReplyFields = {};
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* buildPager
* pagination init

View File

@@ -16,13 +16,6 @@
vm.user = Authentication.user;
vm.forumPath = [];
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* buildPager
* pagination init

View File

@@ -14,13 +14,6 @@
vm.forumsConfig = MeanTorrentConfig.meanTorrentConfig.forumsConfig;
vm.user = Authentication.user;
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* init
*/

View File

@@ -14,7 +14,10 @@
.state('invitations', {
abstract: true,
url: '/invitations',
template: '<ui-view/>'
template: '<ui-view/>',
data: {
roles: ['user', 'oper', 'admin']
}
})
.state('invitations.detail', {
url: '/detail',

View File

@@ -21,13 +21,6 @@
templateUrl: 'userinfo.html'
};
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* buildPager
*/

View File

@@ -26,13 +26,6 @@
templateUrl: 'userinfo.html'
};
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* user-invitations-changed
*/

View File

@@ -14,7 +14,10 @@
.state('messages', {
abstract: true,
url: '/messages',
templateUrl: '/modules/messages/client/views/messages.client.view.html'
templateUrl: '/modules/messages/client/views/messages.client.view.html',
data: {
roles: ['user', 'oper', 'admin']
}
})
.state('messages.box', {
url: '/box',

View File

@@ -15,13 +15,6 @@
vm.user = Authentication.user;
vm.messageType = 'system';
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* sendMessage
* @param isValid

View File

@@ -16,13 +16,6 @@
vm.messageFields = {};
vm.deleteList = [];
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* user-unread-count-changed
*/

View File

@@ -33,13 +33,6 @@
vm.torrentStatus = 'reviewed';
vm.torrentRLevel = 'none';
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* commentBuildPager
* pagination init

View File

@@ -16,11 +16,6 @@
vm.announceConfig = MeanTorrentConfig.meanTorrentConfig.announce;
vm.comment = vm.announceConfig.comment;
// If user is not signed in then redirect back home
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* upload
* @param dataUrl

View File

@@ -33,13 +33,6 @@
vm.searchTags = [];
vm.progress = 0;
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* commentBuildPager
* pagination init

View File

@@ -29,13 +29,6 @@
vm.torrentType = $state.current.data.torrentType;
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* commentBuildPager
* pagination init

View File

@@ -25,11 +25,6 @@
vm.videoNfo = '';
vm.customTorrent = {};
// If user is not signed in then redirect back home
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* upload
* @param dataUrl

View File

@@ -13,13 +13,6 @@
var vm = this;
vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage;
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* buildPager
* pagination init

View File

@@ -19,13 +19,6 @@
vm.searchTags = [];
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* buildPager
*/

View File

@@ -19,13 +19,6 @@
vm.searchTags = [];
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* buildPager
*/

View File

@@ -19,13 +19,6 @@
vm.searchTags = [];
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* buildPager
*/

View File

@@ -20,13 +20,6 @@
vm.searchTags = [];
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* getUserWarningTorrent
*/

View File

@@ -16,13 +16,6 @@
vm.lang = getStorageLangService.getLang();
vm.user = Authentication.user;
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* auth-user-changed
*/

View File

@@ -9,16 +9,8 @@
function ResetPasskeyController($scope, $state, $translate, Authentication, UsersService, Notification, ModalConfirmService) {
var vm = this;
vm.user = Authentication.user;
/**
* If user is not signed in then redirect back home
*/
if (!vm.user) {
$state.go('authentication.signin');
}
vm.resetPasskey = function () {
var modalOptions = {
closeButtonText: $translate.instant('RESET_PASSKEY_CONFIRM_CANCEL'),

View File

@@ -19,13 +19,6 @@
vm.searchTags = [];
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* buildPager
*/

View File

@@ -19,13 +19,6 @@
vm.searchTags = [];
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* buildPager
*/

View File

@@ -13,12 +13,5 @@
vm.scoreLevelData = ScoreLevelService.getScoreLevelJson(vm.user.score);
vm.announce = MeanTorrentConfig.meanTorrentConfig.announce;
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
}
}());

View File

@@ -19,13 +19,6 @@
vm.searchTags = [];
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* buildPager
*/

View File

@@ -22,13 +22,6 @@
vm.searchTags = [];
/**
* If user is not signed in then redirect back home
*/
if (!Authentication.user) {
$state.go('authentication.signin');
}
/**
* getWarningTorrent
*/

View File

@@ -24,13 +24,6 @@
uibButtonConfig.activeClass = 'btn-success';
///**
// * If user is not signed in then redirect back home
// */
//if (!Authentication.user) {
// $state.go('authentication.signin');
//}
/**
* buildPager
*/