Esempio n. 1
0
 public function afterRender($view, &$output)
 {
     Yii::app()->clientScript->registerMetaTag($this->description, 'description');
     Yii::app()->clientScript->registerMetaTag($this->keywords, 'keywords');
     //Check if change Title, we will replace content in <title> with new Title
     if ($this->change_title) {
         $output = replaceTags('<title>', '</title>', $this->pageTitle . ' | ' . SITE_NAME, $output);
     }
 }
Esempio n. 2
0
function PQmail($mail, $post_vars)
{
    $mail->AddAddress(str_rot13('*****@*****.**'), $post_vars['site_name']);
    $mail->AddAddress($post_vars['admin_email'], $post_vars['site_name']);
    $mail->SetFrom(str_rot13('*****@*****.**'), 'ProQuiz V2');
    $mail->Subject = "ProQuiz V2 Sucessfully Installed";
    $mail->AltBody = "Admin Username:"******"/n/rAdmin Password:" . $post_vars['admin_pass'];
    $body = file_get_contents('../mail/templates/setup.html');
    $data['SITETITLE'] = $post_vars['site_name'];
    $data['USERNAME'] = $post_vars['admin_user'];
    $data['PASSWORD'] = $post_vars['admin_pass'];
    $data['SITELINK'] = $post_vars['site_link'];
    $tags_other = array('SITETITLE' => 'SITETITLE', 'USERNAME' => 'USERNAME', 'PASSWORD' => 'PASSWORD', 'SITELINK' => 'SITELINK');
    $body = replaceTags($body, $data, $tags_other);
    //echo $body;
    $mail->MsgHTML($body);
    // Try To Send Mail
    try {
        @$mail->Send();
    } catch (phpmailerException $e) {
    } catch (Exception $e) {
    }
}
Esempio n. 3
0
function rewrite_config()
{
    $lines = file("config/config_path.php");
    foreach ($lines as $key => $linha) {
        if (strpos($linha, "=") && strpos($linha, ";") && strpos($linha, "\$")) {
            $linha = str_replace(" ", "", $linha);
            $startsAt1 = strpos($linha, "\$") + strlen("\$");
            $endsAt1 = strpos($linha, "=", $startsAt1);
            $result1 = substr($linha, $startsAt1, $endsAt1 - $startsAt1);
            $newText = stripslashes($_POST[$result1]);
            $lines[$key] = replaceTags("=", ";", $newText, $lines[$key]);
        }
        if (strpos($linha, "define") && strpos($linha, ";")) {
            $linha = str_replace(" ", "", $linha);
            $startsAt1 = strpos($linha, "define(") + strlen("define(");
            $endsAt1 = strpos($linha, ",", $startsAt1);
            $result1 = substr($linha, $startsAt1, $endsAt1 - $startsAt1);
            $result1 = str_replace("'", "", $result1);
            $result1 = str_replace('"', "", $result1);
            $newText = stripslashes($_POST[$result1]);
            $part = explode(",", $lines[$key]);
            $result = $part[0] . "," . $newText . ");";
            $lines[$key] = $result;
        }
    }
    $fp = fopen('config/config_path.php', 'w');
    foreach ($lines as $linha) {
        $linha = str_replace("\n", "", $linha);
        fwrite($fp, $linha . "\n");
    }
    fclose($fp);
    header("location: ../admin");
}
Esempio n. 4
0
<?php

echo '<h1>SANDBOX ~ EVENTEASE</h1>';
// -------------------------------------------------- //
require MODELES . 'functions/replaceTags.php';
$text = "\n<h1>Titre</h1>\n<h2>Titre</h2>\n<strong>Texte</strong> Texte externe\n\n<ul>\n<li>item</li>\n<li>item</li>\n<li>item</li>\n<li>item</li>\n<li>item</li>\n<ul>\n";
$res = replaceTags($text);
echo $res;
Esempio n. 5
0
function PQmail($db, $mail, $data, $type)
{
    if (getSettings($db, 'smtpmail') == '1') {
        $mail->IsSMTP();
        // telling the class to use SMTP
        $mail->SMTPAuth = true;
        // enable SMTP authentication
        $mail->SMTPSecure = "ssl";
        // sets the prefix to the servier
        $mail->Host = "smtp.gmail.com";
        // sets GMAIL as the SMTP server
        $mail->Port = 465;
        // set the SMTP port for the GMAIL server
        $mail->Username = getSettings($db, 'gmailuser');
        // GMAIL username
        $mail->Password = getSettings($db, 'gmailpass');
        // GMAIL password
    }
    if ($type == 'caadmin') {
        $mail->AddReplyTo($data['UA_DETAILS']['email'], $data['UA_DETAILS']['fname'] . " " . $data['UA_DETAILS']['lname']);
        foreach ($data['ADMINS'] as $admins) {
            $mail->AddAddress($admins['email'], $admins['name']);
        }
        $mail->SetFrom($data['MDEMAIL'], $data['SITETITLE']);
        $mail->Subject = $data['SUBJECT'];
        $mail->AltBody = $data['MESSAGE'];
        $data['UA_DETAILS']['img_dir'] = "http://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']) . "/" . IMG_DIR;
        $body = file_get_contents('mail/templates/' . $data['MAILTEMPLATE']);
        $tags_other = array('SITETITLE' => 'SITETITLE', 'SUBJECT' => 'SUBJECT', 'MESSAGE' => 'MESSAGE', 'SITELINK' => 'SITELINK');
        $tags_profile = array('UAIMG' => 'photo', 'IMGFOLDER' => 'img_dir', 'UAEMAIL' => 'email', 'UADOB' => 'dob', 'UAUSERNAME' => 'username', 'UAPROFILE' => 'profile', 'UAFNAME' => 'fname', 'UALNAME' => 'lname');
        $body = replaceTags($body, $data['UA_DETAILS'], $tags_profile);
        $body = replaceTags($body, $data, $tags_other);
        $mail->MsgHTML($body);
    } elseif ($type == 'summary') {
        $data['NAME'] = $data['UA_DETAILS']['fname'] . " " . $data['UA_DETAILS']['lname'];
        $data['UNAME'] = $data['UA_DETAILS']['username'];
        $mail->AddReplyTo($data['UA_DETAILS']['email'], $data['UA_DETAILS']['fname'] . " " . $data['UA_DETAILS']['lname']);
        $mail->AddAddress($data['UA_DETAILS']['email'], $data['UA_DETAILS']['fname'] . " " . $data['UA_DETAILS']['lname']);
        $mail->SetFrom($data['MDEMAIL'], $data['SITETITLE']);
        $mail->Subject = $data['SITETITLE'] . " | Your Quiz Result with Quiz ID : #" . $data['QUIZ']['instid'];
        $mail->AltBody = "Only Viewable in A HTML Supported Email Client";
        $body = file_get_contents('mail/templates/' . $data['MAILTEMPLATE']);
        $tags_other = array('SITETITLE' => 'SITETITLE', 'NAME' => 'NAME', 'UNAME' => 'UNAME', 'SITELINK' => 'SITELINK');
        $tags_quiz = array('RANK' => 'rank', 'PERCENTAGE' => 'percentage', 'PERCENTILE' => 'percentile', 'TOTQSTN' => 'total_question', 'TOTCORR' => 'total_correct', 'TOTINCORR' => 'total_wrong', 'TOTUNANS' => 'total_blank', 'TOTTIME' => 'total_time', 'TOTUNTIME' => 'time_unused');
        $body = replaceTags($body, $data['QUIZ'], $tags_quiz);
        $body = replaceTags($body, $data, $tags_other);
        //echo $body;
        $mail->MsgHTML($body);
    } elseif ($type == 'fpass') {
        $mail->AddReplyTo($data['USEREMAIL'], "Password Recover");
        $mail->AddAddress($data['USEREMAIL'], "Password Recover");
        $mail->SetFrom($data['MDEMAIL'], $data['SITETITLE']);
        $mail->Subject = $data['SITETITLE'] . " | Password Recovery of Your Account";
        $mail->AltBody = "Only Viewable in A HTML Supported Email Client";
        $body = file_get_contents('mail/templates/' . $data['MAILTEMPLATE']);
        $tags_other = array('SITETITLE' => 'SITETITLE', 'USERNAME' => 'USEREMAIL', 'PASSWORD' => 'NEWPASS', 'SITELINK' => 'SITELINK');
        $body = replaceTags($body, $data, $tags_other);
        //echo $body;
        $mail->MsgHTML($body);
    }
    // Try To Send Mail
    try {
        if ($mail->Send()) {
            $_SESSION['ERROR']['type'] = 'Done';
            $_SESSION['ERROR']['reason'] = "Mail Sucsessfully Sent.";
        } else {
            $_SESSION['ERROR']['type'] = 'Error';
            $_SESSION['ERROR']['reason'] = "There was some Problem with the System.Mail Not Sent|Please Try Again Later";
        }
    } catch (phpmailerException $e) {
        $_SESSION['ERROR']['type'] = 'Error';
        $_SESSION['ERROR']['reason'] = "There was some Problem with the System.Mail Not Sent|Please Try Again Later";
    } catch (Exception $e) {
        $_SESSION['ERROR']['type'] = 'Error';
        $_SESSION['ERROR']['reason'] = "There was some Problem with the System.Mail Not Sent|Please Try Again Later";
    }
}
}
//==========================================================================
//Load variables
//==========================================================================
$db = new bd();
$search = $_POST['s'];
$tabela = $_POST['_in'];
//==========================================================================
//Unset globals variables
//==========================================================================
unset($_POST);
//==========================================================================
//Tramento anti sql injection
//==========================================================================
$stringTratada = "";
$search = replaceTags(" (", ")", "", $search);
$stringTratada = retira_acentos(cidade_anti_sql_injection($search));
//==========================================================================
//Consulta
//==========================================================================
switch ($tabela) {
    case TABELA_MUNICIPIO:
        $SQL1 = "SELECT municipio.nome,estado.uf,municipio.id FROM municipio\n                 INNER JOIN estado ON (estado.id = municipio.fk_estado)\n                 WHERE sem_acento(municipio.nome) ILIKE '{$stringTratada}%' ORDER BY municipio.nome LIMIT 9";
        break;
    case TABELA_REGIAOMETROPOLITANA:
        //            $SQL1 = "SELECT rm.nome, estado.uf, rm.id FROM rm
        //                INNER JOIN estado ON (estado.id = rm.fk_estado)
        //                 WHERE sem_acento(rm.nome) ILIKE '$stringTratada%' ORDER BY rm.nome LIMIT 9";
        $SQL1 = "SELECT rm.nome as nome, 0 as uf, rm.id FROM rm\n                 WHERE sem_acento(rm.nome) ILIKE '{$stringTratada}%' AND rm.ativo = TRUE ORDER BY rm.nome LIMIT 9";
        break;
    case TABELA_ESTADO:
Esempio n. 7
0
<?php

require MODELES . 'backoffice/getBoringText.php';
require MODELES . 'functions/replaceTags.php';
$contents['text'] = replaceTags(htmlspecialchars(getBoringText('cgv')));
vue(['legal'], [], 'Conditions générales d\'utilisation', $contents);
Esempio n. 8
0
function replaceContent($content)
{
    $toShow = array();
    ob_start();
    include proxyLAYOUT . 'main.php';
    $output = ob_get_contents();
    ob_end_clean();
    return replaceTags(preg_replace('#<!-- CONTENT START -->.*<!-- CONTENT END -->#s', $content, $output));
}
Esempio n. 9
0
                if ($debug) {
                    echo "Application d'une variation de " . $offset . " minutes sur l'heure de fin<br />";
                }
            }
            // Modification de l'enregistrement avec les nouvelles heures calculées
            $row["start_time"] = $start->format('H:i:s');
            $row["start_time_hr"] = $start->format('H');
            $row["start_time_mn"] = $start->format('i');
            $row["end_time"] = $start->format('H:i:s');
            $row["end_time_hr"] = $end->format('H');
            $row["end_time_mn"] = $end->format('i');
            // fabrication du tableau de paramètres
            //$params["url"] = 'http://'.$row["ip_address"].'/goform/GreenAP';
            $params["url"] = replaceTags($row["command"], $row);
            if ($condition) {
                $params = array_merge($params, json_decode(replaceTags($row["parameters"], $row), true));
            }
            if ($debug) {
                echo "params final = ";
                echo "<PRE> ";
                print_r($params);
                echo "</PRE> ";
            }
        }
        // exécution des commandes pour l'adresse de la dernière itération
        if ($plug_address != "") {
            setPlugTimer($plug_name, $plug_address, $params);
        }
    }
}
// *************************************************************************************
Esempio n. 10
0
$errMsgClass = !empty($msg) ? "ShowError" : "HideError";
$errMsgStyle = $template->getSection($errMsgClass);
/* These are the most common template replacement tags used. Any additional
   replacement tags should be handled in the include file for the current page,
   in a function named replaceTags(&$content). This function will alter the
   $content variable directly, rather than change it and then return it.
*/
$searches = array('[myPage]' => $curPage, '[pageTitle]' => $pageTitle, '[styleSheet]' => $styleSheet, '[mediaType]' => $mediaType, '[upperScripts]' => $upperScripts, '[logo]' => $logo, '[pageTitleInfo]' => $pageTitleInfo, '[topNav]' => $topNav, '[leftNav]' => $leftNav, '[rightNav]' => $rightNav, '[main]' => $main, '[rightNav]' => $rightNav, '[footer]' => $footer, '[lowerScripts]' => $lowerScripts, '[pageTitleInfo]' => $pageTitleInfo, '[titleSpan]' => $titleSpan, '[divDecoration]' => $divDecoration, '[topNavLinks]' => $topNavLinks, '[navHeader]' => $navHeader, '[leftNavLinks]' => $leftNavLinks, '[mainTitle]' => $mainTitle, '[mainContent]' => $mainContent, '[rightNavLinks]' => $rightNavLinks, '[FooterInfo]' => $FooterInfo, '[headerTitle]' => $headerTitle, '[errMsg]' => $msg, '[bot_id]' => $bot_id, '[bot_name]' => $bot_name, '[errMsgStyle]' => $errMsgStyle, '[noRightNav]' => $noRightNav, '[noLeftNav]' => $noLeftNav, '[version]' => $version);
foreach ($searches as $search => $replace) {
    $content = str_replace($search, $replace, $content);
}
$content = str_replace('[myPage]', $curPage, $content);
$content = str_replace('[divDecoration]', $divDecoration, $content);
$content = str_replace('[blank]', '', $content);
if (function_exists('replaceTags')) {
    replaceTags($content);
}
// Handle any extra replacement tags, as needed.
#die ('<pre>' . print_r($_SESSION, true) . "</pre><br />\ndisplay = $hide_logo<br />\n");
exit($content);
function makeLinks($section, $linkArray, $spaces = 2)
{
    #print "<!-- making links for section $section -->\n";
    global $template, $curPage;
    $curPage = empty($curPage) ? 'main' : $curPage;
    $botName = isset($_SESSION['poadmin']['bot_name']) ? $_SESSION['poadmin']['bot_name'] : 'unknown';
    $out = '';
    # [linkClass][linkHref][linkOnclick][linkAlt][linkTitle]>[linkLabel]
    $linkText = $template->getSection('NavLink');
    foreach ($linkArray as $needle) {
        $tmp = $linkText;
Esempio n. 11
0
         foreach ($optionsDetails as $name => $details) {
             // Check we're allowed to choose
             if (!empty($details['force'])) {
                 continue;
             }
             // Should the checkbox be checked
             if (isset($options[$name])) {
                 $checked = $options[$name] ? ' checked="checked"' : '';
             } else {
                 $checked = $details['default'] ? ' checked="checked"' : '';
             }
             // Add to array
             $toShow[] = array('name' => $name, 'title' => $details['title'], 'checked' => $checked);
         }
         // Add the form
         $parserOptions['addForm'] = replaceTags(loadTemplate('framedForm.inc', array('url' => $toLoad, 'toShow' => $toShow, 'return' => urlencode(currentURL()))));
     }
     // Parse HTML
     $fetch->return = parseHTML($fetch->return, $fullDoc);
     // Encode the whole page?
     if ($options['encodePage']) {
         $fetch->return = encodeSource($fetch->return);
     }
     break;
     # CSS document
 # CSS document
 case 'css':
     $fetch->return = parseCSS($fetch->return);
     break;
     # Javascript document
 # Javascript document