Esempio n. 1
0
*/
include "conf.php";
if (isset($_REQUEST['username'])) {
    $username = $_REQUEST['username'];
    if (isset($_REQUEST['userkey'])) {
        $userkey = $_REQUEST['userkey'];
    } else {
        die("Userkey required.");
    }
    $clean_username = clean_up_input($username);
    if (username_taken($clean_username) == 0) {
        show_header();
        echo "Sorry, that username does not exist.\n";
        echo "</body></html>\n";
        die;
    }
    $myFile = "tmp/" . $clean_username . ".ukf";
    $fh = fopen($myFile, 'r') or die("Can't open user key verification.");
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    if ($theData != $userkey) {
        die("Invalid user key.");
    }
    unlink($myFile);
    confirm_user($clean_username);
    show_header();
    echo "Your account for " . $clean_username . " is now confirmed. You may now login using the link above to start registering domains.";
    echo "</body></html>\n";
} else {
    die("Data error.");
}
Esempio n. 2
0
    }
    if ($authplugin->user_exists($user->username) && $authplugin->user_login($user->username, $user->password)) {
        // Password Election and Verification
        if (isset($user->password) && $passwd) {
            // Password Param included here
            $user->password = hash_internal_user_password($user->password);
        }
        if (!($user->id = insert_record('user', $user))) {
            // Create a new user record for this user
            error("Create new user account failed! Please contact the site administrator...");
        }
        if (isset($changeme) && $changeme || !empty($authplugin->config->forcechangepassword)) {
            // Make em set a new password on inital login.
            set_user_preference('auth_forcepasswordchange', true, $user->id);
        }
        // Log in now with a new profile
        $user = authenticate_user_login($user->username, $passwd);
        // returns $USER object on success
        if ($user) {
            // user exists in mdl_user table
            confirm_user($user);
        }
        // comfirms registration and redirects to page with session
    } else {
        // Somting went wrong with user creation!
        error_log("LDAP URL SSO plugin could not verify Ext Auth entry for user: "******"<p style='color: red; text-align: center;'>Invalid login, please try again!</p>");
redirect($authplugin->config->ldapsso_failed_login_url, 'Login Error!', 2);