All pastes #765000 Raw Edit

Untitled

public php v1 · immutable
·published 2007-11-07 19:03 UTC
rendered paste body
function mailboxes($start = ""){	global $imap, $do_not_show;	static $tree,$name,$array;	$dont_show = array("Slettet", "Sendt post");		if(!empty($do_not_show)){		$dont_show = array_merge($do_not_show,$dont_show);	}		$list = imap_getmailboxes($imap, "{localhost:143/novalidate-cert}$start", "%");		if (is_array($list)) {		$info = array();	    $space = "&nbsp;&nbsp;&nbsp;&nbsp;";	    foreach ($list as $key => $val) {		  $spaces = substr_count($start, ".");		  $spaces = str_repeat($space, $spaces);		  $name = str_replace("{localhost:143/novalidate-cert}".$start, "", $val->name);		  $name = str_replace(".", "", $name);		  //$tree .= $spaces.$name."<br>";		  $info['name'] = $name;		  $info['name_wspaces'] = $spaces.$name;		  $info['full_path'] = $val->name;		  if(!in_array($name, $dont_show)){			$array[] = $info;		  }			if (!($val->attributes & LATT_HASNOCHILDREN)) {				if(empty($start)){					$next = $start;				} else{					$next = $start . ".";				}				$go = $next . $name;				mailboxes($go, 0);			}	    }	}		$the_return = $array;	return $the_return;	}