コード例 #1
0
ファイル: cluster-E.php プロジェクト: Jireck-npds/npds_dune
function V_secur_cluster($Xkey)
{
    global $ModPath;
    $ModPath = str_replace("..", "", $ModPath);
    $trouve = false;
    if (file_exists("modules/{$ModPath}/data-cluster-E.php")) {
        include "modules/{$ModPath}/data-cluster-E.php";
        $cpt = 0;
        while (each($part) and !$trouve) {
            if (md5($part[$cpt]["WWW"] . $part[$cpt]["KEY"]) == decryptK($Xkey, $part[$cpt]["KEY"])) {
                $trouve = true;
            } else {
                $cpt = $cpt + 1;
            }
        }
    }
    if ($trouve) {
        return $part[$cpt];
    } else {
        return false;
    }
}
コード例 #2
0
ファイル: mainfile.php プロジェクト: npds/npds_dune
function decrypt($txt)
{
    global $NPDS_Key;
    return decryptK($txt, $NPDS_Key);
}
コード例 #3
0
ファイル: carnet.php プロジェクト: npds/npds_dune
 echo import_css($tmp_theme, $language, $site_font, "", "");
 include "lib/formhelp.java.php";
 $fic = "users_private/" . $userdata[1] . "/mns/carnet.txt";
 echo "\n\n   </head>\n\n   <body topmargin=\"2\" bottommargin=\"2\" leftmargin=\"2\" rightmargin=\"2\" style=\"background-color: #FFFFFF;\">";
 if (file_exists($fic)) {
     $fp = fopen($fic, "r");
     if (filesize($fic) > 0) {
         $contents = fread($fp, filesize($fic));
     }
     fclose($fp);
     if (substr($contents, 0, 5) != "CRYPT") {
         $fp = fopen($fic, "w");
         fwrite($fp, "CRYPT" . L_encrypt($contents));
         fclose($fp);
     } else {
         $contents = decryptK(substr($contents, 5), substr($userdata[2], 8, 8));
     }
     echo '<table width="100%">';
     $contents = explode("\n", $contents);
     foreach ($contents as $tab) {
         $tabi = explode(';', $tab);
         if ($tabi[0] != '') {
             $rowcolor = tablos();
             echo "\n               <tr {$rowcolor}>\n               <td nowrap=\"nowrap\">&nbsp;<a href=\"javascript: DoAdd(1,'to_user','{$tabi['0']},')\";><b>{$tabi['0']}</b></a></td>\n               <td nowrap=\"nowrap\"><a href=\"mailto:{$tabi['1']}\" class=\"noir\"><b>{$tabi['1']}</a></td>\n               <td nowrap=\"nowrap\">{$tabi['2']}&nbsp;</td>\n               </tr>\n";
         }
     }
     echo '</table>';
 } else {
     echo "<table width=\"100%\"><tr><td>";
     echo "<span class=\"noir\">" . translate("You can upload a file carnet.txt in your Mini-Web site") . ".<br />" . translate("The data structure of any line : name_of_the_member;email;comments") . "</span>";
     echo "</td></tr></table>";
コード例 #4
0
ファイル: user.php プロジェクト: Jireck-npds/npds_dune
function update_password($code, $passwd)
{
    global $system;
    global $NPDS_Prefix;
    $ibid = explode("#fpwd#", $code);
    $uname = urlencode(decrypt($ibid[0]));
    $result = sql_query("SELECT email,pass FROM " . $NPDS_Prefix . "users WHERE uname='{$uname}'");
    list($email, $pass) = sql_fetch_row($result);
    if ($email != "") {
        $ibid = explode("#fpwd#", decryptK($ibid[1], $pass));
        if ($email == $ibid[0]) {
            // Le lien doit avoir ÈtÈ gÈnÈrÈ dans les 24H00
            if (time() - $ibid[2] < 86400) {
                // le mot de passe est-il identique
                if ($ibid[1] == $passwd) {
                    if (!$system) {
                        $cryptpass = crypt($ibid[1], $ibid[1]);
                    } else {
                        $cryptpass = $ibid[1];
                    }
                    sql_query("UPDATE " . $NPDS_Prefix . "users SET pass='******' WHERE uname='{$uname}'");
                    message_pass("<p class=\"lead text-xs-center\"><i class=\"fa fa-exclamation\"></i>&nbsp;" . translate("Password update, please re-connect you.") . "</p>");
                    Ecr_Log("security", "Lost_password_update OK : " . $uname, "");
                } else {
                    message_pass(translate("Error"));
                    Ecr_Log("security", "Lost_password_update Password not match : " . $uname, "");
                }
            } else {
                message_pass(translate("Error"));
                Ecr_Log("security", "Lost_password_update NOK Time > 24H00 : " . $uname, "");
            }
        } else {
            message_pass(translate("Error"));
            Ecr_Log("security", "Lost_password_update NOK Mail not match : " . $uname, "");
        }
    } else {
        message_pass(translate("Error"));
        Ecr_Log("security", "Lost_password_update NOK Empty Mail or bad user : "******"");
    }
}