diff --git a/UI/WebServerResources/js/Administration.js b/UI/WebServerResources/js/Administration.js index 30d5b76c3..d703fbac3 100644 --- a/UI/WebServerResources/js/Administration.js +++ b/UI/WebServerResources/js/Administration.js @@ -1,2 +1,2 @@ -!function(){"use strict";function e(e,n){e.state("administration",{abstract:!0,views:{administration:{templateUrl:"administration.html",controller:"AdministrationController",controllerAs:"app"}}}).state("administration.rights",{url:"/rights",views:{module:{templateUrl:"rights.html"}}}).state("administration.rights.edit",{url:"/:userId/:folderId/edit",views:{acl:{templateUrl:"UIxAdministrationAclEditor",controller:"AdministrationAclController",controllerAs:"acl"}},resolve:{stateUser:t,stateFolder:r}}),n.otherwise("/rights")}function t(e,t,r){var n;return n=_.find(r.$users,function(e){return e.uid==t.userId}),angular.isUndefined(n)?r.$filter(t.userId).then(function(s){return n=_.find(r.$users,function(e){return e.uid==t.userId}),angular.isUndefined(n)?e.reject("User with ID "+t.userId+" not found"):n.$folders().then(function(){return n})}):n}function r(e,t,r,n,s,i){var o,d,l=r(t.folderId);return o=_.find(n.$$folders,function(e){return e.name==l}),d="Appointment"==o.type?new i({id:o.name.split("/").pop(),owner:o.owner,name:o.displayName}):new s({id:o.name.split("/").pop(),owner:o.owner,name:o.displayName}),n.selectedFolder=d.id,d}function n(e,t,r){t.$on("$stateChangeError",function(t,n,s,i,o,d){e.error(d),r.go("administration.rights")}),t.$on("$routeChangeError",function(t,r,n,s){e.error(t,r,n,s)})}angular.module("SOGo.AdministrationUI",["ui.router","SOGo.Common","SOGo.Authentication","SOGo.PreferencesUI","SOGo.ContactsUI","SOGo.SchedulerUI"]).config(e).run(n),e.$inject=["$stateProvider","$urlRouterProvider"],t.$inject=["$q","$stateParams","User"],r.$inject=["$state","$stateParams","decodeUriFilter","stateUser","AddressBook","Calendar"],n.$inject=["$log","$rootScope","$state"]}(),function(){"use strict";function e(e,t,r,n,s,i,o){function d(e,t){if(t&&t.target.parentNode.classList.contains("md-secondary"))return!1;u.selectedUid==e.uid?u.selectedUid=null:(u.selectedUid=e.uid,u.selectedUser=e,u.selectedUser.$rights())}function a(){t.go("administration.rights").then(function(){delete u.user.selectedFolder,u.user=null})}var u=this;u.user=s,u.folder=i,u.folderType=angular.isDefined(i.$cards)?"AddressBook":"Calendar",u.selectedUser=null,u.selectedUid=null,u.selectUser=d,u.selectAllRights=function(e){i.$acl.$selectAllRights(e)},u.showRights=function(e){return u.selectedUid==e.uid&&e.rights},u.removeUser=function(t){e(function(){i.$acl.$removeUser(t.uid,i.owner)},500)},u.getTemplate=function(){return angular.isDefined(i.$cards)?"../"+i.owner+"/Contacts/"+i.id+"/UIxContactsUserRightsEditor":"../"+i.owner+"/Calendar/"+i.id+"/UIxCalUserRightsEditor"},u.close=a,u.save=function(){i.$acl.$saveUsersRights(i.owner).then(function(){n.show(n.simple().content(l("ACLs saved")).position("bottom right").hideDelay(3e3)),r("xs")&&a()})},u.userToAdd="",u.searchText="",u.userFilter=function(e){return o.$filter(e,i.$acl.users,{dry:!0,uid:u.user.uid})},u.addUser=function(e){e&&i.$acl.$addUser(e,i.owner).then(function(e){u.userToAdd="",u.searchText="",u.selectedUid=null,e&&d(e)})},i.$acl.$users(i.owner).then(function(e){u.users=e})}e.$inject=["$timeout","$state","$mdMedia","$mdToast","stateUser","stateFolder","User"],angular.module("SOGo.AdministrationUI").controller("AdministrationAclController",e)}(),function(){"use strict";function e(e,t,r,n,s,i,o,d){var l=this;l.service=d,l.selectedUser=null,l.users=d.$users,l.go=function(t){e.go("administration."+t),r(s["gt-md"])||n("left").close()},l.filter=function(e){d.$filter(e)},l.selectUser=function(e){l.selectedUser==l.users[e]?l.selectedUser=null:l.users[e].$folders().then(function(){l.selectedUser=l.users[e]})},l.selectFolder=function(t){e.go("administration.rights.edit",{userId:l.selectedUser.uid,folderId:o(t.name)})}}e.$inject=["$state","$mdToast","$mdMedia","$mdSidenav","sgConstant","Dialog","encodeUriFilter","User"],angular.module("SOGo.AdministrationUI").controller("AdministrationController",e)}(); +!function(){"use strict";angular.module("SOGo.AdministrationUI",["ui.router","SOGo.Common","SOGo.Authentication","SOGo.PreferencesUI","SOGo.ContactsUI","SOGo.SchedulerUI"]).config(e).run(n),e.$inject=["$stateProvider","$urlRouterProvider"];function e(e,n){e.state("administration",{abstract:!0,views:{administration:{templateUrl:"administration.html",controller:"AdministrationController",controllerAs:"app"}}}).state("administration.rights",{url:"/rights",views:{module:{templateUrl:"rights.html"}}}).state("administration.rights.edit",{url:"/:userId/:folderId/edit",views:{acl:{templateUrl:"UIxAdministrationAclEditor",controller:"AdministrationAclController",controllerAs:"acl"}},resolve:{stateUser:t,stateFolder:r}}),n.otherwise("/rights")}t.$inject=["$q","$stateParams","User"];function t(e,t,r){var n;return n=_.find(r.$users,function(e){return e.uid==t.userId}),angular.isUndefined(n)?r.$filter(t.userId).then(function(s){return n=_.find(r.$users,function(e){return e.uid==t.userId}),angular.isUndefined(n)?e.reject("User with ID "+t.userId+" not found"):n.$folders().then(function(){return n})}):n}r.$inject=["$state","$stateParams","decodeUriFilter","stateUser","AddressBook","Calendar"];function r(e,t,r,n,s,i){var o,d,l=r(t.folderId);return d="Appointment"==(o=_.find(n.$$folders,function(e){return e.name==l})).type?new i({id:o.name.split("/").pop(),owner:o.owner,name:o.displayName}):new s({id:o.name.split("/").pop(),owner:o.owner,name:o.displayName}),n.selectedFolder=d.id,d}n.$inject=["$log","$rootScope","$state"];function n(e,t,r){t.$on("$stateChangeError",function(t,n,s,i,o,d){e.error(d),r.go("administration.rights")}),t.$on("$routeChangeError",function(t,r,n,s){e.error(t,r,n,s)})}}(),function(){"use strict";e.$inject=["$timeout","$state","$mdMedia","$mdToast","stateUser","stateFolder","User"];function e(e,t,r,n,s,i,o){var d=this;d.user=s,d.folder=i,d.folderType=angular.isDefined(i.$cards)?"AddressBook":"Calendar",d.selectedUser=null,d.selectedUid=null,d.selectUser=a,d.selectAllRights=function(e){i.$acl.$selectAllRights(e)},d.showRights=function(e){return d.selectedUid==e.uid&&e.rights},d.removeUser=function(t){e(function(){i.$acl.$removeUser(t.uid,i.owner)},500)},d.getTemplate=function(){return angular.isDefined(i.$cards)?"../"+i.owner+"/Contacts/"+i.id+"/UIxContactsUserRightsEditor":"../"+i.owner+"/Calendar/"+i.id+"/UIxCalUserRightsEditor"},d.close=u,d.save=function(){i.$acl.$saveUsersRights(i.owner).then(function(){n.show(n.simple().content(l("ACLs saved")).position("bottom right").hideDelay(3e3)),r("xs")&&u()})},d.userToAdd="",d.searchText="",d.userFilter=function(e){return o.$filter(e,i.$acl.users,{dry:!0,uid:d.user.uid})},d.addUser=function(e){e&&i.$acl.$addUser(e,i.owner).then(function(e){d.userToAdd="",d.searchText="",d.selectedUid=null,e&&a(e)})},i.$acl.$users(i.owner).then(function(e){d.users=e});function a(e,t){if(t&&t.target.parentNode.classList.contains("md-secondary"))return!1;d.selectedUid==e.uid?d.selectedUid=null:(d.selectedUid=e.uid,d.selectedUser=e,d.selectedUser.$rights())}function u(){t.go("administration.rights").then(function(){delete d.user.selectedFolder,d.user=null})}}angular.module("SOGo.AdministrationUI").controller("AdministrationAclController",e)}(),function(){"use strict";e.$inject=["$state","$mdToast","$mdMedia","$mdSidenav","sgConstant","Dialog","encodeUriFilter","User"];function e(e,t,r,n,s,i,o,d){var l=this;l.service=d,l.selectedUser=null,l.users=d.$users,l.go=function(t){e.go("administration."+t),r(s["gt-md"])||n("left").close()},l.filter=function(e){d.$filter(e)},l.selectUser=function(e){l.selectedUser==l.users[e]?l.selectedUser=null:l.users[e].$folders().then(function(){l.selectedUser=l.users[e]})},l.selectFolder=function(t){e.go("administration.rights.edit",{userId:l.selectedUser.uid,folderId:o(t.name)})}}angular.module("SOGo.AdministrationUI").controller("AdministrationController",e)}(); //# sourceMappingURL=Administration.js.map \ No newline at end of file diff --git a/UI/WebServerResources/js/Administration.js.map b/UI/WebServerResources/js/Administration.js.map index 3bec627d5..f3740495d 100644 --- a/UI/WebServerResources/js/Administration.js.map +++ b/UI/WebServerResources/js/Administration.js.map @@ -1 +1 @@ -{"version":3,"sources":["Administration/Administration.app.js","Administration/AdministrationAclController.js","Administration/AdministrationController.js"],"names":["configure","$stateProvider","$urlRouterProvider","state","abstract","views","administration","templateUrl","controller","controllerAs","url","module","acl","resolve","stateUser","stateFolder","otherwise","$q","$stateParams","User","user","_","find","$users","uid","userId","angular","isUndefined","$filter","then","users","reject","$folders","$state","decodeUriFilter","AddressBook","Calendar","folder","o","folderId","$$folders","name","type","id","split","pop","owner","displayName","selectedFolder","runBlock","$log","$rootScope","$on","event","toState","toParams","fromState","fromParams","error","go","current","previous","rejection","config","run","$inject","AdministrationAclController","$timeout","$mdMedia","$mdToast","selectUser","$event","target","parentNode","classList","contains","vm","selectedUid","selectedUser","$rights","close","this","folderType","isDefined","$cards","selectAllRights","$acl","$selectAllRights","showRights","rights","removeUser","$removeUser","getTemplate","save","$saveUsersRights","show","simple","content","l","position","hideDelay","userToAdd","searchText","userFilter","$query","dry","addUser","data","$addUser","AdministrationController","$mdSidenav","sgConstant","Dialog","encodeUriFilter","service","filter","i","selectFolder"],"mappings":"CAGA,WACE,aAUA,SAASA,EAAUC,EAAgBC,GACjCD,EACGE,MAAM,kBACLC,UAAU,EACVC,OACEC,gBACEC,YAAa,sBACbC,WAAY,2BACZC,aAAc,UAInBN,MAAM,yBACLO,IAAK,UACLL,OACEM,QACEJ,YAAa,kBAIlBJ,MAAM,8BACLO,IAAK,0BACLL,OACEO,KACEL,YAAa,6BACbC,WAAY,8BACZC,aAAc,QAGlBI,SACEC,UAAWA,EACXC,YAAaA,KAKnBb,EAAmBc,UAAU,WAO/B,SAASF,EAAUG,EAAIC,EAAcC,GACnC,IAAIC,EAMJ,OAJAA,EAAOC,EAAEC,KAAKH,EAAKI,OAAQ,SAASH,GAClC,OAAOA,EAAKI,KAAON,EAAaO,SAG9BC,QAAQC,YAAYP,GACfD,EAAKS,QAAQV,EAAaO,QAAQI,KAAK,SAASC,GAIrD,OAHAV,EAAOC,EAAEC,KAAKH,EAAKI,OAAQ,SAASH,GAClC,OA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A2C/HvC,QACGf,OAAO,yBACPH,WAAW,2BAA4BqG,GAnD5C","file":"Administration.js"} \ No newline at end of file +{"version":3,"sources":["Administration/Administration.app.js","Administration/AdministrationAclController.js","Administration/AdministrationController.js"],"names":["angular","module","config","configure","run","runBlock","$inject","$stateProvider","$urlRouterProvider","state","abstract","views","administration","templateUrl","controller","controllerAs","url","acl","resolve","stateUser","stateFolder","otherwise","$q","$stateParams","User","user","_","find","$users","uid","userId","isUndefined","$filter","then","users","reject","$folders","$state","decodeUriFilter","AddressBook","Calendar","folder","o","folderId","$$folders","name","type","id","split","pop","owner","displayName","selectedFolder","$log","$rootScope","$on","event","toState","toParams","fromState","fromParams","error","go","current","previous","rejection","AdministrationAclController","$timeout","$mdMedia","$mdToast","vm","this","folderType","isDefined","$cards","selectedUser","selectedUid","selectUser","selectAllRights","$acl","$selectAllRights","showRights","rights","removeUser","$removeUser","getTemplate","close","save","$saveUsersRights","show","simple","content","l","position","hideDelay","userToAdd","searchText","userFilter","$query","dry","addUser","data","$addUser","$event","target","parentNode","classList","contains","$rights","AdministrationController","$mdSidenav","sgConstant","Dialog","encodeUriFilter","service","filter","i","selectFolder"],"mappings":"CAGA,WACE,aAEAA,QAAQC,OAAO,yBAA0B,YAAa,cAAe,sBAAuB,qBAAsB,kBAAmB,qBAClIC,OAAOC,GACPC,IAAIC,GAKPF,EAAUG,SAAW,iBAAkB,sBACvC,SAASH,EAAUI,EAAgBC,GACjCD,EACGE,MAAM,kBACLC,UAAU,EACVC,OACEC,gBACEC,YAAa,sBACbC,WAAY,2BACZC,aAAc,UAInBN,MAAM,yBACLO,IAAK,UACLL,OACEV,QACEY,YAAa,kBAIlBJ,MAAM,8BACLO,IAAK,0BACLL,OACEM,KACEJ,YAAa,6BACbC,WAAY,8BACZC,aAAc,QAGlBG,SACEC,UAAWA,EACXC,YAAaA,KAKnBZ,EAAmBa,UAAU,WAM/BF,EAAUb,SAAW,KAAM,eAAgB,QAC3C,SAASa,EAAUG,EAAIC,EA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AAQwC,EAAGK,aAAa9C,IAAKc,SAAUsE,EAAgBxE,EAAOI,SAK3G7C,QACGC,OAAO,yBACPa,WAAW,2BAA4B+F,GAnD5C","file":"Administration.js"} \ No newline at end of file diff --git a/UI/WebServerResources/js/Common.js b/UI/WebServerResources/js/Common.js index fbcd02ce9..2d4b765a5 100644 --- a/UI/WebServerResources/js/Common.js +++ b/UI/WebServerResources/js/Common.js @@ -1,2 +1,2 @@ -function l(){var e,t,n=arguments[0],r=n,i=arguments;for(labels[n]?r=labels[n]:clabels[n]&&(r=clabels[n]),e=1,t=0;e1&&(r=r.replace(/%((%)|s|d)/g,function(t){var n=null;if(t[2])n=t[2];else{switch(n=i[e],t){case"%d":n=parseFloat(n),isNaN(n)&&(n=0)}e++}return n})),r}function hexToRgb(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function contrast(e){var t,n,r=1;if(t=hexToRgb(e)){n=[t.r/255,t.g/255,t.b/255];for(var i=0;i.179?"black":"white"}function guid(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return(e()+e()+"-"+e()+"-4"+e().substr(0,3)+"-"+e()+"-"+e()+e()+e()).toLowerCase()}!function(){"use strict";function e(e,t,n,r,i){r.definePalette("sogo-green",{50:"eaf5e9",100:"cbe5c8",200:"aad6a5",300:"88c781",400:"66b86a",500:"56b04c",600:"4da143",700:"388e3c",800:"367d2e",900:"225e1b",A100:"fafafa",A200:"69f0ae",A400:"00e676",A700:"00c853",contrastDefaultColor:"dark",contrastLightColors:["300","400","500","600","700","800","900"]}),r.definePalette("sogo-blue",{50:"f0faf9",100:"e1f5f3",200:"ceebe8",300:"bfe0dd",400:"b2d6d3",500:"a1ccc8",600:"8ebfbb",700:"7db3b0",800:"639997",900:"4d8080",A100:"d4f7fa",A200:"c3f5fa",A400:"53e3f0",A700:"00b0c0",contrastDefaultColor:"light",contrastDarkColors:["50","100","200"]}),r.definePalette("sogo-paper",{50:"fcf7f8",100:"f7f1dc",200:"ede5ca",300:"e6d8ba",400:"e2d2a3",500:"d6c48d",600:"baa870",700:"857545",800:"524517",900:"433809",1000:"000000",A100:"ffffff",A200:"eeeeee",A400:"bdbdbd",A700:"616161",contrastDefaultColor:"dark",contrastLightColors:["800","900"]}),r.theme("default").primaryPalette("sogo-blue",{default:"900","hue-1":"400","hue-2":"800","hue-3":"A700"}).accentPalette("sogo-green",{default:"500","hue-1":"A100","hue-2":"300","hue-3":"A700"}),DebugEnabled||(e.debugEnabled(!1),t.debugInfoEnabled(!1),i.disableWarnings(),r.generateThemesOnDemand(!0)),n.interceptors.push("AuthInterceptor"),n.interceptors.push("ErrorInterceptor")}function t(e,t){return{response:function(n){return n&&/^application\/json/.test(n.config.headers.Accept)&&/^[\n\r ]*/.test(n.data)?(e.location.reload(!0),t.reject()):n}}}function n(e,t,n,r){return{responseError:function(i){var o,s;if(/^application\/json/.test(i.config.headers.Accept)){if(t.usesCASAuthentication&&-1==i.status)return o=n.defer(),(s=angular.element('')).on("load",function(){r.get("$http")(i.config).then(o.resolve,o.reject),s.remove()}),document.body.appendChild(s[0]),o.promise;e.$broadcast("http:Error",i)}return n.reject(i)}}}angular.module("SOGo.Common",["ngAnimate","ngMessages","ngSanitize","ngMaterial","mdColors"]).value("sgSettings",{isPopup:document.body.classList.contains("popup"),baseURL:function(){return ApplicationBaseURL||null},resourcesURL:function(){return ResourcesURL||null},activeUser:function(e){var t={login:UserLogin||null,identification:UserIdentification||null,email:UserEmail||null,language:UserLanguage||null,folderURL:UserFolderURL||null,isSuperUser:IsSuperUser||null,path:{calendar:UserCalendarPath||null,contacts:UserContactsPath||null,mail:UserMailPath||null,preferences:UserPreferencesPath||null,administration:IsSuperUser?UserAdministrationPath:null,help:HelpURL||null,logoff:UserLogoffPath||null}};return e?t[e]:t},minimumSearchLength:function(){return angular.isNumber(minimumSearchLength)?minimumSearchLength:2}}).constant("sgColors",{selection:["#FFFFFF","#330033","#C0C0C0","#999999","#666666","#333333","#000000","#FFCCCC","#FF6666","#FF0000","#CC0000","#990000","#660000","#330000","#FFCC99","#FF9966","#FF9900","#FF6600","#CC6600","#993300","#663300","#FFFF99","#FFFF66","#FFCC66","#FFCC33","#CC9933","#996633","#663333","#FFFFCC","#FFFF33","#FFFF00","#FFCC00","#999900","#666600","#333300","#CCCCCC","#66FF99","#33FF33","#33CC00","#009900","#006600","#003300","#99FFFF","#33FFFF","#66CCCC","#00CCCC","#339999","#336666","#003333","#CCFFFF","#66FFFF","#33CCFF","#3366FF","#3333FF","#000099","#000066","#CCCCFF","#9999FF","#6666CC","#6633FF","#6600CC","#333399","#330099","#FFCCFF","#FF99FF","#CC66CC","#CC33CC","#993399","#663366","#99FF99"]}).constant("sgConstant",{xs:"(max-width: 599px)","gt-xs":"(min-width: 600px)",sm:"(min-width: 600px) and (max-width: 959px)","gt-sm":"(min-width: 960px)",md:"(min-width: 960px) and (max-width: 1023px)","gt-md":"(min-width: 1024px)",lg:"(min-width: 1024px) and (max-width: 1279px)","gt-lg":"(min-width: 1280px)",xl:"(min-width: 1920px)",print:"print"}).config(e).factory("AuthInterceptor",t).factory("ErrorInterceptor",n),e.$inject=["$logProvider","$compileProvider","$httpProvider","$mdThemingProvider","$mdAriaProvider"],t.$inject=["$window","$q"],n.$inject=["$rootScope","$window","$q","$injector"]}(),function(){"use strict";function e(e){n=e}function t(e,t,r){function i(e){return e.join("")}function o(e,t,n,r,i,o){if(i){var s={theme:n,palette:r,value:"rgb("+i.value[0]+","+i.value[1]+","+i.value[2]+")",contrast:"rgb("+i.contrast[0]+","+i.contrast[1]+","+i.contrast[2]+")",hue:o};y.insertRule(e(s),v),v+=1,y.insertRule(t(s),v),v+=1}}function s(e,t,n,r,i){if(r){var o="rgb("+r.value[0]+","+r.value[1]+","+r.value[2]+")";y.insertRule(e({theme:t,palette:n,value:o,hue:i}),v),v+=1}}for(var a=e(i([".md-{{theme}}-theme",".md-fg"])+" { color:{{value}};}"),l=e(i([".md-{{theme}}-theme",".md-bg"])+" { background-color:{{value}};}"),c=e(i([".md-{{theme}}-theme",".md-bdr"])+" { border-color:{{value}};}"),u=e(i([".md-{{theme}}-theme",".md-{{hue}}",".md-fg"])+" { color:{{value}};}"),d=e(i([".md-{{theme}}-theme",".md-{{hue}}",".md-bg"])+" { background-color:{{value}};}"),h=e(i([".md-{{theme}}-theme",".md-{{palette}}",".md-fg"])+" { color:{{value}};}"),m=e(i([".md-{{theme}}-theme",".md-{{palette}}",".md-bg"])+" { background-color:{{value}}; color:{{contrast}} !important; }"),g=e(i([".md-{{theme}}-theme",".md-{{palette}}",".md-bdr"])+" { border-color:{{value}};}"),p=e(i([".md-{{theme}}-theme",".md-{{palette}}.md-{{hue}}",".md-fg"])+" { color:{{value}};}"),f=e(i([".md-{{theme}}-theme",".md-{{palette}}.md-{{hue}}",".md-bg"])+" { background-color:{{value}};}"),y=function(){var e=t[0].head.querySelector('style[title="Dynamic-Generated-by-mdColors"]');return null===e&&((e=t[0].createElement("style")).title="Dynamic-Generated-by-mdColors",e.appendChild(t[0].createTextNode("")),t[0].head.appendChild(e)),e.sheet}(),v=0;y.cssRules.length>0;)y.deleteRule(0);angular.forEach(n._THEMES,function(e,t){o(a,l,t,"primary",n._PALETTES[e.colors.primary.name][e.colors.primary.hues.default]),o(u,d,t,"primary",n._PALETTES[e.colors.primary.name][e.colors.primary.hues["hue-2"]],"hue-2"),o(u,d,t,"primary",n._PALETTES[e.colors.primary.name][e.colors.primary.hues["hue-3"]],"hue-3"),o(u,d,t,"primary",n._PALETTES[e.colors.primary.name][e.colors.primary.hues["hue-1"]],"hue-1"),s(c,t,"primary",n._PALETTES[e.colors.primary.name][e.colors.primary.hues.default]),angular.forEach(e.colors,function(e,r){o(h,m,t,r,n._PALETTES[e.name][e.hues.default]),s(g,t,r,n._PALETTES[e.name][e.hues.default]),o(p,f,t,r,n._PALETTES[e.name][e.hues["hue-2"]],"hue-2"),o(p,f,t,r,n._PALETTES[e.name][e.hues["hue-3"]],"hue-3"),o(p,f,t,r,n._PALETTES[e.name][e.hues["hue-1"]],"hue-1")})})}var n;angular.module("mdColors",["ngMaterial"]).config(e).run(t),e.$inject=["$mdThemingProvider"],t.$inject=["$interpolate","$document","$log"]}(),function(){"use strict";function e(e){return e.decodeURIComponent}e.$inject=["$window"],angular.module("SOGo.Common").filter("decodeUri",e)}(),function(){"use strict";function e(e){return e.encodeURIComponent}e.$inject=["$window"],angular.module("SOGo.Common").filter("encodeUri",e)}(),function(){"use strict";function e(e){return function(t){var n=angular.element("
"+t+"
");return n.find("a").attr("target","_blank"),e.trustAs("html",n.html())}}e.$inject=["$sce"],angular.module("SOGo.Common").filter("ensureTarget",e)}(),function(){"use strict";angular.module("SOGo.Common").filter("loc",function(){return l})}(),function(){"use strict";angular.module("SOGo.Common").filter("range",function(){return function(e){for(var t=[],n=0;n"):void 0}}e.$inject=["linkyFilter"],angular.module("SOGo.Common").filter("txt2html",e)}(),function(){"use strict";function e(e,t,n,r,i,o,s){function a(e,t){if(t&&t.target.parentNode.classList.contains("md-secondary"))return!1;c.selectedUid==e.uid?c.selectedUid=null:(c.selectedUid=e.uid,c.selectedUser=e,e.inactive||c.selectedUser.$rights())}var c=this;c.users=i,c.folder=s,c.selectedUser=null,c.selectedUid=null,c.userToAdd="",c.searchText="",c.folderClassName=function(){return!!angular.isFunction(s.getClassName)&&s.getClassName("bg")},c.templateName=function(t){return"UIx"+(e[0].getElementById("UIxAnonymousUserRightsEditor")&&t.$isAnonymous()?"Anonymous":"")+"UserRightsEditor"},c.userFilter=function(e){return o.$filter(e,s.$acl.users)},c.closeModal=function(){s.$acl.$resetUsersRights(),n.hide()},c.saveModal=function(){s.$acl.$saveUsersRights().then(function(){n.hide()},function(e,t){r.alert(l("Warning"),l("An error occured please try again."))})},c.confirmChange=function(e){var t=e.$confirmRights(c.folder);t&&(c.confirmation.showing=!0,c.confirmation.message=t)},c.removeUser=function(e){t(function(){s.$acl.$removeUser(e.uid)},500)},c.addUser=function(e){e&&s.$acl.$addUser(e).then(function(e){c.userToAdd="",c.searchText="",c.selectedUid=null,e&&a(e)})},c.selectAllRights=function(e){s.$acl.$selectAllRights(e)},c.selectUser=a,c.showRights=function(e){return c.selectedUid==e.uid&&!e.inactive},c.confirmation={showing:!1,message:""}}e.$inject=["$document","$timeout","$mdDialog","Dialog","usersWithACL","User","folder"],angular.module("SOGo.Common").controller("AclController",e)}(),function(){"use strict";function e(e,t,n,r,i,o,s,a,c,u,d,h,m,g){function p(e,t){var n;t.data&&t.data.message&&angular.isString(t.data.message)?n=t.data.message:t.status&&(n=t.statusText),n?a.show({template:["",'
',' error_outline'," "+l(n)+"","
","
"].join(""),hideDelay:5e3,position:"top right"}):u.debug("untrap error")}var f=new m(h.baseURL(),h.activeUser());this.$onInit=function(){t.isPopup=h.isPopup,t.activeUser=h.activeUser(),t.baseURL=h.baseURL(),t.leftIsClose=!c(d["gt-md"]),t.centerIsClose=!!o.centerIsClose&&!t.leftIsClose,t.currentDay=window.currentDay,n(function(){r(function(){i.get("../date").then(function(e){t.currentDay=e})},864e5)},1e3*window.currentDay.secondsBeforeTomorrow),t.$watch(function(){return c(d["gt-md"])},function(e){t.isGtMedium=e,e&&(t.leftIsClose=!1)}),e.$on("http:Error",p),h.activeUser("path").calendar&&g.getAlarms()},t.toggleLeft=function(){t.isGtMedium?t.leftIsClose=!t.leftIsClose:(t.leftIsClose=!s("left").isOpen(),t.leftIsClose&&angular.element(o).triggerHandler("resize"),s("left").toggle().then(function(){u.debug("toggle left is done")}))},t.toggleRight=function(){s("right").toggle().then(function(){u.debug("toggle right is done")})},t.toggleCenter=function(e){t.centerIsClose=!t.centerIsClose,e&&e.save&&f.post(null,"saveListState",{state:t.centerIsClose?"collapse":"rise"})}}e.$inject=["$rootScope","$scope","$timeout","$interval","$http","$window","$mdSidenav","$mdToast","$mdMedia","$log","sgConstant","sgSettings","Resource","Alarm"],angular.module("SOGo.Common").controller("navController",e)}(),function(){"use strict";function e(e){this.folderId=e}e.factory=["$q","$timeout","sgSettings","Resource","User",function(t,n,r,i,o){return angular.extend(e,{$q:t,$timeout:n,$$resource:new i(r.activeUser("folderURL"),r.activeUser()),$User:o}),e}],angular.module("SOGo.Common").factory("Acl",e.factory),e.prototype.$users=function(t){var n,r=this,i=e.$q.defer();if(!this.users){return(angular.isDefined(t)?e.$$resource.userResource(t).fetch(this.folderId,"acls"):e.$$resource.fetch(this.folderId,"acls")).then(function(o){return r.users=[],angular.forEach(o.users,function(i){(n=new e.$User(i)).canSubscribeUser=n.isSubscribed,n.wasSubscribed=n.isSubscribed,n.$rights=angular.bind(n,n.$acl,r.folderId,t),r.users.push(n)}),i.resolve(r.users),r.users})}return i.resolve(this.users),i.promise},e.prototype.$addUser=function(t,n){var r=this,i=e.$q.defer(),o={uid:t.uid};if(!t.uid||_.indexOf(_.map(this.users,"uid"),t.uid)>-1)i.resolve();else{(angular.isDefined(n)?e.$$resource.userResource(n).fetch(this.folderId,"addUserInAcls",o):e.$$resource.fetch(this.folderId,"addUserInAcls",o)).then(function(){t.wasSubscribed=!1,t.userClass=t.isGroup?"normal-group":"normal-user",t.$rights=angular.bind(t,t.$acl,r.folderId,n),r.users.push(t),i.resolve(t)},function(e,t){i.reject(l("An error occured please try again."))})}return i.promise},e.prototype.$removeUser=function(t,n){var r=this,i={uid:t};return(angular.isDefined(n)?e.$$resource.userResource(n).fetch(this.folderId,"removeUserFromAcls",i):e.$$resource.fetch(this.folderId,"removeUserFromAcls",i)).then(function(){var e=_.indexOf(_.map(r.users,"uid"),t);e>=0&&(r.users[e].$shadowRights=null,r.users.splice(e,1))})},e.prototype.$selectAllRights=function(e){_.forEach(e.rights,function(t,n){angular.isNumber(e.rights[n])?e.rights[n]=1:e.rights[n]="Modifier"})},e.prototype.$resetUsersRights=function(){angular.forEach(this.users,function(e){e.$resetRights()})},e.prototype.$saveUsersRights=function(t){var n=this,r=e.$q.defer(),i=e.$q.defer(),o={action:"saveUserRights"},s=[];if(angular.forEach(this.users,function(e){e.$rightsAreDirty()&&s.push(e.$omit())}),s.length){(angular.isDefined(t)?e.$$resource.userResource(t).save(this.folderId,s,o):e.$$resource.save(this.folderId,s,o)).then(function(){angular.forEach(n.users,function(e){e.$rightsAreDirty()&&(e.$shadowRights=angular.copy(e.rights))}),r.resolve()},r.reject)}else r.resolve();return s=[],angular.forEach(this.users,function(e){!e.wasSubscribed&&e.isSubscribed&&s.push(e.uid)}),s.length?(o={uids:s.join(",")},e.$$resource.fetch(this.folderId,"subscribeUsers",o).then(function(){angular.forEach(n.users,function(e){e.wasSubscribed=e.isSubscribed}),i.resolve()},i.reject)):i.resolve(),e.$q.all([r.promise,i.promise])}}(),function(){"use strict";function e(){this.currentAlarm=null}function t(t,n,r,i){return angular.extend(e,{$timeout:t,$$resource:new r(n.activeUser("folderURL")+"Calendar",n.activeUser()),$toast:i}),e}e.getAlarms=function(){var t=this,n=new Date,r=Math.floor(n.getTime()/1e3);this.$$resource.fetch("","alarmslist?browserTime="+r).then(function(n){var r=n.alarms.sort(function(e,t){var n=parseInt(e[2]);return parseInt(t[2])-n});if(r.length>0){var i=r.pop(),o=new Date,s=Math.floor(o.getTime()/1e3),a=i[0]+"/"+i[1],l=parseInt(i[2]),c=l;l>0&&(c-=s);new Date(1e3*l);var u=angular.bind(t,e.showAlarm,a);t.currentAlarm&&t.$timeout.cancel(t.currentAlarm),t.currentAlarm=t.$timeout(u,1e3*c)}})},e.showAlarm=function(e){var t=this;this.$$resource.fetch(e,"?resetAlarm=yes").then(function(n){function r(e,r,i){e.summary=n.summary,e.reminder="10",e.close=function(){r.hide()},e.snooze=function(){t.$$resource.fetch(i,"view?snoozeAlarm="+e.reminder),r.hide()}}t.$toast.show({position:"top right",hideDelay:0,template:["",'
','
','

{{ summary }}

','
'," ",' ',' ',' ',l("5 minutes")," ",' ',l("10 minutes")," ",' ',l("15 minutes")," ",' ',l("30 minutes")," ",' ',l("45 minutes")," ",' ',l("1 hour")," ",' ',l("1 day")," "," "," ",' ',l("Snooze")," ",' ',l("Close")," ","
","
","
","
"].join(""),locals:{url:e},controller:r}),r.$inject=["scope","$mdToast","url"]})},t.$inject=["$timeout","sgSettings","Resource","$mdToast"],angular.module("SOGo.Common").factory("Alarm",t)}(),function(){"use strict";angular.module("SOGo.Authentication",["ngCookies"]).constant("passwordPolicyConfig",{PolicyPasswordChangeUnsupported:-3,PolicyPasswordSystemUnknown:-2,PolicyPasswordUnknown:-1,PolicyPasswordExpired:0,PolicyAccountLocked:1,PolicyChangeAfterReset:2,PolicyPasswordModNotAllowed:3,PolicyMustSupplyOldPassword:4,PolicyInsufficientPasswordQuality:5,PolicyPasswordTooShort:6,PolicyPasswordTooYoung:7,PolicyPasswordInHistory:8,PolicyNoError:65535}).provider("Authentication",function(){function e(e,t){var n,r,i,o,s;return n=e,t&&(n+="@"+t.value),r=""+window.location.href,"/"==(i=ApplicationBaseURL+encodeURIComponent(n))[0]&&(s=(o=r.split("/"))[2],i=o[0]+"//"+s+i),r.startsWith(i)&&!r.endsWith("/logoff")?r:i}function t(t,n,r,i){function o(){var e=null,t=r.get("0xHIGHFLYxSOGo");return t&&t.length>8&&(e=decodeURIComponent(t.substr(8)).base64decode().split(":")),e}return{login:function(r){var s,a=t.defer(),c=r.username,u=r.password,d=r.domain,h=r.rememberLogin?1:0;return r.loginSuffix&&!c.endsWith(r.loginSuffix)&&(c+=loginSuffix,d=!1),r.language&&"WONoSelectionString"!=r.language&&(s=r.language),n({method:"POST",url:"/SOGo/connect",data:{userName:c,password:u,domain:d,language:s,rememberLogin:h}}).then(function(t){var n=t.data;o()?void 0!==n.expire&&void 0!==n.grace?n.expire<0&&n.grace>0?a.reject({grace:n.grace}):n.expire>0&&-1==n.grace?a.reject({expire:n.expire}):a.resolve({cn:n.cn,url:e(c,d)}):a.resolve({url:e(c,d)}):a.reject(l("cookiesNotEnabled"))},function(e){var t,n,r=e.data;t=r&&r.LDAPPasswordPolicyError?(n=r.LDAPPasswordPolicyError)==i.PolicyNoError?l("Wrong username or password."):n==i.PolicyAccountLocked?l("Your account was locked due to too many failed attempts."):l("Login failed due to unhandled error case: ")+n:l("Unhandled error response"),a.reject({error:t})}),a.promise},changePassword:function(e){var s=t.defer(),a=o(),c=r.get("XSRF-TOKEN");return r.remove("XSRF-TOKEN",{path:"/SOGo/"}),n({method:"POST",url:"/SOGo/so/changePassword",headers:{"X-XSRF-TOKEN":c},data:{userName:a[0],password:a[1],newPassword:e}}).then(s.resolve,function(e){var t,n=e.data.LDAPPasswordPolicyError;n?n==i.PolicyNoError?t=l("Password change failed"):n==i.PolicyPasswordModNotAllowed?t=l("Password change failed - Permission denied"):n==i.PolicyInsufficientPasswordQuality?t=l("Password change failed - Insufficient password quality"):n==i.PolicyPasswordTooShort?t=l("Password change failed - Password is too short"):n==i.PolicyPasswordTooYoung?t=l("Password change failed - Password is too young"):n==i.PolicyPasswordInHistory?t=l("Password change failed - Password is in history"):(t=l("Unhandled policy error: %{0}").formatted(n),n=i.PolicyPasswordUnknown):(n=i.PolicyPasswordSystemUnknown,t=_("Unhandled error response")),r.put("XSRF-TOKEN",c,{path:"/SOGo/"}),s.reject(t)}),s.promise}}}this.$get=t,t.$inject=["$q","$http","$cookies","passwordPolicyConfig"]})}(),function(){"use strict";function e(){}function t(t,n){return angular.extend(e,{$q:t,$modal:n}),e}e.alert=function(e,t){var n=this.$modal.alert().title(e).htmlContent(t).ok(l("OK")).multiple(!0);this.$modal.show(n)},e.confirm=function(e,t,n){var r=this.$modal.confirm().title(e).htmlContent(t).ok(n&&n.ok?n.ok:l("OK")).cancel(n&&n.cancel?n.cancel:l("Cancel"));return this.$modal.show(r)},e.prompt=function(e,t,n){function r(t,n){t.title=e,t.name="",t.cancel=function(){s.reject(),n.hide()},t.ok=function(){s.resolve(t.name),n.hide()}}var i=n||{},o=e.asCSSIdentifier(),s=this.$q.defer();return this.$modal.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,template:['','
',' ','

'," "," ",' '," ","
"," ",' '," "+l("Cancel")," ",' '," "+l("OK")," "," ","
","
"].join(""),controller:r}),r.$inject=["scope","$mdDialog"],s.promise},t.$inject=["$q","$mdDialog"],angular.module("SOGo.Common").factory("Dialog",t)}(),function(){"use strict";angular.module("SOGo.Common").factory("Gravatar",function(){return function(e,t,n,r){var i,o,s,a=t,l=n;return e?((i=e.indexOf("<"))>=0&&(o=e.indexOf(">",i))>i&&(e=e.substring(i+1,o)),t||(a=48),s=e.md5(),l&&"none"!=l||(n=r&&r.no_404?"mm":"404"),"https://www.gravatar.com/avatar/"+s+"?s="+a+"&d="+n):""}})}(),function(){"use strict";function e(e,t,n,r,i){angular.extend(this,{_http:e,_q:t,_path:n,_activeUser:r}),angular.extend(this,i),this._path=this._path.replace(/\/$/,"")}e.$factory=["$http","$q",function(t,n){return function(r,i,o){return new e(t,n,r,i,o)}}],angular.module("SOGo.Common").factory("Resource",e.$factory),e.prototype.userResource=function(t){var n=_.compact(this._activeUser.folderURL.split("/"));return t&&n.splice(n.length-1,1,escape(t)),new e(this._http,this._q,"/"+n.join("/"),this._activeUser)},e.prototype.path=function(){var e=[this._path];return arguments.length>0&&Array.prototype.push.apply(e,Array.prototype.slice.call(arguments)),e.join("/")},e.prototype.fetch=function(e,t,n){var r=this._q.defer(),i=[this._path];return e&&i.push(e.split("/")),t&&i.push(t),i=_.compact(_.flatten(i)).join("/"),this._http({method:"GET",url:i,params:n}).then(function(e){return r.resolve(e.data)},r.reject),r.promise},e.prototype.newguid=function(e){var t=this._q.defer(),n=this._path+"/"+e+"/newguid";return this._http.get(n).then(function(e){return t.resolve(e.data)},t.reject),t.promise},e.prototype.create=function(e,t){var n=this._q.defer(),r=this._path+"/"+e;return this._http.post(r,{name:t}).then(function(e){return n.resolve(e.data)},n.reject),n.promise},e.prototype.post=function(e,t,n){var r=this._q.defer(),i=[this._path];return e&&i.push(e),t&&i.push(t),i=_.compact(_.flatten(i)).join("/"),this._http.post(i,n).then(function(e){return r.resolve(e.data)},r.reject),r.promise},e.prototype.save=function(e,t,n){var r=n&&n.action?n.action:"save";return this.post(e,r,t)},e.prototype.download=function(e,t,n,r){this._q.defer();var i=r&&r.type?r.type:"application/zip",o=[this._path];return e&&o.push(e),t&&o.push(t),o=_.compact(_.flatten(o)).join("/"),this._http({method:"POST",url:o,data:n,headers:{accept:i},responseType:"arraybuffer",cache:!1,transformResponse:function(e,t,n){var o,s=null;if(n<200||n>299)throw new Error("Bad gateway");if(e&&(s=new Blob([e],{type:i})),r&&r.filename?o=r.filename:function(e){e&&e.split(";")[1].trim().split("=")[1].replace(/"/g,"")}(t("content-disposition")),!saveAs)throw new Error("To use Resource.download, FileSaver.js must be loaded.");saveAs(s,o)}})},e.prototype.remove=function(e){var t=this._q.defer(),n=this._path+"/"+e+"/delete";return this._http.get(n).then(function(e){return t.resolve(e.data)},t.reject),t.promise}}(),function(){"use strict";function e(e,t){return function(n){t(function(){e.$broadcast("sgFocusOn",n)})}}e.$inject=["$rootScope","$timeout"],angular.module("SOGo.Common").factory("sgFocus",e)}(),function(){"use strict";function e(e,t){return angular.extend(t,{$modal:e}),new t}e.$inject=["$mdDialog","$sgHotkeys"],angular.module("SOGo.Common").service("sgHotkeys",e).provider("$sgHotkeys",function(){function e(e,r){var i=function(e){this.id=e.id||guid(),this.key=e.key,this.description=e.description||null,this.context=e.context||null,this.callback=e.callback,this.preventInClass=e.preventInClass,this.args=e.args,this.onKeyUp=!1,this.key.length>1&&(this.lkey=l("key_"+this.key))};i.prototype.clone=function(){return new i(this)};var o=function(){this._hotkeys={},this._hotkeysUp={},this._preventIn=["INPUT","SELECT","TEXTAREA","MD-OPTION"],this._preventInClass=["md-chip-content"],this._onKeydown=this._onKeydown.bind(this),this._onKeyup=this._onKeyup.bind(this),this._onKeypress=this._onKeypress.bind(this),this.initialize()};return o.prototype.initialize=function(){this.registerHotkey(this.createHotkey({key:"?",description:l("Show or hide this help"),callback:this._toggleCheatSheet.bind(this)})),r.addEventListener("keydown",this._onKeydown,!0),r.addEventListener("keyup",this._onKeyup,!0),r.addEventListener("keypress",this._onKeypress,!0)},o.prototype._invokeHotkeyHandlers=function(e,t,n){for(var r=0,i=n.length;r=0;n--){var r=e.clone();r.key=e.key[n];var i=this._deregisterHotkey(r);void 0!==i&&t.push(i[0])}else t.push(this._deregisterHotkey(e));return t},o.prototype._validateHotkey=function(e){if(!(e instanceof i))throw new TypeError("Hotkeys: Expected a hotkey object be instance of HotKey")},o.prototype._registerKey=function(e){var t=this._hotkeys;return e.onKeyUp&&(t=this._hotkeysUp),t[e.key]=t[e.key]||[],t[e.key].push(e),e},o.prototype._registerKeys=function(e){var t=[];if(angular.isArray(e.key))for(var n=e.key.length-1;n>=0;n--){var r=e.clone();r.id=guid(),r.key=e.key[n],t.push(this._registerKey(r))}else t.push(this._registerKey(e));return t},o.prototype.registerHotkey=function(e){return this._validateHotkey(e),this._registerKeys(e)},o.prototype.registerHotkeyUp=function(e){this._validateHotkey(e),e.onKeyUp=!0,this._registerKeys(e)},o.prototype.createHotkey=function(t){if(null===t.key||void 0===t.key)throw new TypeError('HotKeys: Argument "key" is required');if(null===t.callback||void 0===t.callback)throw new TypeError('HotKeys: Argument "callback" is required');return t.callback=function(t){return function(n,r){e.$apply(function(){t.call(this,n,r)}.bind(this))}}(t.callback),new i(t)},o.prototype.match=function(e,t){angular.isArray(t)||(t=[t]);var n=this.keyStringFromEvent(e);return Boolean(~t.indexOf(n))},o.prototype._toggleCheatSheet=function(){function e(e,t){e.hotkeys=t,e.closeDialog=function(){o.$modal.hide()}}var t=this;this._cheatSheet?(o.$modal.hide(),this._cheatSheet=null):this._cheatSheet=o.$modal.show({clickOutsideToClose:!0,escapeToClose:!0,template:[""," "," ",' ','
'," {{keys[0].lkey || hotkey}}","
"," {{keys[0].description}}","
","
","
","
"].join(""),controller:e,locals:{hotkeys:t._hotkeys}}).finally(function(){t._cheatSheet=null}),e.$inject=["$scope","hotkeys"]},o}var t={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"caps",27:"escape",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"delete",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"},n={42:"*",63:"?"};this.$get=e,e.$inject=["$rootScope","$window"]})}(),function(){"use strict";function e(e){e&&this.init(e)}e.factory=["$q","$log","sgSettings","Resource",function(t,n,r,i){return angular.extend(e,{$q:t,$log:n,$$resource:new i(r.activeUser("folderURL"),r.activeUser()),$query:"",$users:[]}),e}],angular.module("SOGo.Common").factory("User",e.factory),e.$filter=function(t,n,r){var i=e.$$resource,o={search:t};if(r&&r.dry)r&&r.uid&&(i=e.$$resource.userResource(r.uid));else{if(!t)return e.$users.splice(0,e.$users.length),e.$q.when(e.$users);if(e.$query==t)return e.$q.when(e.$users);e.$query=t}return i.fetch(null,"usersSearch",o).then(function(t){var i,o,s,a,l=function(e){return this.uid==e.uid};for(r?r.dry?a=[]:r.results&&(a=r.results):a=e.$users,i=n?_.filter(t.users,function(e){return!_.find(n,_.bind(l,e))}):t.users,o=a.length-1;o>=0;o--)s=a[o],_.find(i,_.bind(l,s))||a.splice(o,1);return _.forEach(i,function(t,n){if(_.isUndefined(_.find(a,_.bind(l,t)))){var r=new e(t);a.splice(n,0,r)}}),e.$log.debug(a),a})},e.prototype.init=function(e){angular.extend(this,e),this.$$shortFormat||(this.$$shortFormat=this.$shortFormat()),this.$$image||(this.$$image=this.image),this.$avatarIcon=this.$isGroup()||this.$isSpecial()?"group":"person",this.empty=" "},e.prototype.$fullname=function(){var e=this.cn||this.uid;return this.c_info&&(e+=" ("+this.c_info.split("\n").join("; ")+")"),e},e.prototype.$shortFormat=function(e){var t=this.$fullname(),n=this.c_email;return!(e&&!1===e.email)&&n&&t!=n&&(t+=" <"+n+">"),t},e.prototype.$acl=function(t,n){var r=this,i=e.$q.defer(),o={uid:this.uid};if(this.$shadowRights)i.resolve(this.rights);else{(angular.isDefined(n)?e.$$resource.userResource(n).fetch(t,"userRights",o):e.$$resource.fetch(t,"userRights",o)).then(function(e){return r.rights=e,r.$shadowRights=angular.copy(e),i.resolve(e),e})}return i.promise},e.prototype.$isGroup=function(){return this.isGroup||this.userClass&&"normal-group"==this.userClass},e.prototype.$isAnonymous=function(){return"anonymous"==this.uid},e.prototype.$isSpecial=function(){return this.userClass&&"public-user"==this.userClass},e.prototype.$confirmRights=function(e){var t=!1;return!this.$confirmation&&(_.some(_.values(this.rights))&&("anonymous"==this.uid?"AddressBook"==e.constructor.name?t=l('Potentially anyone on the Internet will be able to access your address book "%{0}", even if they do not have an account on this system. Is this information suitable for the public Internet?',e.name):"Calendar"==e.constructor.name&&(t=l('Potentially anyone on the Internet will be able to access your calendar "%{0}", even if they do not have an account on this system. Is this information suitable for the public Internet?',e.name)):"anyone"!=this.uid&&""!=this.uid||("AddressBook"==e.constructor.name?t=l('Any user with an account on this system will be able to access your address book "%{0}". Are you certain you trust them all?',e.name):"Calendar"==e.constructor.name?t=l('Any user with an account on this system will be able to access your calendar "%{0}". Are you certain you trust them all?',e.name):"Mailbox"==e.constructor.name&&(t=l('Any user with an account on this system will be able to access your mailbox "%{0}". Are you certain you trust them all?',e.name)))),this.$confirmation=t,t)},e.prototype.$rightsAreDirty=function(){return this.rights&&!_.isEqual(this.rights,this.$shadowRights)},e.prototype.$resetRights=function(e){var t=this;e?_.map(_.keys(this.rights),function(e){angular.isString(t.rights[e])?t.rights[e]="None":t.rights[e]=0}):this.$shadowRights&&(this.rights=angular.copy(this.$shadowRights))},e.prototype.$folders=function(t){var n=this,r=e.$q.defer(),i={type:t};return this.$$folders?r.resolve(this.$$folders):e.$$resource.userResource(this.uid).fetch(null,"foldersSearch",i).then(function(e){n.$$folders=e.folders,r.resolve(e.folders)}),r.promise},e.prototype.$omit=function(){var e={};return angular.forEach(this,function(t,n){"constructor"!=n&&"$"!=n[0]&&(e[n]=t)}),e},e.prototype.toString=function(){return"[User "+this.c_email+"]"}}(),function(){"use strict";function e(e,t,n,r,i,o){function s(){l.url=null,l.urlEmail=null,l.img.addClass("ng-hide"),l.genericImg.removeClass("ng-hide")}function a(){l.genericImg.addClass("ng-hide"),l.img.removeClass("ng-hide")}var l,c;l=this,e.$on("$destroy",function(){c&&t.off("click",c)}),e.$watch(function(){return l.email},function(e,t){e&&l.urlEmail!=e?(s(),i.defaults.SOGoGravatarEnabled&&function(e){var t=o(e,l.size,i.defaults.SOGoAlternateAvatar);n({method:"GET",url:t,cache:!0,headers:{Accept:"image/*"}}).then(function(){l.url||(l.url=t,l.urlEmail=e,a())},function(){s()})}(e)):e||s()}),"sg-src"in t[0].attributes&&e.$watch(function(){return l.src},function(e){e&&(l.url=e,l.urlEmail=""+l.email,t.addClass("sg-avatar-image--zoomable"),c=function(){t.toggleClass("sg-avatar-image--zoom")},t.on("click",c),a())})}e.$inject=["$scope","$element","$http","$q","Preferences","Gravatar"],angular.module("SOGo.Common").directive("sgAvatarImage",function(){return{restrict:"AE",scope:{},bindToController:{size:"@",email:"=sgEmail",src:"=sgSrc"},transclude:!0,template:['
'," ",' ',' ',"
"].join(""),link:function(e,t,n,r){var i,o=t.find("img"),s=t.find("md-icon"),a=angular.element(s[0]),l=angular.element(s[1]);n.size&&(o.attr("width",n.size),o.attr("height",n.size),a.css("font-size",n.size+"px"),l.css("font-size",parseInt(.4*n.size)+"px")),angular.isDefined(n.ngDisabled)&&(i=e.$watch(n.ngDisabled,function(e){n.disabled&&l.css({display:"block"}),i()})),r.img=o,r.genericImg=a},controller:"sgAvatarImageController",controllerAs:"vm"}}).controller("sgAvatarImageController",e)}(),function(){"use strict";function e(e,t,n,r){var i="sg-checked";return{restrict:"E",replace:!0,transclude:!0,require:"?ngModel",template:['