Update webmail n sync servers

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sheru2302
Forum Newbie
Posts: 4
Joined: Fri Dec 18, 2009 8:55 pm

Update webmail n sync servers

Post by sheru2302 »

Hi, I need help on updating webmails n sync servers. I'm adding user in linux server(logon server) and then i want to sync the password to 10 other IMAP servers. Later on in order to check mails I should update the webmails/ mail routers also. Can anybody help with the command that I should send to my logonserver? Thanks...
sheru2302
Forum Newbie
Posts: 4
Joined: Fri Dec 18, 2009 8:55 pm

Re: Update webmail n sync servers

Post by sheru2302 »

Hi...

Can anyone help me with this codes? :banghead: Im trying 2 sync a file within a server. Check it out plz...

This is user_registration.main.php:

if ($status = 1)
{
$servers = TEST_SERVER;
require_once (dirname(__FILE__) . "/user_registration.rsync.php");
$return_sync = rsync_server ($servers);
} else {
fwrite(STDLOG,"\n\n---------->>\nError!!!\n---------->>");
}

This is user_registration.rsync.php:

<?php
require_once (dirname(__FILE__) . "/" . "user_registration.err_msg.php");
function rsync_server ($servers)
{
$return_value = 0;

if (!trim($servers)) {
$return_value = 81;
}
if (!$return_value) {
$descriptorspec = array(
0 => array("pipe", "r"), // stdin is a pipe that the child will read from
1 => array("pipe", "w"), // stdout is a pipe that the child will write to
2 => array("pipe", "w") // stderr is a pipe that the child will write to
);

$command = "rsync /root/testfali/test1.html /root/testfali1/test1.html";

$process = proc_open($command, $descriptorspec, $pipes);

if (is_resource($process)) {
fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
$return_value = proc_close($process);
}
}

$result = $return_value;
$return_value_arr = array ('value'=>$return_value, 'msg'=>$GLOBALS['USER_REG_ERR_MSG'][$return_value]);

return serialize($result);
}
?>

My command is not working and $results retun i=0
Post Reply