Heh, just for the record, the arguments were reversed:
ConnectionManager::alias('admin', 'default'); ($from, $to)
i'm sure you were just making sure i'm paying attention. ;-)
It's working. Very grateful for the help.
-joe
On Monday, 3 November 2014 04:02:00 UTC-5, José Lorenzo wrote:
>
> In you
In your controller under the admin namespace do:
public function beforeFilter() {
parent::beforeFilter();
\Cake\Datasource\ConnectionManager::alias('default', 'admin');
}
On Sunday, November 2, 2014 4:44:16 PM UTC+1, Joe Theuerkauf wrote:
>
> Sorry, what i meant was, i don't plan to use defau
Sorry, what i meant was, i don't plan to use defaultConnectionName the same
WAY i was using it for the Captcha question. If it's a legit option, i'll
use it, but i see your point about not using defaultConnectionName AND a
connection alias.
On Sunday, 2 November 2014 10:40:20 UTC-5, Joe Theuerk
Thanks for that tip, Mark. i don't plan to use defaultConnectionName in
this scenario (as i did for the Captcha thread where the table i needed is
in a different database).
i can see where aliasing the connection will make it hard to access the
original connection. Which is why i asked for som
If you alias connections you don't need to use defaultConnectionName().
Aliasing the connection makes it much harder to access the regular default
connection as whenever you ask for it you get the admin connection instead.
-mark
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us o
Thanks for the idea José. Could you elaborate a little on usage? The API
explains how it works, but i'm fuzzy on *where* to use it. Doesn't looks
like it's mentioned in the Cookbook.
As a basic example, if i have these controllers:
*/App/Controller/AboutController*
- public Controller that conn
The easiest way is to alias the connection:
\Cake\Datasource\ConnectionManager::alias('default', 'admin');
What it does is that, when a table is created instead of passing the
default connection it will pass the admin one.
On Friday, October 31, 2014 1:42:42 AM UTC+1, Joe Theuerkauf wrote:
>
>
Correct. When the Admin is logged in to that part of the site, the
connection with the elevated account would be used for all requests so data
edits can be performed. For the general user, the restricted connection
would be used, where data edits aren't permitted (with limited exceptions
grante
Let me see if I understood correctly: For certain admin actions you want to
use the admin connection instead of default for ALL tables used in that
request?
On Thursday, October 30, 2014 4:25:30 AM UTC+1, Joe Theuerkauf wrote:
>
> i may be overthinking this - if so, tell me.
>
> i'd like to have
i may be overthinking this - if so, tell me.
i'd like to have a DB config for the general website user, who needs only
SELECT for most things, and a separate config for the Admin side of the
site where other privileges are needed.
Since *defaultConnectionName* returns which config to use, is it
10 matches
Mail list logo