<?php require '../../include/ctf.inc.php'; enforce_authentication(CONST_USER_CLASS_MODERATOR); head('Site management'); menu_management(); section_subhead('New hint'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/new_hint'); form_textarea('Body'); $opts = db_query_fetch_all(' SELECT ch.id, ch.title, ca.title AS category FROM challenges AS ch LEFT JOIN categories AS ca ON ca.id = ch.category ORDER BY ca.title, ch.title'); form_select($opts, 'Challenge', 'id', array_get($_GET, 'id', 0), 'title', 'category'); form_input_checkbox('Visible'); form_hidden('action', 'new'); form_button_submit('Create hint'); form_end(); foot();
<?php require '../../include/mellivora.inc.php'; enforce_authentication(CONST_USER_CLASS_MODERATOR); head('Site management'); menu_management(); section_subhead('New category'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/new_category'); form_input_text('Title'); form_textarea('Description'); form_input_checkbox('Exposed', true); form_input_text('Available from', date_time()); form_input_text('Available until', date_time()); form_hidden('action', 'new'); form_button_submit('Create category'); form_end(); foot();
<th>Hint</th> <th>Manage</th> </tr> </thead> <tbody> '; $hints = db_select_all('hints', array('id', 'added', 'body'), array('challenge' => $_GET['id'])); foreach ($hints as $hint) { echo ' <tr> <td>', date_time($hint['added']), '</td> <td>', htmlspecialchars($hint['body']), '</td> <td><a href="edit_hint.php?id=', htmlspecialchars(short_description($hint['id'], 100)), '" class="btn btn-xs btn-primary">Edit</a></td> </tr> '; } echo ' </tbody> </table> <a href="new_hint.php?id=', htmlspecialchars($_GET['id']), '" class="btn btn-sm btn-warning">Add a new hint</a> '; section_subhead('Delete challenge: ' . $challenge['title']); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_challenge'); form_input_checkbox('Delete confirmation'); form_hidden('action', 'delete'); form_hidden('id', $_GET['id']); message_inline_red('Warning! This will also delete all submissions, all hints and all files associated with challenge!'); form_button_submit('Delete challenge', 'danger'); form_end(); foot();
<?php require '../../include/ctf.inc.php'; enforce_authentication(CONST_USER_CLASS_MODERATOR); head('Site management'); menu_management(); section_subhead('New email signup restriction rule'); message_inline_blue('Add rules to restrict which emails can sign up. Rules in list below are applied top-down. Rules further down on the list override rules above. List is ordered by "priority". A higher "priority" value puts a rule further down the list. Rules are PCRE regex. Example: ^.+@.+$'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/new_restrict_email'); form_input_text('Rule'); form_input_text('Priority'); form_input_checkbox('Whitelist'); form_input_checkbox('Enabled'); form_hidden('action', 'new'); form_button_submit('Create new rule'); form_end(); foot();
enforce_authentication(CONST_USER_CLASS_MODERATOR); head('Site management'); menu_management(); if (array_get($_GET, 'bcc') == 'all') { $users = db_select_all('users', array('email')); $bcc = ''; foreach ($users as $user) { $bcc .= $user['email'] . ",\n"; } $bcc = trim($bcc); } section_subhead('New email'); message_inline_blue('Separate receiver emails with a comma and optional whitespace. You can use BBCode. If you do, you must send as HTML email.'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/new_email'); if (isset($bcc)) { form_input_text('To', CONFIG_EMAIL_FROM_EMAIL); form_input_text('CC'); form_textarea('BCC', $bcc); } else { form_input_text('To', isset($_GET['to']) ? $_GET['to'] : ''); form_input_text('CC'); form_input_text('BCC'); } form_input_text('Subject'); form_textarea('Body'); form_input_checkbox('HTML email'); form_hidden('action', 'new'); message_inline_yellow('Important email? Remember to Ctrl+C before attempting to send!'); form_button_submit('Send email'); form_end(); foot();
<?php require '../../include/mellivora.inc.php'; enforce_authentication(CONFIG_UC_MODERATOR); head('Site management'); menu_management(); section_subhead('New challenge'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/new_challenge'); form_input_text('Title'); form_textarea('Description'); form_textarea('Flag'); form_input_checkbox('Automark', true); form_input_checkbox('Case insensitive'); form_input_text('Points'); form_input_text('Num attempts allowed'); form_input_text('Min seconds between submissions'); $opts = db_query_fetch_all('SELECT * FROM categories ORDER BY title'); form_select($opts, 'Category', 'id', $_GET['category'], 'title'); form_input_text('Available from', date_time()); form_input_text('Available until', date_time()); message_inline_blue('Create and edit challenge to add files.'); form_hidden('action', 'new'); form_button_submit('Create challenge'); form_end(); foot();
<?php require '../../include/mellivora.inc.php'; enforce_authentication(CONFIG_UC_MODERATOR); enforce_instance_auth(); head('Site management'); menu_management(); section_subhead('New Instance'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/new_instance'); form_input_text('Name'); form_input_text('URI'); form_input_checkbox('Import Sample Challenge Set'); echo '<h4>Instance Administration</h4>'; form_input_text('Team Name'); form_input_text('Email'); echo ' <div class="form-group"> <label class="col-sm-2 control-label" for="password">Password</label> <div class="col-sm-10"> <input id="password" name="password" class="form-control" placeholder="Password" type="password"> </div> </div> </div> '; form_hidden('action', 'new'); form_button_submit('Create Instance'); form_end();
<?php require '../../include/mellivora.inc.php'; enforce_authentication(CONST_USER_CLASS_MODERATOR); head('Site management'); menu_management(); section_subhead('New challenge'); form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/new_challenge'); form_input_text('Title'); form_textarea('Description'); form_textarea('Flag'); form_input_checkbox('Automark', true); form_input_checkbox('Case insensitive'); form_input_checkbox('Expose'); form_input_text('Points'); form_input_text('Num attempts allowed'); form_input_text('Min seconds between submissions'); $opts = db_query_fetch_all('SELECT * FROM categories ORDER BY title'); form_select($opts, 'Category', 'id', $_GET['category'], 'title'); form_input_text('Available from', date_time()); form_input_text('Available until', date_time()); message_inline_blue('Create and edit challenge to add files.'); form_hidden('action', 'new'); form_button_submit('Create challenge'); form_end(); foot();