Beispiel #1
0
<?php 
}
?>
  </select>
  <div id="gdesc" style="padding: 4px 10px;"><?php 
echo security_group_desc_by_access($user['access']);
?>
</div><div id="hr"></div>
  Является членом групп:
<?php 
$groups = new CVCAppendingList();
$groups->Init('groups', 'height=48px;');
$glist = group_list();
for ($i = 0; $i < count($glist); $i++) {
    $g = $glist[$i];
    $groups->AppendItem($g['name'], $g['id']);
}
$groups->SetItemsUsed(user_get_groups($id));
$groups->Draw();
?>
  <div class="formPast">
    <button class="submitBtn" type="button" onclick="nav ('.?<?php 
echo get_filters();
echo $page != '' ? '&page=' . $page : '';
?>
');">Назад</button>
    <button class="submitBtn" type="submit">Сохранить</button>
  </div>
</form>
<?php 
formc();
Beispiel #2
0
 function user_delete_from_unset_groups($uid, $groups)
 {
     $inGroups = user_get_groups($uid);
     $assoc = array();
     for ($i = 0; $i < count($groups); $i++) {
         $assoc[$groups[$i]] = true;
     }
     for ($i = 0; $i < count($inGroups); $i++) {
         if (!$assoc[$inGroups[$i]]) {
             user_delete_from_group($uid, $inGroups[$i]);
         }
     }
 }
     break;
 }
 $jobflags = 0;
 $jobflags |= JOB_FLAG_ACTIVE;
 if ($attack_modes[$_POST["mode"]]["mode"] == "incremental") {
     $jobflags |= JOB_FLAG_INCREMENTAL;
 } else {
     if ($attack_modes[$_POST["mode"]]["mode"] == "wordlist") {
         $jobflags |= JOB_FLAG_WORDLIST;
     }
 }
 // Update jobs table to reflect hashtype, number of imported hashes and job flags
 $q = "UPDATE jobs SET hashtype='" . $m->escape_string($hashtype) . "', summary_numhashes={$num_entries}, jobflags={$jobflags} WHERE id='" . $m->escape_string($job_id) . "'";
 @$m->query($q);
 // Share job with groups the user have access to based on the selection in the form (groups[])
 foreach (user_get_groups($_SESSION["u"]->id) as $g) {
     // Only add selected groups
     if (!in_array($g->id, $post_groups)) {
         // Skip non-selected groups if it wasn't the public group (id 1)
         if ($g->id != 1) {
             continue;
         }
         // Only skip the public group if the user has a premium account
         if (($_SESSION["u"]->user_flags & USER_FLAG_PREMIUM) == USER_FLAG_PREMIUM) {
             continue;
         }
     }
     $q = "INSERT INTO group_jobs SET group_id='" . $m->escape_string($g->id) . "', job_id='" . $m->escape_string($job_id) . "'";
     @$m->query($q);
 }
 $_SESSION["info"] = "Job created. {$num_entries} {$hashtype} hashes imported.";
    echo $id;
    ?>
"><?php 
    echo htmlspecialchars($a["text"]);
    ?>
</option>
<?php 
}
?>
	</select>
</div>
<div>
	<label for="teams">Share job with these teams</label><br />
	<select name="groups[]" id="teams" multiple="multiple" style="width: 200px">
<?php 
$groups = user_get_groups($_SESSION["u"]->id);
foreach ($groups as $g) {
    $sel_html = ' selected="selected"';
    if ($g->id == 1 && ($_SESSION["u"]->user_flags & USER_FLAG_PREMIUM) == 0) {
        $g->groupname .= " (cannot be deselected)";
    } else {
        if ($g->id == 1 && ($_SESSION["u"]->user_flags & USER_FLAG_PREMIUM) == USER_FLAG_PREMIUM) {
            $sel_html = "";
        }
    }
    ?>
		<option value="<?php 
    echo $g->id;
    ?>
"<?php 
    echo $sel_html;