ZF-9264: Running Gapps class's suspend() or restore() on non-existing accounts results in fatal error

Issue Type: Bug Created: 2010-02-25T08:03:10.000+0000 Last Updated: 2010-10-04T16:33:17.000+0000 Status: Resolved Fix version(s): - 1.10.7 (28/Jul/10)

Reporter: Chua Chee How (chuacheehow) Assignee: Trevor Johns (tjohns) Tags: - Zend_Gdata

Related issues: Attachments: - patch.diff


When the suspend() or restore() method in Zend_Gdata_Gapps is run on a non-existing user, a fatal error is thrown.

Test code:

$domain = ''; $username = "admin_account@$domain"; $password = 'password';

$client = Zend_Gdata_ClientLogin::getHttpClient($username, $password, Zend_Gdata_Gapps::AUTH_SERVICE_NAME); $gapps = new Zend_Gdata_Gapps($client, $domain);

$nonExistingUser = 'nobodynobody'; $gapps->suspendUser($nonExistingUser);

The above will result in the error:

Fatal error: Call to undefined method stdClass::save() in /home/cheeze/public_html/jotterlab/library/Zend/Gdata/Gapps.php on line 788

A similar problem exists for restoreUser().

A better solution is to throw an exception. The following lines:

if ($user === null) { throw new Zend_Gdata_Gapps_ServiceException(); }

can be placed right after the calling of retrieveUser() in both the functions.


Posted by Chua Chee How (chuacheehow) on 2010-02-25T08:05:58.000+0000

The attached file is the diff output from svn diff

Posted by Trevor Johns (tjohns) on 2010-10-04T16:33:15.000+0000

Fixed by r22511.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.