3 // Load Spidio SOAP foundation.
4 require('prepend.inc.php');
6 class SoapidioAuth
extends SoapidioService
{
8 * Get AuthenticationType
12 public function GetAuthenticationType() {
13 return $this->objAuth
->AuthenticationType
;
17 * Login a user based on given credentals.
19 * @param string $strUserName
20 * @param string $strPasswordSalt
21 * @param string $strSalt
24 public function Login($strUserName, $strPasswordSalt, $strSalt) {
25 if (!$this->objAuth
->IsLoggedIn()) {
26 if ($this->objAuth
->Login($strUserName, $strPasswordSalt, $strSalt)) {
27 return $this->objAuth
->SessionGetName();
35 * Logout the logged user.
39 public function Logout() {
40 return $this->objAuth
->Logout();
44 * Clear current Session.
48 public function ResetSession() {
49 $this->objAuth
->ResetSession();
50 return $this->objAuth
->SessionGetName();
54 * Attach given Session to current Session.
56 * @param Session $objSession
57 * @return string $strSessionId
59 public function AttachSession(Session
$objSession) {
60 $this->objAuth
->Session
= $objSession;
62 if ($objSession->AutoLogin
) {
63 $this->objAuth
->SessionKey
= $objSession->SessionKeyAsSession
;
66 return $this->objAuth
->SessionGetName();
70 * Detach given Session.
73 public function DetachSession() {
74 $this->objAuth
->Session
= null;
75 $this->objAuth
->SessionKey
= null;
79 * Check if Session exists.
81 * @param string $strSessionId
84 public function CheckSession($strSessionId) {
85 return $this->objAuth
->SessionExists($strSessionId);
89 * Check if Session has an assigned User.
91 * @param string $strSessionId
94 public function ValidSession($strSessionId) {
95 return $this->objAuth
->SessionIsValid($strSessionId);
99 SoapidioAuth
::Run('SoapidioAuth', 'http://spidio.sourceforge.net/namespaces/auth');