Ahnungsloser: Captcha Script in Sessionverwaltung einbauen

Beitrag lesen

wenn ich das ganze eigenständig lasse funktioniert das ganze einwandfrei
will ich es jedoch in meine RegisterUser-Funktion meines Scriptes einbauen bekomm ich ein Problem, ich nehme an aufgrund meiner Sessionverwaltung, da diese auch nicht wirklich von mir stammt und ich noch nicht ganz dahintersteige und nur kleine Anpassungen daran
machen kann häng ich da eben dran fest

Jetzt erstmal das File zur session verwaltung ... wenn noch includes zum Verständnis benötigt werden bescheid sagen

session.php

  
So wie auch im diesem CaptchaScript gibt es bei mir eine php die das ganze auswertet  
  
process.php  
[code lang=php]<?php  
// * Process.php  
// *  
// * The Process class is meant to simplify the task of processing  
// * user submitted forms, redirecting the user to the correct  
// * pages if errors are found, or if form is successful, either  
// * way. Also handles the logout procedure.  
include("include/session.php");  
  
class Process  
{  
   /* Class constructor */  
   function Process(){  
      global $session;  
      /* User submitted login form */  
      if(isset($_POST['sublogin'])){  
         $this->procLogin();  
      }  
      /* User submitted registration form */  
      else if(isset($_POST['subjoin'])){  
         $this->procRegister();  
      }  
      /* User submitted forgot password form */  
      else if(isset($_POST['subforgot'])){  
         $this->procForgotPass();  
      }  
      /* User submitted edit account form */  
      else if(isset($_POST['subedit'])){  
         $this->procEditAccount();  
	  }  
	  /* Send User ConfirmationMail */  
      else if(isset($_POST['subConfirm'])){  
      	$this->procSendConfirm();  
      }  
      /**  
       * The only other reason user should be directed here  
       * is if he wants to logout, which means user is  
       * logged in currently.  
       */  
      else if($session->logged_in){  
         $this->procLogout();  
      }  
      /**  
       * Should not get here, which means user is viewing this page  
       * by mistake and therefore is redirected.  
       */  
       else{  
          header("Location: index.php");  
       }  
   }  
  
   /**  
    * procLogin - Processes the user submitted login form, if errors  
    * are found, the user is redirected to correct the information,  
    * if not, the user is effectively logged in to the system.  
    */  
   function procLogin(){  
  
   /**  
    * procLogout - Simply attempts to log the user out of the system  
    * given that there is no logout form to process.  
    */  
   function procLogout(){  
  
   /**  
    * procRegister - Processes the user submitted registration form,  
    * if errors are found, the user is redirected to correct the  
    * information, if not, the user is effectively registered with  
    * the system and an email is (optionally) sent to the newly  
    * created user.  
    */  
   function procRegister(){  
      global $session, $form;  
      /* Convert username to all lowercase (by option) */  
      if(ALL_LOWERCASE){  
         $_POST['user'] = strtolower($_POST['user']);  
      }  
      /* Registration attempt */  
      $retval = $session->register($_POST['user'], $_POST['pass'], $_POST['email']);  
  
      /* Registration Successful */  
      if($retval == 0){  
         $_SESSION['reguname'] = $_POST['user'];  
         $_SESSION['regsuccess'] = true;  
         header("Location: ".$session->referrer);  
      }  
      /* Error found with form */  
      else if($retval == 1){  
         $_SESSION['value_array'] = $_POST;  
         $_SESSION['error_array'] = $form->getErrorArray();  
         header("Location: ".$session->referrer);  
      }  
      /* Registration attempt failed */  
      else if($retval == 2){  
         $_SESSION['reguname'] = $_POST['user'];  
         $_SESSION['regsuccess'] = false;  
         header("Location: ".$session->referrer);  
      }  
   }  
  
   /**  
    * procForgotPass - Validates the given username then if  
    * everything is fine, a new password is generated and  
    * emailed to the address the user gave on sign up.  
    */  
   function procForgotPass(){  
  
  
   /**  
    * procEditAccount - Attempts to edit the user's account  
    * information, including the password, which must be verified  
    * before a change is made.  
    */  
   function procEditAccount(){  
  
   /**  
   	* procSendConfirm - only needs to be used if the administrator  
   	* changes the EMAIL_WELCOME from false to true and wants  
   	* the users to confirm themselves. (why not?!)  
   	*/  
   function procSendConfirm(){  
  
};  
  
/* Initialize process */  
$process = new Process;  
  
?>