|
@@ -615,50 +615,19 @@ bool AppSDatenbank::neuAccount( const char *name, const char *pass, const char *
|
|
if( datenbank->befehl( befehl->getText() ) )
|
|
if( datenbank->befehl( befehl->getText() ) )
|
|
{
|
|
{
|
|
unlock();
|
|
unlock();
|
|
- befehl->setText( "SELECT schluessel FROM account_neu WHERE name = '" );
|
|
|
|
|
|
+ befehl->setText( "SELECT schluessel, id FROM account_neu WHERE name = '" );
|
|
befehl->append( (char*)n );
|
|
befehl->append( (char*)n );
|
|
befehl->append( "'" );
|
|
befehl->append( "'" );
|
|
lock();
|
|
lock();
|
|
datenbank->befehl( befehl->getText() );
|
|
datenbank->befehl( befehl->getText() );
|
|
Result res = datenbank->getResult();
|
|
Result res = datenbank->getResult();
|
|
unlock();
|
|
unlock();
|
|
- Datei md;
|
|
|
|
if( res.zeilenAnzahl )
|
|
if( res.zeilenAnzahl )
|
|
{
|
|
{
|
|
- md.setDatei( res.values[ 0 ].getText() );
|
|
|
|
- if( md.open( Datei::Style::schreiben ) )
|
|
|
|
- {
|
|
|
|
- Text txt = eMail;
|
|
|
|
- txt += "\naccount activation\n Account Details:\n";
|
|
|
|
- txt += "\r\nname: ";
|
|
|
|
- txt += name;
|
|
|
|
- txt += "\r\npassword: ";
|
|
|
|
- txt += pass;
|
|
|
|
- txt += "\r\nsecret: ";
|
|
|
|
- txt += geheim;
|
|
|
|
- txt += "\r\ndate of birth: ";
|
|
|
|
- txt += gebDatum;
|
|
|
|
- txt += "\r\nactivation key: ";
|
|
|
|
- txt += res.values[ 0 ].getText();
|
|
|
|
- md.schreibe( txt, txt.getLength() );
|
|
|
|
- md.close();
|
|
|
|
- // e_mail senden
|
|
|
|
-#ifdef WIN32
|
|
|
|
- PROCESS_INFORMATION prozessinfo1;
|
|
|
|
- STARTUPINFO startinfo1;
|
|
|
|
- startinfo1.cb = sizeof( STARTUPINFOW );
|
|
|
|
- ZeroMemory( &startinfo1, sizeof( STARTUPINFOW ) );
|
|
|
|
- Text cmdl = zIni->zWert( "Java" )->getText();
|
|
|
|
- cmdl += " Mailer ";
|
|
|
|
- cmdl += res.values[ 0 ].getText();
|
|
|
|
- if( CreateProcess( 0, cmdl, 0, 0, 0, 0, 0, 0, &startinfo1, &prozessinfo1 ) == 1 )
|
|
|
|
- CloseHandle( prozessinfo1.hThread );
|
|
|
|
-#else
|
|
|
|
- pid_t pid;
|
|
|
|
- char *pargs[] = { zIni->zWert( "Java" )->getText(), ( char* )"Mailer", res.values[ 0 ].getText(), (char*)0 };
|
|
|
|
- posix_spawn( &pid, zIni->zWert( "Java" )->getText(), 0, 0, pargs, 0 );
|
|
|
|
-#endif
|
|
|
|
- }
|
|
|
|
|
|
+ // e_mail senden
|
|
|
|
+ pid_t pid;
|
|
|
|
+ char *pargs[] = { zIni->zWert( "PHP" )->getText(), zIni->zWert( "AccountActivationMail" )->getText(), (char*)name, (char*)geheim, (char*)gebDatum, res.values[ 0 ].getText(), (char*)eMail, res.values[ 1 ].getText(), (char*)0 };
|
|
|
|
+ posix_spawn( &pid, zIni->zWert( "PHP" )->getText(), 0, 0, pargs, 0 );
|
|
}
|
|
}
|
|
res.destroy();
|
|
res.destroy();
|
|
befehl->release();
|
|
befehl->release();
|
|
@@ -669,120 +638,6 @@ bool AppSDatenbank::neuAccount( const char *name, const char *pass, const char *
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-void AppSDatenbank::neuAccountAbbruch( const char *name )
|
|
|
|
-{
|
|
|
|
- Text *befehl = new Text( "DELETE FROM account_neu WHERE name = '" );
|
|
|
|
- Text n( name );
|
|
|
|
- n.ersetzen( "'", "''" );
|
|
|
|
- befehl->append( (char*)n );
|
|
|
|
- befehl->append( "'" );
|
|
|
|
- lock();
|
|
|
|
- datenbank->befehl( befehl->getText() );
|
|
|
|
- unlock();
|
|
|
|
- befehl->release();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-bool AppSDatenbank::aktiviereAccount( const char *name, const char *key )
|
|
|
|
-{
|
|
|
|
- Text *befehl = new Text( "SELECT account_aktivieren( '" );
|
|
|
|
- Text n( name );
|
|
|
|
- n.ersetzen( "'", "''" );
|
|
|
|
- befehl->append( (char*)n );
|
|
|
|
- befehl->append( "', '" );
|
|
|
|
- Text s( key );
|
|
|
|
- s.ersetzen( "'", "''" );
|
|
|
|
- befehl->append( (char*)s );
|
|
|
|
- befehl->append( "' )" );
|
|
|
|
- lock();
|
|
|
|
- if( datenbank->befehl( befehl->getText() ) )
|
|
|
|
- {
|
|
|
|
- befehl->release();
|
|
|
|
- Result res = datenbank->getResult();
|
|
|
|
- unlock();
|
|
|
|
- if( res.values[ 0 ].istGleich( "f" ) )
|
|
|
|
- {
|
|
|
|
- res.destroy();
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- return 1;
|
|
|
|
- }
|
|
|
|
- unlock();
|
|
|
|
- befehl->release();
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-char AppSDatenbank::suchBestaetigung( const char *name, const char *pass )
|
|
|
|
-{
|
|
|
|
- Text *befehl = new Text( "select such_account_bestaetigung( '" );
|
|
|
|
- Text n( name );
|
|
|
|
- n.ersetzen( "'", "''" );
|
|
|
|
- befehl->append( (char*)n );
|
|
|
|
- befehl->append( "', md5('" );
|
|
|
|
- Text p( pass );
|
|
|
|
- p.ersetzen( "'", "''" );
|
|
|
|
- befehl->append( (char*)p );
|
|
|
|
- befehl->append( "') )" );
|
|
|
|
- lock();
|
|
|
|
- datenbank->befehl( befehl->getText() );
|
|
|
|
- Result res = datenbank->getResult();
|
|
|
|
- unlock();
|
|
|
|
- befehl->release();
|
|
|
|
- char ret = (char)TextZuInt( res.values[ 0 ].getText(), 10 );
|
|
|
|
- res.destroy();
|
|
|
|
- return ret;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-void AppSDatenbank::sendeErstellEMail( const char *name, InitDatei *zIni )
|
|
|
|
-{
|
|
|
|
- Text *befehl = new Text( "SELECT geheimnis, e_mail, geb_datum, schluessel FROM account_neu WHERE name = '" );
|
|
|
|
- Text n( name );
|
|
|
|
- n.ersetzen( "'", "''" );
|
|
|
|
- befehl->append( (char*)n );
|
|
|
|
- befehl->append( "'" );
|
|
|
|
- lock();
|
|
|
|
- datenbank->befehl( befehl->getText() );
|
|
|
|
- Result res = datenbank->getResult();
|
|
|
|
- unlock();
|
|
|
|
- befehl->release();
|
|
|
|
- Datei md;
|
|
|
|
- if( res.zeilenAnzahl )
|
|
|
|
- {
|
|
|
|
- md.setDatei( res.values[ 3 ].getText() );
|
|
|
|
- if( md.open( Datei::Style::schreiben ) )
|
|
|
|
- {
|
|
|
|
- Text txt = res.values[ 1 ].getText();
|
|
|
|
- txt += "\naccount activation\n Account Details:\n";
|
|
|
|
- txt += "\r\nname: ";
|
|
|
|
- txt += name;
|
|
|
|
- txt += "\r\nsecret: ";
|
|
|
|
- txt += res.values[ 0 ].getText();
|
|
|
|
- txt += "\r\ndate of birth: ";
|
|
|
|
- txt += res.values[ 2 ].getText();
|
|
|
|
- txt += "\r\nactivation key: ";
|
|
|
|
- txt += res.values[ 3 ].getText();
|
|
|
|
- md.schreibe( txt, txt.getLength() );
|
|
|
|
- md.close();
|
|
|
|
- // e_mail senden
|
|
|
|
-#ifdef WIN32
|
|
|
|
- PROCESS_INFORMATION prozessinfo1;
|
|
|
|
- STARTUPINFO startinfo1;
|
|
|
|
- startinfo1.cb = sizeof( STARTUPINFOW );
|
|
|
|
- ZeroMemory( &startinfo1, sizeof( STARTUPINFOW ) );
|
|
|
|
- Text cmdl = zIni->zWert( "Java" )->getText();
|
|
|
|
- cmdl += " Mailer ";
|
|
|
|
- cmdl += res.values[ 4 ].getText();
|
|
|
|
- if( CreateProcess( 0, cmdl, 0, 0, 0, 0, 0, 0, &startinfo1, &prozessinfo1 ) == 1 )
|
|
|
|
- CloseHandle( prozessinfo1.hThread );
|
|
|
|
-#else
|
|
|
|
- pid_t pid;
|
|
|
|
- char *pargs[] = { zIni->zWert( "Java" )->getText(), ( char* )"Mailer", res.values[ 4 ].getText(), (char*)0 };
|
|
|
|
- posix_spawn( &pid, zIni->zWert( "Java" )->getText(), 0, 0, pargs, 0 );
|
|
|
|
-#endif
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- res.destroy();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
void AppSDatenbank::markballsFinish( int level, int sek, int account, char *device, int diff, int kupfer, int gId )
|
|
void AppSDatenbank::markballsFinish( int level, int sek, int account, char *device, int diff, int kupfer, int gId )
|
|
{
|
|
{
|
|
if( !device && kupfer > 0 )
|
|
if( !device && kupfer > 0 )
|