Changeset 365 for trunk/identification.php
- Timestamp:
- Feb 19, 2004, 9:21:56 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/identification.php
r364 r365 37 37 $query = 'SELECT password'; 38 38 $query.= ' FROM '.USERS_TABLE; 39 $query.= " WHERE username = '".$_POST[' login']."';";39 $query.= " WHERE username = '".$_POST['username']."';"; 40 40 $row = mysql_fetch_array( mysql_query( $query ) ); 41 41 if( $row['password'] == md5( $_POST['pass'] ) ) 42 42 { 43 $session_id = session_create( $_POST[' login'] );43 $session_id = session_create( $_POST['username'] ); 44 44 $url = 'category.php?id='.$session_id; 45 45 header( 'Request-URI: '.$url ); … … 60 60 include('include/page_header.php'); 61 61 62 $handle = $vtp->Open( './template/default/identification.vtp' ); 63 // language 64 $vtp->setGlobalVar( $handle, 'ident_title', $lang['ident_title'] ); 65 $vtp->setGlobalVar( $handle, 'login', $lang['login'] ); 66 $vtp->setGlobalVar( $handle, 'password', $lang['password'] ); 67 $vtp->setGlobalVar( $handle, 'submit', $lang['submit'] ); 68 $vtp->setGlobalVar( $handle, 'ident_guest_visit',$lang['ident_guest_visit'] ); 69 $vtp->setGlobalVar( $handle, 'ident_register', $lang['ident_register'] ); 70 $vtp->setGlobalVar( $handle, 'ident_forgotten_password', 71 $lang['ident_forgotten_password'] ); 72 // conf 73 $vtp->setGlobalVar( $handle, 'mail_webmaster', $conf['mail_webmaster'] ); 74 // user 75 $vtp->setGlobalVar( $handle, 'user_template', $user['template'] ); 62 $template->set_filenames( array('identification'=>'identification.tpl') ); 76 63 initialize_template(); 64 65 $template->assign_vars(array( 66 'MAIL_ADMIN' => $conf['mail_webmaster'], 67 68 'L_TITLE' => $lang['ident_title'], 69 'L_USERNAME' => $lang['login'], 70 'L_PASSWORD' => $lang['password'], 71 'L_LOGIN' => $lang['submit'], 72 'L_GUEST' => $lang['ident_guest_visit'], 73 'L_REGISTER' => $lang['ident_register'], 74 'L_FORGET' => $lang['ident_forgotten_password'], 75 76 'T_STYLE' => $user['template'], 77 78 'F_LOGIN_ACTION' => add_session_id('identification.php') 79 )); 80 77 81 //-------------------------------------------------------------- errors display 78 82 if ( sizeof( $errors ) != 0 ) 79 83 { 80 $vtp->addSession( $handle, 'errors' ); 81 foreach ( $errors as $error ) { 82 $vtp->addSession( $handle, 'li' ); 83 $vtp->setVar( $handle, 'li.li', $error ); 84 $vtp->closeSession( $handle, 'li' ); 84 $template->assign_block_vars('errors',array()); 85 for ( $i = 0; $i < sizeof( $errors ); $i++ ) 86 { 87 $template->assign_block_vars('errors.error',array('ERROR'=>$errors[$i])); 85 88 } 86 $vtp->closeSession( $handle, 'errors' );87 89 } 88 //------------------------------------------------------------------ users list 89 // retrieving all the users login 90 $query = 'select username from '.USERS_TABLE.';'; 91 $result = mysql_query( $query ); 92 if ( mysql_num_rows ( $result ) < $conf['max_user_listbox'] ) 93 { 94 $vtp->addSession( $handle, 'select_field' ); 95 while ( $row = mysql_fetch_array( $result ) ) 96 { 97 if ( $row['username'] != 'guest' ) 98 { 99 $vtp->addSession( $handle, 'option' ); 100 $vtp->setVar( $handle, 'option.option', $row['username'] ); 101 $vtp->closeSession( $handle, 'option' ); 102 } 103 } 104 $vtp->closeSession( $handle, 'select_field' ); 105 } 106 else 107 { 108 $vtp->addSession( $handle, 'text_field' ); 109 $vtp->closeSession( $handle, 'text_field' ); 110 } 90 111 91 //-------------------------------------------------------------- visit as guest 112 92 if ( $conf['access'] == 'free' ) 113 93 { 114 $vtp->addSession( $handle, 'guest_visit' ); 115 $vtp->closeSession( $handle, 'guest_visit' ); 116 } 117 //---------------------------------------------------------------- registration 118 if ( $conf['access'] == 'free' ) 119 { 120 $vtp->addSession( $handle, 'register' ); 121 $vtp->closeSession( $handle, 'register' ); 94 $template->assign_block_vars('free_access',array()); 122 95 } 123 96 //----------------------------------------------------------- html code display 124 $code = $vtp->Display( $handle, 0 ); 125 echo $code; 97 $template->pparse('identification'); 126 98 include('include/page_tail.php'); 127 99 ?>
Note: See TracChangeset
for help on using the changeset viewer.