Advertisement
Guest User

Untitled

a guest
Jan 12th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     login: {
  2.         app:false,
  3.         init: function(){
  4.             if(page.login.app) {
  5.                 $('#application').html(page.login.app.html());
  6.             } else {
  7.                 page.login.app = new LoginApp({
  8.                     target:'#application',
  9.                     email:false,
  10.                     icon:true,
  11.                     event: function(){
  12.                         var data = $('#loginform').serializeObject();
  13.                         rpc.auth.simpleLogin({
  14.                             project:'project',
  15.                             username:data.username,
  16.                             password:data.password
  17.                         }, function(response){
  18.                             ui.loading('#application');
  19.                             user.prefs = new Preferences({
  20.                                 accessToken:response.result.accessToken,
  21.                                 refreshToken:response.result.refreshToken,
  22.                                 userProjects:response.result.userProjects,
  23.                                 selectedProject:response.result.selectedProject
  24.                             });
  25.                             user.setup(function(){
  26.                                 application.setup(function(){
  27.                                     page.data({
  28.                                         view:'home'
  29.                                     });
  30.                                 });
  31.                                 /*page.admin.getSettings(function(response){                   
  32.                                     application.settings = response;
  33.                                     rpc.record.getRecordTypes(function(response){
  34.                                         application.globalSettings.recordTypes = response.result;
  35.                                         var authorizedRecordTypes = {};
  36.                                         $.each(application.settings, function(type, val){
  37.                                             if (val.readPermissions.indexOf(user.groupName) !== -1 || user.groupName == 'admin'){
  38.                                                 authorizedRecordTypes[type] = response.result[type];
  39.                                             }
  40.                                         });
  41.                                         application.recordTypes = authorizedRecordTypes;
  42.                                         page.data({
  43.                                             view:'home'
  44.                                         });
  45.                                     });
  46.                                     QueueManager.init();
  47.                                 });*/
  48.                             });
  49.                         });
  50.                     },
  51.                     forgot: function(){
  52.                        
  53.                     }
  54.                 });
  55.             }
  56.         }
  57.     },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement