@@ -461,7 +473,14 @@
if(file_exists($_POST['imagemagick_path'])) setConfig('imagemagick_path', $_POST['imagemagick_path']);
else echo '
Warning: the file "'.$_POST['imagemagick_path'].'" was not found, and the ImageMagick file path was not updated.';
$max_upload = floor((float)$_POST['max_file_size'] * (int)$_POST['fs_units']);
- setConfig('max_file_size', $max_upload.'');
+ if ( $max_upload > 1048576 && defined('ENANO_DEMO_MODE') )
+ {
+ echo '
Wouldn\'t want the server DoS\'ed now. Stick to under a megabyte for the demo, please.
';
+ }
+ else
+ {
+ setConfig('max_file_size', $max_upload.'');
+ }
}
echo '
');
}
- } elseif(isset($_POST['clearsessions'])) {
- // Get the current session information so the user doesn't get logged out
- $aes = new AESCrypt();
- $sk = md5($session->sid_super);
- $qb = $db->sql_query('SELECT session_key,salt,auth_level,source_ip,time FROM '.table_prefix.'session_keys WHERE session_key=\''.$sk.'\' AND user_id='.$session->user_id.' AND auth_level='.USER_LEVEL_ADMIN);
- if(!$qb) die('Error selecting session key info block B: '.$db->get_error());
- if($db->numrows($qb) < 1) die('Error: cannot read admin session info block B, aborting table clear process');
- $qa = $db->sql_query('SELECT session_key,salt,auth_level,source_ip,time FROM '.table_prefix.'session_keys WHERE session_key=\''.md5($session->sid).'\' AND user_id='.$session->user_id.' AND auth_level='.USER_LEVEL_MEMBER);
- if(!$qa) die('Error selecting session key info block A: '.$db->get_error());
- if($db->numrows($qa) < 1) die('Error: cannot read user session info block A, aborting table clear process');
- $ra = mysql_fetch_object($qa);
- $rb = mysql_fetch_object($qb);
- $db->free_result($qa);
- $db->free_result($qb);
- $db->sql_query('DELETE FROM '.table_prefix.'session_keys;');
- $db->sql_query('INSERT INTO '.table_prefix.'session_keys( session_key,salt,user_id,auth_level,source_ip,time ) VALUES( \''.$ra->session_key.'\', \''.$ra->salt.'\', \''.$session->user_id.'\', \''.$ra->auth_level.'\', \''.$ra->source_ip.'\', '.$ra->time.' ),( \''.$rb->session_key.'\', \''.$rb->salt.'\', \''.$session->user_id.'\', \''.$rb->auth_level.'\', \''.$rb->source_ip.'\', '.$rb->time.' )');
- echo('
-
The session key table has been cleared. Your database should be a little bit smaller now.
- ');
+ }
+ else if(isset($_POST['clearsessions']))
+ {
+ if ( defined('ENANO_DEMO_MODE') )
+ {
+ echo '
Sorry Charlie, no can do. You might mess up other people logged into the demo site.
';
+ }
+ else
+ {
+ // Get the current session information so the user doesn't get logged out
+ $aes = new AESCrypt();
+ $sk = md5($session->sid_super);
+ $qb = $db->sql_query('SELECT session_key,salt,auth_level,source_ip,time FROM '.table_prefix.'session_keys WHERE session_key=\''.$sk.'\' AND user_id='.$session->user_id.' AND auth_level='.USER_LEVEL_ADMIN);
+ if(!$qb) die('Error selecting session key info block B: '.$db->get_error());
+ if($db->numrows($qb) < 1) die('Error: cannot read admin session info block B, aborting table clear process');
+ $qa = $db->sql_query('SELECT session_key,salt,auth_level,source_ip,time FROM '.table_prefix.'session_keys WHERE session_key=\''.md5($session->sid).'\' AND user_id='.$session->user_id.' AND auth_level='.USER_LEVEL_MEMBER);
+ if(!$qa) die('Error selecting session key info block A: '.$db->get_error());
+ if($db->numrows($qa) < 1) die('Error: cannot read user session info block A, aborting table clear process');
+ $ra = mysql_fetch_object($qa);
+ $rb = mysql_fetch_object($qb);
+ $db->free_result($qa);
+ $db->free_result($qb);
+ $db->sql_query('DELETE FROM '.table_prefix.'session_keys;');
+ $db->sql_query('INSERT INTO '.table_prefix.'session_keys( session_key,salt,user_id,auth_level,source_ip,time ) VALUES( \''.$ra->session_key.'\', \''.$ra->salt.'\', \''.$session->user_id.'\', \''.$ra->auth_level.'\', \''.$ra->source_ip.'\', '.$ra->time.' ),( \''.$rb->session_key.'\', \''.$rb->salt.'\', \''.$session->user_id.'\', \''.$rb->auth_level.'\', \''.$rb->source_ip.'\', '.$rb->time.' )');
+ echo('
+
The session key table has been cleared. Your database should be a little bit smaller now.
+ ');
+ }
}
echo('
User Management
@@ -1767,7 +1827,7 @@
$e = $db->sql_query('DELETE FROM '.table_prefix.'banlist WHERE ban_id=' . $db->escape($_GET['id']) . '');
if(!$e) $db->_die('The ban list entry was not deleted.');
}
- if(isset($_POST['create']))
+ if(isset($_POST['create']) && !defined('ENANO_DEMO_MODE'))
{
$q = 'INSERT INTO '.table_prefix.'banlist(ban_type,ban_value,reason,is_regex) VALUES( ' . $db->escape($_POST['type']) . ', \'' . $db->escape($_POST['value']) . '\', \''.$db->escape($_POST['reason']).'\'';
if(isset($_POST['regex'])) $q .= ', 1';
@@ -1776,6 +1836,10 @@
$e = $db->sql_query($q);
if(!$e) $db->_die('The banlist could not be updated.');
}
+ else if ( isset($_POST['create']) && defined('ENANO_DEMO_MODE') )
+ {
+ echo '
This function is disabled in the demo. Just because you don\'t like ' . htmlspecialchars($_POST['value']) . ' doesn\'t mean we don\'t like ' . htmlspecialchars($_POST['value']) . '.
';
+ }
$q = $db->sql_query('SELECT ban_id,ban_type,ban_value,is_regex FROM '.table_prefix.'banlist ORDER BY ban_type;');
if(!$q) $db->_die('The banlist data could not be selected.');
echo '
';
@@ -1813,7 +1877,7 @@
}
global $enano_config;
- if ( isset($_POST['do_send']) )
+ if ( isset($_POST['do_send']) && !defined('ENANO_DEMO_MODE') )
{
$use_smtp = getConfig('smtp_enabled') == '1';
@@ -1952,6 +2016,10 @@
}
}
+ else if ( isset($_POST['do_send']) && defined('ENANO_DEMO_MODE') )
+ {
+ echo 'This function is disabled in the demo. You think demo@enanocms.org likes getting "test" mass e-mails?
';
+ }
echo '