Ejemplo n.º 1
0
         if (defined("DEMO_MODE") && DEMO_MODE) {
             $jsonData = array('success' => false, 'root' => array(), 'error' => array('title' => 'Demo Mode Enabled', 'reason' => 'Change is not allowed in demo mode!'));
         } else {
             if (empty($_POST['serverID']) || intval($_POST['serverID']) < 1) {
                 $jsonData = array('success' => false, 'root' => array(), 'error' => array('title' => 'Error!', 'reason' => 'Unable to load server ID'));
             } else {
                 if (!DB_GetRow($srv, DB_TABLE_RPC_SERVER, $rDbStruct[DB_TABLE_RPC_SERVER], array('WHERE' => "`id`='" . intval($_POST['serverID']) . "'"))) {
                     $jsonData = array('success' => false, 'root' => array(), 'error' => array('title' => 'Error!', 'reason' => 'Unable to get server information.'));
                 } else {
                     if (empty($_POST['account'])) {
                         $jsonData = array('success' => false, 'root' => array(), 'error' => array('title' => 'Error!', 'reason' => 'Label name cannot be blank.'));
                     } else {
                         if (empty($_POST['address'])) {
                             $jsonData = array('success' => false, 'root' => array(), 'error' => array('title' => 'Error!', 'reason' => 'Wallet address cannot be empty.'));
                         } else {
                             if (!rpc_request($rpcOut, $srv, array('method' => 'setaccount', 'params' => array($_POST['address'], FixJsonDecodeBug($_POST['account']))))) {
                                 $jsonData = array('success' => false, 'root' => array(), 'error' => array('title' => 'Error!', 'reason' => $rpcOut->error->message));
                                 insertLog("ERROR", "setaccount", "unable to set account!", sprintf("code:#%d,message:%s", $rpcOut->error->code, $rpcOut->error->message));
                             } else {
                                 $jsonData = array('success' => true, 'root' => array(), 'error' => array());
                                 insertLog("OK", "setaccount", "successfully renamed!", serialize($rpcOut->result));
                             }
                         }
                     }
                 }
             }
         }
     }
 } else {
     if ($currentAction == "FlushBrutes") {
         $rpcOut;
Ejemplo n.º 2
0
                 if ($currentAction == "backup") {
                     $srvList = array();
                     $rData = array();
                     $rpcOut = array();
                     if (!isLoggedIn()) {
                         $jsonData = array('success' => false, 'root' => array(), 'error' => array('title' => 'Login Required', 'reason' => 'You have to login for this operation.'));
                     } else {
                         if (!DB_GetRows($srvList, DB_TABLE_RPC_SERVER, $rDbStruct[DB_TABLE_RPC_SERVER], array('WHERE' => "1"))) {
                             $jsonData = array('success' => false, 'root' => array(), 'error' => array('title' => 'Error!', 'reason' => 'Unable to load server information.'));
                         } else {
                             foreach ($srvList as $srv) {
                                 $backupFileName = $srv['backup_path'] . date("Y_M_d_H_i_s") . ".dat";
                                 if (empty($srv['backup_path'])) {
                                     $tmp = array('title' => $srv['title'], 'server' => $srv['host'] . ':' . $srv['port'], 'backupfilepath' => "---", 'status' => 'ERROR: Backup Destination is not set. Backup Disabled');
                                 } else {
                                     if (!rpc_request($rpcOut, $srv, array('method' => 'backupwallet', 'params' => array($backupFileName)))) {
                                         $tmp = array('title' => $srv['title'], 'server' => $srv['host'] . ':' . $srv['port'], 'backupfilepath' => $backupFileName, 'status' => 'ERROR: ' . $rpcOut->error->message);
                                     } else {
                                         $tmp = array('title' => $srv['title'], 'server' => $srv['host'] . ':' . $srv['port'], 'backupfilepath' => $backupFileName, 'status' => 'DONE');
                                     }
                                 }
                                 $rData[] = $tmp;
                             }
                             $jsonData = array('success' => true, 'root' => $rData, 'message' => sprintf("Total: %d", count($rData)), 'error' => array());
                         }
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
		padding: 4px;
	}
	</style>
	</head>
<body>';
$rData = array();
if (!DB_GetRows($rData, DB_TABLE_RPC_SERVER, $rDbStruct[DB_TABLE_RPC_SERVER], array('WHERE' => '1'))) {
    die("<h2>UNABLE TO LOAD RPC SERVERS</h2>");
}
echo '<center><h2 style="color:red">' . SCRIPT_NAME . ' ' . SCRIPT_VER . '<br />PANIC MODE</h2></center>
<table width="100%" border="1"><tr><th>ID</th><th>SERVER LINK</th><th>ACTION</th><th>RESULT</th></tr>';
$i = 0;
foreach ($rData as $srv) {
    $srvLink = "rcp://" . $srv['username'] . ":***@" . $srv['host'] . ":" . $srv['port'];
    $pText = "<tr><td>" . ($i + 1) . "</td><td>" . $srvLink . "</td><td>Sending stop command</td><td>";
    $c = rpc_request($rpcOut, $srv, array('method' => 'stop', 'params' => array()));
    $pText .= _getPanicStatusText($c);
    $pText .= "</td></tr>";
    $pText .= "<tr><td>" . ($i + 2) . "</td><td>" . $srvLink . "</td><td>Removing record from database </td><td>";
    $c = DB_delete(DB_TABLE_RPC_SERVER, array('WHERE' => "`id`='" . $srv['id'] . "'"));
    $pText .= _getPanicStatusText($c);
    $pText .= "</td></tr>";
    $i += 2;
    echo $pText;
}
$pText = "<tr><td>" . ($i + 1) . "</td><td>LOCAL DB SERVER</td><td>Removing database (" . DB_NAME . ")</td><td>";
$c = mysql_query("DROP DATABASE `" . DB_NAME . "`");
$pText .= _getPanicStatusText($c);
echo $pText;
$pText = "<tr><td>" . ($i + 2) . "</td><td>LOCAL DIR</td><td>Trying to Remove configuration file.</td><td>";
$c = @unlink("config.php");