Location: PHPKode > projects > HuskyMail Webmail > contacts/group_edit.php
<?php
include($bookdir."groups.php");
if (count($group_names) == 0) { include("../contacts/list.php"); }
else if (!in_array($_GET['edit_group'],$group_names)) {
	include("../contacts/list.php");
}
else {
	for ($i=0; $i<count($group_names); $i++) {
		if ($group_names[$i] == $_GET['edit_group']) { $are_in_group = $group_files[$i]; }}
?>

<table border='0' cellpadding='0' cellspacing='0'>
<form action='contacts.php' method='post'>
<input type='hidden' name='save_group' value='1' />
<input type='hidden' name='old_name' value='<?php echo $_GET['edit_group']; ?>' />
	<tr><td class='titlebars' align='center'>
		<b style='font-size: 11px;'>GROUP NAME</b></td></tr>
	<tr><td style='padding: 10px; border: 1px solid #666666; background-color: rgb(250,250,250);' align='center'>
		<input type='text' name='new_name' value='<?php echo $_GET['edit_group']; ?>' class='txt'>
	</td></td>
	<tr><td height='5'></td></tr>
	<tr><td class='titlebars' align='center'>
		<b style='font-size: 11px;'>GROUP CONTACTS</b></td></tr>
	<tr><td style='padding: 10px; border: 1px solid #666666; background-color: rgb(250,250,250);' align='center'>

<?php
$problem = false;
$contacts = array();
$handle = opendir($bookdir);
$skip = array(".","..","index.php","backups","groups.php","security.php","thumbs.db","desktop.ini",".DS_Store","_notes");
while($file = readdir($handle)) {
	if (!in_array($file,$skip)) { array_push($contacts,$file); }}
if (count($contacts) == 0) { echo "You currently have no contacts"; }
else {
	$some = 0;
	echo "<table border='0' cellpadding='0' cellspacing='0'>";
	foreach($contacts as $c) {
		require_once($bookdir.$c);
		if ($test_encrypt != "husky") {
			if (isset($_COOKIE['passkey'])) {
				$passkey = $foo->decode($_COOKIE['passkey'],$default_key);
				if ($foo->decode($test_encrypt,$passkey) == "husky") {
					$identifier = $foo->decode($identifier,$passkey);
					$emailhome = $foo->decode($emailhome,$passkey);
					$emailwork = $foo->decode($emailwork,$passkey);
					$uniqueid = $foo->decode($uniqueid,$passkey);
					$mod = false;
				} else { $mod = true; }
			} else { $mod = true; }
		} else { $mod = false; }
		if ($mod == true) {
			$some++;
			$identifier = "Encrypted";
			$emailhome = "Encrypted";
			$emailwork = "Encrypted";
			$uniqueid = str_replace(".php","",$c); }
		echo "<tr></td><td>";
		echo "<input type='checkbox' name='group_list[]' value='".$uniqueid."'";
		if (in_array($uniqueid,$are_in_group)) { echo " checked"; }
		echo "></td><td></td><td width='2'></td><td><td><b>".$identifier."</b></td><td style='width: 10px;'>&nbsp;</td><td>";
		if ($emailhome != "") { echo "<tt>[</tt>"; }
		echo "</td><td width='2'></td><td>";
		if ($emailhome != "") { echo "<a onfocus='this.blur();' style='text-transform: lowercase; font-size: 12px; font-weight: normal;' href='compose.php?send_to=".$emailhome."'>".$emailhome."</a>"; }
		echo "</td><td width='2'></td><td>";
		if ($emailhome != "") { echo "<tt>]</tt>"; }
		echo "</td><td width='2'></td><td>";
		if ($emailwork != "") { echo "<tt>[</tt>"; }
		echo "</td><td width='2'></td><td>";
		if ($emailwork != "") { echo "<a onfocus='this.blur();' style='text-transform: lowercase; font-size: 12px; font-weight: normal;' href='compose.php?send_to=".$emailwork."'>".$emailwork."</a>"; }
		echo "</td><td width='2'></td><td>";
		if ($emailwork != "") { echo "<tt>]</tt>"; }
		echo "</td><td width='15'></td>";
		echo "<td>";
		if ($test_encrypt != "husky") {
			if ($identifier == "Encrypted") {
				echo "<span style='color: #FF0000; font-size: 12px;'><b>&#10003;</b></span>"; }
			else { echo "<span style='color: #00CC00; font-size: 12px;'><b>&#10003;</b></span>"; }
		}
		else { echo "<span style='color: #666666; font-size: 12px;'><b>&#10003;</b></span>"; }
		echo "</td>";
		echo "</tr>"; }
	echo "</table>";
	if ($some > 0) { $problem = true; }}
?>

	</td></tr>
	<tr><td style='padding: 5px; border: 1px solid #666666; border-top: none;' align='center'>
		<tt>[</tt><INPUT type='submit' name='submit' value='UPDATE' onfocus='this.blur();' class='btn' /><tt>]</tt> <tt>[</tt><INPUT type='reset' name='reset' value='RESET' onfocus='this.blur();' class='btn' /><tt>]</tt> <tt>[</tt><INPUT type='button' name='cancel' value='CANCEL' onfocus='this.blur();' class='btn' onclick='window.location.href = "contacts.php";' /><tt>]</tt>
	</td></tr>
</form>
</table>
<?php } ?>
Return current item: HuskyMail Webmail