$template->assign_vars(array('L_REGISTRATION' => $lang['profilcp_register_pagetitle'], 'L_USERNAME' => $lang['Username'], 'L_EMAIL_TITLE' => $lang['profilcp_email_title'], 'L_EMAIL' => $lang['Email'], 'L_EMAIL_CONFIRM' => $lang['profilcp_email_confirm'], 'L_IMAGE' => $lang['anti_robotic'], 'L_IMAGE_EXPLAIN' => $lang['anti_robotic_explain'], 'L_PASSWORD_TITLE' => $lang['Password'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_CURRENT_PASSWORD' => $lang['Current_password'], 'L_CONFIRM_PASSWORD_EXPLAIN' => $lang['profilcp_password_explain'], 'L_NEW_PASSWORD' => $lang['Password'], 'L_CONFIRM_PASSWORD' => $lang['Confirm_password'], 'L_PASSWORD_IF_CHANGED' => $lang['password_if_changed'], 'L_PASSWORD_CONFIRM_IF_CHANGED' => $lang['password_confirm_if_changed']));
 // get the current password ?
 if (!$create_user) {
     $template->assign_block_vars('switch_get_cur_password', array());
 }
 // name edition allowed ?
 if ($create_user || $board_config['allow_namechange'] || is_admin($userdata)) {
     $template->assign_block_vars('switch_edit_name', array());
 } else {
     $template->assign_block_vars('switch_no_edit_name', array());
 }
 // anti-robotic on registration
 if ($board_config['robotic_register'] && $create_user) {
     $template->assign_block_vars('switch_anti_robotic', array());
     // get the anti-robotic string
     $userdata['session_robot'] = pcp_gen_rand_string(false);
     $sql = "UPDATE " . SESSIONS_TABLE . " SET session_robot = '" . $userdata['session_robot'] . "' WHERE session_id = '" . $userdata['session_id'] . "'";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not update session robot', '', __LINE__, __FILE__, $sql);
     }
     // get the images
     for ($i = 0; $i < strlen($userdata['session_robot']); $i++) {
         $template->assign_block_vars('switch_anti_robotic.robotic_pic', array('PIC' => append_sid("profile_pic.{$phpEx}?l={$i}")));
     }
 }
 // value
 $template->assign_vars(array('USERNAME' => $view_userdata['username'], 'EMAIL' => $view_userdata['user_email'], 'EMAIL_CONFIRM' => $view_userdata['user_email']));
 // forum rules
 /*
 if ( intval($board_config['forum_rules']) != 0 )
 {
 $sql = "SELECT user_id, username, user_email, user_active, user_lang, user_type\n        FROM " . USERS_TABLE . "\n        WHERE user_email = '" . str_replace("\\'", "''", $email) . "'\n            AND username = '******'", "''", $username) . "'";
 if ($result = $db->sql_query($sql)) {
     if ($row = $db->sql_fetchrow($result)) {
         if (!$row['user_active']) {
             message_die(GENERAL_MESSAGE, $lang['No_send_account_inactive']);
         }
         if ($row['user_type'] == User_Type_LDAP) {
             message_die(GENERAL_ERROR, $lang['No_send_account_LDAP']);
         }
         $username = $row['username'];
         $user_id = $row['user_id'];
         $user_actkey = pcp_gen_rand_string(true);
         $key_len = 54 - strlen($server_url);
         $key_len = $str_len > 6 ? $key_len : 6;
         $user_actkey = substr($user_actkey, 0, $key_len);
         $user_password = pcp_gen_rand_string(false);
         $sql = "UPDATE " . USERS_TABLE . "\n                SET user_newpasswd = '" . md5($user_password) . "', user_actkey = '{$user_actkey}'\n                WHERE user_id = " . $row['user_id'];
         if (!$db->sql_query($sql)) {
             message_die(GENERAL_ERROR, 'Could not update new password information', '', __LINE__, __FILE__, $sql);
         }
         //-- mod : profilcp --------------------------------------------------------------------------------
         //-- delete
         //          include($phpbb_root_path . 'includes/emailer.'.$phpEx);
         //-- fin mod : profilcp ----------------------------------------------------------------------------
         $emailer = new emailer($board_config['smtp_delivery']);
         $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\n";
         $emailer->use_template('user_activate_passwd', $row['user_lang']);
         $emailer->email_address($row['user_email']);
         $emailer->set_subject($lang['New_password_activation']);
         $emailer->extra_headers($email_headers);
         $emailer->assign_vars(array('SITENAME' => $board_config['sitename'], 'USERNAME' => $username, 'PASSWORD' => $user_password, 'EMAIL_SIG' => !empty($board_config['board_email_sig']) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', 'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey));