Example #1
0
 /**
  * Factory, instanciate a sender from current context
  * 
  * @return CMS_forms_sender 
  */
 function getSenderForContext()
 {
     //sender does not exists in DB so create a new one*/
     $obj = new CMS_forms_sender();
     $obj->setAttribute('sessionID', Zend_Session::getId());
     if (io::isPositiveInteger(CMS_session::getUserID())) {
         $obj->setAttribute('userID', CMS_session::getUserID());
     }
     $obj->setAttribute('clientIP', @$_SERVER["REMOTE_ADDR"]);
     if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) {
         $obj->setAttribute('languages', @$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
     }
     $obj->setAttribute('userAgent', @$_SERVER["HTTP_USER_AGENT"]);
     return $obj;
 }