Welcome Guest, Not a member yet? Register   Sign In
Activation Routes
#8

[eluser]xtremer360[/eluser]
So what I"m trying to do is with the general message is have it display a message for each reason why it could or could not be validated with the two paramters. In my general_message view I have a <?php echo $message ?> that I need passed. Also at this point if one of the parameters or both of them are not included in the url it does not show the error page. Any ideas why?

Code:
<?php
if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );

class Activation extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();
    }
    
    public function _remap()
    {
        $user_id = $this->uri->segment( 2 );
        $registration_key = $this->uri->segment( 3 );
        
        $this->error = FALSE;
        if ( ( $user_id !== NULL ) && ( $registration_key !== NULL ) )
        {
            if ( ( isset ( $user_id ) ) && ( ( trim( $user_id ) !== '' ) || ( !empty( $user_id ) ) ) )
            {
                if ( !is_numeric( $user_id ) )
                {
                    $this->error = TRUE;
                }
            }
            
            if ( ( isset ( $registration_key ) ) && ( ( trim( $registration_key ) !== '' ) || ( !empty( $registration_key ) ) ) )
            {
                if ( !preg_match( '/^[A-Za-z0-9]+$/', $registration_key ) )
                {
                    $this->error = TRUE;
                }
            }
        }
        
        $msgBoxMsgs = array();
        $cssPageAddons = '';
        $jsPageAddons = '';
        $metaAddons = '';
        $siteTitle = 'KOW Manager Account Activation';
        
        $bodyContent = $this->error ? show_404() : 'usermanagement/general_message';
        $bodyType = 'full';
        
        if ( count( $msgBoxMsgs ) !== 0 )
        {
            $msgBoxes = $this->msgboxes->buildMsgBoxesOutput(array('display' => 'show', 'msgs' =>$msgBoxMsgs));
        }
        else
        {
            $msgBoxes = array('display' => 'none');
        }
        
        if ( isset( $siteTitle ) && ( empty( $siteTitle ) ) )
        {
            $siteTitle = $this->metatags->SiteTitle();
        }
        
        $this->data = compact( 'msgBoxes', 'cssPageAddons', 'jsPageAddons', 'siteTitle', 'bodyContent', 'bodyType' );
        $this->load->view('usermanagement/index', $this->data);      
    }
    
    public function index()
    {
        
    }
}

/* End of file activation.php */
/* Location: ./application/controllers/activation.php */


Messages In This Thread
Activation Routes - by El Forum - 08-10-2012, 11:59 AM
Activation Routes - by El Forum - 08-10-2012, 12:07 PM
Activation Routes - by El Forum - 08-10-2012, 12:28 PM
Activation Routes - by El Forum - 08-10-2012, 12:37 PM
Activation Routes - by El Forum - 08-10-2012, 12:40 PM
Activation Routes - by El Forum - 08-10-2012, 12:47 PM
Activation Routes - by El Forum - 08-10-2012, 01:43 PM
Activation Routes - by El Forum - 08-11-2012, 12:02 PM
Activation Routes - by El Forum - 08-11-2012, 09:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB