示例#1
0
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
// | General Public License for more details.                              |
// |                                                                       |
// | You should have received a copy of the GNU General Public License     |
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+
if (!defined("PHPWG_ROOT_PATH")) {
    die("Hacking attempt!");
}
$conf['updates_ignored'] = unserialize($conf['updates_ignored']);
include_once PHPWG_ROOT_PATH . 'admin/include/updates.class.php';
$autoupdate = new updates($page['page']);
$show_reset = false;
if (!$autoupdate->get_server_extensions()) {
    $page['errors'][] = l10n('Can\'t connect to server.');
    return;
    // TODO: remove this return and add a proper "page killer"
}
foreach ($autoupdate->types as $type) {
    $fs = 'fs_' . $type;
    $server = 'server_' . $type;
    $server_ext = $autoupdate->{$type}->{$server};
    $fs_ext = $autoupdate->{$type}->{$fs};
    if (empty($server_ext)) {
        continue;
    }
    foreach ($fs_ext as $ext_id => $fs_ext) {
        if (!isset($fs_ext['extension']) or !isset($server_ext[$fs_ext['extension']])) {
            continue;
示例#2
0
// |                                Step 2                                 |
// +-----------------------------------------------------------------------+
if ($step == 2 and is_webmaster()) {
    if (isset($_POST['submit']) and isset($_POST['upgrade_to'])) {
        updates::upgrade_to($_POST['upgrade_to'], $step);
    }
}
// +-----------------------------------------------------------------------+
// |                                Step 3                                 |
// +-----------------------------------------------------------------------+
if ($step == 3 and is_webmaster()) {
    if (isset($_POST['dumpDatabase'])) {
        updates::dump_database(isset($_POST['includeHistory']));
    }
    if (isset($_POST['submit']) and isset($_POST['upgrade_to'])) {
        updates::upgrade_to($_POST['upgrade_to'], $step);
    }
    $updates = new updates();
    $updates->get_merged_extensions($upgrade_to);
    $updates->get_server_extensions($upgrade_to);
    $template->assign('missing', $updates->missing);
}
// +-----------------------------------------------------------------------+
// |                        Process template                               |
// +-----------------------------------------------------------------------+
if (!is_webmaster()) {
    $page['errors'][] = l10n('Webmaster status is required.');
}
$template->assign(array('STEP' => $step, 'PHPWG_VERSION' => PHPWG_VERSION, 'UPGRADE_TO' => $upgrade_to, 'RELEASE_URL' => PHPWG_URL . '/releases/' . $upgrade_to));
$template->set_filename('plugin_admin_content', 'updates_pwg.tpl');
$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');