/** * * @param string $message * @author Nanhe Kumar <*****@*****.**> */ public static function setMessage($message) { self::$message = $message; }
header('Cache-Control: public'); header('Content-type: text/html; charset=utf-8'); #Connect to database try { if ($db_db == 'sqlite') { $db = new PDO('sqlite:' . $db_d); } else { $db = new PDO('mysql:host=' . $db_h . ';dbname=' . $db_d, $db_u, $db_p); $db->exec('SET NAMES utf8'); } $db->setAttribute(3, 2); #ERRMODE: Exceptions $db->setAttribute(19, 2); #DefaultFetchMode: ASSOC } catch (PDOException $e) { $view->message(23); } $xuid = false; #User: temporary if (isset($_SESSION['uid'])) { if ($_SERVER['REMOTE_ADDR'] === $_SESSION['IP']) { $xuid = $_SESSION['uid']; $xpass = $_SESSION['uidp']; } else { session_regenerate_id(1); } } elseif (isset($_COOKIE[PRE . 'login'])) { list($xuid, $xpass) = explode(':', $_COOKIE[PRE . 'login']); } #Check user data if (is_numeric($xuid)) {
/** * this is the main feature of the view, in the MVC paradigm the controller sends updates to the view, this is * the method which captures the updates. * * As this view is part of the test framework, all we do here is capture the values * * @param string $uri * @param array $vars * @param string $message * @return void * @author Craig Ulliott */ public static function update($uri, $data = null, $message = null) { self::$uri = $uri; self::$data = $data; self::$message = $message; }
#Classes require './lib/view.php'; require './lib/config.php'; require './lib/utils.php'; require './install/install.php'; #Lang $setup = new Installer(); $error = array(); #Lang file require './install/lang/' . $setup->lang . '.php'; #Templates $view = new View(); $view->title = $lang['installer']; #Already done if (file_exists('./cfg/db.php') && filesize('./cfg/db.php') > 43) { $view->message($lang['ban']); } #PDO drivers $dr = PDO::getAvailableDrivers(); $my = in_array('mysql', $dr); $li = in_array('sqlite', $dr); #No driver if (!$my && !$li) { $view->message($lang['noDB']); } #Only one $one = ($li xor $my) ? $my ? 'mysql' : 'sqlite' : false; #Check CHMOD if (!$setup->chmods()) { $view->add('chmod', array('chmod' => $setup->buildChmodTable())); } else {