Just a though hit my mind about having $pma_usr_prefs = new PMA_PermUsrPref(); in common.lib.php.  I am wondering may be it should be declared as a global var.

--------------------------------------------------
Best regards,
Zeeshan Mughal
Email:  zeeshanmughal@ieee.org
Web:  http://www.zixan.info


On Wed, Aug 12, 2009 at 2:12 AM, Zeeshan M. <zeeshan.jp@gmail.com> wrote:
Hi,

>permUsrPref.table should not be hardcoded, but configurable

I think we discussed this a long time back. [0]  I suppose EAV model had "design flaws" as suggested by Marc Delisle, and other developers.  Please correct me if I am wrong, or you are referring to something else by "configurable".

>permUsrPref class should be named PMA_PermUsrPref and it should be
>defined in libraries/PermUsrPref.class.php

done

>You should really use PMA_query_as_controluser

I can use PMA_query_as_controluser for UPDATE query.  But when I use it for SELECT I get errors. [1]  Following line of code demonstrates how I am implementing PMA_query_as_controluser

return PMA_DBI_fetch_result(PMA_query_as_controluser($sql));

I have also commented out implementation of PMA_query_as_controluser in ./libraries/PermUsrPreg.class.php just in case if you were interested in seeing.


>You copy the same code to several places, it should be rather single
>include which would provide all what is needed to access preferences.

I created a function in ./libraries/common.lib.php to include common files.  Please let me know if there are further improvements you can suggest on this issue.

I also tried to include:

/*
* Creates a $pma_usr_prefs pointer
*/
$pma_usr_prefs = new PMA_PermUsrPref();

but it seems it is not being recognized as an object because of being remotely included in a standalone function:
Fatal error: Call to a member function fetchSettingValue() on a non-object

>All I can say is that is really not
>something what looks like finished and cleaned up work. And it is
>definitely not ready for inclusion.

Well, that is why I need feedback from phpMyAdmin gurus (like you) so I can fix such problems (sometimes lame) before the code is committed. :-)

You can download the revision through tracker.


Thanks so much for you help!  I highly appreciate your time and dedication. :-)

[0] http://www.nabble.com/about-choosing-table-layout-for-pmadb-td23879613.html
[1] http://zixan.info/pma/pma_error.html.0-dev
--------------------------------------------------
Best regards,
Zeeshan Mughal
Email: zeeshanmughal@ieee.org
Web: http://www.zixan.info


On Tue, Aug 11, 2009 at 5:07 PM, Michal Čihař <michal@cihar.com> wrote:
>
> Dne Tue, 11 Aug 2009 12:57:40 -0400
> "Zeeshan M." <zeeshan.jp@gmail.com> napsal(a):
>
> > > * @TODO Figure out why SQL queries do not give proper results
> > >- this means that your code does not work?
> >
> > This is actually very old. So, please ignore it.
>
> Well I don't care whether it is old or not. It is in thing which you
> have called "final revision". All I can say is that is really not
> something what looks like finished and cleaned up work. And it is
> definitely not ready for inclusion.
>
> --
> Michal Čihař | http://cihar.com | http://phpmyadmin.cz
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Phpmyadmin-devel mailing list
> Phpmyadmin-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
>