Exemplo n.º 1
0
 function invia_commento()
 {
     try {
         $nome = Params::get("nome");
         $subject = Params::get("subject");
         $email = Params::get("email");
         $testo = Params::get("testo");
         //$codice_hidden = Params::get("codice_hidden");
         //$codice = Params::get("codice");
         //if ($codice_hidden!=$codice)
         //    throw new InvalidParameterException("Il codice non e' impostato correttamente!!");
         if ($nome != null && $subject != null && $email != null && $testo != null && isset(Config::instance()->EMAIL_COMMENT_RECEIVED)) {
             $e = new EMail("no_reply@" . Host::current_no_www(), Config::instance()->EMAIL_COMMENT_RECEIVED, "[Nuova commento da : " . $nome . "] - " . Host::current(), EMail::HTML_FORMAT);
             $e->render_and_send("include/messages/mail/alert/" . Lang::current() . "/nuovo_commento.php.inc", array("nome" => $nome, "email" => $email, "subject" => $subject, "testo" => $testo));
             return Redirect::success();
         } else {
             if (!isset(Config::instance()->EMAIL_COMMENT_RECEIVED)) {
                 throw new InvalidDataException("Il parametri di configurazione EMAIL_COMMENT_RECEIVED non e' impostato correttamente!!");
             } else {
                 throw new InvalidDataException("I dati immessi nella form non sono validi!!");
             }
         }
     } catch (Exception $ex) {
         Flash::error($ex->getMessage());
         return Redirect::failure();
     }
 }
Exemplo n.º 2
0
 private static function check_domain($domains)
 {
     foreach ($domains as $d) {
         if (Host::current() === $d) {
             return true;
         }
     }
     return false;
 }
Exemplo n.º 3
0
 static function isLocal()
 {
     $current_host = Host::current();
     if (strstr($current_host, ".") === false) {
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 4
0
<?php

// this must be the very first line in your PHP file!
/* This software is released under the BSD license. Full text at project root -> license.txt */
require_once "../../../framework/init.php";
require_once "framework/core/lib/controller/AbstractController.class.php";
DB::openDefaultConnection();
// You can't simply echo everything right away because we need to set some headers first!
$output = '';
// Here we buffer the JavaScript code we want to send to the browser.
$delimiter = "\n";
// for eye candy... code gets new lines
$output .= 'var tinyMCEFileList = new Array(';
$all_documenti = call("documenti", "index", array("__filter_folder__EQUAL" => $_GET["folder"]));
$server_path = "http://" . Host::current();
// Since TinyMCE3.x you need absolute image paths in the list...
if (count($all_documenti) > 0) {
    foreach ($all_documenti as $doc) {
        $output .= $delimiter . '["' . utf8_encode($doc["nome"]) . '", "' . utf8_encode($server_path . $doc["save_folder"] . $doc["hash_name"]) . '"],';
    }
    $output = substr($output, 0, -1);
    // remove last comma from array item list (breaks some browsers)
}
$output .= $delimiter;
DB::closeConnection();
// Finish code: end of array definition. Now we have the JavaScript code ready!
$output .= ');';
// Make output a real JavaScript file!
header('Content-type: text/javascript');
// browser will now recognize the file as a valid JS file
// prevent browser from caching
<html>
    <head>
        <title><?php 
echo Host::current();
?>
</title>
    </head>
    <body>
        <br />
        <br />
        <div align="center">
            <h2>Sito web in fase di manutenzione</h2>
        </div>
    </body>
</html>
Exemplo n.º 6
0
 function testGet()
 {
     $url = "http://" . Host::current() . "/framework/core/tests/utils/http_test/input/hello.php";
     $result = Http::get($url);
     $this->assertEqual("Hello!", $result, "Il risultato ritornato non corrisponde!!");
 }
Exemplo n.º 7
0
 public static function alert($app_name, $alert_title)
 {
     $e = new EMail("alert@" . Host::current(), "*****@*****.**", "[" . $app_name . "] - " . $alert_title, EMail::HTML_FORMAT);
     $e->render_and_send("framework/core/messages/alert/alert.php.inc", array("app_name" => $app_name, "alert_title" => $alert_title));
 }
Exemplo n.º 8
0
 protected function autoconfigure()
 {
     $this->scan_from_site_root("/include/config/__common/");
     $this->scan_from_site_root("/include/config/" . Host::current() . "/");
 }
Exemplo n.º 9
0
<?php

$supported_languages = array("it", "en");
$default_language = "it";
if (isset($_GET["lang"])) {
    Language::setCurrent($_GET["lang"]);
}
$current_lang = Language::getCurrent();
$current_host = Host::current();
header("Location: http://" . $current_host . "/" . $current_lang . "/index.php");
//require_once("include/portfolio.php");
//probe_portfolio_ping("65632473556990386535131");