isSoap) throw new SoapFault($errorType, $msg); else return array("error" => $msg); } /***************************************************************** * PUBLIC FUNCTIONS *****************************************************************/ public function init($username, $password, $sessionID, $isSoap) { $this->user = trim($username); $this->sessionID = trim($sessionID); $this->passwd = trim($password); $this->isSoap = isset($isSoap); // Check if user has DD session already open, otherwise - login if ($this->ddCheckUser() != 0) { if ($this->ddLogin() != 0) { // DD Login if user is not registered $this->throwError("loginError", "Login procedure failed"); } if ($this->ddCheckUser() != 0) { $this->throwError("loginError", "CheckUser procedure failed"); } } $this->userdir = USERPATH."/".$this->user."/"; if (!is_dir($this->userdir)) { if (!$this->createDir()) { $this->throwError("loginError", "Cannot create UserDir"); } } // $this->userWS = USERPATH . "/" . $this->user . "/WS/"; // chmod($this->userWS, 0775); // $this->userMissions = $this->getAvailableMissionsByUser(); $this->setPath(); return array('success' => true); } public function makeUserWS() { $this->makeLocalTree(); $this->makeRemoteTree(); return $this->user; } } ?>