Line 29 | Line 29 |
---|
// Change "full folder" setting - what to do if folder is full if (isset($_POST['fullfolder'])) {
|
// Change "full folder" setting - what to do if folder is full if (isset($_POST['fullfolder'])) {
|
check_form_key('ucp_pm_options', $config['form_token_lifetime'], $redirect_url);
| if (!check_form_key('ucp_pm_options')) { trigger_error('FORM_INVALID'); }
|
$full_action = request_var('full_action', 0);
$set_folder_id = 0;
| $full_action = request_var('full_action', 0);
$set_folder_id = 0;
|
Line 108 | Line 112 |
---|
); $db->sql_query($sql); $msg = $user->lang['FOLDER_ADDED'];
|
); $db->sql_query($sql); $msg = $user->lang['FOLDER_ADDED'];
|
| } else { $msg = $user->lang['FOLDER_NAME_EMPTY'];
|
} } else
| } } else
|
Line 322 | Line 330 |
---|
if ($row) { trigger_error('RULE_ALREADY_DEFINED');
|
if ($row) { trigger_error('RULE_ALREADY_DEFINED');
|
| }
// Prevent users from flooding the rules table $sql = 'SELECT COUNT(rule_id) AS num_rules FROM ' . PRIVMSGS_RULES_TABLE . ' WHERE user_id = ' . (int) $user->data['user_id']; $result = $db->sql_query($sql); $num_rules = (int) $db->sql_fetchfield('num_rules'); $db->sql_freeresult($result);
if ($num_rules >= 5000) { trigger_error('RULE_LIMIT_REACHED');
|
}
$sql = 'INSERT INTO ' . PRIVMSGS_RULES_TABLE . ' ' . $db->sql_build_array('INSERT', $rule_ary); $db->sql_query($sql);
|
}
$sql = 'INSERT INTO ' . PRIVMSGS_RULES_TABLE . ' ' . $db->sql_build_array('INSERT', $rule_ary); $db->sql_query($sql);
|
// Update users message rules
| // Set the user_message_rules bit
|
$sql = 'UPDATE ' . USERS_TABLE . ' SET user_message_rules = 1 WHERE user_id = ' . $user->data['user_id'];
| $sql = 'UPDATE ' . USERS_TABLE . ' SET user_message_rules = 1 WHERE user_id = ' . $user->data['user_id'];
|
Line 374 | Line 395 |
---|
$row = $db->sql_fetchrow($result); $db->sql_freeresult($result);
|
$row = $db->sql_fetchrow($result); $db->sql_freeresult($result);
|
// Update users message rules
| // Unset the user_message_rules bit
|
if (!$row) { $sql = 'UPDATE ' . USERS_TABLE . '
| if (!$row) { $sql = 'UPDATE ' . USERS_TABLE . '
|
Line 633 | Line 654 |
---|
function define_rule_option($hardcoded, $rule_option, $rule_lang, $check_ary) { global $template;
|
function define_rule_option($hardcoded, $rule_option, $rule_lang, $check_ary) { global $template;
|
| global $module;
$exclude = array();
if (!$module->loaded('zebra', 'friends')) { $exclude[RULE_IS_FRIEND] = true; }
if (!$module->loaded('zebra', 'foes')) { $exclude[RULE_IS_FOE] = true; }
|
$s_rule_options = ''; if (!$hardcoded) { foreach ($check_ary as $value => $_check) {
|
$s_rule_options = ''; if (!$hardcoded) { foreach ($check_ary as $value => $_check) {
|
| if (isset($exclude[$value])) { continue; }
|
$s_rule_options .= '<option value="' . $value . '"' . (($value == $rule_option) ? ' selected="selected"' : '') . '>' . $rule_lang[$value] . '</option>'; } }
| $s_rule_options .= '<option value="' . $value . '"' . (($value == $rule_option) ? ' selected="selected"' : '') . '>' . $rule_lang[$value] . '</option>'; } }
|