Esempio n. 1
0
/**
 * clean
 *
 * @since 1.2.1
 * @deprecated 2.0.0
 *
 * @package Redaxscript
 * @category Clean
 * @author Henry Ruhs
 *
 * @param string $input
 * @param integer $mode
 * @return string
 */
function clean($input = '', $mode = '')
{
    $output = $input;
    /* if untrusted user */
    if (FILTER == 1) {
        if ($mode == 0) {
            $output = clean_special($output);
        }
        if ($mode == 1) {
            $output = clean_script($output);
            $output = clean_html($output);
        }
    }
    /* type related clean */
    if ($mode == 2) {
        $output = clean_alias($output);
    }
    if ($mode == 3) {
        $output = clean_email($output);
    }
    if ($mode == 4) {
        $output = clean_url($output);
    }
    /* mysql clean */
    $output = clean_mysql($output);
    return $output;
}
Esempio n. 2
0
/**
 * anchor element
 *
 * @since 1.2.1
 * @deprecated 2.0.0
 *
 * @package Redaxscript
 * @category Generate
 * @author Henry Ruhs
 *
 * @param string $type
 * @param string $id
 * @param string $class
 * @param string $name
 * @param string $value
 * @param string $title
 * @param string $code
 * @return string
 */
function anchor_element($type = '', $id = '', $class = '', $name = '', $value = '', $title = '', $code = '')
{
    /* build attribute strings */
    if ($id) {
        $selector_string = ' id="' . $id . '"';
    }
    if ($class) {
        $selector_string .= ' class="' . $class . '"';
    }
    if ($value) {
        $value_string = ' href="';
        /* switch type */
        switch ($type) {
            case 'external':
                $value = clean_url($value);
                break;
            case 'internal':
                $value_string .= REWRITE_ROUTE;
                break;
            case 'email':
                $value = clean_email($value);
                $value_string .= 'mailto:';
                break;
        }
        $value_string .= $value . '"';
    }
    if ($value_string == ' href=""') {
        $value_string = '';
    }
    if ($title) {
        $title_string = ' title="' . $title . '"';
    }
    if ($code) {
        $code_string = ' ' . $code;
    }
    /* collect output */
    $output = '<a' . $selector_string . $value_string . $title_string . $code_string . '>' . $name . '</a>';
    return $output;
}
Esempio n. 3
0
<?php

session_start();
require "function/config.php";
require "function/main.func.php";
require "function/login_admin.func.php";
if ($_POST) {
    $admin_mail = clean_email($_POST['a_email']);
    $admin_password = clean(protect_password($_POST["a_password"]));
    if (password_verify($admin_password, is_good_password($admin_password, $connexion_db))) {
        if (is_admin_exist($admin_mail, $admin_password, $connexion_db) === 0) {
            $not_allowed = "La combinaison email et mot de passe ne correspondent pas";
            echo 'lol';
        } else {
            header("location:admin.php");
            $_SESSION['admin'];
        }
    }
}
?>

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Connexion Admin</title>
        <meta name="description" content="content">
        <?php 
include "inc/inc.meta.php";
?>
Esempio n. 4
0
<?php

require "function/config.php";
require "function/main.func.php";
if ($_POST) {
    $email = clean_email($_POST['email']);
    if (is_mail_duplicate($email, $connexion_db) === 1) {
        $error_mail = "Vous êtes déja inscrit à la newsletter";
    } else {
        if (empty($email)) {
            $empty_input = "Vous n'avez entré aucune adresse email";
        } else {
            add_mail($email, $connexion_db);
            $cle = md5(microtime(TRUE) * 100000);
            key_mail($email, $cle, $connexion_db);
            $destinataire = $email;
            $sujet = "Activer votre compte";
            $entete = "From: inscription@newsletter.com";
            $message = 'Pour activer votre compte, veuillez cliquer sur le lien ci dessous
    ou copier/coller dans votre navigateur internet.
    http://votresite.com/activation.php?log=' . urlencode($email) . '&cle=' . urlencode($cle) . '

    ---------------
    Ceci est un mail automatique, Merci de ne pas y répondre. <a href="function/unsubscribe.func.php">Ne plus recevoir la newsletter</a>';
            mail($destinataire, $sujet, $message, $entete);
            //    mail($destinataire, $sujet, $message, $entete) ; // Envoi du mail
            //    var_dump($result);
            $valid_mail = "Votre inscription est enregistrée";
            // key_mail($email,$cle,$connexion_db);
        }
    }
Esempio n. 5
0
<?php 
        // ALERT
        $_SESSION['alert'] = "alert-danger";
        $_SESSION['msg'] = "Incorrect email or password.";
    }
}
if (isset($_POST['btn_register'])) {
    // DEFINED VALUE
    $fname = clean_alphabet($_POST['register_fname']);
    $lname = clean_alphabet($_POST['register_lname']);
    $fullname = $fname . " " . $lname;
    $email = clean_email($_POST['register_email']);
    $password = clean_alphanumeric($_POST['regeister_repassword']);
    $check = generate_alias($fullname);
    $date = current_date_sql();
    $check_email = validate_email(clean_email($_POST['register_email']));
    if ($check_email['rows'] > 0) {
        // ALERT
        $_SESSION['alert'] = "alert-danger";
        $_SESSION['msg'] = "The e-mail that you entered has been registered.";
    } else {
        if ($check['rows'] > 0) {
            $user_alias = cleanurl($fullname . $check['rows']);
        } else {
            $user_alias = cleanurl($fullname);
        }
        register_user($fname, $lname, $fullname, $email, $password, $user_alias, $date);
        //CALL FUNCTION
        $user = get_user($email, $password);
        // CONSTRUCT SESSION
        $_SESSION['user_id'] = $user['user_id'];
function sp_get_saved_input($project_id, $input_type)
{
    $project_content = get_option($project_id);
    //URL
    if (strcasecmp($input_type, 'url') == 0) {
        if ($project_content == false) {
            $project_content = get_stylesheet_directory_uri() . "/images/default_portfolio_thumb.png";
        } else {
            //clean content
            $project_content = sp_clean_url($project_content);
        }
    }
    //TEXTBOX
    if (strcasecmp($input_type, 'textbox') == 0) {
        if ($project_content == false) {
            $project_content = "Nothing written here yet.";
        } else {
            //clean content
            $project_content = clean_textbox($project_content);
        }
    }
    //EMAIL
    if (strcasecmp($input_type, 'email') == 0) {
        if ($project_content == false) {
            $project_content = "Nothing written here yet.";
        } else {
            //clean content
            $project_content = clean_email($project_content);
            if (!$project_content) {
                $project_content = "Last e-mail invalid. Please re-enter email.";
            }
        }
    }
    //TEXTAREA
    if (strcasecmp($input_type, 'textarea') == 0) {
        if ($project_content == false) {
            $project_content = "Nothing written here yet.";
        } else {
            //clean content
            $project_content = clean_textarea($project_content);
        }
    }
    //TEXT - FOR USE IN FRONT-END TEMPLATE WHEN CHECKING FOR TEXT CONTENT
    if (strcasecmp($input_type, 'text') == 0) {
        if ($project_content == false) {
            $project_content = "Nothing written here yet.";
        } else {
            //clean content
            $project_content = clean_textbox($project_content);
        }
    }
    return $project_content;
}
Esempio n. 7
0
<?php

session_start();
require "function/config.php";
require "function/main.func.php";
if (isset($_POST["add_mail"])) {
    $new_email = clean_email($_POST['add_mail']);
    if (do_not_exist($new_email, $db_connexion) == 1) {
        $email_added = "L'email à bien été ajouté à la liste";
    } else {
        $email_not_added = "L'email saisis comporte une erreur";
    }
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>title</title>
        <meta name="description" content="content">
        <?php 
include "inc/inc.meta.php";
?>
        <?php 
include "inc/inc.linkrel.php";
?>

        <link rel="stylesheet" href="src/css/app.css">
        <link rel="stylesheet" href="src/css/app.css">