Member
|
Hello, im using your php forum for my website, but i want more then 1 admin on the site, how do i change it? This is the following PHP code in config.php
//Username of the Administrator
$admin='knoblys';
|
Member
|
Instead of using a static string, we can use an array and a function to grab use multiple administrators.
$admins = array("user1", "user2");
function is_admin($username, $array) {
foreach($array as $name) {
if($name == $username) {
return true;
}
}
return false;
}
Now, instead of using:
$_SESSION['username'] == $admin
We can use:
is_admin($_SESSION['username'], $admins)
|