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();
     }
 }
Beispiel #2
0
 public static function current($current = null)
 {
     global $root;
     if ($current) {
         self::$current = $current;
     } elseif (isset($_GET['lang']) && file_exists("{$root}/lang/{$_GET['lang']}.php")) {
         self::$current = $_GET['lang'];
     }
     return self::$current;
 }
Beispiel #3
0
 /**
  * Begins the session.
  */
 public static function start()
 {
     session_start();
     if (isset($_SESSION[self::$name . '_SID'])) {
         self::$sid = $_SESSION[self::$name . '_SID'];
         self::$data = $_SESSION[self::$name . '_DATA'];
     } else {
         self::$sid = md5(time());
         self::$data = array('lang' => Lang::current(), 'uid' => 0);
         $_SESSION[self::$name . '_SID'] = self::$sid;
         $_SESSION[self::$name . '_DATA'] = self::$data;
     }
     Lang::load(self::_('lang'));
     if (self::$data['uid']) {
         self::$logged = true;
     }
 }
Beispiel #4
0
<?php

@error_reporting(E_ALL ^ E_NOTICE);
@set_magic_quotes_runtime(0);
if (empty($root)) {
    $root = '.';
}
/**
 * @ignore
 */
$theme = 'default';
require_once "{$root}/includes/String.php";
require_once "{$root}/includes/Lang.php";
require_once "{$root}/includes/Session.php";
require_once "{$root}/includes/Db.php";
Db::connect($configdb);
$config = Db::fetchPairs("SELECT name, value\n     FROM config");
if (isset($config['lang'])) {
    Lang::current($config['lang']);
}
Session::start();
<?php

$success = call("form_submit", "is_comment_successfull");
$lang = Lang::current();
if ($success) {
    include "include/messages/commenti/" . $lang . "/commento_ok.block.php";
} else {
    include "include/messages/commenti/" . $lang . "/errore_commento.block.php";
}
Beispiel #6
0
<?php

require_once __DIR__ . '/vendor/autoload.php';
var_dump(Lang::current());
Lang::force('ar');
var_dump(Lang::current());