ispCP - Board - Support
[Add User] -- insert a control - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Development Area (/forum-1.html)
+--- Forum: General discussion (/forum-11.html)
+--- Thread: [Add User] -- insert a control (/thread-757.html)

Pages: 1 2 3 4


RE: [Add User] -- insert a control - Ryuuku - 06-11-2007 10:49 PM

Yeah ... I had a new column (domain_egw) in table domain ...
And I have ever the trouble with the yes or no instead of Adr_IP

Basicly ... we have :
- my ($dmn_php, $dmn_cgi) = (@$dmn_data[19], @$dmn_data[20]);
- my $dmn_ip = @$dmn_data[21];


To fix the problem : ( File ispcp-dmn-mngr )

- my ($dmn_php, $dmn_cgi) = (@$dmn_data[19], @$dmn_data[20]); [ The same ]
- my $dmn_egw = @$dmn_data[21]; [ id_column = 21 ]
- my $dmn_ip = @$dmn_data[22]; [ id column +1 : 21 -> 22]

Adding a new user works perfectly ... with no error in site-available/ispcp.conf (adresse IP is well noticed Wink )

Ryu Smile


RE: [Add User] -- insert a control - joximu - 06-11-2007 11:01 PM

We're working on it...
your fix is for your problem - whenn adding two columns we have a new situation...

So we either select only specified columns (not wildcard) or we need hash based arrays for the results...

I hope I can solve this together with rats...

/Joxi


RE: [Add User] -- insert a control - Ryuuku - 06-11-2007 11:04 PM

Yep ... it's only fix my pb ...
For every new colums, we have to change values in ispcp-dmn-mngr ..

Is the fix is planned for the Rc3 ?

Ryu !


RE: [Add User] -- insert a control - joximu - 06-11-2007 11:07 PM

Ryuuku Wrote:Is the fix is planned for the Rc3 ?

what is a plan?
it's planed to release rc3 on april 30 (2007)...

I don't know when the other tickets are fixed - I hope to get this in some days - so there might be a good chance to have it in rc3 :-)

Cheers


RE: [Add User] -- insert a control - Ryuuku - 06-11-2007 11:26 PM

Sry for the meaning of plan Tongue

So i hope to having this fix in Rc 3 :=)


RE: [Add User] -- insert a control - Ryuuku - 06-12-2007 11:41 PM

Need Help Tongue

File : ispcp-dmn-mngr

My function :
------------------------------------------------------------------------------------------------------------------------------------------
Code:
## Egroupware Control Checkbox

sub egw_ctrl_dmn {

my ($rs, $rdata) = ('', '');
my ($dmn_data) = @_;
my $dmn_name = @$dmn_data[1];
my $dmn_egw = @$dmn_data[21];

my $sql = "select domain_egw from domain where domain_name = $dmn_name";
($rs, $rdata) = doSQL($sql);

        if ($sql eq 'yes') {
                mkdir ('/tmp/egw_ctrl1',0777) ;
        } elsif ($sql eq 'no') {
                mkdir ('/tmp/egw_ctrl2', 0777) ;
        }

} # Fin Fonction egw_ctrl_dmn
------------------------------------------------------------------------------------------------------------------------------------------
So when i execute ispcp-dmn-mngr ... there is no syntax error ... Smile ( i think )


In call my function in function dmn_mngr_engine like this :
------------------------------------------------------------------------------------------------------------------------------------------
Code:
if ($dmn_status eq 'toadd') {

        $rs = dmn_add_data($entry);
        &egw_ctrl_dmn($entry);   # <<<<<< My Call Function : )

        $timestamp = time();

        if ($rs == 0) {

            $sql = "update domain set domain_status='ok' where domain_id = $dmn_id";
------------------------------------------------------------------------------------------------------------------------------------------

New user is well inserted ...
Status domain turn well on OK
i think my function isn't executed Big Grin ... no dirs are created :/

So .. if somebody sees an error Tongue ... contact me plz Tongue

Ryu !


RE: [Add User] -- insert a control - joximu - 06-12-2007 11:48 PM

Why not
Code:
$rs = dmn_add_data($entry);
        if ($rs == 0) {
          egw_ctrl_dmn($entry);
        }
or
Code:
$rs = dmn_add_data($entry);
        if ($rs == 0) {
          $rs = egw_ctrl_dmn($entry);
        }
with the possibility to return a error code in your own function....

Regards /J


RE: [Add User] -- insert a control - Ryuuku - 06-13-2007 12:02 AM

You're so fast ... Big Grin Big Grin ^^
I'm going to test this ; )

Thx Smile


RE: [Add User] -- insert a control - Ryuuku - 06-13-2007 12:24 AM

Humm ... Nothing News ..

New user is always well inserted ...
Status domain always turns well on OK
My function isn't executed yet ... no dirs are created :/


RE: [Add User] -- insert a control - joximu - 06-13-2007 01:11 AM

ah, maybe you have to change your function...
Code:
my $dmn_egw = @$dmn_data[21];
here you already have your yes/no, so you don't need the new sql... just continue with:
Code:
if ($dmn_egw eq 'yes') {
                mkdir ('/tmp/egw_ctrl1',0777) ;
        } elsif ($dmn_egw eq 'no') {
                mkdir ('/tmp/egw_ctrl2', 0777) ;
        }

if this still does nothing you rather make

Code:
...
my $sql = "select domain_egw from domain where domain_name = $dmn_name";
($rs, $rdata) = doSQL($sql);

        if ($rdata[0][0] eq 'yes') {
                mkdir ('/tmp/egw_ctrl1',0777) ;
        } elsif ($rdata[0][0] eq 'no') {
                mkdir ('/tmp/egw_ctrl2', 0777) ;
        }

$sql will never be 'yes' or 'no' because it's "SELECT..."....
the result $rdata is a array[row][col] each starting at 0...

/J