|
@@ -109,9 +109,9 @@ int AppSDatenbank::login( char *name, char *passwort )
|
|
|
{
|
|
|
Text befehl = "SELECT id FROM account WHERE name = '";
|
|
|
befehl += name;
|
|
|
- befehl += "' AND passwort = '";
|
|
|
+ befehl += "' AND passwort = md5('";
|
|
|
befehl += passwort;
|
|
|
- befehl += "'";
|
|
|
+ befehl += "')";
|
|
|
lock();
|
|
|
datenbank->befehl( befehl );
|
|
|
Result res = datenbank->getResult();
|
|
@@ -594,11 +594,11 @@ bool AppSDatenbank::neuAccount( const char *name, const char *pass, const char *
|
|
|
Text n( name );
|
|
|
n.ersetzen( "'", "''" );
|
|
|
befehl->append( (char*)n );
|
|
|
- befehl->append( "', '" );
|
|
|
+ befehl->append( "', md5('" );
|
|
|
Text p( pass );
|
|
|
p.ersetzen( "'", "''" );
|
|
|
befehl->append( (char*)p );
|
|
|
- befehl->append( "', '" );
|
|
|
+ befehl->append( "'), '" );
|
|
|
Text g( geheim );
|
|
|
g.ersetzen( "'", "''" );
|
|
|
befehl->append( (char*)g );
|
|
@@ -717,11 +717,11 @@ char AppSDatenbank::suchBestaetigung( const char *name, const char *pass )
|
|
|
Text n( name );
|
|
|
n.ersetzen( "'", "''" );
|
|
|
befehl->append( (char*)n );
|
|
|
- befehl->append( "', '" );
|
|
|
+ befehl->append( "', md5('" );
|
|
|
Text p( pass );
|
|
|
p.ersetzen( "'", "''" );
|
|
|
befehl->append( (char*)p );
|
|
|
- befehl->append( "' )" );
|
|
|
+ befehl->append( "') )" );
|
|
|
lock();
|
|
|
datenbank->befehl( befehl->getText() );
|
|
|
Result res = datenbank->getResult();
|
|
@@ -734,7 +734,7 @@ char AppSDatenbank::suchBestaetigung( const char *name, const char *pass )
|
|
|
|
|
|
void AppSDatenbank::sendeErstellEMail( const char *name, InitDatei *zIni )
|
|
|
{
|
|
|
- Text *befehl = new Text( "SELECT passwort, geheimnis, e_mail, geb_datum, schluessel FROM account_neu WHERE name = '" );
|
|
|
+ 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 );
|
|
@@ -747,21 +747,19 @@ void AppSDatenbank::sendeErstellEMail( const char *name, InitDatei *zIni )
|
|
|
Datei md;
|
|
|
if( res.zeilenAnzahl )
|
|
|
{
|
|
|
- md.setDatei( res.values[ 4 ].getText() );
|
|
|
+ md.setDatei( res.values[ 3 ].getText() );
|
|
|
if( md.open( Datei::Style::schreiben ) )
|
|
|
{
|
|
|
- Text txt = res.values[ 2 ].getText();
|
|
|
+ Text txt = res.values[ 1 ].getText();
|
|
|
txt += "\naccount activation\n Account Details:\n";
|
|
|
txt += "\r\nname: ";
|
|
|
txt += name;
|
|
|
- txt += "\r\npassword: ";
|
|
|
- txt += res.values[ 0 ].getText();
|
|
|
txt += "\r\nsecret: ";
|
|
|
- txt += res.values[ 1 ].getText();
|
|
|
+ txt += res.values[ 0 ].getText();
|
|
|
txt += "\r\ndate of birth: ";
|
|
|
- txt += res.values[ 3 ].getText();
|
|
|
+ txt += res.values[ 2 ].getText();
|
|
|
txt += "\r\nactivation key: ";
|
|
|
- txt += res.values[ 4 ].getText();
|
|
|
+ txt += res.values[ 3 ].getText();
|
|
|
md.schreibe( txt, txt.getLength() );
|
|
|
md.close();
|
|
|
// e_mail senden
|
|
@@ -1057,88 +1055,6 @@ int AppSDatenbank::getMarkballsFortschritt( int accountId, char *device, Array<
|
|
|
return anz;
|
|
|
}
|
|
|
|
|
|
-void AppSDatenbank::curvesnakeFinish( int score, int accId, char *device, int map, int kupfer )
|
|
|
-{
|
|
|
- Text befehl = "SELECT id FROM curvesnake WHERE map = ";
|
|
|
- befehl += map;
|
|
|
- lock();
|
|
|
- datenbank->befehl( befehl );
|
|
|
- int anz = datenbank->getZeilenAnzahl();
|
|
|
- unlock();
|
|
|
- if( !anz )
|
|
|
- {
|
|
|
- befehl = "INSERT INTO curvesnake( map, score ) VALUES( ";
|
|
|
- befehl += map;
|
|
|
- befehl += ", 0 )";
|
|
|
- lock();
|
|
|
- datenbank->befehl( befehl );
|
|
|
- unlock();
|
|
|
- }
|
|
|
- befehl = "UPDATE curvesnake SET score = ";
|
|
|
- befehl += score;
|
|
|
- if( device )
|
|
|
- {
|
|
|
- befehl += ", device = '";
|
|
|
- befehl += device;
|
|
|
- befehl += "'";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- befehl += ", account_id = ";
|
|
|
- befehl += accId;
|
|
|
- }
|
|
|
- befehl += " WHERE map = ";
|
|
|
- befehl += map;
|
|
|
- lock();
|
|
|
- datenbank->befehl( befehl );
|
|
|
- unlock();
|
|
|
- if( !device && kupfer )
|
|
|
- {
|
|
|
- befehl = "UPDATE account SET kupfer = kupfer + ";
|
|
|
- befehl += kupfer;
|
|
|
- befehl += " WHERE id = ";
|
|
|
- befehl += accId;
|
|
|
- lock();
|
|
|
- datenbank->befehl( befehl );
|
|
|
- unlock();
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-int AppSDatenbank::getCurvesnakeScore( Array< int > *map, Array< int > *score )
|
|
|
-{
|
|
|
- lock();
|
|
|
- datenbank->befehl( "SELECT map, score from curvesnake ORDER BY map" );
|
|
|
- Result r = datenbank->getResult();
|
|
|
- unlock();
|
|
|
- for( int i = 0; i < r.zeilenAnzahl; i++ )
|
|
|
- {
|
|
|
- map->add( r.values[ i * 2 ] );
|
|
|
- score->add( r.values[ i * 2 + 1 ] );
|
|
|
- }
|
|
|
- int ret = r.zeilenAnzahl;
|
|
|
- r.destroy();
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
-int AppSDatenbank::getCurvesnakeMapList( Array< int > *map, int account )
|
|
|
-{
|
|
|
- Text befehl = "SELECT id from curvesnake_map WHERE preis = 0 ";
|
|
|
- if( account )
|
|
|
- {
|
|
|
- befehl += "UNION SELECT map_id FROM curvesnake_map_account WHERE account_id = ";
|
|
|
- befehl += account;
|
|
|
- }
|
|
|
- lock();
|
|
|
- datenbank->befehl( befehl );
|
|
|
- Result r = datenbank->getResult();
|
|
|
- unlock();
|
|
|
- for( int i = 0; i < r.zeilenAnzahl; i++ )
|
|
|
- map->add( r.values[ i ] );
|
|
|
- int ret = r.zeilenAnzahl;
|
|
|
- r.destroy();
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
void AppSDatenbank::addKupfer( int account, int kupfer )
|
|
|
{
|
|
|
Text befehl = "UPDATE account SET kupfer = kupfer + ";
|