Changeset 345 for trunk/profile.php
- Timestamp:
- Feb 2, 2004, 1:55:18 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/profile.php
r60 r345 18 18 ***************************************************************************/ 19 19 // customize appearance of the site for a user 20 //----------------------------------------------------------- personnal include 21 include_once( './include/init.inc.php' ); 20 //----------------------------------------------------------- include 21 $phpwg_root_path = './'; 22 include_once( $phpwg_root_path.'common.php' ); 22 23 //-------------------------------------------------- access authorization check 23 24 check_login_authorization(); … … 28 29 exit(); 29 30 } 30 //-------------------------------------------------------------- initialization31 check_cat_id( $_GET['cat'] );32 31 //------------------------------------------------------ update & customization 33 32 $infos = array( 'nb_image_line', 'nb_line_page', 'language', … … 70 69 } 71 70 $mail_error = validate_mail_address( $_POST['mail_address'] ); 72 if ( $mail_error != '' ) 73 { 74 array_push( $errors, $mail_error ); 75 } 76 if ( $_POST['use_new_pwd'] == 1 ) 77 { 78 // password must be the same as its confirmation 79 if ( $_POST['password'] != $_POST['passwordConf'] ) 80 { 81 array_push( $errors, $lang['reg_err_pass'] ); 82 } 83 } 84 71 if ( $mail_error != '' ) array_push( $errors, $mail_error ); 72 // password must be the same as its confirmation 73 if ( isset( $_POST['use_new_pwd'] ) 74 and $_POST['password'] != $_POST['passwordConf'] ) 75 array_push( $errors, $lang['reg_err_pass'] ); 76 85 77 if ( count( $errors ) == 0 ) 86 78 { … … 98 90 mysql_query( $query ); 99 91 100 if ( $_POST['use_new_pwd'] == 1)92 if ( isset( $_POST['use_new_pwd'] ) ) 101 93 { 102 94 $query = 'UPDATE '.PREFIX_TABLE.'users'; … … 106 98 mysql_query( $query ); 107 99 } 108 if ( $_POST['create_cookie'] == 1)100 if ( isset( $_POST['create_cookie'] ) ) 109 101 { 110 102 setcookie( 'id',$page['session_id'],$_POST['cookie_expiration'], … … 118 110 } 119 111 // redirection 120 $url = 'category.php?cat='.$page['cat'].'&expand='.$_GET['expand']; 121 if ( $page['cat'] == 'search' ) 122 { 123 $url.= '&search='.$_GET['search'].'&mode='.$_GET['mode']; 124 } 125 if ( $_POST['create_cookie'] != 1 ) $url = add_session_id( $url, true ); 112 $url = 'category.php'; 113 if ( !isset($_POST['create_cookie']) ) $url = add_session_id( $url,true ); 126 114 header( 'Request-URI: '.$url ); 127 115 header( 'Content-Location: '.$url ); … … 131 119 } 132 120 //----------------------------------------------------- template initialization 133 $vtp = new VTemplate; 121 // 122 // Start output of page 123 // 124 $title = $lang['customize_page_title']; 125 include('include/page_header.php'); 126 134 127 $handle = $vtp->Open( './template/'.$user['template'].'/profile.vtp' ); 135 128 initialize_template(); 136 $tpl = array( 'customize_ page_title','customize_title','password','new',129 $tpl = array( 'customize_title','password','new', 137 130 'reg_confirm','submit','create_cookie' ); 138 131 templatize_array( $tpl, 'lang', $handle ); 139 132 //----------------------------------------------------------------- form action 140 $url = './profile.php?cat='.$page['cat'].'&expand='.$page['expand']; 141 if ( $page['cat'] == 'search' ) 142 { 143 $url.= '&search='.$_GET['search'].'&mode='.$_GET['mode']; 144 } 133 $url = './profile.php'; 145 134 $vtp->setGlobalVar( $handle, 'form_action', add_session_id( $url ) ); 146 135 //-------------------------------------------------------------- errors display … … 202 191 $vtp->addSession( $handle, 'select' ); 203 192 $vtp->setVar( $handle, 'select.name', 'template' ); 204 $option = get_dirs( './template /' );193 $option = get_dirs( './template' ); 205 194 for ( $i = 0; $i < sizeof( $option ); $i++ ) 206 195 { … … 379 368 $code = $vtp->Display( $handle, 0 ); 380 369 echo $code; 370 include('include/page_tail.php'); 381 371 ?>
Note: See TracChangeset
for help on using the changeset viewer.