function process_form_submissions() { switch ($_GET['m']) { case 'logout': process_logout(); break; case 'agreements': process_agreements(); break; case 'logs': process_logs(); break; case 'universities': process_universities(); break; case 'travels': process_travels(); break; case 'foreigncredits': process_foreign_credits(); break; case 'fmficredits': process_fmfi_credits(); break; case 'students': process_students(); break; case 'studyprogs': process_study_programs(); break; case 'fmficourses': process_fmfi_courses(); break; case 'subjectareas': process_subject_areas(); break; case 'export': process_export(); break; case 'app_list': get_applications(); break; case 'application_edit': application_edit(); break; case 'application_preview': application_preview(); break; case 'application_delete': application_delete(); break; case 'edit_form': edit_application(); break; default: case 'welcome': show_welcome(); break; } }
require_once DIR . '/includes/functions_login.php'; // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### $vbulletin->input->clean_gpc('r', 'a', TYPE_STR); if (empty($_REQUEST['do']) and empty($vbulletin->GPC['a'])) { exec_header_redirect($vbulletin->options['forumhome'] . '.php'); } // ############################### start logout ############################### if ($_REQUEST['do'] == 'logout') { define('NOPMPOPUP', true); $vbulletin->input->clean_gpc('r', 'logouthash', TYPE_STR); if ($vbulletin->userinfo['userid'] != 0 and !verify_security_token($vbulletin->GPC['logouthash'], $vbulletin->userinfo['securitytoken_raw'])) { eval(standard_error(fetch_error('logout_error', $vbulletin->session->vars['sessionurl'], $vbulletin->userinfo['securitytoken']))); } process_logout(); $vbulletin->url = fetch_replaced_session_url($vbulletin->url); if (strpos($vbulletin->url, 'do=logout') !== false) { $vbulletin->url = $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q']; } $show['member'] = false; eval(standard_error(fetch_error('cookieclear', create_full_url($vbulletin->url), $vbulletin->options['forumhome'], $vbulletin->session->vars['sessionurl_q']), '', false)); } // ############################### start do login ############################### // this was a _REQUEST action but where do we all login via request? if ($_POST['do'] == 'login') { $vbulletin->input->clean_array_gpc('p', array('vb_login_username' => TYPE_STR, 'vb_login_password' => TYPE_STR, 'vb_login_md5password' => TYPE_STR, 'vb_login_md5password_utf' => TYPE_STR, 'postvars' => TYPE_BINARY, 'cookieuser' => TYPE_BOOL, 'logintype' => TYPE_STR, 'cssprefs' => TYPE_STR)); // can the user login? $strikes = verify_strike_status($vbulletin->GPC['vb_login_username']); if ($vbulletin->GPC['vb_login_username'] == '') { eval(standard_error(fetch_error('badlogin', $vbulletin->options['bburl'], $vbulletin->session->vars['sessionurl'], $strikes)));
function logout() { process_logout(); return get_userinfo(); }
function do_register() { global $vbulletin, $vbphrase, $db; if ($vbulletin->userinfo['userid']) { json_error(ERR_NO_PERMISSION); } if (!$vbulletin->options['forumrunner_enable_registration']) { json_error(ERR_NO_PERMISSION); } $vbulletin->input->clean_array_gpc('r', array('username' => TYPE_STR, 'email' => TYPE_STR, 'password' => TYPE_STR, 'password_md5' => TYPE_STR, 'birthday' => TYPE_STR, 'timezoneoffset' => TYPE_NUM)); // They are registering. Lets find out what fields are required. if (!$vbulletin->options['allowregistration']) { standard_error(fetch_error('noregister')); } $out = array(); if ($vbulletin->GPC['username']) { // Registering. $userdata =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY); $vbulletin->GPC['coppauser'] = false; $userdata->set_info('coppauser', false); $userdata->set_info('coppapassword', $vbulletin->GPC['password']); $userdata->set_bitfield('options', 'coppauser', false); $userdata->set('parentemail', ''); if (empty($vbulletin->GPC['username']) || empty($vbulletin->GPC['email']) || empty($vbulletin->GPC['password']) && empty($vbulletin->GPC['password_md5'])) { standard_error(fetch_error('fieldmissing')); } $vbulletin->GPC['password_md5'] = strtolower($vbulletin->GPC['password_md5']); $vbulletin->GPC['passwordconfirm_md5'] = strtolower($vbulletin->GPC['password_md5']); $userdata->set('email', $vbulletin->GPC['email']); $userdata->set('username', $vbulletin->GPC['username']); $userdata->set('password', $vbulletin->GPC['password_md5'] ? $vbulletin->GPC['password_md5'] : $vbulletin->GPC['password']); $userdata->set_bitfield('options', 'adminemail', 1); if ($vbulletin->options['verifyemail']) { $newusergroupid = 3; } else { if ($vbulletin->options['moderatenewmembers'] || $vbulletin->GPC['coppauser']) { $newusergroupid = 4; } else { $newusergroupid = 2; } } $userdata->set('usergroupid', $newusergroupid); $userdata->set('languageid', $vbulletin->userinfo['languageid']); $userdata->set_usertitle('', false, $vbulletin->usergroupcache["{$newusergroupid}"], false, false); $parts = preg_split('#/#', $vbulletin->GPC['birthday']); $day = $month = $year = ''; if ($parts[1]) { $day = $parts[1]; } if ($parts[0]) { $month = $parts[0]; } if ($parts[2]) { $year = $parts[2]; } $userdata->set('showbirthday', 0); $userdata->set('birthday', array('day' => $day, 'month' => $month, 'year' => $year)); $dst = 2; $userdata->set_dst($dst); $userdata->set('timezoneoffset', $vbulletin->GPC['timezoneoffset']); // register IP address $userdata->set('ipaddress', IPADDRESS); $userdata->pre_save(); if (count($userdata->errors)) { // Just return one error for now. json_error(strip_tags($userdata->errors[0])); } $vbulletin->userinfo['userid'] = $userid = $userdata->save(); if ($userid) { $userinfo = fetch_userinfo($userid); $userdata_rank =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT); $userdata_rank->set_existing($userinfo); $userdata_rank->set('posts', 0); $userdata_rank->save(); require_once DIR . '/includes/functions_login.php'; $vbulletin->session->created = false; process_new_login('', false, ''); // send new user email if ($vbulletin->options['newuseremail'] != '') { $username = $vbulletin->GPC['username']; $email = $vbulletin->GPC['email']; if ($birthday = $userdata->fetch_field('birthday')) { $bday = explode('-', $birthday); $year = vbdate('Y', TIMENOW, false, false); $month = vbdate('n', TIMENOW, false, false); $day = vbdate('j', TIMENOW, false, false); if ($year > $bday[2] and $bday[2] > 1901 and $bday[2] != '0000') { require_once DIR . '/includes/functions_misc.php'; $vbulletin->options['calformat1'] = mktimefix($vbulletin->options['calformat1'], $bday[2]); if ($bday[2] >= 1970) { $yearpass = $bday[2]; } else { $yearpass = $bday[2] + 28 * ceil((1970 - $bday[2]) / 28); } $birthday = vbdate($vbulletin->options['calformat1'], mktime(0, 0, 0, $bday[0], $bday[1], $yearpass), false, true, false); } else { $birthday = vbdate($vbulletin->options['calformat2'], mktime(0, 0, 0, $bday[0], $bday[1], 1992), false, true, false); } if ($birthday == '') { if ($bday[2] == '0000') { $birthday = "{$bday['0']}-{$bday['1']}"; } else { $birthday = "{$bday['0']}-{$bday['1']}-{$bday['2']}"; } } } if ($userdata->fetch_field('referrerid') and $vbulletin->GPC['referrername']) { $referrer = unhtmlspecialchars($vbulletin->GPC['referrername']); } else { $referrer = $vbphrase['n_a']; } $ipaddress = IPADDRESS; eval(fetch_email_phrases('newuser', 0)); $newemails = explode(' ', $vbulletin->options['newuseremail']); foreach ($newemails as $toemail) { if (trim($toemail)) { vbmail($toemail, $subject, $message); } } } $username = htmlspecialchars_uni($vbulletin->GPC['username']); $email = htmlspecialchars_uni($vbulletin->GPC['email']); // sort out emails and usergroups if ($vbulletin->options['verifyemail']) { $activateid = build_user_activation_id($userid, ($vbulletin->options['moderatenewmembers'] or $vbulletin->GPC['coppauser']) ? 4 : 2, 0); eval(fetch_email_phrases('activateaccount')); vbmail($email, $subject, $message, true); } else { if ($newusergroupid == 2) { if ($vbulletin->options['welcomemail']) { eval(fetch_email_phrases('welcomemail')); vbmail($email, $subject, $message); } } } ($hook = vBulletinHook::fetch_hook('register_addmember_complete')) ? eval($hook) : false; // Let them log in again. process_logout(); $out += array('emailverify' => $vbulletin->options['verifyemail'] ? true : false); } } else { $rules = preg_replace('/<a href=\\"(.*?)\\">(.*?)<\\/a>/', "\\2", $vbphrase['fr_register_forum_rules']); $out += array('rules' => prepare_utf8_string($rules), 'birthday' => $vbulletin->options['reqbirthday'] ? true : false); } return $out; }
public function logout() { // unsets all cookies and session data process_logout(); }