Skip to content

Commit

Permalink
v1.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbot committed Jan 12, 2024
1 parent dcf3f4f commit 42c63da
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 29 deletions.
8 changes: 8 additions & 0 deletions includes/Templates/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function get_template(): void {
$error_string .= '<p class="error">' . $error[0] . '</p>';
}
} else {
wp_set_current_user( $user->ID );
$this->login_success( $user );
exit;
}
Expand All @@ -66,6 +67,13 @@ public function get_template(): void {
private function login_success( WP_User $user ) {
$auth_service = Auth::instance();
$user_data = $auth_service->get_user_data( $user );
$stores = array_map(
function ( $store ) {
return $store->get_data();
},
wcpos_get_stores()
);
$user_data['stores'] = $stores;
$credentials = wp_json_encode( $user_data );

echo '<script>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wcpos/woocommerce-pos",
"version": "1.4.3",
"version": "1.4.4",
"description": "A simple front-end for taking WooCommerce orders at the Point of Sale.",
"main": "index.js",
"workspaces": {
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: kilbot
Tags: cart, e-commerce, ecommerce, inventory, point-of-sale, pos, sales, sell, shop, shopify, store, vend, woocommerce, wordpress-ecommerce
Requires at least: 5.6 & WooCommerce 5.3
Tested up to: 6.4
Stable tag: 1.4.3
Stable tag: 1.4.4
License: GPL-3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -63,6 +63,9 @@ There is more information on our website at [https://wcpos.com](https://wcpos.co

== Changelog ==

= 1.4.4 - 2024/01/12 =
* Desktop App: fix login for Desktop Application v1.4.0

= 1.4.3 - 2024/01/12 =
* Pro: fix update notification for Pro plugin

Expand Down
50 changes: 25 additions & 25 deletions templates/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
do_action( 'login_head' );
$login_header_url = apply_filters( 'login_headerurl', __( 'https://wordpress.org/', 'login' ) );
$login_header_title = apply_filters( 'login_headertitle', __( 'Powered by WordPress', 'login' ) );
$classes = array( 'login-action-login', 'wp-core-ui' );
if ( is_rtl() ) {
$classes[] = 'rtl';
}
$classes[] = ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
$classes = apply_filters( 'login_body_class', $classes, 'login' );
$classes = array( 'login-action-login', 'wp-core-ui' );
if ( is_rtl() ) {
$classes[] = 'rtl';
}
$classes[] = ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
$classes = apply_filters( 'login_body_class', $classes, 'login' );
?>
</head>
<body class="login no-js <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
Expand All @@ -31,21 +31,21 @@
</script>
<?php do_action( 'login_header' ); ?>
<div id="login">
<h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
<h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>

<?php
// Login message filter.
$message = apply_filters( 'login_messages', '' );
<?php
// Login message filter.
$message = apply_filters( 'login_messages', '' );

if ( ! empty( $message ) ) {
echo '<p class="message">' . $message . '</p>' . "\n";
}
if ( ! empty( $message ) ) {
echo '<p class="message">' . $message . '</p>' . "\n";
}

if ( ! empty( $error_string ) ) {
echo '<div id="login_error">' . $error_string . '</div>';
}
?>
<form name="loginform" id="loginform" action="" method="post">
if ( ! empty( $error_string ) ) {
echo '<div id="login_error">' . $error_string . '</div>';
}
?>
<form name="loginform" id="loginform" action="" method="post">
<p>
<label for="user_login"><?php _e( 'Username or Email Address' ); ?></label>
<input type="text" name="log" id="user_login" class="input" value="" size="20" autocapitalize="off" autocomplete="username" required="required" />
Expand All @@ -60,14 +60,14 @@
</button>
</div>
</div>
<?php do_action( 'login_form' ); ?>
<?php wp_nonce_field( 'woocommerce_pos_login' ); ?>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="Log In">
</p>
</form>
<?php do_action( 'login_form' ); ?>
<?php wp_nonce_field( 'woocommerce_pos_login' ); ?>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="Log In">
</p>
</form>

<?php do_action( 'login_footer' ); ?>
<?php do_action( 'login_footer' ); ?>
</div>

<div class="clear"></div>
Expand Down
4 changes: 2 additions & 2 deletions woocommerce-pos.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WooCommerce POS
* Plugin URI: https://wordpress.org/plugins/woocommerce-pos/
* Description: A simple front-end for taking WooCommerce orders at the Point of Sale. Requires <a href="http://wordpress.org/plugins/woocommerce/">WooCommerce</a>.
* Version: 1.4.3
* Version: 1.4.4
* Author: kilbot
* Author URI: http://wcpos.com
* Text Domain: woocommerce-pos
Expand All @@ -22,7 +22,7 @@
namespace WCPOS\WooCommercePOS;

// Define plugin constants.
const VERSION = '1.4.3';
const VERSION = '1.4.4';
const PLUGIN_NAME = 'woocommerce-pos';
const SHORT_NAME = 'wcpos';
\define( __NAMESPACE__ . '\PLUGIN_FILE', plugin_basename( __FILE__ ) ); // 'woocommerce-pos/woocommerce-pos.php'
Expand Down

0 comments on commit 42c63da

Please sign in to comment.