<commit_before><?php
/**
 * A hierarchical users and rights system plugin for Pico.
 *
 * @author	<NAME>
 * @link	http://nliautaud.fr
 * @link    http://pico.dev7studios.com
 * @license http://opensource.org/licenses/MIT
 */
class _Pico_Users
{
	private $user;
	private $users;
	private $rights;
	private $base_url;
	private $hash_type;

	// Pico hooks ---------------

	/**
	 * Store settings and define the current user.
	 */
	public function config_loaded(&$settings)
	{
		$this->base_url = $settings['base_url'];
		$this->users = @$settings['users'];
		$this->rights = @$settings['rights'];
		if (in_array($settings['hash_type'], hash_algos())) {
			$this->hash_type = $settings['hash_type'];
		} else {
			$this->hash_type = "sha1";
		}

		$this->user = '';
		$this->check_login();
	}
	/**
	 * If the requested url is unauthorized for the current user
	 * display page "403" and send 403 headers.
	 */<commit_msg>fix #3 : verify that hash_type setting exists<commit_after><?php
/**
 * A hierarchical users and rights system plugin for Pico.
 *
 * @author	<NAME>
 * @link	http://nliautaud.fr
 * @link    http://pico.dev7studios.com
 * @license http://opensource.org/licenses/MIT
 */
class _Pico_Users
{
	private $user;
	private $users;
	private $rights;
	private $base_url;
	private $hash_type;

	// Pico hooks ---------------

	/**
	 * Store settings and define the current user.
	 */
	public function config_loaded(&$settings)
	{
		$this->base_url = $settings['base_url'];
		$this->users = @$settings['users'];
		$this->rights = @$settings['rights'];
		if (isset($settings['hash_type']) && in_array($settings['hash_type'], hash_algos())) {
			$this->hash_type = $settings['hash_type'];
		} else {
			$this->hash_type = "sha1";
		}

		$this->user = '';
		$this->check_login();
	}
	/**
	 * If the requested url is unauthorized for the current user
	 * display page "403" and send 403 headers.
	 */
{'fraction_non_alphanumeric': 0.18148342977380327, 'fraction_numerical': 0.008942661756970016, 'mean_word_length': 3.5071090047393363, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5954722', 'n_tokens_mistral': 694, 'n_tokens_neox': 633, 'n_words': 157}