when i try to use ion-auth in HMVC,
$this->data['title'] = 'test';
$this->load->view('users/login', $this->data);in view,$title have no value.
any idea?
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
February 10, 2010 7:00pm
Subscribe [287]#451 / Jul 10, 2010 7:01pm
when i try to use ion-auth in HMVC,
$this->data['title'] = 'test';
$this->load->view('users/login', $this->data);in view,$title have no value.
any idea?
#452 / Jul 10, 2010 7:55pm
Hi Ben
I just started using CI a couple days ago, and just downloaded Ion Auth a couple of hours ago!
I am glad you are putting some docs together… here is my request, as a newbie to both CI and Ion Auth, for what I need to continue my project:
#1 - Table schema - What is the minimum default table layout for each table.
#2 - Require Login - Everytime I load a page, how do I check if somebody is logged in and if they are authorized to view that particular page?
The docs so far are helpful, but the above two items would help me out immensely.
Thanks
#453 / Jul 11, 2010 4:12am
huuray,
Try just using $data instead of $this->data.
#454 / Jul 11, 2010 4:40am
thanks ben,i figured out.
just put var $data; in controller.
#455 / Jul 11, 2010 6:49am
how to set user can login using username/email ?
#456 / Jul 11, 2010 8:34am
Answers to my own post above…
#1 - Regarding table schema, there are two files located on github (http://github.com/benedmunds/CodeIgniter-Ion-Auth) which contain the table schema.. one for postgres and one for mysql:
ion_auth.postgre.sql
ion_auth.sql#2 Regarding how to check if somebody is logged in, you can use the following at the top of each function/page in your controller file:
if (!$this->ion_auth->logged_in()) {
//redirect them to the login page
redirect('auth/login', 'refresh');
}So again, just a suggestion for the documentation, but as a new use to CI and to Ion Auth and to Github, these were the two obstacles that slowed me down to a crawl, so maybe they could be added in.
Thanks
#457 / Jul 11, 2010 10:42am
Hi Ben,
I’m sorry I don’t know how to use GitHub.
Your code is better than mine (not familiar with the vars) so I’ll use it.
Thanks a lot!
#458 / Jul 11, 2010 3:28pm
huuray,
Are you asking how to switch the identity or are you wanted to enable login using either username or email?
#459 / Jul 12, 2010 2:08am
Hey everybody,
I’ve updated the documentation a lot this weekend. Please take a look and let me know any mistakes, omissions, suggestions.
http://benedmunds.com/ion_auth/
Thanks!
#460 / Jul 12, 2010 6:55pm
why I am getting this error
Severity: 4096
Message: Object of class stdClass could not be converted to string
Filename: libraries/Loader.php(673) : eval()‘d code
Line Number: 3
while doing
<?php echo $this->ion_auth->get_user();?>#461 / Jul 12, 2010 7:01pm
dhaulagiri,
Because you can’t just echo and object.
try:
print_r($this->ion_auth->get_user());
//or
echo $this->ion_auth->get_user()->email;#462 / Jul 13, 2010 8:03pm
Ben
Docs are looking good… I am glad to see an example of each function.
Thanks
#463 / Jul 14, 2010 8:25pm
Hi Ben, thanks for taking time to chuck out a doc for us beginners.
I got a problem however, I’m currently trying out Ion Auth on a project
on my local (Win Vista) server and I can’t understand why I don’t see anything
in all the emails (activation etc) by Ion Auth.
I see the headers, i.e ‘from’, and ‘to’ addresses etc just no content.
And I have not changed the $config[‘email_templates’] from the default
‘auth/email/’ var.
Any insight would be helpful.
#464 / Jul 15, 2010 1:13pm
EDIT: Ignore this post. I made a mistake.
#465 / Jul 15, 2010 2:36pm
Ben. Firstly wanted to say that this is the auth library I liked the most in CI. I tried several others, and this was very simple and straight forward. I am already using it on my website.
I took a quick look at the docs and noticed that you had mentioned the default admin email incorrectly. Shouldn’t it be .(JavaScript must be enabled to view this email address)?