Version Description
- Fix for Facebook registration issue
Download this release
Release Info
Developer | cyberlord92 |
Plugin | Social Login |
Version | 6.4.0 |
Comparing to | |
See all releases |
Code changes from version 6.3.3 to 6.4.0
- class-mo-openid-login-widget.php +984 -946
- miniorange_openid_sso_settings.php +1 -1
- readme.txt +7 -1
class-mo-openid-login-widget.php
CHANGED
@@ -2,602 +2,602 @@
|
|
2 |
include "twitter_oauth.php";
|
3 |
|
4 |
if(mo_openid_is_customer_registered()) {
|
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 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
<a target='_blank' href='https://www.miniorange.com/'>
|
334 |
<img alt='logo' src='". plugins_url('/includes/images/miniOrange.png',__FILE__) ."' class='mo_openid_image'>
|
335 |
</a>
|
336 |
</div>
|
337 |
<br/>";
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
|
400 |
|
401 |
<p style='color:#".$customTextColor."'> $customText</p>";
|
402 |
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
var current_url = window.location.href;
|
602 |
var cookie_name = "redirect_current_url";
|
603 |
var d = new Date();
|
@@ -605,223 +605,223 @@ if(mo_openid_is_customer_registered()) {
|
|
605 |
var expires = "expires="+d.toUTCString();
|
606 |
document.cookie = cookie_name + "=" + current_url + ";" + expires + ";path=/";
|
607 |
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
|
826 |
function mo_openid_start_session() {
|
827 |
if( !session_id() ) {
|
@@ -887,15 +887,22 @@ if(mo_openid_is_customer_registered()) {
|
|
887 |
}
|
888 |
$_SESSION['username'] = $username;
|
889 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
890 |
$userdata = array(
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
|
900 |
$user_id = wp_insert_user( $userdata);
|
901 |
|
@@ -912,7 +919,7 @@ if(mo_openid_is_customer_registered()) {
|
|
912 |
|
913 |
mo_openid_start_session();
|
914 |
$_SESSION['mo_login'] = true;
|
915 |
-
do_action( 'mo_user_register', $user_id);
|
916 |
do_action( 'miniorange_collect_attributes_for_authenticated_user', $user, mo_openid_get_redirect_url());
|
917 |
do_action( 'wp_login', $user->user_login, $user );
|
918 |
wp_set_auth_cookie( $user_id, true );
|
@@ -1100,15 +1107,21 @@ if(mo_openid_is_customer_registered()) {
|
|
1100 |
if(get_option('mo_openid_auto_register_enable')) {
|
1101 |
|
1102 |
$random_password = wp_generate_password( 10, false );
|
|
|
|
|
|
|
|
|
|
|
|
|
1103 |
$userdata = array(
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
|
1113 |
$user_id = wp_insert_user( $userdata);
|
1114 |
if(is_wp_error( $user_id )) {
|
@@ -1126,7 +1139,7 @@ if(mo_openid_is_customer_registered()) {
|
|
1126 |
update_user_meta($user_id, 'moopenid_user_avatar', $user_picture);
|
1127 |
}
|
1128 |
$_SESSION['mo_login'] = true;
|
1129 |
-
do_action( 'mo_user_register', $user_id);
|
1130 |
do_action( 'miniorange_collect_attributes_for_authenticated_user', $user, mo_openid_get_redirect_url());
|
1131 |
do_action( 'wp_login', $user->user_login, $user );
|
1132 |
wp_set_auth_cookie( $user_id, true );
|
@@ -1154,7 +1167,7 @@ if(mo_openid_is_customer_registered()) {
|
|
1154 |
$decrypted_last_name = isset($_POST['lastName']) ? mo_openid_decrypt_sanitize($_POST['lastName']): '';
|
1155 |
$decrypted_app_name = isset($_POST['appName']) ? mo_openid_decrypt_sanitize($_POST['appName']): '';
|
1156 |
$decrypted_user_id = isset($_POST['userid']) ? mo_openid_decrypt_sanitize($_POST['userid']): '';
|
1157 |
-
|
1158 |
$decrypted_app_name = mo_openid_filter_app_name($decrypted_app_name);
|
1159 |
|
1160 |
if(isset( $_POST['firstName'] ) && isset( $_POST['lastName'] )){
|
@@ -1283,19 +1296,24 @@ if(mo_openid_is_customer_registered()) {
|
|
1283 |
|
1284 |
$random_password = wp_generate_password( 10, false );
|
1285 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1286 |
$userdata = array(
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
|
1296 |
|
1297 |
$user_id = wp_insert_user( $userdata);
|
1298 |
-
|
1299 |
if(is_wp_error( $user_id )) {
|
1300 |
//print_r($user_id);
|
1301 |
wp_die('There was an error in registration. Please contact your administrator.');
|
@@ -1315,16 +1333,16 @@ if(mo_openid_is_customer_registered()) {
|
|
1315 |
$_SESSION['mo_login'] = true;
|
1316 |
|
1317 |
//registration hook
|
1318 |
-
do_action( 'mo_user_register', $user_id);
|
1319 |
do_action( 'miniorange_collect_attributes_for_authenticated_user', $user, mo_openid_get_redirect_url());
|
1320 |
//login hook
|
1321 |
do_action( 'wp_login', $user->user_login, $user );
|
1322 |
wp_set_auth_cookie( $user_id, true );
|
1323 |
-
|
1324 |
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
|
1329 |
}
|
1330 |
|
@@ -1417,7 +1435,7 @@ if(mo_openid_is_customer_registered()) {
|
|
1417 |
exit;
|
1418 |
}
|
1419 |
else {
|
1420 |
-
|
1421 |
|
1422 |
// auto registration is enabled
|
1423 |
if(get_option('mo_openid_auto_register_enable')) {
|
@@ -1433,15 +1451,21 @@ if(mo_openid_is_customer_registered()) {
|
|
1433 |
}
|
1434 |
}
|
1435 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1436 |
$userdata = array(
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
|
1446 |
|
1447 |
$user_id = wp_insert_user( $userdata);
|
@@ -1463,7 +1487,7 @@ if(mo_openid_is_customer_registered()) {
|
|
1463 |
$_SESSION['mo_login'] = true;
|
1464 |
|
1465 |
//registration hook
|
1466 |
-
do_action( 'mo_user_register', $user_id);
|
1467 |
do_action( 'miniorange_collect_attributes_for_authenticated_user', $user, mo_openid_get_redirect_url());
|
1468 |
//login hook
|
1469 |
do_action( 'wp_login', $user->user_login, $user );
|
@@ -1876,15 +1900,21 @@ if(mo_openid_is_customer_registered()) {
|
|
1876 |
|
1877 |
$random_password = wp_generate_password( 10, false );
|
1878 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1879 |
$userdata = array(
|
1880 |
-
|
1881 |
-
|
1882 |
-
|
1883 |
-
|
1884 |
-
|
1885 |
-
|
1886 |
-
|
1887 |
-
|
1888 |
|
1889 |
$user_id = wp_insert_user( $userdata);
|
1890 |
|
@@ -1906,7 +1936,7 @@ if(mo_openid_is_customer_registered()) {
|
|
1906 |
}
|
1907 |
|
1908 |
//registration hook
|
1909 |
-
do_action( 'mo_user_register', $user_id);
|
1910 |
do_action( 'miniorange_collect_attributes_for_authenticated_user', $user, mo_openid_get_redirect_url());
|
1911 |
//login hook
|
1912 |
do_action( 'wp_login', $user->user_login, $user );
|
@@ -2021,15 +2051,21 @@ if(mo_openid_is_customer_registered()) {
|
|
2021 |
}
|
2022 |
}
|
2023 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2024 |
$userdata = array(
|
2025 |
-
|
2026 |
-
|
2027 |
-
|
2028 |
-
|
2029 |
-
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
|
2034 |
$user_id = wp_insert_user( $userdata);
|
2035 |
|
@@ -2056,7 +2092,7 @@ if(mo_openid_is_customer_registered()) {
|
|
2056 |
$_SESSION['mo_login'] = true;
|
2057 |
|
2058 |
//registration hook
|
2059 |
-
do_action( 'mo_user_register', $user_id);
|
2060 |
do_action( 'miniorange_collect_attributes_for_authenticated_user', $user, mo_openid_get_redirect_url());
|
2061 |
//login hook
|
2062 |
|
@@ -2327,9 +2363,9 @@ if(mo_openid_is_customer_registered()) {
|
|
2327 |
}
|
2328 |
|
2329 |
function mo_openid_link_account( $username, $user ){
|
2330 |
-
|
2331 |
if($user){
|
2332 |
-
|
2333 |
}
|
2334 |
else{
|
2335 |
wp_die('No user is returned.');
|
@@ -2337,7 +2373,7 @@ if(mo_openid_is_customer_registered()) {
|
|
2337 |
mo_openid_start_session();
|
2338 |
$_SESSION['social_user_id'] = isset($_SESSION['social_user_id']) ? $_SESSION['social_user_id']:'';
|
2339 |
$_SESSION['social_app_name'] = isset($_SESSION['social_app_name']) ? $_SESSION['social_app_name']:'';
|
2340 |
-
|
2341 |
if(isset($userid) && is_null($_SESSION['social_user_id'] ) && is_null($_SESSION['social_app_name']))
|
2342 |
{
|
2343 |
return;
|
@@ -2353,7 +2389,7 @@ if(mo_openid_is_customer_registered()) {
|
|
2353 |
$db_prefix = $wpdb->prefix;
|
2354 |
$linked_email_id = $wpdb->get_var($wpdb->prepare("SELECT user_id FROM ".$db_prefix."mo_openid_linked_user where linked_email = \"%s\" AND linked_social_app =\"%s\"",$user_email,$social_app_name));
|
2355 |
|
2356 |
-
|
2357 |
$result = $wpdb->insert(
|
2358 |
$table_name,
|
2359 |
array(
|
@@ -2379,7 +2415,7 @@ if(mo_openid_is_customer_registered()) {
|
|
2379 |
}
|
2380 |
}
|
2381 |
|
2382 |
-
function mo_openid_send_email($user_id=''){
|
2383 |
if( get_option('mo_openid_email_enable') == 1) {
|
2384 |
global $wpdb;
|
2385 |
$admin_mail = get_option('mo_openid_admin_email');
|
@@ -2514,63 +2550,63 @@ Thank you.';
|
|
2514 |
else
|
2515 |
$content = array('status' => 'FAILURE');
|
2516 |
return $content;
|
2517 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2518 |
|
2519 |
-
|
2520 |
-
|
2521 |
-
|
2522 |
-
|
2523 |
-
|
2524 |
-
|
2525 |
-
|
2526 |
-
|
2527 |
-
|
2528 |
-
|
2529 |
-
unset($_SESSION['$mo_otptoken']);
|
2530 |
-
}
|
2531 |
-
else
|
2532 |
-
$content = array('status' =>'FAILURE');
|
2533 |
-
|
2534 |
-
return $content;
|
2535 |
-
}
|
2536 |
-
|
2537 |
-
/*
|
2538 |
-
* This function checks the time otp was sent to and the time
|
2539 |
-
* user is validating the otp. The time difference shouldn't be
|
2540 |
-
* more that 60 seconds.
|
2541 |
-
*
|
2542 |
-
* @param $sentTime - the time otp was sent to
|
2543 |
-
* @param $validatedTime - the time otp was validated
|
2544 |
-
*/
|
2545 |
-
|
2546 |
-
function checkTimeStamp($sentTime,$validatedTime){
|
2547 |
$diff = round(abs($validatedTime - $sentTime) / 60,2);
|
2548 |
-
|
2549 |
-
|
2550 |
-
|
2551 |
-
|
2552 |
-
|
2553 |
-
|
2554 |
-
|
2555 |
-
|
2556 |
-
|
2557 |
-
|
2558 |
-
|
2559 |
-
|
2560 |
-
|
2561 |
-
|
2562 |
-
|
2563 |
-
|
2564 |
-
|
2565 |
-
|
2566 |
-
|
2567 |
-
|
2568 |
-
|
2569 |
-
|
2570 |
-
|
2571 |
-
|
2572 |
-
|
2573 |
-
|
2574 |
|
2575 |
function mo_openid_filter_app_name($decrypted_app_name)
|
2576 |
{
|
@@ -2585,12 +2621,12 @@ Thank you.';
|
|
2585 |
}
|
2586 |
}
|
2587 |
|
2588 |
-
|
2589 |
-
|
2590 |
-
|
2591 |
-
|
2592 |
-
|
2593 |
-
|
2594 |
|
2595 |
function mo_openid_customize_logo(){
|
2596 |
$logo =" <div style='float:left;' class='mo_image_id'>
|
@@ -2603,7 +2639,7 @@ Thank you.';
|
|
2603 |
}
|
2604 |
|
2605 |
//delete rows from account linking table that correspond to deleted user
|
2606 |
-
|
2607 |
global $wpdb;
|
2608 |
$db_prefix = $wpdb->prefix;
|
2609 |
$result = $wpdb->get_var($wpdb->prepare("DELETE from ".$db_prefix."mo_openid_linked_user where user_id = %s ",$user_id));
|
@@ -2615,32 +2651,34 @@ Thank you.';
|
|
2615 |
}
|
2616 |
}
|
2617 |
|
2618 |
-
function mo_openid_update_role($user_id=''){
|
|
|
|
|
2619 |
if(get_option('mo_openid_login_role_mapping') ){
|
2620 |
$user = get_user_by('ID',$user_id);
|
2621 |
$user->set_role( get_option('mo_openid_login_role_mapping') );
|
2622 |
}
|
2623 |
}
|
2624 |
|
2625 |
-
|
2626 |
-
|
2627 |
-
|
2628 |
|
2629 |
-
|
2630 |
add_action( 'widgets_init', function(){register_widget( "mo_openid_sharing_ver_wid" );});
|
2631 |
add_action( 'widgets_init', function(){register_widget( "mo_openid_sharing_hor_wid" );});
|
2632 |
|
2633 |
-
|
2634 |
-
|
2635 |
-
|
2636 |
-
add_action( 'mo_user_register', 'mo_openid_update_role', 1,
|
2637 |
-
|
2638 |
-
|
2639 |
-
|
2640 |
add_action( 'delete_user', 'mo_openid_delete_account_linking_rows' );
|
2641 |
-
add_action( 'mo_user_register','mo_openid_send_email',1,
|
2642 |
|
2643 |
-
|
2644 |
add_filter('sanitize_user', 'mo_openid_sanitize_user', 10, 3);
|
2645 |
remove_filter('sanitize_title','sanitize_title_with_dashes', 10);
|
2646 |
add_filter( 'sanitize_title', 'mo_openid_sanitize_title_with_dashes', 10, 3 );
|
2 |
include "twitter_oauth.php";
|
3 |
|
4 |
if(mo_openid_is_customer_registered()) {
|
5 |
+
/*
|
6 |
+
* Login Widget
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
class mo_openid_login_wid extends WP_Widget {
|
10 |
+
|
11 |
+
public function __construct() {
|
12 |
+
parent::__construct(
|
13 |
+
'mo_openid_login_wid',
|
14 |
+
'miniOrange Social Login Widget',
|
15 |
+
array(
|
16 |
+
'description' => __( 'Login using Social Apps like Google, Facebook, LinkedIn, Microsoft, Instagram.', 'flw' ),
|
17 |
+
'customize_selective_refresh' => true,
|
18 |
+
)
|
19 |
+
);
|
20 |
+
}
|
21 |
+
|
22 |
+
public function widget( $args, $instance ) {
|
23 |
+
extract( $args );
|
24 |
+
|
25 |
+
echo $args['before_widget'];
|
26 |
+
$this->openidloginForm();
|
27 |
+
|
28 |
+
echo $args['after_widget'];
|
29 |
+
}
|
30 |
+
|
31 |
+
public function update( $new_instance, $old_instance ) {
|
32 |
+
$instance = array();
|
33 |
+
$instance['wid_title'] = strip_tags( $new_instance['wid_title'] );
|
34 |
+
return $instance;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function openidloginForm(){
|
38 |
+
|
39 |
+
global $post;
|
40 |
+
$selected_theme = get_option('mo_openid_login_theme');
|
41 |
+
$appsConfigured = get_option('mo_openid_google_enable') | get_option('mo_openid_salesforce_enable') | get_option('mo_openid_facebook_enable') | get_option('mo_openid_linkedin_enable') | get_option('mo_openid_instagram_enable') | get_option('mo_openid_amazon_enable') | get_option('mo_openid_windowslive_enable') | get_option('mo_openid_twitter_enable') | get_option('mo_openid_vkontakte_enable');
|
42 |
+
$spacebetweenicons = get_option('mo_login_icon_space');
|
43 |
+
$customWidth = get_option('mo_login_icon_custom_width');
|
44 |
+
$customHeight = get_option('mo_login_icon_custom_height');
|
45 |
+
$customSize = get_option('mo_login_icon_custom_size');
|
46 |
+
$customBackground = get_option('mo_login_icon_custom_color');
|
47 |
+
$customTheme = get_option('mo_openid_login_custom_theme');
|
48 |
+
$customTextofTitle = get_option('mo_openid_login_button_customize_text');
|
49 |
+
$customBoundary = get_option('mo_login_icon_custom_boundary');
|
50 |
+
$customLogoutName = get_option('mo_openid_login_widget_customize_logout_name_text');
|
51 |
+
$customLogoutLink = get_option('mo_openid_login_widget_customize_logout_text');
|
52 |
+
$customTextColor=get_option('mo_login_openid_login_widget_customize_textcolor');
|
53 |
+
$customText=get_option('mo_openid_login_widget_customize_text');
|
54 |
+
|
55 |
+
$facebook_custom_app = $this->if_custom_app_exists('facebook');
|
56 |
+
$google_custom_app = $this->if_custom_app_exists('google');
|
57 |
+
$twitter_custom_app = $this->if_custom_app_exists('twitter');
|
58 |
+
$salesforce_custom_app = $this->if_custom_app_exists('salesforce');
|
59 |
+
$linkedin_custom_app = $this->if_custom_app_exists('linkedin');
|
60 |
+
$windowslive_custom_app = $this->if_custom_app_exists('windowslive');
|
61 |
+
$vkontakte_custom_app = $this->if_custom_app_exists('vkontakte');
|
62 |
+
$amazon_custom_app = $this->if_custom_app_exists('amazon');
|
63 |
+
$instagram_custom_app = $this->if_custom_app_exists('instagram');
|
64 |
+
|
65 |
+
if( ! is_user_logged_in() ) {
|
66 |
+
|
67 |
+
if( $appsConfigured ) {
|
68 |
+
$this->mo_openid_load_login_script();
|
69 |
+
?>
|
70 |
+
|
71 |
+
<div class="mo-openid-app-icons">
|
72 |
+
|
73 |
+
<p style="color:#<?php echo $customTextColor ?>"><?php echo $customText ?>
|
74 |
+
</p>
|
75 |
+
<?php
|
76 |
+
if($customTheme == 'default'){
|
77 |
+
if( get_option('mo_openid_facebook_enable') ) {
|
78 |
+
if($selected_theme == 'longbutton'){
|
79 |
+
?>
|
80 |
+
|
81 |
+
<a rel='nofollow' onClick="moOpenIdLogin('facebook','<?php echo $facebook_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-facebook btn-custom-size login-button" > <i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-facebook"></i><?php
|
82 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Facebook</a>
|
83 |
+
<?php
|
84 |
+
|
85 |
+
}else{ ?>
|
86 |
+
|
87 |
+
<a rel='nofollow' title="<?php echo $customTextofTitle ?> Facebook" onClick="moOpenIdLogin('facebook','<?php echo $facebook_custom_app?>');"><img alt='Facebook' style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important" src="<?php echo plugins_url( 'includes/images/icons/facebook.png', __FILE__ )?>" class="<?php echo $selected_theme; ?> login-button" ></a>
|
88 |
+
|
89 |
+
<?php }
|
90 |
+
|
91 |
+
}
|
92 |
+
if( get_option('mo_openid_google_enable') ) {
|
93 |
+
if($selected_theme == 'longbutton'){
|
94 |
+
?>
|
95 |
+
|
96 |
+
<a rel='nofollow' onClick="moOpenIdLogin('google','<?php echo $google_custom_app?>');" style='width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;border-radius:<?php echo $customBoundary ?>px !important;' class='btn btn-block btn-social btn-google btn-custom-size login-button' > <i style='padding-top:<?php echo $customHeight-35 ?>px !important' class='fa fa-google-plus'></i><?php
|
97 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Google</a>
|
98 |
+
<?php }
|
99 |
+
else{ ?>
|
100 |
+
<a rel='nofollow' onClick="moOpenIdLogin('google','<?php echo $google_custom_app?>');" title="<?php echo $customTextofTitle ?> Google" ><img alt='Google' style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important" src="<?php echo plugins_url( 'includes/images/icons/google.png', __FILE__ )?>" class="<?php echo $selected_theme; ?> login-button" ></a>
|
101 |
+
<?php
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
if( get_option('mo_openid_vkontakte_enable') ) {
|
106 |
+
if($selected_theme == 'longbutton'){
|
107 |
+
?>
|
108 |
+
|
109 |
+
<a rel='nofollow' onClick="moOpenIdLogin('vkontakte','<?php echo $vkontakte_custom_app?>');" style='width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;border-radius:<?php echo $customBoundary ?>px !important;' class='btn btn-block btn-social btn-vk btn-custom-size login-button' > <i style='padding-top:<?php echo $customHeight-35 ?>px !important' class='fa fa-vk'></i><?php
|
110 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Vkontakte</a>
|
111 |
+
<?php }
|
112 |
+
else{ ?>
|
113 |
+
<a rel='nofollow' onClick="moOpenIdLogin('vkontakte','<?php echo $vkontakte_custom_app?>');" title="<?php echo $customTextofTitle ?> Vkontakte" ><img alt='Vkontakte' style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important" src="<?php echo plugins_url( 'includes/images/icons/vk.png', __FILE__ )?>" class="<?php echo $selected_theme; ?> login-button" ></a>
|
114 |
+
<?php
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
|
119 |
+
if( get_option('mo_openid_twitter_enable') ) {
|
120 |
+
if($selected_theme == 'longbutton'){
|
121 |
+
?> <a rel='nofollow' onClick="moOpenIdLogin('twitter','<?php echo $twitter_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-twitter btn-custom-size login-button" > <i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-twitter"></i><?php
|
122 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Twitter</a>
|
123 |
+
<?php }
|
124 |
+
else{ ?>
|
125 |
+
|
126 |
+
|
127 |
+
<a rel='nofollow' title="<?php echo $customTextofTitle ?> Twitter" onClick="moOpenIdLogin('twitter','<?php echo $twitter_custom_app?>');"><img alt='Twitter' style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important" src="<?php echo plugins_url( 'includes/images/icons/twitter.png', __FILE__ )?>" class="<?php echo $selected_theme; ?> login-button"></a>
|
128 |
+
<?php }
|
129 |
+
}
|
130 |
+
|
131 |
+
if( get_option('mo_openid_linkedin_enable') ) {
|
132 |
+
if($selected_theme == 'longbutton'){ ?>
|
133 |
+
<a rel='nofollow' onClick="moOpenIdLogin('linkedin','<?php echo $linkedin_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-linkedin btn-custom-size login-button" > <i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-linkedin"></i><?php
|
134 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> LinkedIn</a>
|
135 |
+
<?php }
|
136 |
+
else{ ?>
|
137 |
+
<a rel='nofollow' title="<?php echo $customTextofTitle ?> LinkedIn" onClick="moOpenIdLogin('linkedin','<?php echo $linkedin_custom_app?>');"><img alt='LinkedIn' style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important" src="<?php echo plugins_url( 'includes/images/icons/linkedin.png', __FILE__ )?>" class="<?php echo $selected_theme; ?> login-button" ></a>
|
138 |
+
<?php }
|
139 |
+
}if( get_option('mo_openid_instagram_enable') ) {
|
140 |
+
if($selected_theme == 'longbutton'){ ?>
|
141 |
+
<a rel='nofollow' onClick="moOpenIdLogin('instagram','<?php echo $instagram_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-instagram btn-custom-size login-button" > <i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-instagram"></i><?php
|
142 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Instagram</a>
|
143 |
+
<?php }
|
144 |
+
else{ ?>
|
145 |
+
|
146 |
+
|
147 |
+
<a rel='nofollow' title="<?php echo $customTextofTitle ?> Instagram" onClick="moOpenIdLogin('instagram','<?php echo $instagram_custom_app?>');"><img alt='Instagram' style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important" src="<?php echo plugins_url( 'includes/images/icons/instagram.png', __FILE__ )?>" class="<?php echo $selected_theme; ?> login-button"></a>
|
148 |
+
<?php }
|
149 |
+
}if( get_option('mo_openid_amazon_enable') ) {
|
150 |
+
if($selected_theme == 'longbutton'){
|
151 |
+
?> <a rel='nofollow' onClick="moOpenIdLogin('amazon','<?php echo $amazon_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-soundcloud btn-custom-size login-button" > <i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-amazon"></i><?php
|
152 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Amazon</a>
|
153 |
+
<?php }
|
154 |
+
else{ ?>
|
155 |
+
|
156 |
+
<a rel='nofollow' title="<?php echo $customTextofTitle ?> Amazon" onClick="moOpenIdLogin('amazon','<?php echo $amazon_custom_app?>');"><img alt='Amazon' style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important" src="<?php echo plugins_url( 'includes/images/icons/amazon.png', __FILE__ )?>" class="<?php echo $selected_theme; ?> login-button"></a>
|
157 |
+
<?php }
|
158 |
+
}if( get_option('mo_openid_salesforce_enable') ) {
|
159 |
+
if($selected_theme == 'longbutton'){
|
160 |
+
?> <a rel='nofollow' onClick="moOpenIdLogin('salesforce','<?php echo $salesforce_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-vimeo btn-custom-size login-button" > <i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-cloud"></i> <?php
|
161 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Salesforce</a>
|
162 |
+
<?php }
|
163 |
+
else{ ?>
|
164 |
+
|
165 |
+
|
166 |
+
<a rel='nofollow' title="<?php echo $customTextofTitle ?> Salesforce" onClick="moOpenIdLogin('salesforce','<?php echo $salesforce_custom_app?>');"><img alt='Salesforce' style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important" src="<?php echo plugins_url( 'includes/images/icons/salesforce.png', __FILE__ )?>" class="<?php echo $selected_theme; ?> login-button" ></a>
|
167 |
+
<?php }
|
168 |
+
}if( get_option('mo_openid_windowslive_enable') ) {
|
169 |
+
if($selected_theme == 'longbutton'){
|
170 |
+
?> <a rel='nofollow' onClick="moOpenIdLogin('windowslive','<?php echo $windowslive_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-microsoft btn-custom-size login-button" > <i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-windows"></i><?php
|
171 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Microsoft</a>
|
172 |
+
<?php }
|
173 |
+
else{ ?>
|
174 |
+
|
175 |
+
|
176 |
+
<a rel='nofollow' title="<?php echo $customTextofTitle ?> Microsoft" onClick="moOpenIdLogin('windowslive','<?php echo $windowslive_custom_app?>');"><img alt='Windowslive' style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important" src="<?php echo plugins_url( 'includes/images/icons/windowslive.png', __FILE__ )?>" class="<?php echo $selected_theme; ?> login-button"></a>
|
177 |
+
<?php }
|
178 |
+
}
|
179 |
+
|
180 |
+
}
|
181 |
+
?>
|
182 |
+
|
183 |
+
|
184 |
+
|
185 |
+
<?php
|
186 |
+
if($customTheme == 'custom'){
|
187 |
+
if( get_option('mo_openid_facebook_enable') ) {
|
188 |
+
if($selected_theme == 'longbutton'){
|
189 |
+
?> <a rel='nofollow' onClick="moOpenIdLogin('facebook','<?php echo $facebook_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;background:<?php echo "#".$customBackground?> !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-facebook btn-custom-size login-button" > <i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-facebook"></i><?php
|
190 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Facebook</a>
|
191 |
+
<?php }
|
192 |
+
else{ ?>
|
193 |
+
|
194 |
+
<a rel='nofollow' onClick="moOpenIdLogin('facebook','<?php echo $facebook_custom_app?>');" title="<?php echo $customTextofTitle ?> Facebook"><i style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important;background:<?php echo "#".$customBackground?> !important;font-size:<?php echo $customSize-16?>px !important;" class="fa fa-facebook custom-login-button <?php echo $selected_theme; ?>" ></i></a>
|
195 |
+
|
196 |
+
<?php }
|
197 |
+
|
198 |
+
}
|
199 |
+
|
200 |
+
if( get_option('mo_openid_google_enable') ) {
|
201 |
+
if($selected_theme == 'longbutton'){
|
202 |
+
?>
|
203 |
+
|
204 |
+
<a rel='nofollow' onClick="moOpenIdLogin('google','<?php echo $google_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important; background:<?php echo "#".$customBackground?> !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-customtheme btn-custom-size login-button" > <i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-google-plus"></i><?php
|
205 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Google</a>
|
206 |
+
<?php }
|
207 |
+
else{ ?>
|
208 |
+
<a rel='nofollow' onClick="moOpenIdLogin('google','<?php echo $google_custom_app?>');" title="<?php echo $customTextofTitle ?> Google"><i style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important;background:<?php echo "#".$customBackground?> !important;font-size:<?php echo $customSize-16?>px !important;" class="fa fa-google-plus custom-login-button <?php echo $selected_theme; ?>" ></i></a>
|
209 |
+
<?php
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
if( get_option('mo_openid_vkontakte_enable') ) {
|
214 |
+
if($selected_theme == 'longbutton'){
|
215 |
+
?>
|
216 |
+
|
217 |
+
<a rel='nofollow' onClick="moOpenIdLogin('vkontakte','<?php echo $vkontakte_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important; background:<?php echo "#".$customBackground?> !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-customtheme btn-custom-size login-button" > <i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-vk"></i><?php
|
218 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Vkontakte</a>
|
219 |
+
<?php }
|
220 |
+
else{ ?>
|
221 |
+
<a rel='nofollow' onClick="moOpenIdLogin('vkontakte','<?php echo $vkontakte_custom_app?>');" title="<?php echo $customTextofTitle ?> Vkontakte"><i style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important;background:<?php echo "#".$customBackground?> !important;font-size:<?php echo $customSize-16?>px !important;" class="fa fa-vk custom-login-button <?php echo $selected_theme; ?>" ></i></a>
|
222 |
+
<?php
|
223 |
+
}
|
224 |
+
}
|
225 |
+
|
226 |
+
if( get_option('mo_openid_twitter_enable') ) {
|
227 |
+
if($selected_theme == 'longbutton'){
|
228 |
+
?>
|
229 |
+
|
230 |
+
<a rel='nofollow' onClick="moOpenIdLogin('twitter','<?php echo $twitter_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important; background:<?php echo "#".$customBackground?> !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-customtheme btn-custom-size login-button" > <i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-twitter"></i><?php
|
231 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Twitter</a>
|
232 |
+
<?php }
|
233 |
+
else{ ?>
|
234 |
+
<a rel='nofollow' onClick="moOpenIdLogin('twitter','<?php echo $twitter_custom_app?>');" title="<?php echo $customTextofTitle ?> Twitter"><i style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important;background:<?php echo "#".$customBackground?> !important;font-size:<?php echo $customSize-16?>px !important;" class="fa fa-twitter custom-login-button <?php echo $selected_theme; ?>" ></i></a>
|
235 |
+
<?php
|
236 |
+
}
|
237 |
+
}
|
238 |
+
if( get_option('mo_openid_linkedin_enable') ) {
|
239 |
+
if($selected_theme == 'longbutton'){ ?>
|
240 |
+
<a rel='nofollow' onClick="moOpenIdLogin('linkedin','<?php echo $linkedin_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;background:<?php echo "#".$customBackground?> !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-linkedin btn-custom-size login-button" > <i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-linkedin"></i><?php
|
241 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> LinkedIn</a>
|
242 |
+
<?php }
|
243 |
+
else{ ?>
|
244 |
+
<a rel='nofollow' onClick="moOpenIdLogin('linkedin','<?php echo $linkedin_custom_app?>');" title="<?php echo $customTextofTitle ?> LinkedIn"><i style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important;background:<?php echo "#".$customBackground?> !important;font-size:<?php echo $customSize-16?>px !important;" class="fa fa-linkedin custom-login-button <?php echo $selected_theme; ?>" ></i></a>
|
245 |
+
<?php }
|
246 |
+
}if( get_option('mo_openid_instagram_enable') ) {
|
247 |
+
if($selected_theme == 'longbutton'){ ?>
|
248 |
+
<a rel='nofollow' onClick="moOpenIdLogin('instagram','<?php echo $instagram_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;background:<?php echo "#".$customBackground?> !important;background:<?php echo "#".$customBackground?> !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-instagram btn-custom-size login-button" > <i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-instagram"></i><?php
|
249 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Instagram</a>
|
250 |
+
<?php }
|
251 |
+
else{ ?>
|
252 |
+
|
253 |
+
|
254 |
+
<a rel='nofollow' onClick="moOpenIdLogin('instagram','<?php echo $instagram_custom_app?>');" title="<?php echo $customTextofTitle ?> Instagram"><i style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important;background:<?php echo "#".$customBackground?> !important;font-size:<?php echo $customSize-16?>px !important;" class="fa fa-instagram custom-login-button <?php echo $selected_theme; ?>"></i></a>
|
255 |
+
<?php }
|
256 |
+
}if( get_option('mo_openid_amazon_enable') ) {
|
257 |
+
if($selected_theme == 'longbutton'){
|
258 |
+
?> <a rel='nofollow' onClick="moOpenIdLogin('amazon','<?php echo $amazon_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;background:<?php echo "#".$customBackground?> !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-linkedin btn-custom-size login-button" ><i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-amazon"></i><?php
|
259 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Amazon</a>
|
260 |
+
<?php }
|
261 |
+
else{ ?>
|
262 |
+
|
263 |
+
<a rel='nofollow' onClick="moOpenIdLogin('amazon','<?php echo $amazon_custom_app?>');" title="<?php echo $customTextofTitle ?> Amazon"><i style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important;background:<?php echo "#".$customBackground?> !important;font-size:<?php echo $customSize-16?>px !important;" class="fa fa-amazon custom-login-button <?php echo $selected_theme; ?>"></i></a>
|
264 |
+
<?php }
|
265 |
+
}if( get_option('mo_openid_salesforce_enable') ) {
|
266 |
+
if($selected_theme == 'longbutton'){
|
267 |
+
?> <a rel='nofollow' onClick="moOpenIdLogin('salesforce','<?php echo $salesforce_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;background:<?php echo "#".$customBackground?> !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-linkedin btn-custom-size login-button" ><i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-cloud"></i> <?php
|
268 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Salesforce</a>
|
269 |
+
<?php }
|
270 |
+
else{ ?>
|
271 |
+
|
272 |
+
|
273 |
+
<a rel='nofollow' onClick="moOpenIdLogin('salesforce','<?php echo $salesforce_custom_app?>');" title="<?php echo $customTextofTitle ?> Salesforce"><i style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important;background:<?php echo "#".$customBackground?> !important;font-size:<?php echo $customSize-16?>px " class="fa fa-cloud custom-login-button <?php echo $selected_theme; ?>" ></i></a>
|
274 |
+
<?php }
|
275 |
+
}if( get_option('mo_openid_windowslive_enable') ) {
|
276 |
+
if($selected_theme == 'longbutton'){
|
277 |
+
?> <a rel='nofollow' onClick="moOpenIdLogin('windowslive','<?php echo $windowslive_custom_app?>');" style="width:<?php echo $customWidth ?>px !important;padding-top:<?php echo $customHeight-29 ?>px !important;padding-bottom:<?php echo $customHeight-29 ?>px !important;margin-bottom:<?php echo $spacebetweenicons-5 ?>px !important;background:<?php echo "#".$customBackground?> !important;border-radius:<?php echo $customBoundary ?>px !important;" class="btn btn-block btn-social btn-microsoft btn-custom-size login-button" > <i style="padding-top:<?php echo $customHeight-35 ?>px !important" class="fa fa-windows"></i><?php
|
278 |
+
echo get_option('mo_openid_login_button_customize_text'); ?> Microsoft</a>
|
279 |
+
<?php }
|
280 |
+
else{ ?>
|
281 |
+
|
282 |
+
|
283 |
+
<a rel='nofollow' onClick="moOpenIdLogin('windowslive','<?php echo $windowslive_custom_app?>');" title="<?php echo $customTextofTitle ?> Microsoft"><i style="width:<?php echo $customSize?>px !important;height:<?php echo $customSize?>px !important;margin-left:<?php echo $spacebetweenicons-4?>px !important;background:<?php echo "#".$customBackground?> !important;font-size:<?php echo $customSize-16?>px !important;" class=" fa fa-windows custom-login-button <?php echo $selected_theme; ?>"></i></a>
|
284 |
+
<?php }
|
285 |
+
}
|
286 |
+
|
287 |
+
|
288 |
+
}
|
289 |
+
?>
|
290 |
+
<br>
|
291 |
+
</div>
|
292 |
+
<?php
|
293 |
+
|
294 |
+
|
295 |
+
}
|
296 |
+
else {
|
297 |
+
?>
|
298 |
+
<div>No apps configured. Please contact your administrator.</div>
|
299 |
+
<?php
|
300 |
+
}
|
301 |
+
if(get_option('mo_openid_oauth')=='1' && $appsConfigured && get_option('moopenid_logo_check') == 1){
|
302 |
+
$logo_html = $this->mo_openid_customize_logo();
|
303 |
+
echo $logo_html;
|
304 |
+
}
|
305 |
+
?>
|
306 |
+
<br />
|
307 |
+
<?php
|
308 |
+
}else {
|
309 |
+
global $current_user;
|
310 |
+
$current_user = wp_get_current_user();
|
311 |
+
$customLogoutName = str_replace('##username##', $current_user->display_name, $customLogoutName);
|
312 |
+
$link_with_username = $customLogoutName;
|
313 |
+
if (empty($customLogoutName) || empty($customLogoutLink)) {
|
314 |
+
?>
|
315 |
+
<div id="logged_in_user" class="mo_openid_login_wid">
|
316 |
+
<li><?php echo $link_with_username;?> <a href="<?php echo wp_logout_url( site_url() ); ?>" title="<?php _e('Logout','flw');?>"><?php _e($customLogoutLink,'flw');?></a></li>
|
317 |
+
</div>
|
318 |
+
<?php
|
319 |
+
|
320 |
+
}
|
321 |
+
else {
|
322 |
+
?>
|
323 |
+
<div id="logged_in_user" class="mo_openid_login_wid">
|
324 |
+
<li><?php echo $link_with_username;?> <a href="<?php echo wp_logout_url( site_url() ); ?>" title="<?php _e('Logout','flw');?>"><?php _e($customLogoutLink,'flw');?></a></li>
|
325 |
+
</div>
|
326 |
+
<?php
|
327 |
+
}
|
328 |
+
}
|
329 |
+
}
|
330 |
+
|
331 |
+
public function mo_openid_customize_logo(){
|
332 |
+
$logo =" <div style='float:left;' class='mo_image_id'>
|
333 |
<a target='_blank' href='https://www.miniorange.com/'>
|
334 |
<img alt='logo' src='". plugins_url('/includes/images/miniOrange.png',__FILE__) ."' class='mo_openid_image'>
|
335 |
</a>
|
336 |
</div>
|
337 |
<br/>";
|
338 |
+
return $logo;
|
339 |
+
}
|
340 |
+
|
341 |
+
public function if_custom_app_exists($app_name){
|
342 |
+
if(get_option('mo_openid_apps_list'))
|
343 |
+
$appslist = get_option('mo_openid_apps_list');
|
344 |
+
else
|
345 |
+
$appslist = array();
|
346 |
+
|
347 |
+
foreach( $appslist as $key => $app){
|
348 |
+
if($app_name == $key)
|
349 |
+
return 'true';
|
350 |
+
}
|
351 |
+
return 'false';
|
352 |
+
}
|
353 |
+
|
354 |
+
public function openidloginFormShortCode( $atts ){
|
355 |
+
|
356 |
+
global $post;
|
357 |
+
$html = '';
|
358 |
+
//$this->error_message();
|
359 |
+
$selected_theme = isset( $atts['shape'] )? $atts['shape'] : get_option('mo_openid_login_theme');
|
360 |
+
$appsConfigured = get_option('mo_openid_google_enable') | get_option('mo_openid_salesforce_enable') | get_option('mo_openid_facebook_enable') | get_option('mo_openid_linkedin_enable') | get_option('mo_openid_instagram_enable') | get_option('mo_openid_amazon_enable') | get_option('mo_openid_windowslive_enable') |get_option('mo_openid_twitter_enable') | get_option('mo_openid_vkontakte_enable');
|
361 |
+
$spacebetweenicons = isset( $atts['space'] )? $atts['space'] : get_option('mo_login_icon_space');
|
362 |
+
$customWidth = isset( $atts['width'] )? $atts['width'] : get_option('mo_login_icon_custom_width');
|
363 |
+
$customHeight = isset( $atts['height'] )? $atts['height'] : get_option('mo_login_icon_custom_height');
|
364 |
+
$customSize = isset( $atts['size'] )? $atts['size'] : get_option('mo_login_icon_custom_size');
|
365 |
+
$customBackground = isset( $atts['background'] )? $atts['background'] : get_option('mo_login_icon_custom_color');
|
366 |
+
$customTheme = isset( $atts['theme'] )? $atts['theme'] : get_option('mo_openid_login_custom_theme');
|
367 |
+
$customText = get_option('mo_openid_login_widget_customize_text');
|
368 |
+
$buttonText = get_option('mo_openid_login_button_customize_text');
|
369 |
+
$customTextofTitle = get_option('mo_openid_login_button_customize_text');
|
370 |
+
$logoutUrl = wp_logout_url( site_url() );
|
371 |
+
$customBoundary = isset( $atts['edge'] )? $atts['edge'] : get_option('mo_login_icon_custom_boundary');
|
372 |
+
$customLogoutName = get_option('mo_openid_login_widget_customize_logout_name_text');
|
373 |
+
$customLogoutLink = get_option('mo_openid_login_widget_customize_logout_text');
|
374 |
+
$customTextColor= isset( $atts['color'] )? $atts['color'] : get_option('mo_login_openid_login_widget_customize_textcolor');
|
375 |
+
$customText=isset( $atts['heading'] )? $atts['heading'] :get_option('mo_openid_login_widget_customize_text');
|
376 |
+
|
377 |
+
$facebook_custom_app = $this->if_custom_app_exists('facebook');
|
378 |
+
$google_custom_app = $this->if_custom_app_exists('google');
|
379 |
+
$twitter_custom_app = $this->if_custom_app_exists('twitter');
|
380 |
+
$salesforce_custom_app = $this->if_custom_app_exists('salesforce');
|
381 |
+
$linkedin_custom_app = $this->if_custom_app_exists('linkedin');
|
382 |
+
$windowslive_custom_app = $this->if_custom_app_exists('windowslive');
|
383 |
+
$vkontakte_custom_app = $this->if_custom_app_exists('vkontakte');
|
384 |
+
$amazon_custom_app = $this->if_custom_app_exists('amazon');
|
385 |
+
$instagram_custom_app = $this->if_custom_app_exists('instagram');
|
386 |
+
|
387 |
+
if($selected_theme == 'longbuttonwithtext'){
|
388 |
+
$selected_theme = 'longbutton';
|
389 |
+
}
|
390 |
+
if($customTheme == 'custombackground'){
|
391 |
+
$customTheme = 'custom';
|
392 |
+
}
|
393 |
+
|
394 |
+
if( ! is_user_logged_in() ) {
|
395 |
+
|
396 |
+
if( $appsConfigured ) {
|
397 |
+
$this->mo_openid_load_login_script();
|
398 |
+
$html .= "<div class='mo-openid-app-icons'>
|
399 |
|
400 |
|
401 |
<p style='color:#".$customTextColor."'> $customText</p>";
|
402 |
|
403 |
+
if($customTheme == 'default'){
|
404 |
+
|
405 |
+
if( get_option('mo_openid_facebook_enable') ) {
|
406 |
+
if($selected_theme == 'longbutton'){
|
407 |
+
$html .= "<a rel='nofollow' style='width: " . $customWidth . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom: " . ($spacebetweenicons-5) . "px !important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-facebook btn-custom-dec login-button' onClick=\"moOpenIdLogin('facebook','" .$facebook_custom_app."');\"> <i style='padding-top:" . ($customHeight-35) . "px !important' class='fa fa-facebook'></i>" . $buttonText . " Facebook</a>"; }
|
408 |
+
else{
|
409 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." Facebook' onClick=\"moOpenIdLogin('facebook','" .$facebook_custom_app."');\" ><img alt='Facebook' style='width:" . $customSize ."px !important;height: " . $customSize ."px !important;margin-left: " . ($spacebetweenicons) ."px !important' src='" . plugins_url( 'includes/images/icons/facebook.png', __FILE__ ) . "' class='login-button " .$selected_theme . "' ></a>";
|
410 |
+
}
|
411 |
+
|
412 |
+
}
|
413 |
+
|
414 |
+
if( get_option('mo_openid_google_enable') ) {
|
415 |
+
if($selected_theme == 'longbutton'){
|
416 |
+
$html .= "<a rel='nofollow' style='width: " . $customWidth . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom: " . ($spacebetweenicons-5) . "px !important;border-radius: " .$customBoundary ."px !important;' class='btn btn-block btn-social btn-google btn-custom-dec login-button' onClick=\"moOpenIdLogin('google','".$google_custom_app."');\"> <i style='padding-top:" . ($customHeight-35) . "px !important' class='fa fa-google-plus'></i>" . $buttonText . " Google</a>";
|
417 |
+
}
|
418 |
+
else{
|
419 |
+
|
420 |
+
$html .= "<a rel='nofollow' onClick=\"moOpenIdLogin('google','".$google_custom_app."');\" title= ' ".$customTextofTitle." Google'><img alt='Google' style='width:" . $customSize ."px !important;height: " . $customSize ."px !important;margin-left: " . ($spacebetweenicons) ."px !important' src='" . plugins_url( 'includes/images/icons/google.png', __FILE__ ) . "' class='login-button " .$selected_theme . "' ></a>";
|
421 |
+
|
422 |
+
}
|
423 |
+
}
|
424 |
+
|
425 |
+
if( get_option('mo_openid_vkontakte_enable') ) {
|
426 |
+
if($selected_theme == 'longbutton'){
|
427 |
+
$html .= "<a rel='nofollow' style='width: " . $customWidth . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom: " . ($spacebetweenicons-5) . "px !important;border-radius: " .$customBoundary ."px !important;' class='btn btn-block btn-social btn-vk btn-custom-dec login-button' onClick=\"moOpenIdLogin('vkontakte','" .
|
428 |
+
$vkontakte_custom_app.
|
429 |
+
"');\"> <i style='padding-top:" . ($customHeight-35) . "px !important' class='fa fa-vk'></i>" . $buttonText . " Vkontakte</a>";
|
430 |
+
}
|
431 |
+
else{
|
432 |
+
|
433 |
+
$html .= "<a rel='nofollow' onClick=\"moOpenIdLogin('vkontakte','" .
|
434 |
+
$vkontakte_custom_app.
|
435 |
+
"');\" title= ' ".$customTextofTitle." Vkontakte'><img alt='Vkontakte' style='width:" . $customSize ."px !important;height: " . $customSize ."px !important;margin-left: " . ($spacebetweenicons) ."px !important' src='" . plugins_url( 'includes/images/icons/vk.png', __FILE__ ) . "' class='login-button " .$selected_theme . "' ></a>";
|
436 |
+
|
437 |
+
}
|
438 |
+
}
|
439 |
+
|
440 |
+
if( get_option('mo_openid_twitter_enable') ) {
|
441 |
+
if($selected_theme == 'longbutton'){
|
442 |
+
$html .= "<a rel='nofollow' style='width: " . $customWidth . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom: " . ($spacebetweenicons-5) . "px !important;border-radius: " .$customBoundary ."px !important;' class='btn btn-block btn-social btn-twitter btn-custom-dec login-button' onClick=\"moOpenIdLogin('twitter','" .
|
443 |
+
$twitter_custom_app.
|
444 |
+
"');\"> <i style='padding-top:" . ($customHeight-35) . "px !important' class='fa fa-twitter'></i>" . $buttonText . " Twitter</a>"; }
|
445 |
+
else{
|
446 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." Twitter' onClick=\"moOpenIdLogin('twitter','" .
|
447 |
+
$twitter_custom_app. "');\" ><img alt='Twitter' style='width:" . $customSize ."px !important;height: " . $customSize ."px !important;margin-left: " . ($spacebetweenicons) ."px !important' src='" . plugins_url( 'includes/images/icons/twitter.png', __FILE__ ) . "' class='login-button " .$selected_theme . "' ></a>";
|
448 |
+
}
|
449 |
+
|
450 |
+
}
|
451 |
+
if( get_option('mo_openid_linkedin_enable') ) {
|
452 |
+
if($selected_theme == 'longbutton'){
|
453 |
+
$html .= "<a rel='nofollow' style='width: " . $customWidth . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom: " . ($spacebetweenicons-5) . "px !important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-linkedin btn-custom-dec login-button' onClick=\"moOpenIdLogin('linkedin','" .$twitter_custom_app . "');\"> <i style='padding-top:" . ($customHeight-35) . "px !important' class='fa fa-linkedin'></i>" . $buttonText . " LinkedIn</a>";
|
454 |
+
}
|
455 |
+
else{
|
456 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." LinkedIn' onClick=\"moOpenIdLogin('linkedin','" . $linkedin_custom_app . "');\" ><img alt='LinkedIn' style='width:" . $customSize ."px !important;height: " . $customSize ."px !important;margin-left: " . ($spacebetweenicons) ."px !important' src='" . plugins_url( 'includes/images/icons/linkedin.png', __FILE__ ) . "' class='login-button " .$selected_theme . "' ></a>";
|
457 |
+
}
|
458 |
+
}if( get_option('mo_openid_instagram_enable') ) {
|
459 |
+
if($selected_theme == 'longbutton'){
|
460 |
+
$html .= "<a rel='nofollow' style='width: " . $customWidth . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom: " . ($spacebetweenicons-5) . "px !important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-instagram btn-custom-dec login-button' onClick=\"moOpenIdLogin('instagram','" . $instagram_custom_app . "');\"> <i style='padding-top:" . ($customHeight-35) . "px !important' class='fa fa-instagram'></i>" . $buttonText . " Instagram</a>";
|
461 |
+
}
|
462 |
+
else{
|
463 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." Instagram' onClick=\"moOpenIdLogin('instagram','" . $instagram_custom_app . "');\" ><img alt='Instagram' style='width:" . $customSize ."px !important;height: " . $customSize ."px !important;margin-left: " . ($spacebetweenicons) ."px !important' src='" . plugins_url( 'includes/images/icons/instagram.png', __FILE__ ) . "' class='login-button " .$selected_theme . "' ></a>";
|
464 |
+
}
|
465 |
+
}if( get_option('mo_openid_amazon_enable') ) {
|
466 |
+
if($selected_theme == 'longbutton'){
|
467 |
+
$html .= "<a rel='nofollow' style='width: " . $customWidth . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom: " . ($spacebetweenicons-5) . "px !important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-soundcloud btn-custom-dec login-button' onClick=\"moOpenIdLogin('amazon','" . $amazon_custom_app . "');\"> <i style='padding-top:" . ($customHeight-35) . "px !important' class='fa fa-amazon'></i>" . $buttonText . " Amazon</a>";
|
468 |
+
}
|
469 |
+
else{
|
470 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." Amazon' onClick=\"moOpenIdLogin('amazon','" . $amazon_custom_app . "');\" ><img alt='Amazon' style='width:" . $customSize ."px !important;height: " . $customSize ."px !important;margin-left: " . ($spacebetweenicons) ."px !important' src='" . plugins_url( 'includes/images/icons/amazon.png', __FILE__ ) . "' class='login-button " .$selected_theme . "' ></a>";
|
471 |
+
}
|
472 |
+
}if( get_option('mo_openid_salesforce_enable') ) {
|
473 |
+
if($selected_theme == 'longbutton'){
|
474 |
+
$html .= "<a rel='nofollow' style='width: " . $customWidth . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom: " . ($spacebetweenicons-5) . "px !important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-vimeo btn-custom-dec login-button' onClick=\"moOpenIdLogin('salesforce','" . $salesforce_custom_app . "');\"> <i style='padding-top:" . ($customHeight-35) . "px !important' class='fa fa-cloud'></i>" . $buttonText . " Salesforce</a>";
|
475 |
+
}
|
476 |
+
else{
|
477 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." Salesforce' onClick=\"moOpenIdLogin('salesforce','" . $salesforce_custom_app . "');\" ><img alt='Salesforce' style='width:" . $customSize ."px !important;height: " . $customSize ."px !important;margin-left: " . ($spacebetweenicons) ."px !important' src='" . plugins_url( 'includes/images/icons/salesforce.png', __FILE__ ) . "' class='login-button " .$selected_theme . "' ></a>";
|
478 |
+
}
|
479 |
+
}if( get_option('mo_openid_windowslive_enable') ) {
|
480 |
+
if($selected_theme == 'longbutton'){
|
481 |
+
$html .= "<a rel='nofollow' style='width: " . $customWidth . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom: " . ($spacebetweenicons-5) . "px !important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-microsoft btn-custom-dec login-button' onClick=\"moOpenIdLogin('windowslive','" . $windowslive_custom_app . "');\"> <i style='padding-top:" . ($customHeight-35) . "px !important' class='fa fa-windows'></i>" . $buttonText . " Microsoft</a>";
|
482 |
+
}
|
483 |
+
else{
|
484 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." Microsoft' onClick=\"moOpenIdLogin('windowslive','" . $windowslive_custom_app . "');\" ><img alt='Windowslive' style='width:" . $customSize ."px !important;height: " . $customSize ."px !important;margin-left: " . ($spacebetweenicons) ."px !important' src='" . plugins_url( 'includes/images/icons/windowslive.png', __FILE__ ) . "' class='login-button " .$selected_theme . "' ></a>";
|
485 |
+
}
|
486 |
+
}
|
487 |
+
}
|
488 |
+
|
489 |
+
|
490 |
+
|
491 |
+
if($customTheme == 'custom'){
|
492 |
+
if( get_option('mo_openid_facebook_enable') ) {
|
493 |
+
if($selected_theme == 'longbutton'){
|
494 |
+
$html .= "<a rel='nofollow' onClick=\"moOpenIdLogin('facebook','" . $facebook_custom_app . "');\" style='width:" . ($customWidth) . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom:" . ($spacebetweenicons-5) . "px !important; background:#" . $customBackground . "!important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-customtheme btn-custom-dec login-button' > <i style='padding-top:" .($customHeight-35) . "px !important' class='fa fa-facebook'></i> " . $buttonText . " Facebook</a>";
|
495 |
+
}
|
496 |
+
else{
|
497 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." Facebook' onClick=\"moOpenIdLogin('facebook','" . $facebook_custom_app . "');\" ><i style='width:" . $customSize . "px !important;height:" . $customSize . "px !important;margin-left:" . ($spacebetweenicons) . "px !important;background:#" . $customBackground . " !important;font-size: " . ($customSize-16) . "px !important;' class='fa fa-facebook custom-login-button " . $selected_theme . "' ></i></a>";
|
498 |
+
}
|
499 |
+
|
500 |
+
}
|
501 |
+
|
502 |
+
if( get_option('mo_openid_google_enable') ) {
|
503 |
+
if($selected_theme == 'longbutton'){
|
504 |
+
$html .= "<a rel='nofollow' onClick=\"moOpenIdLogin('google','" .$google_custom_app . "');\" style='width:" . ($customWidth) . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom:" . ($spacebetweenicons-5) . "px !important; background:#" . $customBackground . "!important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-customtheme btn-custom-dec login-button' > <i style='padding-top:" .($customHeight-35) . "px !important' class='fa fa-google-plus'></i> " . $buttonText . " Google</a>";
|
505 |
+
}
|
506 |
+
else{
|
507 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." Google' onClick=\"moOpenIdLogin('google','" . $google_custom_app . "');\" title= ' ". $customTextofTitle." Google'><i style='width:" . $customSize . "px !important;height:" . $customSize . "px !important;margin-left:" . ($spacebetweenicons) . "px !important;background:#" . $customBackground . " !important;font-size: " . ($customSize-16) . "px !important;' class='fa fa-google-plus custom-login-button " . $selected_theme . "' ></i></a>";
|
508 |
+
|
509 |
+
}
|
510 |
+
}
|
511 |
+
|
512 |
+
if( get_option('mo_openid_vkontakte_enable') ) {
|
513 |
+
if($selected_theme == 'longbutton'){
|
514 |
+
$html .= "<a rel='nofollow' onClick=\"moOpenIdLogin('vkontakte','" . $vkontakte_custom_app . "');\" style='width:" . ($customWidth) . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom:" . ($spacebetweenicons-5) . "px !important; background:#" . $customBackground . "!important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-customtheme btn-custom-dec login-button' > <i style='padding-top:" .($customHeight-35) . "px !important' class='fa fa-vk'></i> " . $buttonText . " Vkontakte</a>";
|
515 |
+
}
|
516 |
+
else{
|
517 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." Vkontakte' onClick=\"moOpenIdLogin('vkontakte','" . $vkontakte_custom_app. "');\" title= ' ". $customTextofTitle." Vkontakte'><i style='width:" . $customSize . "px !important;height:" . $customSize . "px !important;margin-left:" . ($spacebetweenicons) . "px !important;background:#" . $customBackground . " !important;font-size: " . ($customSize-16) . "px !important;' class='fa fa-vk custom-login-button " . $selected_theme . "' ></i></a>";
|
518 |
+
|
519 |
+
}
|
520 |
+
}
|
521 |
+
|
522 |
+
if( get_option('mo_openid_twitter_enable') ) {
|
523 |
+
if($selected_theme == 'longbutton'){
|
524 |
+
$html .= "<a rel='nofollow' onClick=\"moOpenIdLogin('twitter','" . $twitter_custom_app . "');\" style='width:" . ($customWidth) . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom:" . ($spacebetweenicons-5) . "px !important; background:#" . $customBackground . "!important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-customtheme btn-custom-dec login-button' > <i style='padding-top:" .($customHeight-35) . "px !important' class='fa fa-twitter'></i> " . $buttonText . " Twitter</a>";
|
525 |
+
}
|
526 |
+
else{
|
527 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." Twitter' onClick=\"moOpenIdLogin('twitter','" . $twitter_custom_app . "');\" ><i style='width:" . $customSize . "px !important;height:" . $customSize . "px !important;margin-left:" . ($spacebetweenicons) . "px !important;background:#" . $customBackground . " !important;font-size: " . ($customSize-16) . "px !important;' class='fa fa-twitter custom-login-button " . $selected_theme . "' ></i></a>";
|
528 |
+
}
|
529 |
+
|
530 |
+
}
|
531 |
+
if( get_option('mo_openid_linkedin_enable') ) {
|
532 |
+
if($selected_theme == 'longbutton'){
|
533 |
+
$html .= "<a rel='nofollow' onClick=\"moOpenIdLogin('linkedin','" . $linkedin . "');\" style='width:" . ($customWidth) . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom:" . ($spacebetweenicons-5) . "px !important; background:#" . $customBackground . "!important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-customtheme btn-custom-dec login-button' > <i style='padding-top:" .($customHeight-35) . "px !important' class='fa fa-linkedin'></i> " . $buttonText . " LinkedIn</a>";
|
534 |
+
}
|
535 |
+
else{
|
536 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." LinkedIn' onClick=\"moOpenIdLogin('linkedin','" . $linkedin_custom_app . "');\" ><i style='width:" . $customSize . "px !important;height:" . $customSize . "px !important;margin-left:" . ($spacebetweenicons) . "px !important;background:#" . $customBackground . " !important;font-size: " . ($customSize-16) . "px !important;' class='fa fa-linkedin custom-login-button " . $selected_theme . "' ></i></a>";
|
537 |
+
}
|
538 |
+
}if( get_option('mo_openid_instagram_enable') ) {
|
539 |
+
if($selected_theme == 'longbutton'){
|
540 |
+
$html .= "<a rel='nofollow' onClick=\"moOpenIdLogin('instagram','" . $instagram_custom_app . "');\" style='width:" . ($customWidth) . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom:" . ($spacebetweenicons-5) . "px !important; background:#" . $customBackground . "!important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-customtheme btn-custom-dec login-button' > <i style='padding-top:" .($customHeight-35) . "px !important' class='fa fa-instagram'></i> " . $buttonText . " Instagram</a>";
|
541 |
+
}
|
542 |
+
else{
|
543 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." Instagram' onClick=\"moOpenIdLogin('instagram','" . $instagram_custom_app . "');\" ><i style='width:" . $customSize . "px !important;height:" . $customSize . "px !important;margin-left:" . ($spacebetweenicons) . "px !important;background:#" . $customBackground . " !important;font-size: " . ($customSize-16) . "px !important;' class='fa fa-instagram custom-login-button " . $selected_theme . "' ></i></a>";
|
544 |
+
}
|
545 |
+
}if( get_option('mo_openid_amazon_enable') ) {
|
546 |
+
if($selected_theme == 'longbutton'){
|
547 |
+
$html .= "<a rel='nofollow' onClick=\"moOpenIdLogin('amazon','" . $amazon_custom_app . "');\" style='width:" . ($customWidth) . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom:" . ($spacebetweenicons-5) . "px !important; background:#" . $customBackground . "!important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-customtheme btn-custom-dec login-button' > <i style='padding-top:" .($customHeight-35) . "px !important' class='fa fa-amazon'></i> " . $buttonText . " Amazon</a>";
|
548 |
+
}
|
549 |
+
else{
|
550 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." Amazon' onClick=\"moOpenIdLogin('amazon','" . $amazon_custom_app . "');\" ><i style='width:" . $customSize . "px !important;height:" . $customSize . "px !important;margin-left:" . ($spacebetweenicons) . "px !important;background:#" . $customBackground . " !important;font-size: " . ($customSize-16) . "px !important;' class='fa fa-amazon custom-login-button " . $selected_theme . "' ></i></a>";
|
551 |
+
}
|
552 |
+
}if( get_option('mo_openid_salesforce_enable') ) {
|
553 |
+
if($selected_theme == 'longbutton'){
|
554 |
+
$html .= "<a rel='nofollow' onClick=\"moOpenIdLogin('salesforce','" . $salesforce_custom_app . "');\" style='width:" . ($customWidth) . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom:" . ($spacebetweenicons-5) . "px !important; background:#" . $customBackground . "!important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-customtheme btn-custom-dec login-button' > <i style='padding-top:" .($customHeight-35) . "px !important' class='fa fa-cloud'></i> " . $buttonText . " Salesforce</a>";
|
555 |
+
}
|
556 |
+
else{
|
557 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." Salesforce' onClick=\"moOpenIdLogin('salesforce','" . $salesforce_custom_app . "');\" ><i style='width:" . $customSize . "px !important;height:" . $customSize . "px !important;margin-left:" . ($spacebetweenicons) . "px !important;background:#" . $customBackground . " !important;font-size: " . ($customSize-16) . "px !important;' class='fa fa-cloud custom-login-button " . $selected_theme . "' ></i></a>";
|
558 |
+
}
|
559 |
+
}if( get_option('mo_openid_windowslive_enable') ) {
|
560 |
+
if($selected_theme == 'longbutton'){
|
561 |
+
$html .= "<a rel='nofollow' onClick=\"moOpenIdLogin('windowslive','" . $windowslive_custom_app . "');\" style='width:" . ($customWidth) . "px !important;padding-top:" . ($customHeight-29) . "px !important;padding-bottom:" . ($customHeight-29) . "px !important;margin-bottom:" . ($spacebetweenicons-5) . "px !important; background:#" . $customBackground . "!important;border-radius: " .$customBoundary. "px !important;' class='btn btn-block btn-social btn-customtheme btn-custom-dec login-button' > <i style='padding-top:" .($customHeight-35) . "px !important' class='fa fa-windows'></i> " . $buttonText . " Microsoft</a>";
|
562 |
+
}
|
563 |
+
else{
|
564 |
+
$html .= "<a rel='nofollow' title= ' ".$customTextofTitle." Microsoft' onClick=\"moOpenIdLogin('windowslive','" . $windowslive_custom_app . "');\" ><i style='width:" . $customSize . "px !important;height:" . $customSize . "px !important;margin-left:" . ($spacebetweenicons) . "px !important;background:#" . $customBackground . " !important;font-size: " . ($customSize-16) . "px !important;' class='fa fa-windows custom-login-button " . $selected_theme . "' ></i></a>";
|
565 |
+
}
|
566 |
+
}
|
567 |
+
}
|
568 |
+
$html .= '</div> <br>';
|
569 |
+
|
570 |
+
}
|
571 |
+
else {
|
572 |
+
|
573 |
+
$html .= '<div>No apps configured. Please contact your administrator.</div>';
|
574 |
+
|
575 |
+
}
|
576 |
+
if(get_option('mo_openid_oauth')=='1' && $appsConfigured && get_option('moopenid_logo_check') == 1 ){
|
577 |
+
$logo_html=$this->mo_openid_customize_logo();
|
578 |
+
$html .= $logo_html;
|
579 |
+
}
|
580 |
+
?>
|
581 |
+
<br/>
|
582 |
+
<?php
|
583 |
+
}else {
|
584 |
+
global $current_user;
|
585 |
+
$current_user = wp_get_current_user();
|
586 |
+
$customLogoutName = str_replace('##username##', $current_user->display_name, $customLogoutName);
|
587 |
+
$flw = __($customLogoutLink,"flw");
|
588 |
+
if (empty($customLogoutName) || empty($customLogoutLink)) {
|
589 |
+
$html .= '<div id="logged_in_user" class="mo_openid_login_wid">' . $customLogoutName . ' <a href=' . $logoutUrl .' title=" ' . $flw . '"> ' . $flw . '</a></div>';
|
590 |
+
}
|
591 |
+
else {
|
592 |
+
$html .= '<div id="logged_in_user" class="mo_openid_login_wid">' . $customLogoutName . ' <a href=' . $logoutUrl .' title=" ' . $flw . '"> ' . $flw . '</a></div>';
|
593 |
+
}
|
594 |
+
}
|
595 |
+
return $html;
|
596 |
+
}
|
597 |
+
|
598 |
+
private function mo_openid_load_login_script() {?>
|
599 |
+
<script type="text/javascript">
|
600 |
+
function moOpenIdLogin(app_name,is_custom_app) {
|
601 |
var current_url = window.location.href;
|
602 |
var cookie_name = "redirect_current_url";
|
603 |
var d = new Date();
|
605 |
var expires = "expires="+d.toUTCString();
|
606 |
document.cookie = cookie_name + "=" + current_url + ";" + expires + ";path=/";
|
607 |
|
608 |
+
<?php
|
609 |
+
|
610 |
+
if(isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'){
|
611 |
+
$http = "https://";
|
612 |
+
} else {
|
613 |
+
$http = "http://";
|
614 |
+
}
|
615 |
+
?>
|
616 |
+
var base_url = '<?php echo site_url();?>';
|
617 |
+
var request_uri = '<?php echo $_SERVER['REQUEST_URI'];?>';
|
618 |
+
var http = '<?php echo $http;?>';
|
619 |
+
var http_host = '<?php echo $_SERVER['HTTP_HOST'];?>';
|
620 |
+
|
621 |
+
if(is_custom_app == 'false'){
|
622 |
+
if ( request_uri.indexOf('wp-login.php') !=-1){
|
623 |
+
var redirect_url = base_url + '/?option=getmosociallogin&app_name=';
|
624 |
+
|
625 |
+
}else {
|
626 |
+
var redirect_url = http + http_host + request_uri;
|
627 |
+
if(redirect_url.indexOf('?') != -1){
|
628 |
+
redirect_url = redirect_url +'&option=getmosociallogin&app_name=';
|
629 |
+
}
|
630 |
+
else
|
631 |
+
{
|
632 |
+
redirect_url = redirect_url +'?option=getmosociallogin&app_name=';
|
633 |
+
}
|
634 |
+
}
|
635 |
+
}
|
636 |
+
else {
|
637 |
+
|
638 |
+
if ( request_uri.indexOf('wp-login.php') !=-1){
|
639 |
+
var redirect_url = base_url + '/?option=oauthredirect&app_name=';
|
640 |
+
|
641 |
+
}else {
|
642 |
+
var redirect_url = http + http_host + request_uri;
|
643 |
+
if(redirect_url.indexOf('?') != -1)
|
644 |
+
redirect_url = redirect_url +'&option=oauthredirect&app_name=';
|
645 |
+
else
|
646 |
+
redirect_url = redirect_url +'?option=oauthredirect&app_name=';
|
647 |
+
}
|
648 |
+
|
649 |
+
}
|
650 |
+
window.location.href = redirect_url + app_name;
|
651 |
+
}
|
652 |
+
</script>
|
653 |
+
<?php
|
654 |
+
}
|
655 |
+
|
656 |
+
/*public function error_message(){
|
657 |
+
if(isset($_SESSION['msg']) and $_SESSION['msg']){
|
658 |
+
echo '<div class="'.$_SESSION['msg_class'].'">'.$_SESSION['msg'].'</div>';
|
659 |
+
unset($_SESSION['msg']);
|
660 |
+
unset($_SESSION['msg_class']);
|
661 |
+
}
|
662 |
+
}*/
|
663 |
+
|
664 |
+
}
|
665 |
+
|
666 |
+
/**
|
667 |
+
* Sharing Widget Horizontal
|
668 |
+
*
|
669 |
+
*/
|
670 |
+
class mo_openid_sharing_hor_wid extends WP_Widget {
|
671 |
+
|
672 |
+
public function __construct() {
|
673 |
+
parent::__construct(
|
674 |
+
'mo_openid_sharing_hor_wid',
|
675 |
+
'miniOrange Sharing - Horizontal',
|
676 |
+
array(
|
677 |
+
'description' => __( 'Share using horizontal widget. Lets you share with Social Apps like Google, Facebook, LinkedIn, Pinterest, Reddit.', 'flw' ),
|
678 |
+
'customize_selective_refresh' => true,
|
679 |
+
)
|
680 |
+
);
|
681 |
+
}
|
682 |
+
|
683 |
+
public function widget( $args, $instance ) {
|
684 |
+
extract( $args );
|
685 |
+
|
686 |
+
echo $args['before_widget'];
|
687 |
+
$this->show_sharing_buttons_horizontal();
|
688 |
+
|
689 |
+
echo $args['after_widget'];
|
690 |
+
}
|
691 |
+
|
692 |
+
public function update( $new_instance, $old_instance ) {
|
693 |
+
$instance = array();
|
694 |
+
$instance['wid_title'] = strip_tags( $new_instance['wid_title'] );
|
695 |
+
return $instance;
|
696 |
+
}
|
697 |
+
|
698 |
+
public function show_sharing_buttons_horizontal(){
|
699 |
+
global $post;
|
700 |
+
$title = str_replace('+', '%20', urlencode($post->post_title));
|
701 |
+
$content=strip_shortcodes( strip_tags( get_the_content() ) );
|
702 |
+
$post_content=$content;
|
703 |
+
$excerpt = '';
|
704 |
+
$landscape = 'horizontal';
|
705 |
+
include( plugin_dir_path( __FILE__ ) . 'class-mo-openid-social-share.php');
|
706 |
+
}
|
707 |
+
|
708 |
+
}
|
709 |
+
|
710 |
+
|
711 |
+
/**
|
712 |
+
* Sharing Vertical Widget
|
713 |
+
*
|
714 |
+
*/
|
715 |
+
class mo_openid_sharing_ver_wid extends WP_Widget {
|
716 |
+
|
717 |
+
public function __construct() {
|
718 |
+
parent::__construct(
|
719 |
+
'mo_openid_sharing_ver_wid',
|
720 |
+
'miniOrange Sharing - Vertical',
|
721 |
+
array(
|
722 |
+
'description' => __( 'Share using a vertical floating widget. Lets you share with Social Apps like Google, Facebook, LinkedIn, Pinterest, Reddit.', 'flw' ),
|
723 |
+
'customize_selective_refresh' => true,
|
724 |
+
)
|
725 |
+
);
|
726 |
+
}
|
727 |
+
|
728 |
+
public function widget( $args, $instance ) {
|
729 |
+
extract( $args );
|
730 |
+
extract( $instance );
|
731 |
+
|
732 |
+
$wid_title = apply_filters( 'widget_title', $instance['wid_title'] );
|
733 |
+
$alignment = apply_filters( 'alignment', isset($instance['alignment'])? $instance['alignment'] : 'left');
|
734 |
+
$left_offset = apply_filters( 'left_offset', isset($instance['left_offset'])? $instance['left_offset'] : '20');
|
735 |
+
$right_offset = apply_filters( 'right_offset', isset($instance['right_offset'])? $instance['right_offset'] : '0');
|
736 |
+
$top_offset = apply_filters( 'top_offset', isset($instance['top_offset'])? $instance['top_offset'] : '100');
|
737 |
+
$space_icons = apply_filters( 'space_icons', isset($instance['space_icons'])? $instance['space_icons'] : '10');
|
738 |
+
|
739 |
+
echo $args['before_widget'];
|
740 |
+
if ( ! empty( $wid_title ) )
|
741 |
+
echo $args['before_title'] . $wid_title . $args['after_title'];
|
742 |
+
|
743 |
+
echo "<div class='mo_openid_vertical' style='" .(isset($alignment) && $alignment != '' && isset($instance[$alignment.'_offset']) ? $alignment .': '. ( $instance[$alignment.'_offset'] == '' ? 0 : $instance[$alignment.'_offset'] ) .'px;' : '').(isset($top_offset) ? 'top: '. ( $top_offset == '' ? 0 : $top_offset ) .'px;' : '') ."'>";
|
744 |
+
|
745 |
+
$this->show_sharing_buttons_vertical($space_icons);
|
746 |
+
|
747 |
+
echo '</div>';
|
748 |
+
|
749 |
+
echo $args['after_widget'];
|
750 |
+
}
|
751 |
+
|
752 |
+
/*Called when user changes configuration in Widget Admin Panel*/
|
753 |
+
public function update( $new_instance, $old_instance ) {
|
754 |
+
$instance = $old_instance;
|
755 |
+
$instance['wid_title'] = strip_tags( $new_instance['wid_title'] );
|
756 |
+
$instance['alignment'] = $new_instance['alignment'];
|
757 |
+
$instance['left_offset'] = $new_instance['left_offset'];
|
758 |
+
$instance['right_offset'] = $new_instance['right_offset'];
|
759 |
+
$instance['top_offset'] = $new_instance['top_offset'];
|
760 |
+
$instance['space_icons'] = $new_instance['space_icons'];
|
761 |
+
return $instance;
|
762 |
+
}
|
763 |
+
|
764 |
+
|
765 |
+
public function show_sharing_buttons_vertical($space_icons){
|
766 |
+
global $post;
|
767 |
+
if($post->post_title) {
|
768 |
+
$title = str_replace('+', '%20', urlencode($post->post_title));
|
769 |
+
} else {
|
770 |
+
$title = get_bloginfo( 'name' );
|
771 |
+
}
|
772 |
+
$content=strip_shortcodes( strip_tags( get_the_content() ) );
|
773 |
+
$post_content=$content;
|
774 |
+
$excerpt = '';
|
775 |
+
$landscape = 'vertical';
|
776 |
+
|
777 |
+
include( plugin_dir_path( __FILE__ ) . 'class-mo-openid-social-share.php');
|
778 |
+
}
|
779 |
+
|
780 |
+
/** Widget edit form at admin panel */
|
781 |
+
function form( $instance ) {
|
782 |
+
/* Set up default widget settings. */
|
783 |
+
$defaults = array('alignment' => 'left', 'left_offset' => '20', 'right_offset' => '0', 'top_offset' => '100' , 'space_icons' => '10');
|
784 |
+
|
785 |
+
foreach( $instance as $key => $value ){
|
786 |
+
$instance[ $key ] = esc_attr( $value );
|
787 |
+
}
|
788 |
+
|
789 |
+
$instance = wp_parse_args( (array)$instance, $defaults );
|
790 |
+
?>
|
791 |
+
<p>
|
792 |
+
<script>
|
793 |
+
function moOpenIDVerticalSharingOffset(alignment){
|
794 |
+
if(alignment == 'left'){
|
795 |
+
jQuery('.moVerSharingLeftOffset').css('display', 'block');
|
796 |
+
jQuery('.moVerSharingRightOffset').css('display', 'none');
|
797 |
+
}else{
|
798 |
+
jQuery('.moVerSharingLeftOffset').css('display', 'none');
|
799 |
+
jQuery('.moVerSharingRightOffset').css('display', 'block');
|
800 |
+
}
|
801 |
+
}
|
802 |
+
</script>
|
803 |
+
<label for="<?php echo $this->get_field_id( 'alignment' ); ?>">Alignment</label>
|
804 |
+
<select onchange="moOpenIDVerticalSharingOffset(this.value)" style="width: 95%" id="<?php echo $this->get_field_id( 'alignment' ); ?>" name="<?php echo $this->get_field_name( 'alignment' ); ?>">
|
805 |
+
<option value="left" <?php echo $instance['alignment'] == 'left' ? 'selected' : ''; ?>>Left</option>
|
806 |
+
<option value="right" <?php echo $instance['alignment'] == 'right' ? 'selected' : ''; ?>>Right</option>
|
807 |
+
</select>
|
808 |
+
<div class="moVerSharingLeftOffset" <?php echo $instance['alignment'] == 'right' ? 'style="display: none"' : ''; ?>>
|
809 |
+
<label for="<?php echo $this->get_field_id( 'left_offset' ); ?>">Left Offset</label>
|
810 |
+
<input style="width: 95%" id="<?php echo $this->get_field_id( 'left_offset' ); ?>" name="<?php echo $this->get_field_name( 'left_offset' ); ?>" type="text" value="<?php echo $instance['left_offset']; ?>" />px<br/>
|
811 |
+
</div>
|
812 |
+
<div class="moVerSharingRightOffset" <?php echo $instance['alignment'] == 'left' ? 'style="display: none"' : ''; ?>>
|
813 |
+
<label for="<?php echo $this->get_field_id( 'right_offset' ); ?>">Right Offset</label>
|
814 |
+
<input style="width: 95%" id="<?php echo $this->get_field_id( 'right_offset' ); ?>" name="<?php echo $this->get_field_name( 'right_offset' ); ?>" type="text" value="<?php echo $instance['right_offset']; ?>" />px<br/>
|
815 |
+
</div>
|
816 |
+
<label for="<?php echo $this->get_field_id( 'top_offset' ); ?>">Top Offset</label>
|
817 |
+
<input style="width: 95%" id="<?php echo $this->get_field_id( 'top_offset' ); ?>" name="<?php echo $this->get_field_name( 'top_offset' ); ?>" type="text" value="<?php echo $instance['top_offset']; ?>" />px<br/>
|
818 |
+
<label for="<?php echo $this->get_field_id( 'space_icons' ); ?>">Space between icons</label>
|
819 |
+
<input style="width: 95%" id="<?php echo $this->get_field_id( 'space_icons' ); ?>" name="<?php echo $this->get_field_name( 'space_icons' ); ?>" type="text" value="<?php echo $instance['space_icons']; ?>" />px<br/>
|
820 |
+
</p>
|
821 |
+
<?php
|
822 |
+
}
|
823 |
+
|
824 |
+
}
|
825 |
|
826 |
function mo_openid_start_session() {
|
827 |
if( !session_id() ) {
|
887 |
}
|
888 |
$_SESSION['username'] = $username;
|
889 |
}
|
890 |
+
|
891 |
+
$user_url = $_SESSION['user_url'] ;
|
892 |
+
|
893 |
+
if(isset($_SESSION['social_app_name']) && !empty($_SESSION['social_app_name']) && $_SESSION['social_app_name']=='facebook'){
|
894 |
+
$_SESSION['user_url'] = '';
|
895 |
+
}
|
896 |
+
|
897 |
$userdata = array(
|
898 |
+
'user_login' => $_SESSION['username'],
|
899 |
+
'user_email' => $_SESSION['user_email'],
|
900 |
+
'user_pass' => $random_password,
|
901 |
+
'display_name' => $_SESSION['user_full_name'],
|
902 |
+
'first_name' => $_SESSION['first_name'],
|
903 |
+
'last_name' => $_SESSION['last_name'],
|
904 |
+
'user_url' => $_SESSION['user_url'],
|
905 |
+
);
|
906 |
|
907 |
$user_id = wp_insert_user( $userdata);
|
908 |
|
919 |
|
920 |
mo_openid_start_session();
|
921 |
$_SESSION['mo_login'] = true;
|
922 |
+
do_action( 'mo_user_register', $user_id, $user_url);
|
923 |
do_action( 'miniorange_collect_attributes_for_authenticated_user', $user, mo_openid_get_redirect_url());
|
924 |
do_action( 'wp_login', $user->user_login, $user );
|
925 |
wp_set_auth_cookie( $user_id, true );
|
1107 |
if(get_option('mo_openid_auto_register_enable')) {
|
1108 |
|
1109 |
$random_password = wp_generate_password( 10, false );
|
1110 |
+
$user_profile_url = $user_url;
|
1111 |
+
|
1112 |
+
if(isset($_SESSION['social_app_name']) && !empty($_SESSION['social_app_name']) && $_SESSION['social_app_name']=='facebook'){
|
1113 |
+
$user_url = '';
|
1114 |
+
}
|
1115 |
+
|
1116 |
$userdata = array(
|
1117 |
+
'user_login' => $username,
|
1118 |
+
'user_email' => $user_email,
|
1119 |
+
'user_pass' => $random_password,
|
1120 |
+
'display_name' => $user_full_name,
|
1121 |
+
'first_name' => $first_name,
|
1122 |
+
'last_name' => $last_name,
|
1123 |
+
'user_url' => $user_url,
|
1124 |
+
);
|
1125 |
|
1126 |
$user_id = wp_insert_user( $userdata);
|
1127 |
if(is_wp_error( $user_id )) {
|
1139 |
update_user_meta($user_id, 'moopenid_user_avatar', $user_picture);
|
1140 |
}
|
1141 |
$_SESSION['mo_login'] = true;
|
1142 |
+
do_action( 'mo_user_register', $user_id, $user_profile_url);
|
1143 |
do_action( 'miniorange_collect_attributes_for_authenticated_user', $user, mo_openid_get_redirect_url());
|
1144 |
do_action( 'wp_login', $user->user_login, $user );
|
1145 |
wp_set_auth_cookie( $user_id, true );
|
1167 |
$decrypted_last_name = isset($_POST['lastName']) ? mo_openid_decrypt_sanitize($_POST['lastName']): '';
|
1168 |
$decrypted_app_name = isset($_POST['appName']) ? mo_openid_decrypt_sanitize($_POST['appName']): '';
|
1169 |
$decrypted_user_id = isset($_POST['userid']) ? mo_openid_decrypt_sanitize($_POST['userid']): '';
|
1170 |
+
|
1171 |
$decrypted_app_name = mo_openid_filter_app_name($decrypted_app_name);
|
1172 |
|
1173 |
if(isset( $_POST['firstName'] ) && isset( $_POST['lastName'] )){
|
1296 |
|
1297 |
$random_password = wp_generate_password( 10, false );
|
1298 |
|
1299 |
+
$user_profile_url = $user_url;
|
1300 |
+
|
1301 |
+
if(isset($_SESSION['social_app_name']) && !empty($_SESSION['social_app_name']) && $_SESSION['social_app_name']=='facebook'){
|
1302 |
+
$user_url = '';
|
1303 |
+
}
|
1304 |
+
|
1305 |
$userdata = array(
|
1306 |
+
'user_login' => $username,
|
1307 |
+
'user_email' => $user_email,
|
1308 |
+
'user_pass' => $random_password,
|
1309 |
+
'display_name' => $user_full_name,
|
1310 |
+
'first_name' => $first_name,
|
1311 |
+
'last_name' => $last_name,
|
1312 |
+
'user_url' => $user_url,
|
1313 |
+
);
|
1314 |
|
1315 |
|
1316 |
$user_id = wp_insert_user( $userdata);
|
|
|
1317 |
if(is_wp_error( $user_id )) {
|
1318 |
//print_r($user_id);
|
1319 |
wp_die('There was an error in registration. Please contact your administrator.');
|
1333 |
$_SESSION['mo_login'] = true;
|
1334 |
|
1335 |
//registration hook
|
1336 |
+
do_action( 'mo_user_register', $user_id, $user_profile_url);
|
1337 |
do_action( 'miniorange_collect_attributes_for_authenticated_user', $user, mo_openid_get_redirect_url());
|
1338 |
//login hook
|
1339 |
do_action( 'wp_login', $user->user_login, $user );
|
1340 |
wp_set_auth_cookie( $user_id, true );
|
1341 |
+
}
|
1342 |
|
1343 |
+
$redirect_url = mo_openid_get_redirect_url();
|
1344 |
+
wp_redirect($redirect_url);
|
1345 |
+
exit;
|
1346 |
|
1347 |
}
|
1348 |
|
1435 |
exit;
|
1436 |
}
|
1437 |
else {
|
1438 |
+
// this user is a guest
|
1439 |
|
1440 |
// auto registration is enabled
|
1441 |
if(get_option('mo_openid_auto_register_enable')) {
|
1451 |
}
|
1452 |
}
|
1453 |
|
1454 |
+
$user_profile_url = $user_url;
|
1455 |
+
|
1456 |
+
if(isset($_SESSION['social_app_name']) && !empty($_SESSION['social_app_name']) && $_SESSION['social_app_name']=='facebook'){
|
1457 |
+
$user_url = '';
|
1458 |
+
}
|
1459 |
+
|
1460 |
$userdata = array(
|
1461 |
+
'user_login' => $username,
|
1462 |
+
'user_email' => $user_email,
|
1463 |
+
'user_pass' => $random_password,
|
1464 |
+
'display_name' => $user_full_name,
|
1465 |
+
'first_name' => $first_name,
|
1466 |
+
'last_name' => $last_name,
|
1467 |
+
'user_url' => $user_url
|
1468 |
+
);
|
1469 |
|
1470 |
|
1471 |
$user_id = wp_insert_user( $userdata);
|
1487 |
$_SESSION['mo_login'] = true;
|
1488 |
|
1489 |
//registration hook
|
1490 |
+
do_action( 'mo_user_register', $user_id,$user_profile_url);
|
1491 |
do_action( 'miniorange_collect_attributes_for_authenticated_user', $user, mo_openid_get_redirect_url());
|
1492 |
//login hook
|
1493 |
do_action( 'wp_login', $user->user_login, $user );
|
1900 |
|
1901 |
$random_password = wp_generate_password( 10, false );
|
1902 |
|
1903 |
+
$user_profile_url = $user_url;
|
1904 |
+
|
1905 |
+
if(isset($_SESSION['social_app_name']) && !empty($_SESSION['social_app_name']) && $_SESSION['social_app_name']=='facebook'){
|
1906 |
+
$user_url = '';
|
1907 |
+
}
|
1908 |
+
|
1909 |
$userdata = array(
|
1910 |
+
'user_login' => $username,
|
1911 |
+
'user_email' => $user_email,
|
1912 |
+
'user_pass' => $random_password,
|
1913 |
+
'display_name' => $user_full_name,
|
1914 |
+
'first_name' => $first_name,
|
1915 |
+
'last_name' => $last_name,
|
1916 |
+
'user_url' => $user_url,
|
1917 |
+
);
|
1918 |
|
1919 |
$user_id = wp_insert_user( $userdata);
|
1920 |
|
1936 |
}
|
1937 |
|
1938 |
//registration hook
|
1939 |
+
do_action( 'mo_user_register', $user_id, $user_profile_url);
|
1940 |
do_action( 'miniorange_collect_attributes_for_authenticated_user', $user, mo_openid_get_redirect_url());
|
1941 |
//login hook
|
1942 |
do_action( 'wp_login', $user->user_login, $user );
|
2051 |
}
|
2052 |
}
|
2053 |
|
2054 |
+
$user_profile_url = $user_url;
|
2055 |
+
|
2056 |
+
if(isset($_SESSION['social_app_name']) && !empty($_SESSION['social_app_name']) && $_SESSION['social_app_name']=='facebook'){
|
2057 |
+
$user_url = '';
|
2058 |
+
}
|
2059 |
+
|
2060 |
$userdata = array(
|
2061 |
+
'user_login' => $username,
|
2062 |
+
'user_email' => $user_email,
|
2063 |
+
'user_pass' => $random_password,
|
2064 |
+
'display_name' => $user_full_name,
|
2065 |
+
'first_name' => $first_name,
|
2066 |
+
'last_name' => $last_name,
|
2067 |
+
'user_url' => $user_url,
|
2068 |
+
);
|
2069 |
|
2070 |
$user_id = wp_insert_user( $userdata);
|
2071 |
|
2092 |
$_SESSION['mo_login'] = true;
|
2093 |
|
2094 |
//registration hook
|
2095 |
+
do_action( 'mo_user_register', $user_id, $user_profile_url);
|
2096 |
do_action( 'miniorange_collect_attributes_for_authenticated_user', $user, mo_openid_get_redirect_url());
|
2097 |
//login hook
|
2098 |
|
2363 |
}
|
2364 |
|
2365 |
function mo_openid_link_account( $username, $user ){
|
2366 |
+
$userid = '';
|
2367 |
if($user){
|
2368 |
+
$userid = $user->ID;
|
2369 |
}
|
2370 |
else{
|
2371 |
wp_die('No user is returned.');
|
2373 |
mo_openid_start_session();
|
2374 |
$_SESSION['social_user_id'] = isset($_SESSION['social_user_id']) ? $_SESSION['social_user_id']:'';
|
2375 |
$_SESSION['social_app_name'] = isset($_SESSION['social_app_name']) ? $_SESSION['social_app_name']:'';
|
2376 |
+
|
2377 |
if(isset($userid) && is_null($_SESSION['social_user_id'] ) && is_null($_SESSION['social_app_name']))
|
2378 |
{
|
2379 |
return;
|
2389 |
$db_prefix = $wpdb->prefix;
|
2390 |
$linked_email_id = $wpdb->get_var($wpdb->prepare("SELECT user_id FROM ".$db_prefix."mo_openid_linked_user where linked_email = \"%s\" AND linked_social_app =\"%s\"",$user_email,$social_app_name));
|
2391 |
|
2392 |
+
if(!isset($linked_email_id)){
|
2393 |
$result = $wpdb->insert(
|
2394 |
$table_name,
|
2395 |
array(
|
2415 |
}
|
2416 |
}
|
2417 |
|
2418 |
+
function mo_openid_send_email($user_id='', $user_url=''){
|
2419 |
if( get_option('mo_openid_email_enable') == 1) {
|
2420 |
global $wpdb;
|
2421 |
$admin_mail = get_option('mo_openid_admin_email');
|
2550 |
else
|
2551 |
$content = array('status' => 'FAILURE');
|
2552 |
return $content;
|
2553 |
+
}
|
2554 |
+
|
2555 |
+
function validate_otp_token($transactionId,$otpToken){
|
2556 |
+
mo_openid_start_session();
|
2557 |
+
$customerKey = get_option('mo_openid_admin_customer_key');
|
2558 |
+
if($_SESSION['mo_otptoken']){
|
2559 |
+
$pass = checkTimeStamp($_SESSION['sent_on'],time());
|
2560 |
+
$pass = checkTransactionId($customerKey, $otpToken, $transactionId, $pass);
|
2561 |
+
if($pass)
|
2562 |
+
$content = array('status' => 'SUCCESS');
|
2563 |
+
else
|
2564 |
+
$content = array('status' => 'FAILURE');
|
2565 |
+
unset($_SESSION['$mo_otptoken']);
|
2566 |
+
}
|
2567 |
+
else
|
2568 |
+
$content = array('status' =>'FAILURE');
|
2569 |
+
|
2570 |
+
return $content;
|
2571 |
+
}
|
2572 |
|
2573 |
+
/*
|
2574 |
+
* This function checks the time otp was sent to and the time
|
2575 |
+
* user is validating the otp. The time difference shouldn't be
|
2576 |
+
* more that 60 seconds.
|
2577 |
+
*
|
2578 |
+
* @param $sentTime - the time otp was sent to
|
2579 |
+
* @param $validatedTime - the time otp was validated
|
2580 |
+
*/
|
2581 |
+
|
2582 |
+
function checkTimeStamp($sentTime,$validatedTime){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2583 |
$diff = round(abs($validatedTime - $sentTime) / 60,2);
|
2584 |
+
if($diff>5)
|
2585 |
+
return false;
|
2586 |
+
else
|
2587 |
+
return true;
|
2588 |
+
}
|
2589 |
+
|
2590 |
+
/**
|
2591 |
+
* This function checks and compares the transaction set in session
|
2592 |
+
* and one generated during validation. Both need to match for the
|
2593 |
+
* otp to be validated.
|
2594 |
+
*
|
2595 |
+
* @param $customerKey - the customer key of the user
|
2596 |
+
* @param $otpToken - otp token entered by the user
|
2597 |
+
* @param $transactionId - the transaction id in session
|
2598 |
+
* @param $pass - the boolean value passed after the time check
|
2599 |
+
*/
|
2600 |
+
|
2601 |
+
function checkTransactionId($customerKey,$otpToken,$transactionId,$pass){
|
2602 |
+
if(!$pass){
|
2603 |
+
return false;
|
2604 |
+
}
|
2605 |
+
$stringToHash = $customerKey . $otpToken;
|
2606 |
+
$txtID = hash("sha512", $stringToHash);
|
2607 |
+
if($txtID == $transactionId)
|
2608 |
+
return true;
|
2609 |
+
}
|
2610 |
|
2611 |
function mo_openid_filter_app_name($decrypted_app_name)
|
2612 |
{
|
2621 |
}
|
2622 |
}
|
2623 |
|
2624 |
+
function mo_openid_account_linking($messages) {
|
2625 |
+
if(isset( $_GET['option']) && $_GET['option'] == 'disable-social-login' ){
|
2626 |
+
$messages = '<p class="message">Link your social account to existing WordPress account by entering username and password.</p>';
|
2627 |
+
}
|
2628 |
+
return $messages;
|
2629 |
+
}
|
2630 |
|
2631 |
function mo_openid_customize_logo(){
|
2632 |
$logo =" <div style='float:left;' class='mo_image_id'>
|
2639 |
}
|
2640 |
|
2641 |
//delete rows from account linking table that correspond to deleted user
|
2642 |
+
function mo_openid_delete_account_linking_rows($user_id){
|
2643 |
global $wpdb;
|
2644 |
$db_prefix = $wpdb->prefix;
|
2645 |
$result = $wpdb->get_var($wpdb->prepare("DELETE from ".$db_prefix."mo_openid_linked_user where user_id = %s ",$user_id));
|
2651 |
}
|
2652 |
}
|
2653 |
|
2654 |
+
function mo_openid_update_role($user_id='', $user_url=''){
|
2655 |
+
// save the profile url in user meta // this was added to save facebook url in user meta as it is more than 100 chars
|
2656 |
+
update_user_meta($user_id, 'moopenid_user_profile_url',$user_url);
|
2657 |
if(get_option('mo_openid_login_role_mapping') ){
|
2658 |
$user = get_user_by('ID',$user_id);
|
2659 |
$user->set_role( get_option('mo_openid_login_role_mapping') );
|
2660 |
}
|
2661 |
}
|
2662 |
|
2663 |
+
if(get_option('mo_openid_logout_redirection_enable') == 1){
|
2664 |
+
add_filter( 'logout_url', 'mo_openid_redirect_after_logout',0,1);
|
2665 |
+
}
|
2666 |
|
2667 |
+
add_action( 'widgets_init', function(){register_widget( "mo_openid_login_wid" );});
|
2668 |
add_action( 'widgets_init', function(){register_widget( "mo_openid_sharing_ver_wid" );});
|
2669 |
add_action( 'widgets_init', function(){register_widget( "mo_openid_sharing_hor_wid" );});
|
2670 |
|
2671 |
+
add_action( 'init', 'mo_openid_login_validate' );
|
2672 |
+
//add_action( 'init', 'mo_openid_start_session' );
|
2673 |
+
//add_action( 'wp_logout', 'mo_openid_end_session' );
|
2674 |
+
add_action( 'mo_user_register', 'mo_openid_update_role', 1, 2);
|
2675 |
+
add_action( 'wp_login', 'mo_openid_login_redirect', 10, 2);
|
2676 |
+
add_action( 'wp_login', 'mo_openid_link_account', 9, 2);
|
2677 |
+
add_filter( 'login_message', 'mo_openid_account_linking');
|
2678 |
add_action( 'delete_user', 'mo_openid_delete_account_linking_rows' );
|
2679 |
+
add_action( 'mo_user_register','mo_openid_send_email',1, 2 );
|
2680 |
|
2681 |
+
//compatibility with international characters
|
2682 |
add_filter('sanitize_user', 'mo_openid_sanitize_user', 10, 3);
|
2683 |
remove_filter('sanitize_title','sanitize_title_with_dashes', 10);
|
2684 |
add_filter( 'sanitize_title', 'mo_openid_sanitize_title_with_dashes', 10, 3 );
|
miniorange_openid_sso_settings.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Social Login, Social Sharing by miniOrange
|
5 |
* Plugin URI: https://www.miniorange.com
|
6 |
* Description: Allow your users to login, comment and share with Facebook, Google, Twitter, LinkedIn etc using customizable buttons.
|
7 |
-
* Version: 6.
|
8 |
* Author: miniOrange
|
9 |
* Author URI: https://www.miniorange.com
|
10 |
* License: GPL2
|
4 |
* Plugin Name: Social Login, Social Sharing by miniOrange
|
5 |
* Plugin URI: https://www.miniorange.com
|
6 |
* Description: Allow your users to login, comment and share with Facebook, Google, Twitter, LinkedIn etc using customizable buttons.
|
7 |
+
* Version: 6.4.0
|
8 |
* Author: miniOrange
|
9 |
* Author URI: https://www.miniorange.com
|
10 |
* License: GPL2
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.miniorange.com
|
|
4 |
Tags: social login, social, facebook, twitter, login
|
5 |
Requires at least: 2.0.2
|
6 |
Tested up to: 4.9.4
|
7 |
-
Stable tag: 6.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -165,6 +165,9 @@ Please email us at info@miniorange.com. You can also submit your query from the
|
|
165 |
|
166 |
|
167 |
== Changelog ==
|
|
|
|
|
|
|
168 |
= 6.3.3 =
|
169 |
* Updated subject of verification mail
|
170 |
* Preview of features in standard and premium is available
|
@@ -490,6 +493,9 @@ Please email us at info@miniorange.com. You can also submit your query from the
|
|
490 |
* First version of Social Login, Social Sharing plugin.
|
491 |
|
492 |
== Upgrade Notice ==
|
|
|
|
|
|
|
493 |
= 6.3.3 =
|
494 |
* Updated subject of verification mail
|
495 |
* Preview of features in standard and premium is available
|
4 |
Tags: social login, social, facebook, twitter, login
|
5 |
Requires at least: 2.0.2
|
6 |
Tested up to: 4.9.4
|
7 |
+
Stable tag: 6.4.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
165 |
|
166 |
|
167 |
== Changelog ==
|
168 |
+
= 6.4.0 =
|
169 |
+
* Fix for Facebook registration issue
|
170 |
+
|
171 |
= 6.3.3 =
|
172 |
* Updated subject of verification mail
|
173 |
* Preview of features in standard and premium is available
|
493 |
* First version of Social Login, Social Sharing plugin.
|
494 |
|
495 |
== Upgrade Notice ==
|
496 |
+
= 6.4.0 =
|
497 |
+
* Fix for Facebook registration issue
|
498 |
+
|
499 |
= 6.3.3 =
|
500 |
* Updated subject of verification mail
|
501 |
* Preview of features in standard and premium is available
|