Administrator : have full access and privilegies
Editor : can add news and edit others posts
Journalist : can only add and edit own news
Commenter : only post comments
";
echofooter();
}
// ********************************************************************************
// Add User
// ********************************************************************************
elseif($action == "adduser")
{
if(!$regusername){ msg("error","Error !!!", "Username can not be blank", "javascript:history.go(-1)"); }
if(!$regpassword){ msg("error","Error !!!", "Password can not be blank", "javascript:history.go(-1)"); }
$all_users = file("./data/users.db.php");
foreach($all_users as $user_line)
{
$user_arr = explode("|", $user_line);
if($user_arr[2] == $regusername){ msg("error", "Error !!!", "Sory but user with this username already exist", "javascript:history.go(-1)"); }
}
$add_time = time()+($config_date_adjust*60);
$regpassword = md5($regpassword);
$regpassword = md5($regpassword);
$old_users_file = file("./data/users.db.php");
$new_users_file = fopen("./data/users.db.php", "a");
fwrite($new_users_file, "$add_time|$reglevel|$regusername|$regpassword|$regnickname|$regemail|0|0||||\n");
fclose($new_users_file);
switch($reglevel){
case "1": $level = "administrator"; break;
case "2": $level = "editor"; break;
case "3": $level = "journalist"; break;
case "4": $level = "commenter"; break;
}
msg("info","User Added","The user $regusername was successfully added as $level", "$PHP_SELF?mod=editusers&action=list");
}
// ********************************************************************************
// Edit User Details
// ********************************************************************************
elseif($action == "edituser")
{
$users_file = file("./data/users.db.php");
foreach($users_file as $user_line){
$user_arr = explode("|", $user_line);
if($id == $user_arr[0]){
break;
}
}
if(isset($user_arr[9]) and $user_arr[9] != ''){ $last_login = date('r',$user_arr[9]); }
else{ $last_login = 'never'; }
echo"
Edit Users
Historical archive. This is a preserved copy of 36 Degrees Design (2005–2008), the early web-design weblog of Stuart Frisby. It is maintained independently as a piece of web history and is not operated by, affiliated with, or endorsed by Stuart Frisby. If you are the original owner and would like this domain returned, get in touch — it’s yours, no fuss.