This repository was archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathupdater.php
More file actions
273 lines (260 loc) · 13.6 KB
/
Copy pathupdater.php
File metadata and controls
273 lines (260 loc) · 13.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<?php
/**
* This file is part of FacturaScripts
* Copyright (C) 2015-2020 Carlos Garcia Gomez <neorazorx@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
if (!file_exists('config.php')) {
die('Archivo config.php no encontrado. No puedes actualizar sin instalar.');
}
define('FS_FOLDER', __DIR__);
/// ampliamos el límite de ejecución de PHP a 5 minutos
@set_time_limit(300);
ignore_user_abort(true);
require_once 'config.php';
require_once 'base/config2.php';
require_once 'base/fs_updater.php';
/**
* Registramos la función para capturar los fatal error.
* Información importante a la hora de depurar errores.
*/
register_shutdown_function("fatal_handler");
$updater = new fs_updater();
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Actualizador de FacturaScripts</title>
<meta name="description" content="Script de actualización de FacturaScripts." />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="generator" content="FacturaScripts" />
<meta name="robots" content="noindex" />
<link rel="shortcut icon" href="view/img/favicon.ico" />
<link rel="stylesheet" href="view/css/bootstrap-yeti.min.css" />
<link rel="stylesheet" href="view/css/font-awesome.min.css" />
<script type="text/javascript" src="view/js/jquery.min.js"></script>
<script type="text/javascript" src="view/js/bootstrap.min.js"></script>
</head>
<body>
<br/>
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<a href="index.php?page=admin_home&updated=TRUE" class="btn btn-sm btn-default">
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
<span class="hidden-xs"> Panel de control</span>
</a>
<a href="https://facturascripts.com/plugins?activetab=ListPluginKey2017" target="_blank" class="btn btn-sm btn-default">
<i class="fa fa-key" aria-hidden="true"></i>
<span class="hidden-xs"> Claves</span>
</a>
<div class="page-header">
<h1>
<span class="glyphicon glyphicon-upload" aria-hidden="true"></span> Actualizador de FacturaScripts
</h1>
</div>
<?php
if (count($updater->get_errors()) > 0) {
echo '<div class="alert alert-danger"><ul>';
foreach ($updater->get_errors() as $error) {
echo '<li>' . $error . '</li>';
}
echo '</ul></div>';
}
if (count($updater->get_messages()) > 0) {
echo '<div class="alert alert-info"><ul>';
foreach ($updater->get_messages() as $msg) {
echo '<li>' . $msg . '</li>';
}
echo '</ul></div>';
if ($updater->btn_fin) {
echo '<a href="index.php?page=admin_home&updated=TRUE" class="btn btn-sm btn-info">'
. '<span class="glyphicon glyphicon-ok" aria-hidden="true"></span> Finalizar'
. '</a></br/></br/>';
}
}
?>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<p class="help-block">
Este actualizador permite actualizar <b>tanto el núcleo</b> de FacturaScripts
<b>como sus plugins</b>, incluso los de pago y los privados.
Si hay una actualización del núcleo tendrás que actualizar antes de poder ver si
también hay actualizaciones de plugins.
</p>
<br/>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<a href="#actualizaciones" aria-controls="actualizaciones" role="tab" data-toggle="tab">
<span class="glyphicon glyphicon-upload" aria-hidden="true"></span>
<span class="hidden-xs"> Actualizaciones</span>
</a>
</li>
<li role="presentation">
<a href="#opciones" aria-controls="opciones" role="tab" data-toggle="tab">
<span class="glyphicon glyphicon-wrench" aria-hidden="true"></span>
<span class="hidden-xs"> Opciones</span>
</a>
</li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="actualizaciones">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th class="text-left">Nombre</th>
<th class="text-left">Descripción</th>
<th class="text-right">Versión</th>
<th class="text-right">Nueva versión</th>
<th></th>
</tr>
</thead>
<?php echo $updater->tr_updates; ?>
</table>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="opciones">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th class="text-left">Opción</th>
<th></th>
</tr>
</thead>
<?php echo $updater->tr_options; ?>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<br/>
<div class="panel panel-warning">
<div class="panel-heading">
<h3 class="panel-title">FacturaScripts 2020</h3>
</div>
<div class="panel-body">
FacturaScripts 2020 es un <b>rediseño desde cero</b> y para actualizar es necesario que hagas
una <b>copia de seguridad</b>, instales FacturaScripts 2020 y ejecutes el <b>proceso de migración</b>.
<br/>
<br/>
<a href="https://facturascripts.com/plugin/backups" target="_blank" class="btn btn-default">Copia de seguridad</a>
<a href="https://facturascripts.com/descargar" target="_blank" class="btn btn-default">Instalar FacturaScripts 2020</a>
<a href="https://facturascripts.com/publicaciones/actualizar-desde-facturascripts-2017-292" target="_blank" class="btn btn-default">Guía de migración</a>
</div>
</div>
</div>
</div>
</div>
<?php
if (!isset($updater->updates)) {
/// nada
} else if ($updater->updates['plugins']) {
foreach ($updater->check_for_plugin_updates() as $plug) {
if ($plug['depago']) {
?>
<form action="updater.php?idplugin=<?php echo $plug['idplugin'] . '&name=' . $plug['name']; ?>" method="post" class="form">
<div class="modal" id="modal_key_<?php echo $plug['name']; ?>" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">
<i class="fa fa-key" aria-hidden="true"></i> Añadir clave de actualización
</h4>
<p class="help-block">Imprescindible para actualizar el plugin <b><?php echo $plug['name']; ?></b>.</p>
</div>
<div class="modal-body">
<div class="row">
<div class="col-xs-12">
<div class="form-group">
Clave:
<input type="text" name="key" class="form-control" autocomplete="off" autofocus=""/>
<p class="help-block">
¿No sabes cual es tu clave? Puedes consultarla pulsando el botón
<b>ver mis claves</b>.
</p>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<a href="<?php echo FS_COMMUNITY_URL; ?>/index.php?page=community_tus_plugins" target="_blank" class="btn btn-sm btn-warning">
<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
<span class="hidden-xs"> Ver mis claves</span>
</a>
</div>
<div class="col-xs-6 text-right">
<button type="submit" class="btn btn-sm btn-primary">
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
<span class="hidden-xs"> Añadir</span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<?php
}
}
}
?>
<br/><br/>
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<hr/>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<small>
Creado con <a target="_blank" href="https://facturascripts.com">FacturaScripts</a>.
</small>
</div>
<div class="col-xs-6 text-right">
<span class="label label-default">
<span class="glyphicon glyphicon-time" aria-hidden="true"></span>
<?php echo $updater->duration(); ?>
</span>
</div>
</div>
</div>
<?php
if (!FS_DEMO) {
$url = FS_COMMUNITY_URL . '/index.php?page=community_stats'
. '&add=TRUE&version=' . $updater->plugin_manager->version . '&plugins=' . implode(',', $updater->plugins);
?>
<div style="display: none;">
<iframe src="<?php echo $url; ?>" height="0"></iframe>
</div>
<?php
}
?>
</body>
</html>