auth requests won't timeout.
[spidio.git] / www / soap / auth.php
bloba2c0043810e65d3153830696be3dbcf095c00735
1 <?php
3 // Load Spidio SOAP foundation.
4 require('prepend.inc.php');
6 class SoapidioAuth extends SoapidioService {
7 /**
8 * Get AuthenticationType
10 * @return int
12 public function GetAuthenticationType() {
13 return $this->objAuth->AuthenticationType;
16 /**
17 * Login a user based on given credentals.
19 * @param string $strUserName
20 * @param string $strPasswordSalt
21 * @param string $strSalt
22 * @return string
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();
29 } else {
30 return false;
34 /**
35 * Logout the logged user.
37 * @return bool
39 public function Logout() {
40 return $this->objAuth->Logout();
43 /**
44 * Clear current Session.
46 * @return string
48 public function ResetSession() {
49 $this->objAuth->ResetSession();
50 return $this->objAuth->SessionGetName();
53 /**
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();
69 /**
70 * Detach given Session.
73 public function DetachSession() {
74 $this->objAuth->Session = null;
75 $this->objAuth->SessionKey = null;
78 /**
79 * Check if Session exists.
81 * @param string $strSessionId
82 * @return bool
84 public function CheckSession($strSessionId) {
85 return $this->objAuth->SessionExists($strSessionId);
88 /**
89 * Check if Session has an assigned User.
91 * @param string $strSessionId
92 * @return bool
94 public function ValidSession($strSessionId) {
95 return $this->objAuth->SessionIsValid($strSessionId);
99 SoapidioAuth::Run('SoapidioAuth', 'http://spidio.sourceforge.net/namespaces/auth');