Skip to content

Commit 9278c7c

Browse files
authored
Merge pull request #296 from Leinad4Mind/Other-fixes
Guests improvements & add album description - thks to archivar
2 parents 45da19d + cc598a7 commit 9278c7c

30 files changed

+109
-109
lines changed

core/album/album.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function get_albumbox($ignore_personals, $select_name, $select_id = false
199199
$padding_store = array('0' => '');
200200
$padding = $album_list = '';
201201
$check_album_type = ($requested_album_type >= 0) ? true : false;
202-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
202+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
203203

204204
// Sometimes it could happen that albums will be displayed here not be displayed within the index page
205205
// This is the result of albums not displayed at index and a parent of a album with no permissions.

core/auth/auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function get_own_album()
141141
return self::OWN_ALBUM;
142142
}
143143

144-
public function load_user_premissions($user_id, $album_id = false)
144+
public function load_user_permissions($user_id, $album_id = false)
145145
{
146146
$cached_permissions = $this->user->get_data('user_permissions');
147147
if (($user_id == $this->user->user_id) && !empty($cached_permissions))

core/auth/level.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function __construct(\phpbbgallery\core\auth\auth $auth, \phpbb\config\co
7676
public function display($album_id, $album_status, $album_user_id = -1)
7777
{
7878
$locked = ($album_status == ITEM_LOCKED && !$this->auth->acl_check('m_', $album_id, $album_user_id)) ? true : false;
79-
$this->auth->load_user_premissions($this->user->data['user_id']);
79+
$this->auth->load_user_permissions($this->user->data['user_id']);
8080
$rules = array(
8181
($this->auth->acl_check('i_view', $album_id, $album_user_id) && !$locked) ? $this->lang->lang('ALBUM_VIEW_CAN') : $this->lang->lang('ALBUM_VIEW_CANNOT'),
8282
($this->auth->acl_check('i_upload', $album_id, $album_user_id) && !$locked) ? $this->lang->lang('ALBUM_UPLOAD_CAN') : $this->lang->lang('ALBUM_UPLOAD_CANNOT'),

core/controller/album.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ public function watch($album_id)
510510
*/
511511
protected function check_permissions($album_id, $owner_id, $album_auth_level)
512512
{
513-
$this->auth->load_user_premissions($this->user->data['user_id']);
513+
$this->auth->load_user_permissions($this->user->data['user_id']);
514514
$zebra_array = $this->auth->get_user_zebra($this->user->data['user_id']);
515515
if (!$this->auth->acl_check('i_view', $album_id, $owner_id) || $this->auth->get_zebra_state($zebra_array, (int) $owner_id, (int) $album_id) < (int) $album_auth_level)
516516
{

core/controller/comment.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function add($image_id, $comment_id)
180180
$album_backlink = $this->helper->route('phpbbgallery_core_album', array('album_id' => $album_id));
181181
$album_loginlink = append_sid($this->phpbb_root_path . 'ucp.' . $this->php_ext . '?mode=login');
182182

183-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
183+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
184184
if (!$this->gallery_auth->acl_check('c_post', $album_id, $album_data['album_user_id']))
185185
{
186186
$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
@@ -444,7 +444,7 @@ public function edit($image_id, $comment_id)
444444
{
445445
$this->misc->not_authorised($image_backlink, $image_loginlink);
446446
}
447-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
447+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
448448
if (!$this->gallery_auth->acl_check('c_edit', $album_id, $album_data['album_user_id']) /*&& $mode == 'add'*/)
449449
{
450450
if (!$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id']))
@@ -658,7 +658,7 @@ public function delete($image_id, $comment_id)
658658
{
659659
$this->misc->not_authorised($image_backlink, $image_loginlink);
660660
}
661-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
661+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
662662
if (!$this->gallery_auth->acl_check('c_edit', $album_id, $album_data['album_user_id']) /*&& $mode == 'add'*/)
663663
{
664664
if (!$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id']))
@@ -792,7 +792,7 @@ public function rate($image_id)
792792
$album_backlink = $this->helper->route('phpbbgallery_core_album', array('album_id' => $album_id));
793793
$image_loginlink = $this->url->append_sid('relative', 'image_page', "album_id=$album_id&amp;image_id=$image_id");
794794

795-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
795+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
796796
$rating = $this->gallery_rating;
797797
$rating->loader($image_id, $image_data, $album_data);
798798
if (!($this->gallery_config->get('allow_rates') && $rating->is_able()))

core/controller/file.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function __construct(\phpbb\config\config $config, \phpbb\db\driver\drive
112112
*/
113113
public function source($image_id)
114114
{
115-
$this->auth->load_user_premissions($this->user->data['user_id']);
115+
$this->auth->load_user_permissions($this->user->data['user_id']);
116116
$this->path = $this->path_source;
117117
$this->load_data($image_id);
118118
$this->check_auth();
@@ -180,7 +180,7 @@ public function medium($image_id)
180180
$this->resize($image_id, $this->config['phpbb_gallery_medium_width'], $this->config['phpbb_gallery_medium_height'], 'filesize_medium');
181181
$this->generate_image_src();
182182
}
183-
$this->auth->load_user_premissions($this->user->data['user_id']);
183+
$this->auth->load_user_permissions($this->user->data['user_id']);
184184
$this->use_watermark = $this->config['phpbb_gallery_watermark_enabled'] && $this->data['album_watermark'] && !$this->auth->acl_check('i_watermark', $this->data['album_id'], $this->data['album_user_id']);
185185
$this->tool->set_image_options($this->config['phpbb_gallery_max_filesize'], $this->config['phpbb_gallery_max_height'], $this->config['phpbb_gallery_max_width']);
186186
$this->tool->set_image_data($this->image_src, $this->data['image_name']);
@@ -270,7 +270,7 @@ public function load_data($image_id)
270270

271271
public function check_auth()
272272
{
273-
$this->auth->load_user_premissions($this->user->data['user_id']);
273+
$this->auth->load_user_permissions($this->user->data['user_id']);
274274
$zebra_array = $this->auth->get_user_zebra($this->user->data['user_id']);
275275
// Check permissions
276276
if (($this->data['image_user_id'] != $this->user->data['user_id']) && ($this->data['image_status'] == \phpbbgallery\core\block::STATUS_ORPHAN))

core/controller/image.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ public function edit($image_id)
822822
$disp_image_data = $image_data;
823823
$owner_id = $image_data['image_user_id'];
824824
$album_loginlink = './ucp.php?mode=login';
825-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
825+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
826826
if (!$this->gallery_auth->acl_check('i_edit', $album_id, $album_data['album_user_id']) || ($image_data['image_status'] == \phpbbgallery\core\block::STATUS_ORPHAN))
827827
{
828828
if (!$this->gallery_auth->acl_check('m_edit', $album_id, $album_data['album_user_id']))
@@ -1064,7 +1064,7 @@ public function delete($image_id)
10641064
$album_loginlink = './ucp.php?mode=login';
10651065
$image_backlink = $this->helper->route('phpbbgallery_core_image', array('image_id' => $image_id));
10661066
$album_backlink = $this->helper->route('phpbbgallery_core_album', array('album_id' => $image_data['image_album_id']));
1067-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
1067+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
10681068
if (!$this->gallery_auth->acl_check('i_delete', $album_id, $album_data['album_user_id']) || ($image_data['image_status'] == \phpbbgallery\core\block::STATUS_ORPHAN))
10691069
{
10701070
if (!$this->gallery_auth->acl_check('m_delete', $album_id, $album_data['album_user_id']))
@@ -1122,7 +1122,7 @@ public function report($image_id)
11221122
$album_loginlink = './ucp.php?mode=login';
11231123
$image_backlink = $this->helper->route('phpbbgallery_core_image', array('image_id' => $image_id));
11241124
$album_backlink = $this->helper->route('phpbbgallery_core_album', array('album_id' => $image_data['image_album_id']));
1125-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
1125+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
11261126
if (!$this->gallery_auth->acl_check('i_report', $album_id, $album_data['album_user_id']) || ($image_data['image_user_id'] == $this->user->data['user_id']))
11271127
{
11281128
$this->misc->not_authorised($image_backlink, '');
@@ -1195,7 +1195,7 @@ public function report($image_id)
11951195
*/
11961196
protected function check_permissions($album_id, $owner_id, $image_status, $album_auth_level)
11971197
{
1198-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
1198+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
11991199
$zebra_array = $this->gallery_auth->get_user_zebra($this->user->data['user_id']);
12001200
if (!$this->gallery_auth->acl_check('i_view', $album_id, $owner_id) || ($image_status == \phpbbgallery\core\block::STATUS_ORPHAN) || $this->gallery_auth->get_zebra_state($zebra_array, (int) $owner_id, (int) $album_id) < (int) $album_auth_level)
12011201
{

core/controller/index.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config
119119
public function base()
120120
{
121121
// Display login box for guests and an error for users
122-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
122+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
123123
$get_albums = $this->gallery_auth->acl_album_ids('a_list');
124124
if (empty($get_albums) && !$this->user->data['is_registered'])
125125
{
@@ -151,6 +151,14 @@ public function base()
151151
$action_image = false;
152152
break;
153153
}
154+
155+
$alphabet = range('a', 'z');
156+
$alpha_links = [];
157+
foreach ($alphabet as $char) {
158+
$alpha_links[] = '<a href="' . append_sid($this->helper->route('phpbbgallery_core_personal'), 'first_char=' . $char) . '">' . strtoupper($char) . '</a>';
159+
}
160+
$alpha_links[] = '<a href="' . append_sid($this->helper->route('phpbbgallery_core_personal'), 'first_char=other') . '">#</a>';
161+
154162
$this->template->assign_vars(array(
155163
'S_USERS_PERSONAL_GALLERIES' => true,
156164
'U_USERS_PERSONAL_GALLERIES' => $this->helper->route('phpbbgallery_core_personal'),
@@ -161,6 +169,7 @@ public function base()
161169
'U_IMAGENAME_ACTION' => $this->helper->route('phpbbgallery_core_image', array('image_id' => $last_image['image_id'])),
162170
'U_TIME' => ($last_image['image_id'] > 0) ? $this->user->format_date($last_image['image_time']) : false,
163171
'U_UPLOADER' => ($last_image['image_id'] > 0) ? get_username_string('full', $last_image['image_user_id'], $last_image['image_username'], $last_image['image_user_colour']) : false,
172+
'ALPHABET_NAVIGATION' => implode('&nbsp;', $alpha_links),
164173
));
165174
$this->gallery_user->set_user_id($this->user->data['user_id']);
166175
$personal_album = $this->gallery_user->get_own_root_album();
@@ -240,7 +249,7 @@ public function base()
240249
public function personal($page)
241250
{
242251
// Display login box for guests and an error for users
243-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
252+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
244253
$get_albums = $this->gallery_auth->acl_album_ids('a_list');
245254
if (empty($get_albums) && !$this->user->data['is_registered'])
246255
{
@@ -295,7 +304,7 @@ public function personal($page)
295304

296305
protected function assign_dropdown_links($base_route)
297306
{
298-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
307+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
299308

300309
// Now let's get display options
301310
$show_comments = $show_random = $show_recent = false;

core/controller/moderate.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function __construct(\phpbb\config\config $config, \phpbb\request\request
140140
*/
141141
public function base($album_id = 0)
142142
{
143-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
143+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
144144
$album_backlink = $album_id === 0 ? $this->helper->route('phpbbgallery_core_moderate') : $this->helper->route('phpbbgallery_core_moderate_album', array('album_id' => $album_id));
145145
$album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login');
146146
if ($album_id === 0)
@@ -202,7 +202,7 @@ public function queue_approve($page, $album_id)
202202
$this->language->add_lang(array('gallery_mcp', 'gallery'), 'phpbbgallery/core');
203203
$this->language->add_lang('mcp');
204204

205-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
205+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
206206
$album_backlink = $album_id === 0 ? $this->helper->route('phpbbgallery_core_moderate') : $this->helper->route('phpbbgallery_core_moderate_album', array('album_id' => $album_id));
207207
$album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login');
208208
if ($album_id === 0)
@@ -298,7 +298,7 @@ public function action_log($page, $album_id)
298298
$this->language->add_lang(array('gallery_mcp', 'gallery'), 'phpbbgallery/core');
299299
$this->language->add_lang('mcp');
300300

301-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
301+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
302302
$album_backlink = $album_id === 0 ? $this->helper->route('phpbbgallery_core_moderate') : $this->helper->route('phpbbgallery_core_moderate_album', array('album_id' => $album_id));
303303
$album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login');
304304
if ($album_id === 0)
@@ -370,7 +370,7 @@ public function reports($page, $album_id, $status)
370370
confirm_box(false, $this->language->lang('REPORTS_A_CLOSE2_CONFIRM'), $s_hidden_fields);
371371
}
372372
}
373-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
373+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
374374
$album_backlink = $album_id === 0 ? $this->helper->route('phpbbgallery_core_moderate') : $this->helper->route('phpbbgallery_core_moderate_album', array('album_id' => $album_id));
375375
$album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login');
376376
if ($album_id === 0)
@@ -504,7 +504,7 @@ public function album_overview($album_id, $page)
504504
}
505505
}
506506
}
507-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
507+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
508508
$album_backlink = $album_id === 0 ? $this->helper->route('phpbbgallery_core_moderate') : $this->helper->route('phpbbgallery_core_moderate_album', array('album_id' => $album_id));
509509
$album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login');
510510
if ($album_id === 0)
@@ -619,7 +619,7 @@ public function image($image_id)
619619
$this->user_loader->load_users(array_keys($users_array));
620620
// Now let's get some ACL
621621
$select_select = '<option value="" selected="selected">' . $this->language->lang('CHOOSE_ACTION') . '</option>';
622-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
622+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
623623
if ($this->gallery_auth->acl_check('m_status', $album_data['album_id'], $album_data['album_user_id']))
624624
{
625625
if ($image_data['image_status'] == 0)
@@ -701,7 +701,7 @@ public function approve($image_id)
701701
$image_backlink = $this->helper->route('phpbbgallery_core_image', array('image_id' => $image_id));
702702
$album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login');
703703
$meta_refresh_time = 2;
704-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
704+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
705705
if (!$this->gallery_auth->acl_check('m_status', $image_data['image_album_id'], $album_data['album_user_id']))
706706
{
707707
$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
@@ -768,7 +768,7 @@ public function unapprove($image_id)
768768
$image_backlink = $this->helper->route('phpbbgallery_core_image', array('image_id' => $image_id));
769769
$album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login');
770770
$meta_refresh_time = 2;
771-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
771+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
772772
if (!$this->gallery_auth->acl_check('m_status', $image_data['image_album_id'], $album_data['album_user_id']))
773773
{
774774
$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
@@ -810,7 +810,7 @@ public function move($image_id): \Symfony\Component\HttpFoundation\Response
810810
$album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login');
811811
$meta_refresh_time = 2;
812812
$this->language->add_lang(array('gallery_mcp', 'gallery'), 'phpbbgallery/core');
813-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
813+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
814814
if (!$this->gallery_auth->acl_check('m_move', $image_data['image_album_id'], $album_data['album_user_id']))
815815
{
816816
$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
@@ -858,7 +858,7 @@ public function lock($image_id)
858858
$album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login');
859859
$meta_refresh_time = 2;
860860
$this->language->add_lang(array('gallery_mcp', 'gallery'), 'phpbbgallery/core');
861-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
861+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
862862
if (!$this->gallery_auth->acl_check('m_status', $image_data['image_album_id'], $album_data['album_user_id']))
863863
{
864864
$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');

core/controller/search.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function base($page = 1)
185185
$sort_by_text['lc'] = $this->language->lang('NEW_COMMENT');
186186
$sort_by_sql['lc'] = 'image_last_comment';
187187
}
188-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
188+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
189189

190190
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
191191
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
@@ -385,7 +385,7 @@ public function random()
385385
$this->template->assign_var('S_NO_SEARCH', true);
386386
trigger_error('NO_SEARCH');
387387
}
388-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
388+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
389389
$this->template->assign_block_vars('navlinks', array(
390390
'FORUM_NAME' => $this->language->lang('GALLERY'),
391391
'U_VIEW_FORUM' => $this->helper->route('phpbbgallery_core_index'),
@@ -423,7 +423,7 @@ public function recent($page)
423423
trigger_error('NO_SEARCH');
424424
}
425425

426-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
426+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
427427
$this->template->assign_block_vars('navlinks', array(
428428
'FORUM_NAME' => $this->language->lang('GALLERY'),
429429
'U_VIEW_FORUM' => $this->helper->route('phpbbgallery_core_index'),
@@ -465,7 +465,7 @@ public function recent_comments($page)
465465
trigger_error('NO_SEARCH');
466466
}
467467

468-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
468+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
469469
$this->template->assign_block_vars('navlinks', array(
470470
'FORUM_NAME' => $this->language->lang('GALLERY'),
471471
'U_VIEW_FORUM' => $this->helper->route('phpbbgallery_core_index'),
@@ -506,7 +506,7 @@ public function ego_search($page)
506506
trigger_error('NO_SEARCH');
507507
}
508508

509-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
509+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
510510
$this->template->assign_block_vars('navlinks', array(
511511
'FORUM_NAME' => $this->language->lang('GALLERY'),
512512
'U_VIEW_FORUM' => $this->helper->route('phpbbgallery_core_index'),
@@ -547,7 +547,7 @@ public function toprated($page)
547547
trigger_error('NO_SEARCH');
548548
}
549549

550-
$this->gallery_auth->load_user_premissions($this->user->data['user_id']);
550+
$this->gallery_auth->load_user_permissions($this->user->data['user_id']);
551551
$this->template->assign_block_vars('navlinks', array(
552552
'FORUM_NAME' => $this->language->lang('GALLERY'),
553553
'U_VIEW_FORUM' => $this->helper->route('phpbbgallery_core_index'),

0 commit comments

Comments
 (0)