Hello SilverStripe Users,
I hope man can me help here.
I have me build a registrationForm without modul and will now a activation build but will not work i have problems with my $_GET.
But here my Datas:
My Test URL : http://localhost.com/silverstripe2.4/Activate?email=demo@localhost.com&code=d8f631b75ef4961c1ff1a7ccba933e9726d98c4e
with my RegistrationForm I make me a random code in my Database, now i will in my ActivateForm check E-mail Adress and the Code what is generated.
Here my ActivateForm:
<?
// INTERFACES:
// - Form
// - Form_Controller
//==============================================================================
// Form
//==============================================================================
class ActivatePage extends Page {
public static $db = array();
public static $has_one = array();
public static $has_many = array();
public static $many_many = array();
public static $can_be_root = true;
public static $icon = 'themes/immofuchs24/images/treeicons/security';
//----------------------------------------------------------------------------
}
//==============================================================================
// Form_Controller
//==============================================================================
class ActivatePage_Controller extends Page_Controller {
public static $allowed_actions = array (
'ActivateForm'
);
function ActivateForm() {
if(!isset($_GET['email'])) {
$Active->sessionMessage(
'Fehler: Unvollständige Daten übergeben - E-mail fehlt.',
'bad'
);
return Director::redirectBack();
} elseif(!isset($_GET['Code'])) {
$Active->sessionMessage(
'Fehler: Unvollständige Daten übergeben - Code fehlt.',
'bad'
);
return Director::redirectBack();
} else {
if(!$Email = DataObject::get_one("Email", "`Email` = '". Convert::raw2sql($data['Email']) . "'")) {
$Active->AddErrorMessage('Email', 'Fehler: E-mail Adresse exestiert nicht.', 'bad');
return Director::redirectBack();
} elseif(!$Code = DataObject::get_one("Code")) {
$Active->AddErrorMessage('Code', 'Fehler: Code ist nicht korrekt.', 'bad');
return Director::redirectBack();
} else {
$Code = 0;
$Code = new Code();
$ActiveCode->saveInto($Code);
$ActiveCode->write;
}
}
}
}
?>
I hope a Member here show my Problem and can help me Thanks.
PS: my englisch is not best