commit a278fbe1ea4674a7af3cea224d269a153e7cb0e3
parent 118f8e333de965716e653de35a1d8dcbb87e1005
Author: Jan Dankert <devnull@localhost>
Date: Sat, 2 Mar 2013 01:39:30 +0100
Fix: Registrierungsfunktion.
Diffstat:
2 files changed, 43 insertions(+), 39 deletions(-)
diff --git a/action/LoginAction.class.php b/action/LoginAction.class.php
@@ -1693,59 +1693,63 @@ class LoginAction extends Action
*/
public function registercodeView()
{
- $email_address = $this->getRequestVar('mail',OR_FILTER_MAIL);
-
- if ( ! Mail::checkAddress($email_address) )
+ global $conf;
+ foreach( $conf['database'] as $dbname=>$dbconf )
{
- $this->addValidationError('mail');
- $this->setTemplateVar('mail',$email_address);
- return;
+ if ( is_array($dbconf) && $dbconf['enabled'] )
+ $dbids[$dbname] = $dbconf['comment'];
}
-
+
+ $this->setTemplateVar( 'dbids',$dbids );
- srand ((double)microtime()*1000003);
- $registerCode = rand();
+ $db = Session::getDatabase();
+ if ( is_object($db) )
+ $this->setTemplateVar('actdbid',$db->id);
+ else
+ $this->setTemplateVar('actdbid',$conf['database']['default']);
- Session::set('registerCode',$registerCode );
-
- // E-Mail and die eingegebene Adresse verschicken
- $mail = new Mail($email_address,
- 'register_commit_code','register_commit_code');
- $mail->setVar('code',$registerCode); // Registrierungscode als Text-Variable
- if ( $mail->send() )
- {
- $this->addNotice('','','mail_sent',OR_NOTICE_OK);
- $this->nextView('registeruserdata');
- }
- else
- {
- $this->addNotice('','','mail_not_sent',OR_NOTICE_ERROR,array(),$mail->error);
- return;
- }
+
}
- function registerxxxxPost()
+ public function registerPost()
{
global $conf;
- Session::set('registerMail',$this->getRequestVar('mail') );
- // TODO: Attribut "Password" abfragen
- foreach( $conf['database'] as $dbname=>$dbconf )
- {
- if ( is_array($dbconf) && $dbconf['enabled'] )
- $dbids[$dbname] = $dbconf['comment'];
- }
+ Session::set('registerMail',$this->getRequestVar('mail') );
+
+ srand ((double)microtime()*1000003);
+ $registerCode = rand();
+
+ Session::set('registerCode',$registerCode );
- $this->setTemplateVar( 'dbids',$dbids );
+ $email_address = $this->getRequestVar('mail',OR_FILTER_MAIL);
+
+ if ( ! Mail::checkAddress($email_address) )
+ {
+ $this->addValidationError('mail');
+ return;
+ }
- $db = Session::getDatabase();
- if ( is_object($db) )
- $this->setTemplateVar('actdbid',$db->id);
+ // E-Mail and die eingegebene Adresse verschicken
+ $mail = new Mail($email_address,
+ 'register_commit_code','register_commit_code');
+ $mail->setVar('code',$registerCode); // Registrierungscode als Text-Variable
+
+ if ( $mail->send() )
+ {
+ $this->addNotice('','','mail_sent',OR_NOTICE_OK);
+ $this->nextView('registeruserdata');
+ }
else
- $this->setTemplateVar('actdbid',$conf['database']['default']);
+ {
+ $this->addNotice('','','mail_not_sent',OR_NOTICE_ERROR,array(),$mail->error);
+ return;
+ }
+
+ $this->nextView('registercode');
}
diff --git a/themes/default/templates/login/register.tpl.src.xml b/themes/default/templates/login/register.tpl.src.xml
@@ -2,7 +2,7 @@
xsi:schemaLocation="http://www.openrat.de/template ../template.xsd">
<if true="config:login/register">
- <form method="GET">
+ <form>
<logo name="register"></logo>