// N? det har vi inte session_destroy(); } if (strlen($_POST['Name']) < $oConfiguration->getCustomValue("NameMin") or strlen($_POST['Name']) > $oConfiguration->getCustomValue("NameMax") or strlen($_POST['RealName']) < $oConfiguration->getCustomValue("RealNameMin") or strlen($_POST['RealName']) > $oConfiguration->getCustomValue("RealNameMax") or strlen($_POST['Email']) < $oConfiguration->getCustomValue("EmailMin") or strlen($_POST['Email']) > $oConfiguration->getCustomValue("EmailMax") or strlen($_POST['Signature']) < $oConfiguration->getCustomValue("SignatureMin") or strlen($_POST['Signature']) > $oConfiguration->getCustomValue("SignatureMax") or $_POST['Age'] and !is_numeric($_POST['Age']) or $_POST['Age'] < $oConfiguration->getCustomValue("AgeMin") or $_POST['Age'] > $oConfiguration->getCustomValue("AgeMax") or strlen($_POST['HomePage']) < $oConfiguration->getCustomValue("HomepageMin") or strlen($_POST['HomePage']) > $oConfiguration->getCustomValue("HomepageMax") or strlen($_POST['Other']) < $oConfiguration->getCustomValue("OtherMin") or strlen($_POST['Other']) > $oConfiguration->getCustomValue("OtherMax")) { trigger_error("36", E_USER_ERROR); } // Annars, skapa användaren $oUser = new User(0, $_POST['Name']); $oUP = new UserPresentation($oUser, TRUE); if ($sErrorMsg = $oUP->getErrorMsg()) { trigger_error("37: " . $sErrorMsg, E_USER_ERROR); die; } $oUP->setRealName(htmlspecialchars($_POST['RealName'])); $oUP->setEmail(htmlspecialchars($_POST['Email'])); $oUP->setSignature(htmlspecialchars($_POST['Signature'])); $oUP->setAge($_POST['Age']); $oUP->setHomesite(htmlspecialchars($_POST['HomePage'])); $oUP->setOther(htmlspecialchars($_POST['Other'])); $oUP->setNumberThreads($oConfiguration->getCustomValue("DefaultNumberThreads")); $oUP->setNumberPostsInThread($oConfiguration->getCustomValue("DefaultNumberPosts")); if (!$oUP->createPasswordAndSend()) { trigger_error("39: " . $oUP->getErrorMsg(), E_USER_ERROR); } if (!$oUP->saveData()) { trigger_error("39: " . $oUP->getErrorMsg(), E_USER_ERROR); } // Templat $oTemplate = new Template("/home/daft/Templates/DoRegisterUser.tpl"); $oTemplate->set("Title", $oConfiguration->getCustomValue("Title")); $oTemplate->parse();