示例#1
0
文件: lib.php 项目: rushi963/moodle
 /**
  * This method parses the $_POST and $_GET superglobals and looks for
  * the following information:
  *  1/ user authentication - username+password or token (wsusername, wspassword and wstoken parameters)
  *
  * @return void
  */
 protected function parse_request()
 {
     // We are going to clean the POST/GET parameters from the parameters specific to the server.
     parent::set_web_service_call_settings();
     // Get GET and POST paramters.
     $methodvariables = array_merge($_GET, $_POST);
     if ($this->authmethod == WEBSERVICE_AUTHMETHOD_USERNAME) {
         //note: some clients have problems with entity encoding :-(
         if (isset($methodvariables['wsusername'])) {
             $this->username = $methodvariables['wsusername'];
         }
         if (isset($methodvariables['wspassword'])) {
             $this->password = $methodvariables['wspassword'];
         }
     } else {
         if (isset($methodvariables['wstoken'])) {
             $this->token = $methodvariables['wstoken'];
         }
     }
 }
示例#2
0
文件: lib.php 项目: vuchannguyen/web
 /**
  * Contructor
  * @param integer $authmethod authentication method - one of WEBSERVICE_AUTHMETHOD_*
  */
 public function __construct($authmethod, $zend_class)
 {
     parent::__construct($authmethod);
     $this->zend_class = $zend_class;
 }