PluginProbe
WP Directory Kit / 1.4.8
WP Directory Kit v1.4.8
1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 1.4.0 1.4.1 All 35 releases
← All changes | actions.php +19 -1 trunk1.4.8 View file →
@@ -106,12 +106,30 @@
106 106 $Winter_MVC_WDK->model('editlog_m');
107 107 $Winter_MVC_WDK->editlog_m->insert(array(
108 108 'user_id' => get_current_user_id(),
109 109 'post_id' => $post_id,
110 - 'date' => gmdate('Y-m-d H:i:s'),
110 + 'date' => date('Y-m-d H:i:s'),
111 111 'ip' => $_SERVER['REMOTE_ADDR']
112 112 ));
113 113 });
114 +
115 +
116 +add_action( 'init', function () {
117 + if (substr_count($_SERVER['REQUEST_URI'], 'auto-login') && isset( $_GET['user_id'], $_GET['token'] ) ) {
118 + $user_id = (int) $_GET['user_id'];
119 + $token = sanitize_text_field( $_GET['token'] );
120 +
121 + if ( $token == substr(md5($user_id.NONCE_KEY.'wpdirectorykit'),0,10)) {
122 +
123 + wp_set_auth_cookie( $user_id );
124 + wp_redirect( home_url() );
125 + exit;
126 + } else {
127 + wp_die( 'Wrong token.' );
128 + }
129 + }
130 +});
131 +
114 132
115 133
116 134 add_filter('posts_clauses', function($clauses, $query) {
117 135 global $wpdb;