contributions/confirmations/controller/confirmations.controller.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Confirmation controller 00004 * 00005 * @author Gerd Riesselmann 00006 * @ingroup Confirmations 00007 */ 00008 class ConfirmationsController extends ControllerBase { 00009 /** 00010 * Return array of IDispatchToken this controller takes responsability 00011 */ 00012 public function get_routes() { 00013 return array( 00014 new ParameterizedRoute('confirm/{id:ui>}/{code:s}', $this, 'confirm', new NoCacheCacheManager()), 00015 ); 00016 } 00017 00018 /** 00019 * Builds and processes the activation page 00020 */ 00021 public function action_confirm($page_data, $id, $code) { 00022 Load::models('confirmations'); 00023 $handler = Confirmations::create_confirmation_handler($id, $code); 00024 $err = $handler->confirm(); 00025 if ($err->is_error()) { 00026 $page_data->error($err); 00027 } 00028 else { 00029 $page_data->message($err); 00030 } 00031 $page_data->in_history = false; 00032 $page_data->head->robots_index = ROBOTS_NOINDEX_FOLLOW; 00033 $page_data->head->title = tr('Confirmation', 'confirmations'); 00034 } 00035 00036 }