示例#1
0
}
$row_config_globale = $cnx->SqlRow("SELECT * FROM {$table_global_config}");
count($row_config_globale) > 0 ? $r = 'SUCCESS' : ($r = '');
if ($r != 'SUCCESS') {
    include "include/lang/english.php";
    echo "<div class='error'>" . translate($r) . "<br>";
    echo "</div>";
    exit;
}
if (empty($row_config_globale['language'])) {
    $row_config_globale['language'] = "english";
} else {
    include "include/lang/" . $row_config_globale['language'] . ".php";
}
$form_pass = empty($_POST['form_pass']) ? "" : $_POST['form_pass'];
if (!checkAdminAccess($row_config_globale['admin_pass'], $form_pass)) {
    quick_Exit();
}
require 'include/lib/PHPMailerAutoload.php';
$step = empty($_GET['step']) ? "" : $_GET['step'];
$subject = !empty($_SESSION['subject']) ? $_SESSION['subject'] : '';
$message = !empty($_SESSION['message']) ? $_SESSION['message'] : '';
$format = !empty($_SESSION['format']) ? $_SESSION['format'] : '';
$list_id = !empty($_POST['list_id']) ? intval($_POST['list_id']) : '';
$list_id = !empty($_GET['list_id']) && empty($list_id) ? intval($_GET['list_id']) : intval($list_id);
$begin = !empty($_POST['begin']) ? $_POST['begin'] : '';
$begin = !empty($_GET['begin']) && empty($begin) ? intval($_GET['begin']) : 0;
$msg_id = !empty($_GET['msg_id']) ? intval($_GET['msg_id']) : '';
$sn = !empty($_GET['sn']) ? intval($_GET['sn']) : '';
$error = !empty($_GET['error']) ? $_GET['error'] : '';
switch ($step) {
示例#2
0
<?php

// protect script from unauthorized calls
$basePath = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
require_once $basePath . 'includes/configuration.php';
require_once $basePath . 'includes/functions.php';
checkAdminAccess();
//  ##############   Include Files  ################ //
require_once $basePath . 'includes/db_connection.php';
//  ##############  Finish Includes  ############### //
if (isset($configuration['repositories']) && is_array($configuration['repositories']) && count($configuration['repositories'])) {
    $consoleLog = array('Begin of import: ' . date('l jS \\of F Y h:i:s A'));
    $error = FALSE;
    $checkDependencies = isset($configuration['dependencies']) && count($configuration['dependencies']) ? TRUE : FALSE;
    // cache existing addon-IDs
    $result = $db->get_results('SELECT id, version, deleted FROM addon');
    $addonCache = array('processed' => array(), 'existing' => array());
    if ($result) {
        foreach ($result as $addon) {
            $addonCache['existing'][$addon->id] = $addon;
        }
    }
    // import addons from each repository
    foreach ($configuration['repositories'] as $repositoryId => $repositoryConfiguration) {
        # Check the XML exists
        if (isset($repositoryConfiguration['xmlUrl']) && $repositoryConfiguration['xmlUrl']) {
            $repositoryXmlUrl = $repositoryConfiguration['xmlUrl'];
        } else {
            $repositoryXmlUrl = $repositoryConfiguration['dataUrl'] . 'addons.xml';
        }
        $xml = simplexml_load_file($repositoryXmlUrl);