![]() |
Ion Auth - Lightweight Auth System based on Redux Auth 2 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Ion Auth - Lightweight Auth System based on Redux Auth 2 (/showthread.php?tid=27435) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 04-12-2010 [eluser]mckyja[/eluser] Hi all, just getting started with CI and enjoying it (been years since i've done web stuff ). I have been tasked with creating a simple web based employee management system for the HR department, and people need to be logged in at all times to view information. Ion_Auth seems to fit that need well. Where would be the best place to put a kind of 'global' logged_in() check? Is my understanding correct that extending the Controller with MY_Controller will provide that check every time any controller is called with something like this? Code: <?php Thanks in advance, Kyle. Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 04-12-2010 [eluser]Ben Edmunds[/eluser] Kyle, That is the correct way to do it. Good job man, hope you continue to enjoy working with CI and Ion Auth. Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 04-12-2010 [eluser]mckyja[/eluser] Thanks for the quick reply Ben, great community here from what i've seen ![]() One other quick question for you, how can I use Ion to display User ID and first/last name. (Sorry if this is a simple one, still getting up to speed on php and CI) Thanks, Kyle Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 04-12-2010 [eluser]Ben Edmunds[/eluser] Kyle, You can just do Code: $user = $this->ion_auth->get_user(); To get the user object and then you can access the properties like so Code: echo $user->id .' - '. $user->first_name .' '. $user->last_name; and of course you can pass the $user object to your view and echo the properties there. Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 04-12-2010 [eluser]mckyja[/eluser] thanks Ben. much appreciated. Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 04-12-2010 [eluser]Zen Savona[/eluser] I have a small problem with this. i am quite new to CI, but loving it so far. I installed it per the instructions on Github, and now when i try to access the auth controller from my browser it is redirecting me wrongly. my install is localhost/AGN, therefore to access the auth demo, i would go to localhost/AGN/auth. when i go there it redirects me to localhost/AGN/localhost/AGN/auth/login, if i manually go to localhost/AGN/auth/login i can enter my credentials but then it redirects me to localhost/AGN/localhost/AGN/auth/login again on submit. Hope you can help me fix this, as your tool looks extremely promising. Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 04-12-2010 [eluser]Ben Edmunds[/eluser] Zen, Does the standard welcome controller work properly? Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 04-12-2010 [eluser]Zen Savona[/eluser] [quote author="Ben Edmunds" date="1271148101"]Zen, Does the standard welcome controller work properly?[/quote] Yes, the welcome controller works fine, but it is not the default controller to be displayed. Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 04-12-2010 [eluser]Ben Edmunds[/eluser] Zen, Check the redirects. Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 04-12-2010 [eluser]Zen Savona[/eluser] Thats the odd part, it all seems correct. Code: function index() when i go to localhost/AGN/auth, because i am not logged in, it should redirect me to auth/login. which is localhost/AGN (base url)/auth/login ...makes no sense to me |