Revision 1551
Added by Dietmar almost 13 years ago
install.php | ||
---|---|---|
45 | 45 |
$temp_file = $temp_dir . $_FILES['userfile']['name']; |
46 | 46 |
$temp_unzip = WB_PATH.'/temp/unzip/'; |
47 | 47 |
|
48 |
// Try to upload the file to the temp dir |
|
49 |
if(!move_uploaded_file($_FILES['userfile']['tmp_name'], $temp_file)) |
|
50 |
{ |
|
51 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UPLOAD']); |
|
48 |
if(!$_FILES['userfile']['error']) { |
|
49 |
// Try to upload the file to the temp dir |
|
50 |
if(!move_uploaded_file($_FILES['userfile']['tmp_name'], $temp_file)) |
|
51 |
{ |
|
52 |
$admin->print_error($MESSAGE['GENERIC_BAD_PERMISSIONS']); |
|
53 |
} |
|
54 |
} else { |
|
55 |
// index for language files |
|
56 |
$key = 'UNKNOW_UPLOAD_ERROR'; |
|
57 |
switch ($error_code) { |
|
58 |
case UPLOAD_ERR_INI_SIZE: |
|
59 |
$key = 'UPLOAD_ERR_INI_SIZE'; |
|
60 |
case UPLOAD_ERR_FORM_SIZE: |
|
61 |
$key = 'UPLOAD_ERR_FORM_SIZE'; |
|
62 |
case UPLOAD_ERR_PARTIAL: |
|
63 |
$key = 'UPLOAD_ERR_PARTIAL'; |
|
64 |
case UPLOAD_ERR_NO_FILE: |
|
65 |
$key = 'UPLOAD_ERR_NO_FILE'; |
|
66 |
case UPLOAD_ERR_NO_TMP_DIR: |
|
67 |
$key = 'UPLOAD_ERR_NO_TMP_DIR'; |
|
68 |
case UPLOAD_ERR_CANT_WRITE: |
|
69 |
$key = 'UPLOAD_ERR_CANT_WRITE'; |
|
70 |
case UPLOAD_ERR_EXTENSION: |
|
71 |
$key = 'UPLOAD_ERR_EXTENSION'; |
|
72 |
default: |
|
73 |
$key = 'UNKNOW_UPLOAD_ERROR'; |
|
74 |
} |
|
75 |
$admin->print_error($MESSAGE[$key].'<br />'.$MESSAGE['GENERIC_CANNOT_UPLOAD']); |
|
52 | 76 |
} |
53 | 77 |
|
54 | 78 |
// Include the PclZip class file (thanks to |
... | ... | |
65 | 89 |
// Check if uploaded file is a valid Add-On zip file |
66 | 90 |
if (!($list && file_exists($temp_unzip . 'index.php'))) |
67 | 91 |
{ |
68 |
$admin->print_error($MESSAGE['GENERIC']['INVALID_ADDON_FILE']);
|
|
92 |
$admin->print_error($MESSAGE['GENERIC_INVALID_ADDON_FILE']);
|
|
69 | 93 |
} |
70 | 94 |
|
71 | 95 |
// Include the modules info file |
Also available in: Unified diff
+ add languages vars in languages files
+ add upload error mesages moduleinstall
+ add index.php if not exists in function createFolderProtectFile
! corrected changed coding between login_form and forgot_form