Location: PHPKode > projects > Aratix > aratix/admin/inc/user.inc.php
<?php
/*
** Aratix
** Version 0.1.0beta8 (Anubis)
**
** Autor: Manuel Burghammer
** E-Mail: hide@address.com
** Homepage: http://www.xitara.net
**
** File: user.inc.php - Version 0.1.0 build 62
** Position: /admin/inc/
** Last Modified: 24.05.2006 - 21:43:10
*/

$user = new User;

if(get('action') == "overview"){
	$user_array = $user->overview();
	$content->assign("user_list", $user_array);
}
if(get('action') == "edit" || get('action') == "add"){
 	if(get('submit') == "submit"){
 		$groups = $GLOBALS['db']->read_array(TB_GROUPS, "id", "", "id ASC");
		$group_list = "|";

		foreach($groups as $group){
			if(get($group['id']) == "on")
				$group_list .= $group['id'] . "|";
		}
		if(get('99999') == "on")
			$group_list = "99999";

		if(get('id') == 1){
			$GLOBALS['db']->update(TB_USER, "last_name;;name;;short_name;;email;;language;;layout", get('last_name') . ";;" . get('name') . ";;" . get('short_name') . ";;" . get('email') . ";;" . get('language') . ";;" . get('layout'), "id=1");
		}
		elseif(get('id') > 1){
			$GLOBALS['db']->update(TB_USER, "last_name;;name;;short_name;;email;;groups;;language;;layout;;group_admin;;page_admin;;block_admin;;module_admin;;plugin_admin;;category_admin", get('last_name') . ";;" . get('name') . ";;" . get('short_name') . ";;" . get('email') . ";;" . $group_list . ";;" . get('language') . ";;" . get('layout') . ";;" . get('group_admin') . ";;" . get('page_admin') . ";;" . get('block_admin') . ";;" . get('module_admin') . ";;" . get('plugin_admin') . ";;" . get('category_admin'), "id='" . get('id') . "'");
		}
		else
			$GLOBALS['db']->write(TB_USER, "last_name;;name;;short_name;;email;;login;;groups;;language;;layout;;group_admin;;page_admin;;block_admin;;module_admin;;plugin_admin;;category_admin", get('last_name') . ";;" . get('name') . ";;" . get('short_name') . ";;" . get('email') . ";;" . get('login') . ";;" . $group_list . ";;" . get('language') . ";;" . get('layout') . ";;" . get('group_admin') . ";;" . get('page_admin') . ";;" . get('block_admin') . ";;" . get('module_admin') . ";;" . get('plugin_admin') . ";;" . get('category_admin'));
	}
	$user_data = $user->edit();
	$content->assign("user_data", $user_data);

	$content->assign("all_groups", split_data($user_data, "groups"));

	$content->assign("group_admin", split_data($user_data, "group_admin"));
	$content->assign("page_admin", split_data($user_data, "page_admin"));
	$content->assign("block_admin", split_data($user_data, "block_admin"));
	$content->assign("module_admin", split_data($user_data, "module_admin"));
	$content->assign("plugin_admin", split_data($user_data, "plugin_admin"));
	$content->assign("category_admin", split_data($user_data, "category_admin"));

	$content->assign("group_list", read_data("groups"));
	$content->assign("page_list", read_data("pages"));
	$content->assign("block_list", read_data("blocks"));
	$content->assign("module_list", read_data("modules"));
	$content->assign("plugin_list", read_data("plugins"));
	$content->assign("category_list", read_data("category"));

	$content->assign("user_status", $user_status);
	$content->assign("user_id", get('user_id'));
	$content->assign("new_password", generate_session($GLOBALS['config'], "New Password"));

	$content->assign("layout_list", read_data("layouts"));
	$content->assign("language_list", read_data("lang"));
}

function split_data($data, $type){
	$data_array = explode("|", $data[$type]);
	return $data_array;
}

function read_data($type){
	if($type == "pages")
		$type_array = $GLOBALS['db']->read_array(TB_PREFIX . $type, "id, menu_text", "", "menu_text, id ASC");
	elseif($type == "lang")
		$type_array = $GLOBALS['db']->read_array(TB_PREFIX . $type, "id, language", "", "language ASC");
	else
		$type_array = $GLOBALS['db']->read_array(TB_PREFIX . $type, "id, name, description", "id != 2", "name, id ASC");
	return $type_array;
}
?>





Return current item: Aratix