[prev in list] [next in list] [prev in thread] [next in thread] 

List:       twig-devel
Subject:    [twig-devel] thx and an update.
From:       Oliver Günther <liq () gg-net ! de>
Date:       2000-09-15 9:57:07
[Download RAW message or body]

First of all thx for the information about exim and SQL.
I will combine both (twig's and eXim's Database) in the next
week's 


Next, I've done some bug-fixes to my own patch
the new-style addbook. 

if u get problems with beeing a member of a group, but aren't
able to select all group's this is for u.
just copy the new file over the old on in
twig/features/addbook

u can also test it at 

mail.gg-net.de 
user demo
pass demo

At next, i'll try to write a something like a webbased useradd-tool.
If this allready exist's, please tell me. 



["addbook.feature.php3" (application/octet-stream)]

<?php	// TWIG New Addresbook ( made from the framework ) ?>

<SCRIPT LANGUAGE="JavaScript">
	<!--
		if(window.screen) { window.moveTo(200,screen.availHeight/6);}
	//-->
</SCRIPT>


<?php

if($context["action"]=="closebook") require( "features/" . $context["feature"] . "/" \
. $context["action"] . ".inc.php3" );


$group[1]=$TWIGphrase["All"];										// Both groups are not definied in the \
Database $group[2]=$TWIGphrase["Unfiled"];
if(!$gruppe) $gruppe=$TWIGphrase["All"];								// Sartup to see all contacts

$stringvar="SELECT groupid FROM twig_members WHERE username='" . $login["username"] . \
"'";		// find out which groups U are a member of $sqlergebnis=dbQuery($stringvar);


if($sqlergebnis)											// get the id's of the group
	{
	$k=0;
	while($zeile=mysql_fetch_object($sqlergebnis))
		{
		$groupid_members[$k]=$zeile->groupid;
		$k++;
		}
	}



$i=3;

$stringvar = "SELECT groupname,id FROM twig_groups WHERE owner='" . \
$login["username"] . "' ";		// now we need the groupname of all groups we own  \
for($j=0;$j<$k;$j++)											// 				        or we are a member of  {
	$stringvar .="OR id='" . $groupid_members[$j] . "' ";
	}

$sqlergebnis=dbQuery($stringvar);
if($sqlergebnis)					
	{
	while($zeile=mysql_fetch_object($sqlergebnis))
		{
		$group[$i]=$zeile->groupname;								// doing some double work while readding alle \
groupid's second time, but at moment I'm satisfied   $groupid[$group[$i]]=$zeile->id;
		$i++;
		}
	}
mysql_free_result($sqlergebnis);
$groupid[$TWIGphrase["Unfiled"]]= 0;									// don't forget to give the unfiled ones \
an ID  

?>



<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" >
<TR>
<TD>
<SPAN 	STYLE="background:#c0c0c0">
<FONT 	FACE="<?php printf($config["cellfont"])?>" 
	COLOR="<?php printf($config["celltext"])?>">
<FORM METHOD=POST ACTION="<?php printf($config["baseurl"]) ?>" >
<?php 
echo TWIGSession( "put" );
echo TWIGContext( "put", "addbook", "" );
if($form["to"]) printf("<INPUT TYPE=HIDDEN NAME=\"form[to]\" VALUE=\"" . $form["to"] \
. "\">");   	// Making the Group Selector if($form["cc"]) printf("<INPUT TYPE=HIDDEN \
NAME=\"form[cc]\" VALUE=\"" . $form["cc"] . "\">"); 		 if($form["bcc"]) \
printf("<INPUT TYPE=HIDDEN NAME=\"form[bcc]\" VALUE=\"" . $form["bcc"] . "\">");  \
printf("<INPUT TYPE=HIDDEN NAME=mode VALUE=" . $mode . ">"); ?>
<SELECT SIZE=1 NAME="gruppe">
<?php
	for($j=1; $j < $i;$j++)
	{
	if($gruppe==$group[$j]) printf("<OPTION SELECTED>" . $group[$j] . "</OPTION>");
	else	printf("<OPTION>" . $group[$j] . "</OPTION>");
	}
?>
 
</SELECT>
</FONT>
</SPAN>
</TD>
<TD>
<SPAN 	STYLE="background:#c0c0c0">
<FONT 	FACE="<?php printf($config["cellfont"])?>" 
	COLOR="<?php printf($config["celltext"])?>">
<DIV  	ALIGN=RIGHT>
<INPUT TYPE=SUBMIT Value="<?php echo $TWIGphrase["Choose Group"]?>">
</DIV></FONT></SPAN> 
</TD>
</TR>
</TABLE>
</FORM>


<?php

if($gruppe==$TWIGphrase["All"])
	{
	$stringvar="SELECT firstname,lastname,email,email2,email3 FROM twig_contacts WHERE \
username='" . $login["username"] . "' AND groupid=0 ";  $i=3;
	if($groupid[$group[$i]])
		{
		do
			{
			$stringvar .="OR groupid=" . $groupid[$group[$i]] . " ";
			$i++;	
			}
		while($groupid[$group[$i]]);
		}
	}
elseif($gruppe==$TWIGphrase["Unfiled"])	
	{
	$stringvar="SELECT firstname,lastname,email,email2,email3 FROM twig_contacts WHERE \
username='" . $login["username"] . "' AND groupid=" . $groupid[$gruppe]. "";  }
else	
	{
	$stringvar="SELECT firstname,lastname,email,email2,email3 FROM twig_contacts WHERE \
groupid=" . $groupid[$gruppe]. "";  }

$sqlergebnis=dbQuery($stringvar);

$i=0;
if($sqlergebnis)			// And here we are creating the rest of de FOrm
	{ ?>
	<SPAN 	STYLE="background:#c0c0c0">
	<FONT 	FACE="<?php printf($config["cellfont"])?>" 
		COLOR="<?php printf($config["celltext"])?>">
	<FORM METHOD=POST ACTION="<?php printf($config["baseurl"])?>">
	<DIV ALIGN=RIGHT>
	<INPUT TYPE=SUBMIT VALUE="<?php echo $TWIGphrase["Adopt Addresses"]?>">
	</DIV></FONT></SPAN>
	<TABLE BORDER=0>
	
<?php	echo TWIGSession( "put" );
	echo TWIGContext( "put", "addbook", "closebook" );
	if($form["to"]) printf("<INPUT TYPE=HIDDEN NAME=\"form[to]\" VALUE=\"" . $form["to"] \
. "\">");  if($form["cc"]) printf("<INPUT TYPE=HIDDEN NAME=\"form[cc]\" VALUE=\"" . \
$form["cc"] . "\">");   if($form["bcc"]) printf("<INPUT TYPE=HIDDEN \
NAME=\"form[bcc]\" VALUE=\"" . $form["bcc"] . "\">");   printf("<INPUT TYPE=HIDDEN \
NAME=mode VALUE=" . $mode . ">");  while($zeile=mysql_fetch_object($sqlergebnis))
		{
		printf("<TR>");
		if($zeile->email || $zeile->email2 || $zeile->email3)
		{
		printf("<TD align=right><FONT FACE=\"" . $config["cellfont"] . "\" COLOR=\"" . \
$config["celltext"] . "\" SIZE=+2 >" . $zeile->firstname . "</FONT></TD><TD><FONT \
FACE=\"" . $config["cellfont"] . "\" COLOR=\"" . $config["celltext"] . "\" SIZE=+2>" \
. $zeile->lastname . "</FONT></TD></TR>");  if($zeile->email) {$i++; printf("<TR><TD \
align=right><FONT FACE=\"" . $config["cellfont"] . "\"><INPUT TYPE=checkbox \
NAME=emailtemp[" . $i . "] VALUE=" . $zeile->email . "></FONT></TD><TD><FONT FACE=\"" \
. $config["cellfont"] . "\" COLOR=\"" . $config["celltext"] . "\">" . $zeile->email . \
"</TD></TR>");}  if($zeile->email2) {$i++; printf("<TR><TD align=right><FONT FACE=\"" \
. $config["cellfont"] . "\"><INPUT TYPE=checkbox NAME=emailtemp[" . $i . "] VALUE=" . \
$zeile->email2 . "></TD><TD><FONT FACE=\"" . $config["cellfont"] . "\" COLOR=\"" . \
$config["celltext"] . "\">" . $zeile->email2 . "</TD></TR>");}  if($zeile->email3) \
{$i++; printf("<TR><TD align=right><FONT FACE=\"" . $config["cellfont"] . "\"><INPUT \
TYPE=checkbox NAME=emailtemp[" . $i . "] VALUE=" . $zeile->email3 . "></TD><TD><FONT \
FACE=\"" . $config["cellfont"] . "\" COLOR=\"" . $config["celltext"] . "\">" . \
$zeile->email3  ."</TD></TR>");}  printf("<TR><TD height=5></TD><TD></TD></TR>");
		}
		}
	printf("</TABLE><BR><BR></FORM>");
	}
mysql_free_result($sqlergebnis);

?>
</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic