".$posterror; } else { // change group if necessary $therights=1; $og=explode(",",$_POST["orig_group"]); foreach ($_POST["group_membership"] as $value) { $gexit=0; foreach ($og as $cv) { if($cv==$value) { $gexit=1; } } if($gexit==0) { $sqlig=sprintf("INSERT INTO tobin_user_group (gid, uid, cdate, updatedby, rights) VALUES (%s, %s, %s, %s, %s)", GetSQLValueString($value, "int"), GetSQLValueString($_SESSION["euuid"], "int"), GetSQLValueString($thedate, "date"), GetSQLValueString($_SESSION["tobin_uid"], "int"), GetSQLValueString($therights, "int")); $qig=mysql_query($sqlig) or $em=$em.mysql_error(); } } foreach ($og as $value) { $gexit=0; foreach ($_POST["group_membership"] as $cv) { if($cv==$value) { $gexit=1; } } if($gexit==0) { $sqldg="DELETE FROM tobin_user_group WHERE gid = ".$value." AND uid = ".$_SESSION["euuid"]; $qdg=mysql_query($sqldg) or $em=$em.mysql_error(); } } $postsuccess="Account successuflly updated."; } } else { $posterror="Duplicate username. Please select another username and resubmit form."; $username=$_POST["orig_username"]; } } // end if em after duplicate check else { $posterror="Unable to update user. Please resubmit form. If the problem persists, please contact the site administrator."; $posterror=$em."
".$posterror; } ?>