Migration of 2.4 to 2.4.10
  Welcome
 



This wizard will perform the migration of version 2.4 to 2.4.10 .

Before you continue , please make sure you have made a backup of your MYSQL database.
This can be done with PHPMYADMIN or via backup tool from S@S.
 

  Step 1
Database migration.
 


Changes will be made to the tables during the next step..
Click on continue.
 

  Step 2
 

" ; include("../configuration/database.inc.php"); mysql_connect("$db_server", "$db_username", "$db_password"); mysql_select_db("$db_name"); unset($sas_config) ; //clear the config array first $query = "SELECT config_key,config_value FROM $table_configuration WHERE config_key NOT LIKE 'agenda_t%'"; //read all the configuration items except agenda options. $result = mysql_query($query) or die(mysql_error()); while ($config_list = mysql_fetch_array($result)) { $sas_config[$config_list[0]] = $config_list[1] ; //put them in the config array } //get the sas version $sas_version = $sas_config['sas_version'].$sas_config['sas_patch_version'] ; if(isset($sas_version)) { print "Current Site@School version: " .$sas_version."

" ; } if($sas_config['sas_version'] != "2.4") { print "This upgrade is not this version you are running.
please check that you have 2.4.xx running"; exit; } switch ($sas_version) // start of switch { case "2.410": //level is ok , quit here print "Your Site@School version is already up to the right level!.
"; break; default: //sas version 2.4 I assume. $forumtopics_table = $dbprefix."m_forumtopics"; //alter reads field forum topics table $result = mysql_query("SHOW COLUMNS FROM $forumtopics_table LIKE 'topic_reads'"); if (mysql_num_rows($result) == 0) { mysql_query("ALTER TABLE $forumtopics_table CHANGE reads topic_reads int(11)"); } //newsletter table extra field $table_newsletter_cat = $dbprefix ."m_newsletter_cat"; $result = mysql_query("SHOW COLUMNS FROM $table_newsletter_cat LIKE 'sender_email'"); if (mysql_num_rows($result) == 0) { mysql_query("ALTER TABLE $table_newsletter_cat ADD sender_email varchar(80) not null") ; } //locked_by field newletter table $table_newsletters = $dbprefix ."m_newsletters"; $result = mysql_query("SHOW COLUMNS FROM $table_newsletters LIKE 'locked_by'"); if (mysql_num_rows($result) == 0) { $result = mysql_query("ALTER TABLE $table_newsletters ADD locked_by int(11) default null") ; } //locked_by field pages table $result = mysql_query("SHOW COLUMNS FROM $table_pages LIKE 'locked_by'"); if (mysql_num_rows($result) == 0) { $result = mysql_query("ALTER TABLE $table_pages ADD locked_by int(11) default null") ; } $table_prot_pages = $dbprefix."prot_pages"; //locked_by field prot pages table $result = mysql_query("SHOW COLUMNS FROM $table_prot_pages LIKE 'locked_by'"); if (mysql_num_rows($result) == 0) { $result = mysql_query("ALTER TABLE $table_prot_pages ADD locked_by int(11) default null") ; } //invalid_logins field pages table $result = mysql_query("SHOW COLUMNS FROM $table_users LIKE 'invalid_logins'"); //invalid_logins field table users if (mysql_num_rows($result) == 0) { $result = mysql_query("ALTER TABLE $table_users ADD invalid_logins tinyint(1) default 0") ; $result = mysql_query("UPDATE $table_users SET invalid_logins = 0 WHERE id > 0") ; } //message $message_table = $dbprefix . "m_message"; $result = mysql_query("SHOW COLUMNS FROM $message_table LIKE 'public'"); if (mysql_num_rows($result) == 0) { mysql_query("ALTER TABLE $message_table ADD public tinyint(4) DEFAULT 0") ; } mysql_query("INSERT INTO $table_configuration VALUES ('message_view_text_prot', 'VIEW MESSAGES PROTECTED AREA


', '')"); //delete orphan studentpages $query = "SELECT dir_number FROM $table_studentpages"; $result = mysql_query($query) or die(mysql_error()); while ($student_list = mysql_fetch_array($result)) { //check if we have a pupil/teacher with this dir_number $query1 = "SELECT name FROM $table_users WHERE id = '$student_list[0]'"; $result1 = mysql_query($query1) or die(mysql_error()); $RecordCount = mysql_num_rows($result1); if($RecordCount == 0) { //if not delete it. mysql_query("DELETE FROM $table_studentpages WHERE dir_number = '$student_list[0]'") ; } } //backup $today = time(); mysql_query("INSERT INTO $table_configuration VALUES ('last_backup_date', '$today', '')"); //forum welcome text mysql_query("INSERT INTO $table_configuration VALUES ('forum_welcome_text', '', '')"); //set new patch version mysql_query("UPDATE $table_configuration SET config_value = '10' WHERE config_key = 'sas_patch_version'"); break; } print "

Migration is finished, current Site@School version is: 2.4.10
You can now continue normal operation on your site.

"; print "
Please don't forget to delete the content of the starnet/install directory when you are finished!" ; ?>

The S@S team.