J'ai créé un nouveau plugin qui permet aux modérateurs de fermer/ouvrir les inscriptions.
Voici le code de la page AMP_Inscriptions.php
<?php
// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
exit;
// Tell admin_loader.php that this is indeed a plugin and that it is loaded
define('PUN_PLUGIN_LOADED', 1);
// Display the admin navigation menu
generate_admin_menu($plugin);
if (isset($_POST['form_sent']))
{
$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$form['regs_allow'].' WHERE conf_name="o_regs_allow"') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
// Regenerate the config cache
require_once PUN_ROOT.'include/cache.php';
generate_config_cache();
redirect('admin_loader.php?plugin=AMP_Inscriptions.php', 'Etat des inscriptions modifié. Redirection ...');
}
?>
<div class="block">
<h2><span>Inscriptions</span></h2>
<div class="box">
<div class="inbox">
<p>Permet d'ouvrir ou de fermer les inscriptions.</p>
</div>
</div>
</div>
<div class="blockform">
<h2><span>Inscriptions</span></h2>
<div class="box">
<form method="post" action="admin_loader.php?plugin=AMP_Inscriptions.php">
<div class="inform">
<input type="hidden" name="form_sent" value="1" />
<fieldset>
<legend>Inscriptions</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Autoriser les nouvelles inscriptions</th>
<td>
<input type="radio" name="form[regs_allow]" value="1"<?php if ($pun_config['o_regs_allow'] == '1') echo ' checked="checked"' ?> /> <strong>Oui</strong> <input type="radio" name="form[regs_allow]" value="0"<?php if ($pun_config['o_regs_allow'] == '0') echo ' checked="checked"' ?> /> <strong>Non</strong>
<span>Permet d'accepter ou non les nouvelles inscriptions aux forums. Désactivez seulement en cas de circonstances spéciales.</span>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<p class="submitend"><input type="submit" name="save" value=" Enregistrer " /></p>
</form>
</div>
</div>