Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra - Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 09-20-2008, 01:20 PM
Active Member
 
Posts: 41
Default

after more testing I think it might be related to a bug in the PHP libcurl version installed on my ISP's web server.
The exact same test script works, at least gets a connection & returns an error, if I try posting a string to standard port 80.

Theres mention of the curlopt_PORT feature not functioning correctly on older versions of libcurl (googled it ) . I'll test the php soap script from a different client server in the next few days.
__________________
Derek Buchanan
Director

Utilis Technology Ltd.
http://www.utilis.ie
Reply With Quote
  #12 (permalink)  
Old 09-24-2008, 10:56 AM
Active Member
 
Posts: 41
Default

this is confusing. I've tried a separate hosted client server from a different ISP running PHP 4 and PHP5 . I've tried connecting to two separate zimbra servers. There are no firewalls blocking port 7071 and I can access admin console on port 7071 via web browser.

PHP libcurl & soap are installed and enabled (details below).
I'm still getting a curl error 7 when I try to run a PHP page which call a simple zimbra PHP soap function .

Is there a simple PHP script anyone can give me to do a basic soap auth/logon test and return a result ?

I'm stuck here as it should be straight forward according to the success of other users in the forum have had.

Thanks,
Derek

soap
Soap Client enabled
Soap Server enabled

Directive Local Value Master Value
soap.wsdl_cache 1 1
soap.wsdl_cache_dir /tmp /tmp
soap.wsdl_cache_enabled 1 1
soap.wsdl_cache_limit 5 5
soap.wsdl_cache_ttl 86400 86400


curl
cURL support enabled
cURL Information libcurl/7.12.1 OpenSSL/0.9.7a zlib/1.2.1.2 libidn/0.5.6
__________________
Derek Buchanan
Director

Utilis Technology Ltd.
http://www.utilis.ie

Last edited by DEREKB : 09-24-2008 at 02:12 PM.
Reply With Quote
  #13 (permalink)  
Old 11-03-2008, 03:16 AM
Project Contributor
 
Posts: 14
Default SOAP/PHP How to use zimbraadmin.php..?

Hello,

I really need help to user zimbraAdmin.php ([SOLVED] PHP Class for easy access to Zimbra SOAP API)

the function 'zimbra_create_account' & 'zimbra_get_quota_usage' very
intesting me, but i don't know how it works...

i would like to create method like
'simple_create_account($email,$domain,$password, $firstname,
$lastname)' but i don't know the attributes to uses in the function 'zimbra_create_account' and i don't know (!) where i can seach the quota of a user... I search in the
account properties without success.

Can anyone help me ?

I post my work when i finish my work, ( with debugging function etc...)

Bests regards,
Reply With Quote
  #14 (permalink)  
Old 11-04-2008, 04:16 AM
Project Contributor
 
Posts: 14
Wink

Code:
public function zimbra_create_account($email,$password,$firstname,$lastname){
	 	$sim = new simba;
		$zim = $sim->_zimbra_login();//extends zimbra_login
		$sim = null;
		//DEFINITION DES ATTRIBUTS
		$a = array('displayName'=>$firstname.' '.$lastname,'givenName'=>$firstname,'sn'=>$lastname,'zimbraMailCanonicalAddress'=>$email);

		$val = $zim->zimbra_create_account($email,$password,$a);
		
		if ($val != false)
			return $val; 
		else
			return array(0 => ' impossible account creation ');	 
	 }
Reply With Quote
  #15 (permalink)  
Old 02-16-2009, 06:00 PM
Member
 
Posts: 14
Default

First, thank you Ron again for providing such useful scripts.

I am trying to test the script and, like derek, I am having some trouble getting pass the authentication and connecting to the server.

i have moved all the files (zimbraAdmin.php, zimbraAdmin.config, xmlparse.php, get_mail.php, get_account.php) into the root folder of my webserver.

I tried to run get_email.php for testing purpose. It waits for a response and after a min or so it comes back with:

#!/usr/bin/php Could not authenticate to the Zimbra server

In my .config file, I have:

$zimbraserver = "host.mydomain.com";
$zimbraadminemail = "admin@mydomain.com";
$zimbraadminpassword = "pwd";

------------------------------------------------------------

I am able to access my admin at https://host.mydomain.com:7071/ through my browser.

I have checked that my Zimbra server has Curl enabled:

curl
CURL support => enabled
CURL Information => libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5

Iptables are all disabled so there should be no firewall issue.

Can someone shed some light on how to get the connection going? Could it be issue with my webserver side? I am using a shared hosting account for web right now.
Reply With Quote
  #16 (permalink)  
Old 02-17-2009, 01:10 AM
Project Contributor
 
Posts: 14
Talking

Hi,

there is lot of bugs in the original zimbraAdmin functions.

I make another versions without bugs @ this time.

You can get this version here:
http://syruis.free.fr/php/zimbraAdmin.tar.gz

For Support and help you can contact CELESTE @:
The lab'

In the archive you can see two folders with the older functions and a "magic" class call zimbra that can help you very well.
Edit=> I have make a Zend bootstap to include functions in the php4 function in the php5 class. But you can use something like include "../zimbraAdmin/zimbraAdmin.php"; ....
To change your settings use:
Code:
protected function _zimbra_login() {
		global $params, $libelles;
		$zimbraserver = $this->_getSettings($params->ZIMBRASOAP, $params->host);
		;
		$zimbraadminemail = $this->_getSettings($params->ZIMBRASOAP, $params->login);
		;
		$zimbraadminpassword = $this->_getSettings($params->ZIMBRASOAP, $params->password);
[...]
or directelly
Code:
$zim = new zimbraAdmin($zimbraserver);
$zim->zimbra_login($zimbraadminemail, $zimbraadminpassword);
$this->zim = $zim;
This code use zimbra connection cache.. thanks php5 -


Good lucks,
Syruis

Last edited by Syruis : 02-17-2009 at 04:08 AM. Reason: code
Reply With Quote
  #17 (permalink)  
Old 03-27-2009, 11:57 PM
Junior Member
 
Posts: 5
Default Security issue

Thanks for the script - I haven't tried using it yet, but it looks like it fits almost exactly what I need.

I'd just like to point out that there's a somewhat large security hole in the naming of zimbraAdmin.config. In a default installation of apache (whereby php script isn't executed on files without the appropriate file extension), and most other webservers (IIS excluded - I'm fairly sure it doesn't hand out plaintext .config files), this file can be accessed directly and in plaintext by simply navigating to the file URL in a browser.

Due to the extremely sensitive nature of the data that's held in the .config file, I think it would be a good idea to hold this data in a file with the .php extension, e.g. zimbraAdminconfig.php. This would ensure that every server will execute the script server-side and thus not make the contained data viewable via a simple GET request.

Thanks again
Reply With Quote
  #18 (permalink)  
Old 08-27-2009, 12:33 PM
bvd bvd is offline
Starter Member
 
Posts: 2
Default Add Virtual Host with Class

Is there a way to add more than one virtual host with this class? I can't seem to add more than one with a domain with it.
Reply With Quote
  #19 (permalink)  
Old 09-08-2009, 01:52 AM
Project Contributor
 
Posts: 14
Default

this class is multi-domain. You only have to... don't specify domain...
Reply With Quote
  #20 (permalink)  
Old 09-08-2009, 06:21 AM
bvd bvd is offline
Starter Member
 
Posts: 2
Default re:Add Virtual Host with Class

I guess I should have posted the code I'm having problems with.

Code:
$domains_name = "test.com";
$vhosts_name = "mail.test.com";
$vhosts2_name = "webmail.test.com";


// add vhost on zimbra server             

if($zim->zimbra_modify_domain($domains_name,$a=array('zimbraVirtualHostname'=>$vhosts_name,'zimbraVirtualHostname[1]=>$vhosts2_name))==true){
        
            
        // add vhost on db->vhosts
        
        $message = "looking good so far";
        $message_class = "message_good";

        } else {
            
            $message = "hmmm something went wrong.";
            $message_class = "message_bad";
            
        }
In the Zimbra Admin panel, they have the vhosts listed as zimbraVirtualHostname[0] and zimbraVirtualHostname[1] as you add them there, so I tried it with the same thinking it would add them as an array. But it didn't.

Am I just missing the boat completely??

Thanks so much for the reply and the help!

Last edited by bvd : 09-10-2009 at 02:01 PM.
Reply With Quote
Reply


Thread Tools
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0