Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Tech > [WEB] Immagini e password
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
Hamelin
.pifferaio.magico.

User info:
Registered: Feb 2003
Posts: 662 (0.08 al dì)
Location: ..tra i monti intorno ad Hamelin..
Corso: Ingegneria Informatica
Anno:
Time Online: 7 Days, 7:19:55 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[WEB] Immagini e password

Ho protetto alcune pagine del mio sito con una password (tramite un paio di righe in php)... per rendere private delle fotogallery... ora, il mio problema è: come faccio ad impedire che qualcuno, conoscendo il percorso esatto dell'immagine sul server, la possa vedere comunque, infischiandosene della password??

__________________
Bjarne Stroustrup: "I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone."
Andrew S. Tanenbaum: "Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway."
Edsger Dijkstra: "Computer Science is no more about computers than astronomy is about telescopes."
Robert Firth: "One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs."
Donald Knuth: "A mathematical formula should never be 'owned' by anybody! Mathematics belong to God."

03-04-2004 18:23
Click Here to See the Profile for Hamelin Click here to Send Hamelin a Private Message Visit Hamelin's homepage! Find more posts by Hamelin Add Hamelin to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
0m4r
.grande:maestro.

User info:
Registered: Mar 2002
Posts: 7287 (0.84 al dì)
Location: Düsseldorf (DE)
Corso:
Anno: ESAMI FINITI
Time Online: 49 Days, 0:57:33 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

non so come funzioni php, ma credo tu debba usare le sessioni.
Piu o meno il procedimento potrebbe essere questo:
nella pagina di login fai inserire usr e pwd, se sonoi corrette memorizzi nella variabile di sessione che l'utente è loggato. A questo punto, in ogni nuva pagina in cui l'utente si dirigerà dovrai fare un controllo che verifichi se la variabile di sessione è valida oppure no, se non lo è neghi l'accesso altrimenti lasci che tutto funzioni...non sono stato chiarissimo nè?

__________________
http://www.twitter.com/0m4r

03-04-2004 19:05
Click Here to See the Profile for 0m4r Click Here to See the Blog of 0m4r Click here to Send 0m4r a Private Message Find more posts by 0m4r Add 0m4r to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
unidavide
.arcimaestro.

User info:
Registered: Nov 2002
Posts: 373 (0.04 al dì)
Location:
Corso:
Anno:
Time Online: 11 Days, 19:48:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by 0m4r
non so come funzioni php, ma credo tu debba usare le sessioni.
Piu o meno il procedimento potrebbe essere questo:
nella pagina di login fai inserire usr e pwd, se sonoi corrette memorizzi nella variabile di sessione che l'utente è loggato. A questo punto, in ogni nuva pagina in cui l'utente si dirigerà dovrai fare un controllo che verifichi se la variabile di sessione è valida oppure no, se non lo è neghi l'accesso altrimenti lasci che tutto funzioni...non sono stato chiarissimo nè?
non penso che questa soluzione funzioni, se uno sa cmq l'indirizzo dell'immagine riesce a vederela lo stesso, una soluzione che mi viene in mente è questa:
metti le immagine in una directory che non sta sotto la document_root o che cmq l'accesso sia negato con
Deny from all
dopo fai un file php a cui passi il nome dell'immagine

visualizza.php?img=foto.jpg
con dentro:

header('Content-type: image/jpg');
readfile('PERCORSO FILE SYSTEM'.$_GET['img']);

piu o meno dovrebbe essere cosi, in questo modo è php che prende l'immagine dalla cartella a cui uno non ha accesso e la manda in output

magari c'è anche una soluzione piu semplice

03-04-2004 19:17
Click Here to See the Profile for unidavide Click here to Send unidavide a Private Message Find more posts by unidavide Add unidavide to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
recoil
dsy adminz

User info:
Registered: Mar 2002
Posts: 4454 (0.51 al dì)
Location: Milano / Erba
Corso: TICOM
Anno: laureato
Time Online: 61 Days, 16:17:45 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

puoi sempre mettere l'immagine in un DB in modo che non esista proprio il percorso

non so quanto sia buona sta idea però...

03-04-2004 19:33
Click Here to See the Profile for recoil Click here to Send recoil a Private Message Visit recoil's homepage! Find more posts by recoil Add recoil to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Rocco.Li
38 Primavere, Dottore !

User info:
Registered: Sep 2003
Posts: 609 (0.07 al dì)
Location: BARLASSINA (MI)
Corso: COMUNICAZIONE DIGITALE
Anno: Finitooooo !!!!
Time Online: 8 Days, 2:31:26 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

La soluzione di Unidavide e' la soluzione piu' semplice, la pagina PHP/ASP/JSP (come vuoi) verifica la validita' della variabile di sessione impostata al login, visualizzando l'immagine (ergo genera uno stream http verso il client dell'immagine letta da disco) oppure reindirizza l'utente verso una pagina di errore.

nelle pagine che hanno il tag img dovrai inserire:

<img src="getimage.asp?file=pippo.jpg" />

ovvero non il percorso assoluto dell'immagine ma il richiamo alla pagina di visualizzazione.

__________________
Alcuni uomini vedono le cose come sono e dicono: << Perche' ? >>
Io sogno le cose come non sono mai state e dico: << Perche' No ? >>
George Barnard Shaw, Commediografo.

"non preoccuparti troppo, comunque vada la vita, non ne uscirai vivo !" - anonimo

03-04-2004 21:47
Click Here to See the Profile for Rocco.Li Click Here to See the Blog of Rocco.Li Click here to Send Rocco.Li a Private Message Find more posts by Rocco.Li Add Rocco.Li to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
mrcnet
dsy developer

User info:
Registered: Oct 2002
Posts: 1160 (0.14 al dì)
Location: Milano
Corso: Comunicazione Digitale
Anno:
Time Online: 9 Days, 5:44:55 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by recoil
puoi sempre mettere l'immagine in un DB in modo che non esista proprio il percorso

non so quanto sia buona sta idea però...


esatto.. l'idea diventa buona nel momento in cui encodizzi l'immagine e la richiami da database.. poi dipende anche da che immagini sono.. altrimenti la soluzione piu semplice in questi casi è far stampare in automatico il tuo logo sull'immagine

__________________
www.mrcnetwork.it

05-04-2004 08:35
Click Here to See the Profile for mrcnet Click Here to See the Blog of mrcnet Click here to Send mrcnet a Private Message Visit mrcnet's homepage! Find more posts by mrcnet Add mrcnet to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Hamelin
.pifferaio.magico.

User info:
Registered: Feb 2003
Posts: 662 (0.08 al dì)
Location: ..tra i monti intorno ad Hamelin..
Corso: Ingegneria Informatica
Anno:
Time Online: 7 Days, 7:19:55 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Grazie dell'aiuto... domandina da ignorante: come faccio a vietare l'accesso ad una cartella (il "deny from all" di cui parla unidavide)?

Grazie a tutti!

__________________
Bjarne Stroustrup: "I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone."
Andrew S. Tanenbaum: "Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway."
Edsger Dijkstra: "Computer Science is no more about computers than astronomy is about telescopes."
Robert Firth: "One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs."
Donald Knuth: "A mathematical formula should never be 'owned' by anybody! Mathematics belong to God."

05-04-2004 10:32
Click Here to See the Profile for Hamelin Click here to Send Hamelin a Private Message Visit Hamelin's homepage! Find more posts by Hamelin Add Hamelin to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
DeepBlue
tired guy

User info:
Registered: Sep 2003
Posts: 4258 (0.52 al dì)
Location: CSN
Corso: Info tlc
Anno:
Time Online: 52 Days, 8:40:31 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

con .htaccess :)

__________________
~ get Debian! ~ get FreeBSD! ~ get OpenBSD! ~

05-04-2004 11:17
Click Here to See the Profile for DeepBlue Click Here to See the Blog of DeepBlue Click here to Send DeepBlue a Private Message Find more posts by DeepBlue Add DeepBlue to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Hamelin
.pifferaio.magico.

User info:
Registered: Feb 2003
Posts: 662 (0.08 al dì)
Location: ..tra i monti intorno ad Hamelin..
Corso: Ingegneria Informatica
Anno:
Time Online: 7 Days, 7:19:55 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

...mi sento sempre più ignorante...

Sarebbe a dire?

__________________
Bjarne Stroustrup: "I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone."
Andrew S. Tanenbaum: "Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway."
Edsger Dijkstra: "Computer Science is no more about computers than astronomy is about telescopes."
Robert Firth: "One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs."
Donald Knuth: "A mathematical formula should never be 'owned' by anybody! Mathematics belong to God."

05-04-2004 21:34
Click Here to See the Profile for Hamelin Click here to Send Hamelin a Private Message Visit Hamelin's homepage! Find more posts by Hamelin Add Hamelin to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
unidavide
.arcimaestro.

User info:
Registered: Nov 2002
Posts: 373 (0.04 al dì)
Location:
Corso:
Anno:
Time Online: 11 Days, 19:48:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by Hamelin
...mi sento sempre più ignorante...

Sarebbe a dire?
devi creare un file di testo nella cartella dove ci sono le immagine che si deve chiamare .htaccess e dentro ci devi scrivere
Deny from all

prova a entrare in quella cartella e ti dovrebbe dare un errore dicendo che non hai i permessi, funziona solo se apache è stato configurato per considerare i file .htaccess presenti nelle directory

05-04-2004 22:22
Click Here to See the Profile for unidavide Click here to Send unidavide a Private Message Find more posts by unidavide Add unidavide to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Renaulto
is fan of UTF-8

User info:
Registered: Aug 2002
Posts: 4064 (0.47 al dì)
Location:
Corso: Informatica
Anno:
Time Online: 96 Days, 0:23:57 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

http://httpd.apache.org/docs/howto/htaccess.html

06-04-2004 00:22
Click Here to See the Profile for Renaulto Click Here to See the Blog of Renaulto Click here to Send Renaulto a Private Message Find more posts by Renaulto Add Renaulto to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 19:29.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.085 seconds (58.03% PHP - 41.97% MySQL) con 25 query.