예제 #1
0
 public function activate()
 {
     // Check to make sure user is not already logged in
     if ($this->auth->isLoggedIn()) {
         Url::redirect();
     }
     // Check to make sure user is trying to login
     if (isset($_GET['username']) && isset($_GET['key'])) {
         // Catch username an password inputs using the Request helper
         $username = Request::get('username');
         $activekey = Request::get('key');
         // Run the Activation script
         if ($this->auth->activateAccount($username, $activekey)) {
             // Success
             $data['welcome_message'] = "Your Account Has Been Activated!  <a href='" . DIR . "Login'>Login</a>";
         } else {
             // Fail
             $data['welcome_message'] = "Activation Failed - Please Contact Administrator";
         }
     } else {
         // No GET information - Send User to index
         //Url::redirect();
     }
     $data['title'] = 'New Member Activation';
     // Setup Breadcrumbs
     $data['breadcrumbs'] = "\n\t\t\t<li><a href='" . DIR . "'>Home</a></li>\n\t\t\t<li class='active'>" . $data['title'] . "</li>\n\t\t";
     View::rendertemplate('header', $data);
     View::render('welcome/info', $data, $error);
     View::rendertemplate('footer', $data);
 }