CakePHP 2 - Facebook integration - cakephp

Trying to add Facebook login / registration to a site I'm working on.
Been following this tutorial http://www.startutorial.com/articles/view/34
After some tweaking (because I'm on CakePHP 2, while the tutorial is for 1.3), I managed to get it to run. (Basically I just need to pull the plugin from the branch)
Now, I'm having issues with 2 things:
How do I save the information? Right now, after I login, I just come back to the same page but instead of the Login button, it says "Teepusink is using ThisApp"
Also some of the documentation doesn't seem to match with the branch version. For example,
Facebook->registration(); ?>
is giving me an error. Should I even be using the branch version? Or how do I go about using the plugin for CakePHP 2?
Thank you,
Tee

Got this to work actually.
So I went into ConnectComponent.php, and noticed that somehow the User model isn't being "recognized" there.
Took a little digging, but this is what I did.
'Facebook.Connect' => array('model' => 'User')
Hope this helps someone.

Related

Unable to add a new page in DNN9 (dotnetnuke version 9)

I installed dnn version 9. When I want to add a new page I go to the contents-> Pages-> Add page. an empty white page appears without any options to add a new page or event to cancel.
This is caused by a problem with your templates folder, either missing, or bad permissions. I'm guessing when you installed you chose the blank template?
I've got a blog post on things to try to resolve
http://www.chrishammond.com/Blog/itemId/2692/Canrsquot-add-ldquopagesrdquo-in-DNN9
"If you are having problems adding Pages in DNN 9, read this blog post.
I recently upgraded all of my sites to DNN 9, the most recent one being upgraded last night. This morning I wake up to an email from a client of mine reporting a problem with adding pages in one of their sites that they also upgraded to DNN recently. I read through their email, and decide that I’ll look into their issue a bit later, have an itch to scratch on one of my own websites, so I’ll get to them later (sorry client).
Working on this site that I upgrade last night, I decided I wanted to add another page to the site, low and behold, I was unable to do so.
To add a page in DNN9 you click on the “Content” option in the persona bar, and then the Pages option. There you will be presented with a view similar to this:
image
When I clicked on Add Page there, the screen went blank, like so:
image
That’s not very useful, actually that is as far from useful as possible. Once that happens, you can’t actually “do” anything from an Admin perspective. You have to “leave” this page, go somewhere else (click on manage/users for example, then you might need to click BACK in your browser a bunch of times) then you can click on Content/Pages again to get back into the Page listing for a site.
So why is the persona bar page blank? This error is the cause:
GET https://SOMEPORTALALIASHERE/API/PersonaBar/Pages/GetDefaultSettings? 500 (Internal Server Error)
If you dig into the DNN Error Log (Admin Logs) a bit you might find a more detailed error, something along the lines of
Message:Value cannot be null. Parameter name: source
StackTrace:
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate) at Dnn.PersonaBar.Pages.Components.TemplateController.GetDefaultTemplateId(IEnumerable`1 templates) at Dnn.PersonaBar.Pages.Components.PagesControllerImpl.GetDefaultSettings() at Dnn.PersonaBar.Pages.Services.PagesController.GetDefaultSettings() at lambda_method(Closure , Object , Object[] ) at
So what does that message tell you? Well something is happening with your DNN Install trying to get a list of “page templates”. In digging further, on my site, I found the issue to be the File Permissions on the Templates folder in the portals/0/ directory. For some reason on the site that I upgraded last night, my permissions were set to ALL USERS DENY on the “Browse Files in Folder” and “Open Files in Folder” check boxes.
image
Unchecking those, clicking SAVE resolved my “pages” persona bar issues. How did those permissions get set? Who knows, this DNN site has been around since 2008 or earlier, and that never caused a problem.
There are definitely some “kinks” to be worked out of DNN9, but so far I am digging the new experience.
Regarding my “client”’s site, they had a similar, but different issue. In their case, the TEMPLATES folder didn’t exist in the Portal that they were trying to use. Simply creating a new Templates folder in their File Manager fixed that problem for their site."
I tried out many solutions but finally I figure it out by reinstalling and add Object Qualifier. because it is optional field I leave it without any value in my first installation
This error was fixed in DNN 9.0.1

CakePHP DebugKit ERR_CONTENT_DECODING_FAILED

So, this is the second time I have seen this but cannot for the life of me explain why?!?
All of a sudden the DebugKit plugin stopped working and would not display in the browser. Looking at the console I can see the following:
debug_kit/js/toolbar.js net::ERR_CONTENT_DECODING_FAILED
So far I have tried rebooting laptop & server. Clearing cache/cookies in browser. Re-uploading the DebugKit plugin folder but still to no avail. Does anyone have any ideas what could be causing this? I have tried the good ol' "Google" approach
I had the same problem.
just make sure you don't have any extra line or space after ?> in your modals, controllers and mainly on bootstrap ( I had a extra line one of my bootstraps's plugin).
or you can delete the ?>, php will work fine.

Using a custom domain on GAE. Won't let me past Step 4

I'm trying to use a custom domain with a static site hosted on AppEngine. Once I get into Google Apps to add the domain, I just get stuck on this page. Basically, I can't get past Step 4 as per the instructions here. I click "Accept" and hit the activate button but the page just refreshes. I spent about a half hour on the phone with "Lewis" from Google phone support and he eventually told me to try App Engine support lol. During the support call we attempted to get this to work multiple times using both the latest Chrome and FF browsers with cookies/cache, etc. cleared.
No reputation, so no screenshot but like I said, the problem is at Step 4 where you have to accept GAE's terms.
Looks like similar problem here. Anyone have the same problem and/or know of a solution? Thanks
You can try other way to activate, like a html page.
I have used this method to activate.
My activated page seems those:
By html to activate => //i.stack.imgur.com/t3nM1.png ;
By operators to activate =>//i.stack.imgur.com/fZTWH.png;
Can you see them?
By the way, I am in China, so, these uploaded images that I can not see them.

Cakephp: cannot login if using a theme

I am not a newbie cakephp developer however I won't call myself as an intermediate level cakephp programmer.
I came across a strange behavor what I could not handle.
I've build up an app with default views. First customer needs themeing so I decided to use the cakephp theme feature and started to make a theme with views, layouts etc.
I am using cakephp 1.3.8.
Everything works fine except I can't log in. Cakephp redirects me to an impossible place, the search controller with search results. It simply could not happen.
With the default views everything works fine.
What could be the reason? Could it be a bug in Auth component? Where should I start to debug this and how?
Thanks.
edit:
I made a copy of my default views into a new theme, and changed the $theme variable to this new theme. Everything works, so Auth and Theme facilities are fine, the reason should be my first theme. How a theme, or view file affects on login processing and/or Auth redirections? I still do not know how to find the bug in my views :(. I've set debug to 2, also checked the logs in tmp/logs but there ares now infos. Any idea?
SOLVED
I found the problem, a $this->Form->end() was missing from the searchbox element so the login data was submitted to the products controller search method, therefore the login wasn't processed.
Was my fault.

Have problem with maintaining session in a Website sone in CakePHP

Well as I have posted earlier too...I have created a site in two languages.One with URL www.mainDomain.com(English) and other with www.fr.subDomain.com(French).Both are done in CakePHP,in french I have just changed the views of it to French.But the problem is,when anybody login's in English version and then switches to the French version,the session does'nt recognizes it and ask for login again.It has become to be the biggest bug in the Web application which I have done till far.How can manage this thing? Is there any way so that I can manage session on the same time?Please suggest me some thing,so that I can resolve this thing...!!!
Thanks in advance
Perhaps this may help you: http://www.cake-toppings.com/tag/subdomains/

Resources