';
echo html_print_image('images/firts_task/icono_grande_import.png', true, ['title' => __('Plugin Registration') ]);
echo '
';
echo '';
echo '
'.__('Plugin registration').'
';
echo '
'.__(
"This extension makes registering server plugins an easier task.
Here you can upload a server plugin in .pspz zipped format.
Please refer to the official documentation on how to obtain and use Server Plugins.
You can get more plugins in our Public Resource Library "
).'
';
// Upload form
echo "
';
echo '';
$zip = null;
$upload = false;
if (isset($_FILES['plugin_upload'])) {
$config['plugin_store'] = $config['attachment_store'].'/plugin';
$name_file = $_FILES['plugin_upload']['name'];
$zip = zip_open($_FILES['plugin_upload']['tmp_name']);
$upload = true;
}
if ($zip) {
while ($zip_entry = zip_read($zip)) {
if (zip_entry_open($zip, $zip_entry, 'r')) {
if (zip_entry_name($zip_entry) == 'plugin_definition.ini') {
$basepath = $config['attachment_store'];
} else {
$basepath = $config['plugin_store'];
}
$filename = $basepath.'/'.zip_entry_name($zip_entry);
$fp = fopen($filename, 'w');
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
fwrite($fp, $buf);
fclose($fp);
chmod($filename, 0755);
zip_entry_close($zip_entry);
}
}
zip_close($zip);
}
if ($upload) {
// Parse with sections
if (! $ini_array = parse_ini_file($config['attachment_store'].'/plugin_definition.ini', true)) {
echo '