login-button.php
4.1 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
<?php
// Prevent public access to this script
defined('ABSPATH') or die();
?>
<script>
window.wpo365 = window.wpo365 || {};
<?php if (class_exists('\Wpo\Core\Url_Helpers') && \Wpo\Core\Url_Helpers::is_wp_login()) :
$_site_url = $GLOBALS['WPO_CONFIG']['url_info']['wp_site_url'];
if (defined('WPO_AUTH_SCENARIO') && constant('WPO_AUTH_SCENARIO') == 'internet') {
$_site_url = \Wpo\Services\Options_Service::get_aad_option('redirect_url');
}
?>
window.wpo365.siteUrl = '<?php echo esc_url_raw($_site_url) ?>';
<?php endif; ?>
</script>
<div>
<style>
.wpo365-mssignin-wrapper {
box-sizing: border-box;
display: block;
width: 100%;
padding: 12px 12px 24px 12px;
text-align: center;
}
.wpo365-mssignin-spacearound {
display: inline-block;
}
.wpo365-mssignin-wrapper form {
display: none;
}
.wpo365-mssignin-button {
border: 1px solid #8c8c8c;
background: #ffffff;
display: flex;
display: -webkit-box;
display: -moz-box;
display: -webkit-flex;
display: -ms-flexbox;
-webkit-box-align: center;
-moz-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-moz-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
cursor: pointer;
max-height: 41px;
min-height: 41px;
height: 41px;
}
.wpo365-mssignin-logo {
padding-left: 12px;
padding-right: 6px;
-webkit-flex-shrink: 1;
-moz-flex-shrink: 1;
flex-shrink: 1;
width: 21px;
height: 21px;
box-sizing: content-box;
display: flex;
display: -webkit-box;
display: -moz-box;
display: -webkit-flex;
display: -ms-flexbox;
-webkit-box-pack: center;
-moz-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
.wpo365-mssignin-label {
white-space: nowrap;
padding-left: 6px;
padding-right: 12px;
font-weight: 600;
color: #5e5e5e;
font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
font-size: 15px;
-webkit-flex-shrink: 1;
-moz-flex-shrink: 1;
flex-shrink: 1;
height: 21px;
line-height: 21px;
}
</style>
<div id="wpo365OpenIdRedirect" class="wpo365-mssignin-wrapper">
<?php if (!$hide_login_button) : ?>
<div class="wpo365-mssignin-spacearound">
<button class="wpo365-mssignin-button" type="button" onclick="window.wpo365.pintraRedirect.toMsOnline()" aria-label="<?php echo esc_html($sign_in_with_microsoft) ?>">
<div class="wpo365-mssignin-logo">
<svg xmlns="http://www.w3.org/2000/svg" width="21" height="21" viewBox="0 0 21 21">
<title>MS-SymbolLockup</title>
<rect x="1" y="1" width="9" height="9" fill="#f25022" />
<rect x="1" y="11" width="9" height="9" fill="#00a4ef" />
<rect x="11" y="1" width="9" height="9" fill="#7fba00" />
<rect x="11" y="11" width="9" height="9" fill="#ffb900" />
</svg>
</div>
<div class="wpo365-mssignin-label"><?php echo esc_html($sign_in_with_microsoft) ?></div>
</button>
</div>
<?php endif ?>
</div>
</div>