miniOrange_2factor - Version 1.0.0

Version Notes

= 1.0.0 =
First version of plugin.

Download this release

Release Info

Developer miniOrange inc.
Extension miniOrange_2factor
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (51) hide show
  1. app/code/community/MiniOrange/2factor/Block/mo2fConfig.php +97 -0
  2. app/code/community/MiniOrange/2factor/Controllers/Adminhtml/IndexController.php +449 -0
  3. app/code/community/MiniOrange/2factor/Controllers/Adminhtml/Login/miniOrangeController.php +23 -0
  4. app/code/community/MiniOrange/2factor/Controllers/IndexController.php +42 -0
  5. app/code/community/MiniOrange/2factor/Helper/Data.php +4 -0
  6. app/code/community/MiniOrange/2factor/Helper/mo2fUtility.php +433 -0
  7. app/code/community/MiniOrange/2factor/Model/Observer.php +186 -0
  8. app/code/community/MiniOrange/2factor/Model/Words.php +18 -0
  9. app/code/community/MiniOrange/2factor/etc/adminhtml.xml +22 -0
  10. app/code/community/MiniOrange/2factor/etc/config.xml +117 -0
  11. app/code/community/MiniOrange/2factor/sql/MiniOrange_2factor_setup/mysql4-install-0.0.1.php +26 -0
  12. app/design/adminhtml/default/default/layout/miniorange_2factor_admin.xml +9 -0
  13. app/design/adminhtml/default/default/template/miniorange_2factor/login.phtml +234 -0
  14. app/design/adminhtml/default/default/template/miniorange_2factor/mo2fConfig.phtml +508 -0
  15. app/etc/modules/miniorange_2factor.xml +9 -0
  16. package.xml +55 -0
  17. skin/adminhtml/default/default/images/MiniOrange_2factor/appstore.png +0 -0
  18. skin/adminhtml/default/default/images/MiniOrange_2factor/arrow.png +0 -0
  19. skin/adminhtml/default/default/images/MiniOrange_2factor/authenticate.png +0 -0
  20. skin/adminhtml/default/default/images/MiniOrange_2factor/authvalidate.png +0 -0
  21. skin/adminhtml/default/default/images/MiniOrange_2factor/cachesetting.png +0 -0
  22. skin/adminhtml/default/default/images/MiniOrange_2factor/clickconfiguremobile.png +0 -0
  23. skin/adminhtml/default/default/images/MiniOrange_2factor/clickconfiguremobile2.png +0 -0
  24. skin/adminhtml/default/default/images/MiniOrange_2factor/configurefirsttime.png +0 -0
  25. skin/adminhtml/default/default/images/MiniOrange_2factor/configuremobile.png +0 -0
  26. skin/adminhtml/default/default/images/MiniOrange_2factor/forgot-phone.png +0 -0
  27. skin/adminhtml/default/default/images/MiniOrange_2factor/forgotphone.png +0 -0
  28. skin/adminhtml/default/default/images/MiniOrange_2factor/loggedin.png +0 -0
  29. skin/adminhtml/default/default/images/MiniOrange_2factor/login1.png +0 -0
  30. skin/adminhtml/default/default/images/MiniOrange_2factor/login2.png +0 -0
  31. skin/adminhtml/default/default/images/MiniOrange_2factor/login3.png +0 -0
  32. skin/adminhtml/default/default/images/MiniOrange_2factor/loginsettings.png +0 -0
  33. skin/adminhtml/default/default/images/MiniOrange_2factor/mail.png +0 -0
  34. skin/adminhtml/default/default/images/MiniOrange_2factor/miniorange_logo.png +0 -0
  35. skin/adminhtml/default/default/images/MiniOrange_2factor/mobileconfigurebutton.png +0 -0
  36. skin/adminhtml/default/default/images/MiniOrange_2factor/mobilescan.png +0 -0
  37. skin/adminhtml/default/default/images/MiniOrange_2factor/mobilesuccess.png +0 -0
  38. skin/adminhtml/default/default/images/MiniOrange_2factor/otp.png +0 -0
  39. skin/adminhtml/default/default/images/MiniOrange_2factor/phone-offline.png +0 -0
  40. skin/adminhtml/default/default/images/MiniOrange_2factor/playStore.png +0 -0
  41. skin/adminhtml/default/default/images/MiniOrange_2factor/processing.png +0 -0
  42. skin/adminhtml/default/default/images/MiniOrange_2factor/register.png +0 -0
  43. skin/adminhtml/default/default/images/MiniOrange_2factor/right.png +0 -0
  44. skin/adminhtml/default/default/images/MiniOrange_2factor/savecache.png +0 -0
  45. skin/adminhtml/default/default/images/MiniOrange_2factor/scanqr.png +0 -0
  46. skin/adminhtml/default/default/images/MiniOrange_2factor/sendingotp.png +0 -0
  47. skin/adminhtml/default/default/images/MiniOrange_2factor/settings.png +0 -0
  48. skin/adminhtml/default/default/images/MiniOrange_2factor/softokenmobile.png +0 -0
  49. skin/adminhtml/default/default/images/MiniOrange_2factor/softtoken.png +0 -0
  50. skin/adminhtml/default/default/images/MiniOrange_2factor/sync.png +0 -0
  51. skin/adminhtml/default/default/images/MiniOrange_2factor/wrong.png +0 -0
app/code/community/MiniOrange/2factor/Block/mo2fConfig.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MiniOrange_2factor_Block_mo2fConfig extends Mage_Core_Block_Template{
3
+
4
+
5
+ public function isEnabled(){
6
+ $customer = Mage::helper('MiniOrange_2factor/mo2fUtility');
7
+ $admin = Mage::getSingleton('admin/session')->getUser();
8
+ $id = $admin->getUserId();
9
+ if($customer->getConfig('isEnabled',$id)==1){
10
+ return 'checked';
11
+ }
12
+ else{
13
+ return '';
14
+ }
15
+ }
16
+
17
+ public function getadminurl($value){
18
+ return Mage::helper("adminhtml")->getUrl($value);
19
+ }
20
+
21
+ public function getcurrentUrl(){
22
+ return Mage::getBaseUrl();
23
+ }
24
+
25
+ public function getHostURl(){
26
+ return Mage::helper('MiniOrange_2factor/mo2fUtility')->getHostURl();
27
+ }
28
+
29
+ public function getqrCode(){
30
+ return Mage::getSingleton('core/session')->getmo2fqrcode();
31
+ }
32
+
33
+
34
+ public function getTransactionId(){
35
+ return Mage::getSingleton('core/session')->getmo2ftransactionId();
36
+ }
37
+
38
+ public function downloaded(){
39
+ if($this->getConfig('downloaded')==1){
40
+ return "checked";
41
+ }
42
+ else{
43
+ return;
44
+ }
45
+ }
46
+
47
+ public function showEmail(){
48
+ $admin = Mage::getSingleton('admin/session')->getUser();
49
+ $id = $admin->getUserId();
50
+ return $customer->showEmail($id);
51
+ }
52
+
53
+ public function saveConfig($url,$value){
54
+ $admin = Mage::getSingleton('admin/session')->getUser();
55
+ $id = $admin->getUserId();
56
+ $data = array($url=>$value);
57
+ $model = Mage::getModel('admin/user')->load($id)->addData($data);
58
+ try {
59
+ $model->setId($id)->save();
60
+ } catch (Exception $e){
61
+ Mage::log($e->getMessage(), null, 'miniorage_error.log', true);
62
+ }
63
+ }
64
+
65
+ public function getImage($image){
66
+ $url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
67
+ return $url.'adminhtml/default/default/images/MiniOrange_2factor/'.$image.'.png';
68
+ }
69
+
70
+ public function getEmail(){
71
+ return Mage::getStoreConfig('miniorange_2factor_options/register/miniorange_2factor_username');
72
+ }
73
+
74
+ public function getConfig($config,$id=""){
75
+ $customer = Mage::helper('MiniOrange_2factor/mo2fUtility');
76
+ if($id!=""){
77
+ return $customer->getConfig($config,$id);
78
+ }
79
+ else{
80
+ $admin = Mage::getSingleton('admin/session')->getUser();
81
+ $id = $admin->getUserId();
82
+ return $customer->getConfig($config,$id);
83
+ }
84
+ }
85
+
86
+ public function cURLEnabled(){
87
+ $customer = Mage::helper('MiniOrange_2factor/mo2fUtility');
88
+ return $customer->is_curl_installed();
89
+ }
90
+
91
+ public function getForgotPassUrl(){
92
+ $url = $this->getHostURl();
93
+ return $url.'/moas/idp/userforgotpassword' ;
94
+ }
95
+
96
+
97
+ }
app/code/community/MiniOrange/2factor/Controllers/Adminhtml/IndexController.php ADDED
@@ -0,0 +1,449 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MiniOrange_2factor_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+ private $defaultCustomerKey = "16352";
6
+ private $defaultApiKey = "AJG97LGpOVVwFUuuPSij5IH6Kvlu6qEj";
7
+
8
+ public function indexAction(){
9
+ $this->loadLayout();
10
+ $this->renderLayout();
11
+ Mage::getSingleton('core/session')->unsErrorMessage();
12
+ Mage::getSingleton('core/session')->unsSuccessMessage();
13
+ Mage::getSingleton('admin/session')->unsshowLoginSettings();
14
+ Mage::getSingleton('admin/session')->unsOTPsent();
15
+ }
16
+
17
+
18
+ public function newUserAction(){
19
+ $params = $this->getRequest()->getParams();
20
+ $customer = Mage::helper('MiniOrange_2factor/mo2fUtility');
21
+ if($customer->is_curl_installed()){
22
+ $email = $params['email'];
23
+ $password = $params['password'];
24
+ $phone = $params['phone'];
25
+ $confirmPassword = $params['confirmPassword'];
26
+ if(strcmp($password,$confirmPassword)!=0){
27
+ $this->displayMessage('Passwords do not match.',"ERROR");
28
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
29
+ }
30
+ else{
31
+ $admin = Mage::getSingleton('admin/session')->getUser();
32
+ $id = $admin->getUserId();
33
+ $content = json_decode($customer->check_customer($email), true);
34
+ if( strcasecmp( $content['status'], 'CUSTOMER_NOT_FOUND') == 0 ){
35
+ $content = json_decode($customer->send_otp_token($email,'EMAIL',$this->defaultCustomerKey,$this->defaultApiKey), true); //send otp for verification
36
+ if(strcasecmp($content['status'], 'SUCCESS') == 0){
37
+ Mage::getSingleton('admin/session')->setMytextid($content['txId']);
38
+ Mage::getSingleton('admin/session')->setOTPsent(1);
39
+ $this->saveConfig('miniorange_2factor_show_otp',1,$id);
40
+ $this->saveConfig('miniorange_2factor_login',0,$id);
41
+ $this->saveConfig('miniorange_2factor_email',$email,$id);
42
+ $this->saveConfig('miniorange_2factor_pass',$password,$id);
43
+ $this->saveConfig('miniorange_2factor_phone',$phone,$id);
44
+ $this->saveConfig('miniorange_2factor_admin_registered',$id,$id);
45
+ $this->displayMessage('OTP has been sent to your Email. Please check your mail and enter the otp below.',"SUCCESS");
46
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
47
+ }
48
+ else{
49
+ $this->displayMessage('You are already a registered user',"ERROR");
50
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
51
+ }
52
+ }
53
+ else{
54
+ $content = $customer->get_customer_key($email,$password);
55
+ $customerKey = json_decode($content, true);
56
+ if(json_last_error() == JSON_ERROR_NONE) {
57
+ $this->saveConfig('miniorange_2factor_email',$email,$id);
58
+ $this->saveConfig('miniorange_2factor_phone',$phone,$id);
59
+ $collection = Mage::getModel('admin/user')->getCollection();
60
+ foreach($collection as $item){
61
+ $ids=$item->getData('user_id');
62
+ $this->saveConfig('miniorange_2factor_customer_key',$customerKey['id'],$ids);
63
+ $this->saveConfig('miniorange_2factor_api_key',$customerKey['apiKey'],$ids);
64
+ $this->saveConfig('miniorange_2factor_token',$customerKey['token'],$ids);
65
+ $this->saveConfig('miniorange_2factor_admin_registered',$id,$ids);
66
+ if($ids!=$id){
67
+ $this->saveConfig('miniorange_2factor_validated',0,$ids);
68
+ }
69
+ }
70
+ $this->saveConfig('miniorange_2factor_pass',"",$id);
71
+ $this->saveConfig('miniorange_2factor_show_otp',0,$id);
72
+ $this->saveConfig('miniorange_2factor_show_configure',1,$id);
73
+ $this->saveConfig('miniorange_2factor_validated',1,$id);
74
+ $this->saveConfig('miniorange_2factor_login',0,$id);
75
+ $this->displayMessage('Registration Successful configure your mobile below',"SUCCESS");
76
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
77
+ }
78
+ else{
79
+ $this->saveConfig('miniorange_2factor_login',"1",$id);
80
+ $this->displayMessage('Invalid Credentials',"ERROR");
81
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
82
+ }
83
+ }
84
+ }
85
+ }
86
+ else{
87
+ $this->displayMessage('cURL is not enabled. Please <a id="cURL" href="#cURLfaq">click here</a> to see how to enable cURL.',"ERROR");
88
+ }
89
+ }
90
+
91
+ public function validateNewUserAction(){
92
+ $params = $this->getRequest()->getParams();
93
+ $customer = Mage::helper('MiniOrange_2factor/mo2fUtility');
94
+ if($customer->is_curl_installed()){
95
+ $admin = Mage::getSingleton('admin/session')->getUser();
96
+ $id = $admin->getUserId();
97
+ $otp = $params['otp'];
98
+ $email = Mage::getSingleton('core/session')->getaddAdmin();
99
+ $phone = Mage::getSingleton('core/session')->getaddPhone();
100
+ if(strcmp($otp,"")!=0){
101
+ $transactionId = Mage::getSingleton('admin/session')->getMytextid();
102
+ $content = json_decode($customer->validate_otp_token( 'EMAIL', null, $transactionId , $otp , $this->defaultCustomerKey, $this->defaultApiKey),true);
103
+
104
+ if(strcasecmp($content['status'], 'SUCCESS') == 0) { //OTP validated and generate QRCode
105
+ $adminregistered = $customer->getConfig('mainAdmin',$id);
106
+ if($adminregistered!="" && $adminregistered==$id){
107
+ $this->mo2f_create_customer();
108
+ }
109
+ else{
110
+ $this->saveConfig('miniorange_2factor_email',$email,$id);
111
+ $this->saveConfig('miniorange_2factor_phone',$phone,$id);
112
+ $this->saveConfig('miniorange_2factor_pass',"",$id);
113
+ $this->saveConfig('miniorange_2factor_show_otp',0,$id);
114
+ $this->saveConfig('miniorange_2factor_show_configure',1,$id);
115
+ $this->saveConfig('miniorange_2factor_validated',1,$id);
116
+ $this->saveConfig('miniorange_2factor_login',0,$id);
117
+ $this->displayMessage('Registration Complete. Please Configure your mobile',"SUCCESS");
118
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
119
+ }
120
+ }
121
+ else{
122
+ $this->displayMessage('Please enter a valid otp',"ERROR");
123
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
124
+ }
125
+ }
126
+ else{
127
+ $this->displayMessage('Please enter a valid otp',"ERROR");
128
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
129
+ }
130
+ }
131
+ else{
132
+ $this->displayMessage('cURL is not enabled. Please <a id="cURL" href="#cURLfaq">click here</a> to see how to enable cURL.',"ERROR");
133
+ }
134
+ }
135
+
136
+ public function existingUserAction(){
137
+ $params = $this->getRequest()->getParams();
138
+ $customer = Mage::helper('MiniOrange_2factor/mo2fUtility');
139
+ if($customer->is_curl_installed()){
140
+ $email = $params['loginemail'];
141
+ $password = $params['loginpassword'];
142
+ $admin = Mage::getSingleton('admin/session')->getUser();
143
+ $id = $admin->getUserId();
144
+ $content = $customer->get_customer_key($email,$password);
145
+ $customerKey = json_decode($content, true);
146
+ if(json_last_error() == JSON_ERROR_NONE) {
147
+ $this->saveConfig('miniorange_2factor_email',$email,$id);
148
+ $collection = Mage::getModel('admin/user')->getCollection();
149
+ foreach($collection as $item){
150
+ $ids=$item->getData('user_id');
151
+ $this->saveConfig('miniorange_2factor_customer_key',$customerKey['id'],$ids);
152
+ $this->saveConfig('miniorange_2factor_api_key',$customerKey['apiKey'],$ids);
153
+ $this->saveConfig('miniorange_2factor_token',$customerKey['token'],$ids);
154
+ if($ids!=$id){
155
+ $this->saveConfig('miniorange_2factor_validated',0,$ids);
156
+ }
157
+ }
158
+ $this->saveConfig('miniorange_2factor_pass',"",$id);
159
+ $this->saveConfig('miniorange_2factor_show_otp',0,$id);
160
+ $this->saveConfig('miniorange_2factor_show_configure',1,$id);
161
+ $this->saveConfig('miniorange_2factor_validated',1,$id);
162
+ $this->saveConfig('miniorange_2factor_login',0,$id);
163
+ $this->displayMessage('Registration Successful. Please Configure your mobile below',"SUCCESS");
164
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
165
+ }
166
+ else{
167
+ $this->saveConfig('miniorange_2factor_login',1,$id);
168
+ $this->displayMessage('Invalid Credentials',"ERROR");
169
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
170
+ }
171
+ }
172
+ else{
173
+ $this->displayMessage('cURL is not enabled. Please <a id="cURL" href="#cURLfaq">click here</a> to see how to enable cURL.',"ERROR");
174
+ }
175
+ }
176
+
177
+ public function additionalAdminAction(){
178
+ $params = $this->getRequest()->getParams();
179
+ $customer = Mage::helper('MiniOrange_2factor/mo2fUtility');
180
+ if($customer->is_curl_installed()){
181
+ $email = $params['additional_email'];
182
+ $phone = $params['additional_phone'];
183
+ $admin = Mage::getSingleton('admin/session')->getUser();
184
+ $id = $admin->getUserId();
185
+ $content = json_decode($customer->send_otp_token($email,'EMAIL',$this->defaultCustomerKey,$this->defaultApiKey), true);
186
+ if(strcasecmp($content['status'], 'SUCCESS') == 0){
187
+ $admin = Mage::getSingleton('admin/session')->getUser();
188
+ $id = $admin->getUserId();
189
+ Mage::getSingleton('admin/session')->setOTPsent(1);
190
+ Mage::getSingleton('admin/session')->setMytextid($content['txId']);
191
+ $this->saveConfig('miniorange_2factor_show_otp',1,$id);
192
+ $this->saveConfig('miniorange_2factor_login',0,$id);
193
+ Mage::getSingleton('core/session')->setaddAdmin($email);
194
+ Mage::getSingleton('core/session')->setaddPhone($phone);
195
+ $this->displayMessage('OTP has been sent to your Email. Please check your mail and enter the otp below.',"SUCCESS");
196
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
197
+ }
198
+ else{
199
+ $this->displayMessage('Error while sending OTP.',"ERROR");
200
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
201
+ }
202
+ }
203
+ else{
204
+ $this->displayMessage('cURL is not enabled. Please <a id="cURL" href="#cURLfaq">click here</a> to see how to enable cURL.',"ERROR");
205
+ }
206
+ }
207
+
208
+ public function enableAdminAction(){
209
+ $customer = Mage::helper('MiniOrange_2factor/mo2fUtility');
210
+ if($customer->is_curl_installed()){
211
+ $admin = Mage::getSingleton('admin/session')->getUser();
212
+ $id = $admin->getUserId();
213
+ $params = $this->getRequest()->getParams();
214
+ $email = $customer->getConfig('email',$id);
215
+ $validated = $customer->getConfig('validated',$id);
216
+ $showqr = $customer->getConfig('configure',$id);
217
+ Mage::getSingleton('admin/session')->setshowLoginSettings(1);
218
+ if($email!="" && $validated==1){
219
+ if($showqr==0){
220
+ $value = $params['adminrole_activation'];
221
+ if($value==1){
222
+ $this->saveConfig('miniorange_2factor_Admin_enable',1,$id);
223
+ $this->displayMessage('Enabled Two Factor for Admin',"SUCCESS");
224
+ }
225
+ else{
226
+ $this->saveConfig('miniorange_2factor_Admin_enable',0,$id);
227
+ $this->displayMessage('Disabled Two Factor for Admin',"ERROR");
228
+ }
229
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
230
+ }
231
+ else{
232
+ $this->displayMessage('You will have to configure your mobile before you can enable 2factor',"ERROR");
233
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
234
+ }
235
+ }
236
+ else{
237
+ $this->displayMessage('You will have to register before you can enable 2factor',"ERROR");
238
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
239
+ }
240
+ }
241
+ else{
242
+ $this->displayMessage('cURL is not enabled. Please <a id="cURL" href="#cURLfaq">click here</a> to see how to enable cURL.',"ERROR");
243
+ }
244
+ }
245
+
246
+ public function supportSubmitAction(){
247
+ $customer = Mage::helper('MiniOrange_2factor/mo2fUtility');
248
+ if($customer->is_curl_installed()){
249
+ $params = $this->getRequest()->getParams();
250
+ $user = Mage::getSingleton('admin/session')->getUser();
251
+ $customer->submit_contact_us($params['query_email'], $params['query_phone'], $params['query'], $user);
252
+ $this->displayMessage('Your query has been sent. We will get in touch with you soon',"SUCCESS");
253
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
254
+ }
255
+ else{
256
+ $this->displayMessage('cURL is not enabled. Please <a id="cURL" href="#cURLfaq">click here</a> to see how to enable cURL.',"ERROR");
257
+ }
258
+ }
259
+
260
+ public function registrationSuccessAction(){
261
+ $customer = Mage::helper('MiniOrange_2factor/mo2fUtility');
262
+ if($customer->is_curl_installed()){
263
+ $admin = Mage::getSingleton('admin/session')->getUser();
264
+ $id = $admin->getUserId();
265
+ $url = Mage::helper("adminhtml")->getUrl('adminhtml/index/logout');
266
+ $this->displayMessage('You are Done. You can <a href="'.$url.'">log out</a> and log back in with mobile authentication.',"SUCCESS");
267
+ $this->saveConfig('miniorange_2factor_show_qr',0,$id);
268
+ $this->saveConfig('miniorange_2factor_show_configure',0,$id);
269
+ Mage::getSingleton('admin/session')->setshowLoginSettings(1);
270
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
271
+ }
272
+ else{
273
+ $this->displayMessage('cURL is not enabled. Please <a id="cURL" href="#cURLfaq">click here</a> to see how to enable cURL.',"ERROR");
274
+ }
275
+ }
276
+
277
+ public function showQRCodeAction(){
278
+ $customer = Mage::helper('MiniOrange_2factor/mo2fUtility');
279
+ if($customer->is_curl_installed()){
280
+ $params = $this->getRequest()->getParams();
281
+ $admin = Mage::getSingleton('admin/session')->getUser();
282
+ $id = $admin->getUserId();
283
+ $email = $customer->getConfig('email',$id);
284
+ $validated = $customer->getConfig('validated',$id);
285
+ if($email!="" && $validated==1){
286
+ $this->saveConfig('miniorange_2factor_show_configure',1,$id);
287
+ $this->saveConfig('miniorange_2factor_downloaded_app',$params['showDownload'],$id);
288
+ $this->mo2f_get_qr_code_for_mobile($email,$id);
289
+ }
290
+ else{
291
+ $this->displayMessage('You will have to register before configuring your mobile',"ERROR");
292
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
293
+ }
294
+ }
295
+ else{
296
+ $this->displayMessage('cURL is not enabled. Please <a id="cURL" href="#cURLfaq">click here</a> to see how to enable cURL.',"ERROR");
297
+ }
298
+ }
299
+
300
+ public function resendValidationOTPAction(){
301
+ $customer = Mage::helper('MiniOrange_2factor/mo2fUtility');
302
+ if($customer->is_curl_installed()){
303
+ $admin = Mage::getSingleton('admin/session')->getUser();
304
+ $id = $admin->getUserId();
305
+ $email = $customer->getConfig('email',$id);
306
+ $content = json_decode($customer->send_otp_token($email,'EMAIL',$this->defaultCustomerKey,$this->defaultApiKey), true); //send otp for verification
307
+ if(strcasecmp($content['status'], 'SUCCESS') == 0){
308
+ Mage::getSingleton('admin/session')->setMytextid($content['txId']);
309
+ $this->saveConfig('miniorange_2factor_show_otp',1,$id);
310
+ $this->saveConfig('miniorange_2factor_login',0,$id);
311
+ $this->saveConfig('miniorange_2factor_admin_registered',$id,$id);
312
+ $this->displayMessage('OTP has been sent to your Email. Please check your mail and enter the otp below.',"SUCCESS");
313
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
314
+ }
315
+ else{
316
+ $this->displayMessage('You are already a registered user',"ERROR");
317
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
318
+ }
319
+ }
320
+ else{
321
+ $this->displayMessage('cURL is not enabled. Please <a id="cURL" href="#cURLfaq">click here</a> to see how to enable cURL.',"ERROR");
322
+ }
323
+ }
324
+
325
+ public function registrationTimeOut(){
326
+ Mage::getSingleton('core/session')->unsmo2fqrcode($response['qrCode']);
327
+ Mage::getSingleton('core/session')->unsmo2ftransactionId($response['txId']);
328
+ $this->displayMessage('Connection TimedOut. Please click on the Re-Configure button below to configure your mobile.',"ERROR");
329
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
330
+ }
331
+
332
+ public function cancelValidationAction(){
333
+ $admin = Mage::getSingleton('admin/session')->getUser();
334
+ $id = $admin->getUserId();
335
+ $this->saveConfig('miniorange_2factor_show_otp',null,$id);
336
+ $this->saveConfig('miniorange_2factor_login',null,$id);
337
+ $this->saveConfig('miniorange_2factor_admin_registered',null,$id);
338
+ $this->saveConfig('miniorange_2factor_email',"",$id);
339
+ $this->saveConfig('miniorange_2factor_pass',"",$id);
340
+ $this->saveConfig('miniorange_2factor_phone',"",$id);
341
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
342
+ }
343
+
344
+
345
+ private function redirect($url){
346
+ $redirect = Mage::helper("adminhtml")->getUrl($url);
347
+ Mage::app()->getResponse()->setRedirect($redirect);
348
+ }
349
+
350
+ private function saveConfig($url,$value,$id){
351
+ $data = array($url=>$value);
352
+ $model = Mage::getModel('admin/user')->load($id)->addData($data);
353
+ try {
354
+ $model->setId($id)->save();
355
+ } catch (Exception $e){
356
+ Mage::log($e->getMessage(), null, 'miniorage_error.log', true);
357
+ }
358
+ }
359
+
360
+ private function displayMessage($message,$type){
361
+ Mage::getSingleton('core/session')->getMessages(true);
362
+ Mage::getSingleton('core/session')->unsSuccessMessage();
363
+ Mage::getSingleton('core/session')->unsErrorMessage();
364
+ if(strcasecmp( $type,"SUCCESS") == 0)
365
+ Mage::getSingleton('core/session')->setSuccessMessage($message);
366
+ else
367
+ Mage::getSingleton('core/session')->setErrorMessage($message);
368
+ }
369
+
370
+ private function mo2f_create_customer(){
371
+ $customer = Mage::helper('MiniOrange_2factor/mo2fUtility');
372
+ if($customer->is_curl_installed()){
373
+ $admin = Mage::getSingleton('admin/session')->getUser();
374
+ $id = $admin->getUserId();
375
+ $email = $customer->getConfig('email',$id);
376
+ $password = $customer->getConfig('pass',$id);
377
+ $customerKey = json_decode($customer->create_customer($email,'',$password), true);
378
+ if(strcasecmp($customerKey['status'], 'CUSTOMER_USERNAME_ALREADY_EXISTS') == 0) { //admin already exists in miniOrange
379
+ $content = $customer->get_customer_key($email,$password);
380
+ $customerKey = json_decode($content, true);
381
+ if(json_last_error() == JSON_ERROR_NONE) {
382
+ $collection = Mage::getModel('admin/user')->getCollection();
383
+ foreach($collection as $item){
384
+ $ids=$item->getData('user_id');
385
+ $this->saveConfig('miniorange_2factor_customer_key',$customerKey['id'],$ids);
386
+ $this->saveConfig('miniorange_2factor_api_key',$customerKey['apiKey'],$ids);
387
+ $this->saveConfig('miniorange_2factor_token',$customerKey['token'],$ids);
388
+ if($ids!=$id){
389
+ $this->saveConfig('miniorange_2factor_validated',0,$ids);
390
+ }
391
+ }
392
+ $this->saveConfig('miniorange_2factor_pass',"",$id);
393
+ $this->saveConfig('miniorange_2factor_show_otp',0,$id);
394
+ $this->saveConfig('miniorange_2factor_show_configure',1,$id);
395
+ $this->saveConfig('miniorange_2factor_validated',1,$id);
396
+ $this->saveConfig('miniorange_2factor_login',0,$id);
397
+ $this->displayMessage('Registration Complete. Please Configure your mobile',"SUCCESS");
398
+ } else {
399
+ $this->displayMessage('An error occurred while creating customer',"ERROR");
400
+ }
401
+ }else{
402
+ $collection = Mage::getModel('admin/user')->getCollection();
403
+ foreach($collection as $item){
404
+ $ids=$item->getData('user_id');
405
+ $this->saveConfig('miniorange_2factor_customer_key',$customerKey['id'],$ids);
406
+ $this->saveConfig('miniorange_2factor_api_key',$customerKey['apiKey'],$ids);
407
+ $this->saveConfig('miniorange_2factor_token',$customerKey['token'],$ids);
408
+ if($ids!=$id){
409
+ $this->saveConfig('miniorange_2factor_validated',0,$ids);
410
+ }
411
+ }
412
+ $this->saveConfig('miniorange_2factor_pass',"",$id);
413
+ $this->saveConfig('miniorange_2factor_show_otp',0,$id);
414
+ $this->saveConfig('miniorange_2factor_login',0,$id);
415
+ $this->saveConfig('miniorange_2factor_show_configure',1,$id);
416
+ $this->saveConfig('miniorange_2factor_validated',1,$id);
417
+ $this->displayMessage('Registration Complete. Please Configure your mobile',"SUCCESS");
418
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
419
+ }
420
+ }
421
+ else{
422
+ $this->displayMessage('cURL is not enabled. Please <a id="cURL" href="#cURLfaq">click here</a> to see how to enable cURL.',"ERROR");
423
+ }
424
+ }
425
+
426
+
427
+ private function mo2f_get_qr_code_for_mobile($email,$id){
428
+ $registerMobile = Mage::helper('MiniOrange_2factor/mo2fUtility');
429
+ $customer = Mage::helper('MiniOrange_2factor/mo2fUtility');
430
+ if($customer->is_curl_installed()){
431
+ $content = $registerMobile->register_mobile($email,$id);
432
+ $response = json_decode($content, true);
433
+ if(json_last_error() == JSON_ERROR_NONE) {
434
+ Mage::getSingleton('core/session')->setmo2fqrcode($response['qrCode']);
435
+ Mage::getSingleton('core/session')->setmo2ftransactionId($response['txId']);
436
+ $this->saveConfig('miniorange_2factor_show_qr',1,$id);
437
+ $this->saveConfig('miniorange_2factor_Admin_enable',1,$id);
438
+ $this->redirect("miniorange_2factor/adminhtml_index/index");
439
+ }
440
+ }
441
+ else{
442
+ $this->displayMessage('cURL is not enabled. Please <a id="cURL" href="#cURLfaq">click here</a> to see how to enable cURL.',"ERROR");
443
+ }
444
+ }
445
+
446
+
447
+
448
+
449
+ }
app/code/community/MiniOrange/2factor/Controllers/Adminhtml/Login/miniOrangeController.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MiniOrange_2factor_Adminhtml_Login_miniOrangeController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+ protected function _isAllowed(){
6
+ return true;
7
+ }
8
+
9
+ public function loginAction(){
10
+ $this->_outTemplate('miniorange_2factor/login');
11
+ }
12
+
13
+ protected function _outTemplate($tplName, $data = array()){
14
+ $this->_initLayoutMessages('adminhtml/session');
15
+ $block = $this->getLayout()->createBlock('adminhtml/template')->setTemplate("$tplName.phtml");
16
+ foreach ($data as $index => $value) {
17
+ $block->assign($index, $value);
18
+ }
19
+ $html = $block->toHtml();
20
+ Mage::getSingleton('core/translate_inline')->processResponseBody($html);
21
+ $this->getResponse()->setBody($html);
22
+ }
23
+ }
app/code/community/MiniOrange/2factor/Controllers/IndexController.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MiniOrange_2factor_IndexController extends Mage_Core_Controller_Front_Action
4
+ {
5
+ /*public function indexAction(){
6
+ $this->loadLayout();
7
+ $this->renderLayout();
8
+ }*/
9
+
10
+ /*public function checkemailAction(){
11
+ $params = $this->getRequest()->getParams();
12
+ $customer = Mage::helper('MiniOrange_2factor/customersetup');
13
+ $content = json_decode($customer->check_customer($params['email']), true);
14
+ if( strcasecmp( $content['status'], 'CUSTOMER_NOT_FOUND') == 0 ){
15
+ $content = json_decode($customer->send_otp_token($email), true); //send otp for verification
16
+ if(strcasecmp($content['status'], 'SUCCESS') == 0) {
17
+ Mage::getSingleton('core/session')->setMySessionVariable($content['txId']);
18
+ //save
19
+ }
20
+ }
21
+ $redirect = Mage::helper('core/url')->getHomeUrl().'customer/account/login#loginScreen';
22
+ $this->_redirectUrl($redirect);
23
+ }
24
+
25
+
26
+ protected function _customerExists($email){
27
+ //called to check if customer already exists
28
+ $websiteId = Mage::app()->getWebsite()->getId();
29
+ $customer = Mage::getModel('customer/customer');
30
+ if ($websiteId) {
31
+ $customer->setWebsiteId($websiteId);
32
+ }
33
+ $customer->loadByEmail($email);
34
+ if ($customer->getId()) {
35
+ return $customer;
36
+ }
37
+ return false;
38
+ }*/
39
+
40
+ }
41
+
42
+ ?>
app/code/community/MiniOrange/2factor/Helper/Data.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ class MiniOrange_2factor_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
app/code/community/MiniOrange/2factor/Helper/mo2fUtility.php ADDED
@@ -0,0 +1,433 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /** miniOrange enables user to log in through mobile authentication as an additional layer of security over password.
3
+ Copyright (C) 2015 miniOrange
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>
17
+ * @package miniOrange OAuth
18
+ * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
19
+ */
20
+ /**
21
+ This library is miniOrange Authentication Service.
22
+ Contains Request Calls to Customer service.
23
+ **/
24
+ class MiniOrange_2factor_Helper_mo2fUtility extends Mage_Core_Helper_Abstract{
25
+
26
+ public $email;
27
+ public $phone;
28
+ public $hostname = "https://test.miniorange.com";
29
+
30
+
31
+ function getHostURl(){
32
+ return $this->hostname;
33
+ }
34
+
35
+ function check_customer($email){
36
+ $url = $this->hostname . '/moas/rest/customer/check-if-exists';
37
+ $ch = curl_init( $url );
38
+
39
+ $fields = array(
40
+ 'email' => $email,
41
+ );
42
+ $field_string = json_encode( $fields );
43
+
44
+ curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
45
+ curl_setopt( $ch, CURLOPT_ENCODING, "" );
46
+ curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
47
+ curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
48
+ curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); # required for https urls
49
+
50
+ curl_setopt( $ch, CURLOPT_MAXREDIRS, 10 );
51
+ curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'charset: UTF - 8', 'Authorization: Basic' ) );
52
+ curl_setopt( $ch, CURLOPT_POST, true);
53
+ curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string);
54
+ $content = curl_exec( $ch );
55
+
56
+ if( curl_errno( $ch ) ){
57
+ echo 'Request Error:' . curl_error( $ch );
58
+ exit();
59
+ }
60
+ curl_close( $ch );
61
+
62
+ return $content;
63
+ }
64
+
65
+
66
+ function send_otp_token($email,$authType,$defaultCustomerKey,$defaultApiKey){
67
+ $url = $this->hostname . '/moas/api/auth/challenge';
68
+ $ch = curl_init($url);
69
+ $customerKey = $defaultCustomerKey;
70
+ $apiKey = $defaultApiKey;
71
+
72
+ $currentTimeInMillis = round(microtime(true) * 1000);
73
+
74
+ $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
75
+ $hashValue = hash("sha512", $stringToHash);
76
+
77
+ $customerKeyHeader = "Customer-Key: " . $customerKey;
78
+ $timestampHeader = "Timestamp: " . $currentTimeInMillis;
79
+ $authorizationHeader = "Authorization: " . $hashValue;
80
+
81
+ $fields = '';
82
+ if( $authType == 'EMAIL' ) {
83
+ $fields = array(
84
+ 'customerKey' => $customerKey,
85
+ 'email' => $email,
86
+ 'authType' => $authType,
87
+ );
88
+ }else{
89
+ $fields = array(
90
+ 'customerKey' => $customerKey,
91
+ 'username' => $email,
92
+ 'authType' => $authType,
93
+ );
94
+ }
95
+
96
+ $field_string = json_encode($fields);
97
+
98
+ curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
99
+ curl_setopt( $ch, CURLOPT_ENCODING, "" );
100
+ curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
101
+ curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
102
+ curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); # required for https urls
103
+
104
+ curl_setopt( $ch, CURLOPT_MAXREDIRS, 10 );
105
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $customerKeyHeader,
106
+ $timestampHeader, $authorizationHeader));
107
+ curl_setopt( $ch, CURLOPT_POST, true);
108
+ curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string);
109
+ $content = curl_exec($ch);
110
+
111
+ if(curl_errno($ch)){
112
+ echo 'Request Error:' . curl_error($ch);
113
+ exit();
114
+ }
115
+ curl_close($ch);
116
+ return $content;
117
+ }
118
+
119
+
120
+ function validate_otp_token($authType,$username,$transactionId,$otpToken,$defaultCustomerKey,$defaultApiKey){
121
+ $url = $this->hostname . '/moas/api/auth/validate';
122
+ $ch = curl_init($url);
123
+
124
+ /* The customer Key provided to you */
125
+ $customerKey = $defaultCustomerKey;
126
+
127
+ /* The customer API Key provided to you */
128
+ $apiKey = $defaultApiKey;
129
+
130
+ /* Current time in milliseconds since midnight, January 1, 1970 UTC. */
131
+ $currentTimeInMillis = round(microtime(true) * 1000);
132
+
133
+ /* Creating the Hash using SHA-512 algorithm */
134
+ $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
135
+ $hashValue = hash("sha512", $stringToHash);
136
+
137
+ $customerKeyHeader = "Customer-Key: " . $customerKey;
138
+ $timestampHeader = "Timestamp: " . $currentTimeInMillis;
139
+ $authorizationHeader = "Authorization: " . $hashValue;
140
+
141
+ $fields = '';
142
+ if( $authType == 'SOFT TOKEN' ) {
143
+ /*check for soft token*/
144
+ $fields = array(
145
+ 'customerKey' => $customerKey,
146
+ 'username' => $username,
147
+ 'token' => $otpToken,
148
+ 'authType' => $authType
149
+ );
150
+ }else{
151
+ //*check for otp over sms/email
152
+ $fields = array(
153
+ 'txId' => $transactionId,
154
+ 'token' => $otpToken,
155
+ );
156
+ }
157
+ $field_string = json_encode($fields);
158
+
159
+ curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
160
+ curl_setopt( $ch, CURLOPT_ENCODING, "" );
161
+ curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
162
+ curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
163
+ curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); # required for https urls
164
+
165
+ curl_setopt( $ch, CURLOPT_MAXREDIRS, 10 );
166
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $customerKeyHeader,
167
+ $timestampHeader, $authorizationHeader));
168
+ curl_setopt( $ch, CURLOPT_POST, true);
169
+ curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string);
170
+ $content = curl_exec($ch);
171
+
172
+ if(curl_errno($ch)){
173
+ echo 'Request Error:' . curl_error($ch);
174
+ exit();
175
+ }
176
+ curl_close($ch);
177
+ return $content;
178
+ }
179
+
180
+ function create_customer($email,$phone,$password){
181
+ $url = $this->hostname . '/moas/rest/customer/add';
182
+ $ch = curl_init($url);
183
+
184
+
185
+ $fields = array(
186
+ 'companyName' => $_SERVER['SERVER_NAME'],
187
+ 'areaOfInterest' => 'Magento 2 Factor Authentication Plugin',
188
+ 'email' => $email,
189
+ 'phone' => $phone,
190
+ 'password' => $password
191
+ );
192
+ $field_string = json_encode($fields);
193
+
194
+ curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
195
+ curl_setopt( $ch, CURLOPT_ENCODING, "" );
196
+ curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
197
+ curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
198
+ curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); # required for https urls
199
+
200
+ curl_setopt( $ch, CURLOPT_MAXREDIRS, 10 );
201
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array(
202
+ 'Content-Type: application/json',
203
+ 'charset: UTF - 8',
204
+ 'Authorization: Basic'
205
+ ));
206
+ curl_setopt( $ch, CURLOPT_POST, true);
207
+ curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string);
208
+ $content = curl_exec($ch);
209
+
210
+ if(curl_errno($ch)){
211
+ echo 'Request Error:' . curl_error($ch);
212
+ exit();
213
+ }
214
+
215
+
216
+ curl_close($ch);
217
+ return $content;
218
+ }
219
+
220
+ function get_customer_key($email,$password) {
221
+ $url = $this->hostname . "/moas/rest/customer/key";
222
+ $ch = curl_init($url);
223
+
224
+ $fields = array(
225
+ 'email' => $email,
226
+ 'password' => $password
227
+ );
228
+ $field_string = json_encode($fields);
229
+
230
+ curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
231
+ curl_setopt( $ch, CURLOPT_ENCODING, "" );
232
+ curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
233
+ curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
234
+ curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); # required for https urls
235
+
236
+ curl_setopt( $ch, CURLOPT_MAXREDIRS, 10 );
237
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array(
238
+ 'Content-Type: application/json',
239
+ 'charset: UTF - 8',
240
+ 'Authorization: Basic'
241
+ ));
242
+ curl_setopt( $ch, CURLOPT_POST, true);
243
+ curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string);
244
+ $content = curl_exec($ch);
245
+ if(curl_errno($ch)){
246
+ echo 'Request Error:' . curl_error($ch);
247
+ exit();
248
+ }
249
+ curl_close($ch);
250
+
251
+ return $content;
252
+ }
253
+
254
+
255
+ function submit_contact_us( $q_email, $q_phone, $query, $user) {
256
+ $url = $this->hostname . "/moas/rest/customer/contact-us";
257
+ $ch = curl_init($url);
258
+ $query = '[Magento 2 Factor Authentication Plugin]: ' . $query;
259
+ $fields = array(
260
+ 'firstName' => $user->getFirstname(),
261
+ 'lastName' => $user->getLastname(),
262
+ 'company' => $_SERVER['SERVER_NAME'],
263
+ 'email' => $q_email,
264
+ 'phone' => $q_phone,
265
+ 'query' => $query
266
+ );
267
+ $field_string = json_encode( $fields );
268
+
269
+ curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
270
+ curl_setopt( $ch, CURLOPT_ENCODING, "" );
271
+ curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
272
+ curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
273
+ curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); # required for https urls
274
+
275
+ curl_setopt( $ch, CURLOPT_MAXREDIRS, 10 );
276
+ curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'charset: UTF-8', 'Authorization: Basic' ) );
277
+ curl_setopt( $ch, CURLOPT_POST, true);
278
+ curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string);
279
+ curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 5);
280
+ curl_setopt( $ch, CURLOPT_TIMEOUT, 20);
281
+ $content = curl_exec( $ch );
282
+
283
+ if(curl_errno($ch)){
284
+ return null;
285
+ }
286
+ curl_close($ch);
287
+
288
+ return true;
289
+ }
290
+
291
+ function adminExists($username){
292
+ $adminuser = Mage::getModel('admin/user');
293
+ $adminuser->loadByUsername($username);
294
+ if ($adminuser->getId()){
295
+ return true;
296
+ }
297
+ else{
298
+ return false;
299
+ }
300
+ }
301
+
302
+ function getAdmin($username){
303
+ $adminuser = Mage::getModel('admin/user');
304
+ $adminuser->loadByUsername($username);
305
+ if ($adminuser->getId()){
306
+ return $adminuser;
307
+ }
308
+ else{
309
+ return;
310
+ }
311
+ }
312
+
313
+ function register_mobile($useremail,$id){
314
+ $url = $this->hostname . '/moas/api/auth/register-mobile';
315
+ $ch = curl_init($url);
316
+ $email = $useremail;
317
+
318
+ /* The customer Key provided to you */
319
+ $customerKey = $this->getConfig('customerKey',$id);
320
+
321
+ /* The customer API Key provided to you */
322
+ $apiKey = $this->getConfig('apiKey',$id);
323
+
324
+ /* Current time in milliseconds since midnight, January 1, 1970 UTC. */
325
+ $currentTimeInMillis = round(microtime(true) * 1000);
326
+
327
+ /* Creating the Hash using SHA-512 algorithm */
328
+ $stringToHash = $customerKey . $currentTimeInMillis . $apiKey;
329
+ $hashValue = hash("sha512", $stringToHash);
330
+
331
+ $customerKeyHeader = "Customer-Key: " . $customerKey;
332
+ $timestampHeader = "Timestamp: " . $currentTimeInMillis;
333
+ $authorizationHeader = "Authorization: " . $hashValue;
334
+
335
+ $fields = array(
336
+ 'username' => $email
337
+ );
338
+
339
+ $field_string = json_encode($fields);
340
+
341
+ curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
342
+ curl_setopt( $ch, CURLOPT_ENCODING, "" );
343
+ curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
344
+ curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
345
+ curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); # required for https urls
346
+
347
+ curl_setopt( $ch, CURLOPT_MAXREDIRS, 10 );
348
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", $customerKeyHeader, $timestampHeader, $authorizationHeader));
349
+ curl_setopt( $ch, CURLOPT_POST, true);
350
+ curl_setopt( $ch, CURLOPT_POSTFIELDS, $field_string);
351
+ $content = curl_exec($ch);
352
+
353
+ if(curl_errno($ch)){
354
+ echo 'Request Error:' . curl_error($ch);
355
+ exit();
356
+ }
357
+ curl_close($ch);
358
+ return $content;
359
+ }
360
+
361
+ /*Function to extract config stored in the database*/
362
+ function getConfig($config,$id){
363
+ switch($config){
364
+ case 'isEnabled':
365
+ $result = Mage::getModel('admin/user')->load($id)->getData('miniorange_2factor_Admin_enable');
366
+ break;
367
+ case 'email':
368
+ $result = Mage::getModel('admin/user')->load($id)->getData('miniorange_2factor_email');
369
+ break;
370
+ case 'pass':
371
+ $result = Mage::getModel('admin/user')->load($id)->getData('miniorange_2factor_pass');
372
+ break;
373
+ case 'customerKey':
374
+ $result = Mage::getModel('admin/user')->load($id)->getData('miniorange_2factor_customer_key');
375
+ break;
376
+ case 'apiKey':
377
+ $result = Mage::getModel('admin/user')->load($id)->getData('miniorange_2factor_api_key');
378
+ break;
379
+ case 'apiToken':
380
+ $result = Mage::getModel('admin/user')->load($id)->getData('miniorange_2factor_token');
381
+ break;
382
+ case 'otp':
383
+ $result = Mage::getModel('admin/user')->load($id)->getData('miniorange_2factor_show_otp');
384
+ break;
385
+ case 'qrcode':
386
+ $result = Mage::getModel('admin/user')->load($id)->getData('miniorange_2factor_show_qr');
387
+ break;
388
+ case 'configure':
389
+ $result = Mage::getModel('admin/user')->load($id)->getData('miniorange_2factor_show_configure');
390
+ break;
391
+ case 'validated':
392
+ $result = Mage::getModel('admin/user')->load($id)->getData('miniorange_2factor_validated');
393
+ break;
394
+ case 'login':
395
+ $result = Mage::getModel('admin/user')->load($id)->getData('miniorange_2factor_login');
396
+ break;
397
+ case 'mainAdmin':
398
+ $result = Mage::getModel('admin/user')->load($id)->getData('miniorange_2factor_admin_registered');
399
+ break;
400
+ case 'downloaded':
401
+ $result = Mage::getModel('admin/user')->load($id)->getData('miniorange_2factor_downloaded_app');
402
+ break;
403
+ default:
404
+ return;
405
+ break;
406
+ }
407
+ return $result;
408
+ }
409
+
410
+ /*Function to show his partial registered email to user*/
411
+ function showEmail($id){
412
+ $email = $this->getConfig('email',$id);
413
+ $emailsize = strlen($email);
414
+ $partialemail = substr($email,0,1);
415
+ $temp = strrpos($email,"@");
416
+ $endemail = substr($email,$temp-1,$emailsize);
417
+ for($i=1;$i<$temp;$i++){
418
+ $partialemail = $partialemail . 'x';
419
+ }
420
+ $showemail = $partialemail . $endemail;
421
+
422
+ return $showemail;
423
+ }
424
+
425
+ /*Function to check if cURL is enabled*/
426
+ function is_curl_installed() {
427
+ if (in_array ('curl', get_loaded_extensions())) {
428
+ return 1;
429
+ } else
430
+ return 0;
431
+ }
432
+
433
+ }?>
app/code/community/MiniOrange/2factor/Model/Observer.php ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MiniOrange_2factor_Model_Observer
3
+ {
4
+
5
+ private $defaultCustomerKey = "16352";
6
+ private $defaultApiKey = "AJG97LGpOVVwFUuuPSij5IH6Kvlu6qEj";
7
+
8
+ public function controllerActionPredispatch(Varien_Event_Observer $observer){
9
+
10
+ $request = Mage::app()->getRequest();
11
+ $session = Mage::getSingleton('adminhtml/session');
12
+ $helper = Mage::helper('MiniOrange_2factor/mo2fUtility');
13
+ if ( $request->getRequestedControllerName() == 'index' && $request->getRequestedActionName() == 'login'){
14
+ $session->unsLoginStatus();
15
+ $session->unsWelcomeMessage();
16
+ $session->unsminiError();
17
+ $session->unsshowsofttoken();
18
+ $session->unsPhoneOpen();
19
+ $request->setControllerName('miniOrange')
20
+ ->setActionName('login')
21
+ ->setDispatched(false);
22
+ }
23
+ else{
24
+ if($request->getPost('miniorange_mobile_validation_Username')){
25
+ //$user = Mage::getModel('admin/user')->loadByUsername(<username>);
26
+ $this->login($request->getPost('miniorange_mobile_validation_Username'), $request->getPost('miniorange_mobile_validation_Password'));
27
+ }
28
+ else if($request->getPost('miniorange-username')){
29
+ $user = Mage::getModel('admin/user');
30
+ Mage::getSingleton('adminhtml/session')->getMessages(true);
31
+ if($session->getLoginStatus()!='MO_2_FACTOR_CHALLENGE_AUTHENTICATION'){
32
+ if($helper->adminExists($request->getPost('miniorange-username'))){
33
+ if($user->authenticate($request->getPost('miniorange-username'),$request->getPost('miniorange-password'))){
34
+ $useragent = $_SERVER['HTTP_USER_AGENT'];
35
+ if(strpos($useragent,'Mobi') !== false){
36
+ $session->unsLoginQRCode();
37
+ $session->unsLogintxtId();
38
+ $session->setPhoneOpen(1);
39
+ $session->unsWelcomeMessage();
40
+ $session->setLoginStatus('MO_2_FACTOR_CHALLENGE_AUTHENTICATION');
41
+ }
42
+ else{
43
+ $admin = $user->login($request->getPost('miniorange-username'), $request->getPost('miniorange-password'));
44
+ $id = $admin->getUserId();
45
+ if($helper->getConfig('isEnabled',$id)==1){
46
+ $apiKey = $helper->getConfig('apiKey',$id);
47
+ $customerKey = $helper->getConfig('customerKey',$id);
48
+ $showemail = $helper->showEmail($id);
49
+ $content = $helper->send_otp_token($helper->getConfig('email',$id),'MOBILE AUTHENTICATION', $customerKey, $apiKey);
50
+ $response = json_decode($content, true);
51
+ if(json_last_error() == JSON_ERROR_NONE){
52
+ $session->setLoginUsername($request->getPost('miniorange-username'));
53
+ $session->setLoginPassword($request->getPost('miniorange-password'));
54
+ $session->setshowEmail($showemail);
55
+ $session->setLoginQRCode($response['qrCode']);
56
+ $session->setLogintxtId($response['txId']);
57
+ $session->setLoginStatus('MO_2_FACTOR_CHALLENGE_AUTHENTICATION');
58
+ $session->setWelcomeMessage(true);
59
+ $session->unsPhoneOpen();
60
+ }
61
+ else{ $session->addError("Invalid request"); }
62
+ }
63
+ else{ $this->login($request->getPost('miniorange-username'), $request->getPost('miniorange-password')); }
64
+ }
65
+ }
66
+ else{ $session->addError("Invalid Credentials. Please Enter Correct Username and Password."); }
67
+ }
68
+ else{ $session->addError("Invalid Username"); }
69
+ }
70
+ }
71
+ else if($request->getPost('softoken_entered')){
72
+ Mage::getSingleton('adminhtml/session')->getMessages(true);
73
+ if( $request->getPost('softtoken')!=null){
74
+ $user = Mage::getModel('admin/user')->login($session->getLoginUsername(),$session->getLoginPassword());
75
+ $id = $user->getUserId();
76
+ $email = $helper->getConfig('email',$id);
77
+ $customerKey = $helper->getConfig('customerKey',$id);
78
+ $apiKey = $helper->getConfig('apiKey',$id);
79
+ $content = $helper->validate_otp_token('SOFT TOKEN',$email, null, $request->getPost('softtoken'), $customerKey, $apiKey);
80
+ $response = json_decode($content, true);
81
+ if(strcasecmp($response['status'], 'FAILED') != 0){
82
+ $this->login($session->getLoginUsername(),$session->getLoginPassword());
83
+ }
84
+ else{
85
+ $session->addError("Invalid Soft Token");
86
+ }
87
+ }
88
+ else{
89
+ $session->setshowsofttoken(1);
90
+ $session->setWelcomeMessage(true);
91
+ $session->unsminiError();
92
+ $session->setminiError("Enter a 6 digit Soft Token");
93
+ }
94
+ }
95
+ else if($request->getPost('disable_forgot_phone')){
96
+ if($session->getshowforgotphone()){
97
+ $session->unsshowforgotphone();
98
+ $session->unsLoginUsername();
99
+ $session->unsLoginPassword();
100
+ $session->unsshowEmail();
101
+ $session->unsWelcomeMessage();
102
+ }
103
+ }
104
+ else if($request->getPost('enable_forgot_phone')){
105
+ Mage::getSingleton('adminhtml/session')->getMessages(true);
106
+ $session->unsWelcomeMessage();
107
+ if(!$session->getshowforgotphone()){
108
+ $user = Mage::getModel('admin/user')->login($session->getLoginUsername(),$session->getLoginPassword());
109
+ $id = $user->getUserId();
110
+ $email = $helper->getConfig('email',$id);
111
+ $customerKey = $helper->getConfig('customerKey',$id);
112
+ $apiKey = $helper->getConfig('apiKey',$id);
113
+ $response = json_decode($helper->send_otp_token($email,'EMAIL',$customerKey,$apiKey), true);
114
+ if(strcasecmp($response['status'], 'SUCCESS') == 0){
115
+ $session->setOTPtxtId($response['txId']);
116
+ $session->unsLoginQRCode();
117
+ $session->unsLoginStatus();
118
+ $session->unsLogintxtId();
119
+ $session->setshowforgotphone(1);
120
+ }
121
+ else{
122
+ $session->addError("An error occurred while sending the OTP.");
123
+ }
124
+ }
125
+ }
126
+ else if($request->getPost('forgotPhoneOtp_entered')){
127
+ Mage::getSingleton('adminhtml/session')->getMessages(true);
128
+ $user = Mage::getModel('admin/user')->login($session->getLoginUsername(),$session->getLoginPassword());
129
+ $id = $user->getUserId();
130
+ if( $request->getPost('forgotPhoneOtp')!=null){
131
+ $email = $helper->getConfig('email',$id);
132
+ $customerKey = $helper->getConfig('customerKey',$id);
133
+ $apiKey = $helper->getConfig('apiKey',$id);
134
+ $content = $helper->validate_otp_token('EMAIL',$email, $session->getOTPtxtId(), $request->getPost('forgotPhoneOtp'), $customerKey, $apiKey);
135
+ $response = json_decode($content, true);
136
+ if(strcasecmp($response['status'], 'FAILED') != 0){
137
+ $session->unsshowforgotphone();
138
+ $this->login($session->getLoginUsername(),$session->getLoginPassword());
139
+ }
140
+ else{
141
+ $session->unsshowforgotphone();
142
+ $session->addError("Invalid OTP Token.");
143
+ }
144
+ }
145
+ else{
146
+ $test = $helper->showEmail($id);
147
+ $session->unsminiError();
148
+ $session->setminiError('Cannot Submit. Please Enter the otp sent to '.$test.'.');
149
+ }
150
+ }
151
+ else{
152
+ $session->unsLoginQRCode();
153
+ $session->unsLoginStatus();
154
+ $session->unsLogintxtId();
155
+ $session->unsWelcomeMessage();
156
+ $session->unsshowsofttoken();
157
+ $session->unsminiError();
158
+ }
159
+ }
160
+ }
161
+
162
+ private function login($username,$password){
163
+ $user = Mage::getModel('admin/user');
164
+ $user->login($username, $password);
165
+ if ($user->getId()) {
166
+ if (Mage::getSingleton('adminhtml/url')->useSecretKey()) {
167
+ Mage::getSingleton('adminhtml/url')->renewSecretUrls();
168
+ }
169
+ }
170
+ $session = Mage::getSingleton('admin/session');
171
+ $session->setIsFirstVisit(true);
172
+ $session->setUser($user);
173
+ $session->setAcl(Mage::getResourceModel('admin/acl')->loadAcl());
174
+ $session->unsLoginUsername();
175
+ $session->unsLoginPassword();
176
+ $session->unsshowEmail();
177
+ $session->unsLoginQRCode();
178
+ $session->unsLoginStatus();
179
+ $session->unsLogintxtId();
180
+ $session->unsWelcomeMessage();
181
+ $session->unsminiError();
182
+ $session->unsshowsofttoken();
183
+ Mage::dispatchEvent('admin_session_user_login_success',array('user'=>$user));
184
+ }
185
+
186
+ }
app/code/community/MiniOrange/2factor/Model/Words.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MiniOrange_2factor_Model_Words
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value'=>0, 'label'=>Mage::helper('MiniOrange_2factor')->__('No')),
8
+ array('value'=>1, 'label'=>Mage::helper('MiniOrange_2factor')->__('Yes'))
9
+ );
10
+ }
11
+
12
+
13
+
14
+ /*public function getLabelText(){
15
+ return 'test';
16
+ }*/
17
+
18
+ }
app/code/community/MiniOrange/2factor/etc/adminhtml.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--Declaring the admin ACL roles-->
2
+ <adminhtml>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <miniorange_2factor_options>
12
+ <title>Second Factor Config Options</title>
13
+ </miniorange_2factor_options>
14
+ </children>
15
+ </config>
16
+ </children>
17
+ </system>
18
+ </children>
19
+ </admin>
20
+ </resources>
21
+ </acl>
22
+ </adminhtml>
app/code/community/MiniOrange/2factor/etc/config.xml ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <!-- The root node for Magento module configuration -->
4
+ <config>
5
+
6
+
7
+ <!-- The module's node contains basic information about each Magento module -->
8
+ <modules>
9
+ <!-- This must exactly match the namespace and module's folder names, with directory separators replaced by underscores -->
10
+ <MiniOrange_2factor>
11
+ <!-- The version of our module, starting at 0.0.1 -->
12
+ <version>0.0.1</version>
13
+ </MiniOrange_2factor>
14
+ </modules>
15
+
16
+ <!-- we are making changes to the backend -->
17
+ <admin>
18
+ <routers>
19
+ <adminhtml>
20
+ <args>
21
+ <modules>
22
+ <MiniOrange_2factor_Adminhtml>MiniOrange_2factor_Adminhtml_Login</MiniOrange_2factor_Adminhtml>
23
+ </modules>
24
+ </args>
25
+ </adminhtml>
26
+ <miniorange_2factor>
27
+ <use>admin</use>
28
+ <args>
29
+ <module>MiniOrange_2factor</module>
30
+ <frontName>miniorange_2factor</frontName>
31
+ </args>
32
+ </miniorange_2factor>
33
+ </routers>
34
+ </admin>
35
+ <adminhtml>
36
+ <layout>
37
+ <updates>
38
+ <miniorange_2factor_admin_layout>
39
+ <file>miniorange_2factor_admin.xml</file>
40
+ </miniorange_2factor_admin_layout>
41
+ </updates>
42
+ </layout>
43
+ <menu>
44
+ <miniOrange translate="title">
45
+ <title>miniOrange</title>
46
+ <sort_order>81</sort_order>
47
+ <children>
48
+ <configure_extension>
49
+ <title>Two Factor Configuration</title>
50
+ <sort_order>1</sort_order>
51
+ <action>miniorange_2factor/adminhtml_index</action>
52
+ </configure_extension>
53
+ </children>
54
+ </miniOrange>
55
+ </menu>
56
+ </adminhtml>
57
+
58
+
59
+ <!-- Configure our module's behavior in the global scope -->
60
+ <global>
61
+ <models>
62
+ <MiniOrange_2factor>
63
+ <class>MiniOrange_2factor_Model</class>
64
+ </MiniOrange_2factor>
65
+ </models>
66
+
67
+
68
+ <!-- Definition of our blocks -->
69
+ <blocks>
70
+ <MiniOrange_2factor>
71
+ <class>MiniOrange_2factor_Block</class>
72
+ </MiniOrange_2factor>
73
+ </blocks>
74
+
75
+
76
+ <!-- Declaration for the helper class-->
77
+ <helpers>
78
+ <MiniOrange_2factor>
79
+ <class>MiniOrange_2factor_Helper</class>
80
+ </MiniOrange_2factor>
81
+ </helpers>
82
+
83
+ <!-- Defining our event observer -->
84
+ <events>
85
+ <admin_system_config_changed_section_miniorange_2factor_options>
86
+ <observers>
87
+ <adminhtml_config_save>
88
+ <class>MiniOrange_2factor/observer</class>
89
+ <method>changeSystemConfig</method>
90
+ </adminhtml_config_save>
91
+ </observers>
92
+ </admin_system_config_changed_section_miniorange_2factor_options>
93
+
94
+ <controller_action_predispatch>
95
+ <observers>
96
+ <miniorange_2factor_login>
97
+ <class>MiniOrange_2factor/observer</class>
98
+ <method>controllerActionPredispatch</method>
99
+ </miniorange_2factor_login>
100
+ </observers>
101
+ </controller_action_predispatch>
102
+ </events>
103
+
104
+
105
+ <!-- Defining our resources -->
106
+ <resources>
107
+ <MiniOrange_2factor_setup>
108
+ <setup>
109
+ <module>MiniOrange_2factor</module>
110
+ </setup>
111
+ </MiniOrange_2factor_setup>
112
+ </resources>
113
+
114
+ </global>
115
+
116
+
117
+ </config>
app/code/community/MiniOrange/2factor/sql/MiniOrange_2factor_setup/mysql4-install-0.0.1.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+ /* @var $installer Mage_Core_Model_Resource_Setup */
5
+
6
+ $installer->startSetup();
7
+
8
+ /**
9
+ * Add yubikey field to table 'admin/user'
10
+ */
11
+ $installer->getConnection()->addColumn($this->getTable('admin/user'), 'miniorange_2factor_email', 'varchar(128) null');
12
+ $installer->getConnection()->addColumn($this->getTable('admin/user'), 'miniorange_2factor_pass', 'varchar(100) null');
13
+ $installer->getConnection()->addColumn($this->getTable('admin/user'), 'miniorange_2factor_phone', 'varchar(60) null');
14
+ $installer->getConnection()->addColumn($this->getTable('admin/user'), 'miniorange_2factor_Admin_enable', 'int null');
15
+ $installer->getConnection()->addColumn($this->getTable('admin/user'), 'miniorange_2factor_customer_key', 'varchar(25) null');
16
+ $installer->getConnection()->addColumn($this->getTable('admin/user'), 'miniorange_2factor_api_key', 'varchar(50) null');
17
+ $installer->getConnection()->addColumn($this->getTable('admin/user'), 'miniorange_2factor_token', 'varchar(50) null');
18
+ $installer->getConnection()->addColumn($this->getTable('admin/user'), 'miniorange_2factor_show_otp', 'int null');
19
+ $installer->getConnection()->addColumn($this->getTable('admin/user'), 'miniorange_2factor_show_qr', 'int null');
20
+ $installer->getConnection()->addColumn($this->getTable('admin/user'), 'miniorange_2factor_show_configure', 'int null');
21
+ $installer->getConnection()->addColumn($this->getTable('admin/user'), 'miniorange_2factor_validated', 'int null');
22
+ $installer->getConnection()->addColumn($this->getTable('admin/user'), 'miniorange_2factor_login', 'int null');
23
+ $installer->getConnection()->addColumn($this->getTable('admin/user'), 'miniorange_2factor_admin_registered', 'int null');
24
+ $installer->getConnection()->addColumn($this->getTable('admin/user'), 'miniorange_2factor_downloaded_app', 'int null');
25
+
26
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/miniorange_2factor_admin.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" ?>
2
+ <layout>
3
+ <miniorange_2factor_adminhtml_index_index>
4
+ <reference name="content">
5
+ <block type="MiniOrange_2factor/mo2fConfig" name="miniorange_2factor_mo2fConfig"
6
+ template="miniorange_2factor/mo2fConfig.phtml" />
7
+ </reference>
8
+ </miniorange_2factor_adminhtml_index_index>
9
+ </layout>
app/design/adminhtml/default/default/template/miniorange_2factor/login.phtml ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
28
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
29
+ <head>
30
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
31
+ <title><?php echo Mage::helper('adminhtml')->__('Log into Magento Admin Page') ?></title>
32
+ <link type="text/css" rel="stylesheet" href="<?php echo $this->getSkinUrl('reset.css') ?>" media="all" />
33
+ <link type="text/css" rel="stylesheet" href="<?php echo $this->getSkinUrl('boxes.css') ?>" media="all" />
34
+ <link rel="icon" href="<?php echo $this->getSkinUrl('favicon.ico') ?>" type="image/x-icon" />
35
+ <link rel="shortcut icon" href="<?php echo $this->getSkinUrl('favicon.ico') ?>" type="image/x-icon" />
36
+
37
+ <script type="text/javascript" src="<?php echo $this->getJsUrl('prototype/prototype.js') ?>"></script>
38
+ <script type="text/javascript" src="<?php echo $this->getJsUrl('prototype/validation.js') ?>"></script>
39
+ <script type="text/javascript" src="<?php echo $this->getJsUrl('scriptaculous/effects.js') ?>"></script>
40
+ <script type="text/javascript" src="<?php echo $this->getJsUrl('mage/adminhtml/form.js') ?>"></script>
41
+ <script type="text/javascript" src="<?php echo $this->getJsUrl('mage/captcha.js') ?>"></script>
42
+
43
+ <!--[if IE]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('iestyles.css') ?>" type="text/css" media="all" /> <![endif]-->
44
+ <!--[if lt IE 7]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('below_ie7.css') ?>" type="text/css" media="all" /> <![endif]-->
45
+ <!--[if IE 7]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('ie7.css') ?>" type="text/css" media="all" /> <![endif]-->
46
+
47
+ <style>
48
+ .label,.label-progressBar{font-weight:700;font-size:15px}#error-cancel,#slide1,#slide2,#slide3,.button,.login-header a,.login-header a:hover{text-decoration:none}.miniorange-password,.miniorange-username{display:inline;float:left;width:50%}#miniorange-button{margin-top:1%;float:right}#logo-miniorange{width:44%;margin-left:2%;margin-top:2%}#loginScreen,.center{text-align:center;width:100%}.center{display:table}#showQrCode{margin:5%}#loginScreen{position:fixed;top:0;left:0;height:100%;z-index:10;display:none;background-color:rgba(0,0,0,.5)}.label{float:left}.login-content{height:84%}.login-footer,.login-header{padding:1%;position:relative;height:6%;background:#D0D0D0}.login-header{border-radius:7px 7px 0 0;font-size:18px;font-weight:700}.login-footer{border-radius:0 0 7px 7px}.login-header a{float:right;cursor:pointer;font-size:20px;padding:1%}.login-header a:hover{color:#F0F}.form a{margin-bottom:4%;text-align:center;display:table-cell;vertical-align:middle}.button{padding:8px 40px;cursor:pointer;font-size:14px}.panel-content{width:450px;height:400px;margin:-250px auto 0 -220px;position:absolute;left:50%;top:50%;z-index:100;overflow:visible;background-color:#fff;border-radius:7px;box-shadow:4px 4px 3px #484848}.form #email{float:left;width:100%}.progressBar{display:none;margin:0 auto;position:absolute}#label-progressBar,#label-progressBar-forgotphone{margin:2% 0;font-size:15px}#forgotPhone,#softoken{display:none;padding:5%}.info{font-size:15px;margin-bottom:3%;color:#ea7601}#forgotPhoneOtp,#softokeninput{display:block;margin:0;width:100%;font-family:sans-serif;font-size:13px}#forgotPhone-button,#softtoken-button{margin-bottom:8%;font-size:15px;padding:8px 20px;text-decoration:none;text-shadow:0 1px 0 #b23e35;border-radius:3px;border:1px solid #000;display:inline-block;cursor:pointer;color:#fff;background-color:#f7934d}input[type=number],textarea{box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;border:1px solid #c2c2c2;box-shadow:1px 1px 4px #ebebeb;-moz-box-shadow:1px 1px 4px #ebebeb;-webkit-box-shadow:1px 1px 4px #ebebeb;border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;padding:7px;outline:0;width:100%}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}td>input:focus,textarea:focus{border:1px solid #ff8500}#forgotphoneform,#softokenform{margin-top:1%;float:left;width:100%}#slider2>ul>li>img,#slider3>ul>li>img,#slider>ul>li>img{left:0}#slider,#slider2,#slider3{position:relative;overflow:hidden;padding-top:5%;display:none}#slider2>ul,#slider3>ul,#slider>ul{position:relative;margin:0;padding:0;height:200px;list-style:none}#slider2>ul>li,#slider3>ul>li,#slider>ul>li{position:relative;display:block;float:left;margin:0;padding:0;width:450px;height:260px;text-align:center}.control_info,.control_next,.control_prev{position:absolute;z-index:999;cursor:pointer}.control_prev{left:0;top:49%;transform:rotate(180deg)}.control_next{right:0;top:50%}#goBack1,#goBack2,#goBack3{display:none;font-size:14px;position:absolute;right:34%}#slide1,#slide2,#slide3{cursor:pointer;font-size:14px}.mini-messages li{display:none;margin:0 5%;min-height:23px!important;padding:4px 0 1px 8px!important;font-weight:700!important;text-align:left}#error-cancel{color:red;font-size:21px;float:right}
49
+ </style>
50
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
51
+ <script type="text/javascript">jQuery.noConflict()</script>
52
+ <script>
53
+ $j=jQuery.noConflict();$j(document).ready(function(){$forgotphone="<?php echo Mage::getSingleton('adminhtml/session')->getshowforgotphone(); ?>";$softtoken="<?php echo Mage::getSingleton('adminhtml/session')->getshowsofttoken(); ?>";$error='<?php echo Mage::getSingleton('adminhtml/session')->getminiError(); ?>';$openedinphone='<?php echo Mage::getSingleton('adminhtml/session')->getPhoneOpen(); ?>'
54
+ if($openedinphone=="1"){$softtoken='1';$j("#goBack").css("display","none");}
55
+ $j("#label-progressBar").css("display","block");$j("#label-progressBar-forgotphone").css("display","none");if($forgotphone=="1"){$j("#loginScreen").css("display","block");$j("#QrCode").css("display","none");$j("#softoken").css("display","none");$j("#forgotPhone").css("display","block");if($error!=""){$j(".error-msg span").empty();$j(".error-msg span").append($error);$j(".mini-messages li").css("display","block");}}
56
+ if($softtoken=="1"){$j("#loginScreen").css("display","block");$j("#QrCode").css("display","none");$j("#forgotPhone").css("display","none");$j("#softoken").css("display","block");if($error!=""){$j(".error-msg span").empty();$j(".error-msg span").append($error);$j(".mini-messages li").css("display","block");}}
57
+ $j('#error-cancel').click(function(){$error="";$j(".mini-messages li").css("display","none");});$j("#cancel").click(function(){$j("#softoken").css("display","none");$j("#QrCode").css("display","block");$j("#loginScreen").css("display","none");$j(".mini-messages li").css("display","none");});$j("#offlinebutton").click(function(){$j("#QrCode").css("display","none");$j("#forgotPhone").css("display","none");$j("#softoken").css("display","block");$j(".mini-messages li").css("display","none");});$j("#forgotphonebutton1").click(function(){$j("#QrCode").css("display","none");$j("#softoken").css("display","none");$j("#label-progressBar").css("display","none");$j("#label-progressBar-forgotphone").css("display","block");$j("#progressBar").css("display","block");$j("#enableforgotphone").submit();$j(".mini-messages li").css("display","none");});$j("#forgotphonebutton2").click(function(){$j("#QrCode").css("display","none");$j("#softoken").css("display","none");$j("#label-progressBar").css("display","none");$j("#label-progressBar-forgotphone").css("display","block");$j("#progressBar").css("display","block");$j("#enableforgotphone").submit();$j(".mini-messages li").css("display","none");});$j("#goBack").click(function(){$j("#softoken").css("display","none");$j("#forgotPhone").css("display","none");$j("#QrCode").css("display","block");$j(".mini-messages li").css("display","none");});$j("#softtoken-button").click(function(){$j("#softoken").css("display","none");$j("#progressBar").css("display","block");$j("#label-progressBar").css("display","block");$j("#label-progressBar-forgotphone").css("display","none");$j(".mini-messages li").css("display","none");});$j("#forgotPhone-button").click(function(){$j("#forgotPhone").css("display","none");$j("#label-progressBar-forgotphone").css("display","none");$j("#progressBar").css("display","block");$j(".mini-messages li").css("display","none");});$j("#gobacklogin").click(function(){$j("#label-progressBar-forgotphone").css("display","none");$j("#disableforgotphone").submit();$j(".mini-messages li").css("display","none");});$j("#slide1").click(function(){$j("#QrCode").css("display","none");$j("#softoken").css("display","none");$j("#slider").css("display","block");$j("#logo").hide();$j("#goBack1").css("display","block");$j(".mini-messages li").css("display","none");});$j("#goBack1").click(function(){$j("#slider").css("display","none");$j("#logo").show();$j("#QrCode").css("display","block");$j("#goBack1").css("display","none");});$j("#slide2").click(function(){$j("#softoken").css("display","none");$j("#slider2").css("display","block");$j("#logo").hide();$j(".mini-messages li").css("display","none");$j("#goBack2").css("display","block");});$j("#goBack2").click(function(){$j("#slider2").css("display","none");$j("#logo").show();$j("#softoken").css("display","block");$j("#goBack2").css("display","none");});$j("#slide3").click(function(){$j("#forgotPhone").css("display","none");$j("#slider3").css("display","block");$j("#logo").hide();$j(".mini-messages li").css("display","none");$j("#goBack3").css("display","block");});$j("#goBack3").click(function(){$j("#slider3").css("display","none");$j("#logo").show();$j("#forgotPhone").css("display","block");$j("#goBack3").css("display","none");});$showloginscreen="<?php echo Mage::getSingleton('adminhtml/session')->getWelcomeMessage() ?>";if($showloginscreen=="1"){$j("#loginScreen").css("display","block");}});
58
+ </script>
59
+ <script>
60
+ var poll="<?php echo Mage::getSingleton('adminhtml/session')->getWelcomeMessage() ?>";if(poll=="1"){var $t=jQuery.noConflict();var timeout;function pollMobileValidation()
61
+ {var transId="<?php echo Mage::getSingleton('adminhtml/session')->getLogintxtId() ?>";var jsonString="{\"txId\":\""+transId+"\"}";var postUrl="<?php echo Mage::helper('MiniOrange_2factor/mo2fUtility')->getHostURl()?>/moas/api/auth/auth-status";$t.ajax({url:postUrl,type:"POST",dataType:"json",data:jsonString,contentType:"application/json; charset=utf-8",success:function(result){var status=JSON.parse(JSON.stringify(result)).status;if(status=='SUCCESS'){var content="<div id='success'><center><img src='"+"<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/right.png'; ?>"+"'/></center></div>";$t("#showQrCode").empty();$t("#showQrCode").append(content);setTimeout(function(){$t("#QrCode").hide();$t("#features").hide();$t("#progressBar").show();$t("#mobile_validation_form").submit();},1000);}else if(status=='ERROR'||status=='FAILED'){var content="<div id='error'><center><img src='"+"<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/wrong.png'; ?>"+"' /></center></div>";$t("#showQrCode").empty();$t("#features").hide();$t("#showQrCode").append(content);setTimeout(function(){$t('#backto_mo_loginform').submit();},1000);}else{timeout=setTimeout(pollMobileValidation,3000);}}});}
62
+ pollMobileValidation();}
63
+ </script>
64
+ <script>
65
+ var $j=jQuery.noConflict();$j(document).ready(function($j){var slideCount=$j('#slider ul li').length;var slideWidth=$j('#slider ul li').width();var slideHeight=$j('#slider ul li').height();var sliderUlWidth=slideCount*slideWidth;$j('#slider').css({width:slideWidth,height:slideHeight});$j('#slider ul').css({width:sliderUlWidth,marginLeft:-slideWidth});$j('#slider ul li:last-child').prependTo('#slider ul');function moveLeft(){$j('#slider ul').fadeOut("slow",function(){$j('#slider ul li:last-child').prependTo('#slider ul');$j('#slider ul').css('left','');$j('#slider ul').fadeIn("slow");});};function moveRight(){$j('#slider ul').fadeOut("slow",function(){$j('#slider ul li:first-child').appendTo('#slider ul').fadeIn("slow");$j('#slider ul').css('left','');$j('#slider ul').fadeIn("slow");});};$j('#slider .control_prev').click(function(){moveLeft();});$j('#slider .control_next').click(function(){moveRight();});});$j(document).ready(function($j){var slideCount=$j('#slider2 ul li').length;var slideWidth=$j('#slider2 ul li').width();var slideHeight=$j('#slider2 ul li').height();var sliderUlWidth=slideCount*slideWidth;$j('#slider2').css({width:slideWidth,height:slideHeight});$j('#slider2 ul').css({width:sliderUlWidth,marginLeft:-slideWidth});$j('#slider2 ul li:last-child').prependTo('#slider2 ul');function moveLeft(){$j('#slider2 ul').fadeOut("slow",function(){$j('#slider2 ul li:last-child').prependTo('#slider2 ul').fadeIn("slow");$j('#slider2 ul').css('left','');$j('#slider2 ul').fadeIn("slow");});};function moveRight(){$j('#slider2 ul').fadeOut("slow",function(){$j('#slider2 ul li:first-child').appendTo('#slider2 ul').fadeIn("slow");$j('#slider2 ul').css('left','');$j('#slider2 ul').fadeIn("slow");});};$j('#slider2 .control_prev').click(function(){moveLeft();});$j('#slider2 .control_next').click(function(){moveRight();});});$j(document).ready(function($j){var slideCount=$j('#slider3 ul li').length;var slideWidth=$j('#slider3 ul li').width();var slideHeight=$j('#slider3 ul li').height();var sliderUlWidth=slideCount*slideWidth;$j('#slider3').css({width:slideWidth,height:slideHeight});$j('#slider3 ul').css({width:sliderUlWidth,marginLeft:-slideWidth});$j('#slider3 ul li:last-child').prependTo('#slider3 ul');function moveLeft(){$j('#slider3 ul').fadeOut("slow",function(){$j('#slider3 ul li:last-child').prependTo('#slider3 ul').fadeIn("slow");$j('#slider3 ul').css('left','');$j('#slider3 ul').fadeIn("slow");});};function moveRight(){$j('#slider3 ul').fadeOut("slow",function(){$j('#slider3 ul li:first-child').appendTo('#slider3 ul').fadeIn("slow");$j('#slider3 ul').css('left','');$j('#slider3 ul').fadeIn("slow");});};$j('#slider3 .control_prev').click(function(){moveLeft();});$j('#slider3 .control_next').click(function(){moveRight();});});
66
+ </script>
67
+ </head>
68
+ <body id="page-login" onload="document.forms.loginForm.username.focus();">
69
+ <div class="login-container">
70
+ <div class="login-box">
71
+ <form method="post" action="" id="loginForm" autocomplete="off">
72
+ <div class="login-form">
73
+
74
+ <input name="form_key" type="hidden" value="" />
75
+ <h2><?php echo Mage::helper('adminhtml')->__('Log in to Admin Panel') ?></h2>
76
+ <div id="messages">
77
+ <?php echo $this->getMessagesBlock()->toHtml() ?>
78
+ </div>
79
+ <div class="input-box input-left"><label for="username"><?php echo Mage::helper('adminhtml')->__('User Name:') ?></label><br/>
80
+ <input type="text" id="username" name="miniorange-username" value="" class="required-entry input-text" /></div>
81
+ <div class="input-box input-right"><label for="login"><?php echo Mage::helper('adminhtml')->__('Password:') ?></label><br />
82
+ <!-- This is a dummy hidden field to trick firefox from auto filling the password -->
83
+ <input type="text" class="input-text no-display" name="dummy" id="dummy" />
84
+ <input type="password" id="login" name="miniorange-password" class="required-entry input-text" value="" /></div>
85
+ <?php echo $this->getChildHtml('form.additional.info'); ?>
86
+ <div class="clear"></div>
87
+ <div class="form-buttons">
88
+ <a class="left" href="<?php echo Mage::helper('adminhtml')->getUrl('adminhtml/index/forgotpassword', array('_nosecret' => true)) ?>"><?php echo Mage::helper('adminhtml')->__('Forgot your password?') ?></a>
89
+ <input type="submit" class="form-button" value="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('adminhtml')->__('Login')) ?>" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('adminhtml')->__('Login')) ?>" /></div>
90
+ </div>
91
+ <p class="legal"><?php echo Mage::helper('adminhtml')->__('Magento is a trademark of Magento Inc. Copyright &copy; %s Magento Inc.', date('Y')) ?></p>
92
+ </form>
93
+ <div class="bottom"></div>
94
+ <script type="text/javascript">
95
+ var loginForm = new varienForm('loginForm');
96
+ </script>
97
+ </div>
98
+ </div>
99
+
100
+ <form name="f" id="backto_mo_loginform" method="post" action="" hidden>
101
+ <input type="hidden" name="miniorange_mobile_validation_failed" value="" />
102
+ </form>
103
+ <form name="f" id="mobile_validation_form" method="post" action="">
104
+ <input type="hidden" name="miniorange_mobile_validation_Username" value="<?php echo Mage::getSingleton('adminhtml/session')->getLoginUsername() ?>" />
105
+ <input type="hidden" name="miniorange_mobile_validation_Password" value="<?php echo Mage::getSingleton('adminhtml/session')->getLoginPassword() ?>" />
106
+ </form>
107
+ <!-- Our login popup-->
108
+ <div id="loginScreen">
109
+ <div class="panel-content">
110
+ <div class="login-header">
111
+ <a id="cancel" href="#">&times;</a>
112
+ </div>
113
+ <div class="login-content">
114
+ <center>
115
+ <a id="logo" href="#loginScreen"><img id="logo-miniorange" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/miniorange_logo.png'; ?>"/></a>
116
+ </center>
117
+ <div id="messages">
118
+ <ul class="mini-messages"><li class="error-msg"><ul><li><span></span><a id="error-cancel" href="#">&times;</a></li></ul></li></ul>
119
+ </div>
120
+ <div id="QrCode" class="form">
121
+ <center><a id="slide1" href="#slider">« See How it Works »</a></center>
122
+ <div id="showQrCode">
123
+ <center> <img src="data:image/jpg;base64,<?php echo Mage::getSingleton('adminhtml/session')->getLoginQRCode(); ?>"/></center>
124
+ </div>
125
+ <div id="features">
126
+ <center>
127
+ <a class="button" id="offlinebutton" href="#softoken">Phone is Offline?</a>
128
+ <a class="button" id="forgotphonebutton1" href="#">Forgot your Phone?</a>
129
+ </center>
130
+ </div>
131
+ </div>
132
+ <div id="softoken">
133
+ <center><a id="slide2" href="#slider2">« See How it Works »</a></center><br/>
134
+ <div class="label"><span><?php echo Mage::helper('adminhtml')->__('Soft Token:') ?></span></div><br/>
135
+ <center>
136
+ <form name="f" method="post" action="" id="softokenform" autocomplete="off">
137
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
138
+ <input type="number" name="softtoken" autofocus="true" id="softokeninput" title="6 Digit Soft Token" placeholder="Enter Soft Token using miniOrange Authenticator App" pattern="[0-9]{6}"/><br/>
139
+ <input type="hidden" name="softoken_entered" value="softoken_entered" />
140
+ <input type="submit" id="softtoken-button" value="<?php echo Mage::helper('adminhtml')->__('Submit') ?>" /><br/>
141
+ </form>
142
+ <a class="button" id="goBack" href="#QrCode">« Scan Qr Code</a>
143
+ <a class="button" id="forgotphonebutton2" href="#">Forgot Phone?</a>
144
+ </center>
145
+ </div>
146
+ <form name="f" method="post" id="enableforgotphone" action="">
147
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
148
+ <input type="hidden" name="enable_forgot_phone" value="enable_forgot_phone" />
149
+ </form>
150
+ <form name="f" method="post" id="disableforgotphone" action="">
151
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
152
+ <input type="hidden" name="disable_forgot_phone" value="disable_forgot_phone" />
153
+ </form>
154
+ <div id="forgotPhone">
155
+ <center><a id="slide3" href="#slider3">« See How it Works »</a></center><br/>
156
+ <div class="label"><span><?php echo Mage::helper('adminhtml')->__('OTP:') ?></span></div><br/>
157
+ <center>
158
+ <form method="post" action="" id="loginform" autocomplete="off">
159
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
160
+ <input type="number" name="forgotPhoneOtp" autofocus="true" id="forgotPhoneOtp" placeholder="Enter OTP sent to <?php echo Mage::getSingleton('adminhtml/session')->getshowEmail() ?>." class="required-entry input-text" pattern="[0-9]{4,6}"/><br/>
161
+ <input type="hidden" name="forgotPhoneOtp_entered" value="forgotPhoneOtp_entered" />
162
+ <input type="submit" id="forgotPhone-button" value="<?php echo Mage::helper('adminhtml')->__('Submit') ?>" /><br/>
163
+ <a class="button" id="gobacklogin" href="#">« Back to Login</a>
164
+ </form>
165
+ </center>
166
+ </div>
167
+ <div class="progressBar center" id="progressBar">
168
+ <div class="label-progressBar"><span id="label-progressBar"><?php echo Mage::helper('adminhtml')->__('Processing your request. Please Wait!') ?></span>
169
+ <span id="label-progressBar-forgotphone"><?php
170
+ $email = Mage::getSingleton('adminhtml/session')->getshowEmail();
171
+ echo Mage::helper('adminhtml')->__('Sending OTP to '.$email.'. Please Wait!')
172
+ ?></span>
173
+ </div>
174
+ <br/>
175
+ <span
176
+ style=" background:url('http://auth.miniorange.com/moas/images/ajax-loader4.gif')no-repeat;
177
+ display:block;
178
+ margin: 0 auto;
179
+ height:140px;
180
+ width:140px">
181
+ </span>
182
+ </div>
183
+
184
+
185
+ <div class="collapse" id="">
186
+ <div id="slider">
187
+ <div class="control_next"><img src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/arrow.png'; ?>' /></div>
188
+ <div class="control_prev"><img src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/arrow.png'; ?>' /></div>
189
+ <ul>
190
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/login2.png'; ?>' /></li>
191
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/authenticate.png'; ?>' /></li>
192
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/mobilescan.png'; ?>' /></li>
193
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/authvalidate.png'; ?>' /></li>
194
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/login3.png'; ?>' /></li>
195
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/processing.png'; ?>' /></li>
196
+ <li><img style="height:26%; position: relative; top: 44%" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/loggedin.png'; ?>' /></li>
197
+ </ul>
198
+ </div>
199
+ <a class="button" id="goBack1" href="#">« Go Back</a>
200
+ <div id="slider2">
201
+ <div class="control_next"><img src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/arrow.png'; ?>' /></div>
202
+ <div class="control_prev"><img src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/arrow.png'; ?>' /></div>
203
+ <ul>
204
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/phone-offline.png'; ?>' /></li>
205
+ <li><img style="height: 85%;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/settings.png'; ?>' /></li>
206
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/sync.png'; ?>' /></li>
207
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/softokenmobile.png'; ?>' /></li>
208
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/softtoken.png'; ?>' /></li>
209
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/processing.png'; ?>' /></li>
210
+ <li><img style="height:26%; position: relative; top: 44%" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/loggedin.png'; ?>' /></li>
211
+ </ul>
212
+ </div>
213
+ <a class="button" id="goBack2" href="#">« Go Back</a>
214
+ <div id="slider3">
215
+ <div class="control_next"><img src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/arrow.png'; ?>' /></div>
216
+ <div class="control_prev"><img src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/arrow.png'; ?>' /></div>
217
+ <ul>
218
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/forgot-phone.png'; ?>' /></li>
219
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/sendingotp.png'; ?>' /></li>
220
+ <li><img style="width: 80%; position: relative; top: 35%" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/mail.png'; ?>' /></li>
221
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/forgotphone.png'; ?>' /></li>
222
+ <li><img style="height: inherit;" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/processing.png'; ?>' /></li>
223
+ <li><img style="height:26%; position: relative; top: 44%" src='<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'adminhtml/default/default/images/MiniOrange_2factor/loggedin.png'; ?>' /></li>
224
+ </ul>
225
+ </div>
226
+ <a class="button" id="goBack3" href="#">« Go Back</a>
227
+ </div>
228
+ </div>
229
+ <div class="login-footer"></div>
230
+ </div>
231
+ </div>
232
+ </div>
233
+ </body>
234
+ </html>
app/design/adminhtml/default/default/template/miniorange_2factor/mo2fConfig.phtml ADDED
@@ -0,0 +1,508 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <link href="http://miniorange.com/css/telephone.css" rel="stylesheet">
4
+ <style>
5
+ .heading>h3,table{font-family:sans-serif}.container{width:63%;float:left}.container-page{border:1px solid #c1bdbd;border-top-color:transparent;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.heading>h3{margin-left:5px;font-size:18px;text-decoration:underline;line-height:1.1;color:inherit}.mo2f_table_layout h3{margin-left:5px;margin-bottom:1%}.navbar-tabs{border-bottom:1px solid #c1bdbd}.navbar-tabs>li.active>a,.navbar-tabs>li.active>a:focus,.navbar-tabs>li.active>a:hover,.navbar-tabs>li.always-active>a,.navbar-tabs>li.always-active>a:focus,.navbar-tabs>li.always-active>a:hover{color:#000;font-size:15px;cursor:default;background-color:#fff;border:1px solid #c1bdbd;border-bottom-color:transparent}.navbar-tabs>li>a{font-size:15px;margin-right:2px;line-height:1.42857143;border-radius:4px 4px 0 0;color:#555;text-decoration:none;background:#F7F7F7;border-right:1px solid #DAD7D7;border-left:1px solid #FFF}.navbar-tabs>li{float:left;margin-bottom:-1px}.navbar ul{margin-top:0;margin-bottom:10px}.navbar-tabs>li>a:hover{border-color:#eee #eee #c1bdbd}.navbar>li>a:hover{text-decoration:none;background-color:#eee;border:1px solid #B7B5B5}a:focus,a:hover{color:#23527c;outline:0}.navbar{padding-left:0;margin-bottom:0;list-style:none;width:100%;min-width:400px}.navbar>li>a{position:relative;display:block;padding:10px 15px;cursor:pointer}.navbar:after,.navbar:before{display:table;content:"";clear:both}#accountsetup,#configuremobile,#helptrouble,#howitworks,#loginsettings,#userprofile{display:none}.page,table{display:block}.mo2f_support_layout{padding-left:3%;padding-top:2%;padding-bottom:2%;border:1px solid #c1bdbd;border-top-color:transparent;border-bottom-left-radius:4px;border-bottom-right-radius:4px;min-width:410px;height:440px}.mo2f_table_layout{margin-top:1%;margin-bottom:3%}.page{padding:0 1%;min-height:425px}td,th{padding:10px 15px}table{overflow:auto}td{color:#6f6f6f}input[type=submit]{border:0;padding:8px 15px;background:#ff8500;color:#fff;box-shadow:1px 1px 4px #dadada;-moz-box-shadow:1px 1px 4px #dadada;-webkit-box-shadow:1px 1px 4px #dadada;border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-webkit-appearance:button;cursor:pointer}input[type=submit]:hover{background:#ea7b00;color:#fff}td>input,textarea{box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;border:1px solid #c2c2c2;box-shadow:1px 1px 4px #ebebeb;-moz-box-shadow:1px 1px 4px #ebebeb;-webkit-box-shadow:1px 1px 4px #ebebeb;border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;padding:7px;outline:0;width:330px}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.btn-link,hr{margin-bottom:1%}input[type=number]{-moz-appearance:textfield}td>input:focus,textarea:focus{border:1px solid #ff8500}input[type=checkbox]{cursor:pointer;width:17px;height:16px;margin-right:1%;margin-left:1%}.button-align{display:inline-block;text-align:left;padding-left:4%}.center{width:100%;display:table;text-align:center}#minisupport{float:left;margin-left:2%}hr{border:0;border-top:1px solid #c1bdbd;border-bottom:1px solid #fafafa}#displayQrCode,.collapse,.panel-body{background:#F7F7F7;border-radius:4px}.required{color:red;margin-left:1%}.panel-body>ol{list-style:disc;margin-left:5%}.collapse{display:none;padding:2%;margin:1%;text-align:justify;font-size:13px}.collapse>ol{list-style:disc;margin-left:2%}.btn-link{color:#ea7601;font-size:16px;cursor:pointer}.btn-link>li{margin-left:3%}.btn-link>li:before{content:"";display:block;left:-1em;top:.7em;position:relative;width:0;height:0;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:7px solid #ea7b00}#displayQrCode{height:200px;margin-top:1%;padding-top:3%}#displayQrCode>img{margin-left:-1%;height:180px}#additional_admin,#already_registered{display:none}#slider,#slider2,#slider3,#slider4,#slider5,#slider6{position:relative;overflow:hidden}#slider ul,#slider2 ul,#slider3 ul,#slider4 ul,#slider5 ul,#slider6 ul{position:relative;margin:0;padding:0;height:200px;list-style:none}#slider ul li,#slider2 ul li,#slider3 ul li,#slider4 ul li,#slider5 ul li,#slider6 ul li{position:relative;display:block;float:left;margin:0;padding:0;width:750px;height:400px;text-align:center}.control_info,.control_next,.control_prev{position:absolute;z-index:999;cursor:pointer}.control_prev{left:0;top:49%;transform:rotate(180deg)}.control_next{right:0;top:50%}.control_info{border-radius:0 2px 2px 0;height:26%;opacity:.5;left:17%;width:70%;bottom:0}#showDownload{margin:2% 0}@media screen and (max-width:1270px){#minisupport{float:inherit;margin-left:0;margin-top:1%}.container{width:100%}}#userprofile table{width:90%;margin-top:2%;border-radius:4px;border-collapse:collapse}#userprofile table td,#userprofile table th{width:100%;border:2px solid #ccc;text-align:left;font-size:15px}#error-cancel,#success-cancel{text-decoration:none;font-size:21px;float:right}#userprofile table th{background:#F7F7F7}#slider2>ul>li>img,#slider3>ul>li>img,#slider4>ul>li>img,#slider5>ul>li>img,#slider>ul>li>img{left:0}#configureMobileButton{display:none}#messages{margin:1%}.mini-messages li{display:none;min-height:23px!important;padding:4px 4px 1px 18px!important;font-weight:700!important;text-align:left}#error-cancel{color:red}#success-cancel{color:#72C868}
6
+ .intl-number-input input {height: 30px; padding-left: 40px; box-sizing: border-box;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;border: 1px solid #c2c2c2;box-shadow: 1px 1px 4px #ebebeb;-moz-box-shadow: 1px 1px 4px #ebebeb;-webkit-box-shadow: 1px 1px 4px #ebebeb;border-radius: 3px;-webkit-border-radius: 3px;-moz-border-radius: 3px; outline: 0; width:330px;}
7
+ .intl-number-input .flag-dropdown .selected-flag {margin: 7px 7px; padding:0;}
8
+ </style>
9
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
10
+ <script src="http://miniorange.com/js/intlTelInput.min.js"></script>
11
+ <script>
12
+ var $m=jQuery.noConflict();$m(document).ready(function(){$m("#phone").intlTelInput();$email="<?php echo $this->getConfig('email')?>";$showotp="<?php echo $this->getConfig('otp')?>";$showqr="<?php echo $this->getConfig('qrcode')?>";$configure="<?php echo $this->getConfig('configure')?>";$showlogin="<?php echo $this->getConfig('login')?>";$validated="<?php echo $this->getConfig('validated')?>";$downloaded="<?php echo $this->getConfig('downloaded')?>";$OTPsent="<?php echo Mage::getSingleton('admin/session')->getOTPsent();?>";$showloginsettings="<?php echo Mage::getSingleton('admin/session')->getshowLoginSettings(); ?>";$success='<?php echo Mage::getSingleton('core/session')->getSuccessMessage(); ?>';$error='<?php echo Mage::getSingleton('core/session')->getErrorMessage(); ?>';if($email==""){if($OTPsent!=""){$error="An error occured while saving your registration details. Please Flush you Magento Cache. [ <a id='preview9' href='#slider6'>Click Here</a> for a preview. ]"}}
13
+ if($error!=""){$m(".error-msg span").empty();$m(".error-msg span").append($error);$m(".mini-messages li").css("display","block");$m(".success-msg").css("display","none");}
14
+ if($success!=""){$m(".success-msg span").empty();$m(".success-msg span").append($success);$m(".mini-messages li").css("display","block");$m(".error-msg").css("display","none");}
15
+ if($showotp==0&&$email!=""){$m("#account_setup").css("display","none");if($configure==1){$m("#configuremobile").css("display","block");voiddisplay("#configuremobile");setactive('configure_mobile');}
16
+ else if($showloginsettings==1){$m("#login_settings").css("display","block");voiddisplay("#loginsettings");setactive('login_settings');$m("#displayQrCode").hide();$m("#configureMobileButton").css("display","block");}
17
+ else{$m("#user_profile").css("display","block");voiddisplay("#userprofile");setactive('user_profile');$m("#displayQrCode").hide();$m("#configureMobileButton").css("display","block");}}
18
+ else{if($showlogin==1){$m("#account_setup").css("display","block");$m("#already_registered").css("display","block");$m("#register_miniorange").css("display","none");voiddisplay("#accountsetup");$m("#user_profile").css("display","none");setactive('account_setup');}
19
+ else if($validated==0&&$validated!=""){$m("#account_setup").css("display","block");$m("#additional_admin").css("display","block");$m("#register_miniorange").css("display","none");voiddisplay("#accountsetup");$m("#user_profile").css("display","none");setactive('account_setup');}
20
+ else{$m("#account_setup").css("display","block");$m("#already_registered").css("display","none");$m("#register_miniorange").css("display","block");voiddisplay("#accountsetup");$m("#user_profile").css("display","none");setactive('account_setup');}}
21
+ if($downloaded==1){$m('#showDownload').attr('checked',true);$m("#showDownload").val(1);}
22
+ if($m("#showDownload").is(":checked")){$m("#configureqr").css("display","block");$m("#downloadscreen").css("display","none");}
23
+ else{$m("#configureqr").css("display","none");$m("#downloadscreen").css("display","block");}
24
+ if($showqr==1){$content="<?php echo "<img src='data:image/jpg;base64," . $this->getqrCode() . "'/>" ?>";$m("#displayQrCode").empty();$m("#displayQrCode").append($content);document.location.href="#displayQrCode";}
25
+ if($showotp==1){$m(".register_miniorange").hide();$m("#additional_admin").hide();$m(".validate_otp").show();$m("#validateotp").focus();}
26
+ else{$m(".validate_otp").hide();$m(".register_miniorange").show();}
27
+ $m(".navbar a").click(function(){$id=this.className;setactive($id);$href=$m(this).attr('id')
28
+ voiddisplay($href);});$m(".btn-link").click(function(){$m(".collapse").slideUp("slow");if(!$m(this).next("div").is(':visible')){$m(this).next("div").slideDown("slow");}});$m('#showDownload').change(function(){if($m(this).attr('checked')){$m(this).val(0);$m(this).attr('checked',false);}else{$m(this).val(1);$m(this).attr('checked',true);$m("#configureMobileButton").click();}
29
+ $m("#downloadscreen").slideToggle();$m("#configureqr").slideToggle();document.location.href="#displayQrCode";});$m("#configureMobileButton").click(function(){$append='<span style=" background:url("http://auth.miniorange.com/moas/images/ajax-loader4.gif")no-repeat; display:block; margin: 3% auto;height:140px; width:140px"></span>'
30
+ $m('#displayQrCode').append($append);$m('#displayQrCode').show();document.location.href="#displayQrCode";});$m('#preview1').click(function(){$m(".how_it_works").click();$m("#register-preview").click();document.location.href="#slider";});$m('#preview2').click(function(){$m(".how_it_works").click();$m("#recconfigure-preview").click();document.location.href="#slider5";});$m('#preview3').click(function(){$m(".how_it_works").click();});$m('#preview4').click(function(){$m(".how_it_works").click();$m("#loginQr-preview").click();document.location.href="#slider2";});$m('#preview5').click(function(){$m(".how_it_works").click();$m("#offline-preview").click();document.location.href="#slider3";});$m('#preview6').click(function(){$m(".how_it_works").click();$m("#phonelost-preview").click();document.location.href="#slider4";});$m('#preview7').click(function(){$m(".how_it_works").click();$m("#reconfigure-preview").click();document.location.href="#slider5";});$m('#preview8').click(function(){$m(".how_it_works").click();$m("#loginQr-preview").click();document.location.href="#slider2";});$m('#preview9').click(function(){$m(".how_it_works").click();$m("#cache-preview").click();document.location.href="#slider6";});$m('#error-cancel').click(function(){$error="";$m(".error-msg").css("display","none");});$m('#success-cancel').click(function(){$success="";$m(".success-msg").css("display","none");});$m('#cURL').click(function(){$m(".help_trouble").click();$m("#cURLfaq").click();});});function setactive($id){$m(".navbar-tabs>li").removeClass("active");$id='#'+$id;$m($id).addClass("active");}
31
+ function voiddisplay($href){$m(".page").css("display","none");$m($href).css("display","block");}
32
+ function mo2f_valid(f){!(/^[a-zA-Z?,.\(\)\/@ 0-9]*$/).test(f.value)?f.value=f.value.replace(/[^a-zA-Z?,.\(\)\/@ 0-9]/,''):null;}
33
+ </script>
34
+ <script>
35
+ var $j=jQuery.noConflict();$j('#refrsh_qrcode').hide();var timeout;pollMobileRegistration();function pollMobileRegistration()
36
+ {var transId="<?php echo $this->getTransactionId() ?>";var jsonString="{\"txId\":\""+transId+"\"}";var postUrl="<?php echo $this->getHostURl() ?>"+"/moas/api/auth/registration-status";var showqr="<?php echo $this->getConfig('qrcode')?>";if(showqr==1){$j.ajax({url:postUrl,type:"POST",dataType:"json",data:jsonString,contentType:"application/json; charset=utf-8",success:function(result){var status=JSON.parse(JSON.stringify(result)).status;if(status=='SUCCESS'){var content="<div id='success' style='margin-left: 1%; margin-top:2%;'><img src='"+"<?php echo $this->getImage('right') ?>"+"' /></div>";$j("#displayQrCode").empty();$j("#displayQrCode").append(content);setTimeout(function(){$j("#mobile_register_form").submit();},1000);}else if(status=='ERROR'||status=='FAILED'){var content="<div id='error' style='margin-left: 1%; margin-top:2%;'><img src='"+"<?php echo $this->getImage('wrong') ?>"+"' /></div>";$j("#displayQrCode").empty();$j("#displayQrCode").append(content);$j('#refrsh_qrcode').show();$j("#configureMobileButton").show();setTimeout(function(){$j("#mobile_register_failed").submit();},1000);}else{timeout=setTimeout(pollMobileRegistration,3000);}}});}}
37
+ </script>
38
+ <script>
39
+ var $j=jQuery.noConflict();$j(document).ready(function($j){var slideCount=$j('#slider ul li').length;var slideWidth=$j('#slider ul li').width();var slideHeight=$j('#slider ul li').height();var sliderUlWidth=slideCount*slideWidth;$j('#slider').css({width:slideWidth,height:slideHeight});$j('#slider ul').css({width:sliderUlWidth,marginLeft:-slideWidth});$j('#slider ul li:last-child').prependTo('#slider ul');function moveLeft(){$j('#slider ul').fadeOut("slow",function(){$j('#slider ul li:last-child').prependTo('#slider ul');$j('#slider ul').css('left','');$j('#slider ul').fadeIn("slow");});};function moveRight(){$j('#slider ul').fadeOut("slow",function(){$j('#slider ul li:first-child').appendTo('#slider ul').fadeIn("slow");$j('#slider ul').css('left','');$j('#slider ul').fadeIn("slow");});};$j('#slider .control_prev').click(function(){moveLeft();});$j('#slider .control_next').click(function(){moveRight();});});$j(document).ready(function($j){var slideCount=$j('#slider2 ul li').length;var slideWidth=$j('#slider2 ul li').width();var slideHeight=$j('#slider2 ul li').height();var sliderUlWidth=slideCount*slideWidth;$j('#slider2').css({width:slideWidth,height:slideHeight});$j('#slider2 ul').css({width:sliderUlWidth,marginLeft:-slideWidth});$j('#slider2 ul li:last-child').prependTo('#slider2 ul');function moveLeft(){$j('#slider2 ul').fadeOut("slow",function(){$j('#slider2 ul li:last-child').prependTo('#slider2 ul').fadeIn("slow");$j('#slider2 ul').css('left','');$j('#slider2 ul').fadeIn("slow");});};function moveRight(){$j('#slider2 ul').fadeOut("slow",function(){$j('#slider2 ul li:first-child').appendTo('#slider2 ul').fadeIn("slow");$j('#slider2 ul').css('left','');$j('#slider2 ul').fadeIn("slow");});};$j('#slider2 .control_prev').click(function(){moveLeft();});$j('#slider2 .control_next').click(function(){moveRight();});});$j(document).ready(function($j){var slideCount=$j('#slider3 ul li').length;var slideWidth=$j('#slider3 ul li').width();var slideHeight=$j('#slider3 ul li').height();var sliderUlWidth=slideCount*slideWidth;$j('#slider3').css({width:slideWidth,height:slideHeight});$j('#slider3 ul').css({width:sliderUlWidth,marginLeft:-slideWidth});$j('#slider3 ul li:last-child').prependTo('#slider3 ul');function moveLeft(){$j('#slider3 ul').fadeOut("slow",function(){$j('#slider3 ul li:last-child').prependTo('#slider3 ul').fadeIn("slow");$j('#slider3 ul').css('left','');$j('#slider3 ul').fadeIn("slow");});};function moveRight(){$j('#slider3 ul').fadeOut("slow",function(){$j('#slider3 ul li:first-child').appendTo('#slider3 ul').fadeIn("slow");$j('#slider3 ul').css('left','');$j('#slider3 ul').fadeIn("slow");});};$j('#slider3 .control_prev').click(function(){moveLeft();});$j('#slider3 .control_next').click(function(){moveRight();});});$j(document).ready(function($j){var slideCount=$j('#slider4 ul li').length;var slideWidth=$j('#slider4 ul li').width();var slideHeight=$j('#slider4 ul li').height();var sliderUlWidth=slideCount*slideWidth;$j('#slider4').css({width:slideWidth,height:slideHeight});$j('#slider4 ul').css({width:sliderUlWidth,marginLeft:-slideWidth});$j('#slider4 ul li:last-child').prependTo('#slider4 ul');function moveLeft(){$j('#slider4 ul').fadeOut("slow",function(){$j('#slider4 ul li:last-child').prependTo('#slider4 ul').fadeIn("slow");$j('#slider4 ul').css('left','');$j('#slider4 ul').fadeIn("slow");});};function moveRight(){$j('#slider4 ul').fadeOut("slow",function(){$j('#slider4 ul li:first-child').appendTo('#slider4 ul').fadeIn("slow");$j('#slider4 ul').css('left','');$j('#slider4 ul').fadeIn("slow");});};$j('#slider4 .control_prev').click(function(){moveLeft();});$j('#slider4 .control_next').click(function(){moveRight();});});$j(document).ready(function($j){var slideCount=$j('#slider5 ul li').length;var slideWidth=$j('#slider5 ul li').width();var slideHeight=$j('#slider5 ul li').height();var sliderUlWidth=slideCount*slideWidth;$j('#slider5').css({width:slideWidth,height:slideHeight});$j('#slider5 ul').css({width:sliderUlWidth,marginLeft:-slideWidth});$j('#slider5 ul li:last-child').prependTo('#slider5 ul');function moveLeft(){$j('#slider5 ul').fadeOut("slow",function(){$j('#slider5 ul li:last-child').prependTo('#slider5 ul').fadeIn("slow");$j('#slider5 ul').css('left','');$j('#slider5 ul').fadeIn("slow");});};function moveRight(){$j('#slider5 ul').fadeOut("slow",function(){$j('#slider5 ul li:first-child').appendTo('#slider5 ul').fadeIn("slow");$j('#slider5 ul').css('left','');$j('#slider5 ul').fadeIn("slow");});};$j('#slider5 .control_prev').click(function(){moveLeft();});$j('#slider5 .control_next').click(function(){moveRight();});});$j(document).ready(function($j){var slideCount=$j('#slider6 ul li').length;var slideWidth=$j('#slider6 ul li').width();var slideHeight=$j('#slider6 ul li').height();var sliderUlWidth=slideCount*slideWidth;$j('#slider6').css({width:slideWidth,height:slideHeight});$j('#slider6 ul').css({width:sliderUlWidth,marginLeft:-slideWidth});$j('#slider6 ul li:last-child').prependTo('#slider6 ul');function moveLeft(){$j('#slider6 ul').fadeOut("slow",function(){$j('#slider6 ul li:last-child').prependTo('#slider6 ul').fadeIn("slow");$j('#slider6 ul').css('left','');$j('#slider6 ul').fadeIn("slow");});};function moveRight(){$j('#slider6 ul').fadeOut("slow",function(){$j('#slider6 ul li:first-child').appendTo('#slider6 ul').fadeIn("slow");$j('#slider6 ul').css('left','');$j('#slider6 ul').fadeIn("slow");});};$j('#slider6 .control_prev').click(function(){moveLeft();});$j('#slider6 .control_next').click(function(){moveRight();});});
40
+ </script>
41
+ </head>
42
+ <body>
43
+ <div class="heading"> <h3>miniOrange Two Factor Extension Configuration</h3></div>
44
+ <div class="container">
45
+ <ul class="navbar navbar-tabs">
46
+ <li id="user_profile"><a id="#userprofile" class="user_profile">User Profile</a></li>
47
+ <li id="account_setup"><a id="#accountsetup" class="account_setup">Account Setup</a></li>
48
+ <li id="configure_mobile"><a id="#configuremobile" class="configure_mobile">Configure Mobile</a></li>
49
+ <li id="login_settings"><a id="#loginsettings" class="login_settings">Login Settings</a></li>
50
+ <li id="how_it_works"><a id="#howitworks" class="how_it_works">How it Works</a></li>
51
+ <li id="help_trouble"><a id="#helptrouble" class="help_trouble">FAQs</a></li>
52
+ </ul>
53
+ <div class="container-page">
54
+ <div id="messages">
55
+ <ul class="mini-messages">
56
+ <li class="error-msg"><ul><li><span></span><a id="error-cancel" href="#">&times;</a></li></ul></li>
57
+ <li class="success-msg"><ul><li><span></span><a id="success-cancel" href="#">&times;</a></li></ul></li>
58
+ </ul>
59
+ </div>
60
+ <!-- USER PROFILE TAB -->
61
+ <div class="page" id="userprofile">
62
+ <div class="mo2f_table_layout">
63
+ <div><h3>Your Profile Information</h3><hr><span style="float:right; margin-top:-4%;">[ <a id="preview8" href="#slider2">Click Here</a> for login preview. ]</span></div>
64
+ <table>
65
+ <tr>
66
+ <td><b>miniOrange Account Email</b></td>
67
+ <td><?php echo $this->getConfig('email')?></td>
68
+ </tr>
69
+ <tr>
70
+ <td><b>Customer Key</b></td>
71
+ <td><?php echo $this->getConfig('customerKey')?></td>
72
+ </tr>
73
+ <tr>
74
+ <td><b>Api Key</b></td>
75
+ <td><?php echo $this->getConfig('apiKey')?></td>
76
+ </tr>
77
+ <tr>
78
+ <td><b>Api Token</b></td>
79
+ <td><?php echo $this->getConfig('apiToken')?></td>
80
+ </tr>
81
+ </table>
82
+ </div>
83
+ </div>
84
+
85
+ <!-- ACCOUNT SETUP TAB -->
86
+ <div class="page" id="accountsetup">
87
+ <div class="mo2f_table_layout">
88
+ <form name="f" id="register_miniorange" method="post" action="<?php echo $this->getadminurl('*/*/newUser') ?>">
89
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
90
+ <div class="register_miniorange">
91
+ <div ><h3>Register with miniOrange</h3><span style="float:right; margin-top:-3%;">[ <a id="preview1" href="#slider">Click Here</a> for a preview. ]</span></div>
92
+ <hr>
93
+ <div id="panel1">
94
+ <div><b>Please enter a valid email id that you have access to. You will be able to move forward after verifying an OTP that we will be sending to this email.</b></div><br />
95
+ <table class="table">
96
+ <tr>
97
+ <td><b><font color="#FF0000">*</font>Email:</b></td>
98
+ <td><input class="" type="email" name="email" required autofocus="true" placeholder="person@example.com" value="<?php echo $current_user->user_email;?>"/></td>
99
+ </tr>
100
+
101
+ <tr>
102
+ <td><b><font color="#FF0000">*</font>Phone number:</b></td>
103
+ <td><input class="" type="text" name="phone" id="phone" required title="Phone with country code eg. +1xxxxxxxxxx" placeholder="Phone with country code eg. +1xxxxxxxxxx" value="" pattern="[\+]?[0-9]{1,4}\s?[0-9]{10}"/><span class="required">*We will call only if you need support.</span></td>
104
+ </tr>
105
+ <tr>
106
+ <td><b><font color="#FF0000">*</font>Password:</b></td>
107
+ <td><input class="" type="password" required name="password" placeholder="Choose your password with minimun 6 characters" title="Minimun 6 characters" pattern="[a-zA-Z0-9!@#$%^&*]{6,24}"/></td>
108
+ </tr>
109
+ <tr>
110
+ <td><b><font color="#FF0000">*</font>Confirm Password:</b></td>
111
+ <td><input class="" type="password" required name="confirmPassword" placeholder="Confirm your password with minimum 6 characters" title="minimun 6 characters" pattern="[a-zA-Z0-9!@#$%^&*]{6,24}" /></td>
112
+ </tr>
113
+ </table>
114
+ <br>
115
+ <div class="button-align"><input type="submit" name="submit" value="Submit" class="" /></div>
116
+ </div>
117
+
118
+ </div>
119
+ </form>
120
+ <form id="already_registered" name="f" method="post" action="<?php echo $this->getadminurl('*/*/existingUser') ?>">
121
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
122
+ <div class="login_miniorange">
123
+ <h3>Login with miniOrange</h3><hr>
124
+ <div id="panel1">
125
+ <div><b>You are already registered with miniOrange. Please Login with your miniOrange credentials</b></div><br />
126
+ <table class="table">
127
+ <tr>
128
+ <td><b><font color="#FF0000">*</font>Email:</b></td>
129
+ <td><input class="" type="email" name="loginemail" autofocus="true" required placeholder="person@example.com" style="width:400px;" value="<?php echo $current_user->user_email;?>"/></td>
130
+ </tr>
131
+ <tr>
132
+ <td><b><font color="#FF0000">*</font>Password:</b></td>
133
+ <td><input class="" type="password" required name="loginpassword" style="width:400px;" placeholder="Choose your password with minimun 6 characters" pattern="[a-zA-Z0-9!@#$%^&*]{6,24}"/></td>
134
+ </tr>
135
+ </table>
136
+ <br>
137
+ <div class="button-align"><input type="submit" name="submit" value="Submit" class="" /></div>
138
+ <span style="margin-left:10%;"><a href="<?php echo $this->getForgotPassUrl() ?>">Forgot Password?</a></span>
139
+ </div>
140
+ </div>
141
+ </form>
142
+ <form id="additional_admin" name="f" method="post" action="<?php echo $this->getadminurl('*/*/additionalAdmin') ?>">
143
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
144
+ <div class="login_miniorange">
145
+ <h3>Login with miniOrange</h3><hr>
146
+ <div id="panel1">
147
+ <div><b>You are already registered with miniOrange. Please Login with your miniOrange credentials</b></div><br />
148
+ <table class="table">
149
+ <tr>
150
+ <td><b><font color="#FF0000">*</font>Email:</b></td>
151
+ <td><input class="" type="email" name="additional_email" autofocus="true" required placeholder="person@example.com" style="width:400px;" value="<?php echo $current_user->user_email;?>"/></td>
152
+ </tr>
153
+ <tr>
154
+ <td><b><font color="#FF0000">*</font>Phone number:</b></td>
155
+ <td><input class="" type="text" name="phone" id="additional_phone" required title="Phone with country code eg. +1xxxxxxxxxx" placeholder="Phone with country code eg. +1xxxxxxxxxx" value="" pattern="[\+]?[0-9]{1,4}\s?[0-9]{10}"/><span class="required">*We will call only if you need support.</span></td>
156
+ </tr>
157
+ </table>
158
+ <br>
159
+ <div class="button-align"><input type="submit" name="submit" value="Submit" class="" /></div>
160
+
161
+ </div>
162
+ </div>
163
+ </form>
164
+ </div>
165
+ <div class="validate_otp">
166
+ <h3>Validate OTP</h3><hr>
167
+ <div id="panel1">
168
+ <table class="">
169
+ <form name="f" method="post" id="" action="<?php echo $this->getadminurl('*/*/validateNewUser') ?>">
170
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
171
+ <tr>
172
+ <td><b><font color="#FF0000">*</font>Enter OTP:</b></td>
173
+ <td colspan="2"><input class="" id="validateotp" autofocus="true" type="number" name="otp" required placeholder="Enter OTP" style="width:95%;" pattern="[0-9]{4,6}"/></td>
174
+ </tr>
175
+ </table>
176
+ <div class="button-align">
177
+ <input type="submit" name="submit" value="Submit" class="" />
178
+ </div>
179
+ </form>
180
+ <form name="f" method="post" id="" action="<?php echo $this->getadminurl('*/*/resendValidationOTP') ?>">
181
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
182
+ <div class="button-align">
183
+ <input type="submit" name="submit" value="Resend-OTP" class="" />
184
+ </div>
185
+ </form>
186
+ <form name="f" method="post" id="" action="<?php echo $this->getadminurl('*/*/cancelValidation') ?>">
187
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
188
+ <div class="button-align">
189
+ <input type="submit" name="submit" value="« Go Back" class="" />
190
+ </div>
191
+ </form>
192
+ </div>
193
+ </div>
194
+ </div>
195
+
196
+
197
+
198
+ <!-- CONFIGURE MOBILE TAB -->
199
+ <div class="page" id="configuremobile">
200
+ <div class="mo2f_table_layout">
201
+ <div><h3>Configure your mobile</h3><hr><span style="float:right; margin-top:-4%;">[ <a id="preview2" href="#slider5">Click Here</a> for a preview. ]</span></div>
202
+ <div id="downloadscreen">
203
+ <div><b>Step 1: Download the miniOrange <span style="color: #F78701;">miniOrange Authenticator</span> app</b></div>
204
+ <table>
205
+ <tr>
206
+ <td class="panel-body" style="width:50%;">
207
+ <p class="content_fonts" style="margin-bottom:2px!important;"><b>iPhone Users</b></p>
208
+ <ol>
209
+ <li>Go to App Store</li>
210
+ <li>Search for <b>miniOrange</b></li>
211
+ <li>Download and install <span style="color: #F78701;"><b>miniOrange Authenticator</b></span> app (<b>NOT MOAuth</b>)</li>
212
+ </ol>
213
+ <span><a target="_blank" href="https://itunes.apple.com/us/app/miniorange-authenticator/id796303566?ls=1"><img src="<?php echo $this->getImage('appstore') ?>" style="width:120px; height:45px; margin-left:6px;"></a></span><br><br>
214
+ </td>
215
+ <td class="panel-body">
216
+ <p class="content_fonts" style="margin-bottom:2px!important;"><b>Android Users</b></p>
217
+ <ol>
218
+ <li> Go to Google Play Store.</li>
219
+ <li> Search for <b>miniOrange.</b></li>
220
+ <li>Download and install miniOrange <span style="color: #F78701;"><b>miniOrange Authenticator</b></span> app (<b>NOT MOAuth</b>)</li>
221
+ </ol>
222
+ <a target="_blank" href="https://play.google.com/store/apps/details?id=com.miniorange.authbeta"><img src="<?php echo $this->getImage('playstore') ?>" style="width:120px; height:=45px; margin-left:6px;"></a>
223
+ </td>
224
+ </tr>
225
+ </table>
226
+ </div>
227
+ <form name="f" method="post" id="configMobileForm" action="<?php echo $this->getadminurl('*/*/showQRCode') ?>">
228
+ <input type="checkbox" id="showDownload" name="showDownload" value="0" /><b>Check here if you have downloaded the app.</b>
229
+ <div id="configureqr">
230
+ <div><b>Step 2: Scan QR code: </b><span style="margin-left:3%;"><b>Open your miniOrange app and click on Configure Button to scan the QR code.</b></span></div>
231
+ <div id="refrsh_qrcode" style="">
232
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
233
+ <input type="submit" name="submit" id="configureMobileButton" value="Re-Configure Mobile" class="" />
234
+ </div>
235
+ </form>
236
+ <table class="QrCode">
237
+ <div id="displayQrCode" class="center"><span style=" background:url('http://auth.miniorange.com/moas/images/ajax-loader4.gif')no-repeat;
238
+ display:block;
239
+ margin: 3% auto;
240
+ height:140px;
241
+ width:140px">
242
+ </span></div>
243
+ </table>
244
+ <div id="mobile_registered" >
245
+ <form name="f" method="post" id="mobile_register_form" action="<?php echo $this->getadminurl('*/*/registrationSuccess') ?>">
246
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
247
+ </form>
248
+ <form name="f" method="post" id="mobile_register_failed" action="<?php echo $this->getadminurl('*/*/registrationTimeOut') ?>">
249
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
250
+ </form>
251
+ </div>
252
+ <br />
253
+ </div>
254
+ </div>
255
+ </div>
256
+
257
+ <!--LOGIN SETTINGS TAB-->
258
+ <div class="page" id="loginsettings">
259
+ <div class="mo2f_table_layout">
260
+ <div><h3>Login Settings</h3><hr></div>
261
+ <form name="f" method="post" action="<?php echo $this->getadminurl('*/*/enableAdmin') ?>">
262
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
263
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
264
+ <input type="checkbox" id="mo2f_adminrole_activation" name="adminrole_activation" value="1" <?php echo $this->isEnabled(); ?> /><b>Enable 2-Factor for admins.</b>
265
+ <div style="margin-left:4%;"><b>Note:</b> This option is checked by default. It will enable 2-Factor only for admins, other users can still login with their password.<p>[ <a id="preview4" href="#slider2">Click Here</a> for a preview. ]</p></div>
266
+ <br>
267
+ <div class="button-align"><input type="submit" name="submit" value="Save Settings" class="button button-primary button-large" /></div>
268
+ </form>
269
+ </div>
270
+ </div>
271
+
272
+ <!--HOW IT WORKS TAB-->
273
+ <div class="page" id="howitworks">
274
+ <div class="mo2f_table_layout">
275
+ <h3>HOW IT ALL WORKS?</h3>
276
+ <hr>
277
+ <ul class="mo2f_works">
278
+ <span class="btn-link" href=""><li id="register-preview" >How to configure miniOrange Two Factor Extension?</li></span>
279
+ <div class="collapse" id="">
280
+ <div id="slider">
281
+ <div class="control_next"><img src='<?php echo $this->getImage('arrow') ?>' /></div>
282
+ <div class="control_prev"><img src='<?php echo $this->getImage('arrow') ?>' /></div>
283
+ <ul>
284
+ <li><img style="height: 90%;" src='<?php echo $this->getImage('register') ?>' /></li>
285
+ <li><img style="width: 90%; position: relative; top: 25%;" src='<?php echo $this->getImage('otp') ?>' /></li>
286
+ <li><img style="width: 90%; position: relative;top: 15%;" src='<?php echo $this->getImage('clickconfiguremobile') ?>' /></li>
287
+ <li><img style="height: 75%; position: relative; top: 12%;" src='<?php echo $this->getImage('scanqr') ?>' /></li>
288
+ <li><img style="width: 40%; position: relative;top: 25%;" src='<?php echo $this->getImage('settings') ?>' /></li>
289
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('sync') ?>' /></li>
290
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('configurefirsttime') ?>' /></li>
291
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('mobilescan') ?>' /></li>
292
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('mobilesuccess') ?>' /></li>
293
+ <li><img style="height: 80%; position: relative; top: 12%;" src='<?php echo $this->getImage('configuremobile') ?>' /></li>
294
+ <li><img style="height: 53%; position: relative; top: 25%;" src='<?php echo $this->getImage('loginsettings') ?>' /></li>
295
+ </ul>
296
+ </div>
297
+ </div>
298
+ <span class="btn-link" href=""><li id="loginQr-preview">How to Login using QrCode?</li></span>
299
+ <div class="collapse" id="">
300
+ <div id="slider2">
301
+ <div class="control_next"><img src='<?php echo $this->getImage('arrow') ?>' /></div>
302
+ <div class="control_prev"><img src='<?php echo $this->getImage('arrow') ?>' /></div>
303
+ <ul>
304
+ <li><img style="width: 90%; position: relative; top: 20%" src='<?php echo $this->getImage('login1') ?>' /></li>
305
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('login2') ?>' /></li>
306
+ <li><img style="height: 76%; position: relative; top: 12%" src='<?php echo $this->getImage('authenticate') ?>' /></li>
307
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('mobilescan') ?>' /></li>
308
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('authvalidate') ?>' /></li>
309
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('login3') ?>' /></li>
310
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('processing') ?>' /></li>
311
+ <li><img style="height:26%; position: relative; top: 44%" src='<?php echo $this->getImage('loggedin') ?>' /></li>
312
+ </ul>
313
+ </div>
314
+ </div>
315
+ <span class="btn-link" href=""><li id="offline-preview" >How to Login when your phone is offline?</li></span>
316
+ <div class="collapse" id="">
317
+ <div id="slider3">
318
+ <div class="control_next"><img src='<?php echo $this->getImage('arrow') ?>' /></div>
319
+ <div class="control_prev"><img src='<?php echo $this->getImage('arrow') ?>' /></div>
320
+ <ul>
321
+ <li><img style="width: 90%; position: relative; top: 20%" src='<?php echo $this->getImage('login1') ?>' /></li>
322
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('phone-offline') ?>' /></li>
323
+ <li><img style="height: 76%; position: relative; top: 12%" src='<?php echo $this->getImage('softokenmobile') ?>' /></li>
324
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('softtoken') ?>' /></li>
325
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('processing') ?>' /></li>
326
+ <li><img style="height:26%; position: relative; top: 44%" src='<?php echo $this->getImage('loggedin') ?>' /></li>
327
+ </ul>
328
+ </div>
329
+ </div>
330
+ <span class="btn-link" href=""><li id="phonelost-preview">How to Login when your phone is unavailable?</li></span>
331
+ <div class="collapse" id="">
332
+ <div id="slider4">
333
+ <div class="control_next"><img src='<?php echo $this->getImage('arrow') ?>' /></div>
334
+ <div class="control_prev"><img src='<?php echo $this->getImage('arrow') ?>' /></div>
335
+ <ul>
336
+ <li><img style="width: 90%; position: relative; top: 20%" src='<?php echo $this->getImage('login1') ?>' /></li>
337
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('forgot-phone') ?>' /></li>
338
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('sendingotp') ?>' /></li>
339
+ <li><img style="width: 80%; position: relative; top: 35%" src='<?php echo $this->getImage('mail') ?>' /></li>
340
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('forgotphone') ?>' /></li>
341
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('processing') ?>' /></li>
342
+ <li><img style="height:26%; position: relative; top: 44%" src='<?php echo $this->getImage('loggedin') ?>' /></li>
343
+ </ul>
344
+ </div>
345
+ </div>
346
+ <span class="btn-link" href=""><li id="reconfigure-preview">How to ReConfigure your Mobile?</li></span>
347
+ <div class="collapse" id="">
348
+ <div id="slider5">
349
+ <div class="control_next"><img src='<?php echo $this->getImage('arrow') ?>' /></div>
350
+ <div class="control_prev"><img src='<?php echo $this->getImage('arrow') ?>' /></div>
351
+ <ul>
352
+ <li><img style="width: 80%; position: relative; top: 20%;" src='<?php echo $this->getImage('clickconfiguremobile2') ?>' /></li>
353
+ <li><img style="height: 76%; position: relative; top: 12%";" src='<?php echo $this->getImage('mobileconfigurebutton') ?>' /></li>
354
+ <li><img style="height: inherit" src='<?php echo $this->getImage('mobilescan') ?>' /></li>
355
+ <li><img style="height: inherit;" src='<?php echo $this->getImage('mobilesuccess') ?>' /></li>
356
+ <li><img style="height: 80%; position: relative; top: 12%;" src='<?php echo $this->getImage('configuremobile') ?>' /></li>
357
+ <li><img style="height: 53%; position: relative; top: 25%;" src='<?php echo $this->getImage('loginsettings') ?>' /></li>
358
+ </ul>
359
+ </div>
360
+ </div>
361
+ <span class="btn-link" href=""><li id="cache-preview">How to flush Magento Cache?</li></span>
362
+ <div class="collapse" id="">
363
+ <div id="slider6">
364
+ <div class="control_next"><img src='<?php echo $this->getImage('arrow') ?>' /></div>
365
+ <div class="control_prev"><img src='<?php echo $this->getImage('arrow') ?>' /></div>
366
+ <ul>
367
+ <li><img style="width: 30%; position: relative;" src='<?php echo $this->getImage('cachesetting') ?>' /></li>
368
+ <li><img style="height: 55%; position: relative; top: 23%";" src='<?php echo $this->getImage('savecache') ?>' /></li>
369
+ </ul>
370
+ </div>
371
+ </div>
372
+
373
+ </ul>
374
+
375
+
376
+ </div>
377
+ </div>
378
+
379
+ <!-- HELP AND TROUBLESHOOTING TAB-->
380
+ <div class="page" id="helptrouble">
381
+ <div class="mo2f_table_layout">
382
+ <ul class="mo2f_faqs">
383
+ <span class="btn-link" href=""><li id="cURLfaq">How to enable PHP cURL extension? (Pre-requisite)</li></span>
384
+ <div class="collapse" id="question14">
385
+ <ol>
386
+ <li>Open php.ini.</li>
387
+ <li>Search for extension=php_curl.dll. Uncomment it by removing the semi-colon( ; ) in front of it.</li>
388
+ <li>Restart the Apache Server.</li>
389
+ </ol>
390
+ For any further queries, please submit a query on right hand side in our <b>Support Section</b>.
391
+ </div>
392
+ <hr>
393
+ <span class="btn-link" href=""><li>I want to enable 2-factor only for administrators ?</li></span>
394
+ <div class="collapse" id="question2">
395
+ 2-Factor is enabled by default for administrators on plugin activation. You just need to complete your account setup and configure your mobile from <b>Configure Mobile Tab</b>. Once this is done administrators can login using 2-Factor.
396
+ </div>
397
+ <hr>
398
+ <span class="btn-link" href=""><li>What happens if an admin tries to login but has not yet registered ?</li></span>
399
+ <div class="collapse" id="question4">
400
+ If an admin has not setup 2-Factor yet, he can still login using his credentials. After logging in, he can go to <b>miniOrage</b> Tab on the top navbar and configure his 2-Factor.
401
+ </div>
402
+ <hr>
403
+ <span class="btn-link" href=""><li>My users have different types of phones. What phones are supported?</li></span>
404
+ <div class="collapse" id="question5">
405
+ Currently we support smart phones only. If you need 2-Factor for basic phone submit a query in our <b>Support Section</b> on right hand side.
406
+ </div>
407
+ <hr>
408
+ <span class="btn-link" href=""><li>What if a user does not have a smart phone?</li></span>
409
+ <div class="collapse" id="question6">
410
+ Currently we support smart phone users only. If you need 2-Factor for basic phone users submit a query in our <b>Support Section</b> on right hand side.
411
+ </div>
412
+ <hr>
413
+ <span class="btn-link" href=""><li>What if I am trying to login from my phone ?</li></span>
414
+ <div class="collapse" id="question15">
415
+ If you are logging in from your phone, just enter the one time passcode from miniOrange Authenticator App.
416
+ Go to Soft Token Tab to see one time passcode.
417
+ </div>
418
+ <hr>
419
+
420
+
421
+ <span class="btn-link" href="" ><li>My phone has no internet connectivity, how can I login?</li></span>
422
+ <div class="collapse" id="question7">
423
+ You can login using our alternate login method. <a id="preview5" href="#slider3">Click Here</a> for a preview to see how it works.
424
+ </div>
425
+ <hr>
426
+ <span class="btn-link" href="" ><li>My phone is lost, stolen or discharged. How can I login?</li></span>
427
+ <div class="collapse" id="question8">
428
+ You can login using our alternate login method. <a id="preview6" href="#slider4">Click Here</a> for a preview to see how it works.
429
+ </div>
430
+ <hr>
431
+ <span class="btn-link" href="" ><li>My phone has no internet connectivity and i am entering the one time passcode from miniOrange Authenticator App, it says Invalid OTP.</li></span>
432
+ <div class="collapse" id="question9">
433
+ Click on the <b>Settings Icon</b> on top right corner in <b>miniOrange Authenticator App</b> and then press <b>Sync button</b> under 'Time correction for codes' to sync your time with miniOrange Servers. If you still can't get it right, submit a query here in our <b>support section</b>.<br><br>
434
+ </div>
435
+ <hr>
436
+
437
+ <span class="btn-link" href="" ><li>I want to go back to default login with password.</li></span>
438
+ <div class="collapse" id="question12">
439
+ You should go to <b>Login Settings Tab</b> and uncheck <b>Enable 2-Factor for admins</b>
440
+ and <b>Enable 2-Factor for all others users</b> checkbox. This will disable 2-Factor and you can login using default login form.
441
+ </div>
442
+ <hr>
443
+
444
+ <span class="btn-link" href=""><li>I am upgrading my phone.</li></span>
445
+ <div class="collapse" id="question11">
446
+ You should go to <b>Configure Mobile Tab</b> and reconfigure 2-Factor with your new phone. <a id="preview7" href="#slider5">Click Here</a> for a preview to see how it works.
447
+ </div>
448
+
449
+ <hr>
450
+
451
+ <span class="btn-link" href="" ><li>What If I want to use any other second factor like OTP Over SMS, Security Questions, Device Id, etc ?</li></span>
452
+ <div class="collapse" id="question13">
453
+ miniOrange authentication service has 15+ authentication methods.One time passcodes (OTP) over SMS, OTP over Email, OTP over SMS and Email, Out of Band SMS, Out of Band Email, Soft Token, Push Notification,
454
+ USB based Hardware token (yubico), Security Questions, Mobile Authentication, Voice Authentication (Biometrics), Phone Verification, Device Identification, Location, Time of Access User Behavior.
455
+ To know more about authentication methods, please visit <a href="http://miniorange.com/strong_auth" target="_blank">http://miniorange.com/strong_auth </a>. If you want to have any other 2-factor for your
456
+ Magento site, Submit your query here in <b>support section</b>.
457
+ </div>
458
+
459
+ <hr>
460
+
461
+ <span class="btn-link" href="">For any other query/problem/request, please feel free to submit a query in our support section on right hand side. We are happy to help you and will get back to you as soon as possible.</span>
462
+
463
+ </ul>
464
+
465
+ </div>
466
+ </div>
467
+ </div>
468
+ </div>
469
+
470
+ <!--SUPPORT TAB-->
471
+ <div id="minisupport">
472
+ <ul class="navbar navbar-tabs">
473
+ <li id="mini_support" class="always-active"><a href="#minisupport" class="mini_support">Support</a></li>
474
+ </ul>
475
+ <div class="mo2f_support_layout">
476
+ <h3>Support</h3>
477
+ <hr>
478
+ <form name="f" method="post" action="<?php echo $this->getadminurl('*/*/supportSubmit') ?>">
479
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
480
+ <div><b>Need any help? Just send us a query so we can help you.</b><br /><br/></div>
481
+ <div>
482
+ <table>
483
+ <tr><td>
484
+ <input type="email" class="mo2f_table_textbox" id="query_email" name="query_email" value="<?php echo Mage::getSingleton('admin/session')->getUser()->getEmail() ?>" placeholder="Enter your email" required="true" />
485
+ </td>
486
+ </tr>
487
+ <tr><td>
488
+ <input type="text" class="mo2f_table_textbox" name="query_phone" id="query_phone" title="Phone with country code eg. +1xxxxxxxxxx" placeholder="Phone with country code eg. +1xxxxxxxxxx" value="" pattern="[\+]?[0-9]{1,4}\s?[0-9]{10}"/>
489
+ </td>
490
+ </tr>
491
+ <tr>
492
+ <td>
493
+ <textarea id="query" name="query" style="resize: vertical;border-radius:4px;width:370px;height:143px;" onkeyup="mo2f_valid(this)" onblur="mo2f_valid(this)" onkeypress="mo2f_valid(this)" placeholder="Write your query here"></textarea>
494
+ </td>
495
+ </tr>
496
+ </table>
497
+ </div>
498
+ <div class="button-align">
499
+ <input type="submit" name="send_query" id="send_query" value="Submit Query" style="margin-bottom:3%;" class="button button-primary button-large" />
500
+ </div>
501
+ </form>
502
+ <br />
503
+ </div>
504
+ <br>
505
+ </div>
506
+
507
+ </body>
508
+ </html>
app/etc/modules/miniorange_2factor.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version = "1.0"?>
2
+ <config>
3
+ <modules>
4
+ <MiniOrange_2factor>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </MiniOrange_2factor>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>miniOrange_2factor</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU General Public License (GPL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Enable Two Factor Authentication (2FA)- Supports QR code, Soft token, otp over sms).</summary>
10
+ <description>A highly secure &amp; easy to setup Two-Factor Authentication for your Magento site. miniOrange Two Factor authentication combines something you know, or something you have (smartphone) to reliably confirm your identity. &#xD;
11
+ &#xD;
12
+ Rather than relying on a password alone, which can be phished or guessed, miniOrange Two Factor authentication adds a second layer of security to your Magento accounts.&#xD;
13
+ &#xD;
14
+ Currently the extension supports:&#xD;
15
+ * It works for administrators.&#xD;
16
+ * You can set up your two factor in minutes.&#xD;
17
+ * Both iPhone and Android phones are supported.&#xD;
18
+ * If your phone is lost or stolen or discharged, it offers an alternate login method.&#xD;
19
+ * If your phone is offline, you can use a one time passcode generated by app to login. &#xD;
20
+ &#xD;
21
+ &#xD;
22
+ Feature phone, landline and two factor for frontend are also supported. You need to contact info@miniorange.com to enable it. &#xD;
23
+ Trusted Device, Location, Time of access and user behavior is also supported. You need to enable this by contacting info@miniorange.com&#xD;
24
+ &#xD;
25
+ miniOrange supports 15+ authentication methods. For a complete list of authentication methods please visit http://miniorange.com/strong_auth . If you want to have any other 2-factor for your Magento site, &lt;a href="http://miniorange.com/contact" target="_blank"&gt;Contact us&lt;/a&gt;.&#xD;
26
+ &#xD;
27
+ * One time passcodes (OTP) over SMS&#xD;
28
+ * OTP over Email&#xD;
29
+ * OTP over SMS and Email&#xD;
30
+ * Out of Band SMS&#xD;
31
+ * Out of Band Email&#xD;
32
+ * Soft Token&#xD;
33
+ * Push Notification&#xD;
34
+ * USB based Hardware token (&lt;b&gt;yubico&lt;/b&gt;)&#xD;
35
+ * Security Questions&#xD;
36
+ * Mobile Authentication&#xD;
37
+ * Voice Authentication (Biometrics)&#xD;
38
+ * Phone Verification&#xD;
39
+ * Device Identification&#xD;
40
+ * Location&#xD;
41
+ * Time of Access&#xD;
42
+ * User Behavior&#xD;
43
+ &#xD;
44
+ You can choose from any of the above authentication methods to augment your password based authentication. miniOrange authentication service works with all phone types, from landlines to smart-phone platforms.&#xD;
45
+ &#xD;
46
+ For support please email us at info@miniorange.com or call us at +1 978 658 9387</description>
47
+ <notes>= 1.0.0 =&#xD;
48
+ First version of plugin.</notes>
49
+ <authors><author><name>miniOrange inc.</name><user>miniOrange</user><email>info@miniorange.com</email></author></authors>
50
+ <date>2015-08-20</date>
51
+ <time>05:45:35</time>
52
+ <contents><target name="magecommunity"><dir name="MiniOrange"><dir name="2factor"><dir name="Block"><file name="mo2fConfig.php" hash="6f5486001145809e212edb86dae5c069"/></dir><dir name="Controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="ad19420a46e349cb13066e0a9dbc804c"/><dir name="Login"><file name="miniOrangeController.php" hash="78d1f305733dc764a87229ea4646a479"/></dir></dir><file name="IndexController.php" hash="10c33497b9bd95b36736d17836ba4c32"/></dir><dir name="Helper"><file name="Data.php" hash="34cbc1036639606723524e411926e15c"/><file name="mo2fUtility.php" hash="d8c436efc2d4aa21774d3e2373339a4f"/></dir><dir name="Model"><file name="Observer.php" hash="bff2b49fa55e170da17d32909d9e0238"/><file name="Words.php" hash="ee26cc8582d5bbad5632a6e02129f815"/></dir><dir name="etc"><file name="adminhtml.xml" hash="955f9f87d1a5df39eea9fd69379af0ee"/><file name="config.xml" hash="c4d26f104393549c5da6b8de88a7b09d"/></dir><dir name="sql"><dir name="MiniOrange_2factor_setup"><file name="mysql4-install-0.0.1.php" hash="1a05fb90202ca98975ac396006178dec"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="miniorange_2factor_admin.xml" hash="49671205b07f54681d1f93fec9ee4d67"/></dir><dir name="template"><dir name="miniorange_2factor"><file name="login.phtml" hash="06b1788d232f30e62aadb273bda634f5"/><file name="mo2fConfig.phtml" hash="f5b79cb27b2ce203aed095f96f3deac7"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="MiniOrange_2factor"><file name="appstore.png" hash="1ac5eb0f971fd8cbeac4d3e4449cd9f0"/><file name="arrow.png" hash="47bdba61de621d8ca74c16f6dd5b6565"/><file name="authenticate.png" hash="052bcae5504f3a9c61365ecf8ab0c4e7"/><file name="authvalidate.png" hash="a01eaf3a0002b3e7115813fd4e4efe1a"/><file name="cachesetting.png" hash="15942adf97c0d48abdf2c583c94eb4f5"/><file name="clickconfiguremobile.png" hash="3ee49ca9596e3ad507d66aca43466ea3"/><file name="clickconfiguremobile2.png" hash="fc0ff15007ea57e3ceef75235056dc88"/><file name="configurefirsttime.png" hash="c6982bcd3f70080d893e3da11d2a77d8"/><file name="configuremobile.png" hash="013d6599af7a31fb53a895d877ab1ffe"/><file name="forgot-phone.png" hash="64cfe82547e4db88d025346477025cfe"/><file name="forgotphone.png" hash="4272645ec478f1479fc3dc56df5dd89b"/><file name="loggedin.png" hash="70cc5cad9c475ef9420aa3d70bc43102"/><file name="login1.png" hash="c0dce259d0e2e84957ba77c6e2e78abb"/><file name="login2.png" hash="99e2c32c2fd5f9c9acf6a8002e1d44ac"/><file name="login3.png" hash="305c7bbdb97da888970b7225641757f0"/><file name="loginsettings.png" hash="811b9792a0e47f7e483d01a7ded0ccd0"/><file name="mail.png" hash="751f9588f2e2aac3ec47a6b0ebb2fa4d"/><file name="miniorange_logo.png" hash="b1cd21c2deeb5f199fb55de487bf950b"/><file name="mobileconfigurebutton.png" hash="747a6057cd50099e1cb3b5041320bd85"/><file name="mobilescan.png" hash="dec68c53b12944a45140d909af803fdd"/><file name="mobilesuccess.png" hash="d977fd41088cf0677f33e77de13da56c"/><file name="otp.png" hash="74dc1d7644af2013d256852d26bc920b"/><file name="phone-offline.png" hash="81b25f8125b13fd4d96c23a6fa84574e"/><file name="playStore.png" hash="fbca6f8b28d05c3bcd833965289a20c2"/><file name="processing.png" hash="56b1a14bd1558354250a7a232a4d16e7"/><file name="register.png" hash="37be41049f1d79215322a8cf908bf7b3"/><file name="right.png" hash="2321d72c95ee1fd5708199f56f213136"/><file name="savecache.png" hash="cf686304f47b080ec98930be8bb0f869"/><file name="scanqr.png" hash="dc4c1d070d9b336c790cd2d1d5315ee6"/><file name="sendingotp.png" hash="28c93249e717916d0f3c974b1cd2af7d"/><file name="settings.png" hash="a3e0382615d3f19f5a0dab4d4accbf2d"/><file name="softokenmobile.png" hash="624d589cdfa031df456e25a2ff034e63"/><file name="softtoken.png" hash="804bd9b0a3a600e6f349a6aa4ea00899"/><file name="sync.png" hash="8fffca24e6184fc3f9af8e20feac430b"/><file name="wrong.png" hash="6bd49538f79c4722610c5535f38213af"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="miniorange_2factor.xml" hash="609cb91239fb4a89f64ae28d4b5b5398"/></dir></target></contents>
53
+ <compatible/>
54
+ <dependencies><required><php><min>5.3.10</min><max>5.6.11</max></php><extension><name>curl</name><min>7.40.0</min><max>7.44.0</max></extension></required></dependencies>
55
+ </package>
skin/adminhtml/default/default/images/MiniOrange_2factor/appstore.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/arrow.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/authenticate.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/authvalidate.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/cachesetting.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/clickconfiguremobile.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/clickconfiguremobile2.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/configurefirsttime.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/configuremobile.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/forgot-phone.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/forgotphone.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/loggedin.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/login1.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/login2.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/login3.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/loginsettings.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/mail.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/miniorange_logo.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/mobileconfigurebutton.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/mobilescan.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/mobilesuccess.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/otp.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/phone-offline.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/playStore.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/processing.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/register.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/right.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/savecache.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/scanqr.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/sendingotp.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/settings.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/softokenmobile.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/softtoken.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/sync.png ADDED
Binary file
skin/adminhtml/default/default/images/MiniOrange_2factor/wrong.png ADDED
Binary file