Changeset 85
- Timestamp:
- 04/07/09 17:00:11 (1 year ago)
- Files:
-
- branches/1.0/apps/main/config/routing.yml (modified) (1 diff)
- branches/1.0/apps/main/modules/mail/actions/actions.class.php (modified) (1 diff)
- branches/1.0/apps/main/modules/mail/templates/reportPageProblemSuccess.php (added)
- branches/1.0/apps/main/modules/utils/actions/actions.class.php (modified) (1 diff)
- branches/1.0/apps/main/modules/utils/config/view.yml (modified) (1 diff)
- branches/1.0/apps/main/modules/utils/templates/reportPageProblemSuccess.php (added)
- branches/1.0/apps/main/modules/utils/validate/reportPageProblem.yml (added)
- branches/1.0/apps/main/templates/layout.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/apps/main/config/routing.yml
r37 r85 1 # Page problem 2 report_problem_url: 3 url: /report 4 param: { module: utils, action: reportPageProblem } 5 1 6 # I18N relocate 2 7 i18n_relocate: branches/1.0/apps/main/modules/mail/actions/actions.class.php
r2 r85 24 24 $this->activation = $this->getRequest()->getAttribute('activation'); 25 25 } 26 27 public function executeReportPageProblem() 28 { 29 } 26 30 27 31 public function executeResendActivation() branches/1.0/apps/main/modules/utils/actions/actions.class.php
r2 r85 156 156 return $redirect; 157 157 } 158 159 public function executeReportPageProblem() 160 { 161 if ($this->getRequest()->getMethod() == sfrequest::POST) 162 { 163 $this->pageUrl = $this->getRequestParameter('pageUrl'); 164 165 // Sends a mail with the user report and the page url 166 $mailSent = $this->sendSwiftSmtpPlainMail('mail', 'reportPageProblem', 167 sfConfig::get('app_contact_default_recipient'), 168 $this->__('Page problem report'), 169 array('reply-to' => array('address' => $this->getRequestParameter('email', sfConfig::get('app_contact_default_recipient'))))); 170 if (!$mailSent) 171 { 172 $this->getRequest()->setError('errors', $this->__('Unable to send your message. Please try again later.')); 173 174 return sfView::SUCCESS; 175 } 176 177 $this->setFlash('notice', $this->__('Your report has been successfully sent, thanks.')); 178 $this->redirect('@homepage'); 179 } 180 else if (!preg_match('#^(http|https)://#i', $this->pageUrl = trim($this->getRequest()->getReferer()))) 181 { 182 $this->setFlash('warning', $this->__('You must activate referer sending to report a problem with an url.')); 183 $this->logMessage(sprintf($this->__('"%s" is not a correct referer'), $this->pageUrl)); 184 $this->redirect('@homepage'); 185 } 186 } 187 188 public function handleErrorReportPageProblem() 189 { 190 return sfView::SUCCESS; 191 } 158 192 159 193 } branches/1.0/apps/main/modules/utils/config/view.yml
r2 r85 2 2 metas: 3 3 title: Contact - Symfonians 4 robots: noindex, nofollow4 robots: "noindex, nofollow" 5 5 6 6 error404Success: 7 7 metas: 8 8 title: Page Not Found - Symfonians 9 robots: noindex, nofollow 9 robots: "noindex, nofollow" 10 11 reportPageProblemSuccess: 12 metas: 13 title: Report a problem - Symfonians 14 robots: "noindex, nofollow" branches/1.0/apps/main/templates/layout.php
r80 r85 55 55 <div id="footer"> 56 56 <p> 57 <?php echo link_to(__('Report a problem on this page'), '@report_problem_url') ?> - 57 58 <?php echo __('Powered by %symfony%, icons by %famfamfam%, code and design by %NiKo%', 58 59 array('%symfony%' => link_to(image_tag('symfony.png', 'alt=Symfony style=vertical-align:top;padding:0 .1em'), 'http://www.symfony-project.org/'),
