Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    Aiuto su IP e confronti

    Salve a tutti, ho un piccolo problema da risolvere. :master:
    Ho un sito in fase di costruzione, e il cliente mi ha chiesto di far evitare le iscrizioni doppie degli user.
    Per farlo sarebbe stato ultile, rilevare IP di user registrarlo nel db e poi confrontarlo ad ogni accesso.
    Il problema diventa molto complesso da questo punto di vista perchè gli IP in adsl cambiano dinamicamente, per cui non si ha la possibilità di dire, sei lo stesso utente X non puoi fare una nuova registrazione.
    Ho sentito parlare di MAC ADRESS, e mi sono informato, e anche li nulla, non si può risalire alla scheda di rete senza infrangere le sicurezze.
    Quindi un Cookie ben settato in modo da assegnare un id univoco all'user e nel caso non li avesse attivi farlo con una session_register?

    Insomma mi serve un aiuto per capire quale soluzione sia meglio, ed eventualmente avere una funzioncina di esempio su cui cominciare ad elaborare qualcosa.

    Grazie in anticipo sulle risposte che mi darete

  2. #2
    fai una cosa controlli se
    nome utente
    email
    corrispondono a quelli già presenti nel db se si allora stampa il messaggio di errore che nn puo effetuare + di una registrazione con lo stesso nome e la stessa email

    visto che ti trovi anche se l'ip come te hai detto cambia fai un controllo anche su di esso molti nn pensano a riavviare il modem o router per la registrazione....




  3. #3
    Si questo controllo già lo fatto, e il problema che sorge e un altro.
    Purtroppo non tentano di registrarsi con lo stesso nome o mail, perchè sanno che non è possibile, ma fanno una nuova registrazione con una mail differente e quindi anche differente nome, quindi ovvio che il sistema accetti la registrazione.
    Alcuni ci provano lo stesso nel tempo in cui non hanno riavviato il modem altri invece lo fanno il giorno dopo, quindi come vedi mi trovo in una situazione particolare.
    Tutto questo e saltato fuori da numerosi test, e il cliente vuole che gli user siano univoci, per ovvie norme di sicurezza.
    Non ce qualche funzione in cui si possa dare un id univoco all'user?
    Naturalmente quell'id durerà affinchè non scadrà la registrazione, ovvero passati 60 giorni di inattività il database cancella in automatico l'user e tutto il suo contenuto che riferiva a quell'user, ma questo è già apposto da un pezzo.

    Quello interessante e come ho detto sopra, dargli una sorta di key o id in quel modo il browser e il sistema si comunicano i due dati se identici ti blocca, se e vuoto prosegui.

    Ce qualcosa di simile in giro?

  4. #4
    imposta dei cookie a durata infinita in cui salvi l' md5 del nome utente.
    Ovviamente i cookie dovranno essere abilitati , se non lo sono interrompi la registrazione e chiedi all' utente di abilitare i cookie
    Come creare e pubblicare ebook : Creare ebook

  5. #5
    Intendi una cosa simile a questa?

    Codice PHP:
    class Horde_Cipher_blowfish {

        
    /* Pi Array */
        
    var $p = array(
                
    0x243F6A880x85A308D30x13198A2E0x03707344,
                
    0xA40938220x299F31D00x082EFA980xEC4E6C89,
                
    0x452821E60x38D013770xBE5466CF0x34E90C6C,
                
    0xC0AC29B70xC97C50DD0x3F84D5B50xB5470917,
                
    0x9216D5D90x8979FB1B);

        
    /* S Boxes */
        
    var $s1 = array(
                
    0xD1310BA60x98DFB5AC0x2FFD72DB0xD01ADFB7,
                
    0xB8E1AFED0x6A267E960xBA7C90450xF12C7F99,
                
    0x24A199470xB3916CF70x0801F2E20x858EFC16,
                
    0x636920D80x71574E690xA458FEA30xF4933D7E,
                
    0x0D95748F0x728EB6580x718BCD580x82154AEE,
                
    0x7B54A41D0xC25A59B50x9C30D5390x2AF26013,
                
    0xC5D1B0230x286085F00xCA4179180xB8DB38EF,
                
    0x8E79DCB00x603A180E0x6C9E0E8B0xB01E8A3E,
                
    0xD71577C10xBD314B270x78AF2FDA0x55605C60,
                
    0xE65525F30xAA55AB940x574898620x63E81440,
                
    0x55CA396A0x2AAB10B60xB4CC5C340x1141E8CE,
                
    0xA15486AF0x7C72E9930xB3EE14110x636FBC2A,
                
    0x2BA9C55D0x741831F60xCE5C3E160x9B87931E,
                
    0xAFD6BA330x6C24CF5C0x7A3253810x28958677,
                
    0x3B8F48980x6B4BB9AF0xC4BFE81B0x66282193,
                
    0x61D809CC0xFB21A9910x487CAC600x5DEC8032,
                
    0xEF845D5D0xE98575B10xDC2623020xEB651B88,
                
    0x23893E810xD396ACC50x0F6D6FF30x83F44239,
                
    0x2E0B44820xA48420040x69C8F04A0x9E1F9B5E,
                
    0x21C668420xF6E96C9A0x670C9C610xABD388F0,
                
    0x6A51A0D20xD8542F680x960FA7280xAB5133A3,
                
    0x6EEF0B6C0x137A3BE40xBA3BF0500x7EFB2A98,
                
    0xA1F1651D0x39AF01760x66CA593E0x82430E88,
                
    0x8CEE86190x456F9FB40x7D84A5C30x3B8B5EBE,
                
    0xE06F75D80x85C120730x401A449F0x56C16AA6,
                
    0x4ED3AA620x363F77060x1BFEDF720x429B023D,
                
    0x37D0D7240xD00A12480xDB0FEAD30x49F1C09B,
                
    0x075372C90x80991B7B0x25D479D80xF6E8DEF7,
                
    0xE3FE501A0xB6794C3B0x976CE0BD0x04C006BA,
                
    0xC1A94FB60x409F60C40x5E5C9EC20x196A2463,
                
    0x68FB6FAF0x3E6C53B50x1339B2EB0x3B52EC6F,
                
    0x6DFC511F0x9B30952C0xCC8145440xAF5EBD09,
                
    0xBEE3D0040xDE334AFD0x660F28070x192E4BB3,
                
    0xC0CBA8570x45C8740F0xD20B5F390xB9D3FBDB,
                
    0x5579C0BD0x1A60320A0xD6A100C60x402C7279,
                
    0x679F25FE0xFB1FA3CC0x8EA5E9F80xDB3222F8,
                
    0x3C7516DF0xFD616B150x2F501EC80xAD0552AB,
                
    0x323DB5FA0xFD2387600x53317B480x3E00DF82,
                
    0x9E5C57BB0xCA6F8CA00x1A87562E0xDF1769DB,
                
    0xD542A8F60x287EFFC30xAC6732C60x8C4F5573,
                
    0x695B27B00xBBCA58C80xE1FFA35D0xB8F011A0,
                
    0x10FA3D980xFD2183B80x4AFCB56C0x2DD1D35B,
                
    0x9A53E4790xB6F845650xD28E49BC0x4BFB9790,
                
    0xE1DDF2DA0xA4CB7E330x62FB13410xCEE4C6E8,
                
    0xEF20CADA0x36774C010xD07E9EFE0x2BF11FB4,
                
    0x95DBDA4D0xAE9091980xEAAD8E710x6B93D5A0,
                
    0xD08ED1D00xAFC725E00x8E3C5B2F0x8E7594B7,
                
    0x8FF6E2FB0xF2122B640x8888B8120x900DF01C,
                
    0x4FAD5EA00x688FC31C0xD1CFF1910xB3A8C1AD,
                
    0x2F2F22180xBE0E17770xEA752DFE0x8B021FA1,
                
    0xE5A0CC0F0xB56F74E80x18ACF3D60xCE89E299,
                
    0xB4A84FE00xFD13E0B70x7CC43B810xD2ADA8D9,
                
    0x165FA2660x809577050x93CC73140x211A1477,
                
    0xE6AD20650x77B5FA860xC75442F50xFB9D35CF,
                
    0xEBCDAF0C0x7B3E89A00xD6411BD30xAE1E7E49,
                
    0x00250E2D0x2071B35E0x226800BB0x57B8E0AF,
                
    0x2464369B0xF009B91E0x5563911D0x59DFA6AA,
                
    0x78C143890xD95A537F0x207D5BA20x02E5B9C5,
                
    0x832603760x6295CFA90x11C819680x4E734A41,
                
    0xB3472DCA0x7B14A94A0x1B5100520x9A532915,
                
    0xD60F573F0xBC9BC6E40x2B60A4760x81E67400,
                
    0x08BA6FB50x571BE91F0xF296EC6B0x2A0DD915,
                
    0xB66365210xE7B9F9B60xFF34052E0xC5855664,
                
    0x53B02D5D0xA99F8FA10x08BA47990x6E85076A);
       
        
    /* The number of rounds to do */
        
    var $_rounds 16;

        
    /* Constructor */
        
    function Cipher_blowfish($params null)
        {
        }

        
    /**
         * Set the key to be used for en/decryption
         *
         * @param String $key   The key to use
         */
        
    function setKey($key)
        {
            
    $key $this->_formatKey($key);
            
    $keyPos $keyXor 0;

            
    $iMax count($this->p);
            
    $keyLen count($key);
            for (
    $i 0$i $iMax$i++) {
                for (
    $t 0$t 4$t++) {
                    
    $keyXor = ($keyXor << 8) | (($key[$keyPos]) & 0x0ff);
                    if (++
    $keyPos == $keyLen) {
                        
    $keyPos 0;
                    }
                }
                
    $this->p[$i] = $this->p[$i] ^ $keyXor;
            }

            
    $encZero = array('L' => 0'R' => 0);
            for (
    $i 0$i $iMax$i += 2) {
              
    $encZero $this->_encryptBlock($encZero['L'], $encZero['R']);
              
    $this->p[$i] = $encZero['L'];
              
    $this->p[$i 1] = $encZero['R'];
            }

            
    $iMax count($this->s1);
            for (
    $i 0$i $iMax$i += 2) {
              
    $encZero $this->_encryptBlock($encZero['L'], $encZero['R']);
              
    $this->s1[$i] = $encZero['L'];
              
    $this->s1[$i 1] = $encZero['R'];
            }

            
    $iMax count($this->s2);
            for (
    $i 0$i $iMax$i += 2) {
              
    $encZero $this->_encryptBlock($encZero['L'], $encZero['R']);
              
    $this->s2[$i] = $encZero['L'];
              
    $this->s2[$i 1] = $encZero['R'];
            }

            
    $iMax count($this->s3);
            for (
    $i 0$i $iMax$i += 2) {
              
    $encZero $this->_encryptBlock($encZero['L'], $encZero['R']);
              
    $this->s3[$i] = $encZero['L'];
              
    $this->s3[$i 1] = $encZero['R'];
            }

            
    $iMax count($this->s4);
            for (
    $i 0$i $iMax$i += 2) {
              
    $encZero $this->_encryptBlock($encZero['L'], $encZero['R']);
              
    $this->s4[$i] = $encZero['L'];
              
    $this->s4[$i 1] = $encZero['R'];
            }

        }

        
    /**
         * Return the size of the blocks that this cipher needs
         *
         * @return Integer  The number of characters per block
         */
        
    function getBlockSize()
        {
            return 
    8;
        }

        
    /**
         * Encrypt a block on data.
         *
         * @param String $block         The data to encrypt
         * @param optional String $key  The key to use
         *
         * @return String the encrypted output
         */
        
    function encryptBlock($block$key null)
        {
            if (!
    is_null($key)) {
                
    $this->setKey($key);
            }

            list(
    $L$R) = array_values(unpack('N*'$block));
            
    $parts $this->_encryptBlock($L$R);
            return 
    pack("NN"$parts['L'], $parts['R']);
        }
        
        
    /**
         * Encrypt a block on data.
         *
         * @param String $L  The data to encrypt.
         * @param String $R  The data to encrypt.
         *
         * @return String  The encrypted output.
         */
        
    function _encryptBlock($L$R)
        {
            
    $L ^= $this->p[0];
            
    $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L 0x0ff]) ^ $this->p[1];
            
    $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R 0x0ff]) ^ $this->p[2];
            
    $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L 0x0ff]) ^ $this->p[3];
            
    $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R 0x0ff]) ^ $this->p[4];
            
    $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L 0x0ff]) ^ $this->p[5];
            
    $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R 0x0ff]) ^ $this->p[6];
            
    $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L 0x0ff]) ^ $this->p[7];
            
    $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R 0x0ff]) ^ $this->p[8];
            
    $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L 0x0ff]) ^ $this->p[9];
            
    $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R 0x0ff]) ^ $this->p[10];
            
    $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L 0x0ff]) ^ $this->p[11];
            
    $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R 0x0ff]) ^ $this->p[12];
            
    $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L 0x0ff]) ^ $this->p[13];
            
    $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R 0x0ff]) ^ $this->p[14];
            
    $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L 0x0ff]) ^ $this->p[15];
            
    $L ^= ((($this->s1[($R >> 24) & 0xFF] + $this->s2[($R >> 16) & 0x0ff]) ^ $this->s3[($R >> 8) & 0x0ff]) + $this->s4[$R 0x0ff]) ^ $this->p[16];
            
    $R ^= $this->p[17];

            return array(
    'L' => $R'R' => $L);
        } 
    e una cosetta che mi hanno passato, però vorrei esser sicuro se fa al caso mio, cosa ne pensi?
    Naturalmente e solo un piccola parte di codice, non ci sta tutto purtroppo

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.