HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Developers' Forum (http://www.howtoforge.com/forums/forumdisplay.php?f=33)
-   -   New Module Microsoft Exchange Hosted (http://www.howtoforge.com/forums/showthread.php?t=61837)

remy74 14th May 2013 11:21

New Module Microsoft Exchange Hosted
 
Dear All,

We have started a new module, for managing Microsoft Exchange / Active Directory using ISPConfig. The goal of this module is to provide customer control into their Tenancy organization. There is a lot of works, but we are on the good way, and we have do a lot of stuff.
This module is on 2 parts, one on Windows (using a Windows service to communicate with the AD / Exchange and the database), and the second is on ISPConfig, for displaying, managing Active Directory Objects.

As this module use a copy of the LDAP database under mysql (done by the windows service) we need to implement complicate SQL query.

However, we didin't find documentation for ISPConfig for doing that.
We just see that every Mysql Table must have some columns, like sys_userid, sys_groupid etc..
How can we do that ? We need to implement "where" to the query, but on the module, we have to select all the table, and the {AUTHSQL} never help .

Is there a way for doing that ?
like that :

Code:

$liste["name"]                                = "Exchange_details";
// Database table
$liste["table"]                                = "AD_MY_TABLE";
$liste["where"]                        = "columns='" .  $_REQUEST['id']  ."'";

Also, we need to use other objects with mysql, for performance, like stored procedure, and views..

In advance, thanks for your help.

PS: Of course, when this module will be done, all the sources will be push to the community, include Windows source.

till 14th May 2013 13:48

You can override many values or override subfunctions of the list object including the complete "where" part of the sql query. Example from web_domain_list.php:

Code:

$list = new list_action;
$list->SQLExtWhere = "type = 'vhost' AND parent_domain_id = '0'";
$list->SQLOrderBy = 'ORDER BY domain';
$list->onLoad();

The list object is defined in lib/classes/listform_actions.inc.php, its a good place to get a overview of the existing functions. Basically you can override nearly every aspect of the list generation and query building in ispconfig.

remy74 14th May 2013 13:59

Thanks for your prompt reply !
This is what we see when we browse the ISPCONFIG class (list form_actions.inc.php)
We test it, and it's working fine ! Again, thanks for your help !

Is there a global documentation about all the classes ?

till 14th May 2013 14:08

Quote:

Is there a global documentation about all the classes ?
No, not yet. It is planned but we simply did not had the time to write it.

Basically forms are inherited from tform_actions class and lists from listform_actions class. You can override subfunctions of the form calss similar to the list class, so you can read even data from other sources then mysql. See e.g. the admin/server_config_edit.php file which reads the data that is displayed in the form from a ini style text blob field in mysql (it could have been a file as well or also ldap if you use ldap functions to get data in form of a array / hash in php.

remy74 23rd May 2013 17:30

Hi,

We are on the good way with the module, but we have some problem.
For example, users have multiple properties to be set / or change.
But on our module, you are not allowed to change mail address and reset the password, or unlock account etc..
For the moment, we manage users using a tform with multiple TAB. When we switch from one TAB to another TAB, it's automatically save into the database. This is not what we except.. Is there a possible override to block that ?
We do not wan't to build each form for each function, and if we have another way..
Thanks for your help !

till 23rd May 2013 17:35

Quote:

For the moment, we manage users using a tform with multiple TAB. When we switch from one TAB to another TAB, it's automatically save into the database. This is not what we except.. Is there a possible override to block that ?
This is configurable under System > Interface config.

remy74 27th May 2013 16:07

Hi All,

Another question for everybody who knows.. Is there an inside function to convert a integer of byte to MB / GB / TB before display it ?
We have see :

Code:

    public function convertSize($value)
    {
        $unit = array('Bytes', 'KB', 'MB', 'GB', 'TB');
        return @round($value/pow(1024, ($i = floor(log($value, 1024)))), 2).' '.$unit[$i];
    }

under ApsBase, but nothing that could help us.
We would like to use it for display the value, not set it (in the DB we prefer have the byte value..)
Maybe with a filter in the tform ?
If someone have an idea..

Thanks for your precious help.

till 27th May 2013 16:26

There is no api function availbale for that. The places were we use such conversions (e.g. web statistics) it is hard coded. Its a good idea to add it as a filter in the next version.

florian030 27th May 2013 17:24

I use

Code:

function formatBytes($size, $precision = 2) {
        $base=log($size)/log(1024);
        $suffixes=array('','k','M','G','T');
        return round(pow(1024,$base-floor($base)),$precision).$suffixes[floor($base)];
}

in cron_daily.php to add the Backup-Size of each file to the Database. The patch is avalable in the svn-trunk.

remy74 28th May 2013 08:52

Quote:

The patch is avalable in the svn-trunk.
Thanks for your answer, but what do you mean about this ?
Do you said that you have implement this ?


All times are GMT +2. The time now is 05:04.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.