Ejemplo n.º 1
0
function verification_reg_data($login, $password1, $password2, $email)
{
    //++
    //Login
    $feedback = login_exist($login);
    if (!$feedback === false) {
        return $feedback;
    }
    if (strlen($login) > LOGIN_MAX_LEN) {
        $feedback = "Very long Login, Please put <=" . LOGIN_MAX_LEN . "letters.";
        return $feedback;
    } elseif (strlen($login) == 0) {
        $feedback = "Login is mising! Please put <=" . LOGIN_MAX_LEN . "letters.";
        return $feedback;
    }
    //Login
    //Password
    if (strlen($password1) > PASSWORD_MAX_LEN) {
        $feedback = "Very long Password! Please put <=" . PASSWORD_MAX_LEN . " letters.";
        return $feedback;
    } elseif (strlen($password1) == 0) {
        $feedback = "Password is mising! Please put <=" . PASSWORD_MAX_LEN . "letters.";
        return $feedback;
    }
    if (!($password1 == $password2)) {
        $feedback = "Passwords do not match! Please retype the password.";
        return $feedback;
    }
    //Password
    //E-mail
    $feedback = email_exist($email);
    if (!$feedback === false) {
        return $feedback;
    }
    if (!preg_match("|^[-0-9a-z_\\.]+@[-0-9a-z_^\\.]+\\.[a-z]{2,6}\$|i", $email)) {
        $feedback = "Incorrect Email!";
        return $feedback;
    }
    //E-mail
}
Ejemplo n.º 2
0
     if (!$prenom) {
         $erreur = 1;
         $str .= "- {$strElementsPrenomInvalide}<br>";
     }
 }
 if ($mods['ville'] == "1") {
     if (!$ville) {
         $erreur = 1;
         $str .= "- {$strElementsVilleInvalide}<br>";
     }
 }
 if (!$email || !eregi("^[a-z0-9\\._-]+@+[a-z0-9\\._-]+\\.+[a-z]{2,3}\$", $email)) {
     $erreur = 1;
     $str .= "- {$strElementsEmailInvalide}<br>";
 }
 if (email_exist($email) != 0) {
     $erreur = 1;
     $str .= "- {$strElementsEmailExistant}<br>";
 }
 if ($mods['age'] == "1") {
     if (!$age || !is_numeric($age)) {
         $erreur = 1;
         $str .= "- {$strElementsAgeInvalide}<br>";
     }
 }
 if ($mods['Osteamid'] == "1") {
     if (!$steamid) {
         $erreur = 1;
         $str .= "- {$strSIDINV}<br>";
     }
     if (!preg_match("#STEAM_[0-9]:[0-9]:[0-9]{4,}#si", $steamid)) {
Ejemplo n.º 3
0
 $smarty->assign('table_email', $table_email);
 $smarty->assign('from', false);
 if (isset($_POST['submit'])) {
     if (!empty($_POST['from']) && !empty($_POST['to'])) {
         $full_email = $_POST['from'] . "@" . $dnsname;
         if (!email_valid($_POST['from'])) {
             $smarty->assign('error_msg', 'y');
             $smarty->assign('if_email_valid', 'y');
             $smarty->assign('from', $_POST['from']);
             $smarty->assign('to', $_POST['to']);
         } else {
             if (get_forem_domain($domain_id, 'forwardings', $db) >= $max_forward && $max_forward != 0) {
                 $smarty->assign('error_msg', 'y');
                 $smarty->assign('if_error_forwds_max_reached', 'y');
             } else {
                 if (email_exist($full_email, $db, 0, 0)) {
                     $smarty->assign('error_msg', 'y');
                     $smarty->assign('if_error_email_exits', 'y');
                     $smarty->assign('full_email', 'y');
                     $smarty->assign('from', $_POST['from']);
                     $smarty->assign('to', $_POST['to']);
                 } else {
                     $eto = preg_replace("(\n|\r)", '', $_POST['to']);
                     $sql = sprintf("INSERT INTO forwardings SET efrom='%s', eto='%s', domainid='%s', access='1'", $db->escapeSimple(strtolower($full_email)), $db->escapeSimple($eto), $db->escapeSimple($_GET['did']));
                     $result =& $db->query($sql);
                     $smarty->assign('success_msg', 'y');
                     $smarty->assign('if_forward_saved', 'y');
                 }
             }
         }
     } else {
Ejemplo n.º 4
0
        if (user_exist($_POST['username']) === true) {
            $errors[] = 'Sorry,the username \'' . $_POST['username'] . '\' is already taken';
        }
        if (preg_match("/\\s/", $_POST['username']) == true) {
            $errors[] = 'Your username must not contains any space';
        }
        if (strlen($_POST['password']) < 6) {
            $errors[] = 'Your password must be at least 6 character';
        }
        if ($_POST['password'] !== $_POST['password_again']) {
            $errors[] = 'Your password do not match';
        }
        if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === false) {
            $errors[] = 'A valid email address is required';
        }
        if (email_exist($_POST['email']) === true) {
            $errors[] = 'Sorry,the email \'' . $_POST['email'] . '\' is already is in use';
        }
    }
}
function output_errors($errors)
{
    return '<ul><li>' . implode('</li><li>', $errors) . '</li></ul>';
}
?>
<div id="center">


  <h1> Register </h1>
  
<?php 
Ejemplo n.º 5
0
 $dnsname = $data['dnsname'];
 $domain_id = $_GET['did'];
 if (isset($_POST['submit'])) {
     if (!empty($_POST['address'])) {
         $full_list = $_POST['address'] . "@" . $data['dnsname'];
         if (isset($_POST['public'])) {
             $public = $_POST['public'];
         } else {
             $public = 'n';
         }
         if (!email_valid($_POST['address'])) {
             $smarty->assign('error_msg', 'y');
             $smarty->assign('if_email_valid', 'y');
             $smarty->assign('address', $_POST['address']);
         } else {
             if (email_exist($full_list, $db, 0, 0)) {
                 $smarty->assign('error_msg', 'y');
                 $smarty->assign('if_error_email_exits', 'y');
                 $smarty->assign('full_email', 'y');
                 $smarty->assign('address', $_POST['address']);
             } else {
                 $sql = sprintf("INSERT INTO lists SET address = '%s', domainid = '%s', public = '%s',access=1", $db->escapeSimple(strtolower($full_list)), $db->escapeSimple($_GET['did']), $db->escapeSimple($public));
                 $result =& $db->query($sql);
                 $smarty->assign('success_msg', 'y');
                 $smarty->assign('if_list_created', 'y');
             }
         }
     } else {
         $smarty->assign('error_msg', 'y');
         $smarty->assign('if_error_missing_input', 'y');
         $smarty->assign('address', $_POST['address']);
<?php 
include "../module/table_frame.php";
include "../" . $folderQweasd . "/url.php";
require "../" . $folderQweasd . "/hoanghung.php";
require "../" . $folderQweasd . "/common_start.php";
include "../" . $folderLib . "/func.lib.home.php";
include "../" . $folderLib . "/paging.php";
$action = $_POST['action'];
if (!empty($_POST['email']) && $action == 'check_email') {
    $mail = $_POST['email'];
    email_exist(strtolower($mail));
}
function email_exist($mail)
{
    global $tableMemberId;
    global $conn;
    $sqlMail = "SELECT email FROM {$tableMemberId} WHERE email='{$mail}'";
    $queryMail = mysql_query($sqlMail, $conn);
    if (mysql_num_rows($queryMail) > 0) {
        echo "Email đã tồn tại.";
        return false;
    } else {
        echo "";
    }
}
//kiem tra mat khau
if (!empty($_POST['pwd'])) {
    $pwd = md5($_POST['pwd']);
    $email = $_POST['email_pwd'];
    pwd_exist($pwd, $email);
}
Ejemplo n.º 7
0
<?php

require "config.php";
//validation before entery
//check if sesseions are set
if (!empty($_GET['email']) && !empty($_GET['code'])) {
    $email = $_GET['email'];
    $code = $_GET['code'];
    //check if email exists in database
    if (email_exist($email) && verify_activation_code($code)) {
        activate_member($email);
        echo "Congrats! Activation is successful.<a href='index.php'>Click here to login</a>";
    } else {
        die(" Could not activate {$email} we are sorry ");
    }
} else {
    die("Sorry you are not allowed here at this time. Missing variables");
}
Ejemplo n.º 8
0
{
    return '<ul><li>' . implode('</li><li>', $errors) . '</li></ul>';
}
if (empty($_POST) === false) {
    $required_fields = array('first_name', 'email');
    foreach ($_POST as $key => $value) {
        if (empty($value) && in_array($key, $required_fields) === true) {
            $errors[] = 'Fields marked with an asterisk are required';
            break 1;
        }
    }
    if (empty($errors) === true) {
        if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === false) {
            $errors[] = 'A valid email address is required';
        } else {
            if (email_exist($_POST['email'] === true)) {
                $errors[] = 'Sorry,the email \'' . $_POST['email'] . '\' is already is in use';
            }
        }
    }
}
?>
	
<div id="center">
<h1>Settings</h1>
<?php 
if (isset($_GET['success']) && empty($_GET['success'])) {
    echo ' <b> <a href ="logout.php">Log out </a> </b> &nbsp  &nbsp';
    echo ' <b><a href ="changepassword.php">Change Password </a> </b> &nbsp  &nbsp';
    echo '<b> <a href="settings.php">Settings</a></b>&nbsp  &nbsp';
    ?>