aboutsummaryrefslogtreecommitdiffstats
path: root/register.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2004-12-28 17:56:33 +0000
committerplegall <plg@piwigo.org>2004-12-28 17:56:33 +0000
commit738d4cc7f4161eab7bc0b847849f8d204f41dc8c (patch)
tree011ab2cd31367d3caa9dbce70ce3fed7ba759dcb /register.php
parent4f11be1410a3289ac4cc37f688c491b077ddc83f (diff)
- register process partly rewritten
git-svn-id: http://piwigo.org/svn/trunk@661 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'register.php')
-rw-r--r--register.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/register.php b/register.php
index f939ff3e9..ad44745a3 100644
--- a/register.php
+++ b/register.php
@@ -30,14 +30,21 @@ define('PHPWG_ROOT_PATH','./');
include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
//----------------------------------------------------------- user registration
$errors = array();
-if ( isset( $_POST['submit'] ) )
+if (isset($_POST['submit']))
{
- $errors = register_user( $_POST['login'], $_POST['password'],
- $_POST['password_conf'], $_POST['mail_address'] );
- if ( sizeof( $errors ) == 0 )
+ $errors = register_user($_POST['login'], $_POST['password'],
+ $_POST['password_conf'], $_POST['mail_address']);
+ if (count($errors) == 0)
{
+ $query = '
+SELECT id
+ FROM '.USERS_TABLE.'
+ WHERE username = \''.$_POST['login'].'\'
+;';
+ list($user_id) = mysql_fetch_array(pwg_query($query));
+ $session_id = session_create($user_id, $conf['session_length']);
$url = 'category.php?id='.$session_id;
- redirect( $url );
+ redirect($url);
}
}