Changeset 15737


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

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

Location:
branches/2.3/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/admin/themes/default/template/updates_pwg.tpl

    r12261 r15737  
    8787  {/if}
    8888  <p>
     89
     90{if isset($forbid_upgrade_message)}
     91  {$forbid_upgrade_message}
     92{else}
    8993  {if !empty($missing.plugins) or !empty($missing.themes)}
    9094  <p><label><input type="checkbox" name="understand"> &nbsp;{'I decide to update anyway'|@translate}</label></p>
     
    9397  </p>
    9498  <p class="autoupdate_bar" style="display:none;">&nbsp; {'Update in progress...'|@translate}<br><img src="admin/themes/default/images/ajax-loader-bar.gif"></p>
     99{/if}
    95100</fieldset>
    96101
  • 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.