Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12e335c69c |
@@ -13,7 +13,6 @@ if ($DEBUG_ALL && $ENABLE_ERROR_HANDLING) {
|
|||||||
include BASE.LIBS."Error.Handling.php";
|
include BASE.LIBS."Error.Handling.php";
|
||||||
}
|
}
|
||||||
// predefine vars
|
// predefine vars
|
||||||
$LANG = '';
|
|
||||||
$messages = array();
|
$messages = array();
|
||||||
// import all POST vars
|
// import all POST vars
|
||||||
// extract($_POST, EXTR_SKIP);
|
// extract($_POST, EXTR_SKIP);
|
||||||
@@ -50,10 +49,6 @@ if ($AJAX_PAGE && !$ZIP_STREAM) {
|
|||||||
//------------------------------ class init start
|
//------------------------------ class init start
|
||||||
// login & page access check
|
// login & page access check
|
||||||
$login = new CoreLibs\ACL\Login(DB_CONFIG);
|
$login = new CoreLibs\ACL\Login(DB_CONFIG);
|
||||||
// post login lang check
|
|
||||||
if (isset($_SESSION['DEFAULT_LANG'])) {
|
|
||||||
$LANG = $_SESSION['DEFAULT_LANG'];
|
|
||||||
}
|
|
||||||
// create smarty object
|
// create smarty object
|
||||||
$smarty = new CoreLibs\Template\SmartyExtend();
|
$smarty = new CoreLibs\Template\SmartyExtend();
|
||||||
// create new DB class
|
// create new DB class
|
||||||
|
|||||||
@@ -208,42 +208,6 @@ class Backend extends \CoreLibs\DB\IO
|
|||||||
$this->dbExec($q, 'NULL');
|
$this->dbExec($q, 'NULL');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* helper function for PHP file upload error messgaes to messge string
|
|
||||||
* @param int $error_code integer _FILE upload error code
|
|
||||||
* @return string message string, translated
|
|
||||||
*/
|
|
||||||
public function fileUploadErrorMessage(int $error_code): string
|
|
||||||
{
|
|
||||||
switch ($error_code) {
|
|
||||||
case UPLOAD_ERR_INI_SIZE:
|
|
||||||
$message = 'The uploaded file exceeds the upload_max_filesize directive in php.ini';
|
|
||||||
break;
|
|
||||||
case UPLOAD_ERR_FORM_SIZE:
|
|
||||||
$message = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form';
|
|
||||||
break;
|
|
||||||
case UPLOAD_ERR_PARTIAL:
|
|
||||||
$message = 'The uploaded file was only partially uploaded';
|
|
||||||
break;
|
|
||||||
case UPLOAD_ERR_NO_FILE:
|
|
||||||
$message = 'No file was uploaded';
|
|
||||||
break;
|
|
||||||
case UPLOAD_ERR_NO_TMP_DIR:
|
|
||||||
$message = 'Missing a temporary folder';
|
|
||||||
break;
|
|
||||||
case UPLOAD_ERR_CANT_WRITE:
|
|
||||||
$message = 'Failed to write file to disk';
|
|
||||||
break;
|
|
||||||
case UPLOAD_ERR_EXTENSION:
|
|
||||||
$message = 'File upload stopped by extension';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$message = 'Unknown upload error';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $this->l->__($message);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* menu creater (from login menu session pages)
|
* menu creater (from login menu session pages)
|
||||||
* @param int $flag visible flag trigger
|
* @param int $flag visible flag trigger
|
||||||
|
|||||||
@@ -891,6 +891,42 @@ class Basic
|
|||||||
return "<pre>".print_r($array, true)."</pre>";
|
return "<pre>".print_r($array, true)."</pre>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* helper function for PHP file upload error messgaes to messge string
|
||||||
|
* @param int $error_code integer _FILE upload error code
|
||||||
|
* @return string message string, translated
|
||||||
|
*/
|
||||||
|
public function fileUploadErrorMessage(int $error_code): string
|
||||||
|
{
|
||||||
|
switch ($error_code) {
|
||||||
|
case UPLOAD_ERR_INI_SIZE:
|
||||||
|
$message = 'The uploaded file exceeds the upload_max_filesize directive in php.ini';
|
||||||
|
break;
|
||||||
|
case UPLOAD_ERR_FORM_SIZE:
|
||||||
|
$message = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form';
|
||||||
|
break;
|
||||||
|
case UPLOAD_ERR_PARTIAL:
|
||||||
|
$message = 'The uploaded file was only partially uploaded';
|
||||||
|
break;
|
||||||
|
case UPLOAD_ERR_NO_FILE:
|
||||||
|
$message = 'No file was uploaded';
|
||||||
|
break;
|
||||||
|
case UPLOAD_ERR_NO_TMP_DIR:
|
||||||
|
$message = 'Missing a temporary folder';
|
||||||
|
break;
|
||||||
|
case UPLOAD_ERR_CANT_WRITE:
|
||||||
|
$message = 'Failed to write file to disk';
|
||||||
|
break;
|
||||||
|
case UPLOAD_ERR_EXTENSION:
|
||||||
|
$message = 'File upload stopped by extension';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$message = 'Unknown upload error';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
|
|
||||||
// ****** DEBUG/ERROR FUNCTIONS ******
|
// ****** DEBUG/ERROR FUNCTIONS ******
|
||||||
|
|
||||||
// ****** RANDOM KEY GEN ******
|
// ****** RANDOM KEY GEN ******
|
||||||
|
|||||||
Reference in New Issue
Block a user