+
+ user: function() {
+ if ($.isEmptyObject(this.user)) {
+ //this.login(function() { return this.user; });
+ if(localStorage.getItem('user')!='undefined'){
+ this.user = JSON.parse(localStorage.getItem('user'));
+ }else{
+ return false;
+ }
+ }
+ return this.user;
+ },
+
+ login: function(fn) {
+ user = localStorage.getItem('user');
+ if($.isEmptyObject(user)){
+ $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
+ //myslice.user = new user(data[0]);
+ localStorage.setItem('user', JSON.stringify(data[0]));
+ });
+ }
+ },
+