ner) {
$this->deleteacl(("$to_mb_name"."$split_res"),$oldowner);
}
};
}
$this->deleteacl($to_mb_name, $this->admin);
$this->imap_logout();
$this->imap_login();
$this->deletemb($from_mb_name);
}
function copymailsfromfolder($from_mb_name, $to_mb_name) {
$com_ret=array();
$find_out=array();
$all="lrswipcda";
$mails=0;
$this->setacl($from_mb_name, $this->admin,$all);
$com_ret=$this->command(". select $from_mb_name");
for ($i=0; $i < count($com_ret); $i++) {
if (strstr( $com_ret[$i], "EXISTS"))
{
$findout=explode(" ", $com_ret[$i]);
$mails=$findout;
}
}
if ( $mails != 0 ) {
$com_ret=$this->command(". copy 1:$mails $to_mb_name");
for ($i=0; $i < count($com_ret); $i++) {
print "$com_ret[$i]<br>";
}
}
$this->deleteacl($from_mb_name, $this->admin);
}
/*
#
# ACL Functions
#
*/
function setacl($mb_name, $user, $acl) {
$this->command(". setacl \"$mb_name\" \"$user\" $acl");
}
function deleteacl($mb_name, $user) {
$result=$this->command(". deleteacl \"$mb_name\" \"$user\"");
}
function getacl($mb_name) {
$aclflag=1; $tmp_pos=0;
$output = $this->command(". getacl \"$mb_name\"");
$output = explode(" ", $output[0]);
$i=count($output)-1;
while ($i>3) {
if (strstr($output[$i],''"'')) {
$i++;
}
if (strstr($output[$i-1],''"'')) {
$aclflag=1;
$lauf=$i-1;
$spacestring=$output[$lauf];
$tmp_pos=$i;
$i=$i-2;
while ($aclflag!=0)
{
$spacestring=$output[$i]." ".$spacestring;
if (strstr($output[$i],''"'')) { $aclflag=0; }
$i--;
}
$spacestring=str_replace("\"","",$spacestring);
if ($i>2) {
$ret[$spacestring] = $output[$tmp_pos];
}
}
else
{
$ret[$output[$i-1]] = $output[$i];
$i = $i - 2;
}
}
return $ret;
}
/*
#
# Folder Functions
#
*/
function GetFolders($username){
$username=str_replace("/",".",$username);
$output = $this->command(". list \"$username\" *");
for ($i=0; $i < count($output); $i++) {
$splitfolder=split("\"",$output[$i]);
$output[$i]=str_replace(".","/",$splitfolder);
}
return $output;
}
function EGetFolders($username){
$lastfolder=split("/",$username);
$position=count($lastfolder)-1;
$last=$lastfolder[$position];
$username=str_replace("/",".",$username);
$output = $this->command(". list \"$username\" *");
for ($i=0; $i < count($output); $i++) {
$splitfolder=split("\"",$output[$i]);
$currentfolder=split("\.",$splitfolder);
$current=$currentfolder[$position];
// echo "<br>FOLDER:($) CURRENTFOLDER:($splitfolder) CURRENT:($current) LAST:($last) POSITION:($position)<br>";
if (strcmp($current,$last)==0){
$newoutput[$i]=str_replace(".","/",$splitfolder);
}
}
return $newoutput;
}
/*
#
# Folde