Home › Forum › Plugin e temi di WP › Ottenere la password dell'utente
-
AutorePost
-
-
11 Agosto 2011 alle 16:02 #18845dariodn81Partecipante
Prima che mi rispondiate che potrebbe essere illegale o quantomeno poco lecito, lasciatemi spiegare
Sto usando lo script FPDI che mi consente di prendere un file pdf e convertirlo in un pdf protetto da password. Bene, come faccio a fare in modo che la password sia la stessa che l’utente usa per loggarsi in WordPress?
Chiaramente, se faccio un $current_user->user_pass mi stampa la password criptata in MD5 che, altrettanto chiaramente, non posso settare come password del pdf (perché l’utente non la saprà mai né potrà mai ricordarsela in formato criptato).
Io non intendo vedere la password ma solo associarla ad una nuova variabile che poi imposterò come password del documento pdf.
Qualche aiuto o suggerimento?
Grazie
-
11 Agosto 2011 alle 16:18 #87476wollyAmministratore del forum
non è possibile decodificare le pwd di wordpress, non sono solo HASH in MD5 ma, vengono anche salate con diverse chiavi di salatura.
-
12 Agosto 2011 alle 10:39 #87497dariodn81Partecipante
capisco. immaginavo, però, che potesse essere integrata o richiamata la stessa procedura che fa l’utente quando si logga: quando inseriamo la password nel campo di login WP la confronta con quella immagazzinata nel database. Immagino, quindi, che lui prenda la password appena inserita dall’utente, la converte e la hasha in MD5 e la confronta con quanto è memorizzato nel database.
Ora mi rendo conto che questa procedura viene fatta a livello di php mentre nel mio caso dovrebbe farla il documento pdf (che credo non possa in alcun modo fare).
Però una procedura di qualche tipo (pur non basata su WP) dovrebbe esserci visto che, per esempio, Repubblica offre i pdf del proprio giornale agli abbonati secondo questa procedura.
Se avete altre consigli sono ben accetti, grazie
-
12 Agosto 2011 alle 15:36 #87513zhenyaPartecipante
Lasci perdere questo meccanismo, per metterlo in pratica dovresti rendere vulnerabile l’installazione togliendo parte delle apposite secret-key nel file wp-config.php.
Installi il plugin wp-downloadmanager, i file .pdf li pubblichi prelevabili solo da chi sarà loggato oppure, in alternativa, da coloro che possiedono la password per scaricarlo.
-
12 Agosto 2011 alle 16:52 #87521dariodn81Partecipante
@zhenya, ti ringrazio per la risposta. Ovviamente non avevo intenzione di andare ad intaccare i protocolli di sicurezza di WP. Cercavo solo di riutilizzarli.
Per quanto consigli tu, a quel punto, non ha proprio senso installare alcun plugin. Basta mettere una password predefinita al file e comunicarla solo agli utenti.
Quel che volevo scoraggiare era la redistribuzione del file (sicuramente io posso comunque condividerlo dando la mia password ma, reputo, dimuniscono le probabilità che ciò accada).
A parte ciò, c’era sempre di base il tentativo di imparare a fare qualcosa di nuovo con WP
-
12 Agosto 2011 alle 16:58 #87523dariodn81Partecipante
Aggiungo una piccola correzione a quanto avevo scritto prima. Il sistema di Repubblica utilizza l’username dell’utente come password del PDF e non la password per accedere all’area abbonati. Personalmente la trovo una cosa “sconvolgente” poiché l’username non è un numero ma una forma nome.cognome che, in teoria, chiunque può ottenere…
senz’altro potrei utilizzare anche io il nickname, che l’utente può cambiare, e non l’username che invece non è modificabile dall’utente. Nel sito sul quale sto lavorando gli utenti sono mostrati con l’username e quindi non dovrebbe essere possibile risalire, per gli altri utenti, ai nickname.
-
12 Agosto 2011 alle 18:11 #87524zhenyaPartecipante
In rete trovi decine di modi per aprire un file .pdf protetto da password. Idem con quelli .zip, ad esempio con 7-Zip la password neanche te la chiede.. Se il documento deve essere non distribuibile si potrebbe crearlo in modo che dopo un paio di aperture si autodistrugge; ma anche cosଠgli utenti imparerebbero e, se gli interessa il contenuto, al prossimo che scaricano farebbero una copia prima dell’autodistruzione..
-
16 Agosto 2011 alle 12:11 #87570rcondorPartecipante
‘ Idem con quelli .zip, ad esempio con 7-Zip la password neanche te la chiede.’
Non credo proprio….. Se apri il file con 7-zip non vedi elementi con l’asterisco, ma se provi a scompattarlo, te la chiede … eccome!!!!
-
16 Agosto 2011 alle 13:13 #87573HotWutPartecipante
Fai vari livelli per utente
ex: membro iscritto ha accesso ai download. visitatore solo agli articoli. ecc
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.