Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zimbra-admin-api-js
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Public
zimbra-admin-api-js
Commits
2b44758f
Commit
2b44758f
authored
May 31, 2016
by
Juorder Antonio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable antispam and allowers for domain admins.
parent
84533f7d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
16 deletions
+64
-16
distribution_lists.jsx
src/components/distribution/distribution_lists.jsx
+17
-5
add_admin_modal.jsx
src/components/domain/add_admin_modal.jsx
+3
-2
domain_admin_list.jsx
src/components/domain/domain_admin_list.jsx
+29
-8
domain_details.jsx
src/components/domain/domain_details.jsx
+12
-0
domain_distribution_list.jsx
src/components/domain/domain_distribution_list.jsx
+2
-0
domain_store.jsx
src/stores/domain_store.jsx
+1
-1
No files found.
src/components/distribution/distribution_lists.jsx
View file @
2b44758f
...
...
@@ -19,6 +19,7 @@ import * as Client from '../../utils/client.jsx';
import
*
as
Utils
from
'../../utils/utils.jsx'
;
import
*
as
GlobalActions
from
'../../action_creators/global_actions.jsx'
;
import
DomainStore
from
'../../stores/domain_store.jsx'
;
import
UserStore
from
'../../stores/user_store.jsx'
;
import
Constants
from
'../../utils/constants.jsx'
;
const
MessagesType
=
Constants
.
MessageType
;
...
...
@@ -38,6 +39,7 @@ export default class DistributionLists extends React.Component {
this
.
onExportMembers
=
this
.
onExportMembers
.
bind
(
this
);
this
.
onExportAllowers
=
this
.
onExportAllowers
.
bind
(
this
);
this
.
domain
=
null
;
this
.
isGlobalAdmin
=
UserStore
.
isGlobalAdmin
();
this
.
state
=
{};
}
...
...
@@ -573,13 +575,23 @@ export default class DistributionLists extends React.Component {
/>
);
let
tabNamesArray
=
[
'Miembros'
,
'Permitidos'
];
let
tabs
=
{
miembros
:
members
,
permitidos
:
allows
};
if
(
this
.
isGlobalAdmin
)
{
tabNamesArray
=
[
'Miembros'
];
tabs
=
{
miembros
:
members
};
}
panelTabs
=
(
<
PanelTab
tabNames=
{
[
'Miembros'
,
'Permitidos'
]
}
tabs=
{
{
miembros
:
members
,
permitidos
:
allows
}
}
tabNames=
{
tabNamesArray
}
tabs=
{
tabs
}
location=
{
this
.
props
.
location
}
/>
);
...
...
src/components/domain/add_admin_modal.jsx
View file @
2b44758f
...
...
@@ -2,6 +2,7 @@
// See LICENSE.txt for license information.
import
DomainStore
from
'../../stores/domain_store.jsx'
;
import
EventStore
from
'../../stores/event_store.jsx'
;
import
*
as
GlobalActions
from
'../../action_creators/global_actions.jsx'
;
import
*
as
Client
from
'../../utils/client.jsx'
;
...
...
@@ -89,10 +90,10 @@ export default class AddAdminModal extends React.Component {
if
(
this
.
props
.
show
)
{
this
.
props
.
onHide
();
GlobalActions
.
emitToast
({
EventStore
.
emitToast
({
type
:
'success'
,
title
:
'Dominio'
,
body
:
`Se ha agrega el administrador:
${
user
}
, éxitosamente.`
,
body
:
`Se ha agrega el administrador:
${
user
.
name
}
, éxitosamente.`
,
options
:
{
timeOut
:
4000
,
extendedTimeOut
:
2000
,
...
...
src/components/domain/domain_admin_list.jsx
View file @
2b44758f
...
...
@@ -13,6 +13,7 @@ import ToggleModalButton from '../toggle_modal_button.jsx';
import
AddAdminModal
from
'./add_admin_modal.jsx'
;
import
*
as
Utils
from
'../../utils/utils.jsx'
;
import
*
as
Client
from
'../../utils/client.jsx'
;
//import Constants from '../../utils/constants.jsx';
...
...
@@ -35,14 +36,31 @@ export default class DomainAdminList extends React.Component {
};
}
getAdmins
()
{
getAdmins
(
getAllFromAPI
)
{
const
domain
=
this
.
props
.
domain
;
domain
.
getAdmins
((
err
,
data
)
=>
{
const
admins
=
data
.
account
||
[];
if
(
this
.
isStoreEnabled
)
{
DomainStore
.
setAdmins
(
domain
,
admins
);
}
this
.
setState
({
admins
});
const
getStuffFromAPI
=
getAllFromAPI
||
false
;
if
(
!
getStuffFromAPI
)
{
return
domain
.
getAdmins
((
err
,
data
)
=>
{
const
admins
=
data
.
account
||
[];
if
(
this
.
isStoreEnabled
)
{
DomainStore
.
setAdmins
(
domain
,
admins
);
}
this
.
setState
({
admins
});
});
}
return
Client
.
getDomain
(
domain
.
name
,
(
data
)
=>
{
this
.
props
.
domain
=
data
;
return
data
.
getAdmins
((
err
,
res
)
=>
{
const
admins
=
res
.
account
||
[];
if
(
this
.
isStoreEnabled
)
{
DomainStore
.
setAdmins
(
domain
,
admins
);
}
return
this
.
setState
({
admins
});
});
},
(
err
)
=>
{
return
err
;
});
}
...
...
@@ -84,7 +102,10 @@ export default class DomainAdminList extends React.Component {
if
(
this
.
isStoreEnabled
)
{
DomainStore
.
removeAdmin
(
admin
.
id
);
}
else
{
DomainStore
.
emitAdminsChange
();
}
return
sweetAlert
(
response
);
}
);
...
...
@@ -96,7 +117,7 @@ export default class DomainAdminList extends React.Component {
onAdminsChange
()
{
const
admins
=
this
.
isStoreEnabled
?
DomainStore
.
getAdmins
(
this
.
props
.
domain
)
:
null
;
if
(
!
admins
)
{
return
this
.
getAdmins
();
return
this
.
getAdmins
(
true
);
}
return
this
.
setState
({
admins
});
...
...
src/components/domain/domain_details.jsx
View file @
2b44758f
...
...
@@ -18,6 +18,7 @@ import MultipleTaskModal from './multiple_task_modal.jsx';
import
AntiSpamComponent
from
'./antispam.jsx'
;
import
ZonaDNS
from
'./domain_admin_dns.jsx'
;
import
EventStore
from
'../../stores/event_store.jsx'
;
import
UserStore
from
'../../stores/user_store.jsx'
;
import
DomainStore
from
'../../stores/domain_store.jsx'
;
...
...
@@ -35,6 +36,7 @@ export default class DomainDetails extends React.Component {
this
.
getDomain
=
this
.
getDomain
.
bind
(
this
);
this
.
showMessage
=
this
.
showMessage
.
bind
(
this
);
this
.
handleClickOnTab
=
this
.
handleClickOnTab
.
bind
(
this
);
this
.
isGlobalAdmin
=
UserStore
.
isGlobalAdmin
();
this
.
state
=
{};
}
...
...
@@ -225,6 +227,16 @@ export default class DomainDetails extends React.Component {
zona_dns
:
zonaDNS
};
if
(
!
this
.
isGlobalAdmin
)
{
tabNames
=
[
'Administradores'
,
'Listas De Distribución'
,
'Tareas Masivas'
,
'Zona DNS'
];
tabs
=
{
administradores
:
tabAdmin
,
listas_de_distribuci
ó
n
:
tabDistribution
,
tareas_masivas
:
tabTareasMasivas
,
zona_dns
:
zonaDNS
};
}
if
(
domain
.
isAliasDomain
)
{
tabNames
=
[
'Zona DNS'
];
tabs
=
{
...
...
src/components/domain/domain_distribution_list.jsx
View file @
2b44758f
...
...
@@ -43,6 +43,7 @@ export default class DomainDistributionList extends React.Component {
const
domain
=
this
.
props
.
domain
;
domain
.
getAllDistributionLists
(
(
err
,
lists
)
=>
{
console
.
log
(
'getAllDL'
,
lists
);
//eslint-disable-line no-console
if
(
this
.
isStoreEnabled
)
{
DomainStore
.
setDistibutionLists
(
domain
,
lists
);
}
...
...
@@ -61,6 +62,7 @@ export default class DomainDistributionList extends React.Component {
onListsChange
()
{
const
lists
=
this
.
isStoreEnabled
?
DomainStore
.
getDistributionLists
(
this
.
props
.
domain
)
:
null
;
if
(
!
lists
)
{
console
.
log
(
'no store'
);
//eslint-disable-line no-console
return
this
.
getLists
();
}
...
...
src/stores/domain_store.jsx
View file @
2b44758f
...
...
@@ -92,7 +92,7 @@ class DomainStoreClass extends EventEmitter {
getAdmins
(
domain
)
{
if
(
this
.
current
!==
domain
)
{
this
.
setCurrent
(
domain
);
this
.
setCurrent
(
domain
);
}
const
admins
=
[];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment