Ejemplo n.º 1
0
 public function addLdapUserToDatabase($username, $password)
 {
     // figure out our context for searching
     $user = self::getLdapUser($username);
     // populate user data
     if (!empty($user)) {
         $userdata = array('username' => $username, 'pass1' => $password, 'firstname' => $user['givenname'][0], 'lastname' => $user['sn'][0], 'email' => $user['mail'][0], 'is_ldap' => 1);
         return exponent_users_create($userdata);
         //FIXME function was deprecated
     } else {
         return null;
     }
 }
Ejemplo n.º 2
0
            } else {
                $strength_error = exponent_security_checkPasswordStrength($_POST['username'], $_POST['pass1']);
                if ($strength_error != '') {
                    $post = $_POST;
                    unset($post['pass1']);
                    unset($post['pass2']);
                    $post['_formError'] = sprintf($i18n['not_strong_enough'], $strength_error);
                    exponent_sessions_set('last_POST', $post);
                    header('Location: ' . $_SERVER['HTTP_REFERER']);
                } else {
                    // Finally, check the capcha
                    if (SITE_USE_CAPTCHA && strtoupper($_POST['captcha_string']) != $capcha_real) {
                        $post = $_POST;
                        unset($post['captcha_string']);
                        $post['_formError'] = $i18n['bad_captcha'];
                        exponent_sessions_set('last_POST', $post);
                        header('Location: ' . $_SERVER['HTTP_REFERER']);
                    } else {
                        exponent_sessions_unset('capcha_string');
                        $u = exponent_users_create($_POST, null);
                        $u = exponent_users_saveProfileExtensions($_POST, $u, true);
                        exponent_users_login($_POST['username'], $_POST['pass1']);
                        exponent_flow_redirect();
                    }
                }
            }
        }
    }
} else {
    echo SITE_403_HTML;
}