first version of a setup command that can run via admins remote command execution

This commit is contained in:
Ralf Becker
2007-12-05 02:27:49 +00:00
parent e74c6debaa
commit 4f77162f64
6 changed files with 198 additions and 19 deletions

View File

@@ -78,6 +78,9 @@ switch($action)
case '--check-acl';
return do_check_acl();
case '--show-header';
return run_command(new setup_cmd_showheader());
case '--exit-codes':
return list_exit_codes();
@@ -123,6 +126,14 @@ function run_command(admin_cmd $cmd)
case '--skip-checks': //do not yet run the checks for scheduled local commands
$skip_checks = true;
break;
case '--header-access':
if ($cmd instanceof setup_cmd)
{
list($user,$pw) = explode(',',array_shift($arguments),2);
$cmd->set_header_secret($user,$pw);
}
break;
default:
//fail(99,lang('Unknown option %1',$extra);
@@ -138,7 +149,15 @@ function run_command(admin_cmd $cmd)
{
fail($cmd->errno,$cmd->error);
}
echo $msg."\n\n";
if (($value = unserialize($msg)) !== false && $msg !== serialize(false))
{
print_r($value);
echo "\n";
}
else
{
echo $msg."\n\n";
}
exit(0);
}
@@ -441,4 +460,4 @@ function do_subscribe_other($account_lid,$pw=null)
//$icServer->subscribeMailbox($mailbox);
//exit;
}
}
}