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
dabece5d
Commit
dabece5d
authored
Jul 26, 2016
by
Patricio Bruna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added getAccountViewMailPath()
parent
080be678
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
0 deletions
+26
-0
README.md
README.md
+2
-0
zimbra-admin-api.js
lib/zimbra-admin-api.js
+8
-0
index.js
src/index.js
+7
-0
test.js
test/js/spec/test.js
+9
-0
No files found.
README.md
View file @
dabece5d
...
...
@@ -390,6 +390,8 @@ This return an `URL PATH` to access the account Webmail as an administrator.
The first parameter is the
`lifetime`
of the Token in seconds.
```
javascript
client
.
getAccountViewMailPath
(
account
.
name
,
3600
,
callback
);
// OR
account
.
viewMailPath
(
3600
,
callback
);
// /service/preauth?authtoken=0_8c671f3146....&isredirect=1&adminPreAuth=1
```
...
...
lib/zimbra-admin-api.js
View file @
dabece5d
...
...
@@ -432,6 +432,14 @@ return /******/ (function(modules) { // webpackBootstrap
value: function getAccount(identifier, callback) {
return this.get('Account', identifier, callback);
}
}, {
key: 'getAccountViewMailPath',
value: function getAccountViewMailPath(account, lifetime_seconds, callback) {
this.getAccount(account, function (err, account) {
if (err) return callback(err);
return account.viewMailPath(lifetime_seconds, callback);
});
}
}, {
key: 'getDistributionListOwners',
value: function getDistributionListOwners(distributionList, callback) {
...
...
src/index.js
View file @
dabece5d
...
...
@@ -328,6 +328,13 @@ class ZimbraAdminApi {
return
this
.
get
(
'Account'
,
identifier
,
callback
);
}
getAccountViewMailPath
(
account
,
lifetime_seconds
,
callback
)
{
this
.
getAccount
(
account
,
(
err
,
account
)
=>
{
if
(
err
)
return
callback
(
err
);
return
account
.
viewMailPath
(
lifetime_seconds
,
callback
);
});
}
getDistributionListOwners
(
distributionList
,
callback
)
{
this
.
getDistributionList
(
distributionList
,
(
err
,
dl
)
=>
{
if
(
err
)
return
callback
(
err
);
...
...
test/js/spec/test.js
View file @
dabece5d
...
...
@@ -14,6 +14,15 @@
this
.
timeout
(
10000
);
it
(
'Should return the viewMailPath'
,
function
(
done
){
let
api
=
new
ZimbraAdminApi
(
auth_data
);
api
.
getAccountViewMailPath
(
'admin@zboxapp.dev'
,
null
,
function
(
err
,
account
){
if
(
err
)
return
console
.
error
(
err
);
expect
(
account
).
to
.
match
(
/adminPreAuth=1$/
);
done
();
});
});
it
(
'getDistributionListOwners should return the DL owners'
,
function
(
done
)
{
let
api
=
new
ZimbraAdminApi
(
auth_data
);
api
.
getDistributionListOwners
(
'restringida@customer.dev'
,
function
(
err
,
data
){
...
...
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