Jump to content

h3ktlk

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

h3ktlk's Achievements

Member

Member (2/5)

0

Reputation

  1. h3ktlk

    Novell

    We are running novell and have radius setup for user auth into our wireless. I can get php to authorize the users per the radius server but is there a way to only allow users that are members of a certain context? I must leave the radius setup to allow all context in novell for the wireless. heres what i have: <?php require_once('radius.class.php'); ?> <html> <head> <title> Login </title> </head> <body> <?php if ((isset($_POST['user'])) && ('' != trim($_POST['user']))) { $radius = new Radius('**.**.**.**', '*******'); $radius->SetNasIpAddress('**.**.**.**'); $radius->SetDebugMode(TRUE); if ($radius->AccessRequest($_POST['user'], $_POST['pass'])) { $URL="http://www.*.com"; header ("Location: $URL"); echo "<strong>Authentication accepted.</strong>"; } else { echo "<strong>Authentication rejected.</strong>"; } echo "<br />"; echo "<br /><strong>GetReadableReceivedAttributes</strong><br />"; echo $radius->GetReadableReceivedAttributes(); echo "<br />"; echo "<a href=\"".$_SERVER['PHP_SELF']."\">Reload authentication form</a>"; } else { ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> User: <input name="user" type="text" value="user" /> <br /> Pass: <input name="pass" type="text" value="pass" /> <br /> <input name="submit" type="submit" value="Check authentication" /> </form> <?php } ?> </body> <html>
  2. Im authenticating again a Novell Radius Server, This works fine, what i want to do is try to authenticate only certain context's that are in the radius server, but am not sure of the php/radius code to only authenticate the novell context. example 4 context are allowed in the radius: context.a context.b context.c context.d i just want to allow users in context.c to authenticate on this page. Here is what i have <?php require_once('radius.class.php'); ?> <?php if ((isset($_POST['user'])) && ('' != trim($_POST['user']))) { $radius = new Radius('xx.xx.xx.xx', 'xxxxxxxx'); $radius->SetNasIpAddress('xx.xx.xx.xx'); $radius->SetDebugMode(TRUE); if ($radius->AccessRequest($_POST['user'], $_POST['pass'])) { echo "<strong>Authentication Accepted.</strong>"; } else { echo "<strong>Authentication rejected.</strong>"; } echo "<br />"; echo "<br /><strong>GetReadableReceivedAttributes</strong><br />"; echo $radius->GetReadableReceivedAttributes(); echo "<br />"; echo "<a href=\"".$_SERVER['PHP_SELF']."\">Reload authentication form</a>"; } else { ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> User: <input name="user" type="text" value="user" /> <br /> Pass: <input name="pass" type="text" value="pass" /> (text type for educational purpose only) <!-- type="text" for educational purpose only ! --> <br /> <input name="submit" type="submit" value="Check authentication" /> </form> <?php } ?>
  3. you know what ty for the help but i just needed to step away and found my mistake.. it was a simple typo in my string for the recordset i named that didnt conform to the script.
  4. Trying to use php to show or hide a form... maybe im going about this wrong.. this is what i have. <?php if ($row_group['group'] == "admin") { echo "<form id=\"form2\" name=\"form2\" method=\"post\" action=\"\">"; echo "<span class=\"style9\">"; echo "<label> </label>"; echo "</span>"; echo "<label>"; echo "<div align=\"center\" class=\"style9\">"; echo "<input type=\"text\" name=\"delete\" id=\"delete\" />"; echo "<br />"; echo "<input type=\"submit\" name=\"submit\" id=\"deletebut\" value=\"Delete\" />"; echo "</div>"; echo "</label>"; echo "<div align=\"center\"></div>"; echo "<div align=\"center\"></div>"; echo "</form></td>"; echo "</tr>"; echo "<tr>"; echo "<td bgcolor=\"#CCCCCC\"> </td>"; echo "<td bgcolor=\"#CCCCCC\"><div align=\"center\"><font color=\"#FF0000\">"; } ?> <?php if (isset($_POST['submit'])) { f(); } function f() { echo "Record Deleted"; } ?> it shows the form no matter what group is . Please help
  5. actually i fixed that.. but it doesnt pull from the database.
  6. when i do this.. it doesnt display the page.. error ...
  7. right now im using a java script that sets an array.. example below: <script language="Javascript"> var states = new Array("Alabama","Alaska","American Samoa","Arizona","Arkansas","California", "Colorado","Connecticut","Delaware","District of Columbia", "Federated States of Micronesia","Florida","Georgia","Guam","Hawaii","Idaho","Illinois", "Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine", "Marshall Islands","Maryland","Massachusetts","Michigan","Minnesota","Mississippi", "Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico", "New York","North Carolina","North Dakota", "Northern Mariana Islands","Ohio","Oklahoma","Oregon","Palau","Pennsylvania","Puerto Rico", "Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont", "Virgin Islands","Virginia","Washington","West Virginia","Wisconsin","Wyoming", "Armed Forces Africa","Armed Forces Americas","Armed Forces Canada", "Armed Forces Europe","Armed Forces Middle East","Armed Forces Pacific"); new AutoSuggest(document.getElementById('firstname'),states); </script> can i use php and sql to pull the array and put it in the java ?
  8. ajax is for asp correct?
  9. What i want to do is have a text field in a form so when a user starts typing it will start to autofill the rest or give a choice based on entries from a database... so if i wanted to enter the name Justin when i typed J it starte dfining all names with J .. then Ju etc. is this possible with php and sql?
  10. Here is my current code: SELECT * FROM classes, students WHERE classes.session = 1 AND classes.time = 9 AND students.studentnumber = colname2 AND classes.count < 13 AND classes.grade1 = students.grade or classes.grade2 = students.grade or classes.grade3 = students.grade what i want to do is take the classes.count < 13 to instead of having classes.count do a live count on the data to see if i have 13 or more. Please Help! THanks!
  11. My problem here is... the if works at the top.. but when i hit register if it does not meet the if requirement i woul dlike it to go to another page and say whats wrong and why it did not take.. the way it setup here.. it auto goes to the second page because the default value for sessiona through d is not correspondent to the if statement. Does the else statement need somewhere else? if ($_POST['sessiona'] == "121" OR $_POST['sessionb'] == "221" OR $_POST['sessionc'] == "321" OR $_POST['sessiond'] == "421"){ if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE users SET tshirt=%s, sessiona=%s, sessionb=%s, sessionc=%s, sessiond=%s WHERE idusers=%s", GetSQLValueString($_POST['Tshirt2'], "text"), GetSQLValueString($_POST['sessiona'], "text"), GetSQLValueString($_POST['sessionb'], "text"), GetSQLValueString($_POST['sessionc'], "text"), GetSQLValueString($_POST['sessiond'], "text"), GetSQLValueString($_POST['idusers'], "text")); mysql_select_db($database_wellness, $wellness); $Result1 = mysql_query($updateSQL, $wellness) or die(mysql_error()); $updateGoTo = "schedule.php"; if (isset($_SERVER['QUERY_STRING'])) { $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $updateGoTo)); } $colname_wellnessusers = "0"; if (isset($_SESSION['MM_Username'])) { $colname_wellnessusers = $_SESSION['MM_Username']; } } else{ header("location: http://*****");} ?>
  12. heres what i have no.. problem is.. it sets sessiona auto to 121 and then reverts others back to default choice if ($_POST['sessiona'] == "121" OR $_POST['sessionb'] == "221" OR $_POST['sessionc'] == "321" OR $_POST['sessiond'] == "421"){ if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE users SET tshirt=%s, sessiona=%s, sessionb=%s, sessionc=%s, sessiond=%s WHERE idusers=%s", GetSQLValueString($_POST['Tshirt2'], "text"), GetSQLValueString($_POST['sessiona'], "text"), GetSQLValueString($_POST['sessionb'], "text"), GetSQLValueString($_POST['sessionc'], "text"), GetSQLValueString($_POST['sessiond'], "text"), GetSQLValueString($_POST['idusers'], "text")); mysql_select_db($database_wellness, $wellness); $Result1 = mysql_query($updateSQL, $wellness) or die(mysql_error()); $updateGoTo = "schedule.php"; if (isset($_SERVER['QUERY_STRING'])) { $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING']; }
  13. I have a php update script running thats grabbing information from 5 fields.. 4 of which are dropdowns... IM trying to make an if statment of some sort to ensure one of the four drop downs has a certain selection or it gives an error.... any help? started by doing this but all it does is sets the value to what is shown if ($_POST['sessiona'] = "121"){
  14. Tryinging to pull a recordset. This is what i have: mysql_select_db($database_wellness, $wellness); $query_wellnesssessionbcount = "SELECT * FROM sessionb WHERE sessionb.`count`<30"; $wellnesssessionbcount = mysql_query($query_wellnesssessionbcount, $wellness) or die(mysql_error()); $row_wellnesssessionbcount = mysql_fetch_assoc($wellnesssessionbcount); $totalRows_wellnesssessionbcount = mysql_num_rows($wellnesssessionbcount); which works great but for one of the records i need it to be fore <20 not <30 ... is it possible to make an AND statment in there to do that somehow? pertaining to the id of the record possibly? what i have is 12 records.. 11 of them need pulled when count is less then 30 .. 1 of them needs pulled if count is less then 20. Im using the data to fill a drop down menu. Thanks!
  15. mysql_select_db($database_sum_enrich, $sum_enrich); $query_EventSession1K = "SELECT EventName FROM eventssession1 WHERE GradeK = 'yes' LIMIT 8"; $EventSession1K = mysql_query($query_EventSession1K, $sum_enrich) or die(mysql_error()); $row_EventSession1K = mysql_fetch_assoc($EventSession1K); $totalRows_EventSession1K = mysql_num_rows($EventSession1K); heres some of my code... what would i place in echo to get it to get the output.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.