Added warning message for server configurations
This commit is contained in:
parent
23399a22ca
commit
0eae917d32
2 changed files with 30 additions and 5 deletions
|
@ -20,7 +20,29 @@ if(has_access('admin_access',TRUE))
|
|||
{
|
||||
echo '<a href="'.ADMIN_BASEURL.'/view_user.php?uid='.$data['userid'].'">Edit User</a>';
|
||||
}
|
||||
|
||||
|
||||
function check_server_confs()
|
||||
{
|
||||
define('POST_MAX_SIZE', ini_get('post_max_size'));
|
||||
define('MEMORY_LIMIT', ini_get('memory_limit'));
|
||||
define('UPLOAD_MAX_FILESIZE', ini_get('upload_max_filesize'));
|
||||
define('MAX_EXECUTION_TIME', ini_get('max_execution_time'));
|
||||
|
||||
if ( POST_MAX_SIZE > 50 && MEMORY_LIMIT > 128 && UPLOAD_MAX_FILESIZE > 50 && MAX_EXECUTION_TIME > 7200 )
|
||||
{
|
||||
define("SERVER_CONFS", true);
|
||||
}
|
||||
elseif ( POST_MAX_SIZE < 50 || MEMORY_LIMIT < 128 || UPLOAD_MAX_FILESIZE || 50 && MAX_EXECUTION_TIME || 7200 )
|
||||
{
|
||||
e('You must update <strong>"Server Configurations"</strong>. Click here <a href='.BASEURL.'/admin_area/cb_server_conf_info.php>for details</a>',w);
|
||||
define("SERVER_CONFS", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
define("SERVER_CONFS", false);
|
||||
}
|
||||
}
|
||||
|
||||
register_anchor_function('show_video_admin_link','watch_admin_options');
|
||||
register_anchor_function('show_view_channel_link','view_channel_admin_options');
|
||||
}
|
||||
|
|
|
@ -50,9 +50,13 @@
|
|||
define('LAYOUT',TEMPLATEDIR.'/layout');
|
||||
|
||||
define('TEMPLATE',$row['template_dir']);
|
||||
/*
|
||||
* Calling this function to check server configs
|
||||
* Checks : MEMORY_LIMIT, UPLOAD_MAX_FILESIZE, POST_MAX_SIZE, MAX_EXECUTION_TIME
|
||||
* If any of these configs are less than required value, warning is shown
|
||||
*/
|
||||
check_server_confs();
|
||||
|
||||
|
||||
|
||||
Assign('baseurl',BASEURL);
|
||||
Assign('admindir',ADMINDIR);
|
||||
Assign('imageurl',TEMPLATEURL.'/images');
|
||||
|
@ -63,8 +67,7 @@
|
|||
Assign('theme_url',TEMPLATEURL.'/theme');
|
||||
Assign('style_dir',LAYOUT);
|
||||
Assign('layout_dir', LAYOUT);
|
||||
|
||||
|
||||
|
||||
Assign('logged_user',@$_SESSION['username']);
|
||||
Assign('superadmin',@$_SESSION['superadmin']);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue