Skip to content

Commit 2d455a2

Browse files
committed
Merge
2 parents 5e4500f + 6452057 commit 2d455a2

20 files changed

+158
-103
lines changed

index.php

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -226,30 +226,31 @@
226226

227227
echo '<div id="menu-wrapper">';
228228
if (!api_is_anonymous()) {
229-
// @todo move all this in a class/function
230-
if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
229+
// @todo move all this in a class/function
231230

232-
//Always show the user image
233-
$img_array = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'web', true, true);
234-
$no_image = false;
235-
if ($img_array['file'] == 'unknown.jpg') {
236-
$no_image = true;
237-
}
238-
$img_array = UserManager::get_picture_user(api_get_user_id(), $img_array['file'], 50, USER_IMAGE_SIZE_MEDIUM, ' width="90" height="90" ');
239-
240-
$profile_content .='<div id="social_widget">';
241-
242-
$profile_content .= '<div id="social_widget_image">';
243-
if (api_get_setting('allow_social_tool') == 'true') {
244-
if (!$no_image) {
245-
$profile_content .='<a href="'.api_get_path(WEB_PATH).'main/social/home.php"><img src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>';
246-
} else {
247-
$profile_content .='<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php"><img title="'.get_lang('EditProfile').'" src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>';
248-
}
231+
//Always show the user image
232+
$img_array = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'web', true, true);
233+
$no_image = false;
234+
if ($img_array['file'] == 'unknown.jpg') {
235+
$no_image = true;
236+
}
237+
$img_array = UserManager::get_picture_user(api_get_user_id(), $img_array['file'], 50, USER_IMAGE_SIZE_MEDIUM, ' width="90" height="90" ');
238+
239+
$profile_content .='<div id="social_widget">';
240+
241+
$profile_content .= '<div id="social_widget_image">';
242+
if (api_get_setting('allow_social_tool') == 'true') {
243+
if (!$no_image) {
244+
$profile_content .='<a href="'.api_get_path(WEB_PATH).'main/social/home.php"><img src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>';
249245
} else {
250246
$profile_content .='<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php"><img title="'.get_lang('EditProfile').'" src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>';
251247
}
252-
$profile_content .= ' </div></div>';
248+
} else {
249+
$profile_content .='<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php"><img title="'.get_lang('EditProfile').'" src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>';
250+
}
251+
$profile_content .= ' </div></div>';
252+
253+
if (api_get_setting('allow_message_tool') == 'true') {
253254

254255
require_once api_get_path(LIBRARY_PATH).'message.lib.php';
255256
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
@@ -272,19 +273,20 @@
272273
$profile_content .= '<div class="clear"></div>';
273274
$profile_content .= '<div class="message-content"><ul class="menulist">';
274275
$link = '';
275-
if (api_get_setting('show_tabs', 'social') == 'true') {
276+
if (api_get_setting('allow_social_tool') == 'true') {
276277
$link = '?f=social';
277278
}
278279
$profile_content .= '<li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php'.$link.'" class="message-body">'.get_lang('Inbox').$cant_msg.' </a></li>';
279280
$profile_content .= '<li><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php'.$link.'" class="message-body">'.get_lang('Compose').' </a></li>';
280281

281-
if ($total_invitations == 0) {
282-
$total_invitations = '';
283-
} else {
284-
$total_invitations = ' ('.$total_invitations.')';
282+
if (api_get_setting('allow_social_tool') == 'true') {
283+
if ($total_invitations == 0) {
284+
$total_invitations = '';
285+
} else {
286+
$total_invitations = ' ('.$total_invitations.')';
287+
}
288+
$profile_content .= '<li><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php" class="message-body">'.get_lang('PendingInvitations').' '.$total_invitations.' </a></li>';
285289
}
286-
$profile_content .= '<li><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php" class="message-body">'.get_lang('PendingInvitations').' '.$total_invitations.' </a></li>';
287-
288290
$profile_content .= '</ul>';
289291
$profile_content .= '</div>';
290292
}

main/auth/profile.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function show_icon_edit(element_html) {
7272
}
7373
</script>';
7474

75-
$interbreadcrumb[] = array('url' => '../auth/profile.php', 'name' => get_lang('ModifyProfile'));
75+
//$interbreadcrumb[] = array('url' => '../auth/profile.php', 'name' => get_lang('ModifyProfile'));
7676
if (!empty ($_GET['coursePath'])) {
7777
$course_url = api_get_path(WEB_COURSE_PATH).htmlentities(strip_tags($_GET['coursePath'])).'/index.php';
7878
$interbreadcrumb[] = array('url' => $course_url, 'name' => Security::remove_XSS($_GET['courseCode']));
@@ -742,14 +742,6 @@ function check_user_email($email){
742742
}
743743

744744

745-
//if (isset($_GET['show'])) {
746-
//if ((api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') || (api_get_setting('allow_social_tool') == 'true')) {
747-
//$interbreadcrumb[] = array ('url' => 'javascript: void(0);', 'name' => get_lang('SocialNetwork'));
748-
//} elseif ((api_get_setting('allow_social_tool') == 'false' && api_get_setting('allow_message_tool') == 'true')) {
749-
//$interbreadcrumb[] = array('url' => 'javascript: void(0);', 'name' => get_lang('MessageTool'));
750-
//}
751-
//}
752-
753745
/* MAIN DISPLAY SECTION */
754746
// the header
755747
Display::display_header(get_lang('ModifyProfile'));

main/messages/inbox.php

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ function hide_icon_edit(element_html) {
9595
for ($i=1;$i<=$count_delete;$i++) {
9696
MessageManager::delete_message_by_user_receiver(api_get_user_id(), $info_delete[$i]);
9797
}
98-
$message_box=get_lang('SelectedMessagesDeleted');
99-
Display::display_normal_message(api_xml_http_response_encode($message_box),false);
100-
inbox_display();
101-
exit;
98+
$message_box=get_lang('SelectedMessagesDeleted');
99+
Display::display_normal_message(api_xml_http_response_encode($message_box),false);
100+
inbox_display();
101+
exit;
102102
}
103103
}
104104

@@ -115,7 +115,7 @@ function hide_icon_edit(element_html) {
115115
} else {
116116
$this_section = SECTION_MYPROFILE;
117117
$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
118-
$interbreadcrumb[]= array ('url' => 'outbox.php','name' => get_lang('Inbox'));
118+
$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Inbox'));
119119
}
120120

121121
Display::display_header('');
@@ -130,27 +130,24 @@ function hide_icon_edit(element_html) {
130130
if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
131131
echo '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'&nbsp;'.get_lang('ViewSharedProfile').'</a>';
132132
}
133+
133134
if (api_get_setting('allow_message_tool') == 'true') {
134-
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
135+
//echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
136+
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>';
137+
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>';
138+
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>';
139+
140+
135141
}
136-
echo '<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php?type=reduced">'.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).'&nbsp;'.get_lang('EditNormalProfile').'</a>';
142+
//echo '<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php?type=reduced">'.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).'&nbsp;'.get_lang('EditNormalProfile').'</a>';
137143
echo '</div>';
138-
139-
140144
}
141145

142146
echo '<div id="social-content">';
143147
$id_content_right = '';
144148
//LEFT CONTENT
145149
if (api_get_setting('allow_social_tool') != 'true') {
146-
$id_content_right = 'inbox';
147-
echo '<div id="inbox-menu" class="actions">';
148-
echo '<ul>';
149-
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>'.'</li>';
150-
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>'.'</li>';
151-
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>'.'</li>';
152-
echo '</ul>';
153-
echo '</div>';
150+
$id_content_right = 'inbox';
154151
} else {
155152
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
156153
$id_content_right = 'social-content-right';
@@ -160,10 +157,8 @@ function hide_icon_edit(element_html) {
160157
echo '</div>';
161158
}
162159

163-
echo '<div id="'.$id_content_right.'">';
164-
165-
if (api_get_setting('allow_social_tool') == 'true') {
166-
160+
echo '<div id="'.$id_content_right.'">';
161+
if (api_get_setting('allow_social_tool') == 'true') {
167162
echo '<div class="social-box-container2">';
168163
echo '<div class="actions">';
169164
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?f=social">'.Display::return_icon('compose_message.png', get_lang('ComposeMessage'), array(), 32).'</a>';

main/messages/new_message.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
api_block_anonymous_users();
2222

23-
if (api_get_setting('allow_message_tool')!='true'){
23+
if (api_get_setting('allow_message_tool') !='true' ){
2424
api_not_allowed();
2525
}
2626

@@ -288,15 +288,14 @@ function manage_form ($default, $select_from_user_list = null) {
288288
/* MAIN SECTION */
289289
if ($_GET['f']=='social') {
290290
$this_section = SECTION_SOCIAL;
291-
$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social'));
292-
$interbreadcrumb[]= array ('url' => '#','name' => $nameTools);
291+
$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social'));
293292
} else {
294293
$this_section = SECTION_MYPROFILE;
295294
$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
296-
$interbreadcrumb[]= array ('url' => 'inbox.php','name' => get_lang('Inbox'));
295+
//$interbreadcrumb[]= array ('url' => '#','name' => get_lang('ComposeMessage'));
297296
}
298297

299-
Display::display_header('');
298+
Display::display_header(get_lang('ComposeMessage'));
300299

301300
$group_id = intval($_REQUEST['group_id']);
302301

@@ -315,9 +314,12 @@ function manage_form ($default, $select_from_user_list = null) {
315314
echo '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'&nbsp;'.get_lang('ViewSharedProfile').'</a>';
316315
}
317316
if (api_get_setting('allow_message_tool') == 'true') {
318-
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
317+
// echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
318+
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>';
319+
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>';
320+
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>';
319321
}
320-
echo '<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php?type=reduced">'.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).'&nbsp;'.get_lang('EditNormalProfile').'</a>';
322+
//echo '<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php?type=reduced">'.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).'&nbsp;'.get_lang('EditNormalProfile').'</a>';
321323
echo '</div>';
322324
}
323325
}
@@ -327,13 +329,13 @@ function manage_form ($default, $select_from_user_list = null) {
327329
//LEFT COLUMN
328330
if (api_get_setting('allow_social_tool') != 'true') {
329331
$id_content_right = 'inbox';
330-
echo '<div id="inbox-menu" class="actions">';
332+
/* echo '<div id="inbox-menu" class="actions">';
331333
echo '<ul>';
332334
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>'.'</li>';
333335
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>'.'</li>';
334336
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>'.'</li>';
335337
echo '</ul>';
336-
echo '</div>';
338+
echo '</div>';*/
337339
} else {
338340
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
339341
echo '<div id="social-content-left">';

main/messages/outbox.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function deselect_all(formita)
6969
} else {
7070
$this_section = SECTION_MYPROFILE;
7171
$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
72-
$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Inbox'));
72+
$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox'));
7373
}
7474

7575
Display::display_header('');
@@ -85,9 +85,14 @@ function deselect_all(formita)
8585
echo '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'&nbsp;'.get_lang('ViewSharedProfile').'</a>';
8686
}
8787
if (api_get_setting('allow_message_tool') == 'true') {
88-
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
88+
//echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
89+
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>';
90+
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>';
91+
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>';
92+
93+
8994
}
90-
echo '<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php?type=reduced">'.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).'&nbsp;'.get_lang('EditNormalProfile').'</a>';
95+
//echo '<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php?type=reduced">'.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).'&nbsp;'.get_lang('EditNormalProfile').'</a>';
9196
echo '</div>';
9297
}
9398
}
@@ -118,13 +123,14 @@ function deselect_all(formita)
118123
//LEFT COLUMN
119124
if (api_get_setting('allow_social_tool') != 'true') {
120125
$id_content_right = 'outbox';
126+
/*
121127
echo '<div id="inbox-menu" class="actions">';
122128
echo '<ul>';
123129
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>'.'</li>';
124130
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>'.'</li>';
125131
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>'.'</li>';
126132
echo '</ul>';
127-
echo '</div>';
133+
echo '</div>';*/
128134
} else {
129135
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
130136
$id_content_right = 'social-content-right';

main/messages/view_message.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@
2121
$interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox'));
2222
} else {
2323
$this_section = SECTION_MYPROFILE;
24-
$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Profile'));
25-
$interbreadcrumb[]= array ('url' => 'inbox.php','name' => get_lang('Inbox'));
24+
$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
2625
}
27-
$interbreadcrumb[]= array ('url' => '#','name' => get_lang('View'));
28-
Display::display_header('');
26+
27+
Display::display_header(get_lang('View'));
2928

3029
if ($_GET['f']=='social') {
3130
$social_parameter = '?f=social';
@@ -37,9 +36,14 @@
3736
echo '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'&nbsp;'.get_lang('ViewSharedProfile').'</a>';
3837
}
3938
if (api_get_setting('allow_message_tool') == 'true') {
40-
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
39+
//echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
40+
41+
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>';
42+
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>';
43+
echo '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>';
44+
4145
}
42-
echo '<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php?type=reduced">'.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).'&nbsp;'.get_lang('EditNormalProfile').'</a>';
46+
//echo '<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php?type=reduced">'.Display::return_icon('edit.gif', get_lang('EditNormalProfile')).'&nbsp;'.get_lang('EditNormalProfile').'</a>';
4347

4448
echo '</div>';
4549
}
@@ -59,13 +63,13 @@
5963
//LEFT COLUMN
6064
if (api_get_setting('allow_social_tool') != 'true') {
6165
$id_content_right = 'inbox';
62-
echo '<div id="inbox-menu" class="actions">';
66+
/*echo '<div id="inbox-menu" class="actions">';
6367
echo '<ul>';
6468
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).get_lang('ComposeMessage').'</a>'.'</li>';
6569
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).get_lang('Inbox').'</a>'.'</li>';
6670
echo '<li><a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).get_lang('Outbox').'</a>'.'</li>';
6771
echo '</ul>';
68-
echo '</div>';
72+
echo '</div>';*/
6973
} else {
7074
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
7175
$id_content_right = 'social-content-right';

main/social/friends.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
1717

1818
api_block_anonymous_users();
19+
if (api_get_setting('allow_social_tool') !='true') {
20+
api_not_allowed();
21+
}
1922

2023
$this_section = SECTION_SOCIAL;
2124

main/social/group_add.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@
88
$language_file= 'userInfo';
99
$cidReset=true;
1010
require_once '../inc/global.inc.php';
11+
12+
api_block_anonymous_users();
13+
if (api_get_setting('allow_social_tool') !='true') {
14+
api_not_allowed();
15+
}
16+
1117
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
1218
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
1319
require_once api_get_path(LIBRARY_PATH).'group_portal_manager.lib.php';
1420

15-
api_block_anonymous_users();
16-
1721
if (api_get_setting('allow_students_to_create_groups_in_social') == 'false' && !api_is_allowed_to_edit()) {
1822
api_not_allowed();
1923
}

0 commit comments

Comments
 (0)