0

我试图从域中检索所有用户,但出现错误..

已下载 Zend 库

文件:

https://developers.google.com/google-apps/provisioning/?hl=da#retrieving_user_accounts

得到这个错误:

Fatal error: Call to undefined method Zend_Gdata_HttpClient::retrieveAllUsers()

脚本:

require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Gapps');

$email = 'alias@mail.com';
$password = 'password';
$client = Zend_Gdata_ClientLogin::getHttpClient($email, $password, Zend_Gdata_Gapps::AUTH_SERVICE_NAME);

echo '<pre>';
print_r($client->retrieveAllUsers());
echo '</pre>';
4

1 回答 1

1

似乎您尝试在错误对象的实例上访问 retrieveAllUsers 方法(Zend_Gdata_HttpClient 而不是 Zend_Gdata_Gapps)。

试试这个:

$client = Zend_Gdata_ClientLogin::getHttpClient($email, $password, Zend_Gdata_Gapps::AUTH_SERVICE_NAME);
$gdata = new Zend_Gdata_Gapps($client, 'mydomain.com');
$users = $gdata->retrieveAllUsers();
于 2012-07-26T13:51:59.493 回答