# |
Jan 22nd 2017, 17:14 |
al_x_mq |
want to build a game schedule |
# |
Jan 22nd 2017, 17:14 |
al_x_mq |
example. |
# |
Jan 22nd 2017, 17:14 |
al_x_mq |
how can i connect 2 tables, over a field, that is not fitting the convention? |
# |
Jan 22nd 2017, 16:18 |
slackebot |
Action: admad hands hmic some calming down juice |
# |
Jan 22nd 2017, 16:16 |
hmic |
throws his hands up *shudders* |
# |
Jan 22nd 2017, 16:14 |
hmic |
and please upgrade to a recent 2.x release, *now* |
# |
Jan 22nd 2017, 16:14 |
admad |
*your |
# |
Jan 22nd 2017, 16:13 |
admad |
just update you js code accordingly and you won't have to much around with the controller code |
# |
Jan 22nd 2017, 16:13 |
hmic |
like admad said. you don't pass anything to login(), if you want the login data beeing checked, make sure your post data is correct rather, as that is what the login checks on a form auth |
# |
Jan 22nd 2017, 16:13 |
admad |
set `$this->request->data['User']['email']` and similarly password and call ->login() without params |
# |
Jan 22nd 2017, 16:12 |
hmic |
https://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#identifying-users-and-logging-them-in, scroll down to the red box and read carefully |
# |
Jan 22nd 2017, 16:12 |
hmic |
but there is no excuse to sticking with a totally outdaed 2.x! |
# |
Jan 22nd 2017, 16:11 |
hmic |
not upgrading to 3.x might be a thing |
# |
Jan 22nd 2017, 16:11 |
hmic |
oh man |
# |
Jan 22nd 2017, 16:11 |
execv |
2.3.3 |
# |
Jan 22nd 2017, 16:10 |
execv |
I have the same result if I don’t pass anything to Auth->login() |
# |
Jan 22nd 2017, 16:10 |
admad |
what version of cake are you using? |
# |
Jan 22nd 2017, 16:10 |
admad |
if you do that the params will be just set to session, no db check will be done |
# |
Jan 22nd 2017, 16:09 |
admad |
don't pass anything to login |
# |
Jan 22nd 2017, 16:09 |
execv |
Nevermind. Auth->user() isn’t empty, but it’s the array I am passing to login |
# |
Jan 22nd 2017, 16:08 |
execv |
Auth Setup: http://pastebin.com/55xgXNkX |
# |
Jan 22nd 2017, 16:08 |
execv |
I’m not starting a new app. I’m just adding an ajax login to an existing one. The current login() function is working perfectly |
# |
Jan 22nd 2017, 16:07 |
hmic |
additionally, why do you start out a new app on 2.x still? |
# |
Jan 22nd 2017, 16:07 |
hmic |
you do actually very likely need to show your auth setup |
# |
Jan 22nd 2017, 16:07 |
execv |
It’s empty |
# |
Jan 22nd 2017, 16:07 |
hmic |
execv, try debuggin Auth->user() instead, whats in? |
# |
Jan 22nd 2017, 15:59 |
execv |
Any help as to why this isn’t working? http://pastebin.com/fSvUiZ2W I am trying to log a user in using AJAX. Regardless of what I send as the username and password, this->Auth->login() always returns true, but never with a UID. |
# |
Jan 22nd 2017, 15:46 |
hmic |
just use the proper function for the task: array_key_exists |
# |
Jan 22nd 2017, 15:45 |
thinkingmedia |
Just got hit by the `isset($arra[$key])` return false for null values. It's moments like this I hate PHP. |
# |
Jan 22nd 2017, 15:02 |
temp1029 |
@admad Doh, sorry, typing fast while trying to make breakfast |
# |
Jan 22nd 2017, 14:45 |
admad |
@temp1029 try to get my nick correct next time :slightly_smiling_face: |
# |
Jan 22nd 2017, 14:33 |
temp1029 |
thanks for your input too ahmad, :) |
# |
Jan 22nd 2017, 14:19 |
temp1029 |
thanks hmic, thats what I was thinking too |
# |
Jan 22nd 2017, 14:15 |
hmic |
temp1029: as auth usually gets configured in the appcontroller and you do have different requirements for the both sections, that sounds like different appcontrollers for both sections to me. i certainly did so :p |
# |
Jan 22nd 2017, 14:12 |
temp1029 |
i'm creating an admin section, which has an auth piece to it, and then a public facing section, which has no need for auth, does it make sense to use multiple appcontrollers in this case? my first thought it yes, but i am just using one now and I'm not seeing any issues, although i've barely built out the public facing piece |
# |
Jan 22nd 2017, 14:09 |
admad |
@temp1029 you can do either depending on your needs |
# |
Jan 22nd 2017, 14:06 |
temp1029 |
if i'm using a prefix, should I create a unique AppController file for that entire prefix, or should all prefixs use the same AppController file? |
# |
Jan 22nd 2017, 13:26 |
keith |
So that I can contain the same table twice |
# |
Jan 22nd 2017, 13:25 |
keith |
How do I alias a contain in a query? |
# |
Jan 22nd 2017, 12:46 |
chi_ |
help |
# |
Jan 22nd 2017, 10:27 |
al_x_mq |
ok, give it a shot. thanks |