Revision 3 (by ahitrov@rambler.ru, 2010/03/24 15:19:32) The CORE
<%args>

	$login => undef

</%args>
<%init>
	unless ($user->check_group(1))
	{
		$m->clear_buffer;
		$m->abort(403);
	}
	my $luser;
	if ($login)
	{
		$luser = $keeper->get_user_by_login($login);

		my %sections = ();
		foreach my $name (keys %ARGS)
		{
			if ($name =~ /^section_(\d+)$/)
			{
				$sections{$1} = 1;
			}
		}
		my @sections_in_order = ();
		push (@sections_in_order, keys(%sections));

		# ������ ���� ����� - ��� ����� ����� ������ ����� ���� �� �����������...
		$luser->{groups} = [@sections_in_order];
		$luser->store();

		$r->header_out("Location", "users.html?login=$login");
		$r->status(302);
		$r->send_http_header();
		$m->abort();
	}
</%init>