priyadi / roundcube-converse.js-xmpp-plugin

XMPP plugin for Roundcube Webmail based on converse.js
49 stars 18 forks source link

Roundcube fails if XMPP server offline. #20

Closed masterxq closed 10 years ago

masterxq commented 10 years ago

Roundcube will fail loading if the XMPP server is offline. With the error: PHP Fatal error: Call to a member function getAttribute() on a non-object in /var/lib/roundcube/plugins/converse/php/xmpp-prebind-php/lib/XmppPrebind.php on line 127

That should be catched.

Thanks for your work MasterQ

PoGo606 commented 10 years ago

Same problem here, whole roundcube should be able to run even with the XMPP server offline.

priyadi commented 10 years ago

I fixed this in XmppPrebind.php upstream long time ago. But I totally forgot to update its copy here. It's committed now and it should give you login form if the XMPP server is offline.

PoGo606 commented 10 years ago

Hello,

Thanks for the update, but I'm afraid that it didn't fix all the issue. I've shutdown the xmpp server, and try to connect to Roundcube, I've got the following error message :

Fatal error: Call to a member function getAttribute() on a non-object in /usr/share/apache2/roundcubemail/plugins/converse/php/xmpp-prebind-php/lib/XmppPrebind.php on line 133

I've check the file XmppPrebind.php and it has been updated accordingly to your repository.

priyadi commented 10 years ago

Hi, try modifying around line 133 so it looks like the following:

                $response = $this->sendInitialConnection();

                $body = self::getBodyFromXml($response);
                if (is_object($body)) {
                        $this->sid = $body->getAttribute('sid');
                } else {
                        throw new Exception('Unable to connect to XMPP server');
                }
                $this->debug($this->sid, 'sid');

Let me know if this fixes your problem.

PoGo606 commented 10 years ago

Yes it did !

Many thanks !

priyadi commented 10 years ago

Fix committed. Let me know if there's any more problem.