-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathqa-plugin.php
More file actions
76 lines (59 loc) · 2.64 KB
/
qa-plugin.php
File metadata and controls
76 lines (59 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/*
Question2Answer (c) Gideon Greenspan
Open Login Plugin (c) Alex Lixandru
http://www.question2answer.org/
File: qa-plugin/open-login/qa-plugin.php
Version: 3.0.0
Description: Initiates Open Login plugin
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
More about this license: http://www.question2answer.org/license.php
*/
/*
Plugin Name: Open Login
Plugin URI: https://github.com/alixandru/q2a-open-login
Plugin Description: Allows users to log in via Facebook, Google and other Open Auth providers
Plugin Version: 3.0.0
Plugin Date: 2014-09-09
Plugin Author: Alex Lixandru
Plugin Author URI: https://github.com/alixandru/
Plugin License: GPLv2
Plugin Minimum Question2Answer Version: 1.6.3
Plugin Minimum PHP Version: 5
Plugin Update Check URI: https://raw.github.com/alixandru/q2a-open-login/master/qa-plugin.php
*/
/*
Based on Facebook Login plugin
*/
if (!defined('QA_VERSION')) { // don't allow this page to be requested directly from browser
header('Location: ../../');
exit;
}
if (!QA_FINAL_EXTERNAL_USERS) { // login modules don't work with external user integration
qa_register_plugin_phrases('qa-open-lang-*.php', 'plugin_open');
qa_register_plugin_overrides('qa-open-overrides.php');
qa_register_plugin_layer('qa-open-layer.php', 'OAuth/OpenID Layer');
qa_register_plugin_module('page', 'qa-open-page-logins.php', 'qa_open_logins_page', 'Open Login Configuration');
qa_register_plugin_module('widget', 'qa-open-widget.php', 'qa_open_logins_widget', 'Open Login Providers');
// sice we're not allowed to access the database at this step, take the information from a local file
// note: the file providers.php will be automatically generated when the configuration of the plugin
// is updated on the Administration page
$providers = @include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'providers.php';
if ($providers) {
// loop through all active providers and register them
$providerList = explode(',', $providers);
foreach($providerList as $provider) {
qa_register_plugin_module('login', 'qa-open-login.php', 'qa_open_login', $provider);
}
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/