forked from ethymos/delibera
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdelibera.php
128 lines (89 loc) · 5.33 KB
/
delibera.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
/*
Plugin Name: Delibera
Plugin URI: http://delibera.redelivre.org.br
Description: O Plugin Delibera extende as funções padrão do WordPress e cria um ambiente de deliberação.
Version: 2.0.0-beta.1
Author: RedeLivre
Author URI: http://redelivre.org.br
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* Reponsável por importar todos os arquivos utilizados pelo plugin
* @package Global
*/
if(!defined('__DIR__')) {
$iPos = strrpos(__FILE__, DIRECTORY_SEPARATOR);
define("__DIR__", substr(__FILE__, 0, $iPos) . DIRECTORY_SEPARATOR);
}
define('DELIBERA_ABOUT_PAGE', __('sobre-a-plataforma', 'delibera'));
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_conf.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_shortcodes.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_widgets.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_rewrite_rules.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_permission.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_conf_themes.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'print' . DIRECTORY_SEPARATOR . 'wp-print.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'delibera_admin_functions.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_setup.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_init.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'delibera_flow.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_utils.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_comments.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_comments_query.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_comments_template.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_comments_edit.php';
require_once __DIR__ . DIRECTORY_SEPARATOR. 'admin'. DIRECTORY_SEPARATOR . 'delibera_cron.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_topic.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_topic_deadline.php';
if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'delibera_filtros.php'))
{
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_filtros.php';
}
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_curtir.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_discordar.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_seguir.php';
if (file_exists(__DIR__.DIRECTORY_SEPARATOR.'mailer') &&
file_exists(__DIR__.DIRECTORY_SEPARATOR.'mailer' . DIRECTORY_SEPARATOR . 'delibera_mailer.php'))
{
//require_once __DIR__.DIRECTORY_SEPARATOR.'mailer'.DIRECTORY_SEPARATOR.'delibera_mailer.php';
}
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_notificar.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'delibera_user_painel.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_relatorio.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'delibera_member_path.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'oembed-in-comments.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'wp-divi'. DIRECTORY_SEPARATOR .'modules.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'api'. DIRECTORY_SEPARATOR . 'wp-api.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'delibera_conf_permission.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'si-captcha.php';
if(file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'wp-side-comments' . DIRECTORY_SEPARATOR . 'wp-side-comments.php'))
require_once __DIR__ . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'wp-side-comments' . DIRECTORY_SEPARATOR . 'wp-side-comments.php';
/**
* Redir e ciona usuários que não são membros do site
* onde o Delibera foi instalado para a página de pautas após o
* login se a opção "Todos os usuários logados na rede podem participar?"
* e s tiver habilitada.
*
* Se não fizermos esse redicionamento estes usuários serão redirecionados
* para suas páginas de perfil fora do site onde o Delibera es t á i nstalado.
*
a d d_filter('login_redirect', function($redirect_to, $request, $user) {
$options = delibera_get_config();
if ($options['todos_usuarios_logados_podem_participar'] == 'S' && !is_user_member_of_blog()) {
return site_url('pauta');
} else {
return $redirect_to;
}
}, 10, 3);
TODO mundo redirecionado para a lista de pauta, talvez uma nova opções */