donjakobo/A3M

utf8 and Uppercase

Closed this issue · 28 comments

Error:
unserialize(): Error at offset 386 of 749 bytes
suggest:
TABLE ci_sessions add DEFAULT CHARSET=utf8;

Error:
Undefined property: Connect_create::$account_model
application/controllers/account/Connect_create.php
edit LINE 94/106
return $this->account_model->get_by_username($username) ? TRUE : FALSE;
to
return $this->Account_model->get_by_username($username) ? TRUE : FALSE;

Error:
Undefined index: firstName/lastName/gender/photoURL
controllers/account/Connect_create.php LINE 68

The first two are fixed in my repo, but the last one I have no clue why is happening. Will do more testing.

OK, I have found something different as well. Seems to be an uncaught exception from Facebook. I think that these two might be related.

I have updated Hybrid Auth on my repo which includes some Facebook fixes, can you check if that fixes that last error?

OK, Thank you @AdwinTrave I will try this repo.

All the current updates are also part of #83 , so if those updates fix the problem I'm going to merge it.

錯誤

SQL 查詢:

-- Adding default user as admin a3m_acl_role

INSERT INTO a3m_rel_account_role ( account_id , role_id )
VALUES ( 1, 1 ) ;
MySQL 返回: 文件
#1146 - Table 'qiqicom_a3m.a3m_rel_account_role' doesn't exist
a3m_database.sql Line 22

This INSERT should be after creat a3m_rel_account_role TABLE .


A PHP Error was encountered
Severity: Notice
Message: Undefined index: firstName
Filename: account/Connect_create.php
Line Number: 68
Backtrace:
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 68
Function: _exception_handler
File: /home/qiqicom/public_html/index.php
Line: 274


A PHP Error was encountered
Severity: Notice
Message: Undefined index: lastName
Filename: account/Connect_create.php
Line Number: 68
Backtrace:
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 68
Function: _exception_handler
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Notice
Message: Undefined index: gender
Filename: account/Connect_create.php
Line Number: 68
Backtrace:
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 68
Function: _exception_handler
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Notice
Message: Undefined index: photoURL
Filename: account/Connect_create.php
Line Number: 68
Backtrace:
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 68
Function: _exception_handler
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Warning
Message: Missing argument 3 for Account_providers_model::insert(), called in /home/qiqicom/public_html/application/controllers/account/Connect_create.php on line 74 and defined
Filename: account/Account_providers_model.php
Line Number: 34
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 34
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Warning
Message: Missing argument 4 for Account_providers_model::insert(), called in /home/qiqicom/public_html/application/controllers/account/Connect_create.php on line 74 and defined
Filename: account/Account_providers_model.php
Line Number: 34
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 34
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Warning
Message: Missing argument 5 for Account_providers_model::insert(), called in /home/qiqicom/public_html/application/controllers/account/Connect_create.php on line 74 and defined
Filename: account/Account_providers_model.php
Line Number: 34
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 34
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Warning
Message: Missing argument 6 for Account_providers_model::insert(), called in /home/qiqicom/public_html/application/controllers/account/Connect_create.php on line 74 and defined
Filename: account/Account_providers_model.php
Line Number: 34
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 34
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Warning
Message: Missing argument 7 for Account_providers_model::insert(), called in /home/qiqicom/public_html/application/controllers/account/Connect_create.php on line 74 and defined
Filename: account/Account_providers_model.php
Line Number: 34
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 34
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Warning
Message: Missing argument 8 for Account_providers_model::insert(), called in /home/qiqicom/public_html/application/controllers/account/Connect_create.php on line 74 and defined
Filename: account/Account_providers_model.php
Line Number: 34
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 34
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Warning
Message: Missing argument 9 for Account_providers_model::insert(), called in /home/qiqicom/public_html/application/controllers/account/Connect_create.php on line 74 and defined
Filename: account/Account_providers_model.php
Line Number: 34
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 34
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Warning
Message: Missing argument 10 for Account_providers_model::insert(), called in /home/qiqicom/public_html/application/controllers/account/Connect_create.php on line 74 and defined
Filename: account/Account_providers_model.php
Line Number: 34
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 34
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Notice
Message: Undefined variable: provider_uid
Filename: account/Account_providers_model.php
Line Number: 37
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 37
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Notice
Message: Undefined variable: email
Filename: account/Account_providers_model.php
Line Number: 37
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 37
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Notice
Message: Undefined variable: display_name
Filename: account/Account_providers_model.php
Line Number: 37
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 37
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Notice
Message: Undefined variable: first_name
Filename: account/Account_providers_model.php
Line Number: 37
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 37
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Notice
Message: Undefined variable: last_name
Filename: account/Account_providers_model.php
Line Number: 37
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 37
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Notice
Message: Undefined variable: profile_url
Filename: account/Account_providers_model.php
Line Number: 37
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 37
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Notice
Message: Undefined variable: website_url
Filename: account/Account_providers_model.php
Line Number: 37
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 37
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Notice
Message: Undefined variable: photo_url
Filename: account/Account_providers_model.php
Line Number: 37
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 37
Function: _exception_handler
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/qiqicom/public_html/system/core/Exceptions.php:211)
Filename: core/Common.php
Line Number: 546
Backtrace:
File: /home/qiqicom/public_html/application/models/account/Account_providers_model.php
Line: 37
Function: insert
File: /home/qiqicom/public_html/application/controllers/account/Connect_create.php
Line: 74
Function: insert
File: /home/qiqicom/public_html/index.php
Line: 274
Function: require_once


A Database Error Occurred
Error Number: 1048
Column 'provider_uid' cannot be null
INSERT INTO a3m_providers (user_id, provider, provider_uid, email, display_name, first_name, last_name, profile_url, website_url, photo_url, created_at) VALUES (1, 'Yahoo', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2014-02-09 01:00:16')
Filename: models/account/Account_providers_model.php
Line Number: 37

If enable Yahoo
please change file application\config\account\account.php

"Yahoo" => array (
"enabled" => FALSE,
"keys" => array ( "id" => "", "secret" => "" ),
),

to

"Yahoo" => array (
"enabled" => FALSE,
"keys" => array ( "key" => "", "secret" => "" ),
),

reference to http://hybridauth.sourceforge.net/userguide/IDProvider_info_Yahoo.html

thinkdj • 8 months ago
In the config, "id" for yahoo's config array needs to be changed to "key"

Fixed the Yahoo stuff in config (should be merged in #83 ). Not sure how much I can do about qiqicom. I will check if there are any updates on Hybrid Auth and mere them. Is Facebook working fine now?

Btw. My personal A3M repository (https://github.com/AdwinTrave/A3M/tree/CI3) is for experimental stuff and things that I later on merge into this repository CI3 branch (A3M v2).

in Facebook I got the error.
A PHP Error was encountered
Severity: Error
Message: Uncaught exception 'Exception' with message 'Authentication failed! Facebook returned an invalid user id.' in /home/qiqicom/public_html/application/third_party/Hybrid/Providers/Facebook.php:91 Stack trace: #0 /home/qiqicom/public_html/application/third_party/Hybrid/Endpoint.php(175): Hybrid_Providers_Facebook->loginFinish() #1 /home/qiqicom/public_html/application/third_party/Hybrid/Endpoint.php(56): Hybrid_Endpoint::processAuthDone() #2 /home/qiqicom/public_html/application/controllers/account/Connect_end.php(45): Hybrid_Endpoint::process() #3 [internal function]: Connect_end->Index() #4 /home/qiqicom/public_html/system/core/CodeIgniter.php(371): call_user_func_array(Array, Array) #5 /home/qiqicom/public_html/index.php(274): require_once('/home/qiqicom/p...') #6 {main} Next exception 'Exception' with message 'Authentication failed! Facebook returned an invalid user id.' in /home/qiqicom/public_html/application/third_party/Hybrid/Auth.php:147 Stack trace: #0 /home/qiqicom/public_html/application/third_party/
Filename: Hybrid/Auth.php
Line Number: 147
Backtrace:

But, ensure I had facebook APP ID and Secret Key.

in /application/controllers/account/Connect.php

// Store user's data in session
$this->session->set_userdata('connect_create', array($provider => $user_profile));

change

// Store user's data in session
$this->session->set_userdata('connect_create', array($provider => (array)$user_profile));

in /application/controllers/account/Connect_create.php

You can test.

foreach($data['connect_create'] as $key=>$provider) {
echo("provider ".$key);
foreach($provider as $key=>$vaule){
echo("key= ".$key." vaule= ".$vaule);
}
}

Alright, found the problem with creating users from social media. Still not sure with the issues from actually getting the data from the media. I would say that the services changed their API and Hybrid Auth isn't yet updated.

@chego77 Did the newest changes fix the issue?

Today is my birthday :) . I will test for later.
Thank you again @AdwinTrave

@chego77 Happy Birthday! Hope it fixes the issues! No rush, let me know once you are done testing.

I just push an update to Hybrid Auth error handling on my repo. Any news on this?

@AdwinTrave Perfect!
I try Facebook/Google/Live/Yahoo/Aol/Twitter all sucess.
but try account/linked_accounts
The error:
An Error Was Encountered
Unable to locate the model you have specified: Account_facebook_model

#87 should fix that.

@chego77 Are my recent changes in my proposed PR fixing your issues?

@AdwinTrave, Test this repo. All Perfect.
Thank you very much.

Ooops, can not delete Linked Accounts?

Strange, works fine for me. Which provider has issues?

Dear @AdwinTrave
I got no delete Linked Accounts.
/application/views/account/account_linked.php
Line 39:

= 1 && isset($account->password)) : ?>

When I sign_in with social account that no password.

Well that is correct. If you login into account that is linked to only one social media and doesn't have a password set then you can't delete that account as that would delete your access to the account. That is a correct behavior.

No, I mean:
First sign_in(register) is fb
Second link google
3rd link twitter
4th link yahoo
....
All account are social's account.
then no Remove button.

@chego77 if you show the line of code, why not fork and commit? Its the && as you pointed out:
<?php if ($total_linked >= 1 && isset($account->password)) : ?>

Should probably be:
<?php if ($total_linked >= 1 || isset($account->password)) : ?>

That way it is either more than 1 linked OR set password, not AND. Make the change and push to @AdwinTrave

@donjakobo
Sorry, I can't use github system.
I will have to study hard.