Esempio n. 1
0
 public function upload()
 {
     // $last = !empty($this->request->post['last']) ? $this->request->post['last'] : array(
     //     'step' => 'list',
     //     'continue_from' => ''
     //   );
     $response =& $this->request->post['last'];
     $valid_extensions = $this->get_valid_extensions(array('css' => getNitroPersistence('CDNStandardFTP.SyncCSS'), 'js' => getNitroPersistence('CDNStandardFTP.SyncJavaScript'), 'images' => getNitroPersistence('CDNStandardFTP.SyncImages')));
     if (empty($valid_extensions)) {
         throw new Exception("No file types selected for upload.");
     }
     $files = $this->cdn_prepare_files(array('valid_extensions' => $valid_extensions, 'cdn' => '3'));
     if (!empty($files) && $response['step'] == 'upload') {
         $ftp =& $this->get_ftp_connection();
         $data = array('ftp' => $ftp);
         np($files, 0, FILE_APPEND);
         foreach ($files as $file) {
             $data['file'] = $file;
             $this->ftp_upload_file($data);
             $this->cdn_after_upload($file);
         }
     } else {
         if (empty($files) && $response['step'] == 'upload') {
             $persistence = getNitroPersistence();
             $persistence['Nitro']['CDNStandardFTP']['LastUpload'] = date($this->language->get('date_format_long') . ' ' . $this->language->get('time_format'));
             setNitroPersistence($persistence);
         }
     }
 }
Esempio n. 2
0
        $shouldhave = floor($p / $five_min);
    }
    echo "<tr><td colspan=3>&nbsp;<br></td></tr>";
    echo "<tr><td>First Test Record";
    echo "</td><td>&nbsp;</td><td>";
    echo nicedt($firstx);
    echo "</td></tr>";
    echo "<tr><td>Last Test Record";
    echo "</td><td>&nbsp;</td><td>";
    echo nicedt($lastx);
    echo "</td></tr>";
    echo "<tr><td colspan=3>&nbsp;<br></td></tr>";
    echo "<tr><td><b>Service Availability</b>";
    echo "</td><td>&nbsp;</td><td><b>";
    // Service level is tested-failed
    echo np($tested, $tested - $failc);
    echo "</b></td></tr>";
    echo "</table><br>";
    /* - zoom period debugging
    echo "Period: $p s (".($p/$five_min).")<br>";
    echo "sx: ".$startx." fx: ".$finishx."<br>";
    echo "diffx: ".($finishx-$startx)."<br>";
    echo "fx2: ".$fx." p: ".$p."<br>";
    */
    echo "<br><hr style=\"width: 400px; border: 0 solid #a0a0a0; height: 1px; background-color: #a0a0a0; align: left;\" align=\"left\"><br>";
}
$savestring = "";
$first = true;
foreach ($_REQUEST['testlist'] as $testid) {
    if ($first) {
        $first = false;
Esempio n. 3
0
echo "<td>&nbsp;</td><td>";
echo np($utt, $passc);
echo "</td></tr>";
echo "<tr><td colspan=3>&nbsp;<br></td></tr>";
echo "<tr><td>" . $testc . " records of which " . $tested . " returned a valid alert level";
echo "</td><td>&nbsp;</td><td>";
echo np($testc, $tested);
echo "</td></tr>";
if ($show_expected_number) {
    $nowx = time();
    if ($finishx > $nowx) {
        $fx = $nowx;
    } else {
        $fx = $finishx;
    }
    $p = $fx - $startx;
    $interval_min = 60 * $tinterval;
    $shouldhave = floor($p / $interval_min);
    echo "<tr><td>" . $testc . " records and you <i>should have</i> " . hlink("History:Should", 12) . " " . $shouldhave;
    echo "</td><td>&nbsp;</td><td>";
    echo np($shouldhave, $testc);
    echo "</td></tr>";
}
echo "</table><br>";
/* - zoom period debugging
echo "Period: $p s (".($p/$five_min).")<br>";
echo "sx: ".$startx." fx: ".$finishx."<br>";
echo "diffx: ".($finishx-$startx)."<br>";
echo "fx2: ".$fx." p: ".$p."<br>";
*/
Screen_Footer();