PageSourceSearch

https://www.officialcatholicdirectory.com/assets/controllers/web.home.register.controller.js

js officialcatholicdirectory.com collected 2026-10-02 12:57:11 UTC 2,856 bytes, 58 lines download raw bytes

1'use strict';
2angular.module('web')
3    .controller('web.home.register.controller', [
4        '$rootScope',
5        '$scope',
6        '$state',
7        '$stateParams',
8        '$location',
9        'SubscriberService',
10        '$localStorage',
11        function($rootScope, $scope, $state, $stateParams, $location, SubscriberService, $localStorage) {
12            $scope.user = new SubscriberService({
13                "directoryId": $rootScope.currentDirectory.directoryId,
14                auth: { secret: localStorage.getItem('NRP-FINGERPRINT') }
15            });
16            $scope.register = function() {
17                $scope.regForm.$setUntouched();
18                $scope.user.$register(function(data) {
19                    var loginPass = [],
20                        printPkg = 0;
21                    for (var i = 0; i < data.email.orders.length; i++) {
22                        if (data.email.orders[i].confirmed.flag == true) {
23                            loginPass.push(data.email.orders[i].package);
24                        }
25                        if (data.email.orders[i].confirmed.flag == true && data.email.orders[i].package == '57a6c362ebba3d886256dba1') {
26                            printPkg += 1;
27                        }
28                    }
29                    if (loginPass.length == printPkg) {
30                        $localStorage['NRP-USER-TOKEN'] = data.token;
31                        $localStorage['PKG'] = "57a6c362ebba3d886256dba1";
32                        $state.go('core.profile');
33                    } else {
34                        $localStorage['NRP-USER-TOKEN'] = data.token;
35                        if (data.requestPasswordChange)
36                            $state.go('core.profile', { requestPasswordChange: true, navigateTo: '#change-pass-div' }, { reload: true });
37                        else
38                            $state.go('core.search', { navigateTo: '#search', navigatePosition: 50 }, { reload: true });
39                    }
40                    showMessages([{
41                        header: 'Sign Up',
42                        type: 'success',
43                        message: 'Sign Up Successful!'
44                    }]);
45                    $localStorage['NRP-USER-TOKEN'] = data.token;
46                    $state.go('core.search', { navigateTo: '#search', navigatePosition: 50 }, { reload: true });
47                }, function(error) {
48                    console.log('Reg. error', error);
49                    var msg = error && error.data ? error.data.message : false;
50                    showMessages([{
51                        header: 'Sign Up',
52                        type: 'error',
53                        message: (msg || 'Could not Sign Up successfully!')
54                    }]);
55                })
56            };
57        }
58    ])

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.