<?php
/**
 * @package Flatnux_controlcenter
 * @author Alessandro Vernassa <speleoalex@gmail.com>
 * @copyright Copyright (c) 2003-2005
 * @license http://opensource.org/licenses/gpl-license.php GNU General Public License
 *
 */
defined('_FNEXEC') or die('Restricted access');
//fix password--->
if (!empty($_POST['passwd']))
{
	$_POST['passwd'] = md5($_POST['passwd']);
}
if (!empty($_POST['passwd_retype']))
{
	$_POST['passwd_retype'] = md5($_POST['passwd_retype']);
}

if (isset($_POST['passwd']) && $_POST['passwd'] == "")
{
	unset($_POST['passwd']);
}
//fix password---<
$table = FN_XmlForm("fn_users");
$table->formvals['passwd']['frm_required'] = false;
$table->formvals['level']['frm_show'] = "1";
$table->formvals['active']['frm_show'] = "1";
$table->formvals['group']['frm_show'] = "1";
$params = array();
$params['fields'] = "username|email|active|level|group";
//$params['search_fields'] ="username,email,active,level,group";

$getfilters = FN_GetParam("filter",$_GET,"flat");
$filters = explode("^",$getfilters);
$arrayfilter = array();
foreach ($filters as $filter)
{
	if (!empty($filter))
		{
	$tmp = explode(":",$filter);
	$arrayfilter[$tmp[0]] = isset($tmp[1]) ? $tmp[1] : "";
}}
$params['filters']="";
if (count($arrayfilter))
	$params['filters'] = $arrayfilter;
global $_FN;
$op = FN_GetParam("opt",$_GET,"html");
$link = "mod={$_FN['mod']}&amp;opt=$op&amp;filter={$getfilters}";
$params['link'] = "$link";

echo "<a href=\"?mod={$_FN['mod']}&amp;opt=$op&amp;filter=\">".FN_Translate("view all")."</a>&nbsp;&nbsp;|&nbsp;&nbsp;";
echo "<a href=\"?mod={$_FN['mod']}&amp;opt=$op&amp;filter=active:1\">".FN_Translate("view only enabled")."</a>&nbsp;&nbsp;|&nbsp;&nbsp;";
echo "<a href=\"?mod={$_FN['mod']}&amp;opt=$op&amp;filter=\">".FN_Translate("view all")."</a>&nbsp;&nbsp;|&nbsp;&nbsp;";
echo "<a href=\"?mod={$_FN['mod']}&amp;opt=$op&amp;filter=level:10\">".FN_Translate("view only administrators")."</a>&nbsp;&nbsp;|&nbsp;&nbsp;";
echo "<br />";
FN_xmltableeditor($table,$params);


/**
 * 
 * @global type $_FN
 * @param type $id
 * @param type $tableobject
 * @return string
 */
/*
function resend($id,$tableobject)
{
	global $_FN;
	dprint_r($tableobject);
	$html = "";
	$op = FN_GetParam("opt",$_GET,"html");
	$html .= "<a href=\"?mod={$_FN['mod']}&amp;opt=$op&amp;id=$id\">".FN_Translate("send activation link")."</a>";
	return $html;
}
*/
?>