Файл: gettingstarted.php
Строк: 43
<?php
/**
* getting started
*
* @package Sngine
* @author Zamblek
*/
// fetch kernal
require('kernal.php');
// check user exist | restricted area
if(!$userExist) {
GetLogin($translate->__("You must sign in to see this page"));
}elseif($userArray['GettingStarted'] == "Y") {
header('Location: '.SITE_URL.'/home.php');
}elseif($userArray['Blocked'] == "Y") {
SystemError($translate->__("System Message"), $translate->__("Your account has been blocked."));
}
// valid inputs
$valid['step'] = array('1', '2', '3');
if(!in_array($_GET['step'], $valid['step'])) {
SystemError($translate->__("Invalid Link"), $translate->__("You may have clicked an expired link or mistyped the address."));
}
// page header
PageHeader($translate->__("Getting Started"));
if($_GET['step'] == '3') {
// generate secret
$_SESSION['secret'] = md5(time()*rand(1, 9999));
$smarty->assign('secret', $_SESSION['secret']);
if($_POST['submit']) {
if(strlen($_POST['bio']) <= 255) {
// update user
$db->query(sprintf("UPDATE users SET UserCountry = %s, UserWebsite = %s, UserBiography = %s, GettingStarted = 'Y' WHERE UserID = %s", Secure($_POST['location']), Secure($_POST['website']), Secure($_POST['bio']), Secure($userArray['UserID'], 'int') )) or SQLError();
header('Location: '.SITE_URL);
}else {
$error = $translate->__("Your bio is too long. The maximum bio length is 255 characters.");
}
}
}
// assign variables
$smarty->assign('error', $error);
$smarty->assign('step', $_GET['step']);
// page footer
PageFooter("gettingstarted");
?>