more xhtml compliance fixes

add access controls to committee member editor
This commit is contained in:
james 2005-01-25 18:58:00 +00:00
parent 5aac09ae15
commit e40bbeda96

View File

@ -166,6 +166,10 @@ if($_POST['add_member'])
if($_POST['save'])
{
//FIXME: deal with what the user can actually do based on their own permissions
if($_POST['access_admin']=="Y") $a_admin='Y'; else $a_admin='N';
if($_POST['access_config']=="Y") $a_config='Y'; else $a_config='N';
if($_POST['access_super']=="Y") $a_super='Y'; else $a_super='N';
mysql_query("UPDATE committees_members SET ".
"name='".$_POST['name']."', ".
"organization='".$_POST['organization']."', ".
@ -175,6 +179,9 @@ if($_POST['save'])
"phonework='".$_POST['phonework']."', ".
"phonecell='".$_POST['phonecell']."', ".
"fax='".$_POST['fax']."', ".
"access_admin='$a_admin', ".
"access_config='$a_config', ".
"access_super='$a_super', ".
"displayemail='".$_POST['displayemail']."' ".
" WHERE id='".$_POST['save']."'");
@ -224,31 +231,30 @@ if($_GET['edit'] || $edit)
$e=$edit;
$q=mysql_query("SELECT * FROM committees_members WHERE id='$e'");
$r=mysql_fetch_object($q);
echo "<h4>Edit Committee Member</h4>";
echo "<a href=\"committees.php\"><font face=arial>&lt;&lt; Back to Committees Editor</a>\n";
echo "<h4>".i18n("Edit Committee Member")."</h4>";
echo "<a href=\"committees.php\">&lt;&lt; ".i18n("Back to Committees Editor")."</a>\n";
// echo "<form enctype=\"multipart/form-data\" action=\"admin_board.php\" method=\"post\" accept=\"image/jpeg\">\n";
echo "<form action=\"committees.php\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"save\" value=\"$e\">\n";
echo "<input type=\"hidden\" name=\"save\" value=\"$e\" />\n";
echo "<table>";
// echo "<tr><td>";
// echo "<table class=bodytext border=\"0\" cellspacing=0 cellpadding=1>";
echo "<tr><td>Name:</td><td><input size=25 type=text name=name value=\"$r->name\"></td></tr>";
echo "<tr><td>".i18n("Name").":</td><td><input size=\"25\" type=\"text\" name=\"name\" value=\"$r->name\" /></td></tr>";
$cq=mysql_query("SELECT committees.name, committees.id, committees_link.title, committees_link.ord FROM committees,committees_link WHERE committees_link.committees_id=committees.id AND committees_link.committees_members_id='$e' ORDER BY committees.name");
echo "<tr><td valign=\"top\">Committees:</td><td>";
echo "<tr><td valign=\"top\">".i18n("Committees").":</td><td>";
if(mysql_num_rows($cq))
{
echo "<table>";
echo "<tr><th>Committee</th><th>Title in Committee</th><th>Order</th></tr>";
echo "<tr><th>".i18n("Committee")."</th><th>".i18n("Title in Committee")."</th><th>".i18n("Order")."</th></tr>";
while($cr=mysql_fetch_object($cq))
{
echo "<tr><td>$cr->name</td><td><input type=\"text\" name=\"titles[$cr->id]\" value=\"$cr->title\" /></td><td><input type=text name=\"ord[$cr->id]\" value=\"$cr->ord\" size=3></td></tr>";
echo "<tr><td>$cr->name</td><td><input type=\"text\" name=\"titles[$cr->id]\" value=\"$cr->title\" /></td><td><input type=\"text\" name=\"ord[$cr->id]\" value=\"$cr->ord\" size=\"3\" /></td></tr>";
}
echo "</table>";
@ -256,21 +262,21 @@ if($_GET['edit'] || $edit)
else
echo "None";
echo "</td></tr>\n";
echo "<tr><td>Organization:</td><td><input size=\"25\" type=\"text\" name=\"organization\" value=\"$r->organization\" /></td></tr>\n";
echo "<tr><td>Email (Public):</td><td><input size=\"25\" type=\"text\" name=\"email\" value=\"$r->email\" /></td></tr>\n";
echo "<tr><td>Email (Private):</td><td><input size=\"25\" type=\"text\" name=\"emailprivate\" value=\"$r->emailprivate\" /></td></tr>\n";
echo "<tr><td>Display Emails:</td><td>";
echo "<tr><td>".i18n("Organization").":</td><td><input size=\"25\" type=\"text\" name=\"organization\" value=\"$r->organization\" /></td></tr>\n";
echo "<tr><td>".i18n("Email (Public)").":</td><td><input size=\"25\" type=\"text\" name=\"email\" value=\"$r->email\" /></td></tr>\n";
echo "<tr><td>".i18n("Email (Private)").":</td><td><input size=\"25\" type=\"text\" name=\"emailprivate\" value=\"$r->emailprivate\" /></td></tr>\n";
echo "<tr><td>".i18n("Display Emails").":</td><td>";
if($r->displayemail=="N") $checked="checked=\"checked\""; else $checked="";
echo "<input type=\"radio\" name=\"displayemail\" value=\"N\" $checked>No";
echo "<input type=\"radio\" name=\"displayemail\" value=\"N\" $checked />".i18n("No");
echo "&nbsp; &nbsp; &nbsp;";
if($r->displayemail=="Y") $checked="checked=\"checked\""; else $checked="";
echo "<input type=\"radio\" name=\"displayemail\" value=\"Y\" $checked>Yes";
echo "<input type=\"radio\" name=\"displayemail\" value=\"Y\" $checked />".i18n("Yes");
echo "</td></tr>\n";
echo "<tr><td>Phone (Home):</td><td><input size=\"15\" type=\"text\" name=\"phonehome\" value=\"$r->phonehome\" /></td></tr>\n";
echo "<tr><td>Phone (Work):</td><td><input size=\"15\" type=\"text\" name=\"phonework\" value=\"$r->phonework\" /></td></tr>\n";
echo "<tr><td>Phone (Cell):</td><td><input size=\"15\" type=\"text\" name=\"phonecell\" value=\"$r->phonecell\" /></td></tr>\n";
echo "<tr><td>Fax:</td><td><input size=\"15\" type=\"text\" name=\"fax\" value=\"$r->fax\"></td></tr>\n";
echo "<tr><td>".i18n("Phone (Home)").":</td><td><input size=\"15\" type=\"text\" name=\"phonehome\" value=\"$r->phonehome\" /></td></tr>\n";
echo "<tr><td>".i18n("Phone (Work)").":</td><td><input size=\"15\" type=\"text\" name=\"phonework\" value=\"$r->phonework\" /></td></tr>\n";
echo "<tr><td>".i18n("Phone (Cell)").":</td><td><input size=\"15\" type=\"text\" name=\"phonecell\" value=\"$r->phonecell\" /></td></tr>\n";
echo "<tr><td>".i18n("Fax").":</td><td><input size=\"15\" type=\"text\" name=\"fax\" value=\"$r->fax\" /></td></tr>\n";
// echo "<tr><td>Picture:</td><td><input size=10 name=\"picture\" type=\"file\"></td></tr>\n";
// echo "</table>";
@ -282,9 +288,22 @@ if($_GET['edit'] || $edit)
// echo "No Picture";
// echo "</td></tr>\n";
echo "<tr><td align=center colspan=2>";
echo "<br><br>";
echo "<input type=submit value=\"Save Member\" />\n";
echo "<tr><td align=\"center\" colspan=\"2\"><hr /></td></tr>";
echo "<tr><td>".i18n("Access Controls").":</td><td>";
if($r->access_admin=="Y") $checked="checked=\"checked\""; else $checked="";
echo "<input type=\"checkbox\" name=\"access_admin\" value=\"Y\" $checked /> ".i18n("Administration")."<br />";
if($r->access_config=="Y") $checked="checked=\"checked\""; else $checked="";
echo "<input type=\"checkbox\" name=\"access_config\" value=\"Y\" $checked /> ".i18n("Configuration")."<br />";
if($r->access_super=="Y") $checked="checked=\"checked\""; else $checked="";
echo "<input type=\"checkbox\" name=\"access_super\" value=\"Y\" $checked /> ".i18n("Superuser")."<br />";
echo "</td></tr>";
echo "<tr><td align=\"center\" colspan=\"2\">";
echo "<br /><br />";
echo "<input type=\"submit\" value=\"".i18n("Save Member")."\" />\n";
echo "</td></tr>\n";
echo "</table>\n";
@ -296,23 +315,23 @@ else
echo "<table>";
echo "<tr><td>";
echo "<h4>Add Committee</h4>\n";
echo "<h4>".i18n("Add Committee")."</h4>\n";
echo "<form method=\"post\"action=\"committees.php\">\n";
echo "<table>\n";
echo "<tr><td>Committee Name: </td><td><input type=\"text\" size=\"15\" name=\"addcommittee\" /></td>";
echo " <td><input type=\"submit\" value=\"Add\" /></td></tr>\n";
echo "<tr><td>".i18n("Committee Name").": </td><td><input type=\"text\" size=\"15\" name=\"addcommittee\" /></td>";
echo " <td><input type=\"submit\" value=\"".i18n("Add")."\" /></td></tr>\n";
echo "</table>\n";
echo "</form>\n";
echo "</td><td width=\"40\">&nbsp;</td><td>";
echo "<h4>Add Committee Member</h4>\n";
echo "<h4>".i18n("Add Committee Member")."</h4>\n";
echo "<form method=\"post\" action=\"committees.php\">\n";
echo "<table>\n";
echo "<tr><td>Member Name: </td><td>";
echo "<tr><td>".i18n("Member Name").": </td><td>";
echo "<input type=\"text\" size=\"15\" name=\"add_member\" />\n";
echo "</td>\n";
echo " <td><input type=\"submit\" value=\"Add\" /></td></tr>\n";
echo " <td><input type=\"submit\" value=\"".i18n("Add")."\" /></td></tr>\n";
echo "</table>\n";
echo "</form>\n";
@ -321,21 +340,21 @@ else
echo "<hr />";
echo "<h4>Committee Member Management</h4>\n";
echo "<h4>".i18n("Committee Member Management")."</h4>\n";
echo "<form name=\"memberaction\" method=\"post\" action=\"committees.php\" onsubmit=\"return actionSubmit()\">\n";
echo "<table>";
echo "<tr><td>";
echo "<select name=\"action\" onchange=\"javascript:actionChanged()\">";
echo "<option value=\"\">Choose</option>\n";
echo "<option value=\"assign\">Assign</option>\n";
echo "<option value=\"edit\">Edit</option>\n";
echo "<option value=\"remove\">Remove</option>\n";
echo "<option value=\"\">".i18n("Choose")."</option>\n";
echo "<option value=\"assign\">".i18n("Assign")."</option>\n";
echo "<option value=\"edit\">".i18n("Edit")."</option>\n";
echo "<option value=\"remove\">".i18n("Remove")."</option>\n";
echo "</select>";
echo "</td><td>";
$q=mysql_query("SELECT * FROM committees_members ORDER BY name");
echo "<select name=\"committees_members_id\">";
echo "<option value=\"\">Select a Member</option>\n";
echo "<option value=\"\">".i18n("Select a Member")."</option>\n";
while($r=mysql_fetch_object($q))
{
echo "<option value=\"$r->id\">$r->name</option>\n";
@ -347,10 +366,10 @@ else
//The Assign Div
echo "<div id=\"assigndiv\">";
echo "To Committee: ";
echo i18n("To Committee").": ";
$q=mysql_query("SELECT * FROM committees ORDER BY ord,name");
echo "<select name=\"committees_id\">";
echo "<option value=\"\">Select a Committee</option>\n";
echo "<option value=\"\">".i18n("Select a Committee")."</option>\n";
while($r=mysql_fetch_object($q))
{
echo "<option value=\"$r->id\">$r->name</option>\n";
@ -361,7 +380,7 @@ else
//The Edit or Remove Div
echo "</td><td><input type=\"submit\" value=\"Go\" /></td></tr>";
echo "</td><td><input type=\"submit\" value=\"".i18n("Go")."\" /></td></tr>";
echo "</table>";
echo "</form>";
@ -373,7 +392,7 @@ else
$q=mysql_query("SELECT * FROM committees ORDER BY ord,name");
if(mysql_num_rows($q))
{
echo "<h4>Committees</h4>";
echo "<h4>".i18n("Committees")."</h4>";
echo "<form method=\"post\" action=\"committees.php\">\n";
echo "<table>";
while($r=mysql_fetch_object($q))
@ -434,7 +453,7 @@ else
}
echo "<tr><td colspan=\"2\">&nbsp;</td></tr>\n";
}
echo "<tr><td colspan=\"2\"><input type=\"submit\" value=\"Re-Order Committees\" /></td></tr>\n";
echo "<tr><td colspan=\"2\"><input type=\"submit\" value=\"".i18n("Re-Order Committees")."\" /></td></tr>\n";
echo "</table>";
echo "</form>\n";
}