715a509ae0714ef97a03293eL14">14
-        <input type='text' name='idCard' class='form-control' placeholder='หมายเลขบัตรประชาชน' required />
15
-        <br>
14
+        <!-- 
15
+        <input type='text' name='idCard' class='form-control' placeholder='หมายเลขบัตรประชาชน' required /> 
16
+        <br> -->
17
+        <label>วันเกิด</label>
16 18
         <input type='date' name='bd' class='form-control' placeholder='วันเกิด' required />
17 19
         <br>
18 20
         <textarea name='address' class='form-control' placeholder='ที่อยู่' required></textarea>  
@@ -24,7 +26,7 @@
24 26
         <input type='text' name='line_id' class='form-control' placeholder='Line ID'/>
25 27
         <br>
26 28
         <label>อัพโหลดภาพ</label>
27
-        <input type="file" name='photo' accept="image/*;capture=camera" class='form-control' required> </br>
29
+        <input type="file" name='photo' accept="image/*;capture=camera" class='form-control'> </br>
28 30
         <span class="glyphicon glyphicon-map-marker"></span>
29 31
         <a class='btn btn-primary form-control' id="currentLocationBtn">
30 32
         <i class="bi bi-geo-alt-fill"></i>

+ 6 - 1
app/front/views.py

@@ -10,7 +10,7 @@ def index(request):
10 10
         p = Patient()
11 11
         p.first_name = request.POST.get('firstName')
12 12
         p.last_name = request.POST.get('lastName')
13
-        p.idcard = request.POST.get('idCard')
13
+        #p.idcard = request.POST.get('idCard')
14 14
         p.address = request.POST.get('address')
15 15
         p.geolocation = request.POST.get('geo')
16 16
         p.birth_date = request.POST.get('bd')
@@ -25,3 +25,8 @@ def index(request):
25 25
 
26 26
 def success(request):
27 27
     return render(request, 'front/success.html')
28
+
29
+def my404(request,exception):
30
+    return render(request, 'front/404.html')
31
+    #return redirect("index")
32
+

BIN
app/shaqfindbed/__pycache__/settings.cpython-39.pyc


BIN
app/shaqfindbed/__pycache__/urls.cpython-39.pyc


+ 1 - 1
app/shaqfindbed/settings.py

@@ -25,7 +25,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
25 25
 SECRET_KEY = 'django-insecure-!=!d6rsewcddw=hr-j46#))^nd-32(kkjmnpxxioi(v&c9!*xn'
26 26
 
27 27
 # SECURITY WARNING: don't run with debug turned on in production!
28
-DEBUG = True
28
+DEBUG = False
29 29
 
30 30
 ALLOWED_HOSTS = [
31 31
     "167.71.218.44",

+ 5 - 0
app/shaqfindbed/urls.py

@@ -18,13 +18,18 @@ from django.urls import path, include
18 18
 from django.conf import settings
19 19
 from django.conf.urls import url
20 20
 from django.conf.urls.static import static
21
+from django.views.static import serve
22
+
21 23
 
22 24
 urlpatterns = [
23 25
     path('', include('front.urls')),
24 26
     path('backend/', include('backend.urls')),
25 27
     path('admin/', admin.site.urls),
26 28
     url(r'^chaining/', include('smart_selects.urls')),
29
+    url(r'^media/(?P<path>.*)$', serve,{'document_root': settings.MEDIA_ROOT}),
27 30
 ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
28 31
 
32
+
29 33
 if settings.DEBUG:
30 34
     urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
35
+handler404 = 'front.views.my404'

+ 162 - 0
app/staticfile/autocomplete_light/autocomplete.init.js

@@ -0,0 +1,162 @@
1
+/*
2
+This script garantees that this will be called once in django admin.
3
+However, its the callback's responsability to clean up if the
4
+element was cloned with data - which should be the case.
5
+*/
6
+
7
+;(function ($) {
8
+    $.fn.getFormPrefix = function() {
9
+        /* Get the form prefix for a field.
10
+         *
11
+         * For example:
12
+         *
13
+         *     $(':input[name$=owner]').getFormsetPrefix()
14
+         *
15
+         * Would return an empty string for an input with name 'owner' but would return
16
+         * 'inline_model-0-' for an input named 'inline_model-0-owner'.
17
+         */
18
+        var parts = $(this).attr('name').split('-');
19
+        var prefix = '';
20
+
21
+        for (var i in parts) {
22
+            var testPrefix = parts.slice(0, -i).join('-');
23
+            if (! testPrefix.length) continue;
24
+            testPrefix += '-';
25
+
26
+            var result = $(':input[name^=' + testPrefix + ']')
27
+
28
+            if (result.length) {
29
+                return testPrefix;
30
+            }
31
+        }
32
+
33
+        return '';
34
+    }
35
+
36
+    $.fn.getFormPrefixes = function() {
37
+        /*
38
+         * Get the form prefixes for a field, from the most specific to the least.
39
+         *
40
+         * For example:
41
+         *
42
+         *      $(':input[name$=owner]').getFormPrefixes()
43
+         *
44
+         * Would return:
45
+         * - [''] for an input named 'owner'.
46
+         * - ['inline_model-0-', ''] for an input named 'inline_model-0-owner' (i.e. nested with a nested inline).
47
+         * - ['sections-0-items-0-', 'sections-0-', ''] for an input named 'sections-0-items-0-product'
48
+         *   (i.e. nested multiple time with django-nested-admin).
49
+         */
50
+        var parts = $(this).attr('name').split('-').slice(0, -1);
51
+        var prefixes = [];
52
+
53
+        for (i = 0; i < parts.length; i += 2) {
54
+            var testPrefix = parts.slice(0, -i || parts.length).join('-');
55
+            if (!testPrefix.length)
56
+                continue;
57
+
58
+            testPrefix += '-';
59
+
60
+            var result = $(':input[name^=' + testPrefix + ']')
61
+
62
+            if (result.length)
63
+                prefixes.push(testPrefix);
64
+        }
65
+
66
+        prefixes.push('');
67
+
68
+        return prefixes;
69
+    }
70
+
71
+    var initialized = [];
72
+
73
+    function initialize(element) {
74
+        if (typeof element === 'undefined' || typeof element === 'number') {
75
+            element = this;
76
+        }
77
+
78
+        if (window.__dal__initListenerIsSet !== true || initialized.indexOf(element) >= 0) {
79
+            return;
80
+        }
81
+
82
+        $(element).trigger('autocompleteLightInitialize');
83
+        initialized.push(element);
84
+    }
85
+
86
+    if (!window.__dal__initialize) {
87
+        window.__dal__initialize = initialize;
88
+
89
+        $(document).ready(function () {
90
+            $('[data-autocomplete-light-function=select2]:not([id*="__prefix__"])').each(initialize);
91
+        });
92
+
93
+        $(document).bind('DOMNodeInserted', function (e) {
94
+            $(e.target).find('[data-autocomplete-light-function=select2]').each(initialize);
95
+        });
96
+    }
97
+
98
+    // using jQuery
99
+    function getCookie(name) {
100
+        var cookieValue = null;
101
+        if (document.cookie && document.cookie != '') {
102
+            var cookies = document.cookie.split(';');
103
+            for (var i = 0; i < cookies.length; i++) {
104
+                var cookie = $.trim(cookies[i]);
105
+                // Does this cookie string begin with the name we want?
106
+                if (cookie.substring(0, name.length + 1) == (name + '=')) {
107
+                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
108
+                    break;
109
+                }
110
+            }
111
+        }
112
+        return cookieValue;
113
+    }
114
+
115
+    document.csrftoken = getCookie('csrftoken');
116
+    if (document.csrftoken === null) {
117
+        // Try to get CSRF token from DOM when cookie is missing
118
+        var $csrf = $('form :input[name="csrfmiddlewaretoken"]');
119
+        if ($csrf.length > 0) {
120
+            document.csrftoken = $csrf[0].value;
121
+        }
122
+    }
123
+})(yl.jQuery);
124
+
125
+// Does the same thing as django's admin/js/autocomplete.js, but uses yl.jQuery.
126
+(function($) {
127
+    'use strict';
128
+    var init = function($element, options) {
129
+        var settings = $.extend({
130
+            ajax: {
131
+                data: function(params) {
132
+                    return {
133
+                        term: params.term,
134
+                        page: params.page
135
+                    };
136
+                }
137
+            }
138
+        }, options);
139
+        $element.select2(settings);
140
+    };
141
+
142
+    $.fn.djangoAdminSelect2 = function(options) {
143
+        var settings = $.extend({}, options);
144
+        $.each(this, function(i, element) {
145
+            var $element = $(element);
146
+            init($element, settings);
147
+        });
148
+        return this;
149
+    };
150
+
151
+    $(function() {
152
+        // Initialize all autocomplete widgets except the one in the template
153
+        // form used when a new formset is added.
154
+        $('.admin-autocomplete').not('[name*=__prefix__]').djangoAdminSelect2();
155
+    });
156
+
157
+    $(document).on('formset:added', (function() {
158
+        return function(event, $newFormset) {
159
+            return $newFormset.find('.admin-autocomplete').djangoAdminSelect2();
160
+        };
161
+    })(this));
162
+}(yl.jQuery));

+ 191 - 0
app/staticfile/autocomplete_light/forward.js

@@ -0,0 +1,191 @@
1
+;(function($, yl) {
2
+    yl.forwardHandlerRegistry = yl.forwardHandlerRegistry || {};
3
+
4
+    yl.registerForwardHandler = function(name, handler) {
5
+        yl.forwardHandlerRegistry[name] = handler;
6
+    };
7
+
8
+    yl.getForwardHandler = function(name) {
9
+        return yl.forwardHandlerRegistry[name];
10
+    };
11
+
12
+    function getForwardStrategy(element) {
13
+        var checkForCheckboxes = function() {
14
+            var all = true;
15
+            $.each(element, function(ix, e) {
16
+                if ($(e).attr("type") !== "checkbox") {
17
+                    all = false;
18
+                }
19
+            });
20
+            return all;
21
+        };
22
+
23
+        if (element.length === 1 &&
24
+                element.attr("type") === "checkbox" &&
25
+                element.attr("value") === undefined) {
26
+            // Single checkbox without 'value' attribute
27
+            // Boolean field
28
+            return "exists";
29
+        } else if (element.length === 1 &&
30
+                element.attr("multiple") !== undefined) {
31
+            // Multiple by HTML semantics. E. g. multiple select
32
+            // Multiple choice field
33
+            return "multiple";
34
+        } else if (checkForCheckboxes()) {
35
+            // Multiple checkboxes or one checkbox with 'value' attribute.
36
+            // Multiple choice field represented by checkboxes
37
+            return "multiple";
38
+        } else {
39
+            // Other cases
40
+            return "single";
41
+        }
42
+    }
43
+
44
+    /**
45
+     * Get fields with name `name` relative to `element` with considering form
46
+     * prefixes.
47
+     * @param element the element
48
+     * @param name name of the field
49
+     * @returns jQuery object with found fields or empty jQuery object if no
50
+     * field was found
51
+     */
52
+    yl.getFieldRelativeTo = function(element, name) {
53
+        var prefixes = $(element).getFormPrefixes();
54
+
55
+        for (var i = 0; i < prefixes.length; i++) {
56
+            var fieldSelector = "[name=" + prefixes[i] + name + "]";
57
+            var field = $(fieldSelector);
58
+
59
+            if (field.length) {
60
+                return field;
61
+            }
62
+        }
63
+
64
+        return $();
65
+    };
66
+
67
+    /**
68
+     * Get field value which is put to forwarded dictionary
69
+     * @param field the field
70
+     * @returns forwarded value
71
+     */
72
+    yl.getValueFromField = function(field) {
73
+        var strategy = getForwardStrategy(field);
74
+        var serializedField = $(field).serializeArray();
75
+
76
+        if ((serializedField == false) && ($(field).prop('disabled'))) {
77
+            $(field).prop('disabled', false);
78
+            serializedField = $(field).serializeArray();
79
+            $(field).prop('disabled', true);
80
+        }
81
+
82
+        var getSerializedFieldElementAt = function (index) {
83
+            // Return serializedField[index]
84
+            // or null if something went wrong
85
+            if (serializedField.length > index) {
86
+                return serializedField[index];
87
+            } else {
88
+                return null;
89
+            }
90
+        };
91
+
92
+        var getValueOf = function (elem) {
93
+            // Return elem.value
94
+            // or null if something went wrong
95
+            if (elem.hasOwnProperty("value") &&
96
+                elem.value !== undefined
97
+            ) {
98
+                return elem.value;
99
+            } else {
100
+                return null;
101
+            }
102
+        };
103
+
104
+        var getSerializedFieldValueAt = function (index) {
105
+            // Return serializedField[index].value
106
+            // or null if something went wrong
107
+            var elem = getSerializedFieldElementAt(index);
108
+            if (elem !== null) {
109
+                return getValueOf(elem);
110
+            } else {
111
+                return null;
112
+            }
113
+        };
114
+
115
+        if (strategy === "multiple") {
116
+            return serializedField.map(
117
+                function (item) {
118
+                    return getValueOf(item);
119
+                }
120
+            );
121
+        } else if (strategy === "exists") {
122
+            return serializedField.length > 0;
123
+        } else {
124
+            return getSerializedFieldValueAt(0);
125
+        }
126
+    };
127
+
128
+    yl.getForwards = function(element) {
129
+        var forwardElem,
130
+            forwardList,
131
+            forwardedData,
132
+            divSelector,
133
+            form;
134
+        divSelector = "div.dal-forward-conf#dal-forward-conf-for-" +
135
+                element.attr("id") + ", " +
136
+                "div.dal-forward-conf#dal-forward-conf-for_" +
137
+                element.attr("id");
138
+        form = element.length > 0 ? $(element[0].form) : $();
139
+
140
+        forwardElem =
141
+            form.find(divSelector).find('script');
142
+        if (forwardElem.length === 0) {
143
+            return;
144
+        }
145
+        try {
146
+            forwardList = JSON.parse(forwardElem.text());
147
+        } catch (e) {
148
+            return;
149
+        }
150
+
151
+        if (!Array.isArray(forwardList)) {
152
+            return;
153
+        }
154
+
155
+        forwardedData = {};
156
+
157
+        $.each(forwardList, function(ix, field) {
158
+            var srcName, dstName;
159
+            if (field.type === "const") {
160
+                forwardedData[field.dst] = field.val;
161
+            } else if (field.type === "self") {
162
+                if (field.hasOwnProperty("dst")) {
163
+                    dstName = field.dst;
164
+                } else {
165
+                    dstName = "self";
166
+                }
167
+                forwardedData[dstName] = yl.getValueFromField(element);
168
+            } else if (field.type === "field") {
169
+                srcName = field.src;
170
+                if (field.hasOwnProperty("dst")) {
171
+                    dstName = field.dst;
172
+                } else {
173
+                    dstName = srcName;
174
+                }
175
+                var forwardedField = yl.getFieldRelativeTo(element, srcName);
176
+
177
+                if (!forwardedField.length) {
178
+                    return;
179
+                }
180
+
181
+                forwardedData[dstName] = yl.getValueFromField(forwardedField);
182
+            } else if (field.type === "javascript") {
183
+                var handler = yl.getForwardHandler(field.handler);
184
+                forwardedData[field.dst || field.handler] = handler(element);
185
+            }
186
+
187
+        });
188
+        return JSON.stringify(forwardedData);
189
+    };
190
+
191
+})(yl.jQuery, yl);

+ 36 - 0
app/staticfile/autocomplete_light/jquery.init.js

@@ -0,0 +1,36 @@
1
+var yl = yl || {};
2
+if (typeof django !== 'undefined' && typeof django.jQuery !== 'undefined') {
3
+    // If django.jQuery is already defined, use it.
4
+    yl.jQuery = django.jQuery;
5
+}
6
+else {
7
+    // We include jquery itself in our widget's media, because we need it.
8
+    // Normally, we expect our widget's reference to admin/js/vendor/jquery/jquery.js
9
+    // to be skipped, because django's own code has already included it.
10
+    // However, if django.jQuery is NOT defined, we know that jquery was not
11
+    // included before we did it ourselves. This can happen if we're not being
12
+    // rendered in a django admin form.
13
+    // However, someone ELSE'S jQuery may have been included before ours, in
14
+    // which case we must ensure that our jquery doesn't override theirs, since
15
+    // it might be a newer version that other code on the page relies on.
16
+    // Thus, we must run jQuery.noConflict(true) here to move our jQuery out of
17
+    // the way.
18
+    yl.jQuery = jQuery.noConflict(true);
19
+}
20
+
21
+// In addition to all of this, we must ensure that the global jQuery and $ are
22
+// defined, because Select2 requires that. jQuery will only be undefined at
23
+// this point if only we or django included it.
24
+if (typeof jQuery === 'undefined') {
25
+    jQuery = yl.jQuery;
26
+    $ = yl.jQuery;
27
+}
28
+else {
29
+    // jQuery IS still defined, which means someone else also included jQuery.
30
+    // In this situation, we need to store the old jQuery in a
31
+    // temp variable, set the global jQuery to our yl.jQuery, then let select2
32
+    // set itself up. We restore the global jQuery to its original value in
33
+    // jquery.post-setup.js.
34
+    dal_jquery_backup = jQuery.noConflict(true);
35
+    jQuery = yl.jQuery;
36
+}

+ 7 - 0
app/staticfile/autocomplete_light/jquery.post-setup.js

@@ -0,0 +1,7 @@
1
+if (typeof dal_jquery_backup !== 'undefined') {
2
+    // We made a backup of the original global jQuery before forcing it to our
3
+    // yl.jQuery value. Now that select2 has been set up, we need to restore
4
+    // our backup to its rightful place.
5
+    jQuery = dal_jquery_backup;
6
+    $ = dal_jquery_backup;
7
+}

+ 14 - 0
app/staticfile/autocomplete_light/select2.css

@@ -0,0 +1,14 @@
1
+.select2-container {
2
+    min-width: 20em;
3
+}
4
+
5
+ul li.select2-selection__choice,
6
+ul li.select2-search {
7
+    /* Cancel out django's style */
8
+    list-style-type: none;
9
+}
10
+
11
+.errors .select2-selection {
12
+    /* Highlight select box with error */
13
+    border-color: #ba2121;
14
+}

+ 122 - 0
app/staticfile/autocomplete_light/select2.js

@@ -0,0 +1,122 @@
1
+;(function ($) {
2
+    if (window.__dal__initListenerIsSet)
3
+        return;
4
+
5
+    $(document).on('autocompleteLightInitialize', '[data-autocomplete-light-function=select2]', function() {
6
+        var element = $(this);
7
+
8
+        // Templating helper
9
+        function template(text, is_html) {
10
+            if (is_html) {
11
+                var $result = $('<span>');
12
+                $result.html(text);
13
+                return $result;
14
+            } else {
15
+                return text;
16
+            }
17
+        }
18
+
19
+        function result_template(item) {
20
+            var text = template(item.text,
21
+                element.attr('data-html') !== undefined || element.attr('data-result-html') !== undefined
22
+            );
23
+
24
+            if (item.create_id) {
25
+                return $('<span></span>').text(text).addClass('dal-create')
26
+            } else {
27
+                return text
28
+            }
29
+        }
30
+
31
+        function selected_template(item) {
32
+            if (item.selected_text !== undefined) {
33
+                return template(item.selected_text,
34
+                    element.attr('data-html') !== undefined || element.attr('data-selected-html') !== undefined
35
+                );
36
+            } else {
37
+                return result_template(item);
38
+            }
39
+            return
40
+        }
41
+
42
+        var ajax = null;
43
+        if ($(this).attr('data-autocomplete-light-url')) {
44
+            ajax = {
45
+                url: $(this).attr('data-autocomplete-light-url'),
46
+                dataType: 'json',
47
+                delay: 250,
48
+
49
+                data: function (params) {
50
+                    var data = {
51
+                        q: params.term, // search term
52
+                        page: params.page,
53
+                        create: element.attr('data-autocomplete-light-create') && !element.attr('data-tags'),
54
+                        forward: yl.getForwards(element)
55
+                    };
56
+
57
+                    return data;
58
+                },
59
+                processResults: function (data, page) {
60
+                    if (element.attr('data-tags')) {
61
+                        $.each(data.results, function(index, value) {
62
+                            value.id = value.text;
63
+                        });
64
+                    }
65
+
66
+                    return data;
67
+                },
68
+                cache: true
69
+            };
70
+        }
71
+
72
+        $(this).select2({
73
+            tokenSeparators: element.attr('data-tags') ? [','] : null,
74
+            debug: true,
75
+            containerCssClass: ':all:',
76
+            placeholder: element.attr('data-placeholder') || '',
77
+            language: element.attr('data-autocomplete-light-language'),
78
+            minimumInputLength: element.attr('data-minimum-input-length') || 0,
79
+            allowClear: ! $(this).is('[required]'),
80
+            templateResult: result_template,
81
+            templateSelection: selected_template,
82
+            ajax: ajax,
83
+            tags: Boolean(element.attr('data-tags')),
84
+        });
85
+
86
+        $(this).on('select2:selecting', function (e) {
87
+            var data = e.params.args.data;
88
+
89
+            if (data.create_id !== true)
90
+                return;
91
+
92
+            e.preventDefault();
93
+
94
+            var select = $(this);
95
+
96
+            $.ajax({
97
+                url: $(this).attr('data-autocomplete-light-url'),
98
+                type: 'POST',
99
+                dataType: 'json',
100
+                data: {
101
+                    text: data.id,
102
+                    forward: yl.getForwards($(this))
103
+                },
104
+                beforeSend: function(xhr, settings) {
105
+                    xhr.setRequestHeader("X-CSRFToken", document.csrftoken);
106
+                },
107
+                success: function(data, textStatus, jqXHR ) {
108
+                    select.append(
109
+                        $('<option>', {value: data.id, text: data.text, selected: true})
110
+                    );
111
+                    select.trigger('change');
112
+                    select.select2('close');
113
+                }
114
+            });
115
+        });
116
+
117
+    });
118
+    window.__dal__initListenerIsSet = true;
119
+    $('[data-autocomplete-light-function=select2]:not([id*="__prefix__"])').each(function() {
120
+        window.__dal__initialize(this);
121
+    });
122
+})(yl.jQuery);

BIN
app/staticfile/img/heartbeat.png


+ 22 - 0
app/staticfile/import_export/action_formats.js

@@ -0,0 +1,22 @@
1
+(function($) {
2
+  $(document).ready(function() {
3
+    var $actionsSelect, $formatsElement;
4
+    if ($('body').hasClass('grp-change-list')) {
5
+        // using grappelli
6
+        $actionsSelect = $('#grp-changelist-form select[name="action"]');
7
+        $formatsElement = $('#grp-changelist-form select[name="file_format"]');
8
+    } else {
9
+        // using default admin
10
+        $actionsSelect = $('#changelist-form select[name="action"]');
11
+        $formatsElement = $('#changelist-form select[name="file_format"]').parent();
12
+    }
13
+    $actionsSelect.change(function() {
14
+      if ($(this).val() === 'export_admin_action') {
15
+        $formatsElement.show();
16
+      } else {
17
+        $formatsElement.hide();
18
+      }
19
+    });
20
+    $actionsSelect.change();
21
+  });
22
+})(django.jQuery);

+ 81 - 0
app/staticfile/import_export/import.css

@@ -0,0 +1,81 @@
1
+.import-preview .errors {
2
+  position: relative;
3
+}
4
+
5
+.validation-error-count {
6
+  display: inline-block;
7
+  background-color: #e40000;
8
+  border-radius: 6px;
9
+  color: white;
10
+  font-size: 0.9em;
11
+  position: relative;
12
+  font-weight: bold;
13
+  margin-top: -2px;
14
+  padding: 0.2em 0.4em;
15
+}
16
+
17
+.validation-error-container {
18
+  position: absolute;
19
+  opacity: 0;
20
+  pointer-events: none;
21
+  background-color: #ffc1c1;
22
+  padding: 14px 15px 10px;
23
+  top: 25px;
24
+  margin: 0 0 20px 0;
25
+  width: 200px;
26
+  z-index: 2;
27
+}
28
+
29
+table.import-preview tr.skip {
30
+  background-color: #d2d2d2;
31
+}
32
+
33
+table.import-preview tr.new {
34
+  background-color: #bdd8b2;
35
+}
36
+
37
+table.import-preview tr.delete {
38
+  background-color: #f9bebf;
39
+}
40
+
41
+table.import-preview tr.update {
42
+  background-color: #fdfdcf;
43
+}
44
+
45
+.import-preview td:hover .validation-error-count {
46
+  z-index: 3;
47
+}
48
+.import-preview td:hover .validation-error-container {
49
+  opacity: 1;
50
+  pointer-events: auto;
51
+}
52
+
53
+.validation-error-list {
54
+  margin: 0;
55
+  padding: 0;
56
+}
57
+
58
+.validation-error-list li {
59
+  list-style: none;
60
+  margin: 0;
61
+}
62
+
63
+.validation-error-list > li > ul {
64
+  margin: 8px 0;
65
+  padding: 0;
66
+}
67
+
68
+.validation-error-list > li > ul > li {
69
+  padding: 0;
70
+  margin: 0 0 10px;
71
+  line-height: 1.28em;
72
+}
73
+
74
+.validation-error-field-label {
75
+  display: block;
76
+  border-bottom: 1px solid #e40000;
77
+  color: #e40000;
78
+  text-transform: uppercase;
79
+  font-weight: bold;
80
+  font-size: 0.85em;
81
+}

+ 15 - 0
app/staticfile/js/main.js

@@ -0,0 +1,15 @@
1
+$(function(){
2
+    $("#currentLocationBtn").click(function(){
3
+        if ("geolocation" in navigator){ //check geolocation available
4
+            //try to get user current location using getCurrentPosition() method
5
+            console.log("current location");
6
+            navigator.geolocation.getCurrentPosition(function(position){
7
+                console.log("xxxx");
8
+                $("#geoText").val(position.coords.latitude+","+position.coords.longitude );
9
+
10
+            });
11
+        }else{
12
+            console.log("Browser doesn't support geolocation!");
13
+        }
14
+    });
15
+});

+ 262 - 0
app/staticfile/vendor/select2/Gruntfile.js

@@ -0,0 +1,262 @@
1
+const sass = require('node-sass');
2
+
3
+module.exports = function (grunt) {
4
+  // Full list of files that must be included by RequireJS
5
+  includes = [
6
+    'jquery.select2',
7
+    'almond',
8
+
9
+    'jquery-mousewheel' // shimmed for non-full builds
10
+  ];
11
+
12
+  fullIncludes = [
13
+    'jquery',
14
+
15
+    'select2/compat/containerCss',
16
+    'select2/compat/dropdownCss',
17
+
18
+    'select2/compat/initSelection',
19
+    'select2/compat/inputData',
20
+    'select2/compat/matcher',
21
+    'select2/compat/query',
22
+
23
+    'select2/dropdown/attachContainer',
24
+    'select2/dropdown/stopPropagation',
25
+
26
+    'select2/selection/stopPropagation'
27
+  ].concat(includes);
28
+
29
+  var i18nModules = [];
30
+  var i18nPaths = {};
31
+
32
+  var i18nFiles = grunt.file.expand({
33
+    cwd: 'src/js'
34
+  }, 'select2/i18n/*.js');
35
+
36
+  var testFiles = grunt.file.expand('tests/**/*.html');
37
+  var testUrls = testFiles.map(function (filePath) {
38
+    return 'http://localhost:9999/' + filePath;
39
+  });
40
+
41
+  var testBuildNumber = "unknown";
42
+
43
+  if (process.env.TRAVIS_JOB_ID) {
44
+    testBuildNumber = "travis-" + process.env.TRAVIS_JOB_ID;
45
+  } else {
46
+    var currentTime = new Date();
47
+
48
+    testBuildNumber = "manual-" + currentTime.getTime();
49
+  }
50
+
51
+  for (var i = 0; i < i18nFiles.length; i++) {
52
+    var file = i18nFiles[i];
53
+    var name = file.split('.')[0];
54
+
55
+    i18nModules.push({
56
+      name: name
57
+    });
58
+
59
+    i18nPaths[name] = '../../' + name;
60
+  }
61
+
62
+  var minifiedBanner = '/*! Select2 <%= package.version %> | https://github.com/select2/select2/blob/master/LICENSE.md */';
63
+
64
+  grunt.initConfig({
65
+    package: grunt.file.readJSON('package.json'),
66
+
67
+    concat: {
68
+      'dist': {
69
+        options: {
70
+          banner: grunt.file.read('src/js/wrapper.start.js'),
71
+        },
72
+        src: [
73
+          'dist/js/select2.js',
74
+          'src/js/wrapper.end.js'
75
+        ],
76
+        dest: 'dist/js/select2.js'
77
+      },
78
+      'dist.full': {
79
+        options: {
80
+          banner: grunt.file.read('src/js/wrapper.start.js'),
81
+        },
82
+        src: [
83
+          'dist/js/select2.full.js',
84
+          'src/js/wrapper.end.js'
85
+        ],
86
+        dest: 'dist/js/select2.full.js'
87
+      }
88
+    },
89
+
90
+    connect: {
91
+      tests: {
92
+        options: {
93
+          base: '.',
94
+          hostname: '127.0.0.1',
95
+          port: 9999
96
+        }
97
+      }
98
+    },
99
+
100
+    uglify: {
101
+      'dist': {
102
+        src: 'dist/js/select2.js',
103
+        dest: 'dist/js/select2.min.js',
104
+        options: {
105
+          banner: minifiedBanner
106
+        }
107
+      },
108
+      'dist.full': {
109
+        src: 'dist/js/select2.full.js',
110
+        dest: 'dist/js/select2.full.min.js',
111
+        options: {
112
+          banner: minifiedBanner
113
+        }
114
+      }
115
+    },
116
+
117
+    qunit: {
118
+      all: {
119
+        options: {
120
+          urls: testUrls
121
+        }
122
+      }
123
+    },
124
+
125
+    jshint: {
126
+      options: {
127
+        jshintrc: true,
128
+        reporterOutput: ''
129
+      },
130
+      code: {
131
+        src: ['src/js/**/*.js']
132
+      },
133
+      tests: {
134
+        src: ['tests/**/*.js']
135
+      }
136
+    },
137
+
138
+    sass: {
139
+      dist: {
140
+        options: {
141
+          implementation: sass,
142
+          outputStyle: 'compressed'
143
+        },
144
+        files: {
145
+          'dist/css/select2.min.css': [
146
+            'src/scss/core.scss',
147
+            'src/scss/theme/default/layout.css'
148
+          ]
149
+        }
150
+      },
151
+      dev: {
152
+        options: {
153
+          implementation: sass,
154
+          outputStyle: 'nested'
155
+        },
156
+        files: {
157
+          'dist/css/select2.css': [
158
+            'src/scss/core.scss',
159
+            'src/scss/theme/default/layout.css'
160
+          ]
161
+        }
162
+      }
163
+    },
164
+
165
+    requirejs: {
166
+      'dist': {
167
+        options: {
168
+          baseUrl: 'src/js',
169
+          optimize: 'none',
170
+          name: 'select2/core',
171
+          out: 'dist/js/select2.js',
172
+          include: includes,
173
+          namespace: 'S2',
174
+          paths: {
175
+            'almond': require.resolve('almond').slice(0, -3),
176
+            'jquery': 'jquery.shim',
177
+            'jquery-mousewheel': 'jquery.mousewheel.shim'
178
+          },
179
+          wrap: {
180
+            startFile: 'src/js/banner.start.js',
181
+            endFile: 'src/js/banner.end.js'
182
+          }
183
+        }
184
+      },
185
+      'dist.full': {
186
+        options: {
187
+          baseUrl: 'src/js',
188
+          optimize: 'none',
189
+          name: 'select2/core',
190
+          out: 'dist/js/select2.full.js',
191
+          include: fullIncludes,
192
+          namespace: 'S2',
193
+          paths: {
194
+            'almond': require.resolve('almond').slice(0, -3),
195
+            'jquery': 'jquery.shim',
196
+            'jquery-mousewheel': require.resolve('jquery-mousewheel').slice(0, -3)
197
+          },
198
+          wrap: {
199
+            startFile: 'src/js/banner.start.js',
200
+            endFile: 'src/js/banner.end.js'
201
+          }
202
+        }
203
+      },
204
+      'i18n': {
205
+        options: {
206
+          baseUrl: 'src/js/select2/i18n',
207
+          dir: 'dist/js/i18n',
208
+          paths: i18nPaths,
209
+          modules: i18nModules,
210
+          namespace: 'S2',
211
+          wrap: {
212
+            start: minifiedBanner + grunt.file.read('src/js/banner.start.js'),
213
+            end: grunt.file.read('src/js/banner.end.js')
214
+          }
215
+        }
216
+      }
217
+    },
218
+
219
+    watch: {
220
+      js: {
221
+        files: [
222
+          'src/js/select2/**/*.js',
223
+          'tests/**/*.js'
224
+        ],
225
+        tasks: [
226
+          'compile',
227
+          'test',
228
+          'minify'
229
+        ]
230
+      },
231
+      css: {
232
+        files: [
233
+          'src/scss/**/*.scss'
234
+        ],
235
+        tasks: [
236
+          'compile',
237
+          'minify'
238
+        ]
239
+      }
240
+    }
241
+  });
242
+
243
+  grunt.loadNpmTasks('grunt-contrib-concat');
244
+  grunt.loadNpmTasks('grunt-contrib-connect');
245
+  grunt.loadNpmTasks('grunt-contrib-jshint');
246
+  grunt.loadNpmTasks('grunt-contrib-qunit');
247
+  grunt.loadNpmTasks('grunt-contrib-requirejs');
248
+  grunt.loadNpmTasks('grunt-contrib-uglify');
249
+  grunt.loadNpmTasks('grunt-contrib-watch');
250
+
251
+  grunt.loadNpmTasks('grunt-sass');
252
+
253
+  grunt.registerTask('default', ['compile', 'test', 'minify']);
254
+
255
+  grunt.registerTask('compile', [
256
+    'requirejs:dist', 'requirejs:dist.full', 'requirejs:i18n',
257
+    'concat:dist', 'concat:dist.full',
258
+    'sass:dev'
259
+  ]);
260
+  grunt.registerTask('minify', ['uglify', 'sass:dist']);
261
+  grunt.registerTask('test', ['connect:tests', 'qunit', 'jshint']);
262
+};

+ 13 - 0
app/staticfile/vendor/select2/bower.json

@@ -0,0 +1,13 @@
1
+{
2
+    "name": "select2",
3
+    "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
4
+    "main": [
5
+        "dist/js/select2.js",
6
+        "src/scss/core.scss"
7
+    ],
8
+    "license": "MIT",
9
+    "repository": {
10
+        "type": "git",
11
+        "url": "git@github.com:select2/select2.git"
12
+    }
13
+}

+ 19 - 0
app/staticfile/vendor/select2/component.json

@@ -0,0 +1,19 @@
1
+{
2
+  "name": "select2",
3
+  "repo": "select/select2",
4
+  "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
5
+  "version": "4.0.7",
6
+  "demo": "https://select2.org/",
7
+  "keywords": [
8
+    "jquery"
9
+  ],
10
+  "main": "dist/js/select2.js",
11
+  "styles": [
12
+    "dist/css/select2.css"
13
+  ],
14
+  "scripts": [
15
+    "dist/js/select2.js",
16
+    "dist/js/i18n/*.js"
17
+  ],
18
+  "license": "MIT"
19
+}

+ 22 - 0
app/staticfile/vendor/select2/composer.json

@@ -0,0 +1,22 @@
1
+{
2
+  "name": "select2/select2",
3
+  "description": "Select2 is a jQuery based replacement for select boxes.",
4
+  "type": "component",
5
+  "homepage": "https://select2.org/",
6
+  "license": "MIT",
7
+  "extra": {
8
+    "component": {
9
+      "scripts": [
10
+        "dist/js/select2.js"
11
+      ],
12
+      "styles": [
13
+        "dist/css/select2.css"
14
+      ],
15
+      "files": [
16
+        "dist/js/select2.js",
17
+        "dist/js/i18n/*.js",
18
+        "dist/css/select2.css"
19
+      ]
20
+    }
21
+  }
22
+}

+ 484 - 0
app/staticfile/vendor/select2/dist/css/select2.css

@@ -0,0 +1,484 @@
1
+.select2-container {
2
+  box-sizing: border-box;
3
+  display: inline-block;
4
+  margin: 0;
5
+  position: relative;
6
+  vertical-align: middle; }
7
+  .select2-container .select2-selection--single {
8
+    box-sizing: border-box;
9
+    cursor: pointer;
10
+    display: block;
11
+    height: 28px;
12
+    user-select: none;
13
+    -webkit-user-select: none; }
14
+    .select2-container .select2-selection--single .select2-selection__rendered {
15
+      display: block;
16
+      padding-left: 8px;
17
+      padding-right: 20px;
18
+      overflow: hidden;
19
+      text-overflow: ellipsis;
20
+      white-space: nowrap; }
21
+    .select2-container .select2-selection--single .select2-selection__clear {
22
+      position: relative; }
23
+  .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
24
+    padding-right: 8px;
25
+    padding-left: 20px; }
26
+  .select2-container .select2-selection--multiple {
27
+    box-sizing: border-box;
28
+    cursor: pointer;
29
+    display: block;
30
+    min-height: 32px;
31
+    user-select: none;
32
+    -webkit-user-select: none; }
33
+    .select2-container .select2-selection--multiple .select2-selection__rendered {
34
+      display: inline-block;
35
+      overflow: hidden;
36
+      padding-left: 8px;
37
+      text-overflow: ellipsis;
38
+      white-space: nowrap; }
39
+  .select2-container .select2-search--inline {
40
+    float: left; }
41
+    .select2-container .select2-search--inline .select2-search__field {
42
+      box-sizing: border-box;
43
+      border: none;
44
+      font-size: 100%;
45
+      margin-top: 5px;
46
+      padding: 0; }
47
+      .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
48
+        -webkit-appearance: none; }
49
+
50
+.select2-dropdown {
51
+  background-color: white;
52
+  border: 1px solid #aaa;
53
+  border-radius: 4px;
54
+  box-sizing: border-box;
55
+  display: block;
56
+  position: absolute;
57
+  left: -100000px;
58
+  width: 100%;
59
+  z-index: 1051; }
60
+
61
+.select2-results {
62
+  display: block; }
63
+
64
+.select2-results__options {
65
+  list-style: none;
66
+  margin: 0;
67
+  padding: 0; }
68
+
69
+.select2-results__option {
70
+  padding: 6px;
71
+  user-select: none;
72
+  -webkit-user-select: none; }
73
+  .select2-results__option[aria-selected] {
74
+    cursor: pointer; }
75
+
76
+.select2-container--open .select2-dropdown {
77
+  left: 0; }
78
+
79
+.select2-container--open .select2-dropdown--above {
80
+  border-bottom: none;
81
+  border-bottom-left-radius: 0;
82
+  border-bottom-right-radius: 0; }
83
+
84
+.select2-container--open .select2-dropdown--below {
85
+  border-top: none;
86
+  border-top-left-radius: 0;
87
+  border-top-right-radius: 0; }
88
+
89
+.select2-search--dropdown {
90
+  display: block;
91
+  padding: 4px; }
92
+  .select2-search--dropdown .select2-search__field {
93
+    padding: 4px;
94
+    width: 100%;
95
+    box-sizing: border-box; }
96
+    .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
97
+      -webkit-appearance: none; }
98
+  .select2-search--dropdown.select2-search--hide {
99
+    display: none; }
100
+
101
+.select2-close-mask {
102
+  border: 0;
103
+  margin: 0;
104
+  padding: 0;
105
+  display: block;
106
+  position: fixed;
107
+  left: 0;
108
+  top: 0;
109
+  min-height: 100%;
110
+  min-width: 100%;
111
+  height: auto;
112
+  width: auto;
113
+  opacity: 0;
114
+  z-index: 99;
115
+  background-color: #fff;
116
+  filter: alpha(opacity=0); }
117
+
118
+.select2-hidden-accessible {
119
+  border: 0 !important;
120
+  clip: rect(0 0 0 0) !important;
121
+  -webkit-clip-path: inset(50%) !important;
122
+  clip-path: inset(50%) !important;
123
+  height: 1px !important;
124
+  overflow: hidden !important;
125
+  padding: 0 !important;
126
+  position: absolute !important;
127
+  width: 1px !important;
128
+  white-space: nowrap !important; }
129
+
130
+.select2-container--default .select2-selection--single {
131
+  background-color: #fff;
132
+  border: 1px solid #aaa;
133
+  border-radius: 4px; }
134
+  .select2-container--default .select2-selection--single .select2-selection__rendered {
135
+    color: #444;
136
+    line-height: 28px; }
137
+  .select2-container--default .select2-selection--single .select2-selection__clear {
138
+    cursor: pointer;
139
+    float: right;
140
+    font-weight: bold; }
141
+  .select2-container--default .select2-selection--single .select2-selection__placeholder {
142
+    color: #999; }
143
+  .select2-container--default .select2-selection--single .select2-selection__arrow {
144
+    height: 26px;
145
+    position: absolute;
146
+    top: 1px;
147
+    right: 1px;
148
+    width: 20px; }
149
+    .select2-container--default .select2-selection--single .select2-selection__arrow b {
150
+      border-color: #888 transparent transparent transparent;
151
+      border-style: solid;
152
+      border-width: 5px 4px 0 4px;
153
+      height: 0;
154
+      left: 50%;
155
+      margin-left: -4px;
156
+      margin-top: -2px;
157
+      position: absolute;
158
+      top: 50%;
159
+      width: 0; }
160
+
161
+.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
162
+  float: left; }
163
+
164
+.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
165
+  left: 1px;
166
+  right: auto; }
167
+
168
+.select2-container--default.select2-container--disabled .select2-selection--single {
169
+  background-color: #eee;
170
+  cursor: default; }
171
+  .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
172
+    display: none; }
173
+
174
+.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
175
+  border-color: transparent transparent #888 transparent;
176
+  border-width: 0 4px 5px 4px; }
177
+
178
+.select2-container--default .select2-selection--multiple {
179
+  background-color: white;
180
+  border: 1px solid #aaa;
181
+  border-radius: 4px;
182
+  cursor: text; }
183
+  .select2-container--default .select2-selection--multiple .select2-selection__rendered {
184
+    box-sizing: border-box;
185
+    list-style: none;
186
+    margin: 0;
187
+    padding: 0 5px;
188
+    width: 100%; }
189
+    .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
190
+      list-style: none; }
191
+  .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
192
+    color: #999;
193
+    margin-top: 5px;
194
+    float: left; }
195
+  .select2-container--default .select2-selection--multiple .select2-selection__clear {
196
+    cursor: pointer;
197
+    float: right;
198
+    font-weight: bold;
199
+    margin-top: 5px;
200
+    margin-right: 10px; }
201
+  .select2-container--default .select2-selection--multiple .select2-selection__choice {
202
+    background-color: #e4e4e4;
203
+    border: 1px solid #aaa;
204
+    border-radius: 4px;
205
+    cursor: default;
206
+    float: left;
207
+    margin-right: 5px;
208
+    margin-top: 5px;
209
+    padding: 0 5px; }
210
+  .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
211
+    color: #999;
212
+    cursor: pointer;
213
+    display: inline-block;
214
+    font-weight: bold;
215
+    margin-right: 2px; }
216
+    .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
217
+      color: #333; }
218
+
219
+.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
220
+  float: right; }
221
+
222
+.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
223
+  margin-left: 5px;
224
+  margin-right: auto; }
225
+
226
+.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
227
+  margin-left: 2px;
228
+  margin-right: auto; }
229
+
230
+.select2-container--default.select2-container--focus .select2-selection--multiple {
231
+  border: solid black 1px;
232
+  outline: 0; }
233
+
234
+.select2-container--default.select2-container--disabled .select2-selection--multiple {
235
+  background-color: #eee;
236
+  cursor: default; }
237
+
238
+.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
239
+  display: none; }
240
+
241
+.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
242
+  border-top-left-radius: 0;
243
+  border-top-right-radius: 0; }
244
+
245
+.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
246
+  border-bottom-left-radius: 0;
247
+  border-bottom-right-radius: 0; }
248
+
249
+.select2-container--default .select2-search--dropdown .select2-search__field {
250
+  border: 1px solid #aaa; }
251
+
252
+.select2-container--default .select2-search--inline .select2-search__field {
253
+  background: transparent;
254
+  border: none;
255
+  outline: 0;
256
+  box-shadow: none;
257
+  -webkit-appearance: textfield; }
258
+
259
+.select2-container--default .select2-results > .select2-results__options {
260
+  max-height: 200px;
261
+  overflow-y: auto; }
262
+
263
+.select2-container--default .select2-results__option[role=group] {
264
+  padding: 0; }
265
+
266
+.select2-container--default .select2-results__option[aria-disabled=true] {
267
+  color: #999; }
268
+
269
+.select2-container--default .select2-results__option[aria-selected=true] {
270
+  background-color: #ddd; }
271
+
272
+.select2-container--default .select2-results__option .select2-results__option {
273
+  padding-left: 1em; }
274
+  .select2-container--default .select2-results__option .select2-results__option .select2-results__group {
275
+    padding-left: 0; }
276
+  .select2-container--default .select2-results__option .select2-results__option .select2-results__option {
277
+    margin-left: -1em;
278
+    padding-left: 2em; }
279
+    .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
280
+      margin-left: -2em;
281
+      padding-left: 3em; }
282
+      .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
283
+        margin-left: -3em;
284
+        padding-left: 4em; }
285
+        .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
286
+          margin-left: -4em;
287
+          padding-left: 5em; }
288
+          .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
289
+            margin-left: -5em;
290
+            padding-left: 6em; }
291
+
292
+.select2-container--default .select2-results__option--highlighted[aria-selected] {
293
+  background-color: #5897fb;
294
+  color: white; }
295
+
296
+.select2-container--default .select2-results__group {
297
+  cursor: default;
298
+  display: block;
299
+  padding: 6px; }
300
+
301
+.select2-container--classic .select2-selection--single {
302
+  background-color: #f7f7f7;
303
+  border: 1px solid #aaa;
304
+  border-radius: 4px;
305
+  outline: 0;
306
+  background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
307
+  background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
308
+  background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
309
+  background-repeat: repeat-x;
310
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
311
+  .select2-container--classic .select2-selection--single:focus {
312
+    border: 1px solid #5897fb; }
313
+  .select2-container--classic .select2-selection--single .select2-selection__rendered {
314
+    color: #444;
315
+    line-height: 28px; }
316
+  .select2-container--classic .select2-selection--single .select2-selection__clear {
317
+    cursor: pointer;
318
+    float: right;
319
+    font-weight: bold;
320
+    margin-right: 10px; }
321
+  .select2-container--classic .select2-selection--single .select2-selection__placeholder {
322
+    color: #999; }
323
+  .select2-container--classic .select2-selection--single .select2-selection__arrow {
324
+    background-color: #ddd;
325
+    border: none;
326
+    border-left: 1px solid #aaa;
327
+    border-top-right-radius: 4px;
328
+    border-bottom-right-radius: 4px;
329
+    height: 26px;
330
+    position: absolute;
331
+    top: 1px;
332
+    right: 1px;
333
+    width: 20px;
334
+    background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
335
+    background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
336
+    background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
337
+    background-repeat: repeat-x;
338
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
339
+    .select2-container--classic .select2-selection--single .select2-selection__arrow b {
340
+      border-color: #888 transparent transparent transparent;
341
+      border-style: solid;
342
+      border-width: 5px 4px 0 4px;
343
+      height: 0;
344
+      left: 50%;
345
+      margin-left: -4px;
346
+      margin-top: -2px;
347
+      position: absolute;
348
+      top: 50%;
349
+      width: 0; }
350
+
351
+.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
352
+  float: left; }
353
+
354
+.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
355
+  border: none;
356
+  border-right: 1px solid #aaa;
357
+  border-radius: 0;
358
+  border-top-left-radius: 4px;
359
+  border-bottom-left-radius: 4px;
360
+  left: 1px;
361
+  right: auto; }
362
+
363
+.select2-container--classic.select2-container--open .select2-selection--single {
364
+  border: 1px solid #5897fb; }
365
+  .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
366
+    background: transparent;
367
+    border: none; }
368
+    .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
369
+      border-color: transparent transparent #888 transparent;
370
+      border-width: 0 4px 5px 4px; }
371
+
372
+.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
373
+  border-top: none;
374
+  border-top-left-radius: 0;
375
+  border-top-right-radius: 0;
376
+  background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
377
+  background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
378
+  background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
379
+  background-repeat: repeat-x;
380
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
381
+
382
+.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
383
+  border-bottom: none;
384
+  border-bottom-left-radius: 0;
385
+  border-bottom-right-radius: 0;
386
+  background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
387
+  background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
388
+  background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
389
+  background-repeat: repeat-x;
390
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
391
+
392
+.select2-container--classic .select2-selection--multiple {
393
+  background-color: white;
394
+  border: 1px solid #aaa;
395
+  border-radius: 4px;
396
+  cursor: text;
397
+  outline: 0; }
398
+  .select2-container--classic .select2-selection--multiple:focus {
399
+    border: 1px solid #5897fb; }
400
+  .select2-container--classic .select2-selection--multiple .select2-selection__rendered {
401
+    list-style: none;
402
+    margin: 0;
403
+    padding: 0 5px; }
404
+  .select2-container--classic .select2-selection--multiple .select2-selection__clear {
405
+    display: none; }
406
+  .select2-container--classic .select2-selection--multiple .select2-selection__choice {
407
+    background-color: #e4e4e4;
408
+    border: 1px solid #aaa;
409
+    border-radius: 4px;
410
+    cursor: default;
411
+    float: left;
412
+    margin-right: 5px;
413
+    margin-top: 5px;
414
+    padding: 0 5px; }
415
+  .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
416
+    color: #888;
417
+    cursor: pointer;
418
+    display: inline-block;
419
+    font-weight: bold;
420
+    margin-right: 2px; }
421
+    .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
422
+      color: #555; }
423
+
424
+.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
425
+  float: right;
426
+  margin-left: 5px;
427
+  margin-right: auto; }
428
+
429
+.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
430
+  margin-left: 2px;
431
+  margin-right: auto; }
432
+
433
+.select2-container--classic.select2-container--open .select2-selection--multiple {
434
+  border: 1px solid #5897fb; }
435
+
436
+.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
437
+  border-top: none;
438
+  border-top-left-radius: 0;
439
+  border-top-right-radius: 0; }
440
+
441
+.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
442
+  border-bottom: none;
443
+  border-bottom-left-radius: 0;
444
+  border-bottom-right-radius: 0; }
445
+
446
+.select2-container--classic .select2-search--dropdown .select2-search__field {
447
+  border: 1px solid #aaa;
448
+  outline: 0; }
449
+
450
+.select2-container--classic .select2-search--inline .select2-search__field {
451
+  outline: 0;
452
+  box-shadow: none; }
453
+
454
+.select2-container--classic .select2-dropdown {
455
+  background-color: white;
456
+  border: 1px solid transparent; }
457
+
458
+.select2-container--classic .select2-dropdown--above {
459
+  border-bottom: none; }
460
+
461
+.select2-container--classic .select2-dropdown--below {
462
+  border-top: none; }
463
+
464
+.select2-container--classic .select2-results > .select2-results__options {
465
+  max-height: 200px;
466
+  overflow-y: auto; }
467
+
468
+.select2-container--classic .select2-results__option[role=group] {
469
+  padding: 0; }
470
+
471
+.select2-container--classic .select2-results__option[aria-disabled=true] {
472
+  color: grey; }
473
+
474
+.select2-container--classic .select2-results__option--highlighted[aria-selected] {
475
+  background-color: #3875d7;
476
+  color: white; }
477
+
478
+.select2-container--classic .select2-results__group {
479
+  cursor: default;
480
+  display: block;
481
+  padding: 6px; }
482
+
483
+.select2-container--classic.select2-container--open .select2-dropdown {
484
+  border-color: #5897fb; }

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
app/staticfile/vendor/select2/dist/css/select2.min.css


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/af.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/ar.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/az.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/bg.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/bn.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/bs.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/ca.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/cs.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/da.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/de.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/dsb.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/el.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/en.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/es.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/et.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/eu.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/fa.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/fi.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/fr.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/gl.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/he.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/hi.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/hr.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/hsb.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/hu.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/hy.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/id.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/is.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/it.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/ja.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/ka.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/km.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/ko.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/lt.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/lv.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/mk.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/ms.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/nb.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/ne.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/nl.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/pl.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/ps.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/pt-BR.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/pt.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/ro.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/ru.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/sk.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/sl.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/sq.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/sr-Cyrl.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/sr.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/sv.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/th.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/tk.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/tr.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/uk.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/vi.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/zh-CN.js


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
app/staticfile/vendor/select2/dist/js/i18n/zh-TW.js


Datei-Diff unterdrückt, da er zu groß ist
+ 6597 - 0
app/staticfile/vendor/select2/dist/js/select2.full.js


Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 0
app/staticfile/vendor/select2/dist/js/select2.full.min.js


Datei-Diff unterdrückt, da er zu groß ist
+ 5885 - 0
app/staticfile/vendor/select2/dist/js/select2.js


Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 0
app/staticfile/vendor/select2/dist/js/select2.min.js


+ 12 - 0
app/staticfile/vendor/select2/docs/announcements-4.0.html

@@ -0,0 +1,12 @@
1
+<!DOCTYPE html>
2
+<html>
3
+  <head>
4
+    <meta charset="UTF-8">
5
+    <title>select2</title>
6
+  </head>
7
+  <body>
8
+    <script>
9
+      window.location = 'https://select2.org/upgrading/new-in-40';
10
+    </script>
11
+  </body>
12
+</html>

+ 12 - 0
app/staticfile/vendor/select2/docs/community.html

@@ -0,0 +1,12 @@
1
+<!DOCTYPE html>
2
+<html>
3
+  <head>
4
+    <meta charset="UTF-8">
5
+    <title>select2</title>
6
+  </head>
7
+  <body>
8
+    <script>
9
+      window.location = 'https://select2.org/getting-help';
10
+    </script>
11
+  </body>
12
+</html>

+ 12 - 0
app/staticfile/vendor/select2/docs/examples.html

@@ -0,0 +1,12 @@
1
+<!DOCTYPE html>
2
+<html>
3
+  <head>
4
+    <meta charset="UTF-8">
5
+    <title>select2</title>
6
+  </head>
7
+  <body>
8
+    <script>
9
+      window.location = 'https://select2.org/getting-started/basic-usage';
10
+    </script>
11
+  </body>
12
+</html>

+ 12 - 0
app/staticfile/vendor/select2/docs/index.html

@@ -0,0 +1,12 @@
1
+<!DOCTYPE html>
2
+<html>
3
+  <head>
4
+    <meta charset="UTF-8">
5
+    <title>select2</title>
6
+  </head>
7
+  <body>
8
+    <script>
9
+      window.location = 'https://select2.org';
10
+    </script>
11
+  </body>
12
+</html>

+ 12 - 0
app/staticfile/vendor/select2/docs/options-old.html

@@ -0,0 +1,12 @@
1
+<!DOCTYPE html>
2
+<html>
3
+  <head>
4
+    <meta charset="UTF-8">
5
+    <title>select2</title>
6
+  </head>
7
+  <body>
8
+    <script>
9
+      window.location = 'https://select2.org/configuration';
10
+    </script>
11
+  </body>
12
+</html>

+ 12 - 0
app/staticfile/vendor/select2/docs/options.html

@@ -0,0 +1,12 @@
1
+<!DOCTYPE html>
2
+<html>
3
+  <head>
4
+    <meta charset="UTF-8">
5
+    <title>select2</title>
6
+  </head>
7
+  <body>
8
+    <script>
9
+      window.location = 'https://select2.org/configuration';
10
+    </script>
11
+  </body>
12
+</html>

+ 65 - 0
app/staticfile/vendor/select2/package.json

@@ -0,0 +1,65 @@
1
+{
2
+  "name": "select2",
3
+  "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
4
+  "homepage": "https://select2.org",
5
+  "author": {
6
+    "name": "Kevin Brown",
7
+    "url": "https://github.com/kevin-brown"
8
+  },
9
+  "contributors": [
10
+    {
11
+      "name": "Igor Vaynberg",
12
+      "url": "https://github.com/ivaynberg"
13
+    },
14
+    {
15
+      "name": "Alex Weissman",
16
+      "url": "https://github.com/alexweissman"
17
+    }
18
+  ],
19
+  "repository": {
20
+    "type": "git",
21
+    "url": "git://github.com/select2/select2.git"
22
+  },
23
+  "bugs": {
24
+    "url": "https://github.com/select2/select2/issues"
25
+  },
26
+  "keywords": [
27
+    "select",
28
+    "autocomplete",
29
+    "typeahead",
30
+    "dropdown",
31
+    "multiselect",
32
+    "tag",
33
+    "tagging"
34
+  ],
35
+  "license": "MIT",
36
+  "main": "dist/js/select2.js",
37
+  "style": "dist/css/select2.css",
38
+  "files": [
39
+    "src",
40
+    "dist"
41
+  ],
42
+  "version": "4.0.7",
43
+  "jspm": {
44
+    "main": "js/select2",
45
+    "directories": {
46
+      "lib": "dist"
47
+    }
48
+  },
49
+  "devDependencies": {
50
+    "almond": "~0.3.1",
51
+    "grunt": "^0.4.5",
52
+    "grunt-cli": "^1.3.2",
53
+    "grunt-contrib-concat": "^1.0.1",
54
+    "grunt-contrib-connect": "^2.0.0",
55
+    "grunt-contrib-jshint": "^1.1.0",
56
+    "grunt-contrib-qunit": "^1.3.0",
57
+    "grunt-contrib-requirejs": "^1.0.0",
58
+    "grunt-contrib-uglify": "~4.0.1",
59
+    "grunt-contrib-watch": "~1.1.0",
60
+    "grunt-sass": "^2.1.0",
61
+    "jquery-mousewheel": "~3.1.13",
62
+    "node-sass": "^4.12.0"
63
+  },
64
+  "dependencies": {}
65
+}

+ 6 - 0
app/staticfile/vendor/select2/src/js/banner.end.js

@@ -0,0 +1,6 @@
1
+  // Return the AMD loader configuration so it can be used outside of this file
2
+  return {
3
+    define: S2.define,
4
+    require: S2.require
5
+  };
6
+}());

+ 0 - 0
app/staticfile/vendor/select2/src/js/banner.start.js


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.

tum/whitesports - Gogs: Simplico Git Service

Bez popisu

wp-login.php 44KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449
  1. <?php
  2. /**
  3. * WordPress User Page
  4. *
  5. * Handles authentication, registering, resetting passwords, forgot password,
  6. * and other user handling.
  7. *
  8. * @package WordPress
  9. */
  10. /** Make sure that the WordPress bootstrap has run before continuing. */
  11. require __DIR__ . '/wp-load.php';
  12. // Redirect to HTTPS login if forced to use SSL.
  13. if ( force_ssl_admin() && ! is_ssl() ) {
  14. if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
  15. wp_safe_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
  16. exit;
  17. } else {
  18. wp_safe_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
  19. exit;
  20. }
  21. }
  22. /**
  23. * Output the login page header.
  24. *
  25. * @since 2.1.0
  26. *
  27. * @global string $error Login error message set by deprecated pluggable wp_login() function
  28. * or plugins replacing it.
  29. * @global bool|string $interim_login Whether interim login modal is being displayed. String 'success'
  30. * upon successful login.
  31. * @global string $action The action that brought the visitor to the login page.
  32. *
  33. * @param string $title Optional. WordPress login Page title to display in the `<title>` element.
  34. * Default 'Log In'.
  35. * @param string $message Optional. Message to display in header. Default empty.
  36. * @param WP_Error $wp_error Optional. The error to pass. Default is a WP_Error instance.
  37. */
  38. function login_header( $title = 'Log In', $message = '', $wp_error = null ) {
  39. global $error, $interim_login, $action;
  40. // Don't index any of these forms.
  41. add_filter( 'wp_robots', 'wp_robots_sensitive_page' );
  42. add_action( 'login_head', 'wp_strict_cross_origin_referrer' );
  43. add_action( 'login_head', 'wp_login_viewport_meta' );
  44. if ( ! is_wp_error( $wp_error ) ) {
  45. $wp_error = new WP_Error();
  46. }
  47. // Shake it!
  48. $shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password', 'retrieve_password_email_failure' );
  49. /**
  50. * Filters the error codes array for shaking the login form.
  51. *
  52. * @since 3.0.0
  53. *
  54. * @param array $shake_error_codes Error codes that shake the login form.
  55. */
  56. $shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes );
  57. if ( $shake_error_codes && $wp_error->has_errors() && in_array( $wp_error->get_error_code(), $shake_error_codes, true ) ) {
  58. add_action( 'login_footer', 'wp_shake_js', 12 );
  59. }
  60. $login_title = get_bloginfo( 'name', 'display' );
  61. /* translators: Login screen title. 1: Login screen name, 2: Network or site name. */
  62. $login_title = sprintf( __( '%1$s &lsaquo; %2$s &#8212; WordPress' ), $title, $login_title );
  63. if ( wp_is_recovery_mode() ) {
  64. /* translators: %s: Login screen title. */
  65. $login_title = sprintf( __( 'Recovery Mode &#8212; %s' ), $login_title );
  66. }
  67. /**
  68. * Filters the title tag content for login page.
  69. *
  70. * @since 4.9.0
  71. *
  72. * @param string $login_title The page title, with extra context added.
  73. * @param string $title The original page title.
  74. */
  75. $login_title = apply_filters( 'login_title', $login_title, $title );
  76. ?><!DOCTYPE html>
  77. <html <?php language_attributes(); ?>>
  78. <head>
  79. <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />
  80. <title><?php echo $login_title; ?></title>
  81. <?php
  82. wp_enqueue_style( 'login' );
  83. /*
  84. * Remove all stored post data on logging out.
  85. * This could be added by add_action('login_head'...) like wp_shake_js(),
  86. * but maybe better if it's not removable by plugins.
  87. */
  88. if ( 'loggedout' === $wp_error->get_error_code() ) {
  89. ?>
  90. <script>if("sessionStorage" in window){try{for(var key in sessionStorage){if(key.indexOf("wp-autosave-")!=-1){sessionStorage.removeItem(key)}}}catch(e){}};</script>
  91. <?php
  92. }
  93. /**
  94. * Enqueue scripts and styles for the login page.
  95. *
  96. * @since 3.1.0
  97. */
  98. do_action( 'login_enqueue_scripts' );
  99. /**
  100. * Fires in the login page header after scripts are enqueued.
  101. *
  102. * @since 2.1.0
  103. */
  104. do_action( 'login_head' );
  105. $login_header_url = __( 'https://wordpress.org/' );
  106. /**
  107. * Filters link URL of the header logo above login form.
  108. *
  109. * @since 2.1.0
  110. *
  111. * @param string $login_header_url Login header logo URL.
  112. */
  113. $login_header_url = apply_filters( 'login_headerurl', $login_header_url );
  114. $login_header_title = '';
  115. /**
  116. * Filters the title attribute of the header logo above login form.
  117. *
  118. * @since 2.1.0
  119. * @deprecated 5.2.0 Use {@see 'login_headertext'} instead.
  120. *
  121. * @param string $login_header_title Login header logo title attribute.
  122. */
  123. $login_header_title = apply_filters_deprecated(
  124. 'login_headertitle',
  125. array( $login_header_title ),
  126. '5.2.0',
  127. 'login_headertext',
  128. __( 'Usage of the title attribute on the login logo is not recommended for accessibility reasons. Use the link text instead.' )
  129. );
  130. $login_header_text = empty( $login_header_title ) ? __( 'Powered by WordPress' ) : $login_header_title;
  131. /**
  132. * Filters the link text of the header logo above the login form.
  133. *
  134. * @since 5.2.0
  135. *
  136. * @param string $login_header_text The login header logo link text.
  137. */
  138. $login_header_text = apply_filters( 'login_headertext', $login_header_text );
  139. $classes = array( 'login-action-' . $action, 'wp-core-ui' );
  140. if ( is_rtl() ) {
  141. $classes[] = 'rtl';
  142. }
  143. if ( $interim_login ) {
  144. $classes[] = 'interim-login';
  145. ?>
  146. <style type="text/css">html{background-color: transparent;}</style>
  147. <?php
  148. if ( 'success' === $interim_login ) {
  149. $classes[] = 'interim-login-success';
  150. }
  151. }
  152. $classes[] = ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
  153. /**
  154. * Filters the login page body classes.
  155. *
  156. * @since 3.5.0
  157. *
  158. * @param array $classes An array of body classes.
  159. * @param string $action The action that brought the visitor to the login page.
  160. */
  161. $classes = apply_filters( 'login_body_class', $classes, $action );
  162. ?>
  163. </head>
  164. <body class="login no-js <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
  165. <script type="text/javascript">
  166. document.body.className = document.body.className.replace('no-js','js');
  167. </script>
  168. <?php
  169. /**
  170. * Fires in the login page header after the body tag is opened.
  171. *
  172. * @since 4.6.0
  173. */
  174. do_action( 'login_header' );
  175. ?>
  176. <div id="login">
  177. <h1><a href="<?php echo esc_url( $login_header_url ); ?>"><?php echo $login_header_text; ?></a></h1>
  178. <?php
  179. /**
  180. * Filters the message to display above the login form.
  181. *
  182. * @since 2.1.0
  183. *
  184. * @param string $message Login message text.
  185. */
  186. $message = apply_filters( 'login_message', $message );
  187. if ( ! empty( $message ) ) {
  188. echo $message . "\n";
  189. }
  190. // In case a plugin uses $error rather than the $wp_errors object.
  191. if ( ! empty( $error ) ) {
  192. $wp_error->add( 'error', $error );
  193. unset( $error );
  194. }
  195. if ( $wp_error->has_errors() ) {
  196. $errors = '';
  197. $messages = '';
  198. foreach ( $wp_error->get_error_codes() as $code ) {
  199. $severity = $wp_error->get_error_data( $code );
  200. foreach ( $wp_error->get_error_messages( $code ) as $error_message ) {
  201. if ( 'message' === $severity ) {
  202. $messages .= ' ' . $error_message . "<br />\n";
  203. } else {
  204. $errors .= ' ' . $error_message . "<br />\n";
  205. }
  206. }
  207. }
  208. if ( ! empty( $errors ) ) {
  209. /**
  210. * Filters the error messages displayed above the login form.
  211. *
  212. * @since 2.1.0
  213. *
  214. * @param string $errors Login error message.
  215. */
  216. echo '<div id="login_error">' . apply_filters( 'login_errors', $errors ) . "</div>\n";
  217. }
  218. if ( ! empty( $messages ) ) {
  219. /**
  220. * Filters instructional messages displayed above the login form.
  221. *
  222. * @since 2.5.0
  223. *
  224. * @param string $messages Login messages.
  225. */
  226. echo '<p class="message">' . apply_filters( 'login_messages', $messages ) . "</p>\n";
  227. }
  228. }
  229. } // End of login_header().
  230. /**
  231. * Outputs the footer for the login page.
  232. *
  233. * @since 3.1.0
  234. *
  235. * @global bool|string $interim_login Whether interim login modal is being displayed. String 'success'
  236. * upon successful login.
  237. *
  238. * @param string $input_id Which input to auto-focus.
  239. */
  240. function login_footer( $input_id = '' ) {
  241. global $interim_login;
  242. // Don't allow interim logins to navigate away from the page.
  243. if ( ! $interim_login ) {
  244. ?>
  245. <p id="backtoblog">
  246. <?php
  247. $html_link = sprintf(
  248. '<a href="%s">%s</a>',
  249. esc_url( home_url( '/' ) ),
  250. sprintf(
  251. /* translators: %s: Site title. */
  252. _x( '&larr; Go to %s', 'site' ),
  253. get_bloginfo( 'title', 'display' )
  254. )
  255. );
  256. /**
  257. * Filter the "Go to site" link displayed in the login page footer.
  258. *
  259. * @since 5.7.0
  260. *
  261. * @param string $link HTML link to the home URL of the current site.
  262. */
  263. echo apply_filters( 'login_site_html_link', $html_link );
  264. ?>
  265. </p>
  266. <?php
  267. the_privacy_policy_link( '<div class="privacy-policy-page-link">', '</div>' );
  268. }
  269. ?>
  270. </div><?php // End of <div id="login">. ?>
  271. <?php
  272. if ( ! empty( $input_id ) ) {
  273. ?>
  274. <script type="text/javascript">
  275. try{document.getElementById('<?php echo $input_id; ?>').focus();}catch(e){}
  276. if(typeof wpOnload==='function')wpOnload();
  277. </script>
  278. <?php
  279. }
  280. /**
  281. * Fires in the login page footer.
  282. *
  283. * @since 3.1.0
  284. */
  285. do_action( 'login_footer' );
  286. ?>
  287. <div class="clear"></div>
  288. </body>
  289. </html>
  290. <?php
  291. }
  292. /**
  293. * Outputs the JavaScript to handle the form shaking on the login page.
  294. *
  295. * @since 3.0.0
  296. */
  297. function wp_shake_js() {
  298. ?>
  299. <script type="text/javascript">
  300. document.querySelector('form').classList.add('shake');
  301. </script>
  302. <?php
  303. }
  304. /**
  305. * Outputs the viewport meta tag for the login page.
  306. *
  307. * @since 3.7.0
  308. */
  309. function wp_login_viewport_meta() {
  310. ?>
  311. <meta name="viewport" content="width=device-width" />
  312. <?php
  313. }
  314. //
  315. // Main.
  316. //
  317. $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'login';
  318. $errors = new WP_Error();
  319. if ( isset( $_GET['key'] ) ) {
  320. $action = 'resetpass';
  321. }
  322. if ( isset( $_GET['checkemail'] ) ) {
  323. $action = 'checkemail';
  324. }
  325. $default_actions = array(
  326. 'confirm_admin_email',
  327. 'postpass',
  328. 'logout',
  329. 'lostpassword',
  330. 'retrievepassword',
  331. 'resetpass',
  332. 'rp',
  333. 'register',
  334. 'checkemail',
  335. 'confirmaction',
  336. 'login',
  337. WP_Recovery_Mode_Link_Service::LOGIN_ACTION_ENTERED,
  338. );
  339. // Validate action so as to default to the login screen.
  340. if ( ! in_array( $action, $default_actions, true ) && false === has_filter( 'login_form_' . $action ) ) {
  341. $action = 'login';
  342. }
  343. nocache_headers();
  344. header( 'Content-Type: ' . get_bloginfo( 'html_type' ) . '; charset=' . get_bloginfo( 'charset' ) );
  345. if ( defined( 'RELOCATE' ) && RELOCATE ) { // Move flag is set.
  346. if ( isset( $_SERVER['PATH_INFO'] ) && ( $_SERVER['PATH_INFO'] !== $_SERVER['PHP_SELF'] ) ) {
  347. $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );
  348. }
  349. $url = dirname( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) );
  350. if ( get_option( 'siteurl' ) !== $url ) {
  351. update_option( 'siteurl', $url );
  352. }
  353. }
  354. // Set a cookie now to see if they are supported by the browser.
  355. $secure = ( 'https' === parse_url( wp_login_url(), PHP_URL_SCHEME ) );
  356. setcookie( TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN, $secure );
  357. if ( SITECOOKIEPATH !== COOKIEPATH ) {
  358. setcookie( TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN, $secure );
  359. }
  360. /**
  361. * Fires when the login form is initialized.
  362. *
  363. * @since 3.2.0
  364. */
  365. do_action( 'login_init' );
  366. /**
  367. * Fires before a specified login form action.
  368. *
  369. * The dynamic portion of the hook name, `$action`, refers to the action
  370. * that brought the visitor to the login form.
  371. *
  372. * Possible hook names include:
  373. *
  374. * - 'login_form_checkemail'
  375. * - 'login_form_confirm_admin_email'
  376. * - 'login_form_confirmaction'
  377. * - 'login_form_entered_recovery_mode'
  378. * - 'login_form_login'
  379. * - 'login_form_logout'
  380. * - 'login_form_lostpassword'
  381. * - 'login_form_postpass'
  382. * - 'login_form_register'
  383. * - 'login_form_resetpass'
  384. * - 'login_form_retrievepassword'
  385. * - 'login_form_rp'
  386. *
  387. * @since 2.8.0
  388. */
  389. do_action( "login_form_{$action}" );
  390. $http_post = ( 'POST' === $_SERVER['REQUEST_METHOD'] );
  391. $interim_login = isset( $_REQUEST['interim-login'] );
  392. /**
  393. * Filters the separator used between login form navigation links.
  394. *
  395. * @since 4.9.0
  396. *
  397. * @param string $login_link_separator The separator used between login form navigation links.
  398. */
  399. $login_link_separator = apply_filters( 'login_link_separator', ' | ' );
  400. switch ( $action ) {
  401. case 'confirm_admin_email':
  402. /*
  403. * Note that `is_user_logged_in()` will return false immediately after logging in
  404. * as the current user is not set, see wp-includes/pluggable.php.
  405. * However this action runs on a redirect after logging in.
  406. */
  407. if ( ! is_user_logged_in() ) {
  408. wp_safe_redirect( wp_login_url() );
  409. exit;
  410. }
  411. if ( ! empty( $_REQUEST['redirect_to'] ) ) {
  412. $redirect_to = $_REQUEST['redirect_to'];
  413. } else {
  414. $redirect_to = admin_url();
  415. }
  416. if ( current_user_can( 'manage_options' ) ) {
  417. $admin_email = get_option( 'admin_email' );
  418. } else {
  419. wp_safe_redirect( $redirect_to );
  420. exit;
  421. }
  422. /**
  423. * Filters the interval for dismissing the admin email confirmation screen.
  424. *
  425. * If `0` (zero) is returned, the "Remind me later" link will not be displayed.
  426. *
  427. * @since 5.3.1
  428. *
  429. * @param int $interval Interval time (in seconds). Default is 3 days.
  430. */
  431. $remind_interval = (int) apply_filters( 'admin_email_remind_interval', 3 * DAY_IN_SECONDS );
  432. if ( ! empty( $_GET['remind_me_later'] ) ) {
  433. if ( ! wp_verify_nonce( $_GET['remind_me_later'], 'remind_me_later_nonce' ) ) {
  434. wp_safe_redirect( wp_login_url() );
  435. exit;
  436. }
  437. if ( $remind_interval > 0 ) {
  438. update_option( 'admin_email_lifespan', time() + $remind_interval );
  439. }
  440. $redirect_to = add_query_arg( 'admin_email_remind_later', 1, $redirect_to );
  441. wp_safe_redirect( $redirect_to );
  442. exit;
  443. }
  444. if ( ! empty( $_POST['correct-admin-email'] ) ) {
  445. if ( ! check_admin_referer( 'confirm_admin_email', 'confirm_admin_email_nonce' ) ) {
  446. wp_safe_redirect( wp_login_url() );
  447. exit;
  448. }
  449. /**
  450. * Filters the interval for redirecting the user to the admin email confirmation screen.
  451. *
  452. * If `0` (zero) is returned, the user will not be redirected.
  453. *
  454. * @since 5.3.0
  455. *
  456. * @param int $interval Interval time (in seconds). Default is 6 months.
  457. */
  458. $admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 6 * MONTH_IN_SECONDS );
  459. if ( $admin_email_check_interval > 0 ) {
  460. update_option( 'admin_email_lifespan', time() + $admin_email_check_interval );
  461. }
  462. wp_safe_redirect( $redirect_to );
  463. exit;
  464. }
  465. login_header( __( 'Confirm your administration email' ), '', $errors );
  466. /**
  467. * Fires before the admin email confirm form.
  468. *
  469. * @since 5.3.0
  470. *
  471. * @param WP_Error $errors A `WP_Error` object containing any errors generated by using invalid
  472. * credentials. Note that the error object may not contain any errors.
  473. */
  474. do_action( 'admin_email_confirm', $errors );
  475. ?>
  476. <form class="admin-email-confirm-form" name="admin-email-confirm-form" action="<?php echo esc_url( site_url( 'wp-login.php?action=confirm_admin_email', 'login_post' ) ); ?>" method="post">
  477. <?php
  478. /**
  479. * Fires inside the admin-email-confirm-form form tags, before the hidden fields.
  480. *
  481. * @since 5.3.0
  482. */
  483. do_action( 'admin_email_confirm_form' );
  484. wp_nonce_field( 'confirm_admin_email', 'confirm_admin_email_nonce' );
  485. ?>
  486. <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
  487. <h1 class="admin-email__heading">
  488. <?php _e( 'Administration email verification' ); ?>
  489. </h1>
  490. <p class="admin-email__details">
  491. <?php _e( 'Please verify that the <strong>administration email</strong> for this website is still correct.' ); ?>
  492. <?php
  493. /* translators: URL to the WordPress help section about admin email. */
  494. $admin_email_help_url = __( 'https://wordpress.org/support/article/settings-general-screen/#email-address' );
  495. /* translators: Accessibility text. */
  496. $accessibility_text = sprintf( '<span class="screen-reader-text"> %s</span>', __( '(opens in a new tab)' ) );
  497. printf(
  498. '<a href="%s" rel="noopener" target="_blank">%s%s</a>',
  499. esc_url( $admin_email_help_url ),
  500. __( 'Why is this important?' ),
  501. $accessibility_text
  502. );
  503. ?>
  504. </p>
  505. <p class="admin-email__details">
  506. <?php
  507. printf(
  508. /* translators: %s: Admin email address. */
  509. __( 'Current administration email: %s' ),
  510. '<strong>' . esc_html( $admin_email ) . '</strong>'
  511. );
  512. ?>
  513. </p>
  514. <p class="admin-email__details">
  515. <?php _e( 'This email may be different from your personal email address.' ); ?>
  516. </p>
  517. <div class="admin-email__actions">
  518. <div class="admin-email__actions-primary">
  519. <?php
  520. $change_link = admin_url( 'options-general.php' );
  521. $change_link = add_query_arg( 'highlight', 'confirm_admin_email', $change_link );
  522. ?>
  523. <a class="button button-large" href="<?php echo esc_url( $change_link ); ?>"><?php _e( 'Update' ); ?></a>
  524. <input type="submit" name="correct-admin-email" id="correct-admin-email" class="button button-primary button-large" value="<?php esc_attr_e( 'The email is correct' ); ?>" />
  525. </div>
  526. <?php if ( $remind_interval > 0 ) : ?>
  527. <div class="admin-email__actions-secondary">
  528. <?php
  529. $remind_me_link = wp_login_url( $redirect_to );
  530. $remind_me_link = add_query_arg(
  531. array(
  532. 'action' => 'confirm_admin_email',
  533. 'remind_me_later' => wp_create_nonce( 'remind_me_later_nonce' ),
  534. ),
  535. $remind_me_link
  536. );
  537. ?>
  538. <a href="<?php echo esc_url( $remind_me_link ); ?>"><?php _e( 'Remind me later' ); ?></a>
  539. </div>
  540. <?php endif; ?>
  541. </div>
  542. </form>
  543. <?php
  544. login_footer();
  545. break;
  546. case 'postpass':
  547. if ( ! array_key_exists( 'post_password', $_POST ) ) {
  548. wp_safe_redirect( wp_get_referer() );
  549. exit;
  550. }
  551. require_once ABSPATH . WPINC . '/class-phpass.php';
  552. $hasher = new PasswordHash( 8, true );
  553. /**
  554. * Filters the life span of the post password cookie.
  555. *
  556. * By default, the cookie expires 10 days from creation. To turn this
  557. * into a session cookie, return 0.
  558. *
  559. * @since 3.7.0
  560. *
  561. * @param int $expires The expiry time, as passed to setcookie().
  562. */
  563. $expire = apply_filters( 'post_password_expires', time() + 10 * DAY_IN_SECONDS );
  564. $referer = wp_get_referer();
  565. if ( $referer ) {
  566. $secure = ( 'https' === parse_url( $referer, PHP_URL_SCHEME ) );
  567. } else {
  568. $secure = false;
  569. }
  570. setcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), $expire, COOKIEPATH, COOKIE_DOMAIN, $secure );
  571. wp_safe_redirect( wp_get_referer() );
  572. exit;
  573. case 'logout':
  574. check_admin_referer( 'log-out' );
  575. $user = wp_get_current_user();
  576. wp_logout();
  577. if ( ! empty( $_REQUEST['redirect_to'] ) ) {
  578. $redirect_to = $_REQUEST['redirect_to'];
  579. $requested_redirect_to = $redirect_to;
  580. } else {
  581. $redirect_to = add_query_arg(
  582. array(
  583. 'loggedout' => 'true',
  584. 'wp_lang' => get_user_locale( $user ),
  585. ),
  586. wp_login_url()
  587. );
  588. $requested_redirect_to = '';
  589. }
  590. /**
  591. * Filters the log out redirect URL.
  592. *
  593. * @since 4.2.0
  594. *
  595. * @param string $redirect_to The redirect destination URL.
  596. * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter.
  597. * @param WP_User $user The WP_User object for the user that's logging out.
  598. */
  599. $redirect_to = apply_filters( 'logout_redirect', $redirect_to, $requested_redirect_to, $user );
  600. wp_safe_redirect( $redirect_to );
  601. exit;
  602. case 'lostpassword':
  603. case 'retrievepassword':
  604. if ( $http_post ) {
  605. $errors = retrieve_password();
  606. if ( ! is_wp_error( $errors ) ) {
  607. $redirect_to = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?checkemail=confirm';
  608. wp_safe_redirect( $redirect_to );
  609. exit;
  610. }
  611. }
  612. if ( isset( $_GET['error'] ) ) {
  613. if ( 'invalidkey' === $_GET['error'] ) {
  614. $errors->add( 'invalidkey', __( '<strong>Error</strong>: Your password reset link appears to be invalid. Please request a new link below.' ) );
  615. } elseif ( 'expiredkey' === $_GET['error'] ) {
  616. $errors->add( 'expiredkey', __( '<strong>Error</strong>: Your password reset link has expired. Please request a new link below.' ) );
  617. }
  618. }
  619. $lostpassword_redirect = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
  620. /**
  621. * Filters the URL redirected to after submitting the lostpassword/retrievepassword form.
  622. *
  623. * @since 3.0.0
  624. *
  625. * @param string $lostpassword_redirect The redirect destination URL.
  626. */
  627. $redirect_to = apply_filters( 'lostpassword_redirect', $lostpassword_redirect );
  628. /**
  629. * Fires before the lost password form.
  630. *
  631. * @since 1.5.1
  632. * @since 5.1.0 Added the `$errors` parameter.
  633. *
  634. * @param WP_Error $errors A `WP_Error` object containing any errors generated by using invalid
  635. * credentials. Note that the error object may not contain any errors.
  636. */
  637. do_action( 'lost_password', $errors );
  638. login_header( __( 'Lost Password' ), '<p class="message">' . __( 'Please enter your username or email address. You will receive an email message with instructions on how to reset your password.' ) . '</p>', $errors );
  639. $user_login = '';
  640. if ( isset( $_POST['user_login'] ) && is_string( $_POST['user_login'] ) ) {
  641. $user_login = wp_unslash( $_POST['user_login'] );
  642. }
  643. ?>
  644. <form name="lostpasswordform" id="lostpasswordform" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ); ?>" method="post">
  645. <p>
  646. <label for="user_login"><?php _e( 'Username or Email Address' ); ?></label>
  647. <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" />
  648. </p>
  649. <?php
  650. /**
  651. * Fires inside the lostpassword form tags, before the hidden fields.
  652. *
  653. * @since 2.1.0
  654. */
  655. do_action( 'lostpassword_form' );
  656. ?>
  657. <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
  658. <p class="submit">
  659. <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Get New Password' ); ?>" />
  660. </p>
  661. </form>
  662. <p id="nav">
  663. <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
  664. <?php
  665. if ( get_option( 'users_can_register' ) ) {
  666. $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
  667. echo esc_html( $login_link_separator );
  668. /** This filter is documented in wp-includes/general-template.php */
  669. echo apply_filters( 'register', $registration_url );
  670. }
  671. ?>
  672. </p>
  673. <?php
  674. login_footer( 'user_login' );
  675. break;
  676. case 'resetpass':
  677. case 'rp':
  678. list( $rp_path ) = explode( '?', wp_unslash( $_SERVER['REQUEST_URI'] ) );
  679. $rp_cookie = 'wp-resetpass-' . COOKIEHASH;
  680. if ( isset( $_GET['key'] ) && isset( $_GET['login'] ) ) {
  681. $value = sprintf( '%s:%s', wp_unslash( $_GET['login'] ), wp_unslash( $_GET['key'] ) );
  682. setcookie( $rp_cookie, $value, 0, $rp_path, COOKIE_DOMAIN, is_ssl(), true );
  683. wp_safe_redirect( remove_query_arg( array( 'key', 'login' ) ) );
  684. exit;
  685. }
  686. if ( isset( $_COOKIE[ $rp_cookie ] ) && 0 < strpos( $_COOKIE[ $rp_cookie ], ':' ) ) {
  687. list( $rp_login, $rp_key ) = explode( ':', wp_unslash( $_COOKIE[ $rp_cookie ] ), 2 );
  688. $user = check_password_reset_key( $rp_key, $rp_login );
  689. if ( isset( $_POST['pass1'] ) && ! hash_equals( $rp_key, $_POST['rp_key'] ) ) {
  690. $user = false;
  691. }
  692. } else {
  693. $user = false;
  694. }
  695. if ( ! $user || is_wp_error( $user ) ) {
  696. setcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true );
  697. if ( $user && $user->get_error_code() === 'expired_key' ) {
  698. wp_redirect( site_url( 'wp-login.php?action=lostpassword&error=expiredkey' ) );
  699. } else {
  700. wp_redirect( site_url( 'wp-login.php?action=lostpassword&error=invalidkey' ) );
  701. }
  702. exit;
  703. }
  704. $errors = new WP_Error();
  705. if ( isset( $_POST['pass1'] ) && $_POST['pass1'] !== $_POST['pass2'] ) {
  706. $errors->add( 'password_reset_mismatch', __( '<strong>Error</strong>: The passwords do not match.' ) );
  707. }
  708. /**
  709. * Fires before the password reset procedure is validated.
  710. *
  711. * @since 3.5.0
  712. *
  713. * @param WP_Error $errors WP Error object.
  714. * @param WP_User|WP_Error $user WP_User object if the login and reset key match. WP_Error object otherwise.
  715. */
  716. do_action( 'validate_password_reset', $errors, $user );
  717. if ( ( ! $errors->has_errors() ) && isset( $_POST['pass1'] ) && ! empty( $_POST['pass1'] ) ) {
  718. reset_password( $user, $_POST['pass1'] );
  719. setcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true );
  720. login_header( __( 'Password Reset' ), '<p class="message reset-pass">' . __( 'Your password has been reset.' ) . ' <a href="' . esc_url( wp_login_url() ) . '">' . __( 'Log in' ) . '</a></p>' );
  721. login_footer();
  722. exit;
  723. }
  724. wp_enqueue_script( 'utils' );
  725. wp_enqueue_script( 'user-profile' );
  726. login_header( __( 'Reset Password' ), '<p class="message reset-pass">' . __( 'Enter your new password below or generate one.' ) . '</p>', $errors );
  727. ?>
  728. <form name="resetpassform" id="resetpassform" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=resetpass', 'login_post' ) ); ?>" method="post" autocomplete="off">
  729. <input type="hidden" id="user_login" value="<?php echo esc_attr( $rp_login ); ?>" autocomplete="off" />
  730. <div class="user-pass1-wrap">
  731. <p>
  732. <label for="pass1"><?php _e( 'New password' ); ?></label>
  733. </p>
  734. <div class="wp-pwd">
  735. <input type="password" data-reveal="1" data-pw="<?php echo esc_attr( wp_generate_password( 16 ) ); ?>" name="pass1" id="pass1" class="input password-input" size="24" value="" autocomplete="off" aria-describedby="pass-strength-result" />
  736. <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>">
  737. <span class="dashicons dashicons-hidden" aria-hidden="true"></span>
  738. </button>
  739. <div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php _e( 'Strength indicator' ); ?></div>
  740. </div>
  741. <div class="pw-weak">
  742. <input type="checkbox" name="pw_weak" id="pw-weak" class="pw-checkbox" />
  743. <label for="pw-weak"><?php _e( 'Confirm use of weak password' ); ?></label>
  744. </div>
  745. </div>
  746. <p class="user-pass2-wrap">
  747. <label for="pass2"><?php _e( 'Confirm new password' ); ?></label>
  748. <input type="password" name="pass2" id="pass2" class="input" size="20" value="" autocomplete="off" />
  749. </p>
  750. <p class="description indicator-hint"><?php echo wp_get_password_hint(); ?></p>
  751. <br class="clear" />
  752. <?php
  753. /**
  754. * Fires following the 'Strength indicator' meter in the user password reset form.
  755. *
  756. * @since 3.9.0
  757. *
  758. * @param WP_User $user User object of the user whose password is being reset.
  759. */
  760. do_action( 'resetpass_form', $user );
  761. ?>
  762. <input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>" />
  763. <p class="submit reset-pass-submit">
  764. <button type="button" class="button wp-generate-pw hide-if-no-js" aria-expanded="true"><?php _e( 'Generate Password' ); ?></button>
  765. <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Save Password' ); ?>" />
  766. </p>
  767. </form>
  768. <p id="nav">
  769. <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
  770. <?php
  771. if ( get_option( 'users_can_register' ) ) {
  772. $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
  773. echo esc_html( $login_link_separator );
  774. /** This filter is documented in wp-includes/general-template.php */
  775. echo apply_filters( 'register', $registration_url );
  776. }
  777. ?>
  778. </p>
  779. <?php
  780. login_footer( 'user_pass' );
  781. break;
  782. case 'register':
  783. if ( is_multisite() ) {
  784. /**
  785. * Filters the Multisite sign up URL.
  786. *
  787. * @since 3.0.0
  788. *
  789. * @param string $sign_up_url The sign up URL.
  790. */
  791. wp_redirect( apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ) );
  792. exit;
  793. }
  794. if ( ! get_option( 'users_can_register' ) ) {
  795. wp_redirect( site_url( 'wp-login.php?registration=disabled' ) );
  796. exit;
  797. }
  798. $user_login = '';
  799. $user_email = '';
  800. if ( $http_post ) {
  801. if ( isset( $_POST['user_login'] ) && is_string( $_POST['user_login'] ) ) {
  802. $user_login = wp_unslash( $_POST['user_login'] );
  803. }
  804. if ( isset( $_POST['user_email'] ) && is_string( $_POST['user_email'] ) ) {
  805. $user_email = wp_unslash( $_POST['user_email'] );
  806. }
  807. $errors = register_new_user( $user_login, $user_email );
  808. if ( ! is_wp_error( $errors ) ) {
  809. $redirect_to = ! empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered';
  810. wp_safe_redirect( $redirect_to );
  811. exit;
  812. }
  813. }
  814. $registration_redirect = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
  815. /**
  816. * Filters the registration redirect URL.
  817. *
  818. * @since 3.0.0
  819. *
  820. * @param string $registration_redirect The redirect destination URL.
  821. */
  822. $redirect_to = apply_filters( 'registration_redirect', $registration_redirect );
  823. login_header( __( 'Registration Form' ), '<p class="message register">' . __( 'Register For This Site' ) . '</p>', $errors );
  824. ?>
  825. <form name="registerform" id="registerform" action="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login_post' ) ); ?>" method="post" novalidate="novalidate">
  826. <p>
  827. <label for="user_login"><?php _e( 'Username' ); ?></label>
  828. <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( wp_unslash( $user_login ) ); ?>" size="20" autocapitalize="off" />
  829. </p>
  830. <p>
  831. <label for="user_email"><?php _e( 'Email' ); ?></label>
  832. <input type="email" name="user_email" id="user_email" class="input" value="<?php echo esc_attr( wp_unslash( $user_email ) ); ?>" size="25" />
  833. </p>
  834. <?php
  835. /**
  836. * Fires following the 'Email' field in the user registration form.
  837. *
  838. * @since 2.1.0
  839. */
  840. do_action( 'register_form' );
  841. ?>
  842. <p id="reg_passmail">
  843. <?php _e( 'Registration confirmation will be emailed to you.' ); ?>
  844. </p>
  845. <br class="clear" />
  846. <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
  847. <p class="submit">
  848. <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Register' ); ?>" />
  849. </p>
  850. </form>
  851. <p id="nav">
  852. <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
  853. <?php echo esc_html( $login_link_separator ); ?>
  854. <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
  855. </p>
  856. <?php
  857. login_footer( 'user_login' );
  858. break;
  859. case 'checkemail':
  860. $redirect_to = admin_url();
  861. $errors = new WP_Error();
  862. if ( 'confirm' === $_GET['checkemail'] ) {
  863. $errors->add(
  864. 'confirm',
  865. sprintf(
  866. /* translators: %s: Link to the login page. */
  867. __( 'Check your email for the confirmation link, then visit the <a href="%s">login page</a>.' ),
  868. wp_login_url()
  869. ),
  870. 'message'
  871. );
  872. } elseif ( 'registered' === $_GET['checkemail'] ) {
  873. $errors->add(
  874. 'registered',
  875. sprintf(
  876. /* translators: %s: Link to the login page. */
  877. __( 'Registration complete. Please check your email, then visit the <a href="%s">login page</a>.' ),
  878. wp_login_url()
  879. ),
  880. 'message'
  881. );
  882. }
  883. /** This action is documented in wp-login.php */
  884. $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );
  885. login_header( __( 'Check your email' ), '', $errors );
  886. login_footer();
  887. break;
  888. case 'confirmaction':
  889. if ( ! isset( $_GET['request_id'] ) ) {
  890. wp_die( __( 'Missing request ID.' ) );
  891. }
  892. if ( ! isset( $_GET['confirm_key'] ) ) {
  893. wp_die( __( 'Missing confirm key.' ) );
  894. }
  895. $request_id = (int) $_GET['request_id'];
  896. $key = sanitize_text_field( wp_unslash( $_GET['confirm_key'] ) );
  897. $result = wp_validate_user_request_key( $request_id, $key );
  898. if ( is_wp_error( $result ) ) {
  899. wp_die( $result );
  900. }
  901. /**
  902. * Fires an action hook when the account action has been confirmed by the user.
  903. *
  904. * Using this you can assume the user has agreed to perform the action by
  905. * clicking on the link in the confirmation email.
  906. *
  907. * After firing this action hook the page will redirect to wp-login a callback
  908. * redirects or exits first.
  909. *
  910. * @since 4.9.6
  911. *
  912. * @param int $request_id Request ID.
  913. */
  914. do_action( 'user_request_action_confirmed', $request_id );
  915. $message = _wp_privacy_account_request_confirmed_message( $request_id );
  916. login_header( __( 'User action confirmed.' ), $message );
  917. login_footer();
  918. exit;
  919. case 'login':
  920. default:
  921. $secure_cookie = '';
  922. $customize_login = isset( $_REQUEST['customize-login'] );
  923. if ( $customize_login ) {
  924. wp_enqueue_script( 'customize-base' );
  925. }
  926. // If the user wants SSL but the session is not SSL, force a secure cookie.
  927. if ( ! empty( $_POST['log'] ) && ! force_ssl_admin() ) {
  928. $user_name = sanitize_user( wp_unslash( $_POST['log'] ) );
  929. $user = get_user_by( 'login', $user_name );
  930. if ( ! $user && strpos( $user_name, '@' ) ) {
  931. $user = get_user_by( 'email', $user_name );
  932. }
  933. if ( $user ) {
  934. if ( get_user_option( 'use_ssl', $user->ID ) ) {
  935. $secure_cookie = true;
  936. force_ssl_admin( true );
  937. }
  938. }
  939. }
  940. if ( isset( $_REQUEST['redirect_to'] ) ) {
  941. $redirect_to = $_REQUEST['redirect_to'];
  942. // Redirect to HTTPS if user wants SSL.
  943. if ( $secure_cookie && false !== strpos( $redirect_to, 'wp-admin' ) ) {
  944. $redirect_to = preg_replace( '|^http://|', 'https://', $redirect_to );
  945. }
  946. } else {
  947. $redirect_to = admin_url();
  948. }
  949. $reauth = empty( $_REQUEST['reauth'] ) ? false : true;
  950. $user = wp_signon( array(), $secure_cookie );
  951. if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
  952. if ( headers_sent() ) {
  953. $user = new WP_Error(
  954. 'test_cookie',
  955. sprintf(
  956. /* translators: 1: Browser cookie documentation URL, 2: Support forums URL. */
  957. __( '<strong>Error</strong>: Cookies are blocked due to unexpected output. For help, please see <a href="%1$s">this documentation</a> or try the <a href="%2$s">support forums</a>.' ),
  958. __( 'https://wordpress.org/support/article/cookies/' ),
  959. __( 'https://wordpress.org/support/forums/' )
  960. )
  961. );
  962. } elseif ( isset( $_POST['testcookie'] ) && empty( $_COOKIE[ TEST_COOKIE ] ) ) {
  963. // If cookies are disabled, we can't log in even with a valid user and password.
  964. $user = new WP_Error(
  965. 'test_cookie',
  966. sprintf(
  967. /* translators: %s: Browser cookie documentation URL. */
  968. __( '<strong>Error</strong>: Cookies are blocked or not supported by your browser. You must <a href="%s">enable cookies</a> to use WordPress.' ),
  969. __( 'https://wordpress.org/support/article/cookies/#enable-cookies-in-your-browser' )
  970. )
  971. );
  972. }
  973. }
  974. $requested_redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
  975. /**
  976. * Filters the login redirect URL.
  977. *
  978. * @since 3.0.0
  979. *
  980. * @param string $redirect_to The redirect destination URL.
  981. * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter.
  982. * @param WP_User|WP_Error $user WP_User object if login was successful, WP_Error object otherwise.
  983. */
  984. $redirect_to = apply_filters( 'login_redirect', $redirect_to, $requested_redirect_to, $user );
  985. if ( ! is_wp_error( $user ) && ! $reauth ) {
  986. if ( $interim_login ) {
  987. $message = '<p class="message">' . __( 'You have logged in successfully.' ) . '</p>';
  988. $interim_login = 'success';
  989. login_header( '', $message );
  990. ?>
  991. </div>
  992. <?php
  993. /** This action is documented in wp-login.php */
  994. do_action( 'login_footer' );
  995. if ( $customize_login ) {
  996. ?>
  997. <script type="text/javascript">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php echo wp_customize_url(); ?>', channel: 'login' }).send('login') }, 1000 );</script>
  998. <?php
  999. }
  1000. ?>
  1001. </body></html>
  1002. <?php
  1003. exit;
  1004. }
  1005. // Check if it is time to add a redirect to the admin email confirmation screen.
  1006. if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( 'manage_options' ) ) {
  1007. $admin_email_lifespan = (int) get_option( 'admin_email_lifespan' );
  1008. // If `0` (or anything "falsey" as it is cast to int) is returned, the user will not be redirected
  1009. // to the admin email confirmation screen.
  1010. /** This filter is documented in wp-login.php */
  1011. $admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 6 * MONTH_IN_SECONDS );
  1012. if ( $admin_email_check_interval > 0 && time() > $admin_email_lifespan ) {
  1013. $redirect_to = add_query_arg(
  1014. array(
  1015. 'action' => 'confirm_admin_email',
  1016. 'wp_lang' => get_user_locale( $user ),
  1017. ),
  1018. wp_login_url( $redirect_to )
  1019. );
  1020. }
  1021. }
  1022. if ( ( empty( $redirect_to ) || 'wp-admin/' === $redirect_to || admin_url() === $redirect_to ) ) {
  1023. // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.
  1024. if ( is_multisite() && ! get_active_blog_for_user( $user->ID ) && ! is_super_admin( $user->ID ) ) {
  1025. $redirect_to = user_admin_url();
  1026. } elseif ( is_multisite() && ! $user->has_cap( 'read' ) ) {
  1027. $redirect_to = get_dashboard_url( $user->ID );
  1028. } elseif ( ! $user->has_cap( 'edit_posts' ) ) {
  1029. $redirect_to = $user->has_cap( 'read' ) ? admin_url( 'profile.php' ) : home_url();
  1030. }
  1031. wp_redirect( $redirect_to );
  1032. exit;
  1033. }
  1034. wp_safe_redirect( $redirect_to );
  1035. exit;
  1036. }
  1037. $errors = $user;
  1038. // Clear errors if loggedout is set.
  1039. if ( ! empty( $_GET['loggedout'] ) || $reauth ) {
  1040. $errors = new WP_Error();
  1041. }
  1042. if ( empty( $_POST ) && $errors->get_error_codes() === array( 'empty_username', 'empty_password' ) ) {
  1043. $errors = new WP_Error( '', '' );
  1044. }
  1045. if ( $interim_login ) {
  1046. if ( ! $errors->has_errors() ) {
  1047. $errors->add( 'expired', __( 'Your session has expired. Please log in to continue where you left off.' ), 'message' );
  1048. }
  1049. } else {
  1050. // Some parts of this script use the main login form to display a message.
  1051. if ( isset( $_GET['loggedout'] ) && $_GET['loggedout'] ) {
  1052. $errors->add( 'loggedout', __( 'You are now logged out.' ), 'message' );
  1053. } elseif ( isset( $_GET['registration'] ) && 'disabled' === $_GET['registration'] ) {
  1054. $errors->add( 'registerdisabled', __( '<strong>Error</strong>: User registration is currently not allowed.' ) );
  1055. } elseif ( strpos( $redirect_to, 'about.php?updated' ) ) {
  1056. $errors->add( 'updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to see what&#8217;s new.' ), 'message' );
  1057. } elseif ( WP_Recovery_Mode_Link_Service::LOGIN_ACTION_ENTERED === $action ) {
  1058. $errors->add( 'enter_recovery_mode', __( 'Recovery Mode Initialized. Please log in to continue.' ), 'message' );
  1059. } elseif ( isset( $_GET['redirect_to'] ) && false !== strpos( $_GET['redirect_to'], 'wp-admin/authorize-application.php' ) ) {
  1060. $query_component = wp_parse_url( $_GET['redirect_to'], PHP_URL_QUERY );
  1061. parse_str( $query_component, $query );
  1062. if ( ! empty( $query['app_name'] ) ) {
  1063. /* translators: 1: Website name, 2: Application name. */
  1064. $message = sprintf( 'Please log in to %1$s to authorize %2$s to connect to your account.', get_bloginfo( 'name', 'display' ), '<strong>' . esc_html( $query['app_name'] ) . '</strong>' );
  1065. } else {
  1066. /* translators: %s: Website name. */
  1067. $message = sprintf( 'Please log in to %s to proceed with authorization.', get_bloginfo( 'name', 'display' ) );
  1068. }
  1069. $errors->add( 'authorize_application', $message, 'message' );
  1070. }
  1071. }
  1072. /**
  1073. * Filters the login page errors.
  1074. *
  1075. * @since 3.6.0
  1076. *
  1077. * @param WP_Error $errors WP Error object.
  1078. * @param string $redirect_to Redirect destination URL.
  1079. */
  1080. $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );
  1081. // Clear any stale cookies.
  1082. if ( $reauth ) {
  1083. wp_clear_auth_cookie();
  1084. }
  1085. login_header( __( 'Log In' ), '', $errors );
  1086. if ( isset( $_POST['log'] ) ) {
  1087. $user_login = ( 'incorrect_password' === $errors->get_error_code() || 'empty_password' === $errors->get_error_code() ) ? esc_attr( wp_unslash( $_POST['log'] ) ) : '';
  1088. }
  1089. $rememberme = ! empty( $_POST['rememberme'] );
  1090. if ( $errors->has_errors() ) {
  1091. $aria_describedby_error = ' aria-describedby="login_error"';
  1092. } else {
  1093. $aria_describedby_error = '';
  1094. }
  1095. wp_enqueue_script( 'user-profile' );
  1096. ?>
  1097. <form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
  1098. <p>
  1099. <label for="user_login"><?php _e( 'Username or Email Address' ); ?></label>
  1100. <input type="text" name="log" id="user_login"<?php echo $aria_describedby_error; ?> class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" />
  1101. </p>
  1102. <div class="user-pass-wrap">
  1103. <label for="user_pass"><?php _e( 'Password' ); ?></label>
  1104. <div class="wp-pwd">
  1105. <input type="password" name="pwd" id="user_pass"<?php echo $aria_describedby_error; ?> class="input password-input" value="" size="20" />
  1106. <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Show password' ); ?>">
  1107. <span class="dashicons dashicons-visibility" aria-hidden="true"></span>
  1108. </button>
  1109. </div>
  1110. </div>
  1111. <?php
  1112. /**
  1113. * Fires following the 'Password' field in the login form.
  1114. *
  1115. * @since 2.1.0
  1116. */
  1117. do_action( 'login_form' );
  1118. ?>
  1119. <p class="forgetmenot"><input name="rememberme" type="checkbox" id="rememberme" value="forever" <?php checked( $rememberme ); ?> /> <label for="rememberme"><?php esc_html_e( 'Remember Me' ); ?></label></p>
  1120. <p class="submit">
  1121. <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Log In' ); ?>" />
  1122. <?php
  1123. if ( $interim_login ) {
  1124. ?>
  1125. <input type="hidden" name="interim-login" value="1" />
  1126. <?php
  1127. } else {
  1128. ?>
  1129. <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
  1130. <?php
  1131. }
  1132. if ( $customize_login ) {
  1133. ?>
  1134. <input type="hidden" name="customize-login" value="1" />
  1135. <?php
  1136. }
  1137. ?>
  1138. <input type="hidden" name="testcookie" value="1" />
  1139. </p>
  1140. </form>
  1141. <?php
  1142. if ( ! $interim_login ) {
  1143. ?>
  1144. <p id="nav">
  1145. <?php
  1146. if ( get_option( 'users_can_register' ) ) {
  1147. $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
  1148. /** This filter is documented in wp-includes/general-template.php */
  1149. echo apply_filters( 'register', $registration_url );
  1150. echo esc_html( $login_link_separator );
  1151. }
  1152. ?>
  1153. <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
  1154. </p>
  1155. <?php
  1156. }
  1157. $login_script = 'function wp_attempt_focus() {';
  1158. $login_script .= 'setTimeout( function() {';
  1159. $login_script .= 'try {';
  1160. if ( $user_login ) {
  1161. $login_script .= 'd = document.getElementById( "user_pass" ); d.value = "";';
  1162. } else {
  1163. $login_script .= 'd = document.getElementById( "user_login" );';
  1164. if ( $errors->get_error_code() === 'invalid_username' ) {
  1165. $login_script .= 'd.value = "";';
  1166. }
  1167. }
  1168. $login_script .= 'd.focus(); d.select();';
  1169. $login_script .= '} catch( er ) {}';
  1170. $login_script .= '}, 200);';
  1171. $login_script .= "}\n"; // End of wp_attempt_focus().
  1172. /**
  1173. * Filters whether to print the call to `wp_attempt_focus()` on the login screen.
  1174. *
  1175. * @since 4.8.0
  1176. *
  1177. * @param bool $print Whether to print the function call. Default true.
  1178. */
  1179. if ( apply_filters( 'enable_login_autofocus', true ) && ! $error ) {
  1180. $login_script .= "wp_attempt_focus();\n";
  1181. }
  1182. // Run `wpOnload()` if defined.
  1183. $login_script .= "if ( typeof wpOnload === 'function' ) { wpOnload() }";
  1184. ?>
  1185. <script type="text/javascript">
  1186. <?php echo $login_script; ?>
  1187. </script>
  1188. <?php
  1189. if ( $interim_login ) {
  1190. ?>
  1191. <script type="text/javascript">
  1192. ( function() {
  1193. try {
  1194. var i, links = document.getElementsByTagName( 'a' );
  1195. for ( i in links ) {
  1196. if ( links[i].href ) {
  1197. links[i].target = '_blank';
  1198. links[i].rel = 'noopener';
  1199. }
  1200. }
  1201. } catch( er ) {}
  1202. }());
  1203. </script>
  1204. <?php
  1205. }
  1206. login_footer();
  1207. break;
  1208. } // End action switch.