I was requested by the client to design something like 
www.clubexpress.com. When you register with Club Express you are given 
an URL after your Club's short name. So for instance if you Club name is 
Jochem then you would be given an URL like 
http://jochem.clubexpress.com/ with your default Club's page and login 
screen. This is exactly what I need to do with ColdFusion. When an user 
register its club an url for that newly created club is created. That's 
the functionality I need and nothing else.

Ravi.

Jochem van Dieten wrote:
> Ravi Gehlot wrote:
>   
>> Do you still have this script?
>>     
>
> It is not just a script, it is a highly specific DNS + DHCP management 
> solution tied to RADIUS authentication for a small ISP and unless you 
> are doing the first eduroam deployment in the US ever you are not going 
> to need 99% of it. I have cleaned up the fragment that does an actual 
> nsupdate call and attached it below, but if you want more you need to be 
> specific in what you want.
>
> Jochem
>
>
> All code:
> Copyright OnLine Internet, 2004
> License: BSD, http://www.opensource.org/licenses/bsd-license.php
>
>
> Library function that does the actual nsupdate call:
>
> /*-------------------------------------------------------------------------
>   *
>   * function nsupdate($command, $server="localhost")
>   *      Pushes the command to the DNS server
>   *
>   * Parameter
>   *       string $command
>   *           the nsupdate command to execute
>   *       string $server
>   *           the server to send the update to, default localhost
>   *
>   * Return value
>   *       number $error -
>   *           0 for success
>   *           1 for error
>   *-------------------------------------------------------------------------
>   */
> function nsupdate($command, $server="localhost")
> {
>          // Verify $command is valid nsupdate command
>          if (!eregi('^update (add|delete) [^ ]+ .+$', $command)) {
>                  logError("Invalid nsupdate command string supplied: " . 
> $command);
>                  return 1;
>          }
>
>          $nscommand = "server " . $server . " \n";
>          $nscommand .= $command . " \n";
>          $nscommand .= "\n";
>          $nscommand .= "quit\n";
>
>          $filename = '/tmp/' . md5(uniqid());
>          file_put_contents($filename, $nscommand);
>
>          echo "<pre>";
>          readfile($filename);
>          echo "</pre>";
>
>          $last_line = system('/usr/local/bin/nsupdate ' . $filename, 
> $retval);
>          unlink($filename);
>
>          if ($retval) {
>                  logError("nsupdate error, string supplied: " . $command);
>          }
>          return $retval;
> }
>
>
>
> Action page that accepts a form post, validates it and calls the 
> nsupdate library:
> if (isset($_POST["Add"])) {
>      // Format the input
>      if ($type == 'A' || $type == 'AAAA' || $type == 'CNAME' || $type == 
> 'MX') {
>          $_POST['name'] = eregi_replace('(.*)\.', '\1', $_POST['name']);
>      }
>      if ($type == 'CNAME') {
>         $_POST['value'] = eregi_replace('(.*)\.', '\1', $_POST['value']);;
>      }
>      $command .= "update add " . $_POST['name'] . " 86400 " . $type . " 
> " . $_POST['value'];
>
>      // Run the update
>      $error = nsupdate($command);
>      // Check the result
>      if ($error) {
>          die("nsupdate failed, rollback.");
>      }
>      print('Record added.<br /><a href="index.php">Back</a>');
>      exit;
> }
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & 
Flex 2
Free Trial 
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278217
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to