[Opensim-users] Help: Self registration script no longer working

Clive Gould cliveg at gmail.com
Fri Mar 11 16:01:52 UTC 2011


Hi Jefferson

I append the verify.php script which writes to the OpenSim database.

Thanks very much for your interest :)

Clive

Clive Gould
HE PAL ICT
Bromley College
http://www.linuxtraining.org.uk

[root at vleinternal www]# cat verify.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                      "http://www.w3.org/TR/html401/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Registration Complete</title>
<link rel="stylesheet" type="text/css" href="osstyle.css" />
</head>
<body>
<!-- Do not change this block and include ibossur!.txt in any distribution
-->
<!-- Web Interface to register (and later administrate) Open Simulator users
-->
<!-- Copyright (C) 2009, Ferdinand Francino -->
<!-- see ibossur!.txt for license -->
<!-- /end of block! -->
<?php
// open the database using the configuration and connect files
include 'config.php';
include 'connect.php';
// this function generates a UUID for the user
function uuid()
{
$chars = md5(uniqid(mt_rand(), true));
$uuid  = substr($chars,0,8) . '-';
$uuid .= substr($chars,8,4) . '-';
$uuid .= substr($chars,12,4) . '-';
$uuid .= substr($chars,16,4) . '-';
$uuid .= substr($chars,20,12);
return $uuid;
}
$queryString = $_SERVER['QUERY_STRING'];
if ($queryString !=="")
{
$query = "SELECT * FROM registration";
$result = mysql_query($query) or die(mysql_error());
  while($row = mysql_fetch_array($result))
{
if ($queryString == $row["activationkey"])
        {
// don't remember why this line is commented out, seems to work w/o it
// $userInfo = "SELECT * FROM registration WHERE (id = $row[id])";
// Database insertion
include 'settings.php';
// pay attention to the database table being used!!!
$table = "users";
$username=$row['username'];
$lastname=$row['lastname'];
$password=$row['password'];
$email=$row['email'];
$this_id=uuid();
$time = time();
$passwordHash = md5(md5($password) . ":" ); // salt is not yet included in
this
$insert = mysql_query("INSERT INTO  $table  (UUID, username, lastname,
passwordHash, passwordSalt, homeRegion, homeLocationX, homeLocationY,
homeLocationZ, homeLookAtX, homeLookAtY, homeLookAtZ, created, lastLogin,
userInventoryURI,userAssetURI, profileCanDoMask, profileWantDoMask,
profileAboutText, profileFirstText, profileImage, profileFirstImage,
webLoginKey,      homeRegionID,userFlags,godLevel,customType,partner,email)
        VALUES
('$this_id','$username','$lastname','$passwordHash','','$homeRegion','$homelocX','$homelocY','$homelocZ','$homelookX','$homelookY','$homelookZ','$time','0','$userInventoryURI','$userAssetURI','0','0','','','00000000-0000-0000-0000-000000000000',
'00000000-0000-0000-0000-000000000000',
'00000000-0000-0000-0000-000000000000',
'$homeRegionID','0','0','','00000000-0000-0000-0000-000000000000','$email')");
// Success output, change at will
print "Congratulations! " . $row["username"] . " ". $row["lastname"] ." is
now registered for access to OpenSim at Bromley College";
$sql="UPDATE registration SET activationkey = '', status='activated' WHERE
(id = $row[id])";
$verified="done";
 if (!mysql_query($sql))
                {
die('Error: ' . mysql_error());
                }
        }
}
include 'done.php';
}
else {
print "The Validation String is empty, paste the complete link into your
browser address bar.<br>";
}
?>
<?php
// close the database when things are done.
include 'close.php';
?>

</body>
</html>


On Fri, Mar 11, 2011 at 3:53 PM, <jeffersontwig at gmail.com> wrote:

> Hey, could you email me the old ones? I can that way take a look, email to
> jeffersontwig at gmail.com thanks.
>
> Jefferson
> iLifegrid founder
>
> Sent from my iPhone
>
> On 11 Mar 2011, at 03:43 p.m., Clive Gould <cliveg at gmail.com> wrote:
>
> > Hi
> >
> > I have a set of PHP scripts originally developed at Glagow Caledonian
> University that allow users to self register with our OpenSim standalone
> installation, provided they have a valid institutional email address.
> >
> > These worked fine with OpenSim 0.6.9 but no longer work with OpenSim 0.7
> as there appears to have been a change in the database tables between the
> two versions.
> >
> > Looking at the original script, which worked with 0.6.9 the following
> user table settings are written:
> >
> > UUID, username, lastname, passwordHash, passwordSalt, homeRegion,
> homeLocationX, homeLocationY, homeLocationZ, homeLookAtX, homeLookAtY,
> homeLookAtZ, created, lastLogin, userInventoryURI,userAssetURI,
> profileCanDoMask, profileWantDoMask, profileAboutText, profileFirstText,
> profileImage, profileFirstImage, webLoginKey,
>  homeRegionID,userFlags,godLevel,customType,partner,email
> >
> > Looking at the new database structure with 0.7 the UserAccounts table now
> contains the following fields:
> >
> > PrincipalID, ScopeID, FirstName, LastName, Email, ServiceURLs, Created,
> UserLevel, UserFlags, UserTitle
> >
> > Does anyone have a set of self-registration scripts that will work with
> OpenSim 0.7 or can advise me what tables a self registration script would
> now need to write to?
> >
> > Thanks very much
> >
> > Clive
> >
> >
> >
> >
> >
> > _______________________________________________
> > Opensim-users mailing list
> > Opensim-users at lists.berlios.de
> > https://lists.berlios.de/mailman/listinfo/opensim-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-users/attachments/20110311/49d1189b/attachment.html>


More information about the Opensim-users mailing list