o_acp_gallery_logs'), 'phpbbgallery/core'); $this->gallery_auth->load_user_premissions($this->user->data['user_id']); $sql_array = array( 'FROM' => array( $this->log_table => 'l' ), 'LEFT_JOIN' => array( array( 'FROM' => array($this->images_table => 'i'), 'ON' => 'l.image = i.image_id' ) ) ); $sql_where = array(); if ($type != 'all') { $sql_where[] = "log_type = '" . $this->db->sql_escape($type) . "'"; } // If album is -1 we are calling it from ACP so ... prority! // If album is 0 we are calling it from moderator log, so we need album we can access $mod_array = $this->gallery_auth->acl_album_ids('m_status'); // Patch for missing album $mod_array[] = 0; if ($album === 0) { // If no albums we can approve - quit building queue if (empty($mod_array)) { return; } $sql_where[] = $this->db->sql_in_set('l.album', $mod_array); $sql_where[] = $this->db->sql_in_set('i.image_album_id', $mod_array); } if ($album > 0) { if (!$this->gallery_auth->acl_check('i_view', $album)) { return; } $sql_where[] = 'l.album = ' . (int) $album; } if ($image > 0) { $sql_where[] = 'l.image = ' . (int) $image; $sql_where[] = $this->db->sql_in_set('i.image_album_id', $mod_array); } if (isset($additional['sort_days'])) { $sql_where[] = 'l.log_time > ' . (time() - ($additional['sort_days'] * 86400)); } // And additional check for "active" logs (DB admin can review logs in DB) $sql_where[] = 'l.deleted = 0'; $sql_array['WHERE'] = implode(' and ', $sql_where); if (isset($additional['sort_key'])) { switch ($additional['sort_key']) { case 'u': $sql_array['ORDER_BY'] = 'l.log_user ' . (isset($additional['sort_dir']) ? 'ASC' : 'DESC'); $sql_array['GROUP_BY'] = 'l.log_user, l.log_id, i.image_id'; break; case 'i': $sql_array['ORDER_BY'] = 'l.log_ip ' . (isset($additional['sort_dir']) ? 'ASC' : 'DESC'); $sql_array['GROUP_BY'] = 'l.log_ip, l.log_id, i.image_id'; break; case 'o': $sql_array['ORDER_BY'] = 'l.description ' . (isset($additional['sort_dir']) ? 'ASC' : 'DESC'); $sql_array['GROUP_BY'] = 'l.description, l.log_id, i.image_id'; break; } } else { $sql_array['ORDER_BY'] = 'l.log_time ' . (isset($additional['sort_dir']) ? 'ASC' : 'DESC'); $sql_array['GROUP_BY'] = 'l.log_time, l.log_id, i.image_id'; } // So we need count - so define SELECT $sql_array['SELECT'] = 'SUM(l.log_id) as count'; $sql = $this->db->sql_build_query('SELECT', $sql_array); $result = $this->db->sql_query($sql); $row = $this->db->sql_fetchrow($result); $this->db->sql_freeresult($result); $count = $row['count']; $sql_array['SELECT'] = '*'; $sql = $this->db->sql_build_query('SELECT', $sql_array); $result = $this->db->sql_query_limit($sql, $limit, ($page - 1) * $limit); $logoutput = $users_array = array(); while ($row = $this->db->sql_fetchrow($result)) { $logoutput[] = array( 'id' => $row['log_id'], 'type' => $row['log_type'], 'action' => $row['log_action'], 'time' => $row['log_time'], 'user' => $row['log_user'], 'ip' => $row['log_ip'], 'album' => $row['album'], 'image' => $row['image'], 'description' => json_decode(stripslashes($row['description'])) ); $users_array[$row['log_user']] = array(''); } $this->db->sql_freeresult($result); $this->user_loader->load_users(array_keys($users_array)); // Let's build template vars if (!empty($logoutput)) { foreach ($logoutput as $var) { $this->template->assign_block_vars('log', array( 'U_LOG_ID' => $var['id'], 'U_LOG_USER' => $this->user_loader->get_username($var['user'], 'full'), 'U_TYPE' => $var['type'], 'U_LOG_IP' => $var['ip'], 'U_ALBUM_LINK' => $var['album'] != 0 ? $this->helper->route('phpbbgallery_core_album', array('album_id' => $var['album'])) : false, 'U_IMAGE_LINK' => $var['image'] != 0 ? $this->helper->route('phpbbgallery_core_image', array('image_id' => $var['image'])) : false, //'U_LOG_ACTION' => $description, 'U_LOG_ACTION' => $this->language->lang($var['description'][0], isset($var['description'][1]) ? $var['description'][1] : false, isset($var['description'][2]) ? $var['description'][2] : false, isset($var['description'][3]) ? $var['description'][3] : false), 'U_TIME' => $this->user->format_date($var['time']), )); } } $this->template->assign_vars(array( 'S_HAS_LOGS' => $count > 0 ? true : false, 'TOTAL_PAGES' => $this->language->lang('PAGE_TITLE_NUMBER', $page), )); // Here we do some routes magic if ($album == 0) { $this->pagination->generate_template_pagination(array( 'routes' => array( 'phpbbgallery_core_moderate_action_log', 'phpbbgallery_core_moderate_action_log_page', ), 'params' => array( ), ), 'pagination', 'page', $count, $limit, ($page-1) * $limit); } else if ($album == -1) { $url_array = array( 'i' => '-phpbbgallery-core-acp-gallery_logs_module', 'mode' => 'main', ); if (isset($additional['sort_days'])) { $url_array['st'] = $additional['sort_days']; } if (isset($additional['sort_key'])) { $url_array['sk'] = $additional['sort_key']; } if (isset($additional['sort_dir'])) { $url_array['sd'] = $additional['sort_dir']; } $url = http_build_query($url_array,'','&'); $this->pagination->generate_template_pagination(append_sid('index.php?' . $url), 'pagination', 'page', $count, $limit, ($page-1) * $limit); } else { $this->pagination->generate_template_pagination(array( 'routes' => array( 'phpbbgallery_core_moderate_action_log_album', 'phpbbgallery_core_moderate_action_log_album_page', ), 'params' => array( 'album_id' => $album, ), ), 'pagination', 'page', $count, $limit, ($page-1) * $limit); } } }
Fatal error: Uncaught Error: Class "phpbbgallery\core\log" not found in /htdocs/cache/production/container_4335734bbdd20f586549a504dff5f80c.php:6530 Stack trace: #0 /htdocs/cache/production/container_4335734bbdd20f586549a504dff5f80c.php(6510): phpbb_cache_container->getPhpbbgallery_Core_LogService() #1 /htdocs/cache/production/container_4335734bbdd20f586549a504dff5f80c.php(6690): phpbb_cache_container->getPhpbbgallery_Core_ImageService() #2 /htdocs/cache/production/container_4335734bbdd20f586549a504dff5f80c.php(6520): phpbb_cache_container->getPhpbbgallery_Core_SearchService() #3 /htdocs/cache/production/container_4335734bbdd20f586549a504dff5f80c.php(4064): phpbb_cache_container->getPhpbbgallery_Core_ListenerService() #4 /htdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(231): phpbb_cache_container->{closure}() #5 /htdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(61): Symfony\Component\EventDispatcher\EventDispatcher->sortListeners('core.user_setup') #6 /htdocs/vendor/symfony/event-dispatcher/EventDispatcher.php(43): Symfony\Component\EventDispatcher\EventDispatcher->getListeners('core.user_setup') #7 /htdocs/phpbb/event/dispatcher.php(62): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('core.user_setup', Object(phpbb\event\data)) #8 /htdocs/phpbb/event/dispatcher.php(46): phpbb\event\dispatcher->dispatch('core.user_setup', Object(phpbb\event\data)) #9 /htdocs/phpbb/user.php(222): phpbb\event\dispatcher->trigger_event('core.user_setup', Array) #10 /htdocs/viewtopic.php(356): phpbb\user->setup('viewtopic', '0') #11 {main} thrown in /htdocs/cache/production/container_4335734bbdd20f586549a504dff5f80c.php on line 6530