Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
WanWizard
a.k.a. WanWizard
Discussions
4
Comments
8243
Activity
send to controller from view and get result set without page refreshing
Add the jquery javascript code to your view, and have it do an ajax call to a rest controller method, which can return the data in json format, which your javascript code can use to update the page. Just like any other application where you would d…
Comment by
WanWizard
November 2015
permalink
Getting Facebook and Opauth working correctly.
Problem is that at some point in your app, you need to convert the Facebook login to a Fuel Auth login, which means you need a mapping between Facebook user "A" and Fuel user "1". This is essentially what the Auth_Opauth class d…
Comment by
WanWizard
October 2015
permalink
Getting Facebook and Opauth working correctly.
To be complete, it is the frontend that has to maintain the session with the user (the users browser), so the login needs to happen there. A login in the backend isn't very useful, there is no cookie mechanism to maintain state, so you need to…
Comment by
WanWizard
October 2015
permalink
Getting Facebook and Opauth working correctly.
You have to handle the authentication in the frontend. If your backend is separated from your frontend you can not use the Auth_Opauth class as that requires all Auth to be local. So you have to write your own version of that class, that does not u…
Comment by
WanWizard
October 2015
permalink
dompdf image is not displayiing
Sorry, no experience with dompdf, you probably have better luck on a dompdf forum?
Comment by
WanWizard
October 2015
permalink
Database connection with db.yml file
BTW, changing framework code is not a good idea, your changes will get lost when it's time to upgrade the framework. It's probably better to create a db.php file in your config folder containing: Config::load('db.yml', true); r…
Comment by
WanWizard
October 2015
permalink
Getting Facebook and Opauth working correctly.
Yes, that doesn't work at all with OAuth and similar HTTP based authentication services. They all need to redirect you to either prompt you for a login or return a token if you are already logged in. That will never work if your frontend does…
Comment by
WanWizard
October 2015
permalink
FuelPHP Slack
Had to look that up... ;-) We're old fashioned, we're on IRC, channel #fuelphp
Comment by
WanWizard
October 2015
permalink
Getting Facebook and Opauth working correctly.
Looks ok. It is this line: $opauth = \Auth_Opauth::forge(false); that will create an Opauth object, and the next line: $status = $opauth->login_or_register(); will call the callback processor in the Opauth class. Both are outside the realm o…
Comment by
WanWizard
October 2015
permalink
Getting Facebook and Opauth working correctly.
That is usually caused by incorrect configuration at the facebook end. We have a login controller that contains the callback method (the example in the docs is a virtual copy of our login controller), and on de facebook developer page, under "…
Comment by
WanWizard
October 2015
permalink
Database connection with db.yml file
A standard db config contains a lot more, this is a standard default entry: array (size=5) 'active' => string 'default' (length=8) 'default' => array (size=9) 'type' => string 'my…
Comment by
WanWizard
October 2015
permalink
Firing action on any not "catched" exception.
That is an option. But if you want to know what the app is doing, it's perhaps better to attach a mail handler to the log and have it email log entries (for example all warnings or errors). See this post on how to setup a custom log handler: …
Comment by
WanWizard
October 2015
permalink
.htaccess not working
So what happens if you request /fuel/page1 ? What page do you get?
Comment by
WanWizard
October 2015
permalink
Force Login is not working correctly
You are correct, you can pass a \Model\Auth_User object as well, but you don't do that, you pass something called Model_User. The Opauth extension is complete integrated in Auth, both for Ormauth and for Simpleauth, you can find information he…
Comment by
WanWizard
October 2015
permalink
.htaccess not working
From the look of it you have installed Fuel inside your document root (which I assume is /var/www/html), instead of using virtualhosts for which Fuel was designed. In that case, your public folder is redundant, you can move everything in it one fol…
Comment by
WanWizard
October 2015
permalink
Force Login is not working correctly
force_login() requires a user_id, not an object, so you need to do Auth::force_login($user->id); But are you sure you want to do this, it is extremely easy to hack this, and to login as any user without knowing the password. If you want to use…
Comment by
WanWizard
October 2015
permalink
Where is ErrorCode constant for PhpErrorException?
No, these are PHP error codes, indicating the type of error. The codes are defined here: http://php.net/manual/en/errorfunc.constants.php where you see that 8 means "PHP Notice". You would have to interpret the message to know what the ex…
Comment by
WanWizard
October 2015
permalink
Inserting data using ORM
Yup, that would be right. Although if you use the Auth package, you should really use it's update method for updating users, it has security checks measures against hacking built-in.
Comment by
WanWizard
October 2015
permalink
Joining two Field and then Order By
No, you will have to use DB::expr(), but I've never tried that in an order_by(). Something like: ->order_by(\DB::expr("GREATEST(fieldA, fieldB)"), 'ASC')-> Or if a field can contain NULL, use ->order_by(\DB::exp…
Comment by
WanWizard
October 2015
permalink
Joining two Field and then Order By
You mean you want to order on the highest value in both fields, so you have the one that is created yesterday below the one that is updated today? If so, have a look at GREATEST() in MySQL. You can use it to select the biggest value from multiple c…
Comment by
WanWizard
October 2015
permalink
Joining two Field and then Order By
On a DB call you mean? You can use multiple order_by's, so you can do ...->order_by('fieldA', 'ASC')->order_by('fieldB', 'DESC')->execute(); Which would order first on fieldA, and within that,…
Comment by
WanWizard
October 2015
permalink
Uploading project to server
If you don't have access to your webserver config, you could work around that by adding some code in your application bootstrap that sets the environment based on for example the server name, or the hostname in the request.
Comment by
WanWizard
October 2015
permalink
Uploading project to server
We have the Fuel environment set in the webservers virtualhost definition using setEnv, and not in the .htaccess. Same with the rewrite rules, we try not use the .htaccess, as it slows the webserver down due to a lot of extra file I/O. That means t…
Comment by
WanWizard
October 2015
permalink
Save duplicate emails, username and password
Auth uses the email address as a login name, so it has to be unique. If you want to change this, you need a migration to remove the unique index on the email column (and add it again on a down migration), and you need to overload the login() and c…
Comment by
WanWizard
October 2015
permalink
Is it possible to log to database?
If you are up to date with your Fuel installation, you can extend the Log class to have Monolog use different handlers or formatters. For example, our applications write to syslog in staging and production: /** * Log class extension. * * Modifi…
Comment by
WanWizard
October 2015
permalink
More Comments
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
About
Username
WanWizard
Joined
January 2011
Visits
2,388
Last Active
4:49PM
Roles
Administrator