[Talossa.com portal]
[Citizens Toolbox]
[Immigration]
No Running elections
First section of the Talossan DB API delivered : User authentication V1.0(#14), posted by Mr. Furxheir, R.M.W., [IP Hidden], October 27, 2004 - 13:57. Viewed 861 times.
User InfoText
Mr. Furxheir, R.M.W.
Group: admins
(1791 posts total)
(last post: November 24, 2007 - 15:07)
Citizen #20:
Martí- Paìr Furxhéir
The Talossa DB API will enable PHP developpers to make their own PHP page to be hosted on the Talossan Database server.

Each file received will be inspected for security purposes.

However, this new feature will enable developper with a little PHP experience into making exciting websites.

The first API section concerns user logging into the system.

To use the API, the first characters in your .php file must be : and the first PHP command must be
include( "talossa_db.php" );


Here are the phpfunctions of the user logging module, version 1.0 :

//////////////////////////////////////////////////////////////////////////////
// Encrypts using sha1 a plain text password ( which cannot be stored by any
// script and returns the encrypted version.
//
// If you have a password field, use the "password" name for the field, and
// read the global variable $pwd instead, which will be encrypted.
//
function encryptpwd( $pwd )

//////////////////////////////////////////////////////////////////////////////
// This function displays the string "Current User : [USER NAME]
// <small>&nbsp;&nbsp;(logout link)</small>".
//
// if a user is logged in.
// If the parameter is different than 0, it will show a simple, one line login
// form. You do not need to handle the login form yourself : it is transparent.
//
function ShowLogin( $showForm = 0)


//////////////////////////////////////////////////////////////////////////////
// This function returns the username of the current logged in citizen,
// or an empty string.
//
function GetUserName()


//////////////////////////////////////////////////////////////////////////////
// This function returns the citizen number of the currently logged in citizen
//
function GetUserID()


//////////////////////////////////////////////////////////////////////////////
// This function validates a usernumber and a password, to confirm it is
// valid. Useful for validating a password field. The $password field MUST
// be encrypted.
//
function ValidateUserPassword( $usernumber, $password )





Do you like my stupid hair?
Would you guess that I didn't know what to wear?
I'm just scared of what you think
You make me nervous so I really can't eat.
When you smile, I melt inside
I'm not worthy for a minute of your time






Reply to this post | Back to the forum | Forums Overview| Activate Thread View
Forums Overview | Login | Register | Lost your password? Cyphor (Release: 0.19, PHP 5.2.5)