# Copyright 2002-2007 Interchange Development Group and others
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.  See the LICENSE file for details.

UserTag reconfig Order   name table file
UserTag reconfig Version 1.5
UserTag reconfig Routine <<EOR
use strict;
sub {
	my ($name, $table, $file) = @_;
	$name ||= $Vend::Cfg->{CatalogName};

	my $myname = $Vend::Cfg->{CatalogName};
#::logGlobal("Trying to reconfig $name");

	if($myname ne '_mv_admin' and $myname ne $name) {
			$::Values{mv_error_tag_restart} =
				"Not authorized to reconfig that catalog.";
			return undef;
	}
#::logGlobal("Passed name check on reconfig $name");

	my $script = $Global::Catalog{$name}->{script};
	unless($script) {
		logGlobal("Attempt to reconfigure catalog without script?");
		logError("Attempt to reconfigure catalog without script?");
		return undef;
	}

	if($table and $file) {
		$script = join "\t", $script, $table, $file;
	}
	logData("$Global::RunDir/reconfig", $script);
	return 1;
}
EOR
