$filter = new Filter("auth_user", "user_id");
	$filter->addRule($lang->get("email"), "email", "email");

	$filter->icon = "li_user.gif";
	$filter->type_name = "Users";

	$filtermenu = new Filtermenu($lang->get("user_filtermenu"), $filter);
	$filtermenu->addMenuEntry($lang->get("user_link"), "user_general.php", "user_premissions.php");
	
	
	$deleteHandler = new ActionHandler("DELETE");
	$deleteHandler->addDbAction("DELETE FROM auth_user where user_id=$oid and user_id > 999");
	
	$form = new stdEDForm($lang->get("user_head"), "i_myprofile.gif");
	$form->submitButtonAction = "if (document.form1.auth_user_password_1.value != '') document.form1.auth_user_password_1.value = document.form1.auth_user_password_2.value = hex_md5(document.form1.auth_user_password_1.value);";

	$cond = $form->setPK("auth_user", "user_id");
	
	$form->add(new TextInput($lang->get("email"), "auth_user", "email", $cond, "type:text,width:300,size:64", "MANDATORY&UNIQUE"));
	$form->add(new TextInput($lang->get("password"), "auth_user", "password", $cond, "type:text,width:200,size:40", "MANDATORY"));
	$form->add(new CheckboxInput($lang->get("user_active"), "auth_user", "active", $cond, "1", "0"));
	$form->add(new TextInput($lang->get("confirmcode", "Confirm-Code"), "auth_user", "confirm", $cond, "type:text,width:300,size:40", "MANDATORY&UNIQUE"));
	// Control Information
	$form->add(new NonDisplayedValueOnInsert("auth_user", "registration_date", $cond, "NOW()", "TIMESTAMP"));
	$form->registerActionHandler($deleteHandler);	

	$page->addMenu($filtermenu);
	$page->add($form);
	$page->drawAndForward("modules/communitylogin/user_general.php?sid=$sid&go=update&oid=<oid>");
	$db->close();
?>
		$addtext = "";
	} else {
		$addtext = ": " . getDBCell("users", "USER_NAME", "USER_ID = " . $oid);
	}

	$form = new stdEDForm($lang->get("user_head"). $addtext, "i_myprofile.gif");
	$form->submitButtonAction = "if (document.form1.users_PASSWORD_1.value != '') document.form1.users_PASSWORD_1.value = document.form1.users_PASSWORD_2.value = hex_md5(document.form1.users_PASSWORD_1.value);";

	$cond = $form->setPK("users", "USER_ID");

	if ($oid != "") {
		$form->headerlink = crHeaderLink($lang->get("user_permission", "Edit user permissions"), "modules/user/user_permissions.php?sid=$sid&go=update&oid=$oid");
	}

	$form->add(new TextInput($lang->get("user_name"), "users", "USER_NAME", $cond, "type:text,width:200,size:16", "MANDATORY&UNIQUE"));
	$form->add(new TextInput($lang->get("full_name"), "users", "FULL_NAME", $cond, "type:text,width:200,size:32", "MANDATORY"));
	$form->add(new PasswordInput($lang->get("password"), "users", "PASSWORD", $cond, "type:text,width:200,size:32", "MANDATORY"));
	$form->add(new TextInput($lang->get("user_email"), "users", "EMAIL", $cond, "type:text,width:200,size:64", "MANDATORY"));
	$form->add(new CheckboxInput($lang->get("user_active"), "users", "ACTIVE", $cond, "1", "0"));
	$form->add(new SelectOneInput($lang->get("user_bl"), "users", "LANGID", "internal_resources_languages", "NAME", "LANGID", "1", $cond, "type:dropdown", "MANDATORY", "TEXT"));

	// Control Information
	$form->add(new NonDisplayedValueOnInsert("users", "REGISTRATION_DATE", $cond, "NOW()", "TIMESTAMP"));
	$form->registerActionHandler($deleteHandler);
	$form->registerActionHandler($insertHandler);

	$page->addMenu($filtermenu);
	$page->add($form);
	$page->drawAndForward("modules/user/user_general.php?sid=$sid&go=update&oid=<oid>");
	$db->close();
?>
	$c["clustertemplatebrowser"] = true;
	$pnode = initValueEx("pnode", "pnode", "0", "NUMERIC");

	//// ACL Check ////
	$aclf = aclFactory($pnode, "folder");
	$aclf->load();
	if (! $aclf->hasAccess($auth->userId)) {
		$pnode = "0";
		delVar("pnode");
		$aclf = aclFactory(0, "folder");
		$aclf->load();
		if (! $aclf->hasAccess($auth->userId)) 
		   header("Location: ". $c["docroot"]."modules/common/noaccess.php?sid=$sid&guid=$pnode");
	}
	//// ACL Check ////
	
	$browser = new Clustermenu($lang->get("clt_browse"));
	$browser->action = $c["docroot"] . "modules/clustertemplate/clustertemplates.php";	
	$browser->tipp = $lang->get("help_clt", "Cluster template is a form that enables you to create structure for your site and define the type of contents. Afterwards, cluster template is merged with a page-template that includes the content of the web page.");
	$page->addMenu($browser);

	require_once $c["path"] . "modules/common/folder_logic.inc.php";
	require_once $c["path"] . "modules/clustertemplate/clustertemplate_logic.inc.php";

	if ($action == "newobject" && value("processing") == "yes" && $errors == "") {
		$page->drawAndForward("modules/clustertemplate/clustertemplates.php?sid=$sid&pnode=$pnode&oid=<oid>&action=editobject");
	} else {
		$page->draw();	
	}
	$db->close();	
?>
		$form->headerlink = crHeaderLink($lang->get("ed_cpgroup"), "modules/compoundgroup/compound_group_members.php?sid=$sid&oid=$oid&go=update");
	}
	$form->add(new TextInput($lang->get("group_name"), "compound_groups", "NAME", $cond, "type:text,width:200,size:32", "MANDATORY&UNIQUE"));
	$form->add(new TextInput($lang->get("group_description", "Description"), "compound_groups", "DESCRIPTION", $cond, "type:textarea,width:340,size:2", ""));
	$form->add(new Hidden("todo", ""));
	
    $values = array();
    array_push($values, array($lang->get("latest", "Latest changed first"), 2));
    array_push($values, array($lang->get("oldest", "Oldest changed first"), 3));    
    array_push($values, array($lang->get("by_order", "By order"), 4));
    array_push($values, array($lang->get("random", "Random"), 1));
    

	$form->add(new SelectOneInputFixed($lang->get("ordercomp", "Order of Compounds"), "compound_groups", "SORTMODE", $values, $cond, "type:dropdown"));
	$form->registerActionHandler($deleteHandler);

	if (value("todo") == $lang->get("launch")) {
		launchCompoundGroup($oid, 10);
		$page_action = "UPDATE";
		$page_state = "";	
		if ($errors == "") {
			$form->addToTopText($lang->get("objlaunch_success"));
			$form->topicon = "ii_success.gif";
		}
	}

	$page->addMenu($filtermenu);
	$page->add($form);
	$page->drawAndForward("modules/compoundgroup/compound_groups.php?sid=$sid&go=update&oid=<oid>");
	$db->close();
?>
	//$form->add(new SelectOneInput($lang->get("spm_meta"), "sitepage_master", "MT_ID", "meta_templates", "NAME", "MT_ID", "INTERNAL=0", $cond, "type:dropdown", "MANDATORY")); 
	$form->add(new SelectMultiple2Input($lang->get("spm_variations"), "sitepage_variations", "VARIATION_ID", $cond, "variations", "NAME", "VARIATION_ID", "DELETED=0"));

	// forbid deletion, until no more SPMs are used in sitemap.
	$amount = countRows("sitemap", "MENU_ID", "SPM_ID = $oid AND DELETED=0");

	if ($amount > 0)
		$form->forbidDelete(true);

	$form->registerActionHandler($deleteHandler);
	$form->registerActionHandler($insertHandler);
	$form->registerActionHandler($updateHandler);
	$form->add(new Hidden("action", ""));
	$page->addMenu($filtermenu);
	$page->add($form);
	$page->drawAndForward("modules/pagetemplate/sitepage_master.php?sid=$sid&go=update&oid=<oid>");
	$db->close();
	
	
	/**
	 * retrieves available thumbnails automatically from the server
	 */
	function getThumbnailList () {
		global $c;
		$ret = array ();
		$ret[] = array("", "");
		$filetypes = array(".png", ".jpg", ".gif");
		$dirhandle = opendir($c["path"].'modules/sitepages/thumbnails/');
		while (false !== ($fname = readdir ($dirhandle))) {
			if (is_file ($c["path"].'modules/sitepages/thumbnails/'.$fname) && in_array(substr($fname, strrpos($fname, "."), strlen($fname) - strrpos($fname, ".")), $filetypes)) {
				$ret[] = array ($fname, $fname);