diff --git a/main/auth/inscription_second.php b/main/auth/inscription_second.php deleted file mode 100644 index a58fa603a6..0000000000 --- a/main/auth/inscription_second.php +++ /dev/null @@ -1,277 +0,0 @@ -".get_lang('EmptyFields')."
\n"; - } - - // CHECK IF THE TWO PASSWORD TOKEN ARE IDENTICAL - - elseif($password1 != $password) - { - $regDataOk = false; - unset($password1, $password); - - $error_message .= "".get_lang('PassTwice')."
\n"; - } - elseif(CHECK_PASS_EASY_TO_FIND && !api_check_password($password)) - { - $error_message .= "".get_lang('PassTooEasy')." : ".api_generate_password()."
".get_lang('EmailWrong').".
\n"; - } - - // CHECK IF THE LOGIN NAME IS ALREADY OWNED BY ANOTHER USER - - else - { - $result = api_sql_query("SELECT user_id FROM $TABLEUSER - WHERE username='$uname'"); - - if (mysql_num_rows($result) > 0) - { - $regDataOk = false; - unset($password1, $password, $uname); - - $error_message .= "".get_lang('UserFree')."
"; - } - else - { - $regDataOk = true; - } - } -} -$nameTools = get_lang('Registration'); -if ( ! $regDataOk) -{ - Display::display_header($nameTools); - api_display_tool_title($nameTools); - echo $error_message; - echo "", - "", - get_lang('Again'), - "", - "
\n"; - Display::display_footer(); - exit; - -} - - -/*> > > > > > > > > > > > REGISTRATION ACCEPTED < < < < < < < < < < < <*/ - -if ($regDataOk) -{ - /*----------------------------------------------------- - STORE THE NEW USER DATA INSIDE THE CLAROLINE DATABASE - -----------------------------------------------------*/ - - api_sql_query("INSERT INTO ".$TABLEUSER." - SET lastname = '".$lastname."', - firstname = '".$firstname."', - username = '".$uname."', - password = '".($userPasswordCrypted?md5($password):$password)."', - email = '".$email."', - status = '".$status."', - official_code = '".$official_code."', - language = '".$language."' - "); - - $_user['user_id'] = mysql_insert_id(); - - -if ($_user['user_id']) -{ - /*-------------------------------------- - SESSION REGISTERING - --------------------------------------*/ - - $_user['firstName'] = stripslashes($firstname); - $_user['lastName' ] = stripslashes($lastname); - $_user['mail' ] = $email; - $_user['language'] = $language; - $is_allowedCreateCourse = ($status == 1) ? true : false ; - - api_session_register('_uid'); - api_session_register('_user'); - api_session_register('is_allowedCreateCourse'); - - //stats - include(api_get_path(LIBRARY_PATH)."events.lib.inc.php"); - event_login(); - // last user login date is now - $user_last_login_datetime = 0; // used as a unix timestamp it will correspond to : 1 1 1970 - - api_session_register('user_last_login_datetime'); - - /*-------------------------------------- - EMAIL NOTIFICATION - --------------------------------------*/ - - if(strstr($email,'@')) - { - // Lets predefine some variables. Be sure to change the from address! - - $emailto = "\"$firstname $lastname\" <$email>"; - $emailfromaddr = api_get_setting('emailAdministrator'); - $emailfromname = api_get_setting('siteName'); - $emailsubject = "[".get_setting('siteName')."] ".get_lang('YourReg')." ".get_setting('siteName'); - - // The body can be as long as you wish, and any combination of text and variables - - $emailbody=get_lang('Dear')." ".stripslashes("$firstname $lastname").",\n\n".get_lang('YouAreReg')." ". get_setting('siteName') ." ".get_lang('Settings')." ". $uname ."\n". get_lang('Pass')." : ".stripslashes($password)."\n\n" .get_lang('Address') ." ". api_get_setting('siteName') ." ". get_lang('Is') ." : ". $_configuration['root_web'] ."\n\n". get_lang('Problem'). "\n\n". get_lang('Formula').",\n\n".get_setting('administratorName')." ".get_setting('administratorSurname')."\n". get_lang('Manager'). " ".get_setting('siteName')."\nT. ".get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".get_setting('emailAdministrator'); - - // Here we are forming one large header line - // Every header must be followed by a \n except the last - $emailheaders = "From: ".get_setting('administratorSurname')." ".get_setting('administratorName')." <".get_setting('emailAdministrator').">\n"; - $emailheaders .= "Reply-To: ".get_setting('emailAdministrator'); - - // Because I predefined all of my variables, this api_send_mail() function looks nice and clean hmm? - @api_send_mail( $emailto, $emailsubject, $emailbody, $emailheaders); - } -} - - -Display::display_header($nameTools); -api_display_tool_title($nameTools); - - echo "".get_lang('Dear')." ".stripslashes("$firstname $lastname").",
".get_lang('PersonalSettings').".
".get_lang('MailHasBeenSent').".
"; - } - - if($is_allowedCreateCourse) - { - echo "",get_lang('NowGoCreateYourCourse'),".
\n"; - $actionUrl = "../create_course/add_course.php"; - } - else - { - echo "",get_lang('NowGoChooseYourCourses'),".
\n"; - $actionUrl = "courses.php?action=subscribe"; - } -// ?uidReset=true&uidReq=$_user['user_id'] - echo "\n"; - -} // else Registration accepted - -$already_second=1; - -Display::display_footer(); -?>