Current time: 11-23-2024, 02:23 AM Hello There, Guest! (LoginRegister)


Post Reply 
[Add User] -- insert a control
Author Message
Ryuuku Offline
Junior Member
*

Posts: 55
Joined: Apr 2007
Reputation: 0
Post: #31
RE: [Add User] -- insert a control
Some good news !

I managed to execute my script ^ But not totally ^^ Big Grin

File : ispcp-dmn-mngr :
Code:
if ($dmn_status eq 'toadd') {

        $rs = dmn_add_data($entry);
        $timestamp = time();

        if ($rs == 0) {

            $sql = "update domain set domain_status='ok' where domain_id = $dmn_id";
            # $rs = &egw_ctrl_dmn($entry);    ### Appel de la fonction pour Egroupware
            my $ispcp2egw_dmn_add = $main::cfg{'ispcp2egw_dmn_add'};
            $rs = system`$ispcp2egw_dmn_add`;  <<<< My call Function


File : ispcp2egw_dmn_add
Code:
## Function Egroupware Control Checkbox

sub egw_ctrl_dmn {

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

open(FILE,">/tmp/test.sql");
printf FILE "\n\n Testttttttttttttt \n";
printf FILE "\n dmn_egw = $dmn_egw" ;
close(FILE);

if ($dmn_egw eq 'yes') {

        # Test
        mkdir ("/tmp/ispcp2egw1/",0777) ;

} elsif ($dmn_egw eq 'no') {
        mkdir ('/tmp/ispcp2egw2', 0777) ;
} # Fin Elsif
} # Fin Fonction egw_ctrl_dmn
              
####################################################
# Main => Appel du programme prinicipal

open(FIC,">/tmp/test1.sql");
printf FIC "\n\n Mouaaaaaaaaaaaaaaaaaaaaaaa \n";
close(FIC);

# my ($rs, $rows, $rdata) = (undef, undef, undef);
# my $entry = @$rows[0];
$rs = &egw_ctrl_dmn($entry);

open(FIC,">/tmp/test1.sql");
printf FIC "\n\n popooooooooooooooooooo \n";
close(FIC);


Result of my test :
-> ispcp-dmn-mngr call well my script
-> File test1.sql is well created
-> File test.sql is also well created
But the printf of $dmn_egw return nothing ... so i have to found how my function could have data from ispcp-dmn-mngr @dmn_data[*]

Voilou Big Grin ^^ See you soon Big Grin
(This post was last modified: 06-14-2007 10:52 PM by Ryuuku.)
06-14-2007 10:45 PM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #32
RE: [Add User] -- insert a control
Hi Ryuuku
I'm on the way during the day...

ok. In the short time I see two things:
how does your new script knows, which domain is to be made/deleted/enhanced or whatever... (-> parameter wih domain_id)

# my ($rs, $rows, $rdata) = (undef, undef, undef);
# my $entry = @$rows[0];
$rs = &egw_ctrl_dmn($entry);

$entry seems to be empty/missing/not existent

if you have the domain_id, you can make a SELECT on the database to get the infos you need.

See what I mean?

/J
06-15-2007 04:54 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Ryuuku Offline
Junior Member
*

Posts: 55
Joined: Apr 2007
Reputation: 0
Post: #33
RE: [Add User] -- insert a control
Yep ; )

I think i've found a solution : ) I'm testing it ^
I will post my report Smile

Thx one more time /Joxi ! ( My helper ^^ )
06-15-2007 09:49 PM
Find all posts by this user Quote this message in a reply
Ryuuku Offline
Junior Member
*

Posts: 55
Joined: Apr 2007
Reputation: 0
Post: #34
RE: [Add User] -- insert a control
Solution found ! Wink

Code:
$dbh = DBI->connect('dbi:mysql:ispcp',$Mysql_Login,$Mysql_Mdp) or die "Echec de la connexion\n";
$query = "SELECT domain_name,domain_egw FROM domain WHERE domain_id = $dmn_id";
$sth = $dbh->prepare($query);
$res = $sth->execute;
while(@row = $sth->fetchrow_array) {
$dmn_name = $row[0];
$dmn_egw = $row[1];
}


I win a batltle ^^ but not the war yet Big Grin ^^
Go Go Go ^^

Ryu !
06-16-2007 12:15 AM
Find all posts by this user Quote this message in a reply
Ryuuku Offline
Junior Member
*

Posts: 55
Joined: Apr 2007
Reputation: 0
Post: #35
RE: [Add User] -- insert a control
Some news about my project :

=> Project finished about 95% ( Like the Rc3 ^^ Big Grin )

I'm actually waiting for :
=> IspCP Rc3
=> A small developpement of Egw Team
=> An update of my install script / procédure

Seen you soon i hope with the project totally finished ! Smile

Ryu !
07-04-2007 05:52 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)