![]() |
![]() |
|
| Condividi questo contenuto nei Social Network: |
|
Tweet |
|
|
|
Ti stiamo aspettando: Registrati subito e gratis. Entra a far parte di una delle comunità più attive in Italia. Se hai dimenticato i tuoi dati li puoi recuperare subito. |
||||
|
|||||||||
Hey Amico Visitatore, Condividi con noi le tue idee e la tua conoscenza Aprendo una nuova discussione nella sezione Flash & ActionScript |
|
|
LinkBack | Strumenti di discussione |
|
|
#1 (permalink) |
|
Banned
|
md5
io ho una chat in flash agganciata a un db dv si trovano gli iscritti...ma nel db le pass sono criptate in md5 e vorrei ke la chat le leggesse ... cioè ... io avevo gia degli utenti con pass in md5 sul db e vorrei che il form di login in flash le leggesse poiche ora è impostato a leggere pass non in md5 ... il codice del form login è
function submitLogin(){ _root.userName = username.text; _root.chatService.loginToChat(_root.userName,passw ord.text); gotoAndPlay("send"); } username.onSubmit = submitLogin; Key.addListener(username); password.onSubmit = submitLogin; Key.addListener(password); username.tabEnabled = true; username.tabIndex = 1; password.tabEnabled = true; password.tabIndex = 2; Selection.setFocus("usernameField"); //status.text+=String.fromCharCode(10,13); ki mi aiuta? quello che riporto è il form di una chat in flash che non cripta le pass e io volevo integrarla con un portale che le cripta! quindi ho fatto si che la chat si agganciasse alla tab utenti del portale ... ma dato ke il form non è configurato per l'md5 da pass errata ... io nn sono esperto di codice ... quindi se potete postate direttamente quello ke devo modificare, Grazie |
|
|
|
|
|
|
|
#5 (permalink) |
|
Banned
|
La pag config è :
<?php error_reporting(0); $CONFIG['gatewayURL'] = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/gateway.php"; $CONFIG['tablesList'] = array("bans","chat_messages","groups","pvt_rooms_u sers","rooms","sessions","system","users"); $CONFIG['database'] = "****"; // MySQL database name $CONFIG['dbHost'] = "****"; // MySQL host name $CONFIG['dbUser'] = "****"; // MySQL username $CONFIG['dbPass'] = "*****"; // MySQL password $CONFIG['tablePrefix'] = "jos_"; $CONFIG['masterAdminUsername'] = "admin"; $CONFIG['masterAdminPass'] = "*****"; $CONFIG['masterAdminBanPriv'] = "all"; $CONFIG['masterAdminMngusersPriv'] = "all"; $CONFIG['masterAdminMnggroupsPriv'] = true; $CONFIG['masterAdminInvisiblePriv'] = false; $CONFIG['masterAdminLoginToChatPriv'] = true; $CONFIG['masterAdminMngroomsPriv'] = true; $CONFIG['masterAdminMngsystemPriv'] = true; $CONFIG['masterAdminDefaultRoomId'] = 50; $CONFIG['guestsGroupID'] = 7; $CONFIG['defaultLang'] = "it"; if (($CONFIG['defaultLang']=="he")||($CONFIG['defaultLang']=="ar")) { $CONFIG['rightToLeft'] = true; } else { $CONFIG['rightToLeft'] = false; } $CONFIG['chatFontSize'] = 16;// Chat font size $CONFIG['fontSize'] = 11; //Interface font size $CONFIG['smallFontSize'] = 10;//Size of the other small interface elements $CONFIG['roomExpireAfter'] = 10; $CONFIG['maximumUsersPerRoom'] = 999;//0 means unlimited $CONFIG['unbanAfter'] = 3600;//value in seconds 0 means never unban only unban from admin area $CONFIG['updateAfter'] = 2.4; //this config var specifies a duration between update requests $CONFIG['defaultVolume'] = 50; $CONFIG['defaultRoomID'] = 1; $CONFIG['joinRoomTimeStamp'] = "h:i a"; $CONFIG['helpFile'] = "help.txt"; $CONFIG['sessionTimeOut'] = 120;// number of elapsed seconds after last request to consider user logged out $CONFIG['connectionTimeOut'] = 120;// number of elapsed seconds after last response to consider connection time out (used by flash side) ?> Poi la main.php è : <HTML> <HEAD> <meta http-equiv=Content-Type content="text/html; charset="> <TITLE>main</TITLE> </HEAD> <BODY bgcolor="#FFFFFF"> <SCRIPT LANGUAGE=JavaScript> <!-- var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1; // Handle all the the FSCommand messages in a Flash movie function main_DoFSCommand(command, args) { var mainObj = InternetExplorer ? main : document.main; // // Place your code here... // } // Hook for Internet Explorer if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) { document.write('<SCRIPT LANGUAGE=VBScript\> \n'); document.write('on error resume next \n'); document.write('Sub main_FSCommand(ByVal command, ByVal args)\n'); document.write(' call main_DoFSCommand(command, args)\n'); document.write('end sub\n'); document.write('</SCRIPT\> \n'); } //--> </SCRIPT> <!-- URL's used in the movie--> <!-- text used in the movie--> <OBJECT classid="clsid codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ID="main" WIDTH="100%" HEIGHT="100%" ALIGN=""> <PARAM NAME=movie VALUE="main.swf"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="main.swf" menu=false quality=high bgcolor=#FFFFFF WIDTH="100%" HEIGHT="100%" swLiveConnect=true ID="main" NAME="main" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED> </OBJECT> </BODY> </HTML> e dbconnection.php <?php class DBconnection{ var $connection; var $database; var $dbuser; var $dbpass; var $host; var $queryString; /************************************************** *****************************************/ function DBConnection($database, $dbuser, $dbpass, $host){ $this->database = $database; $this->dbuser = $dbuser; $this->dbpass = $dbpass; $this->host = $host; $this->connection = @mysql_connect ( $this->host, $this->dbuser, $this->dbpass ); if (!mysql_select_db($this->database)) { mysql_query("CREATE DATABASE `".$this->database."`"); if (!mysql_select_db($this->database)) { print mysql_error(); exit; } } } function getFieldValue($field_name,$table_name,$condition=f alse){ if($condition){ $result = mysql_query("SELECT $field_name FROM $table_name $condition LIMIT 1"); }else{ $result = mysql_query("SELECT $field_name FROM $table_name LIMIT 1"); } if($result){ $value = mysql_fetch_assoc($result); return $value[$field_name]; }else{ return false; } } function valueExist($value,$table_name,$field_name){ $result = mysql_query("SELECT * FROM $table_name WHERE $field_name = $value"); if($result){ while($row = $this->nextRow($result)){ $matched[] = $row; } return $matched; }else{ return false; } } function getRecordById($id_field_name,$id,$table_name){ $result = mysql_query("SELECT * FROM $table_name WHERE $id_field_name = '$id'"); if($result){ $value = mysql_fetch_assoc($result); return $value; }else{ return false; } } function getFirstRow($input){ if($input){ switch (gettype($input)){ case "string": $result = $this->query($input); if($result){ return mysql_fetch_array( $result ); }else{ return false; } break; case "resource": return mysql_fetch_array($input); break; } }else{ return false; } } function nextRow($result){ if($result){ return mysql_fetch_array( $result ); }else{ return false; } } function numRows($input){ if($input){ switch (gettype($input)){ case "string": $result = mysql_query( $input ); if ( !$result ) return 0; return mysql_num_rows( $result ); break; case "resource": if ( !$input ) return 0; return mysql_num_rows( $input ); break; } }else{ return false; } } function query( $query ){ $this->queryString = $query; return mysql_query( $query ); } /************************************************** *****************************************/ /** Iterator. */ function next( $result ) { return mysql_fetch_array( $result ); } /** Return the number of rows in a result set. */ function rowsInResult( $result ) { if ( !$result ) return 0; return mysql_num_rows( $result ); } /** Return only the first item of the first row of a query - useful with "SELECT ID" queries. */ function getValue( $query ) { $result = mysql_query( $query ); if ( !$result || mysql_num_rows( $result ) == 0 ) return false; return mysql_fetch_array( $result ); } /** Execute a plain query string, return the result set. */ /** Close the database connection. */ function close() { mysql_close(); } /** Returns true if the executed query retrieves a record, or false if no record is returned by executing the query */ function exists ( $table, $whereClause = "" ) { $query = "SELECT ID FROM $table $whereClause LIMIT 1"; $result = mysql_query ( $query ); if ( !$result ) return false; // if the query was invalid, return false return mysql_num_rows ( $result ) != 0; } } ?> ve ne servono altre ? |
|
|
|
|
|
#6 (permalink) |
|
User Attivo
Data di registrazione: Feb 2006
Ubicazione: Undisclosed city of South America
Messaggi: 4,901
|
A dir la verità non mi serve sapere tutta quella trafila.
Il punto è questo: per poter recuperare dei valori du uno script PHP , il medesimo script dev'essere strutturato in modo che quando viene chiamato , interroga il db recuperando la password e crea un output con il valore della password che Flash può leggere. Ora, se il tuo problema è di cambiare l'algoritmo di criptaggio che hai sulle password del vecchio database Flash non può farlo, Flash può 'solo' recuperare i dati che gli passa il PHP e poi utilizzarli per fare quello che vuoi. |
|
Ultima modifica di Flep : 05-09-06 10:51. |
|
|
|
|
| Tags: md5 |
| Strumenti di discussione | |
|
|