Commit 98c5bd4436120f2ac752d1bd7cbf18491b2a7d98

Authored by Benjamin Renard
1 parent 039d19ac

Introduce anonymous user for WS (ie. impex user)

Showing 2 changed files with 12 additions and 12 deletions   Show diff stats
php/WebServices/WebServer.php
... ... @@ -24,7 +24,7 @@ class WebServer
24 24 $this->requestTime = date('Ymd',time());
25 25  
26 26 if (!isset($data)) {
27   - $this->userID = 'impex';
  27 + $this->userID = WSConfigClass::getAnonymousUserName();
28 28 return array('success' => true);
29 29 }
30 30  
... ... @@ -41,7 +41,7 @@ class WebServer
41 41 IHMConfigClass::setUserName($this->userID);
42 42 }
43 43 else {
44   - $this->userID = 'impex';
  44 + $this->userID = WSConfigClass::getAnonymousUserName();
45 45 }
46 46  
47 47 $this->sessionID = $this->userID;
... ... @@ -49,7 +49,7 @@ class WebServer
49 49 if (isset($vars['password']))
50 50 $this->userPWD = $vars['password'];
51 51 else
52   - $this->userPWD = 'impexfp7';
  52 + $this->userPWD = WSConfigClass::getAnonymousUserPwd();
53 53  
54 54 return array('success' => true, 'vars' => $vars);
55 55 }
... ... @@ -116,14 +116,14 @@ class WebServer
116 116 }
117 117  
118 118 /*
119   -* get user TimeTables list; Shared for impex
  119 +* get user TimeTables list; Shared for anonymous user ('impex')
120 120 */
121 121 private function getTimeTablesCatalogsList($object)
122 122 {
123 123 $this->initUserMgr();
124 124 $dom = new DOMDocument("1.0");
125 125  
126   - if ($this->userID == 'impex') {
  126 + if ($this->userID == WSConfigClass::getAnonymousUserName()) {
127 127 $sharedObjMgr = new SharedObjectsMgr();
128 128 if (!@$dom->load($sharedObjMgr->getTreeFilePath()))
129 129 $this->throwError("workspaceError", "Workspace Error : Cannot load Shared TimeTable list");
... ... @@ -337,7 +337,7 @@ error_log($path);
337 337 }
338 338  
339 339 /*
340   -* public data only : user impex
  340 +* public data only : anonymous user (impex)
341 341 */
342 342 public function getObsDataTree()
343 343 {
... ... @@ -455,7 +455,7 @@ error_log("BRE =============================> getParameter");
455 455 }
456 456  
457 457 /*
458   -* get user Catalogs list; Shared for impex
  458 +* get user Catalogs list; Shared for anonymous user (impex)
459 459 */
460 460 public function getCatalogsList($data)
461 461 {
... ... @@ -465,7 +465,7 @@ error_log("BRE =============================> getParameter");
465 465 }
466 466  
467 467 /*
468   -* get user TimeTables list; Shared for impex
  468 +* get user TimeTables list; Shared for anonymous user (impex)
469 469 */
470 470 public function getTimeTablesList($data)
471 471 {
... ... @@ -635,7 +635,7 @@ error_log("BRE =============================> getParameter");
635 635 * TODO Can be done by TTCONVERT function of AMDA_Kernel - more hard !!!
636 636 * TODO Think about this if merge/union will be also done by AMDA_Kernel
637 637 *
638   -* get Time Table : shared for impex ; user' for user
  638 +* get Time Table : shared for anonymous user (impex) ; user' for user
639 639 */
640 640 public function getTimeTable($data)
641 641 {
... ... @@ -649,7 +649,7 @@ error_log("BRE =============================> getParameter");
649 649  
650 650 $ttID = $res['vars']['ttID'];
651 651  
652   - if ($this->userID == 'impex') {
  652 + if ($this->userID == WSConfigClass::getAnonymousUserName()) {
653 653 $sharedObjMgr = new SharedObjectsMgr();
654 654 $ttSrc = $sharedObjMgr->getDataFilePath('timeTable', $ttID);
655 655 }
... ... @@ -764,7 +764,7 @@ error_log("BRE =============================> getParameter");
764 764  
765 765 $resultFilePrefix = strtolower(__FUNCTION__)."_".$mission."_".date("YmdHms",strtotime($vars["startTime"]))."_".date("YmdHms",strtotime($vars["stopTime"]));
766 766  
767   - if ($this->userID != "impex")
  767 + if ($this->userID != WSConfigClass::getAnonymousUserName())
768 768 $resultFilePrefix .= "_".$this->userID;
769 769  
770 770 $dom = new DomDocument("1.0");
... ...
php/classes/AmdaAction.php
... ... @@ -948,7 +948,7 @@ class AmdaAction
948 948 return array('success' => false, 'message' => 'ddLogin error: '.$res);
949 949 }
950 950  
951   - if ($dd->user == 'impex')
  951 + if ($dd->user == WSConfigClass::getAnonymousUserName())
952 952 {
953 953 //if ($dd->getWsSize() > DISK_QUOTA * 100)
954 954 // error_log('Natacha! It is time to CLEAN UP IMPEX WS!',1,'nbourrel@irap.omp.eu');
... ...