« Programmation PHP/Exemples/MiniForum » : différence entre les versions

Contenu supprimé Contenu ajouté
Ligne 330 :
}
 
?>
</source>
}}
 
 
<b>increment 1 : controler.inc.php</b>
 
{{Cadre fichier|controler.inc.php|
<source lang="php">
<?php
/* application controler
 
*/
 
# INIT
 
/* admin and mod status control
 
*/
if(@$_REQUEST['aut']!='0')
{
// moderating user
mod();
}
 
# PREPARE
 
/* cases
 
*/
if(@$_SESSION['userMod'])
{//
if(preg_match('/[0]/',$_SESSION['userMod']['adm']))
$_mod[0] = 'superAdmin';
if(preg_match('/[1]/',$_SESSION['userMod']['adm']))
$_mod[0] = 'Admin';
if(preg_match('/[0]/',$_SESSION['userMod']['mod']))
$_mod[1] = 'superModerator';
if(preg_match('/[1]/',$_SESSION['userMod']['mod']))
$_mod[1] = 'Moderator';
}
?>
</source>