=linkcount" );
$body = "Welcome to linkshelf!\nYour username: $usr\nYour password: $pss\n\n";
$body .= "You can now log on to your links from anywhere in the world by typing http://www.linkshelf.com and entering ";
$body .= "your username and password. ";
/* $body .= "A short manual:\n\n";
$body .= "Adding links:\n";
$body .= "To add a link click on \"Link:add\" on the shelf you want to add the link to. Enter the URL (link-address) your want to add and enter a description. Select the window you want to create the link in or select \"create in new window\" to automatically create a new window for this link\n\n";
$body .= "Adding windows:\n ";
$body .= "Click on \"Window:add\" and enter the name of the window that you want to create\n\n";
$body .= "Removing windows/links:\n";
$body .= "Click on \"Action:delete\" and select the window or link you want to delete\n\n";
$body .= "Edit windows/links:\n";
$body .= "Click on \"Action:edit\" and select the window or link you want to edit\n\n";
$body .= "Move links/windows:\n";
$body .= "Click on \"Action:move\" and click on the window or link you want to move. Links can also be moved to another window by clicking \"window\". Windows can be moved to another shelf by clicking \"shelf\".\n\n";
$body .= "Creating Shelfs:\n";
$body .= "To create a new shelf click on the tab \"account\". In the form click on \"shelf:add\" and enter a name for the new shelf. You can also enter a sharename and password. Right now this information is obsolete, but in the future you'll be able to share shelfs with other people\n\n";
$body .= "Editting Shelfs:\n";
$body .= "Click on the tab \"account\" and select \"Shelf:add\"\n\n";
$body .= "Deleting Shelfs:\n";
$body .= "Click on the tab \"account\" and select \"Shelf:delete\"\n\n";
*/
@mail( $email, "Your linkshelf account", $body, "From: webmaster@linkshelf.com" );
print( "" );
}
break;
case "editaccount":
$query = sprintf( "update linkshelf.user set language=\"$language\", email=\"%s\" where id=$accountid", htmlentities( $email ) );
mysql_query( $query );
print( "" );
break;
case "forgotpass":
if( !$name && !$email ){
print( "" );
die();
}
$query = sprintf( "select * from linkshelf.user where ( \"%s\"=\"\" and name=\"%s\" ) or ( \"%s\"=\"\" and email=\"%s\" )", htmlentities( $email ), htmlentities( $name ), htmlentities( $name ), htmlentities( $email ) );
$result = mysql_query( $query );
if( $result && $row = mysql_fetch_array( $result ) ){
print( "" );
} else{
print( "alert( \"error in program, mail server is not configured correctly. Please contact webmaster@linkshelf.com with your account-name or username to get the information sent manually\" );\n" );
print( "self.parent.login();\n" );
print( "" );
}
} else{
print( "" );
}
break;
case "includeexternal":
$shelf = htmlentities( $shelf );
$pass = htmlentities( $pass );
if( mysql_fetch_array( mysql_query( "select * from linkshelf.shelf where sharename=\"$shelf\" and sharepass=\"$pass\"" ) ) ){
//* get the current external-string
$row = mysql_fetch_array( mysql_query( "select linkshelf.external from user where id=$accountid" ) );
//* check if the shelf is not already included
$external = explode( ",\"", $row['external'] );
for( $i = 1; $i < count( $external ); $i += 2 ){
if( strtolower( $shelf ) == strtolower( substr( $external[ $i ], 0, -1 ) ) ){
print( "" );
}
}
$external = AddSlashes( sprintf( "$row[0],\"$shelf\",\"$pass\"" ) );
mysql_query( "update linkshelf.user set external=\"$external\" where id=$accountid" );
print( "" );
} else{
print( "" );
}
break;
case "unlinkexternal":
//* get the current external-string
$row = mysql_fetch_array( mysql_query( "select linkshelf.external from user where id=$accountid" ) );
//* check if the shelf is not already included
$newexternal = "";
$external = explode( ",\"", $row['external'] );
for( $i = 1; $i < count( $external ); $i += 2 )
if( $name != substr( $external[ $i ], 0, -1 ) )
$newexternal .= sprintf( ",\"%s\",\"%s\"", substr( $external[ $i ], 0, -1 ), substr( $external[ $i + 1 ], 0, -1 ) );
mysql_query( "update linkshelf.user set external=\"$newexternal\" where id=$accountid" );
print( "" );
break;
default:
print( "command: $command ($_GET[command])
" );
printf( "environment: %s
", $_SERVER["QUERY_STRING"] );
}
?>