Ignore:
Timestamp:
Jun 15, 2012, 11:17:55 PM (12 years ago)
Author:
plg
Message:

feature 2654: forbid upgrade in case we find a remote site + dynamic message displayed from piwigo.org

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/admin/updates_pwg.php

    r10511 r15737  
    128128if ($step == 3 and is_webmaster())
    129129{
     130  // Remote sites are not compatible with Piwigo 2.4+
     131  $has_remote_site = false;
     132
     133  $query = 'SELECT galleries_url FROM '.SITES_TABLE.';';
     134  $result = pwg_query($query);
     135  while ($row = pwg_db_fetch_assoc($result))
     136  {
     137    if (url_is_remote($row['galleries_url']))
     138    {
     139      $has_remote_site = true;
     140    }
     141  }
     142 
     143  if ($has_remote_site)
     144  {
     145    $url = PHPWG_URL.'/download/messages/upgrade24-remote-sites.php';
     146    $url.= '?lang='.$user['language'];
     147    $url.= '&rand='.md5(uniqid(rand(), true)); // Avoid server cache
     148
     149    $result = null;
     150    if (@fetchRemote($url, $result))
     151    {
     152      $template->assign('forbid_upgrade_message', $result);
     153      array_push($page['errors'], $result);
     154    }
     155  }
     156 
    130157  if (isset($_POST['dumpDatabase']))
    131158  {
     
    133160  }
    134161
    135   if (isset($_POST['submit']) and isset($_POST['upgrade_to']))
     162  if (!$has_remote_site and isset($_POST['submit']) and isset($_POST['upgrade_to']))
    136163  {
    137164    updates::upgrade_to($_POST['upgrade_to'], $step);
Note: See TracChangeset for help on using the changeset viewer.