[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Tabella msql e interfaccia web



Leonardo Boselli wrote:
Problema : ho un archivio myql.
Tramite interfaccia web posso leggerlo.
il problema quale è ?
ci debbono essere tre gruppi di utenti:
A , B e C
I fati possono essere inseriti solo dal gruppo B con una particolarità: 
ogni record deve portare un campo con lo username di chi ha inserito.
Solo chi ha inserito potrà modificare.
IL gruppo C è la interfaccia web che puo' solo leggere.
Gli utenti del gruppo A possono invece agire come qualunque utente (quindi
modificare qualunque record)
C'è un esempio già pronto di una interfaccia del genere ?
  
phpmysql? ci sta anche il package aggiornato sotto sarge.
tramite interfaccia web puoi vedere tranquillamente il db e come root modifichi i permessi sulle tabelle facendo un fine-grain su ogni utente.
se dai un'occhio alla documentazioen mysql su www.mysql.com vedi subito come esiste una funzione che si chiama
CURRENT_USER()
Returns the username and hostname combination that the current session was authenticated as. This value corresponds to the MySQL account that determines your access privileges. It can be different from the value of USER().
mysql> SELECT USER();
        -> 'davida@localhost'
mysql> SELECT * FROM mysql.user;
ERROR 1044: Access denied for user ''@'localhost' to
database 'mysql'
mysql> SELECT CURRENT_USER();
        -> '@localhost'
    
The example illustrates that although the client specified a username of davida (as indicated by the value of the USER() function), the server authenticated the client using an anonymous user account (as seen by the empty username part of the CURRENT_USER() value). One way this might occur is that there is no account listed in the grant tables for davida. CURRENT_USER() was added in MySQL 4.0.6.

quindi ti è abbastanza facile impostare questa feature usando phpmyadmin, comunque non ti tolgo il divertimento!
dagli uno sguardo.
ciao fabrizio


Reply to: