<commit_before><?php
/**
 * Contains controller managing user preferences.
 *
 * @copyright  Copyright (c) 2010 The Fajr authors (see AUTHORS).
 *             Use of this source code is governed by a MIT license that can be
 *             found in the LICENSE file in the project root directory.
 *
 * @package    Fajr
 * @subpackage Controller__User
 * @author     <NAME> <<EMAIL>>
 * @filesource
 */
namespace fajr\controller\user;

use Exception;
use fajr\Context;
use fajr\controller\BaseController;
use libfajr\AIS2Utils;
use libfajr\base\Preconditions;
use libfajr\trace\Trace;
use fajr\Request;
use fajr\Response;
use fajr\util\FajrUtils;
use sfStorage;
use fajr\config\FajrConfig;
use fajr\config\FajrConfigLoader;
use fajr\settings\SkinSettings;
use fajr\SessionStorageProvider;

/**
 * Controller, which manages user settings.
 *
 * @package    Fajr
 * @subpackage Controller__Settings
 * @author     <NAME> <<EMAIL>>
 */
class UserSettingsController extends BaseController
{
  private $settingsStorage;
  private $config;
  
  public static function getInstance()
  {
    return new UserSettingsController(SessionStorageProvider::getInstance(),
        FajrConfigLoader::getConfiguration());
  }

  public function __construct(sfStorage $settingsStorage, FajrConfig $config)
  {
    $this->settingsStorage = $settingsStorage;
    $this->config = $config;
  }

  public function runSettings(Trace $trace, Context $context)<commit_msg>Nastavenia by mali byt pristupne iba po logine<commit_after><?php
/**
 * Contains controller managing user preferences.
 *
 * @copyright  Copyright (c) 2010-2012 The Fajr authors (see AUTHORS).
 *             Use of this source code is governed by a MIT license that can be
 *             found in the LICENSE file in the project root directory.
 *
 * @package    Fajr
 * @subpackage Controller__User
 * @author     <NAME> <<EMAIL>>
 * @filesource
 */
namespace fajr\controller\user;

use Exception;
use fajr\Context;
use fajr\controller\BaseController;
use libfajr\AIS2Utils;
use libfajr\base\Preconditions;
use libfajr\trace\Trace;
use fajr\Request;
use fajr\Response;
use fajr\util\FajrUtils;
use sfStorage;
use fajr\config\FajrConfig;
use fajr\config\FajrConfigLoader;
use fajr\settings\SkinSettings;
use fajr\SessionStorageProvider;
use fajr\LoginManager;
use fajr\exceptions\AuthenticationRequiredException;

/**
 * Controller, which manages user settings.
 *
 * @package    Fajr
 * @subpackage Controller__Settings
 * @author     <NAME> <<EMAIL>>
 */
class UserSettingsController extends BaseController
{
  private $settingsStorage;
  private $config;
  /** @var LoginManager */
  private $loginManager;
  
  public static function getInstance()
  {
    return new UserSettingsController(SessionStorageProvider::getInstance(),
        FajrConfigLoader::getConfiguration(), LoginManager::getInstance());
  }

  public function __construct(sfStorage $settingsStorage, FajrConfig $config,
      LoginManager $loginManager)
  {
    $this->settingsStorage = $settingsStorage;
    $this->config = $config;
    $this->loginManager = $loginManager;
  }

  public function invokeAction(Trace $trace, $action, Context $context)
  {
    Preconditions::checkIsString($action);

    if (!$this->loginManager->isLoggedIn()) {
      throw new AuthenticationRequiredException();
    }

    parent::invokeAction($trace, $action, $context);
  }

  public function runSettings(Trace $trace, Context $context)
{'fraction_non_alphanumeric': 0.10087209302325581, 'fraction_numerical': 0.004069767441860465, 'mean_word_length': 4.261467889908257, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 22, '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': '5928261', 'n_tokens_mistral': 1045, 'n_tokens_neox': 1026, 'n_words': 277}