public function __construct()
    {
        global $Misc;
        parent::__construct();
        $restrictedActions = array('wipeVariants' => array('name' => 'Clear variant caches', 'description' => 'Clears out all variant data and cache files, forcing them all to be reinstalled.', 'params' => array()), 'clearErrorLogs' => array('name' => 'Clear error logs', 'description' => 'Clears error log text files.', 'params' => array()), 'clearOrderLogs' => array('name' => 'Clear order logs', 'description' => 'Clears order log text files.', 'params' => array()), 'clearAccessLogs' => array('name' => 'Clear access logs', 'description' => 'Clears access log table of logs older than 30 days.', 'params' => array()), 'clearAdminLogs' => array('name' => 'Clear admin logs', 'description' => 'Clears admin log table.', 'params' => array()), 'giveModerator' => array('name' => 'Give moderator status', 'description' => 'Gives moderator status to the specified user ID.', 'params' => array('userID' => 'User ID')), 'takeModerator' => array('name' => 'Take moderator status', 'description' => 'Takes moderator status from the specified user ID.', 'params' => array('userID' => 'Mod User ID')), 'giveForumModerator' => array('name' => 'Give forum moderator status', 'description' => 'Gives forum moderator status to the specified user ID.', 'params' => array('userID' => 'User ID')), 'takeForumModerator' => array('name' => 'Take forum moderator status', 'description' => 'Takes forum moderator status from the specified user ID.', 'params' => array('userID' => 'Mod User ID')), 'reprocessGame' => array('name' => 'Reprocess game', 'description' => 'Returns an active game to the last Diplomacy phase,
					along with that phase\'s orders, and sets the time so that the game will be reprocessed.', 'params' => array('gameID' => 'Game ID')), 'notice' => array('name' => 'Toggle site-wide notice', 'description' => 'Toggle the notice which is displayed in a noticebar across the whole site. The
					notice itself can be set in config.php', 'params' => array()), 'maintenance' => array('name' => 'Toggle maintenance', 'description' => 'Toggle maintenance mode, which makes the server inaccessible except to admins
					so changes can be made.', 'params' => array()), 'globalAddTime' => array('name' => 'Add time to all games', 'description' => 'Add extra time (in hours) to all games, or 0 for the game\'s phase time.', 'params' => array('timeHours' => 'Extra time (hours)')), 'backupGame' => array('name' => 'Backup a game', 'description' => 'Save a game\'s data to the backup tables', 'params' => array('gameID' => 'Game ID')), 'restoreGame' => array('name' => 'Restore a game from backups', 'description' => 'Restores a game from a backup', 'params' => array('gameID' => 'Game ID')), 'wipeBackups' => array('name' => 'Wipe game backups', 'description' => 'Clear out all game backups', 'params' => array()), 'checkPausedGames' => array('name' => 'Check paused game process times', 'description' => 'Sometimes after extending next process times and resetting the last process
						time some games are left with incorrectly set process/pause time values, which causes
						users to have errors when the game gets loaded on their home page / board page.<br />
						Until the cause can be tracked down and resolved this command can find and correct the
						invalid values, but it shouldn\'t be used unless errors are occurring since it may alter
						unaffected games.', 'params' => array()), 'recreateUnitDestroyIndex' => array('name' => 'Recreate the destroy unit indexes', 'description' => 'Refreshes the unit destroy indexes for a certain map ID. This will generally only
					be run if there has been a bug found in the unit destroy index generation code which requires 
					the indexes to be recreated.<br />
					Note that this uses the generic installation code, so if there are any variant-specific modifications
					running this may give unpredictable results. Please confirm with the variant maintainer before
					using this admin action.', 'params' => array('mapID' => 'Map ID')), 'recalculateRR' => array('name' => 'Recalculate reliability ratings', 'description' => 'Updates the reliability ratings for all users.', 'params' => array()));
        adminActions::$actions = array_merge(adminActions::$actions, $restrictedActions);
    }
예제 #2
0
 public function __construct()
 {
     parent::__construct();
     $forumActions = array('disableSilence' => array('name' => 'Unsilence something', 'description' => 'Disables a silence on a user/thread.', 'params' => array('silenceID' => 'Silence ID#')), 'changeSilenceLength' => array('name' => 'Change silence length', 'description' => 'Alter the length of an existing silence (note that this only applies to user silences; thread silences are indefinite).<br />0 length silences are indefinite.', 'params' => array('silenceID' => 'Silence ID#', 'length' => 'Length (days)')), 'createUserSilence' => array('name' => 'Silence user', 'description' => 'Silences a user for the given length of time (0 is indefinite).', 'params' => array('userID' => 'User ID', 'reason' => 'Reason', 'length' => 'Length (days)')), 'createThreadSilence' => array('name' => 'Silence thread', 'description' => 'Silence a thread/post.', 'params' => array('postID' => 'Post ID', 'reason' => 'Reason')), 'createUserThreadSilence' => array('name' => 'Silence thread and user', 'description' => 'Silence a thread/post and user, with the user silence acting for the given length of time (0 is indefinite). Thread silences are always indefinite.', 'params' => array('userID' => 'User ID', 'postID' => 'Post ID', 'reason' => 'Reason', 'length' => 'Length (days)')));
     adminActions::$actions = array_merge(adminActions::$actions, $forumActions);
 }
예제 #3
0
    print '<h3>' . l_t('Director action forms') . '</h3>';
    // For each task display the form, and run the task if data entered from the corresponding form
    print '<ul class="formlist">';
    foreach ($adminActions->actionsList as $actionCode => $action) {
        $adminActions->process($actionCode);
    }
    print '</ul>';
} else {
    print '<div class="hr"></div>';
    adminActionsLayout::printActionShortcuts();
    if ($User->type['Admin']) {
        $adminActions = new adminActionsRestricted();
    } elseif ($User->type['ForumModerator']) {
        $adminActions = new adminActionsForum();
    } else {
        $adminActions = new adminActions();
    }
    adminActionsForms::$target = "admincp.php";
    $adminActions->actionsList = adminActions::$actions;
    // Create a bullet-point set of anchor shortcuts to each task
    $actionCodesByType = adminActionsLayout::actionCodesByType();
    print '<h3>' . l_t('Admin actions') . '</h3>';
    foreach ($actionCodesByType as $type => $actionCodes) {
        print '<a name="' . strtolower($type) . 'Actions"></a><h4>' . l_t($type . ' actions') . '</h4>';
        adminActionsLayout::printActionLinks($actionCodes);
    }
    print '<div class="hr"></div>';
    print '<h3>' . l_t('Forms') . '</h3>';
    // For each task display the form, and run the task if data entered from the corresponding form
    print '<ul class="formlist">';
    foreach ($actionCodesByType as $type => $actionCodes) {