upgrade.php
changeset 228 b0a4d179be85
parent 196 54b3e14bf19d
parent 181 06bdbdfec160
child 279 8acd77a6c19d
equal deleted inserted replaced
197:90b7a52bea45 228:b0a4d179be85
    59 
    59 
    60 // SCRIPT CONFIGURATION
    60 // SCRIPT CONFIGURATION
    61 // Everything related to versions goes here!
    61 // Everything related to versions goes here!
    62 
    62 
    63 // Valid versions to upgrade from
    63 // Valid versions to upgrade from
    64 $valid_versions = Array('1.0b1', '1.0b2', '1.0b3', '1.0b4', '1.0RC1', '1.0RC2', '1.0RC3', '1.0', '1.0.1', '1.0.1.1', '1.0.2b1');
    64 $valid_versions = Array('1.0b1', '1.0b2', '1.0b3', '1.0b4', '1.0RC1', '1.0RC2', '1.0RC3', '1.0', '1.0.1', '1.0.1.1', '1.0.2b1', '1.0.2', 'Stable1.0ToUnstable1.1');
    65 
    65 
    66 // Basically a list of dependencies, which should be resolved automatically
    66 // Basically a list of dependencies, which should be resolved automatically
    67 // If, for example, upgrading from 1.0b1 to 1.0RC1 requires one extra query that would not
    67 // If, for example, upgrading from 1.0b1 to 1.0RC1 requires one extra query that would not
    68 // normally be required (for whatever reason) then you would add a custom version number to the array under key '1.0b1'.
    68 // normally be required (for whatever reason) then you would add a custom version number to the array under key '1.0b1'.
    69 $deps_list = Array(
    69 $deps_list = Array(
    74     '1.0RC1' => Array('1.0RC2'),
    74     '1.0RC1' => Array('1.0RC2'),
    75     '1.0RC2' => Array('1.0RC3'),
    75     '1.0RC2' => Array('1.0RC3'),
    76     '1.0RC3' => Array('1.0'),
    76     '1.0RC3' => Array('1.0'),
    77     '1.0' => Array('1.0.1'),
    77     '1.0' => Array('1.0.1'),
    78     '1.0.1' => Array('1.0.1.1'),
    78     '1.0.1' => Array('1.0.1.1'),
    79     '1.0.1.1' => Array('1.0.2b1')
    79     '1.0.1.1' => Array('1.0.2b1'),
       
    80     '1.0.2b1' => Array('Stable1.0ToUnstable1.1'),
       
    81     'Stable1.0ToUnstable1.1' => Array('1.1.1')
    80   );
    82   );
    81 $this_version   = '1.0.2';
    83 $this_version   = '1.1.1';
    82 $func_list = Array(
    84 $func_list = Array(
    83     '1.0' => Array('u_1_0_1_update_del_votes'),
    85     '1.0' => Array('u_1_0_1_update_del_votes'),
    84     '1.0b4' => Array('u_1_0_RC1_update_user_ids', 'u_1_0_RC1_add_admins_to_group', 'u_1_0_RC1_alter_files_table', 'u_1_0_RC1_destroy_session_cookie', 'u_1_0_RC1_set_contact_email', 'u_1_0_RC1_update_page_text'), // ,
    86     '1.0b4' => Array('u_1_0_RC1_update_user_ids', 'u_1_0_RC1_add_admins_to_group', 'u_1_0_RC1_alter_files_table', 'u_1_0_RC1_destroy_session_cookie', 'u_1_0_RC1_set_contact_email', 'u_1_0_RC1_update_page_text'), // ,
    85     // '1.0RC2' => Array('u_1_0_populate_userpage_comments')
    87     // '1.0RC2' => Array('u_1_0_populate_userpage_comments')
    86     '1.0RC3' => Array('u_1_0_RC3_make_users_extra')
    88     '1.0RC3' => Array('u_1_0_RC3_make_users_extra')
   443     }
   445     }
   444     if($session->user_logged_in && $session->user_level >= $ul_admin)
   446     if($session->user_logged_in && $session->user_level >= $ul_admin)
   445     {
   447     {
   446       if(isset($_POST['login']))
   448       if(isset($_POST['login']))
   447       {
   449       {
   448         $session->login_without_crypto($_POST['username'], $_POST['password'], false, $ul_admin);
   450         $result = $session->login_without_crypto($_POST['username'], $_POST['password'], false, $ul_admin);
   449         if($session->sid_super)
   451         if($session->sid_super)
   450         {
   452         {
   451           header('Location: upgrade.php?mode=welcome&auth='.$session->sid_super);
   453           header('Location: upgrade.php?mode=welcome&auth='.$session->sid_super);
   452           exit;
   454           exit;
   453         }
   455         }
   460           <th colspan="2">You must re-authenticate to perform this upgrade.</th>
   462           <th colspan="2">You must re-authenticate to perform this upgrade.</th>
   461         </tr>
   463         </tr>
   462         <?php
   464         <?php
   463         if(isset($_POST['login']))
   465         if(isset($_POST['login']))
   464         {
   466         {
   465           echo '<tr><td colspan="2"><p style="color: red;">Login failed. Bad password?</p></td></tr>';
   467           echo '<tr><td colspan="2"><p style="color: red;">Login failed: '. $result['error'] . '</p></td></tr>';
   466         }
   468         }
   467         ?>
   469         ?>
   468         <tr>
   470         <tr>
   469           <td>Username:</td><td><input type="text" name="username" size="30" /></td>
   471           <td>Username:</td><td><input type="text" name="username" size="30" /></td>
   470         </tr>
   472         </tr>