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.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / templates / global / login.php
tutor / templates / global Last commit date
attachments.php 4 years ago course-archive-filter-bar.php 4 years ago login.php 4 years ago
login.php
136 lines
1 <?php
2
3 /**
4 * Display global login
5 *
6 * @since v.1.0.0
7 * @author themeum
8 * @url https://themeum.com
9 *
10 * @package TutorLMS/Templates
11 * @version 1.4.3
12 */
13
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18 ?>
19
20 <div class="tutor-login-form-wrap">
21 <?php do_action( 'tutor_before_login_form' ); ?>
22
23 <?php
24 $current_url = tutils()->get_current_url();
25 $register_page = tutor_utils()->student_register_url();
26 $query_args = array(
27 'redirect_to' => $current_url,
28 );
29 /**
30 * Get current course to make user auto enroll
31 *
32 * @since 1.9.8
33 */
34 global $post;
35 $course_id = '';
36 if ( isset( $post->post_type ) && $post->post_type == tutor()->course_post_type ) {
37 $course_id = sanitize_text_field( $post->ID );
38 $query_args['id'] = $course_id;
39 }
40 $register_url = add_query_arg( $query_args, $register_page );
41 // redirect_to
42 $args = array(
43 'echo' => true,
44 // Default 'redirect' value takes the user back to the request URI.
45 'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
46 'form_id' => 'loginform',
47 'label_username' => __( 'Username or Email Address', 'tutor' ),
48 'label_password' => __( 'Password', 'tutor' ),
49 'label_remember' => __( 'Remember Me', 'tutor' ),
50 'label_log_in' => __( 'Log In', 'tutor' ),
51 'label_create_new_account' => __( 'Create a new account', 'tutor' ),
52 'id_username' => 'user_login',
53 'id_password' => 'user_pass',
54 'id_remember' => 'rememberme',
55 'id_submit' => 'wp-submit',
56 'remember' => true,
57 'value_username' => tutils()->input_old( 'log' ),
58 // Set 'value_remember' to true to default the "Remember me" checkbox to checked.
59 'value_remember' => false,
60 'wp_lostpassword_url' => apply_filters( 'tutor_lostpassword_url', wp_lostpassword_url() ),
61 'wp_lostpassword_label' => __( 'Forgot Password?', 'tutor' ),
62 );
63
64 // action="' . esc_url( site_url( 'wp-login.php', 'login_post' ) ) . '"
65
66 // tutor_alert(null, 'warning');
67
68 ob_start();
69 tutor_nonce_field();
70 $nonce_field = ob_get_clean();
71 ?>
72
73 <form name="<?php echo esc_attr( $args['form_id'] ); ?>" id="<?php echo esc_attr( $args['form_id'] ); ?>" method="post">
74 <input type="hidden" name="tutor_course_enroll_attempt" value="<?php echo esc_html( $course_id ); ?>">
75 <?php do_action( 'tutor_login_form_start' ); ?>
76
77 <?php echo $nonce_field; ?>
78
79 <input type="hidden" name="tutor_action" value="tutor_user_login" />
80 <p class="login-username">
81 <input type="text" placeholder="<?php echo esc_html( $args['label_username'] ); ?>" name="log" id="<?php echo esc_attr( $args['id_username'] ); ?>" class="input" value="<?php echo esc_attr( $args['value_username'] ); ?>" size="20" />
82 </p>
83
84 <p class="login-password">
85 <input type="password" placeholder="<?php echo esc_html( $args['label_password'] ); ?>" name="pwd" id="<?php echo esc_attr( $args['id_password'] ); ?>" class="input" value="" size="20"/>
86 </p>
87
88 <?php
89 do_action( 'tutor_login_form_middle' );
90 do_action( 'login_form' );
91 apply_filters( 'login_form_middle', '', '' );
92 ?>
93
94
95 <div class="tutor-login-rememeber-wrap">
96 <?php if ( $args['remember'] ) : ?>
97 <p class="login-remember">
98 <label>
99 <input name="rememberme" type="checkbox" id="<?php echo esc_attr( $args['id_remember'] ); ?>"
100 value="forever" <?php echo esc_attr( $args['value_remember'] ? 'checked' : '' ); ?>
101 >
102 <?php echo esc_html( $args['label_remember'] ); ?>
103 </label>
104 </p>
105 <?php endif; ?>
106 <a href="<?php echo esc_url( $args['wp_lostpassword_url'] ); ?>">
107 <?php echo esc_html( $args['wp_lostpassword_label'] ); ?>
108 </a>
109 </div>
110
111 <?php do_action( 'tutor_login_form_end' ); ?>
112
113 <p class="login-submit">
114 <input type="submit" name="wp-submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" class="tutor-button" value="<?php echo esc_attr( $args['label_log_in'] ); ?>" />
115 <input type="hidden" name="redirect_to" value="<?php echo esc_url( $args['redirect'] ); ?>" />
116 </p>
117
118 <?php
119 if ( get_option( 'users_can_register', false ) ) {
120 ?>
121 <p class="tutor-form-register-wrap">
122 <a href="<?php echo esc_url( $register_url ); ?>">
123 <?php echo esc_html( $args['label_create_new_account'] ); ?>
124 </a>
125 </p>
126 <?php
127 }
128 ?>
129 </form>
130
131 <?php
132 // #@TODO: student_register_url() return false, it must be an valid url.
133 do_action( 'tutor_after_login_form' );
134 ?>
135 </div>
136