Home › Forum › Problemi Vari con WP › Prima pagina
-
AutorePost
-
-
9 Novembre 2011 alle 15:05 #19695xdaniel2Partecipante
Salve a tutti,
ho un problema con WordPress.
In particolare io devo creare un sito di autenticazione radius in wordpress.
Il mio problema in questo momento e che ho creato l’interazione tra form e database, quindi riesco ad aggiungere nuovi utenti alla tabella wp_users, ma quando esco dal utente admin e cerco di entrare in un altro utente creato attraverso le form non mi riconosce la password.
E andando a vedere nel database la password dell’utente creato tramite form è “in chiaro” mentre quella del mio admin o di un altro utente creato attraverso la voce aggiungi utente e scritta in modo criptato cioè di questo tipo $P$BWAgw……………..LdOD/.
Inoltre vorrei cambiare anche la prima pagina, ma non capisco perche come pagina statica mi esce solo ma pagina che ho creato Registra, quando c’è anche la pagina “di base” Home!
Ringrazio tutti anticipatamente
-
9 Novembre 2011 alle 15:07 #89656xdaniel2Partecipante
Aggiungo che cerco di accedere all’utente creato attraverso la pagina wp-login.php, cioè la mia schermata principale quando non sono loggaato come admin!!!!
-
9 Novembre 2011 alle 15:11 #89657SteveAglAmministratore del forum
e come li aggiungi gli utenti? Non dirmi che lo fai mettendo i dati direttamente nel DB e nel caso che non hai guardato proprio come è fatto il db vero?
-
9 Novembre 2011 alle 15:22 #89658xdaniel2Partecipante
Per quanto riguarda la prima pagina ho risolto andando in impostazione e cambiando il link sel sito, in pratica ho aggiunto al sito uno “/” cosi anche se non si è loggati la prima pagina sarà sempre la home.
Gli utenti li aggiungo attraverso una pagina “Registrazione” che compilando i form richiama una pagina php che si connette prima al DB e poi fa l’inserimento, solo che per quanto riguarda le password ti ripeto se le inserisco in questo modo, se poi vado a controllare “a mano” nel database vedo che il campo password e in chiaro, nel senso se avevo inserito PIPPO (ovviamente coperto dagli asterischi) nella form, ora leggo PIPPO nel DB. Mentre se un utente lo avevo inserito tramite DB diretto la password mi esce in quel formato criptato.
Ho visto come è fatto il database, acneh xke altrimento non potevo fare l’inserimento tramite form e pagina php!
-
9 Novembre 2011 alle 15:31 #89659SteveAglAmministratore del forum
Inseriscilo nel DB usando le funzionalità di WordPress in maniera tale da creare l’utente correttamente… ad esempio le password di WP NON vengono salvate mai ma ne viene salvato un hashing salato… quindi non sono criptate ma non ci sono proprio…
-
9 Novembre 2011 alle 15:36 #89660xdaniel2Partecipante
Bhe il problema e che devo farlo non utilizzando wordpress…anche perche poi la password mi servirebbe piu avanti per effettuare l’autenticazione Radius, a questo punto mi conviene girare il problema e come ho fatto una pagina per la registrazione faccio anche una pagina per il login, ti sembra giusta come idea?
In tal caso conosci qualche guida per leggere i dati dal db e quindi logarmi? Cosi posso spostare anche i dati in un’altra tabella creata ad hoc per questa registrazione/login.
Cmq grazie mille !
-
9 Novembre 2011 alle 15:54 #89661SteveAglAmministratore del forum
No perchè non ho capito cosa vuoi fare se l’autenticazione la devi fare su WP devi usare le funzioni di WP creando ad esempio una pagina WP con un template di pagina che riceva dati in POST ad esempio verifichi se la login è corretta e restituisca true o false nel caso. Se vuoi usare un altro DB per l’autenticazione e far si che WP usi quello c’è un plugin http://wordpress.org/extend/plugins/external-database-authentication/ che verifica la login remota e se ok crea pure se serve l’utente WP (che serve poi ad uso interno).
Le password sono salvate in hashing MD5 ma poi anche salate per evitare attacchi tipo rainbow table… non esiste uan documentazione passo passo della funzione di hashing di WP devi studiarti il codice… che poi potrebbe pure cambiare come metodo di salatura etc col tempo ergo occorre una soluzione che utilizzi nell’interazione e verifica DB SOLO le funzioni di WP.
Ovviamente se salvi le pswd in chiaro nel DB e provi ad autenticarti su WP lui prende la tua password ne fa l’hashing etc e fa un semplice confronto col valore memorizzato.. che ovviamente essendo in chiaro NON matcherà mai
-
9 Novembre 2011 alle 16:14 #89665xdaniel2Partecipante
Ho capito,
quindi in pratica posso fare cosà¬:
– in una pagina di WP (la chiama Registrazione)inserisco questo codice:
<form method="post" action="registrazioni/registra_utente.php">
<p style="text-align: left;">Username: <input name="uuname" type="text" /></p>
<p style="text-align: left;">Password: <input name="password" type="password" /></p>
<p style="text-align: left;">E-mail: <input name="email" type="text" /></p>
<p style="text-align: left;">Nome visualizzato: <input name="dname" type="text" /></p>
<input name="submit" type="submit" value="Registra">
<input type="reset" name="Submit" value="Reset">
</form>
Successivamente inserisco un plug-in, la mia domanda e quindi esiste un plugin con aggangio al tasto 'submit'. In questo modo effettuo una registrazione attraverso i moduli di wordpress e posso riutilizzare anche il login di WP stesso. Solo che non mi trovo perche non so cosa dichiare al posto di:
<form method="post" action="registrazioni/registra_utente.php">
E come poi una volta dichiarato l'aggangio nel plugin va scritta qualche altra cosa nella pagina di Registrazione di WP, anche perche nn ho capito bene come un plugin si riferisce a una pagine/action.
Grazie ancora e perdona la mia inesperienza! -
9 Novembre 2011 alle 16:20 #89666SteveAglAmministratore del forum
altre ricerche simili su ggooel ti daranno le info che cerchi ci sono plugin per fare quel che vuoi senza fare codice tuo da zero…
http://www.netchillies.com/frontend-membership/
costa poco e fa quel che ti serve.. se no si trovan altre cose anche free nel repository… la domanda che mi viene però è:
Perchè fate applicazioni con cose che non conoscete (WP) per usi professionali?
-
9 Novembre 2011 alle 16:30 #89667xdaniel2Partecipante
Non è per usi professionali ma per usi didattici, il mio progetto deve essere sviluppato in WP e credo che il prof voglia farci scrivere quanto più codice a mano,
cmq ho trovato anche una funzione per trasformare la password in hash ora la provo spero che basterà per avere almeno una corrispondenza quando dopo andrò a fare il login attraverso WP.
La funzione si chiama proprio md5.(http://it2.php.net/md5).
Non so davvero come ringraziarti, inoltre questo è solo l’inzio poi dopo si va nella parte complicata visto che per quanto riguarda l’autenticazione Radius nn ho trovato molto in rete c’è qualcosa in inglese ma per il resto ancora niente.
-
9 Novembre 2011 alle 16:56 #89669xdaniel2Partecipante
La funzione md5 funziona solo nonostante abbia inserito tutti i privilegi mi dice che nn ho abbastanza permessi per accedere alla pagina :S
In pratica perche l’utente registrato non gli è stato assegnato nessun ruolo, eppure in impostazione->generale e selezionato chiunque può iscriversi e come ruolo base ho assegnato il sottoscrittore bah :S!!!
-
9 Novembre 2011 alle 17:24 #89671SteveAglAmministratore del forum
Perchè RIPETO NON BASTA METTERE I DATI NEL DB… visto che è per studio guarda il codice di WP cerca le funzioni adatte e studiale… codex.wordpress.org come riferimento
-
11 Novembre 2011 alle 9:51 #89705xdaniel2Partecipante
Grazie mille!
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.