setApplicationName(THIS_INSTALL_SET_TITLE); $googleClient->setClientSecret(GOOGLE_CLIENT_SECRET); $googleClient->setClientId(GOOGLE_CLIENT_ID); $googleClient->setAccessType('online'); $googleClient->setApprovalPrompt('auto'); $googleClient->setRedirectUri(BASE_URI . 'sociallogin/google/callback.php'); $googleClient->setScopes(array('profile','email')); $auth_url = $googleClient->createAuthUrl(); } /** The form was submitted */ if ($_POST) { global $dbh; $sysuser_password = $_POST['login_form_pass']; $selected_form_lang = $_POST['login_form_lang']; /** Look up the system users table to see if the entered username exists */ $statement = $dbh->prepare("SELECT * FROM " . TABLE_USERS . " WHERE user= :username OR email= :email"); $statement->execute( array( ':username' => $_POST['login_form_user'], ':email' => $_POST['login_form_user'], ) ); $count_user = $statement->rowCount(); if ($count_user > 0){ /** If the username was found on the users table */ $statement->setFetchMode(PDO::FETCH_ASSOC); while ( $row = $statement->fetch() ) { $sysuser_username = $row['user']; $db_pass = $row['password']; $user_level = $row["level"]; $active_status = $row['active']; $logged_id = $row['id']; $global_name = $row['name']; } $check_password = $hasher->CheckPassword($sysuser_password, $db_pass); if ($check_password) { //if ($db_pass == $sysuser_password) { if ($active_status != '0') { /** Set SESSION values */ $_SESSION['loggedin'] = $sysuser_username; $_SESSION['userlevel'] = $user_level; $_SESSION['lang'] = $selected_form_lang; /** * Language cookie * TODO: Implement. * Must decide how to refresh language in the form when the user * changes the language
*/?>
Google Signin