Commit 4111d47d385d33d101b1a5600623ddae98d2241a
1 parent
ea60a0bc
Exists in
master
and in
111 other branches
use coding conventions (tabs)
Showing
1 changed file
with
54 additions
and
53 deletions
Show diff stats
php/classes/WSUserMgr.php
@@ -2,59 +2,60 @@ | @@ -2,59 +2,60 @@ | ||
2 | /** | 2 | /** |
3 | * @class WSUserMgr | 3 | * @class WSUserMgr |
4 | * @version $Id: WSUserMgr.php 2806 2015-03-02 15:31:05Z natacha $ | 4 | * @version $Id: WSUserMgr.php 2806 2015-03-02 15:31:05Z natacha $ |
5 | - * | 5 | + * |
6 | */ | 6 | */ |
7 | 7 | ||
8 | 8 | ||
9 | - class WSUserMgr extends UserMgr { | ||
10 | - | ||
11 | - protected $isSoap; | ||
12 | - | ||
13 | -/***************************************************************** | ||
14 | -* PUBLIC FUNCTIONS | ||
15 | -*****************************************************************/ | ||
16 | - | ||
17 | - public function init($username,$password,$sessionID,$isSoap) { | ||
18 | - | ||
19 | - $this->user = trim($username); | ||
20 | - $this->sessionID = trim($sessionID); | ||
21 | - $this->passwd = trim($password); | ||
22 | - $this->userWS = USERPATH."/".$this->user."/WS/"; | ||
23 | - $this->userdir = USERPATH."/".$this->user."/"; | ||
24 | - $this->userMissions = $this->getAvailableMissionsByUser(); | ||
25 | - | ||
26 | - chmod($this->userWS,0775); | ||
27 | - if (isset($isSoap)) | ||
28 | - $this->isSoap = $isSoap; | ||
29 | - else $this->isSoap = false; | ||
30 | - | ||
31 | - $this->setPath(); | ||
32 | - | ||
33 | - | ||
34 | - if ($this->ddCheckUser() != 0) { | ||
35 | - if ($this->ddLogin() != 0) { // DD Login if user is not registered | ||
36 | - if ($this->isSoap) throw new SoapFault("server00","Server Error: AMDA Login procedure failed"); | ||
37 | - else return array("error" => "Server Error: AMDA Login procedure failed"); | ||
38 | - } | ||
39 | - | ||
40 | - if ($this->ddCheckUser() != 0) { | ||
41 | - if ($this->isSoap) throw new SoapFault("server01","Server Error: Check User procedure failed"); | ||
42 | - else return array("error" => "Server Error: CheckUser procedure failed"); | ||
43 | - } | ||
44 | - | ||
45 | - } | ||
46 | - return array('success' => true); | ||
47 | - | ||
48 | - } | ||
49 | - | ||
50 | - public function makeUserWS(){ | ||
51 | - $this->makeLocalTree(); | ||
52 | - $this->makeRemoteTree(); | ||
53 | - | ||
54 | - return $sessionID = $this->user; | ||
55 | - | ||
56 | - } | ||
57 | - | ||
58 | - } | ||
59 | - | ||
60 | -?> | 9 | +class WSUserMgr extends UserMgr |
10 | +{ | ||
11 | + | ||
12 | + protected $isSoap; | ||
13 | + | ||
14 | + /***************************************************************** | ||
15 | + * PUBLIC FUNCTIONS | ||
16 | + *****************************************************************/ | ||
17 | + | ||
18 | + public function init($username, $password, $sessionID, $isSoap) | ||
19 | + { | ||
20 | + | ||
21 | + $this->user = trim($username); | ||
22 | + $this->sessionID = trim($sessionID); | ||
23 | + $this->passwd = trim($password); | ||
24 | + $this->userWS = USERPATH . "/" . $this->user . "/WS/"; | ||
25 | + $this->userdir = USERPATH . "/" . $this->user . "/"; | ||
26 | + $this->userMissions = $this->getAvailableMissionsByUser(); | ||
27 | + | ||
28 | + chmod($this->userWS, 0775); | ||
29 | + if (isset($isSoap)) { | ||
30 | + $this->isSoap = $isSoap; | ||
31 | + } else $this->isSoap = false; | ||
32 | + | ||
33 | + $this->setPath(); | ||
34 | + | ||
35 | + | ||
36 | + if ($this->ddCheckUser() != 0) { | ||
37 | + if ($this->ddLogin() != 0) { // DD Login if user is not registered | ||
38 | + if ($this->isSoap) throw new SoapFault("server00", "Server Error: AMDA Login procedure failed"); | ||
39 | + else return array("error" => "Server Error: AMDA Login procedure failed"); | ||
40 | + } | ||
41 | + | ||
42 | + if ($this->ddCheckUser() != 0) { | ||
43 | + if ($this->isSoap) throw new SoapFault("server01", "Server Error: Check User procedure failed"); | ||
44 | + else return array("error" => "Server Error: CheckUser procedure failed"); | ||
45 | + } | ||
46 | + | ||
47 | + } | ||
48 | + return array('success' => true); | ||
49 | + | ||
50 | + } | ||
51 | + | ||
52 | + public function makeUserWS() | ||
53 | + { | ||
54 | + $this->makeLocalTree(); | ||
55 | + $this->makeRemoteTree(); | ||
56 | + | ||
57 | + return $sessionID = $this->user; | ||
58 | + } | ||
59 | +} | ||
60 | + | ||
61 | +?> | ||
61 | \ No newline at end of file | 62 | \ No newline at end of file |