From: <kiw...@us...> - 2016-02-11 11:59:47
|
Revision: 4132 http://sourceforge.net/p/openlcb/svn/4132 Author: kiwi64ajs Date: 2016-02-11 11:59:46 +0000 (Thu, 11 Feb 2016) Log Message: ----------- changed links to point to http://registry.openlcb.org equivalents and added redirects Modified Paths: -------------- trunk/web/index.html trunk/web/requestuidrange.php trunk/web/uidxml.php trunk/web/viewuid.php trunk/web/viewuidall.php Modified: trunk/web/index.html =================================================================== --- trunk/web/index.html 2016-02-09 07:35:07 UTC (rev 4131) +++ trunk/web/index.html 2016-02-11 11:59:46 UTC (rev 4132) @@ -24,13 +24,8 @@ contains various resources for the OpenLCB web site.</P> <P>The main page of the OpenLCB web site is <A HREF="../../index.html">here</A>.</P> <P> -Local pages: -<ul> -<li><a href="viewuid.php">Formatted tables</a> of assigned unique ID ranges -<li><a href="viewuidall.php">Single table</a> of assigned unique ID ranges -<li><a href="uidxml.php">XML listing</a> of assigned unique ID ranges -<li><a href="requestuidrange.php">Request</a> to be assigned a range -</ul> +The UniqueId Registry has moved to a new web site here: <a href="http://registry.openlcb.org">The UniqueId Registry</a> +</P> <HR> <P>Site hosted by <A HREF="http://sourceforge.net/projects/openlcb"><FONT COLOR="#000080"><IMG SRC="http://sflogo.sourceforge.net/sflogo.php?group_id=286373&type=13" NAME="graphics2" ALIGN=ABSMIDDLE WIDTH=120 HEIGHT=30 BORDER=2></FONT></A> Modified: trunk/web/requestuidrange.php =================================================================== --- trunk/web/requestuidrange.php 2016-02-09 07:35:07 UTC (rev 4131) +++ trunk/web/requestuidrange.php 2016-02-11 11:59:46 UTC (rev 4132) @@ -1,203 +1,4 @@ -<?php require_once('access.php');?> - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" - "http://www.w3.org/TR/html4/loose.dtd"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - <title>Request OpenLCB Unique ID Range</title> - - <STYLE TYPE="text/css"> - </STYLE> - -</head> -<body> -<IMG SRC="logo-ajs-dph.png" NAME="graphics1" ALIGN=RIGHT WIDTH=195 HEIGHT=80 BORDER=0> -<h1>Request OpenLCB Unique ID Range</h1> - -This page allows you to request a range of 256 OpenLCB Unique IDs for your own use. -<P> -For more information on OpenLCB, please see the <a href="../documents/index.html">documentation page</a>. -For more information on OpenLCB unique ID assignment, please see the current draft -<a href="../specs/drafts/GenUniqueIdS.pdf">specification</a> and -<a href="../specs/drafts/GenUniqueIdTN.pdf">technical note</a>. - -<p> -<ul> -<li>You must provide a personal name. You may also provide a company name. -In our <a href="viewuid.php">listing of assigned ranges</a>, we will publish the company name, if provided. -If there is no company name, we will publish the personal name. - -<li>We will not publish your email address. - -<li>You may provide a URL, which we will publish if provided. - -<li>You may provide a comment, which we will publish if provided. -You can use this for company contact information, for example, including an email address. - -<li>If you check the "Add to OpenLCB email list" box, -we will add your email address to a -<a href="https://sourceforge.net/mailarchive/forum.php?forum_name=openlcb-announcements">mailing list</a> -for occasional updates regarding OpenLCB standards & documentation, policy changes, etc. -We strongly recommend that you subscribe so that you'll hear about these things in a timely manner. -The traffic on that list will be low, generally less than one email a month. -</ul> - -<hr> -<?php -// parse out arguments -//parse_str($_SERVER["QUERY_STRING"], $args); -$args = $_POST; - -$p_first_name = $args["fn"]; -$p_last_name = $args["ln"]; -$p_email = $args["em"]; -$p_organization = $args["or"]; -$p_url = $args["ur"]; -$p_comment = $args["cm"]; -$p_subscribe = ($args["ms"] != '')?"y":"n"; -$p_subscribe_checked = " checked "; // always check box by default - -// check for necessary user ID fields -if ($p_first_name == "" || $p_last_name == "" || $p_email == "") { - // missing something, present ID form - echo '<form method="post" action="requestuidrange.php">'; - echo 'First, enter your info. (* fields required)<p>'; - echo 'First Name: <input name="fn" value="'.$p_first_name.'"/>* '; - echo 'Last Name: <input name="ln" value="'.$p_last_name.'"/>*<p>'; - echo 'Organization: <input name="or" value="'.$p_organization.'"/><p>'; - echo 'Email Address: <input name="em" value="'.$p_email.'"/>*<p>'; - echo '<input type="checkbox" name="ms" value="y" '.$p_subscribe_checked.'>Add to OpenLCB email list<p>'; - echo '<button type="submit">Next</button>'; - echo '</form>'; - echo '</body></html>'; - return; -} - -// open DB -global $opts; -mysql_connect($opts['hn'],$opts['un'],$opts['pw']); -@mysql_select_db($opts['db']) or die( "Unable to select database"); - -// see if person already present -$query = "SELECT * FROM Person - WHERE person_email = '".$p_email."' - ;"; -$result=mysql_query($query); - -if (mysql_numrows($result) == 0) { - // insert this person - $query = "INSERT INTO Person - (person_first_name, person_last_name, person_email, person_organization, person_request_IP_address, person_subscribe) - VALUES - ('".$p_first_name."', '".$p_last_name."', '".$p_email."', '".$p_organization."', - '".$_SERVER['REMOTE_ADDR']."', '".$p_subscribe."') - ;"; - $result=mysql_query($query); - $id = mysql_insert_id(); // inserted ID -} else if (mysql_numrows($result) == 1) { - // person already exists - $id = mysql_result($result,0,"person_id"); -} else { - // can't cope - echo "Sorry, have multiple records for this email, can't cope. Please contact op...@pa... for help"; -} - -// now, set if type request present -// (only 256 for now) -$size = $args["sz"]; -if ($size == "") { - echo 'Last, enter the request information.<br>'; - echo '<form method="post" action="requestuidrange.php">'; - echo 'Requested allocations:<br>'; - echo '<input type="radio" name="sz" group="size" value="1" checked="yes">256 values<p>'; - echo 'Comment: <textarea name="cm"></textarea><p>'; - echo 'URL: <textarea name="ur"></textarea><p>'; - - echo '<input type="hidden" name="fn" value="'.$p_first_name.'"/>'; - echo '<input type="hidden" name="ln" value="'.$p_last_name.'"/>'; - echo '<input type="hidden" name="or" value="'.$p_organization.'"/>'; - echo '<input type="hidden" name="em" value="'.$p_email.'"/>'; - echo '<button type="submit">Submit Request</button>'; - echo '</form>'; - echo '(Larger requests are handled offline, please contact op...@pa... directly)'; - echo '</body></html>'; - return; -} - -// got all needed info, make the request -$b0 = 5; -$b1 = 1; -$b2 = 1; -$b3 = 1; - -$query = "SELECT MAX(uniqueid_byte4_value) FROM UniqueIDs - WHERE uniqueid_byte0_value = '".$b0."' - AND uniqueid_byte1_value = '".$b1."' - AND uniqueid_byte2_value = '".$b2."' - AND uniqueid_byte3_value = '".$b3."' - ;"; -$result=mysql_query($query); - -$next = 1+mysql_result($result,0,0); - -// insert -$query = "INSERT INTO UniqueIDs - (person_id, uniqueid_byte0_value, uniqueid_byte1_value, uniqueid_byte2_value, - uniqueid_byte3_value, uniqueid_byte4_value, uniqueid_byte5_value, - uniqueid_byte5_mask, uniqueid_user_comment, uniqueid_url) - VALUES - ('".$id."', '".$b0."', '".$b1."', '".$b2."', - '".$b3."', '".$next."', '0', - '255','".$args["cm"]."','".$args["ur"]."') - ;"; -$result=mysql_query($query); -if (! $result) { - echo "Could not commit to database, contact op...@pa... for help. Error (" . mysql_errno() . ") " . mysql_error(); - return; -} - -// inform user - -$range = $b0.' . '.$b1.' . '.$b2.' . '.$b3.' . '.$next.' . '.' (0-255)'; - -echo 'Your assigned range is:<br>'; -echo $range; - -// and send email notification -define(EMAIL_FROM, "op...@pa..."); - -$subject = "OpenLCB unique ID range assignment"; -$body = "You were assigned an OpenLCB unique ID range of: \n".$range."\n\nThe OpenLCB Group\n"; - -include('Mail.php'); - -$recipients = array( $p_email ); # Can be one or more emails - -$headers = array ( - 'From' => EMAIL_FROM, - 'To' => join(', ', $recipients), - 'CC' => EMAIL_FROM, - 'Subject' => $subject, -); - -$mail_object =& Mail::factory('smtp', - array( - 'host' => 'prwebmail', - 'auth' => true, - 'username' => 'openlcb', - 'password' => $opts['email'], - #'debug' => true, # uncomment to enable debugging - )); - -$ok = $mail_object->send($recipients, $headers, $body); - -if ($ok) { - echo "<p>Confirmation email sent</P>"; -} else { - echo "<p>Unable to send confirmation email</P>"; -} - -?> - -</body></html> +<?php +header("Location: http://registry.openlcb.org/requestuniqueidrange", true, 301); +exit(); +?> \ No newline at end of file Modified: trunk/web/uidxml.php =================================================================== --- trunk/web/uidxml.php 2016-02-09 07:35:07 UTC (rev 4131) +++ trunk/web/uidxml.php 2016-02-11 11:59:46 UTC (rev 4132) @@ -1,50 +1,4 @@ -<?php require_once('access.php');?> - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" - "http://www.w3.org/TR/html4/loose.dtd"> - - -<?php - -// open DB -global $opts; -mysql_connect($opts['hn'],$opts['un'],$opts['pw']); -@mysql_select_db($opts['db']) or die( "Unable to select database. Error (" . mysql_errno() . ") " . mysql_error()); - - -function value($result, $j, $index) { - if (255 == mysql_result($result,$j,"uniqueid_byte".$index."_mask")) return "*"; - else return mysql_result($result,$j,"uniqueid_byte".$index."_value"); -} - -$query = "SELECT * FROM UniqueIDs LEFT JOIN Person USING (person_id) - ORDER BY uniqueid_byte0_value, uniqueid_byte1_value, uniqueid_byte2_value, uniqueid_byte3_value, uniqueid_byte4_value, uniqueid_byte5_value - ;"; -$result=mysql_query($query); - -echo "<uidranges>\n"; -echo "<!-- '*' means that any values are accepted in that byte, forming the range.-->\n"; - -for ($j = 0; $j < mysql_numrows($result); $j++) { - echo '<uidrange>'; - echo '<byte0>'.value($result,$j,"0").'</byte0>'; - echo '<byte1>'.value($result,$j,"1").'</byte1>'; - echo '<byte2>'.value($result,$j,"2").'</byte2>'; - echo '<byte3>'.value($result,$j,"3").'</byte3>'; - echo '<byte4>'.value($result,$j,"4").'</byte4>'; - echo '<byte5>'.value($result,$j,"5").'</byte5>'; - if (mysql_result($result,$j,"person_organization") != '') { - echo '<organization>'.mysql_result($result,$j,"person_organization").'</organization>'; - } else { - echo '<firstname>'.mysql_result($result,$j,"person_first_name").'</firstname><lastname>'.mysql_result($result,$j,"person_last_name").'</lastname>'; - } - echo '<url>'.mysql_result($result,$j,"uniqueid_url").'</url>'; - echo '<comment>'.mysql_result($result,$j,"uniqueid_user_comment").'</comment>'; - echo "</uidrange>\n"; -} - -echo "</uidranges>\n"; - -?> - - +<?php +header("Location: http://registry.openlcb.org/uniqueidrangesxml", true, 301); +exit(); +?> \ No newline at end of file Modified: trunk/web/viewuid.php =================================================================== --- trunk/web/viewuid.php 2016-02-09 07:35:07 UTC (rev 4131) +++ trunk/web/viewuid.php 2016-02-11 11:59:46 UTC (rev 4132) @@ -1,122 +1,4 @@ -<?php require_once('access.php');?> - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" - "http://www.w3.org/TR/html4/loose.dtd"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - <title>View OpenLCB Unique ID Ranges</title> - - <STYLE TYPE="text/css"> - </STYLE> - -</head> -<body> -<IMG SRC="logo-ajs-dph.png" NAME="graphics1" ALIGN=RIGHT WIDTH=195 HEIGHT=80 BORDER=0> -<h1>View OpenLCB Unique ID Ranges</h1> - -This page shows the ranges of OpenLCB Unique ID's that have been assigned to date. -The numbers below are in hexadecimal. -<P> -For more information on OpenLCB, please see the <a href="../documents/index.html">documentation page</a>. -For more information on OpenLCB unique ID assignment, please see the current draft -<a href="../specs/drafts/GenUniqueIdS.pdf">specification</a> and -<a href="../specs/drafts/GenUniqueIdTN.pdf">technical note</a>. - -<?php - -// open DB -global $opts; -mysql_connect($opts['hn'],$opts['un'],$opts['pw']); -@mysql_select_db($opts['db']) or die( "Unable to select database. Error (" . mysql_errno() . ") " . mysql_error()); - - -function value($result, $j, $index) { - if (255 == mysql_result($result,$j,"uniqueid_byte".$index."_mask")) return "*"; - else return strtoupper(dechex(mysql_result($result,$j,"uniqueid_byte".$index."_value"))); -} - -$query = "SELECT * FROM UniqueIDs LEFT JOIN Person USING (person_id) - WHERE uniqueid_byte1_mask = 255 - AND uniqueid_byte2_mask = 255 - AND uniqueid_byte3_mask = 255 - AND uniqueid_byte4_mask = 255 - AND uniqueid_byte5_mask = 255 - ORDER BY uniqueid_byte0_value, uniqueid_byte0_mask, - uniqueid_byte1_value, uniqueid_byte1_mask, - uniqueid_byte2_value, uniqueid_byte2_mask, - uniqueid_byte3_value, uniqueid_byte3_mask, - uniqueid_byte4_value, uniqueid_byte4_mask, - uniqueid_byte5_value, uniqueid_byte5_mask - ;"; -$result=mysql_query($query); - -echo '<table border="1">'; -echo "<tr><th colspan='6'>Range. '*' means that any values are accepted in that byte.</th>"; -echo "<th>Delegating organization or person</th><th>URL</th><th>Comment</th></tr>"; - -for ($j = 0; $j < mysql_numrows($result); $j++) { - echo '<tr>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($result,$j,"0").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($result,$j,"1").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($result,$j,"2").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($result,$j,"3").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($result,$j,"4").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($result,$j,"5").'</td>'; - if (mysql_result($result,$j,"person_organization") != '') { - echo '<td>'.mysql_result($result,$j,"person_organization").'</td>'; - } else { - echo '<td>'.mysql_result($result,$j,"person_first_name").' '.mysql_result($result,$j,"person_last_name").'</td>'; - } - echo '<td>'.mysql_result($result,$j,"uniqueid_url").'</td>'; - echo '<td>'.mysql_result($result,$j,"uniqueid_user_comment").'</td>'; - echo '</tr>'; -} - -echo '</table>'; - -for ($i = 0; $i < mysql_numrows($result); $i++) { - - $query = "SELECT * FROM UniqueIDs LEFT JOIN Person USING (person_id) - WHERE uniqueid_byte0_value = ".mysql_result($result,$i,"uniqueid_byte0_value")." - AND NOT ( uniqueid_byte1_mask = 255 AND uniqueid_byte2_mask = 255 AND uniqueid_byte3_mask = 255 - AND uniqueid_byte4_mask = 255 AND uniqueid_byte5_mask = 255 ) - ORDER BY uniqueid_byte1_value, uniqueid_byte1_mask, - uniqueid_byte2_value, uniqueid_byte2_mask, - uniqueid_byte3_value, uniqueid_byte3_mask, - uniqueid_byte4_value, uniqueid_byte4_mask, - uniqueid_byte5_value, uniqueid_byte5_mask - ;"; - $table=mysql_query($query); - - if (mysql_numrows($table) > 0) { - echo "<h3>".mysql_result($result,$i,"uniqueid_user_comment")."</h3>\n"; - echo '<table border="1">'; - echo "<tr><th colspan='6'>Range. '*' means that any values are accepted in that byte.</th>"; - echo "<th>Delegating organization or person</th><th>URL</th><th>Comment</th></tr>"; - - for ($j = 0; $j < mysql_numrows($table); $j++) { - echo '<tr>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($table,$j,"0").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($table,$j,"1").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($table,$j,"2").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($table,$j,"3").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($table,$j,"4").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($table,$j,"5").'</td>'; - if (mysql_result($table,$j,"person_organization") != '') { - echo '<td>'.mysql_result($table,$j,"person_organization").'</td>'; - } else { - echo '<td>'.mysql_result($table,$j,"person_first_name").' '.mysql_result($table,$j,"person_last_name").'</td>'; - } - echo '<td>'.mysql_result($table,$j,"uniqueid_url").'</td>'; - echo '<td>'.mysql_result($table,$j,"uniqueid_user_comment").'</td>'; - echo '</tr>'; - } - - echo '</table>'; - } -} - -?> - -</body></html> +<?php +header("Location: http://registry.openlcb.org/uniqueidranges", true, 301); +exit(); +?> \ No newline at end of file Modified: trunk/web/viewuidall.php =================================================================== --- trunk/web/viewuidall.php 2016-02-09 07:35:07 UTC (rev 4131) +++ trunk/web/viewuidall.php 2016-02-11 11:59:46 UTC (rev 4132) @@ -1,74 +1,4 @@ -<?php require_once('access.php');?> - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" - "http://www.w3.org/TR/html4/loose.dtd"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - <title>View All OpenLCB Unique ID Ranges</title> - - <STYLE TYPE="text/css"> - </STYLE> - -</head> -<body> -<IMG SRC="logo-ajs-dph.png" NAME="graphics1" ALIGN=RIGHT WIDTH=195 HEIGHT=80 BORDER=0> -<h1>View All OpenLCB Unique ID Ranges</h1> - -This page shows the ranges of OpenLCB Unique ID's that have been assigned to date. -<P> -For more information on OpenLCB, please see the <a href="../documents/index.html">documentation page</a>. -For more information on OpenLCB unique ID assignment, please see the current draft -<a href="../specs/drafts/GenUniqueIdS.pdf">specification</a> and -<a href="../specs/drafts/GenUniqueIdTN.pdf">technical note</a>. - -<?php - -// open DB -global $opts; -mysql_connect($opts['hn'],$opts['un'],$opts['pw']); -@mysql_select_db($opts['db']) or die( "Unable to select database. Error (" . mysql_errno() . ") " . mysql_error()); - - -function value($result, $j, $index) { - if (255 == mysql_result($result,$j,"uniqueid_byte".$index."_mask")) return "*"; - else return strtoupper(dechex(mysql_result($result,$j,"uniqueid_byte".$index."_value"))); -} - -$query = "SELECT * FROM UniqueIDs LEFT JOIN Person USING (person_id) - ORDER BY uniqueid_byte0_value, uniqueid_byte0_mask DESC, - uniqueid_byte1_value, uniqueid_byte1_mask DESC, - uniqueid_byte2_value, uniqueid_byte2_mask DESC, - uniqueid_byte3_value, uniqueid_byte3_mask DESC, - uniqueid_byte4_value, uniqueid_byte4_mask DESC, - uniqueid_byte5_value, uniqueid_byte5_mask DESC - ;"; -$result=mysql_query($query); - -echo '<table border="1">'; -echo "<tr><th colspan='6'>Range. '*' means that any values are accepted in that byte.</th>"; -echo "<th>Delegating organization or person</th><th>URL</th><th>Comment</th></tr>"; - -for ($j = 0; $j < mysql_numrows($result); $j++) { - echo '<tr>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($result,$j,"0").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($result,$j,"1").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($result,$j,"2").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($result,$j,"3").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($result,$j,"4").'</td>'; - echo '<td WIDTH="20" ALIGN="CENTER">'.value($result,$j,"5").'</td>'; - if (mysql_result($result,$j,"person_organization") != '') { - echo '<td>'.mysql_result($result,$j,"person_organization").'</td>'; - } else { - echo '<td>'.mysql_result($result,$j,"person_first_name").' '.mysql_result($result,$j,"person_last_name").'</td>'; - } - echo '<td>'.mysql_result($result,$j,"uniqueid_url").'</td>'; - echo '<td>'.mysql_result($result,$j,"uniqueid_user_comment").'</td>'; - echo '</tr>'; -} - -echo '</table>'; - -?> - -</body></html> +<?php +header("Location: http://registry.openlcb.org/uniqueidranges", true, 301); +exit(); +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |