File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -224,4 +224,18 @@ public function createAccount($data)
224
224
Mage::getModel ('zendesk/api_users ' )->create ($ data );
225
225
}
226
226
227
+ public function checkSsoRedirect ($ user )
228
+ {
229
+ if (
230
+ Mage::helper ('zendesk ' )->isSSOAdminUsersEnabled () &&
231
+ Mage::app ()->getRequest ()->getControllerName () === 'zendesk ' &&
232
+ Mage::app ()->getRequest ()->getActionName () === 'authenticate '
233
+ ) {
234
+ Mage::app ()->getResponse ()
235
+ ->setRedirect (Mage::helper ('adminhtml ' )->getUrl ('*/zendesk/authenticate ' ))
236
+ ->sendHeaders ()
237
+ ->sendResponse ();
238
+ exit ();
239
+ }
240
+ }
227
241
}
Original file line number Diff line number Diff line change 19
19
20
20
class Zendesk_Zendesk_Adminhtml_ZendeskController extends Mage_Adminhtml_Controller_Action
21
21
{
22
- protected $ _publicActions = array ('redirect ' , 'authenticate ' );
22
+ protected $ _publicActions = array ('redirect ' , 'logout ' );
23
23
24
24
public function indexAction ()
25
25
{
@@ -147,12 +147,13 @@ public function logoutAction()
147
147
{
148
148
// Admin sessions do not currently have an explicit "logout" method (unlike customer sessions) so do this
149
149
// manually with the session object
150
+
150
151
$ adminSession = Mage::getSingleton ('admin/session ' );
151
152
$ adminSession ->unsetAll ();
152
153
$ adminSession ->getCookie ()->delete ($ adminSession ->getSessionName ());
153
154
$ adminSession ->addSuccess (Mage::helper ('adminhtml ' )->__ ('You have logged out. ' ));
154
155
155
- $ this ->_redirect ('adminhtml/zendesk/* ' );
156
+ $ this ->_redirect ('adminhtml/zendesk/authenticate ' );
156
157
}
157
158
158
159
public function createAction ()
Original file line number Diff line number Diff line change 61
61
</connection >
62
62
</zendesk_read >
63
63
</resources >
64
+ <events >
65
+ <admin_session_user_login_success >
66
+ <observers >
67
+ <zendesk >
68
+ <class >zendesk/observer</class >
69
+ <method >checkSsoRedirect</method >
70
+ </zendesk >
71
+ </observers >
72
+ </admin_session_user_login_success >
73
+ </events >
64
74
</global >
65
75
<frontend >
66
76
<routers >
171
181
</zendesk >
172
182
</observers >
173
183
</customer_save_commit_after >
174
-
175
184
</events >
176
185
<menu >
177
186
<zendesk translate =" title" module =" zendesk" >
You can’t perform that action at this time.
0 commit comments