How to change status

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

How to change status

Post by subh1 »

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: 1326
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

Post by DualBoot »

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

Post by subh1 »

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: 1326
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

Post by DualBoot »

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

Post by subh1 »

Hi

change the status name in small letter did the trick. Thanks a lot. Really appreciate your help 8-)
User avatar
vnngoanhtuan
Posts: 9
Joined: Wed Feb 20, 2019 8:44 am

Re: How to change status

Post by vnngoanhtuan »

Hi,

Can you help me on this case? I did the same but get error: PHP Fatal error: Uncaught Error: Class 'KeyValuePair' not found in /file.php

Thanks,
Tuan Ngo
Post Reply