コード例 #1
0
ファイル: admin.php プロジェクト: madnerdTRASH/webmanage
 //CREATE USER
 /////////////////////
 // Vérifie que les informations ont été correctement entrer
 $pass = trim($_POST['pass']);
 $login = $_POST['login'];
 $login = str_replace('"', '', $login);
 $login = str_replace("'", '', $login);
 $login = trim($login);
 $pass_confirm = trim($_POST['pass_confirm']);
 if ($pass == "" || $login == "" || $pass_confirm == "") {
     // DO NOTHING (car on ne peut pas deviner si y a eu un post
 } else {
     if ($pass == $pass_confirm) {
         //VERIFICATION existance du login
         $log = new logmein();
         $login_existence = $log->check_login($login);
         if ($login_existence["useremail"] == $login) {
             title('<img src="/img/info.png" height="32" width="32" ><font color="#990000">Ce login existe déjà</font>');
         } else {
             $username = $login;
             $password = md5($pass);
             $log = new logmein();
             $log->create_login($username, $password);
         }
     } else {
         title('<img src="/img/info.png" height="32" width="32" > <font color="#990000">Vous avez rentré un mot de passe différent</font>');
     }
 }
 /////////////////////////
 //CREATE USER END
 ////////////////////////
コード例 #2
0
ファイル: user.php プロジェクト: madnerdTRASH/webmanage
<?php

include "/func/func.php";
include "/func/class.login.php";
// LOGIN START
$log = new logmein();
$log->encrypt = true;
//set encryption
//parameters are(SESSION, name of the table, name of the password field, name of the username field)
if ($log->logincheck($_SESSION['loggedin'], "logon", "password", "useremail") == false) {
    echo '<meta http-equiv="refresh" content="0; URL=index.php">';
} else {
    //LOGIN END
    $user = $_GET["user"];
    $log = new logmein();
    $login_existence = $log->check_login($_GET["user"]);
    if ($login_existence["useremail"] !== $_GET["user"]) {
        echo '<meta http-equiv="refresh" content="0; URL=admin.php">';
    } else {
        // Vérifie sur un utilisateur a été spécifié
        if (!isset($user)) {
            echo '<meta http-equiv="refresh" content="0; URL=admin.php">';
        } else {
            ////////////////////////
            //CHANGE USER NAME
            ////////////////////////
            if (isset($_POST["username_box"])) {
                $login = $_POST['username_box'];
                $login = str_replace('"', '', $login);
                $login = str_replace("'", '', $login);
                $login = trim($login);