How to change status

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
subh1
Posts: 4
Joined: Tue Jun 02, 2020 9:18 am

How to change status

Postby subh1 » Thu Jun 04, 2020 12:31 pm

Hi
I would like change Account Status from Active to Closed/Locked. I tried with modifyAccount() to set zimbraAccountStatus but it always through an exception. Can anyone help me to resolve this? I m not sure whether it is possible ?


User avatar
DualBoot
Elite member
Elite member
Posts: 1308
Joined: Mon Apr 18, 2016 8:18 pm
Location: France - Earth
ZCS/ZD Version: ZCS FLOSS - 8.8.15 Mutli servers
Contact:

Re: How to change status

Postby DualBoot » Thu Jun 04, 2020 5:55 pm

Hello

show us the command you used and the output.

Regards,
subh1
Posts: 4
Joined: Tue Jun 02, 2020 9:18 am

Re: How to change status

Postby subh1 » Fri Jun 05, 2020 7:09 am

Hi,

I m using https://github.com/zimbra-api/zimbra-api to communicate ZCS with my PHP application.

//set attributes
$dnAttr = new KeyValuePair('displayName', 'John Doe');
$cnAttr = new KeyValuePair('cn', 'John Doe');
$titleAttr = new KeyValuePair('title', 'Dev Manager');
$statusAttr = new KeyValuePair('zimbraAccountStatus', 'Closed');
//Call method
$createAccountRes = $api->modifyAccount ($accountId, [$dnAttr, $cnAttr, $titleAttr]);

After that if I print the response, it gives me all the object attributes with New value; except the
zimbraAccountStatus
.

Thanks for your reply.
User avatar
DualBoot
Elite member
Elite member
Posts: 1308
Joined: Mon Apr 18, 2016 8:18 pm
Location: France - Earth
ZCS/ZD Version: ZCS FLOSS - 8.8.15 Mutli servers
Contact:

Re: How to change status

Postby DualBoot » Fri Jun 05, 2020 7:45 am

Maybe you should respected the case with full lower case for the account status.
value : active,maintenance,locked,closed,lockout,pending

Any other clues in the Zimbra log ? Is it possible to use a debug mode ? Did you post an issue in the GitHub repo ? As far as I see, this API could be out of date related to the evolution of Zimbra.

Regards,
subh1
Posts: 4
Joined: Tue Jun 02, 2020 9:18 am

Re: How to change status

Postby subh1 » Fri Jun 05, 2020 11:03 am

Hi

change the status name in small letter did the trick. Thanks a lot. Really appreciate your help 8-)

Return to “Developers”

Who is online

Users browsing this forum: No registered users and 5 guests