Remove system file

This commit is contained in:
Romain Neutron
2012-05-21 17:00:11 +02:00
parent 7c9bc6f358
commit 1e161a7ec9
3 changed files with 11 additions and 9 deletions

View File

@@ -8,6 +8,8 @@
* file that was distributed with this source code.
*/
use Symfony\Component\HttpFoundation\File\File as SymfoFile;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
@@ -98,7 +100,7 @@ switch ($parm['act']) {
$msg['SENDMINILOGO'] = '<div style="color:#FF0000">' . _('forms::erreur lors de l\'envoi du fichier') . '</div>';
} elseif (( $_FILES['newLogo']['error'] == UPLOAD_ERR_OK)) {
try {
$appbox->write_collection_pic($collection, new system_file($_FILES['newLogo']['tmp_name']), collection::PIC_LOGO);
$appbox->write_collection_pic($collection, new SymfoFile($_FILES['newLogo']['tmp_name']), collection::PIC_LOGO);
} catch (Exception $e) {
$msg['SENDMINILOGO'] = $e->getMessage();
}
@@ -125,7 +127,7 @@ switch ($parm['act']) {
$msg['SENDWM'] = '<div style="color:#FF0000">' . _('forms::erreur lors de l\'envoi du fichier') . "</div>"; // par le serveur (fichier php.ini)
} elseif (($_FILES['newWm']['error'] == UPLOAD_ERR_OK)) {
try {
$appbox->write_collection_pic($collection, new system_file($_FILES['newWm']["tmp_name"]), collection::PIC_WM);
$appbox->write_collection_pic($collection, new SymfoFile($_FILES['newWm']["tmp_name"]), collection::PIC_WM);
} catch (Exception $e) {
$msg['SENDWM'] = '<div style="color:#FF0000">' . $e->getMessage() . "</div>";
}
@@ -148,7 +150,7 @@ switch ($parm['act']) {
$msg['SENDSTAMPLOGO'] = '<div style="color:#FF0000">' . _('forms::erreur lors de l\'envoi du fichier') . '</div>'; // par le serveur (fichier php.ini)
} elseif (( $_FILES['newStampLogo']['error'] == UPLOAD_ERR_OK)) {
try {
$appbox->write_collection_pic($collection, new system_file($_FILES['newStampLogo']["tmp_name"]), collection::PIC_STAMP);
$appbox->write_collection_pic($collection, new SymfoFile($_FILES['newStampLogo']["tmp_name"]), collection::PIC_STAMP);
} catch (Exception $e) {
$msg['SENDSTAMPLOGO'] = '<div style="color:#FF0000">' . $e->getMessage() . "</div>";
}
@@ -173,7 +175,7 @@ switch ($parm['act']) {
$msg['SENDPRESENTPICT'] = '<div style="color:#FF0000">' . _('forms::erreur lors de l\'envoi du fichier') . '</div>'; // par le serveur (fichier php.ini)
} elseif ($_FILES['newPresentPict']['error'] == UPLOAD_ERR_OK) {
try {
$appbox->write_collection_pic($collection, new system_file($_FILES['newPresentPict']["tmp_name"]), collection::PIC_PRESENTATION);
$appbox->write_collection_pic($collection, new SymfoFile($_FILES['newPresentPict']["tmp_name"]), collection::PIC_PRESENTATION);
} catch (Exception $e) {
$msg['SENDPRESENTPICT'] = '<div style="color:#FF0000">' . $e->getMessage() . "</div>";
}

View File

@@ -8,6 +8,8 @@
* file that was distributed with this source code.
*/
use Symfony\Component\HttpFoundation\File\File as SymfoFile;
/**
*
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
@@ -42,9 +44,7 @@ if ($user->ACL()->has_right_on_sbas($sbas_id, 'bas_manage')) {
case "SENDLOGOPDF":
if (isset($_FILES['newLogoPdf']) && $_FILES['newLogoPdf']['error'] == UPLOAD_ERR_OK) {
if ($_FILES['newLogoPdf']['size'] < 65536) {
$filenameTemp = $_FILES['newLogoPdf']["tmp_name"];
$system_file = new system_file($_FILES['newLogoPdf']["tmp_name"]);
$appbox->write_databox_pic($databox, $system_file, databox::PIC_PDF);
$appbox->write_databox_pic($databox, new SymfoFile($_FILES['newLogoPdf']["tmp_name"]), databox::PIC_PDF);
unlink($_FILES['newLogoPdf']["tmp_name"]);
} else {
$printLogoUploadMsg = _('forms::erreur lors de l\'envoi du fichier');

View File

@@ -116,7 +116,7 @@ phrasea::headers();
$user = $connexion->get('user');
$password = $connexion->get('password');
$data_template = new system_file($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $parm['new_data_template'] . '.xml');
$data_template = new \SplFileInfo($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $parm['new_data_template'] . '.xml');
$connbas = new connection_pdo('databox_creation', $hostname, $port, $user, $password, $parm['new_dbname'], array(), $appbox->get_registry());
@@ -142,7 +142,7 @@ phrasea::headers();
if (count($error) === 0) {
try {
$data_template = new system_file($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $parm['new_data_template'] . '.xml');
$data_template = new \SplFileInfo($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $parm['new_data_template'] . '.xml');
$connbas = new connection_pdo('databox_creation', $parm['new_hostname'], $parm['new_port'], $parm['new_user'], $parm['new_password'], $parm['new_dbname'], array(), $appbox->get_registry());
$base = databox::create($appbox, $connbas, $data_template, $registry);
$base->registerAdmin($user_obj);