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
05c15d68
Commit
05c15d68
authored
May 31, 2016
by
Juorder Antonio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix archiving show on edit mailbox, antispam when create, delete, with special character solved too
parent
a2fdc008
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
13 deletions
+46
-13
antispam.jsx
src/components/domain/antispam.jsx
+30
-7
stats_mailbox.jsx
src/components/mailbox/stats_mailbox.jsx
+3
-1
config.json
src/config/config.json
+12
-4
utils.jsx
src/utils/utils.jsx
+1
-1
No files found.
src/components/domain/antispam.jsx
View file @
05c15d68
...
@@ -47,7 +47,7 @@ export default class AntiSpam extends React.Component {
...
@@ -47,7 +47,7 @@ export default class AntiSpam extends React.Component {
break
;
break
;
}
}
this
.
alterDomain
(
attrs
);
this
.
alterDomain
(
attrs
,
action
);
}
}
searchItemToRemove
(
array
,
item
)
{
searchItemToRemove
(
array
,
item
)
{
...
@@ -65,12 +65,22 @@ export default class AntiSpam extends React.Component {
...
@@ -65,12 +65,22 @@ export default class AntiSpam extends React.Component {
const
attrs
=
{};
const
attrs
=
{};
const
isEmail
=
/^
(([^
<>()
\[\]\\
.,;:
\s
@"
]
+
(\.[^
<>()
\[\]\\
.,;:
\s
@"
]
+
)
*
)
|
(
".+"
))
@
((\[[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}
]
)
|
(([
a-zA-Z
\-
0-9
]
+
\.)
+
[
a-zA-Z
]{2,}))
$/
;
const
isEmail
=
/^
(([^
<>()
\[\]\\
.,;:
\s
@"
]
+
(\.[^
<>()
\[\]\\
.,;:
\s
@"
]
+
)
*
)
|
(
".+"
))
@
((\[[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}
]
)
|
(([
a-zA-Z
\-
0-9
]
+
\.)
+
[
a-zA-Z
]{2,}))
$/
;
const
isDomain
=
/^
[
a-zA-Z0-9
][
a-zA-Z0-9-
]{1,61}[
a-zA-Z0-9
](?:\.[
a-zA-Z
]{2,})
+$/
;
const
isDomain
=
/^
[
a-zA-Z0-9
][
a-zA-Z0-9-
]{1,61}[
a-zA-Z0-9
](?:\.[
a-zA-Z
]{2,})
+$/
;
const
invalidInput
=
/ñ/gi
;
const
target
=
action
===
'black'
?
'lista negra'
:
'lista blanca'
;
const
target
=
action
===
'black'
?
'lista negra'
:
'lista blanca'
;
let
clone
=
null
;
e
.
preventDefault
();
e
.
preventDefault
();
const
input
=
this
.
refs
[
`
${
action
}
-item`
];
const
input
=
this
.
refs
[
`
${
action
}
-item`
];
const
value
=
input
.
value
.
trim
();
const
value
=
input
.
value
.
trim
();
if
(
invalidInput
.
test
(
value
))
{
EventStore
.
emitMessage
({
message
:
'El valor de esta lista no puede contener caracteres "Ñ".'
,
typeError
:
MessageType
.
ERROR
});
return
false
;
}
if
(
!
value
||
value
===
''
)
{
if
(
!
value
||
value
===
''
)
{
EventStore
.
emitMessage
({
EventStore
.
emitMessage
({
message
:
`No puede agregar una
${
target
}
vacia.`
,
message
:
`No puede agregar una
${
target
}
vacia.`
,
...
@@ -91,24 +101,28 @@ export default class AntiSpam extends React.Component {
...
@@ -91,24 +101,28 @@ export default class AntiSpam extends React.Component {
switch
(
action
)
{
switch
(
action
)
{
case
'black'
:
case
'black'
:
this
.
blackList
.
push
(
value
);
clone
=
this
.
blackList
.
slice
();
attrs
.
amavisBlacklistSender
=
this
.
blackList
;
clone
.
push
(
value
);
attrs
.
amavisBlacklistSender
=
clone
;
break
;
break
;
case
'white'
:
case
'white'
:
this
.
whiteList
.
push
(
value
);
clone
=
this
.
whiteList
.
slice
();
attrs
.
amavisWhitelistSender
=
this
.
whiteList
;
clone
.
push
(
value
);
attrs
.
amavisWhitelistSender
=
clone
;
break
;
break
;
}
}
return
this
.
alterDomain
(
attrs
,
e
.
target
,
input
);
return
this
.
alterDomain
(
attrs
,
action
,
e
.
target
,
input
);
}
}
alterDomain
(
attrs
,
button
,
input
)
{
alterDomain
(
attrs
,
action
,
button
,
input
)
{
const
domain
=
this
.
domain
;
const
domain
=
this
.
domain
;
const
hasButton
=
button
||
false
;
const
hasButton
=
button
||
false
;
const
hasInput
=
input
||
false
;
const
hasInput
=
input
||
false
;
let
oldContent
=
null
;
let
oldContent
=
null
;
let
id
=
null
;
let
id
=
null
;
let
returns
;
const
key
=
Object
.
keys
(
attrs
).
pop
();
if
(
hasButton
)
{
if
(
hasButton
)
{
oldContent
=
button
.
innerHTML
;
oldContent
=
button
.
innerHTML
;
...
@@ -128,6 +142,15 @@ export default class AntiSpam extends React.Component {
...
@@ -128,6 +142,15 @@ export default class AntiSpam extends React.Component {
});
});
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
DomainStore
.
setCurrent
(
res
);
DomainStore
.
setCurrent
(
res
);
returns
=
res
.
attrs
[
key
]
?
res
.
attrs
[
key
]
:
[];
returns
=
Array
.
isArray
(
returns
)
?
returns
:
[
returns
];
if
(
action
===
'black'
)
{
this
.
blackList
=
returns
;
}
else
{
this
.
whiteList
=
returns
;
}
this
.
setState
({
this
.
setState
({
update
:
true
update
:
true
});
});
...
...
src/components/mailbox/stats_mailbox.jsx
View file @
05c15d68
...
@@ -12,6 +12,8 @@ export default class BlockGeneralInfoMailbox extends React.Component {
...
@@ -12,6 +12,8 @@ export default class BlockGeneralInfoMailbox extends React.Component {
this
.
lastConection
=
'No se ha conectado'
;
this
.
lastConection
=
'No se ha conectado'
;
this
.
getMailSize
=
this
.
getMailSize
.
bind
(
this
);
this
.
getMailSize
=
this
.
getMailSize
.
bind
(
this
);
this
.
sizeEnabled
=
Utils
.
getEnabledPlansObjectByCos
(
ZimbraStore
.
getAllCos
(),
this
.
props
.
data
.
attrs
.
zimbraCOSId
);
this
.
sizeEnabled
=
Utils
.
getEnabledPlansObjectByCos
(
ZimbraStore
.
getAllCos
(),
this
.
props
.
data
.
attrs
.
zimbraCOSId
);
console
.
log
(
'cosID'
,
this
.
props
.
data
.
attrs
.
zimbraCOSId
);
//eslint-disable-line no-console
console
.
log
(
'all cos'
,
ZimbraStore
.
getAllCos
());
//eslint-disable-line no-console
this
.
state
=
{};
this
.
state
=
{};
}
}
...
@@ -66,7 +68,7 @@ export default class BlockGeneralInfoMailbox extends React.Component {
...
@@ -66,7 +68,7 @@ export default class BlockGeneralInfoMailbox extends React.Component {
if
(
this
.
state
.
size
)
{
if
(
this
.
state
.
size
)
{
size
=
this
.
state
.
size
;
size
=
this
.
state
.
size
;
}
}
console
.
log
(
this
.
sizeEnabled
);
//eslint-disable-line no-console
if
(
this
.
sizeEnabled
.
hasOwnProperty
(
'attrs'
)
&&
this
.
sizeEnabled
.
attrs
.
zimbraMailQuota
)
{
if
(
this
.
sizeEnabled
.
hasOwnProperty
(
'attrs'
)
&&
this
.
sizeEnabled
.
attrs
.
zimbraMailQuota
)
{
const
sizeOfPlan
=
typeof
this
.
sizeEnabled
.
attrs
.
zimbraMailQuota
===
'string'
?
parseInt
(
this
.
sizeEnabled
.
attrs
.
zimbraMailQuota
,
10
)
:
this
.
sizeEnabled
.
attrs
.
zimbraMailQuota
;
const
sizeOfPlan
=
typeof
this
.
sizeEnabled
.
attrs
.
zimbraMailQuota
===
'string'
?
parseInt
(
this
.
sizeEnabled
.
attrs
.
zimbraMailQuota
,
10
)
:
this
.
sizeEnabled
.
attrs
.
zimbraMailQuota
;
...
...
src/config/config.json
View file @
05c15d68
...
@@ -13,17 +13,25 @@
...
@@ -13,17 +13,25 @@
"plans"
:
{
"plans"
:
{
"basic"
:
{
"basic"
:
{
"statusCos"
:
"btn-success"
,
"statusCos"
:
"btn-success"
,
"label"
:
"Básica"
"label"
:
"Básica"
,
"isEnabledToEdit"
:
true
},
},
"premium"
:
{
"premium"
:
{
"statusCos"
:
"btn-primary2"
,
"statusCos"
:
"btn-primary2"
,
"label"
:
"Premium"
"label"
:
"Premium"
,
"isEnabledToEdit"
:
true
},
},
"professional"
:
{
"professional"
:
{
"statusCos"
:
"btn-primary"
,
"statusCos"
:
"btn-primary"
,
"label"
:
"Profesional"
"label"
:
"Profesional"
,
"isEnabledToEdit"
:
true
},
},
"default"
:
false
"default"
:
false
,
"archiving"
:
{
"statusCos"
:
"btn-warning"
,
"label"
:
"Archiving"
,
"isEnabledToEdit"
:
false
}
},
},
"multiFormDomain"
:
{
"multiFormDomain"
:
{
"hasMailCleaner"
:
false
,
"hasMailCleaner"
:
false
,
...
...
src/utils/utils.jsx
View file @
05c15d68
...
@@ -291,7 +291,7 @@ export function getEnabledPlansByCos(cosArray) {
...
@@ -291,7 +291,7 @@ export function getEnabledPlansByCos(cosArray) {
cosArray
.
forEach
((
cos
)
=>
{
cosArray
.
forEach
((
cos
)
=>
{
const
key
=
cos
.
name
;
const
key
=
cos
.
name
;
if
(
configPlans
.
hasOwnProperty
(
key
)
&&
configPlans
[
key
])
{
if
(
configPlans
.
hasOwnProperty
(
key
)
&&
configPlans
[
key
]
&&
configPlans
[
key
].
isEnabledToEdit
)
{
plans
[
key
]
=
cos
.
id
;
plans
[
key
]
=
cos
.
id
;
}
}
});
});
...
...
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