@@ -825,8 +825,8 @@ |
||
| 825 | 825 | generate_smilies('inline', 0); |
| 826 | 826 | |
| 827 | 827 | /** |
| 828 | - * Rating-System: now you can comment and rate in one form |
|
| 829 | - */ |
|
| 828 | + * Rating-System: now you can comment and rate in one form |
|
| 829 | + */ |
|
| 830 | 830 | $s_user_rated = false; |
| 831 | 831 | if ($this->gallery_config->get('allow_rates')) |
| 832 | 832 | { |
@@ -14,11 +14,11 @@ discard block |
||
| 14 | 14 | 'phpbbgallery/acpcleanup', |
| 15 | 15 | ); |
| 16 | 16 | /** |
| 17 | - * Single enable step that installs any included migrations |
|
| 18 | - * |
|
| 19 | - * @param mixed $old_state State returned by previous call of this method |
|
| 20 | - * @return mixed Returns false after last step, otherwise temporary state |
|
| 21 | - */ |
|
| 17 | + * Single enable step that installs any included migrations |
|
| 18 | + * |
|
| 19 | + * @param mixed $old_state State returned by previous call of this method |
|
| 20 | + * @return mixed Returns false after last step, otherwise temporary state |
|
| 21 | + */ |
|
| 22 | 22 | function enable_step($old_state) |
| 23 | 23 | { |
| 24 | 24 | switch ($old_state) |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * Single disable step that does nothing |
|
| 56 | - * |
|
| 57 | - * @param mixed $old_state State returned by previous call of this method |
|
| 58 | - * @return mixed Returns false after last step, otherwise temporary state |
|
| 59 | - */ |
|
| 55 | + * Single disable step that does nothing |
|
| 56 | + * |
|
| 57 | + * @param mixed $old_state State returned by previous call of this method |
|
| 58 | + * @return mixed Returns false after last step, otherwise temporary state |
|
| 59 | + */ |
|
| 60 | 60 | function disable_step($old_state) |
| 61 | 61 | { |
| 62 | 62 | switch ($old_state) |
@@ -87,21 +87,21 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | - * Single purge step that reverts any included and installed migrations |
|
| 91 | - * |
|
| 92 | - * @param mixed $old_state State returned by previous call of this method |
|
| 93 | - * @return mixed Returns false after last step, otherwise temporary state |
|
| 94 | - */ |
|
| 90 | + * Single purge step that reverts any included and installed migrations |
|
| 91 | + * |
|
| 92 | + * @param mixed $old_state State returned by previous call of this method |
|
| 93 | + * @return mixed Returns false after last step, otherwise temporary state |
|
| 94 | + */ |
|
| 95 | 95 | function purge_step($old_state) |
| 96 | 96 | { |
| 97 | 97 | switch ($old_state) |
| 98 | 98 | { |
| 99 | 99 | case '': // Empty means nothing has run yet |
| 100 | 100 | /** |
| 101 | - * @todo Remove this try/catch condition once purge_notifications is fixed |
|
| 102 | - * in the core to work with disabled extensions without fatal errors. |
|
| 103 | - * https://tracker.phpbb.com/browse/PHPBB3-12435 |
|
| 104 | - */ |
|
| 101 | + * @todo Remove this try/catch condition once purge_notifications is fixed |
|
| 102 | + * in the core to work with disabled extensions without fatal errors. |
|
| 103 | + * https://tracker.phpbb.com/browse/PHPBB3-12435 |
|
| 104 | + */ |
|
| 105 | 105 | try |
| 106 | 106 | { |
| 107 | 107 | // Purge board rules notifications |
@@ -59,11 +59,11 @@ |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | - * Helper function building queues |
|
| 63 | - * @param int $album album we build queue for |
|
| 64 | - * @param int $page This queue builder should return objects for MCP queues, so page? |
|
| 65 | - * @param int $per_page We need how many elements per page |
|
| 66 | - */ |
|
| 62 | + * Helper function building queues |
|
| 63 | + * @param int $album album we build queue for |
|
| 64 | + * @param int $page This queue builder should return objects for MCP queues, so page? |
|
| 65 | + * @param int $per_page We need how many elements per page |
|
| 66 | + */ |
|
| 67 | 67 | public function build_list($album, $page = 1, $per_page = 0) |
| 68 | 68 | { |
| 69 | 69 | // So if we are not forcing par page get it from config |
@@ -14,40 +14,40 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | class album |
| 16 | 16 | { |
| 17 | - /** @var \phpbb\db\driver\driver_interface */ |
|
| 18 | - protected $db; |
|
| 17 | + /** @var \phpbb\db\driver\driver_interface */ |
|
| 18 | + protected $db; |
|
| 19 | 19 | |
| 20 | - /** @var \phpbb\user */ |
|
| 21 | - protected $user; |
|
| 20 | + /** @var \phpbb\user */ |
|
| 21 | + protected $user; |
|
| 22 | 22 | |
| 23 | - /** @var language */ |
|
| 24 | - protected $language; |
|
| 23 | + /** @var language */ |
|
| 24 | + protected $language; |
|
| 25 | 25 | |
| 26 | - /** @var \phpbb\profilefields\manager */ |
|
| 27 | - protected $user_cpf; |
|
| 26 | + /** @var \phpbb\profilefields\manager */ |
|
| 27 | + protected $user_cpf; |
|
| 28 | 28 | |
| 29 | - /** @var \phpbbgallery\core\auth\auth */ |
|
| 30 | - protected $gallery_auth; |
|
| 29 | + /** @var \phpbbgallery\core\auth\auth */ |
|
| 30 | + protected $gallery_auth; |
|
| 31 | 31 | |
| 32 | - /** @var \phpbbgallery\core\cache */ |
|
| 33 | - protected $gallery_cache; |
|
| 32 | + /** @var \phpbbgallery\core\cache */ |
|
| 33 | + protected $gallery_cache; |
|
| 34 | 34 | |
| 35 | - /** @var \phpbbgallery\core\block */ |
|
| 36 | - protected $block; |
|
| 35 | + /** @var \phpbbgallery\core\block */ |
|
| 36 | + protected $block; |
|
| 37 | 37 | |
| 38 | - /** @var \phpbbgallery\core\config */ |
|
| 39 | - protected $gallery_config; |
|
| 38 | + /** @var \phpbbgallery\core\config */ |
|
| 39 | + protected $gallery_config; |
|
| 40 | 40 | |
| 41 | - /** @var */ |
|
| 42 | - protected $images_table; |
|
| 41 | + /** @var */ |
|
| 42 | + protected $images_table; |
|
| 43 | 43 | |
| 44 | - /** @var */ |
|
| 45 | - protected $watch_table; |
|
| 44 | + /** @var */ |
|
| 45 | + protected $watch_table; |
|
| 46 | 46 | |
| 47 | - /** @var */ |
|
| 48 | - protected $contest_table; |
|
| 47 | + /** @var */ |
|
| 48 | + protected $contest_table; |
|
| 49 | 49 | |
| 50 | - /** @var */ |
|
| 50 | + /** @var */ |
|
| 51 | 51 | protected $albums_table; |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -463,8 +463,8 @@ discard block |
||
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | /** |
| 466 | - * Create array of album IDs that are public |
|
| 467 | - */ |
|
| 466 | + * Create array of album IDs that are public |
|
| 467 | + */ |
|
| 468 | 468 | public function get_public_albums() |
| 469 | 469 | { |
| 470 | 470 | $sql = 'SELECT album_id |
@@ -40,12 +40,12 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * Load the data of an album |
|
| 44 | - * |
|
| 45 | - * @param int $album_id |
|
| 46 | - * @return bool True if the album was loaded |
|
| 47 | - * @throws \OutOfBoundsException if the album does not exist |
|
| 48 | - */ |
|
| 43 | + * Load the data of an album |
|
| 44 | + * |
|
| 45 | + * @param int $album_id |
|
| 46 | + * @return bool True if the album was loaded |
|
| 47 | + * @throws \OutOfBoundsException if the album does not exist |
|
| 48 | + */ |
|
| 49 | 49 | public function load($album_id) |
| 50 | 50 | { |
| 51 | 51 | $sql_array = array( |
@@ -107,13 +107,13 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | - * Check whether the album_user is the user who wants to do something |
|
| 111 | - * |
|
| 112 | - * @param int $album_id |
|
| 113 | - * @param mixed $user_id If false the current user will be compared |
|
| 114 | - * @return bool True if the user is the owner of the album |
|
| 115 | - * @throws \DomainException if the user is not the owner of the album |
|
| 116 | - */ |
|
| 110 | + * Check whether the album_user is the user who wants to do something |
|
| 111 | + * |
|
| 112 | + * @param int $album_id |
|
| 113 | + * @param mixed $user_id If false the current user will be compared |
|
| 114 | + * @return bool True if the user is the owner of the album |
|
| 115 | + * @throws \DomainException if the user is not the owner of the album |
|
| 116 | + */ |
|
| 117 | 117 | public function validate_owner($album_id, $user_id = false) |
| 118 | 118 | { |
| 119 | 119 | $album_id = (int) $album_id; |
@@ -751,8 +751,8 @@ discard block |
||
| 751 | 751 | $log_action = implode('_', array($log_action_images, $log_action_albums)); |
| 752 | 752 | |
| 753 | 753 | /** |
| 754 | - * Log what we did |
|
| 755 | - */ |
|
| 754 | + * Log what we did |
|
| 755 | + */ |
|
| 756 | 756 | switch ($log_action) |
| 757 | 757 | { |
| 758 | 758 | case 'MOVE_IMAGES_MOVE_ALBUMS': |
@@ -842,14 +842,14 @@ discard block |
||
| 842 | 842 | $this->gallery_notification->delete_albums($from_id); |
| 843 | 843 | |
| 844 | 844 | /** |
| 845 | - * Event related to moving album content |
|
| 846 | - * |
|
| 847 | - * @event phpbbgallery.core.album.manage.move_album_content |
|
| 848 | - * @var int from_id Album we are moving from |
|
| 849 | - * @var int to_id Album we are moving to |
|
| 850 | - * @var bool sync Should we sync the albums data |
|
| 851 | - * @since 1.2.0 |
|
| 852 | - */ |
|
| 845 | + * Event related to moving album content |
|
| 846 | + * |
|
| 847 | + * @event phpbbgallery.core.album.manage.move_album_content |
|
| 848 | + * @var int from_id Album we are moving from |
|
| 849 | + * @var int to_id Album we are moving to |
|
| 850 | + * @var bool sync Should we sync the albums data |
|
| 851 | + * @since 1.2.0 |
|
| 852 | + */ |
|
| 853 | 853 | $vars = array('from_id', 'to_id', 'sync'); |
| 854 | 854 | extract($this->dispatcher->trigger_event('phpbbgallery.core.album.manage.move_album_content', compact($vars))); |
| 855 | 855 | |
@@ -951,12 +951,12 @@ discard block |
||
| 951 | 951 | $this->gallery_config->set('num_comments', $row['num_comments']); |
| 952 | 952 | |
| 953 | 953 | /** |
| 954 | - * Event delete album content |
|
| 955 | - * |
|
| 956 | - * @event phpbbgallery.core.album.manage.delete_album_content |
|
| 957 | - * @var int album_id Album we are deleting |
|
| 958 | - * @since 1.2.0 |
|
| 959 | - */ |
|
| 954 | + * Event delete album content |
|
| 955 | + * |
|
| 956 | + * @event phpbbgallery.core.album.manage.delete_album_content |
|
| 957 | + * @var int album_id Album we are deleting |
|
| 958 | + * @since 1.2.0 |
|
| 959 | + */ |
|
| 960 | 960 | $vars = array('album_id'); |
| 961 | 961 | extract($this->dispatcher->trigger_event('phpbbgallery.core.album.manage.delete_album_content', compact($vars))); |
| 962 | 962 | |
@@ -979,11 +979,11 @@ discard block |
||
| 979 | 979 | public function move_album_by($album_row, $action = 'move_up', $steps = 1) |
| 980 | 980 | { |
| 981 | 981 | /** |
| 982 | - * Fetch all the siblings between the module's current spot |
|
| 983 | - * and where we want to move it to. If there are less than $steps |
|
| 984 | - * siblings between the current spot and the target then the |
|
| 985 | - * module will move as far as possible |
|
| 986 | - */ |
|
| 982 | + * Fetch all the siblings between the module's current spot |
|
| 983 | + * and where we want to move it to. If there are less than $steps |
|
| 984 | + * siblings between the current spot and the target then the |
|
| 985 | + * module will move as far as possible |
|
| 986 | + */ |
|
| 987 | 987 | $sql = 'SELECT album_id, album_name, left_id, right_id |
| 988 | 988 | FROM ' . $this->albums_table . ' |
| 989 | 989 | WHERE parent_id = ' . (int) $album_row['parent_id'] . ' |
@@ -1005,12 +1005,12 @@ discard block |
||
| 1005 | 1005 | } |
| 1006 | 1006 | |
| 1007 | 1007 | /** |
| 1008 | - * $left_id and $right_id define the scope of the nodes that are affected by the move. |
|
| 1009 | - * $diff_up and $diff_down are the values to substract or add to each node's left_id |
|
| 1010 | - * and right_id in order to move them up or down. |
|
| 1011 | - * $move_up_left and $move_up_right define the scope of the nodes that are moving |
|
| 1012 | - * up. Other nodes in the scope of ($left_id, $right_id) are considered to move down. |
|
| 1013 | - */ |
|
| 1008 | + * $left_id and $right_id define the scope of the nodes that are affected by the move. |
|
| 1009 | + * $diff_up and $diff_down are the values to substract or add to each node's left_id |
|
| 1010 | + * and right_id in order to move them up or down. |
|
| 1011 | + * $move_up_left and $move_up_right define the scope of the nodes that are moving |
|
| 1012 | + * up. Other nodes in the scope of ($left_id, $right_id) are considered to move down. |
|
| 1013 | + */ |
|
| 1014 | 1014 | if ($action == 'move_up') |
| 1015 | 1015 | { |
| 1016 | 1016 | $left_id = $target['left_id']; |
@@ -213,9 +213,9 @@ |
||
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
| 216 | - * Get all recent images the user has access to |
|
| 217 | - * return (int) $images_count |
|
| 218 | - */ |
|
| 216 | + * Get all recent images the user has access to |
|
| 217 | + * return (int) $images_count |
|
| 218 | + */ |
|
| 219 | 219 | public function recent_count() |
| 220 | 220 | { |
| 221 | 221 | $this->gallery_auth->load_user_premissions($this->user->data['user_id']); |
@@ -103,8 +103,8 @@ discard block |
||
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | - * Load the users data from the database and cast it... |
|
| 107 | - */ |
|
| 106 | + * Load the users data from the database and cast it... |
|
| 107 | + */ |
|
| 108 | 108 | public function load_data() |
| 109 | 109 | { |
| 110 | 110 | $this->entry_exists = false; |
@@ -134,9 +134,9 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
| 137 | - * Some functions need the data to be loaded or at least checked. |
|
| 138 | - * So here we loaded if it is not laoded yet and we need it ;) |
|
| 139 | - */ |
|
| 137 | + * Some functions need the data to be loaded or at least checked. |
|
| 138 | + * So here we loaded if it is not laoded yet and we need it ;) |
|
| 139 | + */ |
|
| 140 | 140 | public function force_load() |
| 141 | 141 | { |
| 142 | 142 | if (is_null($this->entry_exists)) |
@@ -146,12 +146,12 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /** |
| 149 | - * Get user-setting, if the user does not have his own settings we fall back to default. |
|
| 150 | - * |
|
| 151 | - * @param string $key Column name from the users-table |
|
| 152 | - * @param bool $default Load default value, if user has no entry |
|
| 153 | - * @return mixed Returns the value of the column, it it does not exist it returns false. |
|
| 154 | - */ |
|
| 149 | + * Get user-setting, if the user does not have his own settings we fall back to default. |
|
| 150 | + * |
|
| 151 | + * @param string $key Column name from the users-table |
|
| 152 | + * @param bool $default Load default value, if user has no entry |
|
| 153 | + * @return mixed Returns the value of the column, it it does not exist it returns false. |
|
| 154 | + */ |
|
| 155 | 155 | public function get_data($key, $default = true) |
| 156 | 156 | { |
| 157 | 157 | if (isset($this->data[$key])) |
@@ -217,11 +217,11 @@ discard block |
||
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
| 220 | - * Updates the users table with the new data. |
|
| 221 | - * |
|
| 222 | - * @param array $data Array of data we want to add/update. |
|
| 223 | - * @return bool Returns true if the columns were updated successfully |
|
| 224 | - */ |
|
| 220 | + * Updates the users table with the new data. |
|
| 221 | + * |
|
| 222 | + * @param array $data Array of data we want to add/update. |
|
| 223 | + * @return bool Returns true if the columns were updated successfully |
|
| 224 | + */ |
|
| 225 | 225 | private function update($data) |
| 226 | 226 | { |
| 227 | 227 | $sql_ary = array_merge($this->validate_data($data), array( |
@@ -240,11 +240,11 @@ discard block |
||
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | /** |
| 243 | - * Updates the users table by increasing the values. |
|
| 244 | - * |
|
| 245 | - * @param int $num Number of images to add to the counter |
|
| 246 | - * @return bool Returns true if the columns were updated successfully, else false |
|
| 247 | - */ |
|
| 243 | + * Updates the users table by increasing the values. |
|
| 244 | + * |
|
| 245 | + * @param int $num Number of images to add to the counter |
|
| 246 | + * @return bool Returns true if the columns were updated successfully, else false |
|
| 247 | + */ |
|
| 248 | 248 | protected function update_image_count($num) |
| 249 | 249 | { |
| 250 | 250 | $sql = 'UPDATE ' . $this->gallery_users_table . ' |
@@ -267,11 +267,11 @@ discard block |
||
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | /** |
| 270 | - * Updates the users table with the new data. |
|
| 271 | - * |
|
| 272 | - * @param array $data Array of data we want to insert |
|
| 273 | - * @return bool Returns true if the data was inserted successfully |
|
| 274 | - */ |
|
| 270 | + * Updates the users table with the new data. |
|
| 271 | + * |
|
| 272 | + * @param array $data Array of data we want to insert |
|
| 273 | + * @return bool Returns true if the data was inserted successfully |
|
| 274 | + */ |
|
| 275 | 275 | private function insert($data) |
| 276 | 276 | { |
| 277 | 277 | $sql_ary = array_merge(self::get_default_values(), $this->validate_data($data), array( |
@@ -295,8 +295,8 @@ discard block |
||
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /** |
| 298 | - * Delete the user from the table. |
|
| 299 | - */ |
|
| 298 | + * Delete the user from the table. |
|
| 299 | + */ |
|
| 300 | 300 | public function delete() |
| 301 | 301 | { |
| 302 | 302 | $sql = 'DELETE FROM ' . $this->gallery_users_table . ' |
@@ -305,10 +305,10 @@ discard block |
||
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | /** |
| 308 | - * Delete the user from the table. |
|
| 309 | - * |
|
| 310 | - * @param mixed $user_ids Can either be an array of IDs, one ID or the string 'all' to delete all users. |
|
| 311 | - */ |
|
| 308 | + * Delete the user from the table. |
|
| 309 | + * |
|
| 310 | + * @param mixed $user_ids Can either be an array of IDs, one ID or the string 'all' to delete all users. |
|
| 311 | + */ |
|
| 312 | 312 | public function delete_users($user_ids) |
| 313 | 313 | { |
| 314 | 314 | |
@@ -320,12 +320,12 @@ discard block |
||
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | /** |
| 323 | - * Updates the users table with new data. |
|
| 324 | - * |
|
| 325 | - * @param mixed $user_ids Can either be an array of IDs, one ID or the string 'all' to update all users. |
|
| 326 | - * @param array $data Array of data we want to add/update. |
|
| 327 | - * @return bool Returns true if the columns were updated successfully |
|
| 328 | - */ |
|
| 323 | + * Updates the users table with new data. |
|
| 324 | + * |
|
| 325 | + * @param mixed $user_ids Can either be an array of IDs, one ID or the string 'all' to update all users. |
|
| 326 | + * @param array $data Array of data we want to add/update. |
|
| 327 | + * @return bool Returns true if the columns were updated successfully |
|
| 328 | + */ |
|
| 329 | 329 | public function update_users($user_ids, $data) |
| 330 | 330 | { |
| 331 | 331 | $sql_ary = array_merge($this->validate_data($data), array( |
@@ -344,11 +344,11 @@ discard block |
||
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | /** |
| 347 | - * Builds a valid WHERE-sql-statement, with casted integers, or empty to allow handling all users. |
|
| 348 | - * |
|
| 349 | - * @param mixed $user_ids Can either be an array of IDs, one ID or the string 'all' to update all users. |
|
| 350 | - * @return string The WHERE statement with "WHERE " if needed. |
|
| 351 | - */ |
|
| 347 | + * Builds a valid WHERE-sql-statement, with casted integers, or empty to allow handling all users. |
|
| 348 | + * |
|
| 349 | + * @param mixed $user_ids Can either be an array of IDs, one ID or the string 'all' to update all users. |
|
| 350 | + * @return string The WHERE statement with "WHERE " if needed. |
|
| 351 | + */ |
|
| 352 | 352 | public function sql_build_where($user_ids) |
| 353 | 353 | { |
| 354 | 354 | if (is_array($user_ids) && !empty($user_ids)) |
@@ -368,12 +368,12 @@ discard block |
||
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | /** |
| 371 | - * Validate user data. |
|
| 372 | - * |
|
| 373 | - * @param array $data Array of data we need to validate |
|
| 374 | - * @param bool $inc Are we incrementing the value |
|
| 375 | - * @return array Array with all allowed keys and their casted and selected values |
|
| 376 | - */ |
|
| 371 | + * Validate user data. |
|
| 372 | + * |
|
| 373 | + * @param array $data Array of data we need to validate |
|
| 374 | + * @param bool $inc Are we incrementing the value |
|
| 375 | + * @return array Array with all allowed keys and their casted and selected values |
|
| 376 | + */ |
|
| 377 | 377 | public function validate_data($data, $inc = false) |
| 378 | 378 | { |
| 379 | 379 | $validated_data = array(); |
@@ -412,14 +412,14 @@ discard block |
||
| 412 | 412 | $is_validated = false; |
| 413 | 413 | |
| 414 | 414 | /** |
| 415 | - * Event user validat data |
|
| 416 | - * |
|
| 417 | - * @event phpbbgallery.core.user.validate_data |
|
| 418 | - * @var bool is_validated is value validated |
|
| 419 | - * @var string name value name |
|
| 420 | - * @var mixed value value of the value |
|
| 421 | - * @since 1.2.0 |
|
| 422 | - */ |
|
| 415 | + * Event user validat data |
|
| 416 | + * |
|
| 417 | + * @event phpbbgallery.core.user.validate_data |
|
| 418 | + * @var bool is_validated is value validated |
|
| 419 | + * @var string name value name |
|
| 420 | + * @var mixed value value of the value |
|
| 421 | + * @since 1.2.0 |
|
| 422 | + */ |
|
| 423 | 423 | $vars = array('is_validated', 'name', 'value'); |
| 424 | 424 | extract($this->dispatcher->trigger_event('phpbbgallery.core.user.validate_data', compact($vars))); |
| 425 | 425 | |
@@ -457,12 +457,12 @@ discard block |
||
| 457 | 457 | $default_values = self::$default_values; |
| 458 | 458 | |
| 459 | 459 | /** |
| 460 | - * Event user validat data |
|
| 461 | - * |
|
| 462 | - * @event phpbbgallery.core.user.get_default_values |
|
| 463 | - * @var array default_values the default values array |
|
| 464 | - * @since 1.2.0 |
|
| 465 | - */ |
|
| 460 | + * Event user validat data |
|
| 461 | + * |
|
| 462 | + * @event phpbbgallery.core.user.get_default_values |
|
| 463 | + * @var array default_values the default values array |
|
| 464 | + * @since 1.2.0 |
|
| 465 | + */ |
|
| 466 | 466 | $vars = array('default_values'); |
| 467 | 467 | extract($this->dispatcher->trigger_event('phpbbgallery.core.user.get_default_values', compact($vars))); |
| 468 | 468 | |
@@ -470,8 +470,8 @@ discard block |
||
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | /** |
| 473 | - * Default values for new users. |
|
| 474 | - */ |
|
| 473 | + * Default values for new users. |
|
| 474 | + */ |
|
| 475 | 475 | static protected $default_values = array( |
| 476 | 476 | 'user_images' => 0, |
| 477 | 477 | 'personal_album_id' => 0, |
@@ -505,111 +505,111 @@ discard block |
||
| 505 | 505 | include($this->root_path . 'includes/functions_display.' . $this->php_ext); |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | - $now = $this->user->create_datetime(); |
|
| 509 | - $now = phpbb_gmgetdate($now->getTimestamp() + $now->getOffset()); |
|
| 510 | - |
|
| 511 | - // Cache various user specific data ... so we don't have to recompute |
|
| 512 | - // this each time the same user appears on this page |
|
| 513 | - if (!isset($user_cache[$user_id])) { |
|
| 514 | - if ($user_id == ANONYMOUS) { |
|
| 515 | - $user_cache_data = array( |
|
| 516 | - 'user_type' => USER_IGNORE, |
|
| 517 | - 'joined' => '', |
|
| 518 | - 'posts' => '', |
|
| 519 | - 'sig' => '', |
|
| 520 | - 'sig_bbcode_uid' => '', |
|
| 521 | - 'sig_bbcode_bitfield' => '', |
|
| 522 | - 'online' => false, |
|
| 523 | - 'avatar' => ($this->user->optionget('viewavatars')) ? phpbb_get_user_avatar($row) : '', |
|
| 524 | - 'rank_title' => '', |
|
| 525 | - 'rank_image' => '', |
|
| 526 | - 'rank_image_src' => '', |
|
| 527 | - 'pm' => '', |
|
| 528 | - 'email' => '', |
|
| 529 | - 'jabber' => '', |
|
| 530 | - 'search' => '', |
|
| 531 | - 'age' => '', |
|
| 532 | - 'username' => $row['username'], |
|
| 533 | - 'user_colour' => $row['user_colour'], |
|
| 534 | - 'contact_user' => '', |
|
| 535 | - 'warnings' => 0, |
|
| 536 | - 'allow_pm' => 0, |
|
| 537 | - ); |
|
| 538 | - } else { |
|
| 539 | - $user_sig = ''; |
|
| 540 | - // We add the signature to every posters entry because enable_sig is post dependent |
|
| 541 | - if ($row['user_sig'] && $this->config['allow_sig'] && $this->user->optionget('viewsigs')) { |
|
| 542 | - $user_sig = $row['user_sig']; |
|
| 543 | - } |
|
| 544 | - $user_cache_data = array( |
|
| 545 | - 'user_type' => $row['user_type'], |
|
| 546 | - 'user_inactive_reason' => $row['user_inactive_reason'], |
|
| 547 | - 'joined' => $this->user->format_date($row['user_regdate']), |
|
| 548 | - 'posts' => $row['user_posts'], |
|
| 549 | - 'warnings' => (isset($row['user_warnings'])) ? $row['user_warnings'] : 0, |
|
| 550 | - 'sig' => $user_sig, |
|
| 551 | - 'sig_bbcode_uid' => (!empty($row['user_sig_bbcode_uid'])) ? $row['user_sig_bbcode_uid'] : '', |
|
| 552 | - 'sig_bbcode_bitfield' => (!empty($row['user_sig_bbcode_bitfield'])) ? $row['user_sig_bbcode_bitfield'] : '', |
|
| 553 | - 'viewonline' => $row['user_allow_viewonline'], |
|
| 554 | - 'allow_pm' => $row['user_allow_pm'], |
|
| 555 | - 'avatar' => ($this->user->optionget('viewavatars')) ? phpbb_get_user_avatar($row) : '', |
|
| 556 | - 'age' => '', |
|
| 557 | - 'rank_title' => '', |
|
| 558 | - 'rank_image' => '', |
|
| 559 | - 'rank_image_src' => '', |
|
| 560 | - 'username' => $row['username'], |
|
| 561 | - 'user_colour' => $row['user_colour'], |
|
| 562 | - 'contact_user' => $this->user->lang('CONTACT_USER', get_username_string('username', $user_id, $row['username'], $row['user_colour'], $row['username'])), |
|
| 563 | - 'online' => false, |
|
| 564 | - 'jabber' => ($this->config['jab_enable'] && $row['user_jabber'] && $this->auth->acl_get('u_sendim')) ? append_sid("{$this->root_path}memberlist.$this->php_ext", "mode=contact&action=jabber&u=$user_id") : '', |
|
| 565 | - 'search' => ($this->config['load_search'] && $this->auth->acl_get('u_search')) ? append_sid("{$this->root_path}search.$this->php_ext", "author_id=$user_id&sr=posts") : '', |
|
| 566 | - 'author_full' => get_username_string('full', $user_id, $row['username'], $row['user_colour']), |
|
| 567 | - 'author_colour' => get_username_string('colour', $user_id, $row['username'], $row['user_colour']), |
|
| 568 | - 'author_username' => get_username_string('username', $user_id, $row['username'], $row['user_colour']), |
|
| 569 | - 'author_profile' => get_username_string('profile', $user_id, $row['username'], $row['user_colour']), |
|
| 570 | - ); |
|
| 571 | - |
|
| 572 | - $user_cache[$user_id] = $user_cache_data; |
|
| 573 | - |
|
| 574 | - $user_rank_data = phpbb_get_user_rank($row, $row['user_posts']); |
|
| 575 | - $user_cache[$user_id]['rank_title'] = $user_rank_data['title']; |
|
| 576 | - $user_cache[$user_id]['rank_image'] = $user_rank_data['img']; |
|
| 577 | - $user_cache[$user_id]['rank_image_src'] = $user_rank_data['img_src']; |
|
| 578 | - |
|
| 579 | - if ((!empty($row['user_allow_viewemail']) && $this->auth->acl_get('u_sendemail')) || $this->auth->acl_get('a_email')) |
|
| 580 | - { |
|
| 581 | - $user_cache[$user_id]['email'] = ($this->config['board_email_form'] && $this->config['email_enable']) ? append_sid("{$this->root_path}memberlist.$this->php_ext", "mode=email&u=$user_id") : (($this->config['board_hide_emails'] && !$this->auth->acl_get('a_email')) ? '' : 'mailto:' . $row['user_email']); |
|
| 582 | - } |
|
| 583 | - else |
|
| 584 | - { |
|
| 585 | - $user_cache[$user_id]['email'] = ''; |
|
| 586 | - } |
|
| 587 | - if ($this->config['allow_birthdays'] && !empty($row['user_birthday'])) |
|
| 588 | - { |
|
| 589 | - list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $row['user_birthday'])); |
|
| 590 | - if ($bday_year) |
|
| 591 | - { |
|
| 592 | - $diff = $now['mon'] - $bday_month; |
|
| 593 | - if ($diff == 0) |
|
| 594 | - { |
|
| 595 | - $diff = ($now['mday'] - $bday_day < 0) ? 1 : 0; |
|
| 596 | - } |
|
| 597 | - else |
|
| 598 | - { |
|
| 599 | - $diff = ($diff < 0) ? 1 : 0; |
|
| 600 | - } |
|
| 601 | - $user_cache[$user_id]['age'] = (int) ($now['year'] - $bday_year - $diff); |
|
| 602 | - } |
|
| 603 | - } |
|
| 604 | - } |
|
| 605 | - } |
|
| 508 | + $now = $this->user->create_datetime(); |
|
| 509 | + $now = phpbb_gmgetdate($now->getTimestamp() + $now->getOffset()); |
|
| 510 | + |
|
| 511 | + // Cache various user specific data ... so we don't have to recompute |
|
| 512 | + // this each time the same user appears on this page |
|
| 513 | + if (!isset($user_cache[$user_id])) { |
|
| 514 | + if ($user_id == ANONYMOUS) { |
|
| 515 | + $user_cache_data = array( |
|
| 516 | + 'user_type' => USER_IGNORE, |
|
| 517 | + 'joined' => '', |
|
| 518 | + 'posts' => '', |
|
| 519 | + 'sig' => '', |
|
| 520 | + 'sig_bbcode_uid' => '', |
|
| 521 | + 'sig_bbcode_bitfield' => '', |
|
| 522 | + 'online' => false, |
|
| 523 | + 'avatar' => ($this->user->optionget('viewavatars')) ? phpbb_get_user_avatar($row) : '', |
|
| 524 | + 'rank_title' => '', |
|
| 525 | + 'rank_image' => '', |
|
| 526 | + 'rank_image_src' => '', |
|
| 527 | + 'pm' => '', |
|
| 528 | + 'email' => '', |
|
| 529 | + 'jabber' => '', |
|
| 530 | + 'search' => '', |
|
| 531 | + 'age' => '', |
|
| 532 | + 'username' => $row['username'], |
|
| 533 | + 'user_colour' => $row['user_colour'], |
|
| 534 | + 'contact_user' => '', |
|
| 535 | + 'warnings' => 0, |
|
| 536 | + 'allow_pm' => 0, |
|
| 537 | + ); |
|
| 538 | + } else { |
|
| 539 | + $user_sig = ''; |
|
| 540 | + // We add the signature to every posters entry because enable_sig is post dependent |
|
| 541 | + if ($row['user_sig'] && $this->config['allow_sig'] && $this->user->optionget('viewsigs')) { |
|
| 542 | + $user_sig = $row['user_sig']; |
|
| 543 | + } |
|
| 544 | + $user_cache_data = array( |
|
| 545 | + 'user_type' => $row['user_type'], |
|
| 546 | + 'user_inactive_reason' => $row['user_inactive_reason'], |
|
| 547 | + 'joined' => $this->user->format_date($row['user_regdate']), |
|
| 548 | + 'posts' => $row['user_posts'], |
|
| 549 | + 'warnings' => (isset($row['user_warnings'])) ? $row['user_warnings'] : 0, |
|
| 550 | + 'sig' => $user_sig, |
|
| 551 | + 'sig_bbcode_uid' => (!empty($row['user_sig_bbcode_uid'])) ? $row['user_sig_bbcode_uid'] : '', |
|
| 552 | + 'sig_bbcode_bitfield' => (!empty($row['user_sig_bbcode_bitfield'])) ? $row['user_sig_bbcode_bitfield'] : '', |
|
| 553 | + 'viewonline' => $row['user_allow_viewonline'], |
|
| 554 | + 'allow_pm' => $row['user_allow_pm'], |
|
| 555 | + 'avatar' => ($this->user->optionget('viewavatars')) ? phpbb_get_user_avatar($row) : '', |
|
| 556 | + 'age' => '', |
|
| 557 | + 'rank_title' => '', |
|
| 558 | + 'rank_image' => '', |
|
| 559 | + 'rank_image_src' => '', |
|
| 560 | + 'username' => $row['username'], |
|
| 561 | + 'user_colour' => $row['user_colour'], |
|
| 562 | + 'contact_user' => $this->user->lang('CONTACT_USER', get_username_string('username', $user_id, $row['username'], $row['user_colour'], $row['username'])), |
|
| 563 | + 'online' => false, |
|
| 564 | + 'jabber' => ($this->config['jab_enable'] && $row['user_jabber'] && $this->auth->acl_get('u_sendim')) ? append_sid("{$this->root_path}memberlist.$this->php_ext", "mode=contact&action=jabber&u=$user_id") : '', |
|
| 565 | + 'search' => ($this->config['load_search'] && $this->auth->acl_get('u_search')) ? append_sid("{$this->root_path}search.$this->php_ext", "author_id=$user_id&sr=posts") : '', |
|
| 566 | + 'author_full' => get_username_string('full', $user_id, $row['username'], $row['user_colour']), |
|
| 567 | + 'author_colour' => get_username_string('colour', $user_id, $row['username'], $row['user_colour']), |
|
| 568 | + 'author_username' => get_username_string('username', $user_id, $row['username'], $row['user_colour']), |
|
| 569 | + 'author_profile' => get_username_string('profile', $user_id, $row['username'], $row['user_colour']), |
|
| 570 | + ); |
|
| 571 | + |
|
| 572 | + $user_cache[$user_id] = $user_cache_data; |
|
| 573 | + |
|
| 574 | + $user_rank_data = phpbb_get_user_rank($row, $row['user_posts']); |
|
| 575 | + $user_cache[$user_id]['rank_title'] = $user_rank_data['title']; |
|
| 576 | + $user_cache[$user_id]['rank_image'] = $user_rank_data['img']; |
|
| 577 | + $user_cache[$user_id]['rank_image_src'] = $user_rank_data['img_src']; |
|
| 578 | + |
|
| 579 | + if ((!empty($row['user_allow_viewemail']) && $this->auth->acl_get('u_sendemail')) || $this->auth->acl_get('a_email')) |
|
| 580 | + { |
|
| 581 | + $user_cache[$user_id]['email'] = ($this->config['board_email_form'] && $this->config['email_enable']) ? append_sid("{$this->root_path}memberlist.$this->php_ext", "mode=email&u=$user_id") : (($this->config['board_hide_emails'] && !$this->auth->acl_get('a_email')) ? '' : 'mailto:' . $row['user_email']); |
|
| 582 | + } |
|
| 583 | + else |
|
| 584 | + { |
|
| 585 | + $user_cache[$user_id]['email'] = ''; |
|
| 586 | + } |
|
| 587 | + if ($this->config['allow_birthdays'] && !empty($row['user_birthday'])) |
|
| 588 | + { |
|
| 589 | + list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $row['user_birthday'])); |
|
| 590 | + if ($bday_year) |
|
| 591 | + { |
|
| 592 | + $diff = $now['mon'] - $bday_month; |
|
| 593 | + if ($diff == 0) |
|
| 594 | + { |
|
| 595 | + $diff = ($now['mday'] - $bday_day < 0) ? 1 : 0; |
|
| 596 | + } |
|
| 597 | + else |
|
| 598 | + { |
|
| 599 | + $diff = ($diff < 0) ? 1 : 0; |
|
| 600 | + } |
|
| 601 | + $user_cache[$user_id]['age'] = (int) ($now['year'] - $bday_year - $diff); |
|
| 602 | + } |
|
| 603 | + } |
|
| 604 | + } |
|
| 605 | + } |
|
| 606 | 606 | } |
| 607 | 607 | |
| 608 | 608 | /** |
| 609 | - * Get user personal album |
|
| 610 | - * Checks and returns users personal album |
|
| 611 | - * returns (int) $album_id or 0 |
|
| 612 | - */ |
|
| 609 | + * Get user personal album |
|
| 610 | + * Checks and returns users personal album |
|
| 611 | + * returns (int) $album_id or 0 |
|
| 612 | + */ |
|
| 613 | 613 | public function get_own_root_album() |
| 614 | 614 | { |
| 615 | 615 | $sql = 'SELECT personal_album_id FROM ' . $this->gallery_users_table . ' WHERE user_id = ' . (int) $this->user_id; |
@@ -619,8 +619,8 @@ discard block |
||
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | /** |
| 622 | - * Destroy user data and set this class to empty |
|
| 623 | - */ |
|
| 622 | + * Destroy user data and set this class to empty |
|
| 623 | + */ |
|
| 624 | 624 | public function destroy() |
| 625 | 625 | { |
| 626 | 626 | $this->user_id = null; |
@@ -231,9 +231,9 @@ discard block |
||
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /** |
| 234 | - * We need to disable the "last-modified" caching for guests and in cases of image-errors, |
|
| 235 | - * so that they can view them, if they logged in or the error was fixed. |
|
| 236 | - */ |
|
| 234 | + * We need to disable the "last-modified" caching for guests and in cases of image-errors, |
|
| 235 | + * so that they can view them, if they logged in or the error was fixed. |
|
| 236 | + */ |
|
| 237 | 237 | public function disable_browser_cache() |
| 238 | 238 | { |
| 239 | 239 | $this->browser_cache = false; |
@@ -460,12 +460,12 @@ discard block |
||
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | /** |
| 463 | - * Delete file from disc. |
|
| 464 | - * |
|
| 465 | - * @param mixed $files String with filename or an array of filenames |
|
| 466 | - * Array-Format: $image_id => $filename |
|
| 467 | - * @param array $locations Array of valid url::path()s where the image should be deleted from |
|
| 468 | - */ |
|
| 463 | + * Delete file from disc. |
|
| 464 | + * |
|
| 465 | + * @param mixed $files String with filename or an array of filenames |
|
| 466 | + * Array-Format: $image_id => $filename |
|
| 467 | + * @param array $locations Array of valid url::path()s where the image should be deleted from |
|
| 468 | + */ |
|
| 469 | 469 | public function delete($files, $locations = array('thumbnail', 'medium', 'upload')) |
| 470 | 470 | { |
| 471 | 471 | if (!is_array($files)) |