Project

General

Profile

« Previous | Next » 

Revision 2044

Added by Dietmar almost 11 years ago

  1. /admin/modules/install.php:: fixed Fileupload error messages

View differences:

branches/2.8.x/CHANGELOG
12 12
===============================================================================
13 13

  
14 14

  
15
19 Dec-2013 Build 2044 Dietmar Woellbrink (Luisehahne)
16
# /admin/modules/install.php:: fixed Fileupload error messages
15 17
19 Dec-2013 Build 2043 Dietmar Woellbrink (Luisehahne)
16 18
+ /admin/addons/languages/ add more Language Files (Tks To jacobi22)
17 19
18 Dec-2013 Build 2042 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.4');
54
if(!defined('REVISION')) define('REVISION', '2043');
54
if(!defined('REVISION')) define('REVISION', '2044');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/admin/modules/install.php
19 19
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
20 20

  
21 21
// Setup admin object
22
require('../../config.php');
23
require_once(WB_PATH.'/framework/class.admin.php');
22
//require('../../config.php');
23
$config_file = realpath('../../config.php');
24
if(file_exists($config_file) && !defined('WB_URL'))
25
{
26
	require($config_file);
27
}
28

  
29
//require_once(WB_PATH.'/framework/class.admin.php');
24 30
$admin = new admin('Addons', 'modules_install', false);
25 31
if( !$admin->checkFTAN() )
26 32
{
......
51 57
		$admin->print_error($MESSAGE['GENERIC_BAD_PERMISSIONS']);
52 58
	}
53 59
} else {
60
    $iErrorMessage = ( isset($_FILES['userfile']['error']) && ( $_FILES['userfile']['error'] > 0 ) ? $_FILES['userfile']['error'] : UNKNOW_UPLOAD_ERROR );
54 61
// index for language files
55 62
	$key = 'UNKNOW_UPLOAD_ERROR';
56
    switch ($error_code) {
63
    switch ( $iErrorMessage ) {
57 64
        case UPLOAD_ERR_INI_SIZE:
58 65
            $key = 'UPLOAD_ERR_INI_SIZE';
66
            break;
59 67
        case UPLOAD_ERR_FORM_SIZE:
60 68
            $key = 'UPLOAD_ERR_FORM_SIZE';
69
            break;
61 70
        case UPLOAD_ERR_PARTIAL:
62 71
            $key = 'UPLOAD_ERR_PARTIAL';
72
            break;
63 73
        case UPLOAD_ERR_NO_FILE:
64 74
            $key = 'UPLOAD_ERR_NO_FILE';
65
        case UPLOAD_ERR_NO_TMP_DIR:
75
             break;
76
       case UPLOAD_ERR_NO_TMP_DIR:
66 77
            $key = 'UPLOAD_ERR_NO_TMP_DIR';
78
            break;
67 79
        case UPLOAD_ERR_CANT_WRITE:
68 80
            $key = 'UPLOAD_ERR_CANT_WRITE';
81
            break;
69 82
        case UPLOAD_ERR_EXTENSION:
70 83
            $key = 'UPLOAD_ERR_EXTENSION';
84
            break;
71 85
        default:
72 86
            $key = 'UNKNOW_UPLOAD_ERROR';
73 87
    }
88

  
74 89
	$admin->print_error($MESSAGE[$key].'<br />'.$MESSAGE['GENERIC_CANNOT_UPLOAD']);
75 90
}
76 91

  

Also available in: Unified diff