Exemplo n.º 1
0
 public function getRequestParameter($name, $default = null)
 {
     $val = parent::getRequestParameter($name, null);
     if (!is_null($val)) {
         return $val;
     }
     if (isset(self::$shortNames[$name])) {
         $val = parent::getRequestParameter(self::$shortNames[$name], null);
         if (!is_null($val)) {
             return $val;
         }
     }
     return $default;
 }
 protected function getLoggedInUserId()
 {
     if ($this->partner_id) {
         // this part overhere should be in a more generic place - part of the services
         $ks = "";
         // TODO - for now ignore the session
         $valid = true;
         // ( 0 >= kSessionUtils::validateKSession ( $this->partner_id , $this->uid , $this->ks_str ,&$ks ) );
         if ($valid) {
             $puser_id = $this->uid;
             // actually the better user indicator will be placed in the ks - TODO - use it !!
             // $puser_id = $ks->user;
             $kuser_name = $puser_name = $this->getP("user_name");
             if (!$puser_name) {
                 $kuser_name = myPartnerUtils::getPrefix($this->partner_id) . $puser_id;
             }
             // will return the existing one if any, will create is none
             $puser_kuser = PuserKuserPeer::createPuserKuser($this->partner_id, $this->subp_id, $puser_id, $kuser_name, $puser_name, false);
             $likuser_id = $puser_kuser->getKuserId();
             // from now on  - this will be considered the logged in user
             return $likuser_id;
         }
     } else {
         return parent::getLoggedInUserId();
     }
 }