Location: PHPKode > projects > chillyCMS > chillyCMS/admin/usersgroups.site.php
<?php
//#################################################################################################
//	Users/Groups page
//#################################################################################################
//	chillyCMS - Content Management System
//	Copyright (C) 2008
//	Stefanie Wiegand <hide@address.com> & Johannes Cox <hide@address.com>
//	
//	This program is licensed under the GPL 3.0 license. For more information see LICENSE.txt.
//#################################################################################################
define('DOIT',true);

require_once("../core/session.backend.include.php");

//update language in case it was changed for the current user
if (isset($_POST["action"]) && $_POST["action"]=="updateuser" && isset ($_POST["id"]) && $_POST["id"]==$mysession->user->uid) {
	$language=$_POST["language"];
	require(PATH."/languages/$language.php");
}
require_once(PATH."/admin/usersgroups.include.php");


//Do anything?
if (isset($_POST["action"])) { $action = only_text($_POST["action"]); } else { $action = false; }
if (isset($_POST["id"])) { $id = intval($_POST["id"]); } else { $id = 0; }
if (isset($_POST["what"])) { $what = only_text(	$_POST["what"]); } else { $what = false; }
//Useractions
if ($action=="deleteuser") { $msg = delete_user($id); }
elseif ($action=="updateuser") { $msg = update_user($id); }
elseif ($action=="switchstatuson") { $msg = switch_status($id,"on"); }
elseif ($action=="switchstatusoff") { $msg = switch_status($id,"off"); }
//Groupactions
elseif ($action=="deletegroup")	{ $msg = delete_group($id); }
elseif ($action=="check") { $msg = switch_checked($id,$what,1); }
elseif ($action=="uncheck") { $msg = switch_checked($id,$what,0); }
else { $msg = false; }

//reload groups?
if ($action==("deletegroup" or "check" or "unckeck")) {
	$page->query("select g.*,u.user from system_groups as g,system_users ".
	"as u where g.moderator=u.uid order by g.name");
	$allgroups = $page->db->getdata_array();
}

$page->use_scripts("table.js");
$page->print_head();
$page->add(load_users());
$page->add(load_groups());
$page->print_body($msg);
?>
Return current item: chillyCMS