can someone tell me how i can use the "profilable" feature? I created the table with some own colums like: 'title', 'first_name', 'last_name', 'city', 'country', 'refid'. I added it in the Model_Profile too ...
My problem is, when I create an user with Model_User I can't use something like this: $user->title = 'Mr.';
It throws an exception: "Property "title" not found for Warden\Model_User."
I've to use the Mode_Profile, but when I try to it: $profile->save()
Greets Andrew Wayne wrote on Sunday 13th of November 2011:I'm not getting any errors using your code, must be something else in your environment, try do a Warden::logout(true) then logging in again
Andrew Wayne wrote on Tuesday 1st of November 2011:I realize this should be explained better in the docs i'll add a better example for this.
In your warden config file in the omniauthable section you should have in_use => true,
then depending on your settings in the config files, you need to add a controller class Controller_Auth extends Controller_OmniAuth {}
and add auth to your routes. The same way you would use Fuel NinjAuth package https://github.com/philsturgeon/fuel-ninjauth but you should already have a services table in your database, the example schema is in 'config/install.sql' or you can use oil to add the table to your db with 'php oil r warden --omniauthable' there's an example view file included in 'views/register.php'
. Will try it and f/up later... for the assessment!
Thx again, Andrew. Good catch! Here's the next barrier... ErrorException [ Error ]: Class 'OAuth2\Exception' not foundAndrew Wayne wrote on Thursday 3rd of November 2011:this was actually a typo which caused this error, fixed it now thanks.. In 'warden/classes/warden/omniauth/strategy/oauth2.php' you need to change line 24, the class 'OmniAuth_Strategy_OAuth2' should actually extend 'OmniAuth_Strategy' not 'Strategy' so line 24 should be: class OmniAuth_Strategy_OAuth2 extends OmniAuth_Strategy You can see it here https://github.com/dre1080/warden/commit/be60a49dd2919be81228e6238f6d63a1a6e760d5
php oil r warden -p
Warden installed successfully!
php oil r warden -c
Setting up Warden config... Error - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists with query: "CREATE TABLE `users`...
php oil r warden help
php oil r warden -p -l
php oil r warden:uninstall
php oil r warden:feature -c
Andrew Wayne wrote on Thursday 3rd of November 2011:That one's actually a bug with the fuel-oauth2 package I think.. On line 12 the class is extending from global php Exception class but not taking the namespace into account. So line 12 of that file should actually be: class Exception extends \Exception { Notice the backslash
.
Post - adding the \ in front of the Exception... yields the following (*sigh*):
ErrorException [ Error ]: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])
Bill
Andrew Wayne wrote on Thursday 3rd of November 2011:What provider are you trying to use? Facebook?
Seems like you haven't included the client_id, in warden config, omniauthable => providers => facebook => id
.
Secondly, yes, i was trying the facebook provider and you're right it was still blank... didn't realize at first glance this was the 'wall'. I'll try the twitter account... just easier to create twitter apps, than fb...
fuel-oauth uses twitter as well as yours...
'warden' overrides the fuel-oauth's?
Bill
Andrew Wayne wrote on Thursday 3rd of November 2011:I think you don't have the php curl extension installed, thats why php isn't recognizing the curl functions or curl constants
check your php.ini or try phpinfo() to see if curl is installed
EDIT:
I've another problem now
If I use Warden::authenticate_user() and $remember is false the Warden::check() says false, but the authenticate said true ... If I set $remember to true, then the check returns true ...
And Waren::current_user() returns in both situations false.
What I do wrong?! public function action_index() {
$val = Login::validate_form('form_login');
Debug::dump(Warden::check());
if (Input::method() == 'POST') {
if ($val->run()) {
$email = trim($val->validated('logEmail'));
if (Login::is_confirmed($email)) {
$password = trim($val->validated('logPassword'));
$remember = !is_null($val->validated('logRemember')) ? true : false;
Debug::dump(Warden::authenticate_user($email, $password, $remember));
}
else {
Session::set_flash('notice', 'You are not registred, please register first!');
}
}
else {
Session::set_flash('notice', $val->errors());
}
}
$this->template->title = "Login";
$this->template->content = View::forge('user/index')
->set('val', $val, false);
}
Warning - 2011-11-30 10:51:56 --> Fuel\Core\Fuel::init - The configured locale en_US is not installed on your system.
It looks like you're new here. If you want to get involved, click one of these buttons!