Re: MySQL and Dokuwiki
M. Sabath <msabath <at> gmx.de>
2010-02-01 15:08:04 GMT
Am Donnerstag, den 28.01.2010, 10:51 +0100 schrieb M. Sabath:
> Am Donnerstag, den 17.12.2009, 11:23 +0100 schrieb Matthias Grimm:
> > On Wed, 16 Dec 2009 04:28:35 +0100
> > "M. Sabath" <msabath <at> gmx.de> wrote:
> >
> > Hi Markus,
> >
> > > table name is "egw_adrress"
> > > an the
> > > column name is "subject"
> > >
> > > How do I ask mysql for the information?#
> >
> > To get a link from the "subject" to your user you need a reference from one table to the other.
> > This is a commin field like username or something similar.
> >
> > Here is the SQL statement:
> > $conf['auth']['mysql']['getGroups'] = "SELECT subject as `group`
> > FROM egw_address g, egw_accounts u
> > WHERE u.account_id = g.account_id
> > AND u.account_id='%{user}'";
> >
> > The statement does the following:
> > The result of the statement is a table which contains the field "subject" named as "group".
> > The data came from the two tables "egw_address" and "egw_accounts". For both tables
> > aliases were set ("g" and "u") to make life easier. Now comes the tricky part. We have to tell
> > MySQL how the two tables are connected; which row in egw_address belongs to which
> > row in egw_accounts. I assumed that the column "account_id" exists in both tables. Keep
> > in mind that this relation must not be unique. A row in "egw_accounts" may have multiple
> > counterparts in "egw_address", but this depends on the dabase design.
> > Last but not least we have to make shure that obly groups that belong to our user will be
> > returned, so we add a condition to check that to the WHERE statement.
> >
> > I hope my explanation will help you to play a bit with the statement and find one that works
> > for you. I could only provide a full statement, if I knew the complete database model.
> >
> > Best Regards
> > Matthias
>
>
> Hello Matthias,
>
> thank your for your time and advice.
> I had to adjust it a little bit.
>
>
> > I assumed that the column "account_id" exists in both tables.
> The columns have different names.
>
> Markus
>
>
this is my again,
it doesn't work as I thought.
The two tables aren't related.
-------------------------
My goal is, that every user in the table "egw_accounts" is allowed to
see and edit the dokuwiki pages. All others aren't allowed to see and
edit pages.
The table "egw_accounts" has no column where I could put in the entry
"user". All it has is a column "primary_group" with the entry "u" for
all users.
Here is my question:
* Is there a mysql statement which makes "user" out of the "u" while
questioning the database.
or
* Cant't every user in the table be a member of the group "user" by
default without checking?
Thank you
Markus
--
--
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist