• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Welcome message out of the box regardless

#1
I know this has been discussed before but I do think that being able to immediately display the "Welcome_message" would be beneficial rather than having the unfriendly "Whoops! We seem to have hit a snag message..." appear...

May I propose the following additional JavaScript script which I think is far more informative:

file: system/Cache/Handlers/FileHandler.php
PHP Code:
/**
* Constructor.
*
* @param  type $config
* @throws type
*/
public function __construct($config)
{
$path = ! empty($config->storePath) ? $config->storePath WRITEPATH 'cache';
if (! 
is_really_writable($path))
{

// PROPOSAL START
$aTmp = [
 
'Unable to log Errors and/or warnings'
 
'Please set ../writable folder permissions to 0777',
 
'../writable folder permissions not set to 0777',
 
'Please consult manual regarding ../writable folder',
 
'\t\tWhoops! \n\nWe seem to have hit a snag. \n\n\tPlease try again later...\n\n',
 
'Better suggestions welcome \n\n\t\t :)\n\n',
 
'Shit happens :(',
 ];
$tmp $aTmp[mt_rand(0count($aTmp)-)];

?>
<script>
alert("<?= $tmp ?>");
</script>
<?php
// throw CacheException::forUnableToWrite($path);
// PROPOSAL FINISH

}//endif

$this->prefix $config->prefix ?: '';
$this->path  rtrim($path'/') . '/';
}
//endfunc 

Please note the additional script always shows if and only the writable folder is not writable instead of the following exception:

PHP Code:
  throw CacheException::forUnableToWrite($path); 
download and make your system directory strict
Reply

#2
Displaying an error 500 in an alert window with javascript is not a good idea and displaying information about your file system is a security risk.
This message is displayed in production only. In development you should see a lot more information, but in production you don’t want to display too much information when there’s an error. The error details should be written to the log file.
Test your translation files with Translation Tester
Reply

#3
includebeer
Quote:Displaying an error 500 in an alert window with javascript is not a good idea 
When CodeIgniter detects that the writable folder is not writable (0777) a http_request () result of 200 is displayed and not a 500. 


Quote:and displaying information about your file system is a security risk.
There are currently about six error messages which can be displayed and easily changed because the error messages will not suit everybody.


Quote:This message is displayed in production only.
Agreed and it is nor informative to new users who have just downloaded and tried to run the application for the very first time. 


Quote:In development you should see a lot more information, but in production you don’t want to display too much information when there’s an error. 
There is a lot of documentation to and I believe it is not easy to change the default from "production". Displaying a suitable JavaScript messages could make it easier for new users to search for the relevant documentation. 


Quote:The error details should be written to the log file.
If the writable folder is not writable then no error details can be written to the log file.


I have set the online directory permissions to be read only and the results can be found here:

https://ci4-strict.tk
download and make your system directory strict
Reply

#4
The installation instructions are clear about the writable folder and the initial setup in general. The first step is to change the ENVIRONNEMENT variable and the permissions of the writable folder : https://codeigniter4.github.io/userguide...ion-set-up

If somebody know nothing about CodeIgniter and install it in production for the first time, then what can we do? It is just stupid. It’s not hard to test on a local server.
Test your translation files with Translation Tester
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.