All pastes #472510 Raw Edit

Mine

public php v1 · immutable
·published 2007-05-05 17:12 UTC
rendered paste body
function multiSave($op, $servers_to_modify, $presetid=0) { global $_POST, $appID, $config_file, $contentarray, $api;   foreach($servers_to_modify as $k=>$v)  {   if (strcmp("restart", $_POST['activateoption']) == 0)    {    $api->stopServer($v);     }     $contentarray = explode("\r\n", stripslashes($_POST['filecontents']) );    $api->setConfigFileContents($v, $config_file, $presetid, $contentarray);    if (strcmp("restart", $_POST['activateoption']) == 0)    {    $api->startServer($v);    }  }   $retval = $api->exec();  $api->clear();   foreach($retval as $k=>$v)   {    if (strcmp("restart", $_POST['activateoption']) == 0)     {    if ($k % 3 == 0)     {     $checkStatus[]["stop"]   = $retval[$k];     $checkStatus[][$op]      = $retval[$k+1];     $checkStatus[]["start"]  = $retval[$k+2];     }    }   else    $checkStatus[][$op]       = $retval[$k];   } return $checkStatus;   }