Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating from PHP Soap module: Cannot use stdclass as array #111

Open
qroac opened this issue Sep 26, 2023 · 0 comments
Open

Migrating from PHP Soap module: Cannot use stdclass as array #111

qroac opened this issue Sep 26, 2023 · 0 comments

Comments

@qroac
Copy link

qroac commented Sep 26, 2023

On request of a user I started migrating my Nextcloud auth app for ISPConfig from php-soap to this library.
SpicyWeb-de/nextcloud-user-ispconfig#13
Without depending on php-soap, the app can be more easily used in shared hosting environments, so I see nusoap as big enhancement.

Migration went quite smooth so far.
I struggle just with one API call that is required to change users passwords. The server responds with

array(2) {
  ["faultcode"]=>
  string(15) "SOAP-ENV:Server"
  ["faultstring"]=>
  string(43) "Cannot use object of type stdClass as array"
}

Here is my migration:

// Original call
// $rowsUpdated = $this->soap->mail_user_update($this->session, $remoteUid, $mailuser['mailuser_id'], $params);
// nusoap call
$rowsUpdated = $this->nusoap->call('mail_user_update', [$this->nusession, $remoteUid, $mailuser['mailuser_id'], $mailuser]);
var_dump($rowsUpdated);

This appears only with the nusoap call. the php-soap call still works as expected.
Do you have any Idea what could cause this problem or what I can do to fix it?

This is a var_dump of the params given to the nusoap call. I cannot see anything that looks line a std object.

array(4) {
  [0]=>
  string(32) "7199b31458b...session ID"
  [1]=>
  int(0)
  [2]=>
  string(3) "111"
  [3]=>
  array(41) {
    ["mailuser_id"]=>
    string(3) "111"
    ["sys_userid"]=>
    string(1) "1"
    ["sys_groupid"]=>
    string(1) "2"
    ["sys_perm_user"]=>
    string(4) "riud"
    ["sys_perm_group"]=>
    string(4) "riud"
    ["sys_perm_other"]=>
    string(0) ""
    ["server_id"]=>
    string(1) "3"
    ["email"]=>
    string(17) "[email protected]"
    ["login"]=>
    string(17) "[email protected]"
    ["password"]=>
    string(10) "newPassword"
    ["name"]=>
    string(4) "someMailbox"
    ["uid"]=>
    string(4) "5000"
    ["gid"]=>
    string(4) "5000"
    ["maildir"]=>
    string(28) "/var/vmail/mail.box/some"
    ["maildir_format"]=>
    string(7) "maildir"
    ["quota"]=>
    string(1) "0"
    ["cc"]=>
    string(0) ""
    ["sender_cc"]=>
    string(0) ""
    ["homedir"]=>
    string(10) "/var/vmail"
    ["autoresponder"]=>
    string(1) "n"
    ["autoresponder_start_date"]=>
    NULL
    ["autoresponder_end_date"]=>
    NULL
    ["autoresponder_subject"]=>
    string(19) "Out of office reply"
    ["autoresponder_text"]=>
    string(0) ""
    ["move_junk"]=>
    string(1) "n"
    ["custom_mailfilter"]=>
    NULL
    ["postfix"]=>
    string(1) "y"
    ["greylisting"]=>
    string(1) "n"
    ["access"]=>
    string(1) "y"
    ["disableimap"]=>
    string(1) "n"
    ["disablepop3"]=>
    string(1) "n"
    ["disabledeliver"]=>
    string(1) "n"
    ["disablesmtp"]=>
    string(1) "n"
    ["disablesieve"]=>
    string(1) "n"
    ["disablesieve-filter"]=>
    string(1) "n"
    ["disablelda"]=>
    string(1) "n"
    ["disablelmtp"]=>
    string(1) "n"
    ["disabledoveadm"]=>
    string(1) "n"
    ["last_quota_notification"]=>
    NULL
    ["backup_interval"]=>
    string(4) "none"
    ["backup_copies"]=>
    string(1) "1"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant