$area_qs->close(); if ($count > 0) { echo '<li>Updated TEXTBOX questions</li>'; } echo '</ul></li>'; } // 17/05/2013 (brzsw) - Add cache_paper_stats table if (!$updater_utils->does_table_exist('cache_paper_stats')) { $sql = "CREATE TABLE cache_paper_stats (paperID mediumint(8) unsigned not null, cached int unsigned, max_mark decimal(10,5), max_percent decimal(10,5), min_mark decimal(10,5), min_percent decimal(10,5), q1 decimal(10,5), q2 decimal(10,5), q3 decimal(10,5), mean_mark decimal(10,5), mean_percent decimal(10,5), stdev_mark decimal(10,5), stdev_percent decimal(10,5), UNIQUE KEY `paperID` (`paperID`)) ENGINE=InnoDB"; $updater_utils->execute_query($sql, true); $sql = 'GRANT SELECT, INSERT, UPDATE, DELETE ON ' . $cfg_db_database . '.cache_paper_stats TO \'' . $cfg_db_staff_user . '\'@\'' . $cfg_web_host . '\''; $updater_utils->execute_query($sql, true); $sql = 'GRANT SELECT ON ' . $cfg_db_database . '.cache_paper_stats TO \'' . $cfg_db_student_user . '\'@\'' . $cfg_web_host . '\''; $updater_utils->execute_query($sql, true); } if (!$updater_utils->has_grant($cfg_db_external_user, 'SELECT', 'cache_paper_stats', $cfg_web_host)) { $sql = 'GRANT SELECT ON ' . $cfg_db_database . '.cache_paper_stats TO \'' . $cfg_db_external_user . '\'@\'' . $cfg_web_host . '\''; $updater_utils->execute_query($sql, true); } // 20/05/2013 (brzsw) - Add cache_student_paper_marks table if (!$updater_utils->does_table_exist('cache_student_paper_marks')) { $sql = "CREATE TABLE cache_student_paper_marks (paperID mediumint(8) unsigned not null, userID int(10) unsigned, mark decimal(10,5), percent decimal(10,5)) ENGINE=InnoDB"; $updater_utils->execute_query($sql, true); $sql = "ALTER TABLE cache_student_paper_marks ADD CONSTRAINT pk_paperID_userID PRIMARY KEY (paperID, userID)"; $updater_utils->execute_query($sql, false); $sql = 'GRANT SELECT, INSERT, UPDATE, DELETE ON ' . $cfg_db_database . '.cache_student_paper_marks TO \'' . $cfg_db_staff_user . '\'@\'' . $cfg_web_host . '\''; $updater_utils->execute_query($sql, true); $sql = 'GRANT SELECT ON ' . $cfg_db_database . '.cache_student_paper_marks TO \'' . $cfg_db_student_user . '\'@\'' . $cfg_web_host . '\''; $updater_utils->execute_query($sql, true); } // 20/05/2013 (brzsw) - Add cache_median_question_marks table
if (file_exists($cfg_web_root . 'config/config.inc.php')) { rename($cfg_web_root . 'config/config.inc.php', $cfg_web_root . 'config/config.inc.old8.php'); } if (file_put_contents($cfg_web_root . 'config/config.inc.php', $cfg_new) === false) { echo "<li class=\"error\">" . $string['couldnotwrite'] . "</li>"; } echo "<li>Added page charset to configuration file.</li>\n"; } ob_flush(); flush(); // 05/03/2012 - Add announcements table if (!$updater_utils->does_table_exist('announcements')) { $sql = "CREATE TABLE announcements (id int not null primary key auto_increment, title varchar(255), staff_msg text, student_msg text, icon varchar(255), startdate datetime, enddate datetime, deleted datetime)"; $updater_utils->execute_query($sql, true); } if (!$updater_utils->has_grant($cfg_db_student_user, 'SELECT', 'announcements', $cfg_db_host)) { $sql = "GRANT SELECT ON " . $cfg_db_database . ".announcements TO '" . $cfg_db_student_user . "'@'" . $cfg_db_host . "'"; $updater_utils->execute_query($sql, true); } if (!$updater_utils->has_grant($cfg_db_inv_username, 'SELECT', 'log2', $cfg_db_host)) { $sql = "GRANT SELECT ON " . $cfg_db_database . ".log2 TO '" . $cfg_db_inv_username . "'@'" . $cfg_db_host . "'"; $updater_utils->execute_query($sql, true); } if (!$updater_utils->has_grant($cfg_db_student_user, 'SELECT', 'standards_setting', $cfg_db_host)) { $sql = "GRANT SELECT ON " . $cfg_db_database . ".standards_setting TO '" . $cfg_db_student_user . "'@'" . $cfg_db_host . "'"; $updater_utils->execute_query($sql, true); } if (!$updater_utils->has_grant($cfg_db_username, 'SELECT, INSERT, UPDATE, DELETE', 'password_tokens', $cfg_db_host)) { $sql = "GRANT SELECT, INSERT, UPDATE, DELETE ON " . $cfg_db_database . ".password_tokens TO '" . $cfg_db_username . "'@'" . $cfg_db_host . "'"; $updater_utils->execute_query($sql, true); }