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 Control Panel with ISPConfig as Backend (http://www.howtoforge.com/forums/showthread.php?t=59066)

abdi 12th October 2012 15:52

New Control Panel with ISPConfig as Backend
 
Hello Forgers,
Esp: Till

I am developing a whole new interface that is seemingly integrated with my billing system but using the ISPConfig 3's Remote API as processor of almost every task and sometimes querying the database it self directly where need be.

In the process of developing this control panel, I have come across a few things I would like to share and help also make clear to me ..I will list almost all of them on this thread with all possible recommendations and bugs if expected ..

abdi 12th October 2012 15:56

The first of them is:

I noticed when logged in as an admin, and you try to create an email address for a domain that belongs to a client, in the table: mail_user, the sys_userid assigned to that email address is 1 (which is the admin's). I thought this ID should be for the client him self who anyways owns the email domain.

However if the client him self creates the email address, then the sys_userid assigned is that of the client him self ..

I hit this snag when I tried to query for ALL email addresses that belong to a client (identified by sys_userid) and noticed some emails were then left out.

Till, is that how it's operating or its a bug?

Joseph

till 12th October 2012 16:30

Quote:

I noticed when logged in as an admin, and you try to create an email address for a domain that belongs to a client, in the table: mail_user, the sys_userid assigned to that email address is 1 (which is the admin's). I thought this ID should be for the client him self who anyways owns the email domain.
The id has to be 1 and not the id of the client. So ispconfig is correct here.

Quote:

However if the client him self creates the email address, then the sys_userid assigned is that of the client him self ..
Thats correct as well. The sys_userid identifies the creator of a record and not the owner permissions. The permissions are hendled trough the groups.

abdi 12th October 2012 18:59

Thanks Till for that information, its very helpful.

Again I hit another snag, when I realized that NOT all variables are updated when running:

mail_user_update() command through API. Below is what I pass to it:

$params['access'] = 'n';
$params['disableimap'] = 'y';
$params['disablepop3'] = 'y';
$params['disabledeliver'] = 'y';
$params['disablesmtp'] = 'z';
$params['disablesieve'] = 'y';
$params['disablelda'] = 'y';
$params['disabledoveadm'] = 'y';

However ONLY the below are updated, the rest stay intact and un-updated:

$params['access'] = 'n';
$params['disableimap'] = 'y';
$params['disablepop3'] = 'y';

Any ideas what am doing wrong or leaving out? or its like that ...

BTW: Accordingly to the API manual, its supposed to return the number of affected rows, however it does not ..even though I use the default API example file ..

Thanks, Joseph

abdi 12th October 2012 19:21

Till I noticed a variable $params['postfix']. If its set to "n" (ie mail receiving is disabled) then does it really matter what is set for disablesmtp and disabledeliver ?

Am thinking as long as postfix is set to "n" then a user wouldnt still be able to send mail through SMTP regardless of the flag set for disablesmtp ..Right?

My problem is, I want if I disable postfix for that user then he shouldnt be able to send mail also through SMTP ..

Advice ..Joseph

abdi 13th October 2012 02:03

Till, when creating a mailbox with the command mail_user_add am expected to provide maildir and homedir. Is there anywhere in the DB where these variables are defined or I have to build them my self before sending them?

till 13th October 2012 20:08

Quote:

Originally Posted by abdi (Post 286638)
Till I noticed a variable $params['postfix']. If its set to "n" (ie mail receiving is disabled) then does it really matter what is set for disablesmtp and disabledeliver ?

Am thinking as long as postfix is set to "n" then a user wouldnt still be able to send mail through SMTP regardless of the flag set for disablesmtp ..Right?

My problem is, I want if I disable postfix for that user then he shouldnt be able to send mail also through SMTP ..

Advice ..Joseph

Thus depends on your installation, e.g. If you use courier or dovecot. Take a look at the postfix and dovecot and courier config files if you want to know what sll internal flags are used for.

till 13th October 2012 20:09

Quote:

Originally Posted by abdi (Post 286647)
Till, when creating a mailbox with the command mail_user_add am expected to provide maildir and homedir. Is there anywhere in the DB where these variables are defined or I have to build them my self before sending them?

The pats are stored in the ini style server config which can be retrieved with the api as well.

abdi 13th October 2012 20:57

Quote:

The pats are stored in the ini style server config which can be retrieved with the api as well.
Which command should I use for that?

till 14th October 2012 13:20

Code:

$client->server_get($session_id, $server_id, $section ='')


All times are GMT +2. The time now is 13:03.

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