role basics

This commit is contained in:
xiaomlove
2022-08-19 15:30:16 +08:00
parent e013c90c55
commit 05f281b7e3
26 changed files with 81 additions and 497 deletions
+3 -2
View File
@@ -50,13 +50,13 @@ $classes = array_chunk(\App\Models\User::$classes, 4, true);
</tr>
<tr><td class="rowhead" valign="top">Amount </td><td class="rowfollow"><input type=text name=amount size=10></td></tr>
<tr>
<td class="rowhead" valign="top">Add to</td><td class="rowfollow">
<td class="rowhead" valign="top">Add to Class</td><td class="rowfollow">
<table style="border: 0" width="100%" cellpadding="0" cellspacing="0">
<?php
foreach ($classes as $chunk) {
printf('<tr>');
foreach ($chunk as $class => $info) {
printf('<td style="border: 0"><label><input type="checkbox" name="clases[]" value="%s" />%s</label></td>', $class, $info['text']);
printf('<td style="border: 0"><label><input type="checkbox" name="classes[]" value="%s" />%s</label></td>', $class, $info['text']);
}
printf('</tr>');
}
@@ -64,6 +64,7 @@ $classes = array_chunk(\App\Models\User::$classes, 4, true);
</table>
</td>
</tr>
<?php do_action('increment_bulk_filters') ?>
<tr><td class="rowhead" valign="top">Subject </td><td class="rowfollow"><input type=text name=subject size=82></td></tr>
<tr><td class="rowhead" valign="top">Reason </td><td class="rowfollow"><textarea name=msg cols=80 rows=5><?php echo $body ?? ''?></textarea></td></tr>
<tr>
+1 -2
View File
@@ -11,8 +11,7 @@ permissiondenied();
function go_back()
{
global $lang_settings;
\Nexus\Database\NexusDB::cache_del('nexus_settings_in_laravel');
\Nexus\Database\NexusDB::cache_del('nexus_settings_in_nexus');
clear_setting_cache();
stdmsg($lang_settings['std_message'], $lang_settings['std_click']."<a class=\"altlink\" href=\"settings.php\">".$lang_settings['std_here']."</a>".$lang_settings['std_to_go_back']);
}
+10 -12
View File
@@ -29,25 +29,23 @@ if (!isset($validTypeMap[$type])) {
if ($type == 'uploaded') {
$amount = sqlesc(getsize_int($amount,"G"));
}
$updateset = $_POST['clases'];
if (is_array($updateset)) {
foreach ($updateset as $class) {
if (!is_valid_id($class) && $class != 0)
stderr("Error","Invalid Class");
}
}else{
if (!is_valid_id($updateset) && $updateset != 0)
stderr("Error","Invalid Class");
}
$subject = trim($_POST['subject']);
$size = 10000;
$page = 1;
set_time_limit(300);
$classStr = implode(",", $updateset);
$conditions = [];
if (!empty($_POST['classes'])) {
$conditions[] = "class IN (" . implode(', ', $_POST['classes']) . ")";
}
$conditions = apply_filter("increment_bulk_conditions", $conditions, $_POST);
if (empty($conditions)) {
stderr("Error","No valid filter");
}
$whereStr = implode(' OR ', $conditions);
while (true) {
$msgValues = $idArr = [];
$offset = ($page - 1) * $size;
$query = sql_query("SELECT id FROM users WHERE class IN ($classStr) and `enabled` = 'yes' and `status` = 'confirmed' limit $offset, $size");
$query = sql_query("SELECT id FROM users WHERE ($whereStr) and `enabled` = 'yes' and `status` = 'confirmed' limit $offset, $size");
while($dat=mysql_fetch_assoc($query))
{
$idArr[] = $dat['id'];