text:
<?php
/**
 * Functions for Elgg's access system for entities, metadata, and annotations.
 *
 * Access is generally saved in the database as access_id.  This corresponds to
 * one of the ACCESS_* constants defined in {@link elgglib.php} or the ID of an
 * access collection.
 *
 * @package Elgg.Core
 * @subpackage Access
 * @link http://docs.elgg.org/Access
 */

/**
 * Return an ElggCache static variable cache for the access caches
 *
 * @staticvar ElggStaticVariableCache $access_cache
 * @return \ElggStaticVariableCache
 * @access private
 */
function _elgg_get_access_cache() {
	/**
	 * A default filestore cache using the dataroot.
	 */
	static $access_cache;

	if (!$access_cache) {
		$access_cache = new ElggStaticVariableCache('access');
	}

	return $access_cache;
}

/**
 * Return a string of access_ids for $user_id appropriate for inserting into an SQL IN clause.
 *
 * @uses get_access_array
 *
 * @link http://docs.elgg.org/Access
 * @see get_access_array()
 *
 * @param int  $user_id User ID; defaults to currently logged in user
 * @param int  $site_id Site ID; defaults to current site
 * @param bool $flush   If set to true, will refresh the access list from the
 *                      database rather than using this function's cache.
 *
 * @return string A list of access collections suitable for using in an SQL call
 * @access private
 */
function get_access_list($user_id = 0, $site_id = 0, $flush = false) {
	global $CONFIG, $init_finished;
	$cache = _elgg_get_access_cache();

	if ($flush) {
		$cache->clear();
	}

	if ($user_id == 0) {
		$user_id = elgg_get_logged_in_user_guid();
	}

	if (($site_id == 0) && (isset($CONFIG->site_id))) {
		$site_id = $CONFIG->site_id;
	}
	$user_id = (int) $user_id;
	$site_id = (int) $site_id;

	$hash = $user_id . $site_id . 'get_access_list';

	if ($cache[$hash]) {
		return $cache[$hash];
	}

	$access_array = get_access_array($user_id, $site_id, $flush);
	$access = "(" . implode(",", $access_array) . ")";

	if ($init_finished) {
		$cache[$hash] = $access;
	}

	return $access;
}

/**
 * Returns an array of access IDs a user is permitted to see.
 *
 * Can be overridden with the 'access:collections:read', 'user' plugin hook.
 *
 * This returns a list of all the collection ids a user owns or belongs
 * to plus public and logged in access levels. If the user is an admin, it includes
 * the private access level.
 *
 * @internal this is only used in core for creating the SQL where clause when
 * retrieving content from the database. The friends access level is handled by
 * get_access_sql_suffix().
 *
 * @see get_write_access_array() for the access levels that a user can write to.
 *
 * @param int  $user_id User ID; defaults to currently logged in user
 * @param int  $site_id Site ID; defaults to current site
 * @param bool $flush   If set to true, will refresh the access ids from the
 *                      database rather than using this function's cache.
 *
 * @return array An array of access collections ids
 */
function get_access_array($user_id = 0, $site_id = 0, $flush = false) {
	global $CONFIG, $init_finished;

	$cache = _elgg_get_access_cache();

	if ($flush) {
		$cache->clear();
	}

	if ($user_id == 0) {
		$user_id = elgg_get_logged_in_user_guid();
	}

	if (($site_id == 0) && (isset($CONFIG->site_guid))) {
		$site_id = $CONFIG->site_guid;
	}

	$user_id = (int) $user_id;
	$site_id = (int) $site_id;

	$hash = $user_id . $site_id . 'get_access_array';

	if ($cache[$hash]) {
		$access_array = $cache[$hash];
	} else {
		$access_array = array(ACCESS_PUBLIC);

		// The following can only return sensible data if the user is logged in.
		if (elgg_is_logged_in()) {
			$access_array[] = ACCESS_LOGGED_IN;

			// Get ACL memberships
			$query = "SELECT am.access_collection_id"
				. " FROM {$CONFIG->dbprefix}access_collection_membership am"
				. " LEFT JOIN {$CONFIG->dbprefix}access_collections ag ON ag.id = am.access_collection_id"
				. " WHERE am.user_guid = $user_id AND (ag.site_guid = $site_id OR ag.site_guid = 0)";

			$collections = get_data($query);
			if ($collections) {
				foreach ($collections as $collection) {
					if (!empty($collection->access_collection_id)) {
						$access_array[] = (int)$collection->access_collection_id;
					}
				}
			}

			// Get ACLs owned.
			$query = "SELECT ag.id FROM {$CONFIG->dbprefix}access_collections ag ";
			$query .= "WHERE ag.owner_guid = $user_id AND (ag.site_guid = $site_id OR ag.site_guid = 0)";

			$collections = get_data($query);
			if ($collections) {
				foreach ($collections as $collection) {
					if (!empty($collection->id)) {
						$access_array[] = (int)$collection->id;
					}
				}
			}

			$ignore_access = elgg_check_access_overrides($user_id);

			if ($ignore_access == true) {
				$access_array[] = ACCESS_PRIVATE;
			}
		}

		if ($init_finished) {
			$cache[$hash] = $access_array;
		}
	}

	$options = array(
		'user_id' => $user_id,
		'site_id' => $site_id
	);

	return elgg_trigger_plugin_hook('access:collections:read', 'user', $options, $access_array);
}

/**
 * Gets the default access permission.
 *
 * This returns the default access level for the site or optionally for the user.
 *
 * @param ElggUser $user Get the user's default access. Defaults to logged in user.
 *
 * @return int default access id (see ACCESS defines in elgglib.php)
 * @link http://docs.elgg.org/Access
 */
function get_default_access(ElggUser $user = null) {
	global $CONFIG;

	if (!$CONFIG->allow_user_default_access) {
		return $CONFIG->default_access;
	}

	if (!($user) && (!$user = elgg_get_logged_in_user_entity())) {
		return $CONFIG->default_access;
	}

	if (false !== ($default_access = $user->getPrivateSetting('elgg_default_access'))) {
		return $default_access;
	} else {
		return $CONFIG->default_access;
	}
}

/**
 * Allow disabled entities and metadata to be returned by getter functions
 *
 * @todo Replace this with query object!
 * @global bool $ENTITY_SHOW_HIDDEN_OVERRIDE
 * @access private
 */
$ENTITY_SHOW_HIDDEN_OVERRIDE = false;

/**
 * Show or hide disabled entities.
 *
 * @param bool $show_hidden Show disabled entities.
 * @return void
 * @access private
 */
function access_show_hidden_entities($show_hidden) {
	global $ENTITY_SHOW_HIDDEN_OVERRIDE;
	$ENTITY_SHOW_HIDDEN_OVERRIDE = $show_hidden;
}

/**
 * Return current status of showing disabled entities.
 *
 * @return bool
 * @access private
 */
function access_get_show_hidden_status() {
	global $ENTITY_SHOW_HIDDEN_OVERRIDE;
	return $ENTITY_SHOW_HIDDEN_OVERRIDE;
}

/**
 * Returns the SQL where clause for a table with a access_id and enabled columns.
 *
 * This handles returning where clauses for ACCESS_FRIENDS and the currently
 * unused block and filter lists in addition to using get_access_list() for
 * access collections and the standard access levels.
 *
 * @param string $table_prefix Optional table. prefix for the access code.
 * @param int    $owner        The guid to check access for. Defaults to logged in user.
 *
 * @return string The SQL for a where clause
 * @access private
 */
function get_access_sql_suffix($table_prefix = '', $owner = null) {
	global $ENTITY_SHOW_HIDDEN_OVERRIDE, $CONFIG;

	$sql = "";
	$friends_bit = "";
	$enemies_bit = "";

	if ($table_prefix) {
		$table_prefix = sanitise_string($table_prefix) . ".";
	}

	if (!isset($owner)) {
		$owner = elgg_get_logged_in_user_guid();
	}

	if (!$owner) {
		$owner = -1;
	}

	$ignore_access = elgg_check_access_overrides($owner);
	$access = get_access_list($owner);

	if ($ignore_access) {
		$sql = " (1 = 1) ";
	} else if ($owner != -1) {
		// we have an entity's guid and auto check for friend relationships
		$friends_bit = "{$table_prefix}access_id = " . ACCESS_FRIENDS . "
			AND {$table_prefix}owner_guid IN (
				SELECT guid_one FROM {$CONFIG->dbprefix}entity_relationships
				WHERE relationship='friend' AND guid_two=$owner
			)";

		$friends_bit = '(' . $friends_bit . ') OR ';

		// @todo untested and unsupported at present
		if ((isset($CONFIG->user_block_and_filter_enabled)) && ($CONFIG->user_block_and_filter_enabled)) {
			// check to see if the user is in the entity owner's block list
			// or if the entity owner is in the user's filter list
			// if so, disallow access
			$enemies_bit = get_access_restriction_sql('elgg_block_list', "{$table_prefix}owner_guid", $owner, false);
			$enemies_bit = '('
				. $enemies_bit
				. '	AND ' . get_access_restriction_sql('elgg_filter_list', $owner, "{$table_prefix}owner_guid", false)
			. ')';
		}
	}

	if (empty($sql)) {
		$sql = " $friends_bit ({$table_prefix}access_id IN {$access}
			OR ({$table_prefix}owner_guid = {$owner})
			OR (
				{$table_prefix}access_id = " . ACCESS_PRIVATE . "
				AND {$table_prefix}owner_guid = $owner
			)
		)";
	}

	if ($enemies_bit) {
		$sql = "$enemies_bit AND ($sql)";
	}

	if (!$ENTITY_SHOW_HIDDEN_OVERRIDE) {
		$sql .= " and {$table_prefix}enabled='yes'";
	}

	return '(' . $sql . ')';
}

/**
 * Get the where clause for an access restriction based on annotations
 *
 * Returns an SQL fragment that is true (or optionally false) if the given user has
 * added an annotation with the given name to the given entity.
 *
 * @warning this is a private function for an untested capability and will likely
 * be removed from a future version of Elgg.
 *
 * @param string  $annotation_name Name of the annotation
 * @param string  $entity_guid     SQL GUID of entity the annotation is attached to.
 * @param string  $owner_guid      SQL string that evaluates to the GUID of the annotation owner
 * @param boolean $exists          If true, returns BOOL if the annotation exists
 *
 * @return string An SQL fragment suitable for inserting into a WHERE clause
 * @access private
 */
function get_access_restriction_sql($annotation_name, $entity_guid, $owner_guid, $exists) {
	global $CONFIG;

	if ($exists) {
		$not = '';
	} else {
		$not = 'NOT';
	}

	$sql = <<<END
$not EXISTS (SELECT * FROM {$CONFIG->dbprefix}annotations a
INNER JOIN {$CONFIG->dbprefix}metastrings ms ON (a.name_id = ms.id)
WHERE ms.string = '$annotation_name'
AND a.entity_guid = $entity_guid
AND a.owner_guid = $owner_guid)
END;
	return $sql;
}

/**
 * Can a user access an entity.
 *
 * @warning If a logged in user doesn't have access to an entity, the
 * core engine will not load that entity.
 *
 * @tip This is mostly useful for checking if a user other than the logged in
 * user has access to an entity that is currently loaded.
 *
 * @todo This function would be much more useful if we could pass the guid of the
 * entity to test access for. We need to be able to tell whether the entity exists
 * and whether the user has access to the entity.
 *
 * @param ElggEntity $entity The entity to check access for.
 * @param ElggUser   $user   Optionally user to check access for. Defaults to
 *                           logged in user (which is a useless default).
 *
 * @return bool
 * @link http://docs.elgg.org/Access
 */
function has_access_to_entity($entity, $user = null) {
	global $CONFIG;

	if (!isset($user)) {
		$access_bit = get_access_sql_suffix("e");
	} else {
		$access_bit = get_access_sql_suffix("e", $user->getGUID());
	}

	$query = "SELECT guid from {$CONFIG->dbprefix}entities e WHERE e.guid = " . $entity->getGUID();
	// Add access controls
	$query .= " AND " . $access_bit;
	if (get_data($query)) {
		return true;
	} else {
		return false;
	}
}

/**
 * Returns an array of access permissions that the user is allowed to save content with.
 * Permissions returned are of the form (id => 'name').
 *
 * Example return value in English:
 * array(
 *     0 => 'Private',
 *    -2 => 'Friends',
 *     1 => 'Logged in users',
 *     2 => 'Public',
 *    34 => 'My favorite friends',
 * );
 *
 * Plugin hook of 'access:collections:write', 'user'
 *
 * @warning this only returns access collections that the user owns plus the
 * standard access levels. It does not return access collections that the user
 * belongs to such as the access collection for a group.
 *
 * @param int  $user_id The user's GUID.
 * @param int  $site_id The current site.
 * @param bool $flush   If this is set to true, this will ignore a cached access array
 *
 * @return array List of access permissions
 * @link http://docs.elgg.org/Access
 */
function get_write_access_array($user_id = 0, $site_id = 0, $flush = false) {
	global $CONFIG, $init_finished;
	$cache = _elgg_get_access_cache();

	if ($flush) {
		$cache->clear();
	}

	if ($user_id == 0) {
		$user_id = elgg_get_logged_in_user_guid();
	}

	if (($site_id == 0) && (isset($CONFIG->site_id))) {
		$site_id = $CONFIG->site_id;
	}

	$user_id = (int) $user_id;
	$site_id = (int) $site_id;

	$hash = $user_id . $site_id . 'get_write_access_array';

	if ($cache[$hash]) {
		$access_array = $cache[$hash];
	} else {
		// @todo is there such a thing as public write access?
		$access_array = array(
			ACCESS_PRIVATE => elgg_echo("PRIVATE"),
			ACCESS_FRIENDS => elgg_echo("access:friends:label"),
			ACCESS_LOGGED_IN => elgg_echo("LOGGED_IN"),
			ACCESS_PUBLIC => elgg_echo("PUBLIC")
		);

		$query = "SELECT ag.* FROM {$CONFIG->dbprefix}access_collections ag ";
		$query .= " WHERE (ag.site_guid = $site_id OR ag.site_guid = 0)";
		$query .= " AND (ag.owner_guid = $user_id)";

		$collections = get_data($query);
		if ($collections) {
			foreach ($collections as $collection) {
				$access_array[$collection->id] = $collection->name;
			}
		}

		if ($init_finished) {
			$cache[$hash] = $access_array;
		}
	}

	$options = array(
		'user_id' => $user_id,
		'site_id' => $site_id
	);
	return elgg_trigger_plugin_hook('access:collections:write', 'user',
		$options, $access_array);
}

/**
 * Can the user change this access collection?
 *
 * Use the plugin hook of 'access:collections:write', 'user' to change this.
 * @see get_write_access_array() for details on the hook.
 *
 * Respects access control disabling for admin users and {@see elgg_set_ignore_access()}
 *
 * @see get_write_access_array()
 *
 * @param int   $collection_id The collection id
 * @param mixed $user_guid     The user GUID to check for. Defaults to logged in user.
 * @return bool
 */
function can_edit_access_collection($collection_id, $user_guid = null) {
	if ($user_guid) {
		$user = get_entity((int) $user_guid);
	} else {
		$user = elgg_get_logged_in_user_entity();
	}

	$collection = get_access_collection($collection_id);

	if (!($user instanceof ElggUser) || !$collection) {
		return false;
	}

	$write_access = get_write_access_array($user->getGUID(), 0, true);

	// don't ignore access when checking users.
	if ($user_guid) {
		return array_key_exists($collection_id, $write_access);
	} else {
		return elgg_get_ignore_access() || array_key_exists($collection_id, $write_access);
	}
}

/**
 * Creates a new access collection.
 *
 * Access colletions allow plugins and users to create granular access
 * for entities.
 *
 * Triggers plugin hook 'access:collections:addcollection', 'collection'
 *
 * @internal Access collections are stored in the access_collections table.
 * Memberships to collections are in access_collections_membership.
 *
 * @param string $name       The name of the collection.
 * @param int    $owner_guid The GUID of the owner (default: currently logged in user).
 * @param int    $site_guid  The GUID of the site (default: current site).
 *
 * @return int|false The collection ID if successful and false on failure.
 * @link http://docs.elgg.org/Access/Collections
 * @see update_access_collection()
 * @see delete_access_collection()
 */
function create_access_collection($name, $owner_guid = 0, $site_guid = 0) {
	global $CONFIG;

	$name = trim($name);
	if (empty($name)) {
		return false;
	}

	if ($owner_guid == 0) {
		$owner_guid = elgg_get_logged_in_user_guid();
	}
	if (($site_guid == 0) && (isset($CONFIG->site_guid))) {
		$site_guid = $CONFIG->site_guid;
	}
	$name = sanitise_string($name);

	$q = "INSERT INTO {$CONFIG->dbprefix}access_collections
		SET name = '{$name}',
			owner_guid = {$owner_guid},
			site_guid = {$site_guid}";
	$id = insert_data($q);
	if (!$id) {
		return false;
	}

	$params = array(
		'collection_id' => $id
	);

	if (!elgg_trigger_plugin_hook('access:collections:addcollection', 'collection', $params, true)) {
		return false;
	}

	return $id;
}

/**
 * Updates the membership in an access collection.
 *
 * @warning Expects a full list of all members that should
 * be part of the access collection
 *
 * @note This will run all hooks associated with adding or removing
 * members to access collections.
 *
 * @param int   $collection_id The ID of the collection.
 * @param array $members       Array of member GUIDs
 *
 * @return bool
 * @link http://docs.elgg.org/Access/Collections
 * @see add_user_to_access_collection()
 * @see remove_user_from_access_collection()
 */
function update_access_collection($collection_id, $members) {
	$acl = get_access_collection($collection_id);

	if (!$acl) {
		return false;
	}
	$members = (is_array($members)) ? $members : array();

	$cur_members = get_members_of_access_collection($collection_id, true);
	$cur_members = (is_array($cur_members)) ? $cur_members : array();

	$remove_members = array_diff($cur_members, $members);
	$add_members = array_diff($members, $cur_members);

	$result = true;

	foreach ($add_members as $guid) {
		$result = $result && add_user_to_access_collection($guid, $collection_id);
	}

	foreach ($remove_members as $guid) {
		$result = $result && remove_user_from_access_collection($guid, $collection_id);
	}

	return $result;
}

/**
 * Deletes a specified access collection and its membership.
 *
 * @param int $collection_id The collection ID
 *
 * @return bool
 * @link http://docs.elgg.org/Access/Collections
 * @see create_access_collection()
 * @see update_access_collection()
 */
function delete_access_collection($collection_id) {
	global $CONFIG;

	$collection_id = (int) $collection_id;
	$params = array('collection_id' => $collection_id);

	if (!elgg_trigger_plugin_hook('access:collections:deletecollection', 'collection', $params, true)) {
		return false;
	}

	// Deleting membership doesn't affect result of deleting ACL.
	$q = "DELETE FROM {$CONFIG->dbprefix}access_collection_membership
		WHERE access_collection_id = {$collection_id}";
	delete_data($q);

	$q = "DELETE FROM {$CONFIG->dbprefix}access_collections
		WHERE id = {$collection_id}";
	$result = delete_data($q);

	return (bool)$result;
}

/**
 * Get a specified access collection
 *
 * @note This doesn't return the members of an access collection,
 * just the database row of the actual collection.
 *
 * @see get_members_of_access_collection()
 *
 * @param int $collection_id The collection ID
 *
 * @return object|false
 */
function get_access_collection($collection_id) {
	global $CONFIG;
	$collection_id = (int) $collection_id;

	$query = "SELECT * FROM {$CONFIG->dbprefix}access_collections WHERE id = {$collection_id}";
	$get_collection = get_data_row($query);

	return $get_collection;
}

/**
 * Adds a user to an access collection.
 *
 * Triggers the 'access:collections:add_user', 'collection' plugin hook.
 *
 * @param int $user_guid     The GUID of the user to add
 * @param int $collection_id The ID of the collection to add them to
 *
 * @return bool
 * @see update_access_collection()
 * @see remove_user_from_access_collection()
 * @link http://docs.elgg.org/Access/Collections
 */
function add_user_to_access_collection($user_guid, $collection_id) {
	global $CONFIG;

	$collection_id = (int) $collection_id;
	$user_guid = (int) $user_guid;
	$user = get_user($user_guid);

	$collection = get_access_collection($collection_id);

	if (!($user instanceof Elgguser) || !$collection) {
		return false;
	}

	$params = array(
		'collection_id' => $collection_id,
		'user_guid' => $user_guid
	);

	$result = elgg_trigger_plugin_hook('access:collections:add_user', 'collection', $params, true);
	if ($result == false) {
		return false;
	}

	// if someone tries to insert the same data twice, we do a no-op on duplicate key
	$q = "INSERT INTO {$CONFIG->dbprefix}access_collection_membership
			SET access_collection_id = $collection_id, user_guid = $user_guid
			ON DUPLICATE KEY UPDATE user_guid = user_guid";
	$result = insert_data($q);

	return $result !== false;
}

/**
 * Removes a user from an access collection.
 *
 * Triggers the 'access:collections:remove_user', 'collection' plugin hook.
 *
 * @param int $user_guid     The user GUID
 * @param int $collection_id The access collection ID
 *
 * @return bool
 * @see update_access_collection()
 * @see remove_user_from_access_collection()
 * @link http://docs.elgg.org/Access/Collections
 */
function remove_user_from_access_collection($user_guid, $collection_id) {
	global $CONFIG;

	$collection_id = (int) $collection_id;
	$user_guid = (int) $user_guid;
	$user = get_user($user_guid);

	$collection = get_access_collection($collection_id);

	if (!($user instanceof Elgguser) || !$collection) {
		return false;
	}

	$params = array(
		'collection_id' => $collection_id,
		'user_guid' => $user_guid
	);

	if (!elgg_trigger_plugin_hook('access:collections:remove_user', 'collection', $params, true)) {
		return false;
	}

	$q = "DELETE FROM {$CONFIG->dbprefix}access_collection_membership
		WHERE access_collection_id = {$collection_id}
			AND user_guid = {$user_guid}";

	return (bool)delete_data($q);
}

/**
 * Returns an array of database row objects of the access collections owned by $owner_guid.
 *
 * @param int $owner_guid The entity guid
 * @param int $site_guid  The GUID of the site (default: current site).
 *
 * @return array|false
 * @see add_access_collection()
 * @see get_members_of_access_collection()
 * @link http://docs.elgg.org/Access/Collections
 */
function get_user_access_collections($owner_guid, $site_guid = 0) {
	global $CONFIG;
	$owner_guid = (int) $owner_guid;
	$site_guid = (int) $site_guid;

	if (($site_guid == 0) && (isset($CONFIG->site_guid))) {
		$site_guid = $CONFIG->site_guid;
	}

	$query = "SELECT * FROM {$CONFIG->dbprefix}access_collections
			WHERE owner_guid = {$owner_guid}
			AND site_guid = {$site_guid}";

	$collections = get_data($query);

	return $collections;
}

/**
 * Get all of members of an access collection
 *
 * @param int  $collection The collection's ID
 * @param bool $idonly     If set to true, will only return the members' GUIDs (default: false)
 *
 * @return array ElggUser guids or entities if successful, false if not
 * @see add_user_to_access_collection()
 * @see http://docs.elgg.org/Access/Collections
 */
function get_members_of_access_collection($collection, $idonly = FALSE) {
	global $CONFIG;
	$collection = (int)$collection;

	if (!$idonly) {
		$query = "SELECT e.* FROM {$CONFIG->dbprefix}access_collection_membership m"
			. " JOIN {$CONFIG->dbprefix}entities e ON e.guid = m.user_guid"
			. " WHERE m.access_collection_id = {$collection}";
		$collection_members = get_data($query, "entity_row_to_elggstar");
	} else {
		$query = "SELECT e.guid FROM {$CONFIG->dbprefix}access_collection_membership m"
			. " JOIN {$CONFIG->dbprefix}entities e ON e.guid = m.user_guid"
			. " WHERE m.access_collection_id = {$collection}";
		$collection_members = get_data($query);
		if (!$collection_members) {
			return FALSE;
		}
		foreach ($collection_members as $key => $val) {
			$collection_members[$key] = $val->guid;
		}
	}

	return $collection_members;
}

/**
 * Return entities based upon access id.
 *
 * @param array $options Any options accepted by {@link elgg_get_entities()} and
 * 	access_id => int The access ID of the entity.
 *
 * @see elgg_get_entities()
 * @return mixed If count, int. If not count, array. false on errors.
 * @since 1.7.0
 */
function elgg_get_entities_from_access_id(array $options = array()) {
	// restrict the resultset to access collection provided
	if (!isset($options['access_id'])) {
		return FALSE;
	}

	// @todo add support for an array of collection_ids
	$where = "e.access_id = '{$options['access_id']}'";
	if (isset($options['wheres'])) {
		if (is_array($options['wheres'])) {
			$options['wheres'][] = $where;
		} else {
			$options['wheres'] = array($options['wheres'], $where);
		}
	} else {
		$options['wheres'] = array($where);
	}

	// return entities with the desired options
	return elgg_get_entities($options);
}

/**
 * Lists entities from an access collection
 *
 * @param array $options See elgg_list_entities() and elgg_get_entities_from_access_id()
 *
 * @see elgg_list_entities()
 * @see elgg_get_entities_from_access_id()
 *
 * @return string
 */
function elgg_list_entities_from_access_id(array $options = array()) {
	return elgg_list_entities($options, 'elgg_get_entities_from_access_id');
}

/**
 * Return the name of an ACCESS_* constant or a access collection,
 * but only if the user has write access on that ACL.
 *
 * @warning This function probably doesn't work how it's meant to.
 *
 * @param int $entity_access_id The entity's access id
 *
 * @return string 'Public', 'Private', etc.
 * @since 1.7.0
 * @todo I think this probably wants get_access_array() instead of get_write_access_array(),
 * but those two functions return different types of arrays.
 */
function get_readable_access_level($entity_access_id) {
	$access = (int) $entity_access_id;

	//get the access level for object in readable string
	$options = get_write_access_array();

	if (array_key_exists($access, $options)) {
		return $options[$access];
	}

	// return 'Limited' if the user does not have access to the access collection
	return elgg_echo('access:limited:label');
}

/**
 * Set if entity access system should be ignored.
 *
 * The access system will not return entities in any getter
 * functions if the user doesn't have access.
 *
 * @internal For performance reasons this is done at the database access clause level.
 *
 * @tip Use this to access entities in automated scripts
 * when no user is logged in.
 *
 * @note This clears the access cache.
 *
 * @warning This will not show disabled entities.
 * Use {@link access_show_hidden_entities()} to access disabled entities.
 *
 * @param bool $ignore If true, disables all access checks.
 *
 * @return bool Previous ignore_access setting.
 * @since 1.7.0
 * @see http://docs.elgg.org/Access/IgnoreAccess
 * @see elgg_get_ignore_access()
 */
function elgg_set_ignore_access($ignore = true) {
	$cache = _elgg_get_access_cache();
	$cache->clear();
	$elgg_access = elgg_get_access_object();
	return $elgg_access->setIgnoreAccess($ignore);
}

/**
 * Get current ignore access setting.
 *
 * @return bool
 * @since 1.7.0
 * @see http://docs.elgg.org/Access/IgnoreAccess
 * @see elgg_set_ignore_access()
 */
function elgg_get_ignore_access() {
	return elgg_get_access_object()->getIgnoreAccess();
}

/**
 * Decides if the access system should be ignored for a user.
 *
 * Returns true (meaning ignore access) if either of these 2 conditions are true:
 *   1) an admin user guid is passed to this function.
 *   2) {@link elgg_get_ignore_access()} returns true.
 *
 * @see elgg_set_ignore_access()
 *
 * @param int $user_guid The user to check against.
 *
 * @return bool
 * @since 1.7.0
 */
function elgg_check_access_overrides($user_guid = 0) {
	if (!$user_guid || $user_guid <= 0) {
		$is_admin = false;
	} else {
		$is_admin = elgg_is_admin_user($user_guid);
	}

	return ($is_admin || elgg_get_ignore_access());
}

/**
 * Returns the ElggAccess object.
 *
 * // @todo comment is incomplete
 * This is used to
 *
 * @return ElggAccess
 * @since 1.7.0
 * @access private
 */
function elgg_get_access_object() {
	static $elgg_access;

	if (!$elgg_access) {
		$elgg_access = new ElggAccess();
	}

	return $elgg_access;
}

/**
 * A flag to set if Elgg's access initialization is finished.
 *
 * @global bool $init_finished
 * @access private
 * @todo This is required to tell the access system to start caching because
 * calls are made while in ignore access mode and before the user is logged in.
 */
$init_finished = false;

/**
 * A quick and dirty way to make sure the access permissions have been correctly set up
 *
 * @elgg_event_handler init system
 * @todo Invesigate
 *
 * @return void
 */
function access_init() {
	global $init_finished;
	$init_finished = true;
}

/**
 * Overrides the access system if appropriate.
 *
 * Allows admin users and calls after {@link elgg_set_ignore_access} to
 * bypass the access system.
 *
 * Registered for the 'permissions_check', 'all' and the
 * 'container_permissions_check', 'all' plugin hooks.
 *
 * Returns true to override the access system or null if no change is needed.
 *
 * @param string $hook
 * @param string $type
 * @param bool $value
 * @param array $params
 * @return true|null
 * @access private
 */
function elgg_override_permissions($hook, $type, $value, $params) {
	$user = elgg_extract('user', $params);
	if ($user) {
		$user_guid = $user->getGUID();
	} else {
		$user_guid = elgg_get_logged_in_user_guid();
	}

	// don't do this so ignore access still works with no one logged in
	//if (!$user instanceof ElggUser) {
	//	return false;
	//}

	// check for admin
	if ($user_guid && elgg_is_admin_user($user_guid)) {
		return true;
	}

	// check access overrides
	if ((elgg_check_access_overrides($user_guid))) {
		return true;
	}

	// consult other hooks
	return NULL;
}

/**
 * Runs unit tests for the entities object.
 *
 * @param string $hook
 * @param string $type
 * @param array $value
 * @param array $params
 * @return array
 *
 * @access private
 */
function access_test($hook, $type, $value, $params) {
	global $CONFIG;

	$value[] = $CONFIG->path . 'engine/tests/api/access_collections.php';
	return $value;
}

// Tell the access functions the system has booted, plugins are loaded,
// and the user is logged in so it can start caching
elgg_register_event_handler('ready', 'system', 'access_init');

// For overrided permissions
elgg_register_plugin_hook_handler('permissions_check', 'all', 'elgg_override_permissions');
elgg_register_plugin_hook_handler('container_permissions_check', 'all', 'elgg_override_permissions');

elgg_register_plugin_hook_handler('unit_test', 'system', 'access_test');

redpajama_set_name: RedPajamaGithub


« Windows / Linux: Mutually accessing various filesystems on the same PC.
Most linux distros come shipped with basic firewall software. Other then ipchains or ipfwadm probably the most common command line firewall just might be iptables. If you run a small home network and need a bit more security on your box then what comes already available or a router already ships with, iptables is something you'll want to run. What you put in the firewall will depend on what services you need running on your Linux box and which outside networks or devices will be able to access them. A general rule I follow is to block everything except what my applications need. For example, I'll block everything with a single line then slowly unblock absolutely necessary traffic such as MSN, Email ports, internal server service communication etc. This guarantees me taht I won't absolutely overlook a security hole. If I take the opposite approach, by blocking only what 'know' at the time is dangerous, then the only way to know if you have trouble is if it occurs to you. So the latter is probably not the best approach.
# Internal server / workstation traffic (from itselt).
# IRC, Filesharing and other PTP protocol ports.
# Could also use "-A INPUT -p icmp –icmp-type echo-reply -j ACCEPT" above.
then run the previous chkconfig command to check and ensure iptables is now enabled.
for example where 12345 would be the actual port that application will need.
to view network activity on your server showing connections to and from your box at any one time. A good third party network monitoring tool you can use is iftop found on http://www.ex-parrot.com/~pdw/iftop/. This tool did not come pre packaged with my distribution and may not come with yours. You'll have to install it via RPM or compile it from sources by downloading a 'tar.gz' file off rpmfind.net, one of the online repositories of linux third party binaries now available, or other sites available online.
-i The interface. The network card name to apply the rule to. Use ifconfig to determine this.
-A Append to take on the following conditions.
-j Action to take on this rule. Some common are LOG, REJECT and ACCEPT.
to see your rules in effect.
This entry was posted on Thursday, July 5th, 2007 at 1:47 am	and is filed under NIX Posts. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


How desperate we are to avoid labeling our kids! And with good reason … if they're in a classroom setting, maybe. But as homeschoolers, we have a much better handle on the social side, and there are serious benefits to your struggling child when you get her tested earlier rather than later. This episode, we talk about our own struggling learner and what we discovered on the way from a late start … to a college scholarship! There's hope!


text:
[![Build Status](https://travis-ci.org/goboss/fpinscala.svg?branch=master)](https://travis-ci.org/goboss/fpinscala)

This repository contains my solutions to exercises found in the book
[Functional Programming in Scala](http://manning.com/bjarnason/) by Paul Chiusano and Rúnar Bjarnason.


The PlayStation 4 lovers would be really happy to play the best action adventure game of this year. One of the best survival game that has ever been produced and on top the list stands this, Detroit Become Human video game. With a 98% liked google user review and a huge fan following of it makes it one of the best to have ever come. The cool feature of it is, it is very realistic and the gameplay is excellent. It feels like you are in it, living the moment. The fascinating characters in this game are amazing and the costumes collection from the video game is very vast and up to the mark.
Highlighting some of the amazing characters throughout the video game, Markus is one of the mains of this video game series who have played a crucial role in it. A fans favorite kind of costume by him, Detroit Become Human Markus Cosplay Leather Coat has certainly gained some attraction and demands from the fans, as it is very beautifully crafted with faux material and consists of grey and black color. Very casual and amazing style coat to have!
A truly amazing coat for the casual wear! The stuff is very nice and the design is very elegant! Best gaming costume to have.


Hi! I'm Jessica and I share thoughtful stories in defense of the earth here on this blog. My journey is in service to something bigger—honoring the wildness and cultural diversity of our beautiful home planet. The stories I share here give voice to the voiceless, inspire, and share universal truths about our collective experience in the world.
So how did this all begin? In 2012, I left my 9-5 job and got the idea to vagabond to over 40 countries. It was epic. Sometimes it was hard. I saw and learned a lot and fell in love with our wild earth. After 15 months on the road, I returned to California where I'm continuing to process my journey and have begun a new life chapter.
This blog is the story of my journey along with discoveries and inspirations found along the way. I hope you'll join me.
When I'm not off in the wild, I write, photograph and curate awesome stuff. Even though I'm now based in California, I still travel often. Today I direct social media strategy with the fastest growing PR agency in the U.S., Praytell, helping clients such as @TwitterVideo tell important stories and engage with our ever growing community. As a social media strategy director, I use images and words to tell a story, to solve a problem and to communicate something meaningful drawing from my expertise in communication in order to help build online communities.
I'm also passionate about solving problems and inspiring change around environmental and human rights issues. Some of my favorite projects have been collaboratively launching innovative nonprofits such as Counterspill.org and The Tiziano Project, which both promote truth through storytelling using design along with new media. I once spoke at TEDx in China. I've also worked as an art director and producer on documentary films. I've lived and worked in San Francisco, Los Angeles, Paris, Italy, and Michigan (my home state) and traveled to over 40 countries on six continents (Antarctica, you continue to elude me).
"If you love a place, you have a duty to protect it. And to love a place, you must know it first." This I believe. If travel has taught me anything, it's that I sure do love this vast world. If you're working on a project that uses creative communications and social media to protect our crazy home and grow a community and would like to collaborate, please connect.
If you're press, a brand, or an organization that would like to work together, please note that my missjessrose.com Media Kit is available upon request.
— Pico Iyer, from "Why We Travel"


text:
Q: I am new to RegEx and I need to create a few RegEx scripts for a Drivers License field I need to create RegEx for two different states and I am having some trouble. Here are the requirements; one is for Washington DC and and the other for Delaware:

1) DISTRICT OF COLUMBIA (DC)
  - Format: 9 Numeric (SSN) or 7 Numeric
2) DELAWARE (DE)
  - Format: 1-7 Numeric

The RegEx I have for DC is ^(\d{7}|(\d{9})$ which doesnt seem to work.
I think I have the one for Delaware  ^(\d{1,7})$

A: Another posiibility which should work aswell is:
^\d{7}(\d{2})?$

A: If you're still having problems try this.  I moved the parenthesis around to enclose both conditions at once.
^(\d{7}|\d{9})$

A: For the DC expression, you have some syntax errors. Try:
^(\d{7})|(\d{9})

A: In your DC regex, you've got a parenthesis after the 7, where there should be a closing curly bracket.

redpajama_set_name: RedPajamaStackExchange


Awakening Hearts is the result of years of ministry in New England. Each week is filled with spiritual insights and personal stories from New England pastors and ministry leaders.
The people who serve churches and minister there face difficulties rarely found in other parts of our country. These experiences deepen their spiritual lives with a richness that will challenge you and broaden your walk with the Lord.
In addition, each week features a brief incident from the Great Awakenings that occurred in the 1700s. You will be blessed as you learn about the revivals that took place in New England in years past and the ministry happening there today.
The Gift that Gives Back - With every book you purchase, we help a New England ministry leader in need. More pastors leave the ministry after serving in New England than anywhere else in the country. Awakening Hearts purchases help provide vital encouragement retreats and ministry support to help these messengers of the gospel persevere and thrive in ministry.
* Order individually or in bulk. One case equals 24 books.


text:
Filter: Demolished
United Engineering, Vintage, Demolished, Deindustrialization, Industry, Republic Steel, Submitted, Warren
Warren, O. - These photos were taken in the 56" hot strip mill in the former Republic Steel Warren works when it was operating as Warren Consolidated Industries (WCI). These photos are one of a kind, ones I've never seen and can never be duplicated considering this mill is a brownfield now. These hit close to home, my Pops hauled plenty of coils out of this mill and I was looking to get my CDL so I could go run a crane out there right before they shut down.
They were taken and submitted by Ken Treharn who worked in the mills for 43 and a half years, starting out in the Youngstown Sheet & Tube Brier Hill works open hearth melt shop in 68. He worked was a craneman in the 56" mill in Warren for 23 years as you will read in the captions. My man was very thorough and provided a ton of background information on the photos. Enough out of me, read his words in the captions and see his world for 23 years of his life through his eyes below.
" 'Work' rolls with the mill in the background."
"Coil on the 'upender'. A fixture that turns the coil 90 degrees while transferring it to go of the 'runout' line"
"Coil being just 'stripped' from #3 'super coiler' "
"The #3 'super coiler' was the newest state of the art coiler, capable of coiling 50+" steel up to one inch thick."
"An extra coiler mandrel for #1+#2 coiler, they were a lighter duty but very good coilers." [This photo's file name indicates this coiler was mfg. by United Engineering. - Editor]
"Ground level looking into #3 Super coiler." [Photo file name: Red Weld Station to weld tail ends of heavier gauge coils 0250 to 1 inch thick - Ed.]
"Crane view midway of the Hot Strip Mill looking south towards the furnace area at the end of the mill. The yellow apparatus was used to change finish mill work rolls. Past the tow motor is the large backup finish mill rolls. Farther down you can see the Hot strip coming out of the 4 high Roughing mill. Past that is a Two High 'Scale' breaker. It reduces the 9 inch thick hot strip to 7 inches in one pass while extreme water pressure blasts the scale off of the strip. At the end of the building is the one Walking Beam Furnace that replaced the 3 pusher type furnaces."
"Looking down at the 6 stand finish mill from the crane I operated." [Photo file name: Reducing Gage Finish Mills - Ed.]
"Looking into a 'empty' (no work rolls, floor plates off) finish mill stand." [Photo file name: Showing Guide Box water sprays in Hot Strip Mill Finish Stand -Ed.]
"Hot strip coming from the 4 high roughing mill down to first the 'crop shear' (it is a flying shear that 'crops' cuts the front and back couple feet off the strip) the actual cut is like this ) then it feeds into #1 finish mill stand."
"Looking down from the overhead Crane that I operated for 23 years of the coiler area."
"An iron mould for slab from the old pre-melt shop caster days. This mould was made at Valley Mould in Hubbard. I worked there starting during the new electric furnace melt shop for 4 years till they shut down. They reopened as Elwood City Forge. We used this iron mould to "break up" steel that "piled up" instead of going into the coiler due to a problem."
"A 'pinch roll' which pushes/directs the front end of the strip into the throat of the coiler."
"Floor view looking North to the Coiler area. You can see the overhead Crane that I operated for 23 years."
"A 'Crop Shear Bucket' that went into a pit at the 'Crop Shear' before #1 finish stand. The hot cropped ends fell down a large steel chute going into the bucket that was submerged below water."
"Hot strip coming out of #6 finish mill heading to the Coiler. Notice the pollution that I breathed for 23 years."
"Walking Beam Furnace. Door is opening getting ready to extract a hot slab. Crane with magnet is picking up pieces of a cobble on the cobble burn rack."
"Hot strip going through the finish mills."
"Floor view of finish mills during down/repair turn.
"Looking into #3 Super Coiler looking through the 'Upender' into the mandrel and assemblies of the coiler. Apparatus on the bottom with 2 rolls is the 'Stripper Car' that removes the coil from inside the coiler to the Upender."
"Looking down into the Crop Shear Shoot"
Fresh coils
"Hot strip coming out of the finish mill, down the 'Run Out tables' into the coilers."
Deindustrialization, Industry, Youngstown Sheet and Tube, Demolished, Submitted, Brier Hill Works
Youngstown Sheet & Tube Co.
Youngstown, O. - An image from a not often seen angle of the Jeanette blast furnace at YS&T's Brier Hill works. This is the same Jenny that Springsteen sang about in his song Youngstown, but I'm told guys down the mill didn't call her that.
This was taken in 1975 by Joseph R. "Bud" Puskarich who was nice enough to share it this site. My godfather/late Uncle Bob Grilli was working for Sheet & Tube at this time at the Campbell works. They would shut down the bar mill for a couple weeks in the summer and he was sent up here on a labor gang; they had him relining the open hearths. He said it was so hot in there they had to wear wooden platforms strapped to the bottom of their boots to keep them from melting. Imagine that job in July.
Youngstown Sheet and Tube, Vallourec, Original Content, J&L Steel, GIrard, Industry, Ghost Signs, Demolished, Deindustrialization, Brier Hill Works
GIrard, O. - A track walk and some photos of a now demolished steel mill in 2005 would lead to my extremely short lived employment in the steel industry and an interesting connection to my father.
We parked near the former Pennsylvania RR coaling tower in Girard and started hiking down the tracks. It is now falling over, but the coal tower still stands - you can see it from Route 80. Passing under 80 and heading further south we came upon the former Youngstown Sheet & Tube Co. Brier Hill works.
The building to the left was in use, occupied by Syro Steel, but there wasn't much going on in the building to the right so we went in to take a look and some photos. Good thing we did because this giant structure is now gone. It was built during WWI and housed an 84 inch and 132 inch plate mill, and later an experimental hot strip mill per Rick Rowlands. The first time I saw the Tod Engine, which he eventually restored and built a museum around, was down here but I seem to have lost those photos. It was stored here prior to moving it to Hubbard Rd.
The photos in the next set got me hired into this same mill. I had the image below as a screen saver on my work computer - it was the most "artistic" looking photo I had ever taken, even though I didn't know what I was doing.
A customer of mine saw that and I wound up showing him the whole series. He says you're a steel man? I say no but my whole family was, why? It turned out he was the owner of the company that had the contract to staff V&M Star Steel and he needed a foreman. For whatever reason he offers me the job. I ran a die line in a plastic extrusion factory for a while, but had no steel experience and was currently selling cell phones for a living. But he needed a foreman and I figured it was my birthright so we started negotiating. He agreed to pay me $18 an hour so I was ready to quit my current job. It was a pay cut but I figured I'd work my way back up.
My employment lasted a shift. I got to ride around and take a tour of the mill with the superintendent and then he took me to my job. They were going to have me cutting tube rounds as my training, which was cool with me (tube rounds meaning solid steel logs that had not been pierced to make seamless pipe).
I just sat in an elevated office, and when the rounds came down the table I would stop them and press a button that made the plasma cutter come down and cut it to length. This took me back to my childhood. I lived 5 minutes from this mill and in the summer with the windows open I would lay in bed and hear steel clanging around all night. When the rounds were cut they dropped from the table to the floor; I think this is the sound I grew up hearing.
The superintendent came back at the end of the day to have me sign the paperwork. He hands it to me and it says $11.00 an hour. I say what's this? I'm making forty some thousand a year to stand in the air conditioning and talk to pretty girls at the cell phone shop, what happened to the $18 an hour? He stuck to the $11 an hour offer, something about policy or some bullshit, I told him to stick it.
Alright, one more personal story then I'll show yins the rest of the photos. I was showing these images to my pops and he sees this overhead crane that was laying out in the yard. He says wait is that Brier Hill, I say yeah why? Turns out he hauled this crane here from what was J&L Steel Aliquippa works when they were demolishing that mill.
Ok I lied, one more personal connection. My cousin was an Ironworker on the V&M expansion project. Part of the plans for the expansion, which is right next to where this building was, was to strip the building to the beams and then re-sheet and reuse it. Once they spent the man hours stripping it down, they realized the structure was out of plumb and could not be used. Photo of the skeleton below. They eventually tore the whole thing down and the foundation is now an exterior pipe yard.
Click to enlarge the photos in the gallery below.
All images copyright Paul Grilli / The Rust Jungle 2018
Campbell, Industry, Demolished, Youngstown Sheet and Tube
Campbell, O. - This class photo, dated 1925, shows students from Penhale school. If you look closely you can make out the Sheet & Tube Campbell works through the smoke in the background.
Photo courtesy of Ohio Memory Collection
Submitted, Demolished, Deindustrialization, Industry, Republic Steel, Warren, Weirton Steel
Forty years and a few days after Black Monday, the day that Youngstown Sheet & Tube suddenly announced the closure of their Campbell works and started the trend of integrated steel mill closures, blast furnaces in the Steel Valley and Ohio Valley continued to fall. The photos below were submitted to this site by people near these mills.
Weirton, WVa. - A very powerful drone shot courtesy of Roger VanGosen showing the No. 4 furnace at Weirton Steel laying in the yard. It looks somebody shot her. This furnace was featured prominently in the multiple Oscar award winning film The Deer Hunter. In it, Robert DeNiro's character looks over his hometown from up on a hill after he returned from Vietnam. A banner that reads "WELCOME HOME MICHAEL" hangs in the foreground, with ol No. 4 in the background.
Image copyright Roger VanGosen
Warren, O. - Demolition is well underway at the Trumbull Cliffs blast furnace at the former Republic Steel Warren works. I can't really say where I got these photos, but am very grateful to the person that took them.This is the last blast furnace standing in the Steel Valley, and at one time was the largest in the world. They already knocked down the ore bridge, cut out the cast house floor, and are busy talking the rest of the cast house down. All of the hand painted signs I attempted to buy out of that cast house are going to the scrap heap. This pisses me off for many reasons.
Ore bridge location.
Cast house
Black Monday, Youngstown Sheet and Tube, Deindustrialization, Demolished, Campbell
Youngstown Sheet & Tube Corp.
Campbell, O. - Today is the eve of the 40th anniversary of Black Monday, the day that Youngstown Sheet & Tube announced they would put 5,000 men (including 5 of my relatives, whether laid off immediatley or allowed to retire) out of work by closing the massive Campbell works.
Frank Castro, who has contributed many memories to this site, sat down with the Youngstown Vindicator to share his story of that infamous day. He has an interesting perspective on the closure, including how he was still installing new machinery right up until the end and lost a finger in the mill just before he lost his livelihood. The video of his interview is below.
Sharon Steel Corp, Industry, Demolished, Deindustrialization
Farrell, PA. - I was contacted by Jason W. in response to the video posted showing the Norman Rockwell series he painted of steelworkers at Sharon Steel. His great grandfather Bob Addicott was one of the men featured in the paintings, working in vacuum degassing.
Here is a YouTube video that discusses the paintings, and features an interview with two of the men Rockwell painted, one being Mr. Addicott.
Jason also included the photo below of his grandfather working in the same mill. Pictured is his grandfather at the top of the steps, watching the pouring a heat at the electric furnace.
The mill still runs, but the electric furnace is long gone. Below is a video of the failed attempts at demolishing this building. Per the video author: "This was the Sharon Steel Corp. electric furnace. Not enough explosives to bring this down. There was a second attempt about a week later, which also didn't have enough explosives. They then tried to pull this down manually with a cable and a bulldozer, which also didn't work. The building actually blew down with some high winds a few days later.".
Ghost Signs, Warren, Republic Steel, Demolished, Deindustrialization, Industry
Warren, O. - In the days before vinyl graphics and digital printers, sign makers used a brush, One Shot sign paint, and a steady hand. Republic Steel had a sign shop in their Warren works that hand lettered safety signs, trucks and locomotives among other things. Their work could be seen at the Warren plant, as well as the Youngstown mills, Niles works and Newton Falls plant. The photo below was taken by Rick Rowlands of Youngstown Steel Heritage Foundation during an auction of former Republic/WCI/RG Steel equipment as the new owner was preparing to scrap the mill. I wish that sign shop sign could have been preserved damn it, it is a testament to the dying art form of hand lettered signs. And basic steelmaking.
By night I am a guerrilla historian, but day I am a mild mannered project manager for a commercial sign company. I enjoy the work, it pays the bills and lets me travel, but the projects that really excite me are the ones that involve a real live sign painter. It is truly an art form that is dying before my eyes. These people (wall dogs and letterheads they call themselves) are incredibly difficult to find. I am up to the challenge of finding a painter when a customer requests it, I feel like I am doing something to preserve the craft. Some of the work can be emulated with a vinyl plotter and a decent graphic designer but it is just not the same.
Case in point: the hard hats below. I had been looking for the man that lettered the 35 or 40 years of service anniversary hard hats that were given to Republic Steel employees in the Youngstown district.
Thanks to this website, and the power of the internet, I was able to locate the man who is not only still alive, but still practicing his craft!! I was excited just to talk to him for a moment, but when he agreed to letter a hard hat for me like the ones he used to do down the mill I was ecstatic. This is now one of my prize possessions, one that I will keep for the rest of my life. Hand lettered and signed by the man himself, Jack Tolson. Below are photos of my new hat next to the one he wore in the mill for years.
Since my time working in the steel industry consisted of a half a shift cutting tube rounds down the former Youngstown Sheet & Tube Brier Hill works, I didn't think it would be right to ask him to put 30 years of service on the hat. Instead, he included The Rust Jungle logo, which is a tribute to the YST hook and bucket logo. He was also kind enough to put on some origioanl Republic Steel, WCI Steel, and RG Steel stickers on it that he still had from his time down there. Jack worked there that long, starting in the 50's in the galvanized department. He's a great guy with great stories to tell. I must have been at his house for an hour and a half shooting the shit with him.
"Sign Painter - Paint Shop"
When I heard they were tearing down the blast furnace, I frantically starting calling the demo company in an effort to purchase the remaining signage in the mill. I had seen the hand painted signs on the exterior, assumed the same guy that lettered the hats painted them, and was on a mission to see them preserved.
As I was offering cash, the contractor allowed me access to the entire blast fce. side of the mill. My requests since that day requesting a quote to purchase the signs have gone unanswered. I am only looking to buy a small amount of scrap metal, not tons, so the sons of bitches don't have time to reply. To hell with em.
I planned on donating most of the signs to the Youngstown Steel Heritage Foundation to be displayed, but to no avail. I did photograph them, and they can't sell that to the Chinese as scrap. See below for some examples of Jack's handiwork.
"DANGER - DO NOT STAND IN FRONT OF CANNON" This safety sign was referencing an air cannon that would keep migratory birds out of some holding pond. It also did a great job of keeping residents of Warren awake. It was some EPA regulation. The pond is gone, the cannon is gone, the BOF side of the mill is gone, but this sign Jack painted remians.
Copyright Paul Grilli - The Rust Jungle 2017
"TRUCKS OVER 5 TON - STOP - STAY ON R.R. TRACK" - This sign was just before the hot metal bridge that ran over Main Ave. that would take molten iron from the blast fce. side over to basic oxygen furnace to be converted to steel. The bridge is to the right, the cold blast furnace peeks up to the left.
"MAHONING VALLEY DISTRICT - FIRE BRIGADE COMPETITION" - I found this years ago inside a boxcar across Pine Ave. from Republic. Apparently it referred to a competition between the fire departments in different Republic mills in the Steel Valley.
Another example of Jack's work.
Copyright Rick Rowlands
So that's it. Even if the demolition company wouldn't sell me the signs and is content to let them go to the scrap heap, I still have a piece of our history.
Vintage, Youngstown, Youngstown Sheet and Tube, Industry, Demolished
No location given - A Bessemer Converter blow lighting up the mill at Youngstown Sheet & Tube. Not to be confused with Bessemer Street on the Westside, or Bessemer, PA., this was the method for turning iron to steel prior to the open hearth process. They would blow oxygen through the hot iron and the impurities would puke out of the top and rain down like hell fire and brimstone. That's what you're seeing here.
If you want to see one of these beasts in person they have preserved one at Station Square in Pittsburgh. That converter was built by the Pennsylvania Engineering Corp. on the south side of New Castle which was demolished recently. The converter is cold now, but it originally worked at Ambridge, PA.
Ambridge is an odd name right? It was a company town, full of employees of the US Steel subsidiary American Bridge Co. Get it, Am Bridge?
Vintage, Youngstown, Warren, Youngstown Sheet and Tube, Republic Steel, Little Steel Strike, Industry, Demolished
Stop 5 Riot
Youngstown, O. - Today, 6/19/2017, marks the 80 year anniversary of the Stop 5 Riot at the gates of Republic Steel on Poland Avenue. This event is one that should never be forgotten.
Below is an eyewitness account of the bloodshed that took place that day, which was called ladies day where the picket lines were manned by wives of the striking workers. There are other accounts out there, from the police and the chairman of the board of Repbulic at that time, but we should start here.
Courtesy of Ohio Memory Connection.
The most important passage from this account, in my opinion, is this: "Soon thereafter, the sky was lit up with flares fired from the plant and was followed with a fusillade of machine gun fire from the overhead cranes in the old tube mill". Jesus Criminelli.
The Vindicator reported that over 160,000 rounds of ammunition were purchased for the strike between Youngstown Sheet & Tube and Republic Steel. Let that sink in.
The photos of National Guard machine gunners below were taken in Warren not long after the Stop 5 incident.
Machine gunners on hot metal bridge in Warren. Trumbull Cliffs furnace in background. Courtesy of Ohio Memory Connection.
Machine gunners on Pine Avenue in Warren. Courtesy of Ohio Memory Connection.
The strikers were not innocent in all of this, at least some of them were waging warfare against the company. I'm not saying this should have given the company a license to kill, but they used it as justification. Photos of sabotage below.
Derailed box cars on Pine Avenue in Warren. Courtesy of Ohio Memory Connection.
Pennsylvania Rail Road cars with hoppers opened up. Looks like they were hauling in limestone for the Blast Fce. Courtesy of Ohio Memory Connection.
There was so much tension at the Republic mills becuase they refused to close them, and still had employees working inside that didn't support the union. See below for telegraphs that were sent to holdouts in the Warren works.
Segregated religious services were held for the holdouts in the mills, who were forced to live in the plants for fear of reprisal as they left the gates.
Employee housing near the stainless mill. Courtesy of Ohio Memory Connection.
Images below show how strong the tensions were between both sides. The holdouts in the mill hung an effigy of a CIO striker at the No. 1 hot strip mill, the strikers prepared a gate ramming car to breach the line.
All of this fighting and bloodshed was all for naught. The union still was unable to organize, and after the murders at Stop 5 the National Guard was deployed and put the strike down for good. The union may have gained some ground, but 80 years later these mills are either demolished, in the process of being demo'd, or sitting there rusting. The photo below was taken days after the killings in Youngstown. They repealed the beer ban that was in place during the strike, and it was back to business as usual.
Industry, Demolished, Warren, Republic Steel, Vintage, Youngstown Sheet and Tube, Youngstown, Little Steel Strike
Republic Steel Corp. - Little Steel Strike
Warren, O. - As the Little Steel Strike heated up, many Republic Steel Corp. mills closed due to the pickets, but others remained operating with a skeleton crew of employees loyal to the company. The Warren works was one of these mills. The pickets were preventing food and supplies from being brought into the mills for the (scabs) men that stayed on, so the company improvised.
Republic management initially used one biplane to drop supplies into the Niles mill. After a few failed attempts where the packages fell outside of the gates and were taken by pickets, they were eventually successful. Republic's president bought four more planes that day, and the fleet evenutally numbered 9 planes. A makeshift airfield was set up at the Warren works.
It didn't take long for the strikers to realize the flights were effective. The planes launched from a secret airfield, and were reported to have altered their identification numbers. The strikers took matters into their own hands, and started hunting for the airfield and allegedly attempting to shoot down the planes as they flew into the mill. This was war, right in the middle of the Steel Valley. See the Vindicator headlines from 80 years ago today below.
6/2/1937 - This plane was rumored to have been shot down.
Even with the supposed anti-aircraft fire, the airdrops kept the mills running. The illustration on the envelope sent to the Trumbull Cliff Furnace (Republic Warren works) seems to indicate the S.W.O.C/C.I.O. was losing the battle, judging by the plane and the smoke still coming from the stacks.
Press photos below, coutesy of the Ohio Memory Collection, that show the airfield at Warren and the urgency they unloaded the planes with. They say the men on the ground were under fire as well.
The strike continued to rage on, and would evenutally escalate to more bloodshed and the loss of life on the steelworker's side at a Republic mill in Youngstown. More to come on that, don't change that dial.
Demolished, Youngstown, United Engineering, Original Content, Deindustrialization, Industry, Wean Engineering
William Tod Co.
Youngstown, O. - The works of the William Tod Co., which became United Engineering & Foundry Co., and most recently Wean United. They manufactured steel mill equipment (see attached), including some of the worlds most powerful rolling mill engines, which at one time could be found throughout the world. Two examples that I know of still exist. One is rusting away on the grounds of Weirton Steel, and has been since they tore the blooming mill building down around it. I actually had the opportunity to photograph it before it was left outside to rust, I'll post those photos eventually. IN THE MEANTIME, if you want to see the only preserved and restored example of the engines that came out of this plant, check out todengine.org or go see it at the museum on Hubbard Rd.
This facility that helped build America's infrastructure was torn down a few years ago to make way for a brownfield. My buddy Trillions, aka Squirrley Dan, used to work here as part of the OWE program (or work release as I called it) at Chaney High School. They would let you out of school early to go work; it was some occupational program I guess. A company called OH&R, or something to that effect, used part of the buildings to fab or sort or store steel bar. Or something, this was a long time ago, pardon the foggy details. Anyhow, I used to go pick this kid up from work at the main gates at the end of Phleps and he would come out to the car completely covered in soot, grease and grime. Everybody else that would walk out looked relatively clean, so I ask was he running a tow motor like he told me he was or working in a damn coal mine? He tells me that he really spent most of his time sleeping or looking for places to sleep on top of the stacks of bar haha.
I think these photos are ten years old, give or take. I didn't care to photograph it when it was coming down like every Tom Dick and Harry with a camera, I was pretty unhappy with the fact that they were demolishing it. I want to say the downtown resident crowd was pushing to replace our heritage with a dog park at that time.
I am almost positive I took these the day we met Spaceman. Trillions and I walked from downtown to Himrod on the railroad tracks that follow the river, with a pack of smokes and what appears to be a plastic camera based on the quality of these images. We come across this older guy that had built a deck that cantilevered out over the Mahoning down under the Market Street bridge. This guy was cool as hell. A little out there, but cool. Introduced himself as Spaceman and goes on to tell us he built the deck by hand using material he scavenged. I thought he had a pretty nice set up. The city was kicking him out and knocking down the deck as they were getting ready to build the Chevy Center. I hope they end up doing something with this land and build that amphitheater. It's either that, or Spaceman and I are going down there and building a new deck.
Vintage, Youngstown, Republic Steel, Industry, Demolished
Youngstown, O. - We are coming up on the 100 year anniversary of the date this beautiful photograph was taken - 7/31/1917. This is a now demolished blast furnace at Republic Steel, in the Hazelton area. Think Poland Ave. and Center Street.
I was wandering around down there and found a brick marked Niles No. 1. Niles Firebrick was a manufacturer of refractory brick, so that piece of masonry I carried home may well have been used to line this furnace.
I wonder if this was taken by a company photographer or who? They made a gorgeous large format film photo I know that. Damn I was born 100 years too late. Wish that would have been me getting paid to take this.
Photo courtesy of Ohio Memory collection.
Original Content, Youngstown, US Steel, Ohio Works, Industry, Deindustrialization, Demolished
US Steel Ohio Works
Youngstown, O. Today marks the the 35th anniversary of not only my first memory as a child, but the end of one hell of an era in Youngstown history. The day the four remaining blast furnaces in Youngstown fell.
Lookit these damn vultures
I vividly remember the day it happened. If you looked out of our front window, across the street you could see the tops of these monolithic structures peeking up over Jimmy Sebena's roof. Jimmy was awesome. His daughter saved my brother's life. Jimmy told me after they landed at Normandy they confiscated all this French money. Said he won so much in the dice games he came home damn near rich, but it was like Monopoly money over there. He called me Pauley and enjoyed sitting on his front porch and spitting. All night in the summer, between the sounds of the Harleys roaring up Hazelwood and the tube rounds clanging around down the former Sheet & Tube Brier Hill works, you would hear Jimmy hawker. But that's neither here nor there.
Back to April 28th, 1982. My mom brought me to our picture window, and opened the front door so we could hear the explosion. I remember looking over the roof of the Sebena's and watching "the smokestacks" as I called them start to lean. You felt the house shake, and then you heard the explosion. It blew my young mind that the sound came later. I didn't know much about physics at just shy of 3 years old. I also didn't know much about the steel industry and how the fact they abandoned my hometown would effect the economy and my life in general either, but that would change.
I attended an old timers reunion at the Youngstown Historical Center of Labor and Industry last year, and got to sit down with one of the last US Steel employees in the Steel Valley. Tom was named Project Engineer, and was tasked with selling off the remaining USS properties, and oversaw the demolition of the Ohio Works. The demo company provided him a stack of photos of the demo, which was meant to be used as a flip book. Below is a video of him flipping through the shots at that event.
Tom was nice enough to give me a copy of a transcript of a speech he had recently given, which details the fate of every damn US Steel property in the Valley. Definitly worth a read if you're into that subject. Which I sure as hell am.
Vintage, US Steel, Youngstown Sheet and Tube, Youngstown, Industry, Demolished, Brier Hill Works, Ohio Works
Youngstown, O. -This photo is dated 1947, I am guessing this was a rebuild of the #4 blast furnace. This photo features questionable safety practices and a nice birds eye view of the Youngstown Sheet & Tube Brier Hill works in the background. The caption reads "Sledging shrink link into place on top ring casting at US Steel Ohio Works Youngstown Ohio"
Photo courtesy of the Ohio Memory Project.
Brier Hill Works, Youngstown Sheet and Tube, Youngstown, Vintage, Demolished
Youngstown Sheet & Tube Brier Hill Works
Youngstown, O. - This photo is interesting to me for a few reasons, but let's look past the (now defunct) Erie Lackawanna RR in the foreground, the (now demolished) Sheet & Tube blast furnace to the left and what I think is a (now demolished) US Steel blast furnace in the center/background.
Let's talk about the old Division Street bridge on the left of the photo, which was taken in 1975. Right before they knocked down the bridge, my buddy Vito and I decided to walk over it to Brier Hill from the Westside. I remember holes in the pavement that you could see through to the ground below, and a single shoe in the middle of the bridge. I started to climb the arch on the Brier Hill side, holding either side of the H beam and using the half-a tennis ball sized rivets for footing. Made it less than 50' up the arch and came right back down hah. Didn't feel like falling 100 feet that day.
I was one of the last people on the old bridge, and one of the first on the new 711 version of the bridge. Right before they opened it, I drove up the Stephens St off ramp and cruised the wrong way to Brier Hill. Another dumb ass move, but it was closed to traffic so no harm no foul.
Photo credit: Akron Rail Road Club
Youngstown, US Steel, Demolished
St. Mary's Byzantine Rite Church
Youngstown, O.
This Greek Catholic church was located in the heart of Youngstown's Steelton neighborhood, and was literally across the street from where U.S. Steel's Ohio Works once stood. I wonder what mass was like with the sounds of an integrated steel mill playing back up to the organ? Bang clang bang woosh clang (Amen) train whistle clang clang bang maybe?
Below is an interior photo of the church in it's early years. When I documented the building in 2010 or 11, the beautiful mosaic floor was carpeted, and the ornate ceiling was dry walled over. A few years after I took these photos an arsonist burned the church down to the brick walls.
Images below circa 2010 +/-
Copyright Paul Grilli 2017
The night of the fire. Photo and video below courtesy of Nicholas Serra.
Copyright Nicholas Serra.
Tagged: youngstown, ohio, 330, Urban Decay, Urbex Photography, urban exploration, urbex, RUSTBELT, rust belt, fire, photography, photooftheday, Steel City, Steel Valley
Deindustrialization, Original Content, Industry, Weirton Steel, William Tod Company, Demolished
Weirton, West Virginia - Dead 15 and 50 town overhead cranes in the rolling mill engine shop.
I shot this shortly before this building came down; was there to document the Tod Engine that ran this mill. As far as I know then engine still sits in the yard rusting away where the rolling mill shed was.
Tagged: abandoned, rust belt, steel, demolished
Youngstown, Republic Steel, Original Content, Industry, Demolished
Truscon Steel Co.
Ross Industrial Park (Republic Steel-Truscon Steel-Werner Ladder-Avanti Motor Car Company assembly plant) Youngstown Ohio.

redpajama_set_name: RedPajamaCommonCrawl


Dreamers, The Short Film by Vlamyr Vizcaya produced by El Tuerto Pictures is now in part of the official selection for the Cambridge Film Festival 2008.
Maria is a farmer teenager with a thousand dreams for her life.
José is her young boyfriend. Maria´s family doesn´t approve her seeing the boy.
and not precisely because their families.
Based in real life stories about growing up in a country in war like Colombia.


text:
Акідзукі (Akizuki, яп. 秋月) – ескадрений міноносець Імперського флоту Японії, який брав участь у Другій Світовій війні.

Корабель, який відносився до есмінців типу «Акідзукі», спорудили у 1942 році на верфі ВМФ у Майдзуру.

29 червня 1942-го, менш ніж через три тижні після завершення, «Акідзукі» вийшов у свій перший дальній похід, супроводжуючи лайнер «Камакура-Мару» з Йокосуки до Індонезії. 6 – 10 липня кораблі провели у Макассарі (південно-західний півострів острова Целебес), а потім рушили назад і 18 липня знову були у Йокосуці.

7 серпня 1942-го союзники висадились на сході Соломонових островів, що започаткувало шестимісячну битву за Гуадалканал та змусило японське командування перекидати сюди підкріплення. Як наслідок, 13 серпня «Акідзукі» повів у регіон судно для перевезення амуніції «Наруто-Мару». 20 серпня кораблі зайшли до Кавієнгу (друга за значенням японська база у архіпелазі Бісмарка, розташована на північному завершенні острова Нова Ірландія), а 21 серпня досягнули Рабаула (головна передова база японців у архіпелазі Бісмарку, з якої провадились операції на Соломонових островах та сході Нової Гвінеї).

Тим часом японське командування організувало проведення конвою з підкріпленнями до Гуадалканалу і 22 серпня «Акідзукі» вийшов на схід, де приєднався до до ескорту загону адмірала Хіроакі Абе (2 лінкора, 3 важкі крейсера). 24 серпня операція призвела до битви авіаносців біля Східних Соломонових островів, а 25 серпня рух конвою виявився остаточно перерваним унаслідок ударів літаків з островів Еспіриту-Санто та Гуадалканал. Втім, флот ще кілька діб перебував у морі перед тим як 5 вересня прибути на атол Трук в центральній частині Каролінських островів (ще до війни тут створили потужну базу японського ВМФ, з якої до лютого 1944-го провадили операції у цілому ряді архіпелагів).

9 вересня 1942-го з Труку вийшли кілька з'єднань, які загалом нараховували 2 авіаносці, легкий авіаносець, 4 лінкора та 8 важких крейсерів і мали патрулювати північніше від Соломонових островів в межах підтримки операцій на Гуадалканалі. «Акідзукі» охороняв їх разом з іншими численними есмінцями, причому на цей раз до якогось зіткнення з супротивником не дійшло і 23 вересня японські сили повернулись на Трук.

27 – 29 вересня 1942-го «Акідзукі» прослідував з Труку на якірну стоянку Шортленд (прикрита групою невеликих островів Шортленд акваторія біля південного завершення острова Бугенвіль, де зазвичай відстоювались бойові кораблі та перевалювались вантажі для подальшої відправки далі на схід Соломонових островів). 3 – 4 жовтня есмінець виходив звідси, щоб зустріти гідроавіаносець «Ніссін», який повертався із транспортного рейсу до Гуадалканалу (висока швидкість «Ніссін» дозволила залучити цей корабель до таких місій). 7 жовтня сам «Акідзукі» вийшов у транспортний рейс до зазначеного острова, який, втім, був скасований через погану погоду. 8 – 9 жовтня есмінець нарешті здійснив перший похід до Гуадалканалу, охороняючи при цьому зазначений вище «Ніссін».

11 жовтня 1942-го транспортна група із 2 гідроавіаносців та 6 есмінців, серед яких був і «Акідзукі», рушила у черговий рейс до Гуадалканалу. Під час розвантаження інший японський загін із 3 важких крейсерів та 2 есмінців вступив у невдале зіткнення з ворожими силами, відоме як бій біля мису Есперанс. Як наслідок, чотири есмінці транспортної групи отримали нові завдання по допомозі постраждалому загону, втім, «Акідзукі» залишився з гідроавіаносцями та довів їх назад до Шортленду.

13 жовтня 1942-го «Акідзукі» разом зі ще 7 есмінцями попрямували на схід як охорона 1-го штурмового конвою до Тассафаронга. В ніч на 14 жовтня конвой почав розвантаження, а з настанням дня втратив унаслідок ударів авіації три судна, втім, інші три судна та всі есмінці змогли повернутись на Шортленд. 17 жовтня «Акідзукі» ще раз виходив до Гуадалканалу у складі великого загону.

23 та 24 жовтня 1942-го «Акідзукі» полишав Шортленд, щоб разом з кількома есмінцями супроводжувати легкий крейсер «Юра» в межах операції з артилерійської підтримки наступу наземних військ. Перший з цих походів швидко скасували, а під час другого ще на шляху до Гуадалканалу «Юра» був пошкоджений авіацією та у підсумку затонув. Сам «Акідзукі» отримав пошкодження від прямого влучання невеликої бомби та двох близьких розривів, що призвело до затоплення одного з машинних відділень. Максимальна швидкість есмінця впала до 23 вузлів, втім, «Акідзукі» ще прийняв участь у порятунку вцілілих з Юра, а потім повернувся на базу. З 27 по 31 жовтня він проходив аварійне відновлення у Рабаулі за допомогою ремонтного судна «Хаккай-Мару», а 31 жовтня – 6 листопада прослідував через Трук до Японії, причому на переході від Трука «Акікадзе» разом зі ще трьома есмінцями супроводив авіаносець «Сьокаку» і важкий крейсер «Тікума», які отримали пошкодження 26 жовтня в битві у островів Санта-Круз. З 8 листопада по 16 грудня 1942-го «Акідзукі» пройшов ремонт у Йокосуці.

В період з 31 грудня 1942 по 4 січня 1943-го «Акідзукі» повернувся до Океанії, разом зі ще двома есмінцями супроводивши авіаносець «Дзуйкаку» з Йокосуки на Трук. 6 – 11 січня есмінець прослідував через Рабаул на Шортленд. 14 січня «Акідзукі» разом зі ще 8 есмінцями вийшов у рейс до Гуадалканалу, під час якого есмінець «Арасі» унаслідок атаки авіації втратив здатність до кермування. Після цього «Майкадзе» узяв пошкоджений корабель на буксир, а «Акідзукі» прикривав їх на зворотному шляху до Шортленду.

19 січня 1943-го «Акідзукі» вийшов на допомогу транспорту «Мьохо-Мару», торпедованому підводним човном на підході до Бугенвіля. Надвечір есмінець виявив ворожу субмарину USS Nautilus у надводному положення та спробував таранити її, проте був уражений двома випущеними нею торпедами. Одна з них не здетонувала, проте інша завдала значних пошкоджень, були затоплені котельне та машинне відділення одного борту, постраждав кіль. Втім, корабель зберіг здатність пересуватись зі швидкістю до 20 вузлів і зміг повернутись на Шортленд, де провели перший аварійний ремонт. 30 січня – 2 лютого «Акідзукі» здійснив перехід на Трук, де пройшов черговий етап відновлення за допомогою ремонтного судна «Акасі». Нарешті, 11 березня есмінець рушив до Японії для завершального ремонту, при цьому на першому етапі до Сайпану (Маріанські острова) він ескортував транспорт «Токіо-Мару». 14 березня «Акідзукі» вийшов з Сайпану, проте всього за кілька десятків кілометрів від нього носова секція корабля загнулась. Через побоювання, що вона взагалі відірветься, «Акідзукі» зупинив свої машини та був узятий буксир переобладнаним канонерським човном «Шоєй-Мару». 15 березня есмінець довели до Сайпану та посадили тут на мілину, після чого більше трьох місяців «Акідзукі» готували для переходу до Японії. За допомогою рятувального судна Matsunouri Maru з корабля демонтували передні установки головного калібру та деякі інші конструкції, а також провели деякі інші модифікації, що мали збільшити мореходність. Нарешті, 24 червня – 2 липня переобладнаний мінний загорджувач «Сінко-Мару» провів «Акідзукі» на буксирі до Нагасакі, при цьому есмінці «Садзанамі» та «Удзукі» (останній також був пошкоджений, але прямував на ремонт власним ходом) забезпечували охорону. Ремонт тривав до 23 жовтня, при цьому «Акідзукі» отримав носову секцію від недобудованого однотипного есмінця «Сімоцукі».

26 листопада – 1 грудня 1943-го «Акідзукі» разом зі ще 2 есмінцями супроводили авіаносець «Сьокаку» та легкий авіаносець «Тітосе» з Японії на Трук. 9 – 14 грудня «Акідзукі» здійснив транспортний рейс до атолу Кваджелейн (Маршаллові острова) та назад.

З 30 грудня 1943 по 2 січня 1944 «Акідзукі» разом зі ще одним есмінцем та двома легкими крейсерами здійснили рейс з Трука до Кавієнга та назад (це відбувалось в межах операції «Бо Го», яка мала за мету підсилення гарнізонів у архіпелазі Бісмарка). На зворотному шляху «Акідзукі» відокремився, щоб прийняти участь у допомозі торпедованому судну «Кійосумі-Мару», а тому прибув на Трук лише 4 січня (що стосується «Кійосумі-Мару», то цей транспорт 8 січня вдалось дотягнути до Труку, де він і загинув під час лютневого рейду американського авіаносного з'єднання).

Станом на початок лютого 1944-го японське командування вже розуміло, що подальше перебування великих сил флоту на Труці наражає їх на невиправдану небезпеку і розпочало вивід. 1 – 4 лютого «Акідзукі» разом зі ще 4 есмінцями прослідував у охороні 2 лінкорів та 3 важких крейсерів на Палау (а вже 17 лютого база на Труці дійсно була розгромлена ворожою авіацією). 16 – 21 лютого «Акідзукі» супроводив ті самі лінкори та крейсера з Палау в районі Сінгапура до якірної стоянки Лінгга (дії підводних човнів на комунікаціях вкрай ускладнювали доставку палива до Японії та призвели до рішення базувати флот у Південно-Східній Азії поблизу від районів нафтовидобутку).

12 – 15 травня 1944-го «Акідзукі» прослідував разом з основними силами з Лінгга до Таві-Таві (в філіппінському архіпелазі Сулу поряд з нафтовидобувними районами острова Борнео), оскільки японське командування готувалось до неминучої ворожої атаки на головний оборонний периметр Імперії – Маріанські острови, Палау чи північно-західну частину Нової Гвінеї. Наступні кілька тижнів «Акідзукі» ніс патрульно-ескортну службу в околицях Таві-Таві. 12 червня американці дійсно розпочали операцію по оволодінню Маріанськими островами і наступної доби японський флот рушив для контратаки, а 19 – 20 червня зазнав важкої поразки в битві у Філіппінському морі. Під час цих подій «Акідзукі» разом з 6 іншими есмінцями та легким крейсером забезпечував охорону загону «А», при цьому ескорт не зміг захистити головні кораблі від підводних човнів. Остані 19 червня потопили 2 із 3 авіаносців, причому «Акідзукі» прийняв участь у порятунку моряків як з «Сьокаку», так і з «Тайхо». 22 червня японський флот прибув на Окінаву, а 24 числа був вже у Японії. Наступні кілька місяців «Акідзукі» провів у метрополії.

У другій декаді жовтня 1944-го союзники розпочали операцію на Філіппінах. 20 жовтня «Акідзукі» вийшов з Японії у складі охорони з'єднання адмірала Одзави, яке мало 4 авіаносці, але лише сотню літаків. За планами японського командування, воно повинне було відволікти сили ворога та дозволити головному з'єднанню адмірала Куріти атакувати транспорти вторгнення. Цей план дійсно спрацював (в частині відволікання уваги) і 25 жовтня американське ударне авіаносне з'єднання зайнялось кораблями Одзави та потопило всі 4 авіаносця. Вранці того ж дня «Акідзукі» був атакований літаками та втратив хід. За вісім хвилин на кораблі стався потужний вибух, причина якого достеменно невідома – за різними версіями, це стало результатом потрапляння авіаційної торпеди або детонації власних торпед унаслідок влучання бомби. Есмінець майже розірвало на дві частини і він затонув за 6 хвилин. Біля 150 членів екіпажу були підібрані ескортним есмінцем «Макі», який під час подальшого бою сам був атакований літаками, що призвело до загибелі 4 моряків з «Акідзукі». «Макі» міг пересуватись лише зі зменшеною проти звичайної швидкості, але 29 жовтня все-таки дійшов до острова Амаміосіма (середня частина архіпелагу Рюкю). В останньому бою на «Акідзукі» загинуло понад 180 членів екіпажу (ще один потрапив у полон до американців).

Примітки

Кораблі Японії втрачені у Філіппінському морі
Ескадрені міноносці Японії періоду Другої світової війни

redpajama_set_name: RedPajamaWikipedia