Beispiel #1
0
 function EnumerateRoles2($paramSet)
 {
     try {
         $this->unitTestParamVm->Execute("Select ParamValue from Params WHERE ParamSet={$paramSet} AND ParamName=\"USER\"");
         $this->arrayParam["USER"] = $this->unitTestParamVm->GetString("ParamValue");
         $this->unitTestParamVm->Execute("Select ParamValue from Params WHERE ParamSet={$paramSet} AND ParamName=\"LOGIN\"");
         $this->arrayParam['LOGIN'] = $this->unitTestParamVm->GetString("ParamValue") . "";
         $this->unitTestParamVm->Execute("Select ParamValue from Params WHERE ParamSet={$paramSet} AND ParamName=\"PASSWORD\"");
         $this->arrayParam['PASSWORD'] = $this->unitTestParamVm->GetString("ParamValue") . "";
         $userInfo = new MgUserInformation();
         $userInfo->SetMgUsernamePassword($this->arrayParam['LOGIN'], $this->arrayParam['PASSWORD']);
         $userInfo->SetLocale("en");
         $site2 = new MgSite();
         $site2->Open($userInfo);
         $collection = $site2->EnumerateRoles($this->arrayParam['USER']);
         $site2->Close();
         return new Result(Utils::MgStringCollectionToString($collection), "text/plain");
     } catch (MgException $e) {
         return new Result(get_class($e), "text/plain");
     } catch (SqliteException $s) {
         return new Result($s->GetExceptionMessage(), "text/plain");
     }
 }