<?php namespace w34u\ssp; require '../includeheader.php'; $cfg = \w34u\ssp\Configuration::getConfiguration(); if ($cfg->enableSetup !== true) { exit('Setup disabled, Enable in configuration, ->enableSetup'); } $content = []; if (!isset($_POST['SFC_Submit'])) { // set up database if not posting the form define('RUCKUSING_WORKING_BASE', getcwd()); $db_config = (require RUCKUSING_WORKING_BASE . DIRECTORY_SEPARATOR . 'ruckusing.conf.php'); if (isset($db_config['ruckusing_base'])) { define('RUCKUSING_BASE', $db_config['ruckusing_base']); } else { define('RUCKUSING_BASE', dirname(__FILE__)); } require_once RUCKUSING_BASE . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.inc.php'; $params = ['index.php', 'db:migrate']; $main = new \Ruckusing_FrameworkRunner($db_config, $params); $content['database_creation'] = $main->execute(); } $session = new Protect(); $ssp = new Setup($session, true); $admin = new UserAdmin($session, $ssp, '', 'sspsmalltemplate.tpl'); echo $admin->adminCreate($content);
$query = "CREATE TABLE `" . $SSP_Config->sessionTable . "` (\n `SessionId` char(32) NOT NULL default '',\n `UserId` char(32) NOT NULL default '',\n `SessionTime` int(11) NOT NULL default '0',\n `SessionName` varchar(30) NOT NULL default '',\n `SessionIp` varchar(40) NOT NULL default '',\n `SessionUserIp` varchar(40) NOT NULL default '',\n `SessionCheckIp` tinyint(4) NOT NULL default '0',\n `SessionRandom` int(11) NOT NULL default '0',\n `SessionData` blob NOT NULL,\n PRIMARY KEY (`SessionId`),\n KEY `SessionTime` (`SessionTime`)\n) CHARACTER SET " . $SSP_Config->connectionEncoding . " COLLATE " . $SSP_Config->tableCollation; $SSP_DB->query($query, $values, "SSP Database configuration: Creating session table"); $query = "CREATE TABLE `" . $SSP_Config->tokenTable . "` (\n `token` char(32) NOT NULL default '',\n `time` int(11) NOT NULL default '0',\n `id` varchar(50) NOT NULL default '',\n PRIMARY KEY (`token`),\n KEY `time` (`time`),\n KEY `id` (`id`)\n) CHARACTER SET " . $SSP_Config->connectionEncoding . " COLLATE " . $SSP_Config->tableCollation; $SSP_DB->query($query, $values, "SSP Database configuration: Creating token table"); $query = "CREATE TABLE `" . $SSP_Config->userTable . "` (\n `UserId` char(32) NOT NULL default '',\n `UserEmail` varchar(255) NOT NULL default '',\n `UserName` varchar(50) default NULL,\n `UserPassword` varchar(255) NOT NULL default '',\n `UserIp` varchar(30) NOT NULL default '',\n `UserIpCheck` tinyint(4) NOT NULL default '0',\n `UserAccess` varchar(20) NOT NULL default 'public',\n `lang` varchar(10) NOT NULL default '',\n `country` varchar(10) NOT NULL default '',\n `UserDateLogon` int(11) NOT NULL default '0',\n `UserDateLastLogon` int(11) NOT NULL default '0',\n `UserDateCreated` int(11) NOT NULL default '0',\n `UserDisabled` tinyint(4) NOT NULL default '0',\n `UserPending` tinyint(4) NOT NULL default '0',\n `UserAdminPending` tinyint(4) NOT NULL default '0',\n `CreationFinished` tinyint(4) NOT NULL default '0',\n `UserWaiting` tinyint(4) NOT NULL default '0',\n `UserInvisible` tinyint(4) NOT NULL default '0',\n PRIMARY KEY (`UserId`),\n KEY `UserEmail` (`UserEmail`),\n UNIQUE KEY `UserName` (`UserName`),\n KEY `UserPassword` (`UserPassword`),\n KEY `UserDisabled` (`UserDisabled`,`UserPending`,`UserAdminPending`,`CreationFinished`,`UserWaiting`)\n) CHARACTER SET " . $SSP_Config->connectionEncoding . " COLLATE " . $SSP_Config->tableCollation; $SSP_DB->query($query, $values, "SSP Database configuration: Creating login table"); $query = "CREATE TABLE `" . $SSP_Config->userMiscTable . "` (\n `UserId` char(32) NOT NULL default '',\n `Title` varchar(15) NOT NULL default '',\n `FirstName` varchar(20) NOT NULL default '',\n `Initials` varchar(5) NOT NULL default '',\n `FamilyName` varchar(30) NOT NULL default '',\n `Address` varchar(255) NOT NULL default '',\n `TownCity` varchar(30) NOT NULL default '',\n `PostCode` varchar(10) NOT NULL default '',\n `County` varchar(20) NOT NULL default '',\n `Country` varchar(5) NOT NULL default '',\n PRIMARY KEY (`UserId`)\n) CHARACTER SET " . $SSP_Config->connectionEncoding . " COLLATE " . $SSP_Config->tableCollation; $SSP_DB->query($query, $values, "SSP Database configuration: Creating user misc data table"); $query = "CREATE TABLE `" . $SSP_Config->responseTable . "` (\n `token` char(32) NOT NULL default '',\n `time` int(11) NOT NULL default '0',\n `UserId` char(32) NOT NULL default '',\n PRIMARY KEY (`token`),\n KEY `time` (`time`)\n) CHARACTER SET " . $SSP_Config->connectionEncoding . " COLLATE " . $SSP_Config->tableCollation; $SSP_DB->query($query, $values, "SSP Database configuration: Creating user misc data table"); $query = "CREATE TABLE `" . $SSP_Config->tableRememberMe . "` (\n `id` char(32) NOT NULL default '',\n `user_id` char(32) NOT NULL default '',\n `date_expires` int(11) NOT NULL default '0',\n PRIMARY KEY (`id`),\n KEY `date_expires` (`date_expires`)\n) CHARACTER SET " . $SSP_Config->connectionEncoding . " COLLATE " . $SSP_Config->tableCollation; $SSP_DB->query($query, $values, "SSP Database configuration: Creating remember me table"); $session = new Protect(); $ssp = new Setup($session); $admin = new UserAdmin($session, $ssp); $admin->adminCreate(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!-- Site by w34u http://www.w34u.com info@w34u.com + 44 (0)1273 201344 + 44 (0)7833 512221 --> <title>SSP Database creation</title> <meta name="Generator" content="EditPlus" /> <meta name="Author" content="w34u - Julian Blundell" /> <meta http-equiv="distribution" content="Global" />