Example #1
0
if (empty($testValue) || $testValue == '(no subject)') {
    $allReady = false;
    $GLOBALS['pagefooter']['addtoqueue'] .= '<script type="text/javascript">
  $("#addtoqueue").append(\'<div class="missing">' . $GLOBALS['I18N']->get('subject missing') . '</div>\');
  </script>';
}
$testValue = trim($messagedata['message']);
$testValue2 = trim($messagedata['sendurl']);
if (empty($testValue) && (empty($testValue2) || $testValue2 == 'e.g. http://www.phplist.com/testcampaign.html')) {
    $allReady = false;
    $GLOBALS['pagefooter']['addtoqueue'] .= '<script type="text/javascript">
  $("#addtoqueue").append(\'<div class="missing">' . $GLOBALS['I18N']->get('message content missing') . '</div>\');
  </script>';
}
if ($messagedata['sendmethod'] == 'remoteurl') {
    $code = testUrl($messagedata['sendurl']);
    if ($code != 200) {
        $allReady = false;
        $GLOBALS['pagefooter']['addtoqueue'] .= '<script type="text/javascript">
        $("#addtoqueue").append(\'<div class="missing">' . s('Incorrect URL for sending') . ' (' . resourceLink('http://resources.phplist.com/documentation/errors/sendurlinvalid') . ')</div>\');
        </script>';
    }
}
$testValue = trim($messagedata['fromfield']);
if (empty($testValue)) {
    $allReady = false;
    $GLOBALS['pagefooter']['addtoqueue'] .= '<script type="text/javascript">
  $("#addtoqueue").append(\'<div class="missing">' . $GLOBALS['I18N']->get('From missing') . '</div>\');
  </script>';
}
##16615, check that "send until" is in after the embargo and warn if it isn't
<?php

/**
 * Copyright (c) 2014 Robin Appelman <*****@*****.**>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */
OCP\JSON::checkAppEnabled('files_sharing');
$remote = $_GET['remote'];
function testUrl($url)
{
    try {
        $result = file_get_contents($url);
        $data = json_decode($result);
        // public link mount is only supported in ownCloud 7+
        return is_object($data) and !empty($data->version) and version_compare($data->version, '7.0.0', '>=');
    } catch (Exception $e) {
        return false;
    }
}
if (testUrl('https://' . $remote . '/status.php')) {
    echo 'https';
} elseif (testUrl('http://' . $remote . '/status.php')) {
    echo 'http';
} else {
    echo 'false';
}
Example #3
0
     }
 }
 if (sizeof($missingImages) && empty($_POST['sendtest'])) {
     include dirname(__FILE__) . "/class.image.inc";
     $image = new imageUpload();
     print "<h3>" . $GLOBALS['I18N']->get('Images') . '</h3><p class="information">' . $GLOBALS['I18N']->get('Below is the list of images used in your template. If an image is currently unavailable, please upload it to the database.') . "</p>";
     print '<p class="information">' . $GLOBALS['I18N']->get('This includes all images, also fully referenced ones, so you may choose not to upload some. If you upload images, they will be included in the campaigns that use this template.') . "</p>";
     print formStart('enctype="multipart/form-data" class="template1" ');
     print '<input type="hidden" name="id" value="' . $id . '" />';
     ksort($images);
     reset($images);
     while (list($key, $val) = each($images)) {
         $key = trim($key);
         if (preg_match('~^https?://~i', $key)) {
             $missingImage = true;
             $imageFound = testUrl($key);
             if ($imageFound != 200) {
                 printf($GLOBALS['I18N']->get('Image name:') . ' <b>%s</b> (' . $GLOBALS['I18N']->get('%d times used') . ')<br/>', $key, $val);
                 print $image->showInput($key, $val, $id);
             }
         } else {
             printf($GLOBALS['I18N']->get('Image name:') . ' <b>%s</b> (' . $GLOBALS['I18N']->get('%d times used') . ')<br/>', $key, $val);
             print $image->showInput($key, $val, $id);
         }
     }
     print '<input type="hidden" name="id" value="' . $id . '" /><input type="hidden" name="action" value="addimages" />
 <input class="submit" type="submit" name="addimages" value="' . $GLOBALS['I18N']->get('Save Images') . '" /></form>';
     if (empty($_POST['sendtest'])) {
         return;
     }
     #    return;
Example #4
0
<?php

## check url
$request_parameters = array('timeout' => 10, 'allowRedirects' => 1, 'method' => 'HEAD');
if (empty($_GET['url'])) {
    return;
}
$url = expandURL($_GET['url']);
$isOk = true;
$code = -1;
if ($GLOBALS['can_fetchUrl']) {
    $code = testUrl($url);
    if ($code != 200) {
        if (!empty($url_append)) {
            $status = $GLOBALS['I18N']->get('Error fetching URL') . ' ' . $GLOBALS['I18N']->get('Check your "remoteurl_append" setting.');
        } else {
            $status = $GLOBALS['I18N']->get('Error fetching URL');
        }
        $isOk = false;
    }
} else {
    $status = $GLOBALS['I18N']->get('Error fetching URL');
    $isOk = false;
}
if ($isOk) {
    $status = '<span class="pass">' . s('URL is valid') . '</span>';
} else {
    $status = '<span class="fail">' . $status . '. ' . s('Please verify that the URL entered is correct.') . '</span>';
}