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
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
15 deletions
+63
-15
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
No files found.
src/components/distribution/distribution_lists.jsx
View file @
2b44758f
...
@@ -19,6 +19,7 @@ import * as Client from '../../utils/client.jsx';
...
@@ -19,6 +19,7 @@ import * as Client from '../../utils/client.jsx';
import
*
as
Utils
from
'../../utils/utils.jsx'
;
import
*
as
Utils
from
'../../utils/utils.jsx'
;
import
*
as
GlobalActions
from
'../../action_creators/global_actions.jsx'
;
import
*
as
GlobalActions
from
'../../action_creators/global_actions.jsx'
;
import
DomainStore
from
'../../stores/domain_store.jsx'
;
import
DomainStore
from
'../../stores/domain_store.jsx'
;
import
UserStore
from
'../../stores/user_store.jsx'
;
import
Constants
from
'../../utils/constants.jsx'
;
import
Constants
from
'../../utils/constants.jsx'
;
const
MessagesType
=
Constants
.
MessageType
;
const
MessagesType
=
Constants
.
MessageType
;
...
@@ -38,6 +39,7 @@ export default class DistributionLists extends React.Component {
...
@@ -38,6 +39,7 @@ export default class DistributionLists extends React.Component {
this
.
onExportMembers
=
this
.
onExportMembers
.
bind
(
this
);
this
.
onExportMembers
=
this
.
onExportMembers
.
bind
(
this
);
this
.
onExportAllowers
=
this
.
onExportAllowers
.
bind
(
this
);
this
.
onExportAllowers
=
this
.
onExportAllowers
.
bind
(
this
);
this
.
domain
=
null
;
this
.
domain
=
null
;
this
.
isGlobalAdmin
=
UserStore
.
isGlobalAdmin
();
this
.
state
=
{};
this
.
state
=
{};
}
}
...
@@ -573,13 +575,23 @@ export default class DistributionLists extends React.Component {
...
@@ -573,13 +575,23 @@ export default class DistributionLists extends React.Component {
/>
/>
);
);
panelTabs
=
(
let
tabNamesArray
=
[
'Miembros'
,
'Permitidos'
];
<
PanelTab
let
tabs
=
{
tabNames=
{
[
'Miembros'
,
'Permitidos'
]
}
tabs=
{
{
miembros
:
members
,
miembros
:
members
,
permitidos
:
allows
permitidos
:
allows
}
}
};
if
(
this
.
isGlobalAdmin
)
{
tabNamesArray
=
[
'Miembros'
];
tabs
=
{
miembros
:
members
};
}
panelTabs
=
(
<
PanelTab
tabNames=
{
tabNamesArray
}
tabs=
{
tabs
}
location=
{
this
.
props
.
location
}
location=
{
this
.
props
.
location
}
/>
/>
);
);
...
...
src/components/domain/add_admin_modal.jsx
View file @
2b44758f
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
// See LICENSE.txt for license information.
// See LICENSE.txt for license information.
import
DomainStore
from
'../../stores/domain_store.jsx'
;
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
GlobalActions
from
'../../action_creators/global_actions.jsx'
;
import
*
as
Client
from
'../../utils/client.jsx'
;
import
*
as
Client
from
'../../utils/client.jsx'
;
...
@@ -89,10 +90,10 @@ export default class AddAdminModal extends React.Component {
...
@@ -89,10 +90,10 @@ export default class AddAdminModal extends React.Component {
if
(
this
.
props
.
show
)
{
if
(
this
.
props
.
show
)
{
this
.
props
.
onHide
();
this
.
props
.
onHide
();
GlobalActions
.
emitToast
({
EventStore
.
emitToast
({
type
:
'success'
,
type
:
'success'
,
title
:
'Dominio'
,
title
:
'Dominio'
,
body
:
`Se ha agrega el administrador:
${
user
}
, éxitosamente.`
,
body
:
`Se ha agrega el administrador:
${
user
.
name
}
, éxitosamente.`
,
options
:
{
options
:
{
timeOut
:
4000
,
timeOut
:
4000
,
extendedTimeOut
:
2000
,
extendedTimeOut
:
2000
,
...
...
src/components/domain/domain_admin_list.jsx
View file @
2b44758f
...
@@ -13,6 +13,7 @@ import ToggleModalButton from '../toggle_modal_button.jsx';
...
@@ -13,6 +13,7 @@ import ToggleModalButton from '../toggle_modal_button.jsx';
import
AddAdminModal
from
'./add_admin_modal.jsx'
;
import
AddAdminModal
from
'./add_admin_modal.jsx'
;
import
*
as
Utils
from
'../../utils/utils.jsx'
;
import
*
as
Utils
from
'../../utils/utils.jsx'
;
import
*
as
Client
from
'../../utils/client.jsx'
;
//import Constants from '../../utils/constants.jsx';
//import Constants from '../../utils/constants.jsx';
...
@@ -35,9 +36,11 @@ export default class DomainAdminList extends React.Component {
...
@@ -35,9 +36,11 @@ export default class DomainAdminList extends React.Component {
};
};
}
}
getAdmins
()
{
getAdmins
(
getAllFromAPI
)
{
const
domain
=
this
.
props
.
domain
;
const
domain
=
this
.
props
.
domain
;
domain
.
getAdmins
((
err
,
data
)
=>
{
const
getStuffFromAPI
=
getAllFromAPI
||
false
;
if
(
!
getStuffFromAPI
)
{
return
domain
.
getAdmins
((
err
,
data
)
=>
{
const
admins
=
data
.
account
||
[];
const
admins
=
data
.
account
||
[];
if
(
this
.
isStoreEnabled
)
{
if
(
this
.
isStoreEnabled
)
{
DomainStore
.
setAdmins
(
domain
,
admins
);
DomainStore
.
setAdmins
(
domain
,
admins
);
...
@@ -46,6 +49,21 @@ export default class DomainAdminList extends React.Component {
...
@@ -46,6 +49,21 @@ export default class DomainAdminList extends React.Component {
});
});
}
}
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
;
});
}
handleRemoveAdmin
(
e
,
admin
)
{
handleRemoveAdmin
(
e
,
admin
)
{
const
plans
=
Object
.
keys
(
window
.
manager_config
.
plans
).
filter
((
plan
)
=>
{
const
plans
=
Object
.
keys
(
window
.
manager_config
.
plans
).
filter
((
plan
)
=>
{
return
window
.
manager_config
.
plans
[
plan
].
forRights
;
return
window
.
manager_config
.
plans
[
plan
].
forRights
;
...
@@ -84,7 +102,10 @@ export default class DomainAdminList extends React.Component {
...
@@ -84,7 +102,10 @@ export default class DomainAdminList extends React.Component {
if
(
this
.
isStoreEnabled
)
{
if
(
this
.
isStoreEnabled
)
{
DomainStore
.
removeAdmin
(
admin
.
id
);
DomainStore
.
removeAdmin
(
admin
.
id
);
}
else
{
DomainStore
.
emitAdminsChange
();
}
}
return
sweetAlert
(
response
);
return
sweetAlert
(
response
);
}
}
);
);
...
@@ -96,7 +117,7 @@ export default class DomainAdminList extends React.Component {
...
@@ -96,7 +117,7 @@ export default class DomainAdminList extends React.Component {
onAdminsChange
()
{
onAdminsChange
()
{
const
admins
=
this
.
isStoreEnabled
?
DomainStore
.
getAdmins
(
this
.
props
.
domain
)
:
null
;
const
admins
=
this
.
isStoreEnabled
?
DomainStore
.
getAdmins
(
this
.
props
.
domain
)
:
null
;
if
(
!
admins
)
{
if
(
!
admins
)
{
return
this
.
getAdmins
();
return
this
.
getAdmins
(
true
);
}
}
return
this
.
setState
({
admins
});
return
this
.
setState
({
admins
});
...
...
src/components/domain/domain_details.jsx
View file @
2b44758f
...
@@ -18,6 +18,7 @@ import MultipleTaskModal from './multiple_task_modal.jsx';
...
@@ -18,6 +18,7 @@ import MultipleTaskModal from './multiple_task_modal.jsx';
import
AntiSpamComponent
from
'./antispam.jsx'
;
import
AntiSpamComponent
from
'./antispam.jsx'
;
import
ZonaDNS
from
'./domain_admin_dns.jsx'
;
import
ZonaDNS
from
'./domain_admin_dns.jsx'
;
import
EventStore
from
'../../stores/event_store.jsx'
;
import
EventStore
from
'../../stores/event_store.jsx'
;
import
UserStore
from
'../../stores/user_store.jsx'
;
import
DomainStore
from
'../../stores/domain_store.jsx'
;
import
DomainStore
from
'../../stores/domain_store.jsx'
;
...
@@ -35,6 +36,7 @@ export default class DomainDetails extends React.Component {
...
@@ -35,6 +36,7 @@ export default class DomainDetails extends React.Component {
this
.
getDomain
=
this
.
getDomain
.
bind
(
this
);
this
.
getDomain
=
this
.
getDomain
.
bind
(
this
);
this
.
showMessage
=
this
.
showMessage
.
bind
(
this
);
this
.
showMessage
=
this
.
showMessage
.
bind
(
this
);
this
.
handleClickOnTab
=
this
.
handleClickOnTab
.
bind
(
this
);
this
.
handleClickOnTab
=
this
.
handleClickOnTab
.
bind
(
this
);
this
.
isGlobalAdmin
=
UserStore
.
isGlobalAdmin
();
this
.
state
=
{};
this
.
state
=
{};
}
}
...
@@ -225,6 +227,16 @@ export default class DomainDetails extends React.Component {
...
@@ -225,6 +227,16 @@ export default class DomainDetails extends React.Component {
zona_dns
:
zonaDNS
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
)
{
if
(
domain
.
isAliasDomain
)
{
tabNames
=
[
'Zona DNS'
];
tabNames
=
[
'Zona DNS'
];
tabs
=
{
tabs
=
{
...
...
src/components/domain/domain_distribution_list.jsx
View file @
2b44758f
...
@@ -43,6 +43,7 @@ export default class DomainDistributionList extends React.Component {
...
@@ -43,6 +43,7 @@ export default class DomainDistributionList extends React.Component {
const
domain
=
this
.
props
.
domain
;
const
domain
=
this
.
props
.
domain
;
domain
.
getAllDistributionLists
(
domain
.
getAllDistributionLists
(
(
err
,
lists
)
=>
{
(
err
,
lists
)
=>
{
console
.
log
(
'getAllDL'
,
lists
);
//eslint-disable-line no-console
if
(
this
.
isStoreEnabled
)
{
if
(
this
.
isStoreEnabled
)
{
DomainStore
.
setDistibutionLists
(
domain
,
lists
);
DomainStore
.
setDistibutionLists
(
domain
,
lists
);
}
}
...
@@ -61,6 +62,7 @@ export default class DomainDistributionList extends React.Component {
...
@@ -61,6 +62,7 @@ export default class DomainDistributionList extends React.Component {
onListsChange
()
{
onListsChange
()
{
const
lists
=
this
.
isStoreEnabled
?
DomainStore
.
getDistributionLists
(
this
.
props
.
domain
)
:
null
;
const
lists
=
this
.
isStoreEnabled
?
DomainStore
.
getDistributionLists
(
this
.
props
.
domain
)
:
null
;
if
(
!
lists
)
{
if
(
!
lists
)
{
console
.
log
(
'no store'
);
//eslint-disable-line no-console
return
this
.
getLists
();
return
this
.
getLists
();
}
}
...
...
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