function register_f($register_data) { array_walk($register_data, 'array_sanitize'); $register_data['f_fname'] = ucwords(strtolower($register_data['f_fname'])); $register_data['f_lname'] = ucwords(strtolower($register_data['f_lname'])); $register_data['f_password'] = md5($register_data['f_password']); $register_data['f_uname'] = strtolower($register_data['f_uname']); $fields = '`' . implode('`, `', array_keys($register_data)) . '`'; $data = '\'' . implode('\', \'', $register_data) . '\''; mysql_query("INSERT INTO `flight_users` ({$fields}, `f_regdate`) VALUES ({$data}, NOW())"); activation($register_data['f_mailid'], 'Swift Airlines: Activate your account', "Hello " . $register_data['f_fname'] . ", \n\nYou need to activate your account in order to use the features of Swift Airlines. Please click the link below: \n\nhttp://srikanthnatarajan.com/swift/activate.php?f_mailid=" . $register_data['f_mailid'] . "&f_mailcode=" . $register_data['f_mailcode'] . " \n\n-Swift Airlines"); }
function mainLogic() { global $debugMode, $option, $requestCategory, $optionValue, $serverName; //$category = $data[4]; switch ($option) { case "newEntry": if ($debugMode == "on") { echo "Calling newEntryPass()"; } newEntryForm(); break; case "newEntryForm": if ($debugMode == "on") { echo "Calling newEntryForm()"; } newEntryForm(); break; case "newEntrySubmit": newEntrySubmit(); break; case "newEntrySuccess": newEntrySuccess(); break; case "mainPage": $requestCategory = ''; listPosts(); $referrer = $serverName . $_SERVER['REQUEST_URI']; $_SESSION['referrer'] = $referrer; break; case "adminPage": adminPage(); break; case "adminPageBasic": if ($debugMode == "on") { echo "adminPageBasic " . $_POST['process'] . "<br>"; } adminPageBasic(); break; case "adminPageBasicSubmit": if ($debugMode == "on") { echo "adminPageBasicSubmit " . $_POST['process'] . "<br>"; } adminPageBasicSubmit(); break; case "adminPageAdvanced": if ($debugMode == "on") { echo "adminPageAdvanced " . $_POST['process'] . "<br>"; } adminPageAdvanced(); break; case "adminPageAdvancedSubmit": if ($debugMode == "on") { echo "adminPageAdvancedSubmit " . $_POST['process'] . "<br>"; } adminPageAdvancedSubmit(); break; case "adminPageAuthors": if ($debugMode == "on") { echo "adminPageAuthors " . $_POST['process'] . "<br>"; } adminPageAuthors(); break; case "adminAuthorsAdd": if ($debugMode == "on") { echo "adminAuthorsAdd " . $_POST['process'] . "<br>"; } adminAuthorsAdd(); break; case "adminAuthorsEdit": if ($debugMode == "on") { echo "adminAuthorsEdit " . $_POST['process'] . "<br>"; } adminAuthorsEdit(); break; case "adminPluginsSubmit": case "adminPagePlugins": adminPagePlugins(); break; case "adminPageModerate": case "adminModerateSubmit": adminPageModerate(); break; case "deleteEntry": if ($debugMode == "on") { echo "deleteEntry " . $_POST['process'] . "<br>"; } //deleteEntrySubmit(); if ($_POST['process'] !== "deleteEntrySubmit") { deleteEntryForm(); } else { deleteEntrySubmit(); } break; case "editEntry": if ($debugMode == "on") { echo "editEntry " . $_POST['process'] . "<br>"; } editEntryForm(); $referrer = $serverName . $_SERVER['REQUEST_URI']; $_SESSION['referrer'] = $referrer; break; case "editEntryForm": editEntryForm(); break; case "editEntrySubmit": editEntrySubmit(); break; case "posts": viewEntry(); break; case "archives": viewArchive(); break; case "month": viewArchiveMonth(); break; case "category": $requestCategory = $optionValue; listPosts(); $referrer = $serverName . $_SERVER['REQUEST_URI']; $_SESSION['referrer'] = $referrer; break; case "searchPosts": searchPosts(); break; case "sendComment": sendComment(); break; case "sendCommentSuccess": sendCommentSuccess(); break; case "listAllComments": listAllComments(); break; case "deleteComment": if ($debugMode == "on") { echo "deleteEntry " . $_POST['process'] . "<br>"; } $process = isset($_POST['process']) ? $_POST['process'] : ""; if ($process !== "deleteCommentSubmit") { deleteCommentForm(); } else { deleteCommentSubmit(); } break; case "loginPage": loginPage(); break; case "logoutPage": logoutPage(); break; case "registerPage": registerPage(); break; case "registerPageSubmit": registerPageSubmit(); break; case "forgotPass": forgotPass(); break; case "forgotPassSubmit": forgotPassSubmit(); break; case "activation": activation(); break; case "myProfile": myProfile(); break; case "myProfileSubmit": myProfileSubmit(); break; case "pluginFunction1": pluginFunction1(); break; case "pluginFunction2": pluginFunction2(); break; case "pluginFunction3": pluginFunction3(); break; case "pluginFunction4": pluginFunction4(); break; case "pluginFunction5": pluginFunction5(); break; } }
$error = checklog($_POST); if ($error == "NoError") { $User = new user($_POST['email']); $_SESSION['id'] = $User->getId(); if ($User->getLastco() == NUll) { $_SESSION['msg'] = "<div class='success' ><p class='success-txt' >Bienvenue, Share2Go vous souhaite un bon voyage !</p></div>"; } updateCo(True); $_SESSION['login'] = "******"; $_SESSION['email'] = $_POST['email']; $_SESSION['lastco'] = $User->getlastco(); $_SESSION['nbnewmess'] = getNbNewMess($User->getId()); $_SESSION['lu'] = false; header('Location: index.php'); } else { echo "<div class='error' ><p class='error-txt' >" . $error . "</p></div>"; } } if ($_GET['tok']) { $error = activation($_GET['mail'], $_GET['tok']); if ($error == "ok") { $_SESSION['msg'] = "<div class='success' ><p class='success-txt' >Compte activé !</p></div>"; } else { $_SESSION['msg'] = "<div class='error' ><p class='error-txt' >" . $error . "</p></div>"; } header("Location: login.php"); } require_once "../View/login.php"; ?>
$pass = mysql_escape_string($pass); $pass = sha1($pass); } $sql = "INSERT INTO users (name, email, password,type, status, role, whois)\n\t\t\t\tVALUES ('{$company}','{$email}','{$pass}', 'cust', '0', 'user', 'UL');"; if (ExecFromDB($sql) == TRUE) { proc_actlink(mysql_insert_id()); echo "Вы успешно зарегистрированы! Письмо для активации отправлено на email"; } else { echo "Ошибка при регистрации!"; } } else { die("Не указано лицо (ЮЛ/ФЛ)"); } } else { if (isset($_REQUEST['regid'])) { $actmsg = activation($_REQUEST['regid']); if ($actmsg == 0) { $regmsg = "Ваша учетная запись успешно активирована!"; } else { if ($actmsg == 1) { $regmsg = "Ваша учетная запись уже была активирована!"; } else { if ($actmsg == 1) { $regmsg = "Неверная ссылка!"; } } } } } function whois() {
if ($action == 'connexion') { $retour = connexion($auth); } else { if ($action == 'statut') { $retour = $auth->checkStatut(); } else { if ($action == 'deconnexion') { $retour = $auth->deconnexion(); } else { if ($action == 'enregistrement') { $retour = enregistrement(); } else { if ($action == "demandeRecupPass") { $retour = demandeRecupPass(); } else { if ($action == "validRecupPass") { $retour = validRecupPass(); } else { if ($action == 'activation') { $retour = activation(); } } } } } } } $retour['checkProc'] = 'ok'; } //return echo json_encode($retour);
function actionActivation($mysqli) { return activation($mysqli); }
<?php if (!empty($user) or is_array($user)) { header("Location:http://" . $_SERVER['SERVER_NAME'] . "/"); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (isset($_POST['reg'])) { $registration = registration($mysql_link, $_POST); if ($registration === TRUE) { header('Location: ?' . $_SERVER['QUERY_STRING']); $_SESSION['msg']['message'] = setMessage('Ваша регистрация принята, дальнейшая инструкция отправлена Вам на email.', 'success'); exit; } else { header('Location: ?' . $_SERVER['QUERY_STRING']); $_SESSION['msg']['message'] = $registration; exit; } } } elseif ($_SERVER['REQUEST_METHOD'] == 'GET') { if (isset($_GET['hash'])) { $activate = activation($mysql_link, $_GET['hash']); if ($activate === TRUE) { $_SESSION['msg']['message'] = setMessage('Ваша учётная запись успешно активирована, можете зайти на сайт под своими учётными данными', 'success'); } else { $_SESSION['msg']['message'] = $activate; } } } $content = template('registration.tpl.php', array('title' => 'Регистрация', 'active' => $activate));
validNew($vueAuth); } else { if ($action == 'creation') { creation($vueAuth); } else { if ($action == "pageReinitPass") { pageReinitPass($vueAuth); } else { if ($action == "reinitPass") { reinitPass($vueAuth); } else { if ($action == "validRecupPass") { validRecupPass($vueAuth); } else { if ($action == 'activation') { activation($vueAuth); } else { if ($action == 'profil') { pageProfil($vueAuth); } else { if ($action == 'majProfil') { majProfil($vueAuth); } else { if ($action == 'pageSuppress') { $vueAuth->pageSuppress(); } else { if ($action == 'supress') { supprimerCompte($vueAuth); } } }