It pertains to J1.5 and concerns a common issue, access control.
Setting the scene...
Assuming I already have a means to classifying users according to
which I want to control access to articles, it's easy enough to write
a plugin that stops content being accessed when it's being loaded. If
we take an article as an example, the problem is in the many ways an
article makes its appearance in search results, category and section
layouts and all manner of modules: the title and/or intro text is
still visible even though the plugin would prevent access to the full
article. Writing a further check into template overrides is not an
option because it doesn't cover all bases and would mess with page
result numbering.
My thinking...
The one thing everything has in common is setQuery. If I can override
the setQuery function and adjust queries to include access checks in
the where clause then prehaps I have a solution. I realise adjusting
queries will pose it's own technical challenge and complexities but
before I consider that I'd first like to know if it's possible to
override the setQuery function.
What I'm thinking is a plugin that loads a JDatabaseExteded class that
extends JDatabase and then overrides what is returned by
JFactory::getDBO() after it has initial been set.
Possible? Workable?
basicly I think it is possible. Two problems come in my mind:
1) Conflicts with Joomfish. Joomfish goes on the way you have mention.
2) Performance. You need some regexp to make it possible and you are
in an area that is often used. So if you code is not very good you can
make a site very slow.
Robert
I did the exact samething for several sites in the past that had
either massive scale or deep customization needs. Instead of a plugin
though I just copied mysqli.php to mysqlie.php (Mysqli-Extended! hehe)
and went from there. This is also how I managed to build my own
master-slave functionality as stock Joomla only has one connection.
Agreed you will need to be careful with your code, as performance is
only one of your issues ;-)
-- Mitch
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.
> Hi,
>
> basicly I think it is possible. Two problems come in my mind:
>
> 1) Conflicts with Joomfish. Joomfish goes on the way you have mention.
Joomfish does the same kind of aggregation that the normal Joomla JDatabase class does. So in the case you have a special driver it should be possible to add a simple wrapper in Joomfish as well and then use your driver too.
In general if we separated JDatabase from the real database drivers which again inherit JDatabase and use it more like a concept that is used by JDBC we could simplify these issues quite a lot. But I think this is a different discussion.
Alex