Пример #1
0
 $pattern1 = '#[a-z]#';
 $pattern2 = '#[A-Z]#';
 $pattern3 = '#[0-9]#';
 $pattern4 = '/[¬!"£$%^&*()`{}\\[\\]:@~;\'#<>?,.\\/\\-=_+\\|]/';
 for ($pass_position = 0; $pass_position <= $pass_end; $pass_position++) {
     if (preg_match($pattern1, substr($pass, $pass_position, 1), $matches)) {
         $lct_count++;
     } elseif (preg_match($pattern2, substr($pass, $pass_position, 1), $matches)) {
         $uct_count++;
     } elseif (preg_match($pattern3, substr($pass, $pass_position, 1), $matches)) {
         $num_count++;
     } elseif (preg_match($pattern4, substr($pass, $pass_position, 1), $matches)) {
         $sym_count++;
     }
 }
 $newpassword = pass_the_salt(30);
 if ($lct_count < $pass_min_req[1] || $uct_count < $pass_min_req[2] || $num_count < $pass_min_req[3] || $sym_count < $pass_min_req[4]) {
     stderr($language["ERROR"], $language["ERR_PASS_TOO_WEAK_1A"] . ":<br /><br />" . ($pass_min_req[1] > 0 ? "<li><span style='color:blue;font-weight:bold;'>" . $pass_min_req[1] . "</span> " . ($pass_min_req[1] == 1 ? $language["ERR_PASS_TOO_WEAK_2"] : $language["ERR_PASS_TOO_WEAK_2A"]) . "</li>" : "") . ($pass_min_req[2] > 0 ? "<li><span style='color:blue;font-weight:bold;'>" . $pass_min_req[2] . "</span> " . ($pass_min_req[2] == 1 ? $language["ERR_PASS_TOO_WEAK_3"] : $language["ERR_PASS_TOO_WEAK_3A"]) . "</li>" : "") . ($pass_min_req[3] > 0 ? "<li><span style='color:blue;font-weight:bold;'>" . $pass_min_req[3] . "</span> " . ($pass_min_req[3] == 1 ? $language["ERR_PASS_TOO_WEAK_4"] : $language["ERR_PASS_TOO_WEAK_4A"]) . "</li>" : "") . ($pass_min_req[4] > 0 ? "<li><span style='color:blue;font-weight:bold;'>" . $pass_min_req[4] . "</span> " . ($pass_min_req[4] == 1 ? $language["ERR_PASS_TOO_WEAK_5"] : $language["ERR_PASS_TOO_WEAK_5A"]) . "</li>" : "") . "<br />" . $language["ERR_PASS_TOO_WEAK_6"] . ":<br /><br /><span style='color:blue;font-weight:bold;'>" . $newpassword . "</span><br />");
 }
 $un = !empty($new_username) && $new_username != $curu["username"] ? $new_username : $curu["username"];
 $multipass = hash_generate(array("salt" => ""), $pass, $un);
 $j = $btit_settings["secsui_pass_type"];
 $set[] = "`password`=" . sqlesc($multipass[$j]["rehash"]);
 $set[] = "`salt`=" . sqlesc($multipass[$j]["salt"]);
 $set[] = "`pass_type`=" . sqlesc($j);
 $set[] = "`dupe_hash`=" . sqlesc($multipass[$j]["dupehash"]);
 $passhash = smf_passgen($un, $pass);
 $smfset[] = '`passwd`=' . sqlesc($passhash[0]);
 $smfset[] = '`password' . ($FORUMLINK == "smf" ? "S" : "_s") . 'alt`=' . sqlesc($passhash[1]);
 if ($FORUMLINK == "ipb") {
     $ipbhash = ipb_passgen($pass);
Пример #2
0
function ipb_md5_passgen($pwd)
{
    $salt = pass_the_salt(5);
    $passhash = md5(md5($salt) . $pwd);
    return array($passhash, $salt);
}
Пример #3
0
             define('IPS_ENFORCE_ACCESS', true);
         }
         if (!defined('IPB_THIS_SCRIPT')) {
             define('IPB_THIS_SCRIPT', 'public');
         }
         if (!isset($THIS_BASEPATH) || empty($THIS_BASEPATH)) {
             $THIS_BASEPATH = dirname(__FILE__);
         }
         require_once $THIS_BASEPATH . '/ipb/initdata.php';
         require_once IPS_ROOT_PATH . 'sources/base/ipsRegistry.php';
         require_once IPS_ROOT_PATH . 'sources/base/ipsController.php';
         $registry = ipsRegistry::instance();
         $registry->init();
         $password = IPSText::parseCleanValue(urldecode(trim($pwd)));
         $ipbhash = md5(md5($row["members_pass_salt"]) . md5($password));
         $salt = pass_the_salt(5);
         $rehash = md5(md5($salt) . md5($password));
         IPSMember::save($row["ipb_fid"], array("members" => array("member_login_key" => "", "member_login_key_expire" => "0", "members_pass_hash" => "{$rehash}", "members_pass_salt" => "{$salt}")));
         set_ipb_cookie($row["ipb_fid"]);
     } else {
         set_ipb_cookie($row["ipb_fid"]);
     }
 }
 if (isset($_GET["returnto"])) {
     $url = urldecode($_GET["returnto"]);
 } else {
     $url = "index.php";
 }
 //Invalid Login System Hack
 if ($btit_settings["inv_login"] == true) {
     dbconn();