PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.6.6
VikBooking Hotel Booking Engine & PMS v1.6.6
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
vikbooking / site / class / login_sasl_client.php

login_sasl_client.php in VikBooking Hotel Booking Engine & PMS 1.6.6, at site/class/login_sasl_client.php

73 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package VikBooking
4 * @subpackage com_vikbooking
5 * @author Alessio Gaggii - e4j - Extensionsforjoomla.com
6 * @copyright Copyright (C) 2018 e4j - Extensionsforjoomla.com. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE
8 * @link https://vikwp.com
9 */
10
11 defined('ABSPATH') or die('No script kiddies please!');
12
13 define("SASL_LOGIN_STATE_START", 0);
14 define("SASL_LOGIN_STATE_IDENTIFY_USER", 1);
15 define("SASL_LOGIN_STATE_IDENTIFY_PASSWORD", 2);
16 define("SASL_LOGIN_STATE_DONE", 3);
17
18 class login_sasl_client_class
19 {
20 var $credentials=array();
21 var $state=SASL_LOGIN_STATE_START;
22
23 Function Initialize(&$client)
24 {
25 return(1);
26 }
27
28 Function Start(&$client, &$message, &$interactions)
29 {
30 if($this->state!=SASL_LOGIN_STATE_START)
31 {
32 $client->error="LOGIN authentication state is not at the start";
33 return(SASL_FAIL);
34 }
35 $this->credentials=array(
36 "user"=>"",
37 "password"=>"",
38 "realm"=>""
39 );
40 $defaults=array(
41 "realm"=>""
42 );
43 $status=$client->GetCredentials($this->credentials,$defaults,$interactions);
44 if($status==SASL_CONTINUE)
45 $this->state=SASL_LOGIN_STATE_IDENTIFY_USER;
46 Unset($message);
47 return($status);
48 }
49
50 Function Step(&$client, $response, &$message, &$interactions)
51 {
52 switch($this->state)
53 {
54 case SASL_LOGIN_STATE_IDENTIFY_USER:
55 $message=$this->credentials["user"].(strlen($this->credentials["realm"]) ? "@".$this->credentials["realm"] : "");
56 $this->state=SASL_LOGIN_STATE_IDENTIFY_PASSWORD;
57 break;
58 case SASL_LOGIN_STATE_IDENTIFY_PASSWORD:
59 $message=$this->credentials["password"];
60 $this->state=SASL_LOGIN_STATE_DONE;
61 break;
62 case SASL_LOGIN_STATE_DONE:
63 $client->error="LOGIN authentication was finished without success";
64 break;
65 default:
66 $client->error="invalid LOGIN authentication step state";
67 return(SASL_FAIL);
68 }
69 return(SASL_CONTINUE);
70 }
71 };
72
73 ?>