示例#1
0
文件: bmA5.php 项目: NickMitin/P-W
 public function __construct($application, $parameters = array())
 {
     /*FF::AC::MAPPING::{*/
     $this->objectName = 'a5';
     /*FF::AC::MAPPING::}*/
     parent::__construct($application, $parameters);
 }
示例#2
0
 public function __construct($application, $parameters = array())
 {
     $this->map = array_merge($this->map, array('identifier' => array('fieldName' => 'id', 'dataType' => BM_VT_STRING, 'defaultValue' => ''), 'ipAddress' => array('fieldName' => 'ipAddress', 'dataType' => BM_VT_STRING, 'defaultValue' => ''), 'userId' => array('fieldName' => 'userId', 'dataType' => BM_VT_INTEGER, 'defaultValue' => C_DEFAULT_USER_ID), 'userAgent' => array('fieldName' => 'userAgent', 'dataType' => BM_VT_STRING, 'defaultValue' => ''), 'location' => array('fieldName' => 'location', 'dataType' => BM_VT_STRING, 'defaultValue' => ''), 'createTime' => array('fieldName' => 'createTime', 'dataType' => BM_VT_INTEGER, 'defaultValue' => 0), 'lastActivity' => array('fieldName' => 'lastActivity', 'dataType' => BM_VT_INTEGER, 'defaultValue' => 0), 'lastVisit' => array('fieldName' => 'lastVisit', 'dataType' => BM_VT_INTEGER, 'defaultValue' => 0)));
     $load = array_key_exists('load', $parameters);
     $identifier = array_key_exists('identifier', $parameters) ? $parameters['identifier'] : '';
     if ($load && $identifier == '') {
         $parameters['load'] = false;
     }
     parent::__construct($application, $parameters);
     if ($load && $parameters['load']) {
         if ($this->application->errorHandler->getLast() != E_SUCCESS) {
             $sql = "SELECT \n                    `link_user_session`.`userId` AS `userId`,\n                    `link_user_session`.`sessionHash` AS `sessionId`\n                  FROM \n                    `link_user_session`\n                  JOIN \n                    `user` ON (`link_user_session`.`userId` = `user`.`id`)\n                  WHERE \n                    `link_user_session`.`sessionHash` = '" . $this->application->dataLink->formatInput($this->identifier) . "'";
             $oldSession = $this->application->dataLink->getObject($sql);
             if ($oldSession) {
                 $this->userId = intval($oldSession->userId);
                 $this->ipAddress = $this->application->cgi->getIPAddress();
                 $this->createTime = time();
             } else {
                 $this->identifier = md5(uniqid(microtime(true), true));
                 $this->userId = C_DEFAULT_USER_ID;
                 $this->createTime = time();
             }
         }
     } else {
         $this->identifier = md5(uniqid(microtime(true), true));
         $this->userId = C_DEFAULT_USER_ID;
         $this->createTime = time();
     }
     $this->ipAddress = $this->application->cgi->getIPAddress();
     $this->userAgent = $_SERVER['HTTP_USER_AGENT'];
     $this->location = $_SERVER['REQUEST_URI'];
     $this->lastActivity = time();
     $this->application->user = new bmUser($this->application, array('identifier' => $this->properties['userId'], 'load' => true));
 }
示例#3
0
文件: bmUser.php 项目: NickMitin/P-W
 public function __construct($application, $parameters = array())
 {
     /*FF::AC::MAPPING::{*/
     $this->objectName = 'user';
     $this->map = array_merge($this->map, array('email' => array('fieldName' => 'email', 'dataType' => BM_VT_STRING, 'defaultValue' => ''), 'password' => array('fieldName' => 'password', 'dataType' => BM_VT_PASSWORD, 'defaultValue' => ''), 'type' => array('fieldName' => 'type', 'dataType' => BM_VT_INTEGER, 'defaultValue' => 0)));
     /*FF::AC::MAPPING::}*/
     parent::__construct($application, $parameters);
 }
示例#4
0
 public function __construct($application, $parameters)
 {
     $this->map = array_merge($this->map, array('identifier' => array('fieldName' => 'id', 'dataType' => BM_VT_INTEGER, 'defaultValue' => 0), 'passwordHash' => array('fieldName' => 'password', 'dataType' => BM_VT_STRING, 'defaultValue' => ''), 'email' => array('fieldName' => 'email', 'dataType' => BM_VT_STRING, 'defaultValue' => ''), 'homePage' => array('fieldName' => 'homePage', 'dataType' => BM_VT_STRING, 'defaultValue' => ''), 'avatar' => array('fieldName' => 'avatar', 'dataType' => BM_VT_STRING, 'defaultValue' => ''), 'name' => array('fieldName' => 'name', 'dataType' => BM_VT_STRING, 'defaultValue' => ''), 'firstName' => array('fieldName' => 'firstname', 'dataType' => BM_VT_STRING, 'defaultValue' => ''), 'lastName' => array('fieldName' => 'lastname', 'dataType' => BM_VT_STRING, 'defaultValue' => ''), 'birthday' => array('fieldName' => 'birthday', 'dataType' => BM_VT_DATETIME, 'defaultValue' => '0000-01-01 00:00:00'), 'sex' => array('fieldName' => 'sex', 'dataType' => BM_VT_INTEGER, 'defaultValue' => 0), 'offset' => array('fieldName' => 'offset', 'dataType' => BM_VT_INTEGER, 'defaultValue' => 0), 'type' => array('fieldName' => 'type', 'dataType' => BM_VT_INTEGER, 'defaultValue' => 0), 'timeOnline' => array('fieldName' => 'timeOnline', 'dataType' => BM_VT_INTEGER, 'defaultValue' => 0), 'joinDate' => array('fieldName' => 'joinDate', 'dataType' => BM_VT_DATETIME, 'defaultValue' => '0000-00-00 00:00:00'), 'lastActivity' => array('fieldName' => 'lastActivity', 'dataType' => BM_VT_DATETIME, 'defaultValue' => '0000-00-00 00:00:00'), 'lastVisit' => array('fieldName' => 'lastVisit', 'dataType' => BM_VT_DATETIME, 'defaultValue' => '0000-00-00 00:00:00')));
     parent::__construct($application, $parameters);
 }
示例#5
0
 public function __construct($aplication, $parameters = array())
 {
     $this->objectName = 'dataObjectMap';
     $this->map = array('identifier' => array('fieldName' => 'id', 'dataType' => BM_VT_INTEGER, 'defaultValue' => 0), 'name' => array('fieldName' => 'name', 'dataType' => BM_VT_STRING, 'defaultValue' => ''), 'type' => array('fieldName' => 'type', 'dataType' => BM_VT_INTEGER, 'defaultValue' => 0));
     parent::__construct($aplication, $parameters);
 }
示例#6
0
 public function __construct($application, $parameters = array())
 {
     $this->readonly = true;
     parent::__construct($application, $parameters);
 }