-
Notifications
You must be signed in to change notification settings - Fork 930
Expand file tree
/
Copy pathadmin.php
More file actions
178 lines (134 loc) · 6.75 KB
/
admin.php
File metadata and controls
178 lines (134 loc) · 6.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?php
/*
type: layout
name: Login admin
description: Admin login style
*/
?>
<?php $user = user_id(); ?>
<?php
$selected_lang = 'en';
if (isset($_COOKIE['lang'])) {
$selected_lang = $_COOKIE['lang'];
}
$current_lang = current_lang();
?>
<div id="mw-login">
<script>mw.require("tools.js");</script>
<script>mw.require("session.js");</script>
<script>
mw.session.checkPauseExplicitly = true;
$(document).ready(function () {
mw.tools.dropdown();
mw.session.checkPause = true;
mw.$("#lang_selector").bind("change", function () {
mw.cookie.set("lang", $(this).getDropdownValue());
});
});
</script>
<style type="text/css">
body {
background: #F4F4F4;
}
.mw-ui-col.main-bar-column {
display: none;
}
.main-admin-row {
max-width: none;
}
</style>
<?php
if (!isset(mw()->ui->admin_logo_login_link) or mw()->ui->admin_logo_login_link == false) {
$link = "https://microweber.com";
} else {
$link = mw()->ui->admin_logo_login_link;
}
?>
<a href="<?php print $link; ?>" target="_blank" id="login-logo"> <img src="<?php print mw()->ui->admin_logo_login(); ?>" alt="Logo"> <span class="mw-sign-version">v. <?php print MW_VERSION; ?></span> </a>
<div class="mw-ui-box">
<div class="mw-ui-box-content" id="admin_login">
<?php if ($user != false): ?>
<div>
<?php _e("Welcome"); ?>
<?php print user_name(); ?> </div>
<a href="<?php print site_url() ?>">
<?php _e("Go to"); ?>
<?php print site_url() ?></a> <a href="<?php print api_link('logout') ?>">
<?php _e("Log Out"); ?>
</a>
<?php else: ?>
<?php if (get_option('enable_user_microweber_registration', 'users') == 'y' and get_option('microweber_app_id', 'users') != false and get_option('microweber_app_secret', 'users') != false): ?>
<?php
/*
// TBA
<div style="text-align: center; margin-bottom: 1em;">
<p>
<a href="<?php echo api_url(); ?>user_social_login?provider=microweber" class="mw-ui-btn mw-ui-btn-big mw-ui-btn-info">
Use <?php echo mw()->ui->brand_name; ?> Account
</a>
</p>
<div style="margin-top: 1em;"><i>- or -</i></div>
</div>
*/
?>
<?php endif; ?>
<?php event_trigger('mw.ui.admin.login.form.before'); ?>
<form autocomplete="on" method="post" id="user_login_<?php print $params['id'] ?>" action="<?php print api_link('user_login') ?>">
<div class="mw-ui-field-holder">
<input class="mw-ui-field mw-ui-field-big silver-field" autofocus="" tabindex="1" required name="username" type="text" placeholder="<?php _e("Username or Email"); ?>" <?php if (isset($_REQUEST['username']) != false): ?> value="<?php print $_REQUEST['username'] ?>" <?php endif;
?> />
</div>
<div class="mw-ui-field-holder">
<input class="mw-ui-field mw-ui-field-big silver-field" name="password" tabindex="2" required type="password" <?php if (isset($_REQUEST['password']) != false): ?> value="<?php print $_REQUEST['password'] ?>" <?php endif; ?> placeholder="<?php _e("Password"); ?>"/>
</div>
<?php if (isset($login_captcha_enabled) and $login_captcha_enabled): ?>
<div class="mw-ui-field-holder">
<div class="mw-ui-row captcha-holder">
<div class="mw-ui-col">
<img onclick="mw.tools.refresh_image(this);" class="mw-captcha-img" id="captcha-<?php print $params['id']; ?>" src="<?php print api_link('captcha') ?>"/>
</div>
<div class="mw-ui-col">
<input name="captcha" type="text" required class="mw-ui-field mw-captcha-input" tabindex="3" placeholder="<?php _e("Security code"); ?>"/>
</div>
</div>
</div>
<?php endif; ?>
<div class="mw-ui-field-holder">
<ul class="mw-ui-inline-list pull-left">
<li><span>
<?php _e("Language"); ?>
</span></li>
<li>
<div data-value="" title="" class="mw-dropdown mw-dropdown-type-wysiwyg" id="lang_selector"> <span class="mw-dropdown-value"> <span class="mw-dropdown-arrow"></span>
<?php if ($current_lang != 'en'): ?>
<span class="mw-dropdown-val"><?php print strtoupper($current_lang); ?></span>
<?php else: ?>
<span class="mw-dropdown-val">EN</span>
<?php endif; ?>
</span>
<div class="mw-dropdown-content">
<ul>
<?php
$langs = get_available_languages(); ?>
<?php foreach ($langs as $lang): ?>
<li value="<?php print $lang; ?>" <?php if ($selected_lang == $lang) { ?> class="active" <?php } ?>><a href="javascript:;"><?php print strtoupper($lang); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
</div>
</li>
</ul>
<input type="hidden" name="where_to" value="admin_content"/>
<input class="mw-ui-btn mw-ui-btn-big mw-ui-btn-info mw-ui-btn-outline pull-right" type="submit" tabindex="4" value="<?php _e("Login"); ?>"/>
</div>
</form>
<?php event_trigger('mw.ui.admin.login.form.after'); ?>
</div>
</div>
<div id="login_foot"><a href="<?php print site_url() ?>" class="pull-left"><span class="mw-icon-back"></span>
<?php _e("Back to My WebSite"); ?>
</a> <a href="javascript:mw.load_module('users/forgot_password', '#admin_login', false, {template:'admin'});" class="mw-ui-link pull-right">
<?php _e("Forgot my password"); ?>
?</a></div>
<?php endif; ?>
</div>