{"id":900,"date":"2022-08-30T15:09:03","date_gmt":"2022-08-30T15:09:03","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/google-cpanel-and-zend-php-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:09:03","modified_gmt":"2022-08-30T15:09:03","slug":"google-cpanel-and-zend-php-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/google-cpanel-and-zend-php-collection-of-common-programming-errors\/","title":{"rendered":"Google cPanel and Zend\/PHP-Collection of common programming errors"},"content":{"rendered":"<p>Im trying to retrieve all users from a domain, but I get an error..<\/p>\n<p>Have downloaded the Zend library<\/p>\n<p>Docs:<\/p>\n<p>https:\/\/developers.google.com\/google-apps\/provisioning\/?hl=da#retrieving_user_accounts<\/p>\n<p>Get this error:<\/p>\n<pre><code>Fatal error: Call to undefined method Zend_Gdata_HttpClient::retrieveAllUsers()\n<\/code><\/pre>\n<p>script:<\/p>\n<pre><code>require_once 'Zend\/Loader.php';\nZend_Loader::loadClass('Zend_Gdata_ClientLogin');\nZend_Loader::loadClass('Zend_Gdata_Gapps');\n\n$email = 'alias@mail.com';\n$password = 'password';\n$client = Zend_Gdata_ClientLogin::getHttpClient($email, $password, Zend_Gdata_Gapps::AUTH_SERVICE_NAME);\n\necho '<\/code><\/pre>\n<pre><code>';\nprint_r($client-&gt;retrieveAllUsers());\necho '<\/code><\/pre>\n<pre>';\n<\/pre>\n<ol>\n<li>\n<p><code>Seems like you try to access the retrieveAllUsers method on an instance of the wrong object (Zend_Gdata_HttpClient instead of Zend_Gdata_Gapps).<\/code><\/p>\n<p><code>Try this:<\/code><\/p>\n<pre><code><code>$client = Zend_Gdata_ClientLogin::getHttpClient($email, $password, Zend_Gdata_Gapps::AUTH_SERVICE_NAME);\n$gdata = new Zend_Gdata_Gapps($client, 'mydomain.com');\n$users = $gdata-&gt;retrieveAllUsers();\n<\/code><\/code><\/pre>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 22:56:15. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Im trying to retrieve all users from a domain, but I get an error.. Have downloaded the Zend library Docs: https:\/\/developers.google.com\/google-apps\/provisioning\/?hl=da#retrieving_user_accounts Get this error: Fatal error: Call to undefined method Zend_Gdata_HttpClient::retrieveAllUsers() script: require_once &#8216;Zend\/Loader.php&#8217;; Zend_Loader::loadClass(&#8216;Zend_Gdata_ClientLogin&#8217;); Zend_Loader::loadClass(&#8216;Zend_Gdata_Gapps&#8217;); $email = &#8216;alias@mail.com&#8217;; $password = &#8216;password&#8217;; $client = Zend_Gdata_ClientLogin::getHttpClient($email, $password, Zend_Gdata_Gapps::AUTH_SERVICE_NAME); echo &#8216; &#8216;; print_r($client-&gt;retrieveAllUsers()); echo &#8216; &#8216;; Seems [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-900","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=900"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/900\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}