public function preExecute()
 {
     parent::preExecute();
     $this->upgrade = new sfSympalUpgradeFromWeb($this->getContext()->getConfiguration(), $this->getContext()->getEventDispatcher(), new sfFormatter());
     $this->hasNewVersion = $this->upgrade->hasNewVersion();
     $this->latestVersion = $this->upgrade->getLatestVersion();
     $this->currentVersion = $this->upgrade->getCurrentVersion();
     $this->checkFilePermissions();
 }
Пример #2
0
 public function preExecute()
 {
     parent::preExecute();
     if ($this->getUser()->hasAttribute('api_log')) {
         $dispatcher = sfApplicationConfiguration::getActive()->getEventDispatcher();
         $string = $this->getUser()->getAttribute('api_log');
         $dispatcher->notify(new sfEvent('Api', 'application.log', array('priority' => sfLogger::WARNING, $string)));
         $this->getUser()->getAttributeHolder()->remove('api_log');
     }
 }
 public function preExecute()
 {
     parent::preExecute();
     $this->config = new sfRestWebServiceConfiguration($this->getContext()->getConfiguration());
     $this->enableDoctrineValidation();
     if ($this->isProtected()) {
         $this->authenticate();
     }
     $this->checkContentType();
 }
 public function preExecute()
 {
     $this->configuration = new peticionCodigoGeneratorConfiguration();
     if (!$this->getUser()->hasCredential($this->configuration->getCredentials($this->getActionName()))) {
         $this->forward(sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
     }
     $this->dispatcher->notify(new sfEvent($this, 'admin.pre_execute', array('configuration' => $this->configuration)));
     $this->helper = new peticionCodigoGeneratorHelper();
     parent::preExecute();
 }
 public function preExecute()
 {
     $ip = $_SERVER['REMOTE_ADDR'];
     $myFile = "ip_address_log.txt";
     $ip_address_log = new IpAddressLog();
     $ip_address_log->ip_address = $_SERVER['REMOTE_ADDR'];
     $ip_address_log->save();
     $fh = fopen($myFile, 'a') or die("can't open file");
     $stringData = $ip . " | " . date(DATE_W3C) . "\n";
     fwrite($fh, $stringData);
     fclose($fh);
     parent::preExecute();
 }
Пример #6
0
 public function preExecute()
 {
     // $module = 'sf_plop_profile';
     //     if (!in_array($module, array_keys(sfPlop::getSafePluginModules()))
     //       && !$this->getUser()->hasCredential($module)
     //     )
     //       $this->forward404();
     if (!$this->getUser()->isAuthenticated()) {
         $this->forward(sfConfig::get('sf_login_module'), sfConfig::get('sf_login_action'));
     }
     //     if (!$this->getUser()->hasCredential($module))
     //       $this->forward(sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));
     parent::preExecute();
     ProjectConfiguration::getActive()->LoadHelpers(array('I18N'));
     $this->getResponse()->setTitle(sfPlop::setMetaTitle(__('User profile', '', 'plopAdmin')));
 }
 public function preExecute()
 {
     parent::preExecute();
     // Récupération de l'utilisateur.
     $this->guard_user = $this->getUser()->getGuardUser();
     if ($this->guard_user != null) {
         $this->ei_user = $this->guard_user->getEiUser();
     } else {
         $this->ei_user = null;
     }
     $requiredModules = array("eicampaignexecution", "eitestset", "eilog");
     // Mise à jour des statuts des campagnes/JDT.
     if (in_array($this->getModuleName(), $requiredModules)) {
         Doctrine_Core::getTable("EiTestSet")->closeUnterminatedTestSet();
     }
     if ($this->getModuleName() == "eicampaignexecution") {
         Doctrine_Core::getTable("EiCampaignExecution")->closeUnterminatedTestSet();
     }
 }
 /**
  * @return
  */
 public function preExecute()
 {
     if ($this->getUser()->id) {
         // get or create model sfVkontakteUser
         $this->vkontakteUser = sfVkontakteUserTable::getInstance()->find($this->getUser()->id);
         if (!$this->vkontakteUser) {
             $this->vkontakteUser = new sfVkontakteUser();
             $this->vkontakteUser->id = $this->getUser()->id;
             $this->vkontakteUser->save();
         }
         // if we need to fetch profiles
         $this->getUser()->need_fetch = sfConfig::get('app_vkontakte_enable_fetch') && $this->vkontakteUser->getNeedFetchFriends();
     }
     if (sfConfig::get('app_vkontakte_enable_add_js')) {
         // add JS to response
         sfContext::getInstance()->getResponse()->addJavascript('http://vkontakte.ru/js/api/xd_connection.js?2', 'first');
         sfContext::getInstance()->getResponse()->addJavascript('/sfVkontaktePlugin/js/common.js', 'first');
     }
     parent::preExecute();
 }
 /**
  * Here we will initiate system messages translatable strings
  * 
  */
 public function preExecute()
 {
     parent::preExecute();
     sfLoader::loadHelpers('I18N');
     $this->messages = array('already_voted' => __('You have already voted'), 'missing_params' => __('Parameters are missing to retrieve ratable object'), 'post_only' => __('POST requests only'), 'ratable_error' => __('Unable to retrieve ratable object: %s'), 'thank_you' => __('Thank you for your vote'), 'thank_you_update' => __('Thanks for updating your vote'), 'user_error' => __('A problem has occured, sorry for the inconvenience'));
 }
 public function preExecute()
 {
     parent::preExecute();
     $this->getContext()->getEventDispatcher()->connect('admin.save_object', array($this, 'listenToAdminSaveObject'));
 }
Пример #11
0
 public function preExecute()
 {
     parent::preExecute();
     $this->searcher = new opThemeAssetSearcher();
     $this->config = new opThemeConfig();
 }
 public function preExecute()
 {
     parent::preExecute();
     rtTemplateToolkit::setBackendTemplateDir();
 }
Пример #13
0
 public function preExecute()
 {
     parent::preExecute();
     ini_set('max_execution_time', 0);
 }
 public function preExecute()
 {
     parent::preExecute();
     rtTemplateToolkit::setBackendTemplateDir();
     sfConfig::set('app_rt_node_title', 'Search');
 }
 public function preExecute()
 {
     $this->table = $this->getRequestParameter('table');
     parent::preExecute();
 }
Пример #16
0
 public function preExecute()
 {
     parent::preExecute();
     $this->referer_module = $this->getUser()->getAttribute("referer_module");
 }
 public function preExecute()
 {
     parent::preExecute();
     self::preExecuteCacheHeaders($this->getRequest(), $this->getResponse(), $this->getUser(), $this->isSecure());
 }
 /**
  * Set the template.
  */
 public function preExecute()
 {
     rtTemplateToolkit::setFrontendTemplateDir();
     parent::preExecute();
 }
 public function preExecute()
 {
     parent::preExecute();
     $this->folderProvider = new sfAssetsFolderProvider();
     $this->assetProvider = new sfAssetsProvider();
 }
 /**
  * Here we will initiate system messages translatable strings
  * 
  */
 public function preExecute()
 {
     parent::preExecute();
     sfLoader::loadHelpers('I18N');
     $this->messages = array('missing_params' => __('Parameters are missing to retrieve object'), 'post_only' => __('POST requests only'), 'prioritisable_error' => __('Unable to retrieve object: %s'), 'thank_you' => __('Thank you'), 'user_error' => __('A problem has occured, sorry for the inconvenience'));
 }